Asset Hub - Polkadot's Native Asset Management Parachain
Chain RPC
With Dwellir, you get access to our global Chain network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.
Why Build on Asset Hub?
Asset Hub is Polkadot's native system parachain designed for efficient asset creation, management, and transfers. As a core infrastructure parachain, Asset Hub provides low-cost asset operations and seamless integration with the broader Polkadot ecosystem.
🏦 Native Asset Management
- Asset creation - Mint fungible and non-fungible tokens natively
- Low transaction costs - Optimized for high-frequency asset operations
- Cross-chain transfers - Seamless XCM integration with all parachains
- DOT integration - Native support for Polkadot's main token
🌐 Multi-Network Support
- Polkadot Asset Hub - Main network for production applications
- Kusama Asset Hub - Canary network for testing and experimentation
- Westend Asset Hub - Test network for development and staging
⚡ Performance & Efficiency
- Fast finality - ~6 second block times with instant finality
- Minimal fees - Optimized for micro-transactions and asset operations
- Substrate runtime - Built on battle-tested Polkadot technology
- XCM native - First-class cross-chain messaging support
Quick Start with Asset Hub
Connect to Asset Hub networks with Dwellir's reliable endpoints:
🔗 RPC Endpoints
https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY
Quick Connect:
curl -X POST https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
This documentation applies to all Asset Hub networks:
- Asset Hub Polkadot: Production network (
https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY
) - Asset Hub Kusama: Canary network (
https://api-asset-hub-kusama.n.dwellir.com/YOUR_API_KEY
) - Asset Hub Westend: Test network (
https://api-asset-hub-westend.n.dwellir.com/YOUR_API_KEY
)
Installation & Setup
- Polkadot.js
- Substrate API
- Python (py-substrate-interface)
- Direct JSON-RPC
import { ApiPromise, WsProvider } from '@polkadot/api';
// Connect to Asset Hub Polkadot
const provider = new WsProvider('wss://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
// Verify connection
const chain = await api.rpc.system.chain();
const version = await api.rpc.system.version();
console.log(`Connected to ${chain} v${version}`);
// Get the latest block
const hash = await api.rpc.chain.getFinalizedHead();
const block = await api.rpc.chain.getBlock(hash);
console.log(`Latest block: #${block.block.header.number}`);
// Query account balance
const account = 'ACCOUNT_ADDRESS';
const balance = await api.query.system.account(account);
console.log(`Free balance: ${balance.data.free.toString()}`);
import { createClient } from '@substrate/api';
// Connect to Asset Hub
const client = createClient({
chainSpec: {
genesisHash: '0x68d56f15f85d3136970ec16946040bc1752654e906147f7e43e9d539d7c3de2f',
rpcUrls: ['https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY']
}
});
// Query chain information
const chainInfo = await client.getChainHead();
console.log('Current head:', chainInfo.hash);
// Get asset information
const assetId = 1000; // USDT on Asset Hub
const assetDetails = await client.query({
type: 'assets',
method: 'asset',
args: [assetId]
});
from substrateinterface import SubstrateInterface
# Connect to Asset Hub Polkadot
substrate = SubstrateInterface(
url="wss://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY"
)
# Get chain information
chain_name = substrate.rpc_request("system_chain", [])
print(f"Connected to: {chain_name['result']}")
# Query account balance
account_info = substrate.query(
module='System',
storage_function='Account',
params=['ACCOUNT_ADDRESS']
)
print(f"Free balance: {account_info['data']['free']}")
# Query asset details
asset_id = 1000 # USDT
asset_details = substrate.query(
module='Assets',
storage_function='Asset',
params=[asset_id]
)
if asset_details:
print(f"Asset name: {asset_details['name']}")
print(f"Asset symbol: {asset_details['symbol']}")
print(f"Decimals: {asset_details['decimals']}")
# Get chain information
curl -X POST https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system_chain",
"params": [],
"id": 1
}'
# Get latest finalized block
curl -X POST https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "chain_getFinalizedHead",
"params": [],
"id": 1
}'
# Query account balance
curl -X POST https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "state_getStorage",
"params": ["0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9"],
"id": 1
}'
Network Information
Genesis Hash
0x68d56f15...
Polkadot Asset HubBlock Time
6 seconds
Instant finalityNative Token
DOT
Polkadot tokenParachain ID
1000
System parachain- Polkadot Asset Hub Parachain ID: 1000
- Kusama Asset Hub Parachain ID: 1000
- Westend Asset Hub Parachain ID: 1000
- Native Token: DOT (Polkadot), KSM (Kusama), WND (Westend)
- Consensus: Nominated Proof of Stake (via Relay Chain)
- Finality: Instant (via GRANDPA finality gadget)
Core Features
🪙 Asset Management
Create and manage fungible assets with native support:
// Create a new asset
const createAsset = async (api, signer, assetId, admin, minBalance) => {
const tx = api.tx.assets.create(assetId, admin, minBalance);
const hash = await tx.signAndSend(signer);
return hash;
};
// Set asset metadata
const setMetadata = async (api, signer, assetId, name, symbol, decimals) => {
const tx = api.tx.assets.setMetadata(assetId, name, symbol, decimals);
const hash = await tx.signAndSend(signer);
return hash;
};
// Mint assets
const mintAsset = async (api, signer, assetId, beneficiary, amount) => {
const tx = api.tx.assets.mint(assetId, beneficiary, amount);
const hash = await tx.signAndSend(signer);
return hash;
};
🎨 NFT Support
Work with non-fungible tokens using the Uniques pallet:
// Create an NFT collection
const createCollection = async (api, signer, collectionId, admin) => {
const tx = api.tx.uniques.create(collectionId, admin);
const hash = await tx.signAndSend(signer);
return hash;
};
// Mint an NFT
const mintNFT = async (api, signer, collectionId, itemId, owner) => {
const tx = api.tx.uniques.mint(collectionId, itemId, owner);
const hash = await tx.signAndSend(signer);
return hash;
};
// Set NFT metadata
const setNFTMetadata = async (api, signer, collectionId, itemId, data) => {
const tx = api.tx.uniques.setMetadata(collectionId, itemId, data, false);
const hash = await tx.signAndSend(signer);
return hash;
};
🌉 Cross-Chain Transfers (XCM)
Send assets across the Polkadot ecosystem:
// Transfer DOT to another parachain
const xcmTransfer = async (api, signer, dest, beneficiary, amount) => {
const destination = {
V3: {
parents: 1,
interior: {
X1: {
Parachain: dest // Destination parachain ID
}
}
}
};
const account = {
V3: {
parents: 0,
interior: {
X1: {
AccountId32: {
network: null,
id: beneficiary
}
}
}
}
};
const assets = {
V3: [
{
id: {
Concrete: {
parents: 1,
interior: 'Here'
}
},
fun: {
Fungible: amount
}
}
]
};
const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(
destination,
account,
assets,
0,
'Unlimited'
);
const hash = await tx.signAndSend(signer);
return hash;
};
Common Integration Patterns
🔄 Multi-Asset Wallet
Build wallets supporting multiple Asset Hub tokens:
class AssetHubWallet {
constructor(api, address) {
this.api = api;
this.address = address;
}
async getAllBalances() {
const balances = {};
// Get DOT balance
const account = await this.api.query.system.account(this.address);
balances.DOT = {
free: account.data.free.toString(),
reserved: account.data.reserved.toString(),
symbol: 'DOT',
decimals: 10
};
// Get asset balances
const assets = await this.api.query.assets.account.entries(this.address);
for (const [key, balance] of assets) {
const assetId = key.args[0].toString();
const metadata = await this.api.query.assets.metadata(assetId);
balances[metadata.symbol.toString()] = {
free: balance.unwrap().balance.toString(),
assetId,
symbol: metadata.symbol.toString(),
decimals: metadata.decimals.toNumber()
};
}
return balances;
}
async transferAsset(assetId, recipient, amount) {
let tx;
if (assetId === 'DOT') {
// Native DOT transfer
tx = this.api.tx.balances.transferKeepAlive(recipient, amount);
} else {
// Asset transfer
tx = this.api.tx.assets.transferKeepAlive(assetId, recipient, amount);
}
return tx;
}
}
📊 Asset Analytics
Track asset metrics and usage:
class AssetAnalytics {
constructor(api) {
this.api = api;
}
async getAssetInfo(assetId) {
const [details, metadata] = await Promise.all([
this.api.query.assets.asset(assetId),
this.api.query.assets.metadata(assetId)
]);
if (details.isNone) {
throw new Error(`Asset ${assetId} not found`);
}
const assetDetails = details.unwrap();
return {
id: assetId,
name: metadata.name.toString(),
symbol: metadata.symbol.toString(),
decimals: metadata.decimals.toNumber(),
supply: assetDetails.supply.toString(),
accounts: assetDetails.accounts.toNumber(),
sufficients: assetDetails.sufficients.toNumber(),
owner: assetDetails.owner.toString(),
issuer: assetDetails.issuer.toString(),
admin: assetDetails.admin.toString(),
freezer: assetDetails.freezer.toString(),
minBalance: assetDetails.minBalance.toString(),
isSufficient: assetDetails.isSufficient.toBoolean()
};
}
async getTopAssets(limit = 10) {
const assets = [];
// Get all assets
const assetEntries = await this.api.query.assets.asset.entries();
for (const [key, details] of assetEntries) {
const assetId = key.args[0].toString();
const metadata = await this.api.query.assets.metadata(assetId);
assets.push({
id: assetId,
symbol: metadata.symbol.toString(),
supply: details.unwrap().supply.toString(),
accounts: details.unwrap().accounts.toNumber()
});
}
// Sort by number of accounts (popularity)
return assets
.sort((a, b) => b.accounts - a.accounts)
.slice(0, limit);
}
}
🔍 NFT Marketplace Integration
Integrate with NFT collections:
class NFTCollection {
constructor(api, collectionId) {
this.api = api;
this.collectionId = collectionId;
}
async getCollectionInfo() {
const [details, metadata] = await Promise.all([
this.api.query.uniques.class(this.collectionId),
this.api.query.uniques.classMetadataOf(this.collectionId)
]);
return {
id: this.collectionId,
owner: details.unwrap().owner.toString(),
issuer: details.unwrap().issuer.toString(),
admin: details.unwrap().admin.toString(),
freezer: details.unwrap().freezer.toString(),
totalDeposit: details.unwrap().totalDeposit.toString(),
freeHolding: details.unwrap().freeHolding.toBoolean(),
instances: details.unwrap().instances.toNumber(),
instanceMetadatas: details.unwrap().instanceMetadatas.toNumber(),
attributes: details.unwrap().attributes.toNumber(),
isFrozen: details.unwrap().isFrozen.toBoolean(),
metadata: metadata.isSome ? metadata.unwrap().data.toString() : null
};
}
async getAllItems() {
const items = [];
const itemEntries = await this.api.query.uniques.asset.entries();
for (const [key, details] of itemEntries) {
const [collectionId, itemId] = key.args;
if (collectionId.toString() === this.collectionId.toString()) {
const metadata = await this.api.query.uniques.instanceMetadataOf(
collectionId,
itemId
);
items.push({
collectionId: collectionId.toString(),
itemId: itemId.toString(),
owner: details.unwrap().owner.toString(),
approved: details.unwrap().approved.isSome
? details.unwrap().approved.unwrap().toString()
: null,
isFrozen: details.unwrap().isFrozen.toBoolean(),
deposit: details.unwrap().deposit.toString(),
metadata: metadata.isSome ? metadata.unwrap().data.toString() : null
});
}
}
return items;
}
}
Performance Optimization
1. Efficient State Queries
Batch multiple queries for better performance:
async function batchQueries(api, queries) {
const results = await Promise.all(queries.map(query => {
if (query.type === 'storage') {
return api.query[query.module][query.method](...query.args);
} else if (query.type === 'rpc') {
return api.rpc[query.module][query.method](...query.args);
}
}));
return results;
}
// Example usage
const queries = [
{ type: 'storage', module: 'system', method: 'account', args: [address] },
{ type: 'storage', module: 'assets', method: 'asset', args: [1000] },
{ type: 'rpc', module: 'chain', method: 'getFinalizedHead', args: [] }
];
const [account, asset, head] = await batchQueries(api, queries);
2. Event Subscription
Monitor blockchain events efficiently:
async function subscribeToAssetEvents(api, callback) {
const unsubscribe = await api.query.system.events((events) => {
events.forEach((record) => {
const { event } = record;
if (api.events.assets.Transferred.is(event)) {
const [assetId, from, to, amount] = event.data;
callback({
type: 'AssetTransferred',
assetId: assetId.toString(),
from: from.toString(),
to: to.toString(),
amount: amount.toString()
});
} else if (api.events.assets.Created.is(event)) {
const [assetId, creator, owner] = event.data;
callback({
type: 'AssetCreated',
assetId: assetId.toString(),
creator: creator.toString(),
owner: owner.toString()
});
}
});
});
return unsubscribe;
}
Developer Resources
🔗 Official Resources
🛠 Developer Tools
- Polkadot.js Apps - Web interface for Asset Hub
- Polkadot.js API - JavaScript SDK
- Subxt - Rust SDK for Substrate chains
- py-substrate-interface - Python SDK
🌐 Block Explorers
- Polkadot.js Apps Explorer
- Subscan Asset Hub
- Polkaholic - Multi-chain explorer
💡 Example Projects
Need Help?
- 📧 Email: support@dwellir.com
- 📚 Polkadot Wiki: wiki.polkadot.network
- 🎯 Dashboard: dashboard.dwellir.com
- 💬 Community: Polkadot Discord
Build the future of cross-chain asset management on Asset Hub with Dwellir's reliable infrastructure. Get your API key →