Docs

Asset Hub - Polkadot Asset Management

Complete guide to Asset Hub Polkadot integration with Dwellir RPC. Access native asset management, NFT functionality, and efficient cross-chain transfers on Polkadot's system parachain.

Asset Hub RPC

With Dwellir, you get access to our global Asset Hub network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.

Get your API key

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
  • Paseo Asset Hub - Community-operated testnet tracking Polkadot releases
  • Polkadot Sidecar - Managed Sidecar API surface for REST-friendly data access

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:

Asset Hub RPC Endpoints
HTTPS
WSS
curl -sS -X POST https://api-asset-hub-polkadot.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots> \  -H 'Content-Type: application/json' \  -d '{"jsonrpc":"2.0","method":"chain_getBlockHash","params":[0],"id":1}'
import { ApiPromise, WsProvider } from '@polkadot/api';const provider = new WsProvider('wss://api-asset-hub-polkadot.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>');const api = await ApiPromise.create({ provider });const hash = await api.rpc.chain.getBlockHash(0);console.log(hash.toHex());
from substrateinterface import SubstrateInterfacesubstrate = SubstrateInterface(url='wss://api-asset-hub-polkadot.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>')block_hash = substrate.get_block_hash(block_id=0)print(block_hash)
package mainimport (  "bytes"  "fmt"  "io"  "net/http")func main() {  url := "https://api-asset-hub-polkadot.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>"  payload := []byte(`{"jsonrpc":"2.0","id":1,"method":"chain_getBlockHash","params":[0]}`)  resp, err := http.Post(url, "application/json",    bytes.NewBuffer(payload))  if err != nil { panic(err) }  defer resp.Body.Close()  body, _ := io.ReadAll(resp.Body)  fmt.Println(string(body))}

Multi-Network Support

Dwellir serves Asset Hub across every public Polkadot environment:

  • Asset Hub Polkadotwss://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY
  • Asset Hub Kusamawss://api-asset-hub-kusama.n.dwellir.com/YOUR_API_KEY
  • Asset Hub Westendhttps://api-asset-hub-westend.n.dwellir.com/YOUR_API_KEY
  • Asset Hub Paseohttps://api-asset-hub-paseo.n.dwellir.com/YOUR_API_KEY
  • Polkadot Sidecarhttps://api-asset-hub-polkadot-sidecar.n.dwellir.com/YOUR_API_KEY

The Sidecar tab exposes a managed Polkadot Sidecar deployment so you can issue REST requests (for example /accounts or /blocks) without running additional infrastructure.

Installation & Setup

Bash
# 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
  }'
TypeScript
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()}`);
TypeScript
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]
});
Python
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']}")

Network Information

ParameterValueDetails
Genesis Hash0x68d56f15...Polkadot Asset Hub
Block Time6 secondsInstant finality
Native TokenDOTPolkadot token
Parachain ID1000System parachain

Network Details

ParameterValueDetails
Polkadot Asset Hub Parachain ID1000
Kusama Asset Hub Parachain ID1000
Westend Asset Hub Parachain ID1000
Native TokenDOT (Polkadot), KSM (Kusama), WND (Westend)
ConsensusNominated Proof of Stake (via Relay Chain)
FinalityInstant (via GRANDPA finality gadget)

Core Features

Asset Management

Create and manage fungible assets with native support:

TypeScript
// 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:

TypeScript
// 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:

TypeScript
// 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:

TypeScript
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:

TypeScript
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:

TypeScript
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:

TypeScript
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:

TypeScript
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

Block Explorers

Example Projects

Need Help?


Build the future of cross-chain asset management on Asset Hub with Dwellir's reliable infrastructure. Get your API key