npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@paraspell/assets

v12.1.1

Published

Assets for ParaSpell XCM/XCMP tool for developers

Readme

Information

This package serves as a core component for both @paraspell/sdk and @paraspell/sdk-pjs and is automatically installed as a dependency. The package on its own offers functionality that can be imported separately and be used in front-end applications. It allows to retrieve asset data from compatible Parachains. Users can retrieve details like asset decimals, registered assets on particular Parachain, check if the asset is registered on Parachain and more.

Implementation

Install package

pnpm | npm install || yarn add @paraspell/assets

Import functionality

To use this functionality you first have to import it in the following way.

import { getSupportedDestinations, getSupportedAssets, getFeeAssets, getAssetsObject, getAssetId, getRelayChainSymbol, getNativeAssets, getNativeAssets, getOtherAssets, getAllAssetsSymbols, hasSupportForAsset, getAssetDecimals, getParaId, getTChain, getAssetLocation, TParachain, TRelaychain, TSubstrateChain, TExternalChain, TChain, findAssetInfo, findAssetInfoOrThrow } from  '@paraspell/assets'

Query assets object

This function returns assets object from assets.json for particular Parachain including information about native and foreign assets. Function uses TChain types.

getAssetsObject(TChain)

Query asset ID

This function returns assetId for particular Parachain and asset symbol. Function uses TChain types.

getAssetId(TChain, ASSET_SYMBOL)

Query Relay chain asset symbol

This function returns the symbol of the Relay chain for a particular Parachain. Either DOT or KSM or WND or PAS. Function uses TChain types.

getRelayChainSymbol(TChain)

Query native assets

This function returns a string array of native assets symbols for a particular Parachain. Function uses TChain types.

getNativeAssets(TChain)

Query foreign assets

This function returns an object array of foreign assets for a particular Parachain. Each object has a symbol and assetId property. Function uses TChain types.

getOtherAssets(TChain)

Query all asset symbols

Function returns string array of all asset symbols for a specific Parachain. (native and foreign assets are merged into a single array). Function uses TChain types.

getAllAssetsSymbols(TChain)

Query asset support

The function checks if Parachain supports a particular asset. (Both native and foreign assets are searched). Returns boolean. Function uses TChain types.

hasSupportForAsset(TChain, ASSET_SYMBOL)

Query asset decimals

The function returns decimals for a specific asset. Function uses TChain types.

getAssetDecimals(TChain, ASSET_SYMBOL)

Query Parachain ID

The function returns specific Parachain id. Function uses TChain types.

getParaId(TChain)

### Query asset data and support for specific chain I Find out whether asset is registered on chain and return its entire parameters. If not found, returns null. Function uses TChain types.

findAssetInfo(TChain, ASSET_SYMBOL/*, DESTINATION?*/)

### Query asset data and support for specific chain II Find out whether asset is registered on chain and return its entire parameters. If not found, returns error. Function uses TChain types.

findAssetInfoOrThrow(TChain, ASSET_SYMBOL/*, DESTINATION?*/)

Query Parachain name

Function to get specific TChain from Parachain id.

getTChain(chainID: number, ecosystem: 'Polkadot' | 'Kusama' | 'Ethereum' | 'Paseo' | 'Westend') //When Ethereum ecosystem is selected please fill chainID as 1 to select Ethereum.

Import chains as types

There are 5 options for types you can choose based on your prefference

// Export all Parachains
console.log(TParachain)

// Export all Relay chains
console.log(TRelaychain)

// Export all Substrate chains (Parachains + Relays)
console.log(TSubstrateChain)

// Export chains outside Polkadot ecosystem (Ethereum)
console.log(TExternalChain)

// Export all chains implemented in ParaSpell
console.log(TChain)

Import chains as constant

There are 5 options for constants you can choose based on your prefference

// Export all Parachains
console.log(PARACHAINS)

// Export all Relay chains
console.log(RELAYCHAINS)

// Export all Substrate chains (Parachains + Relays)
console.log(SUBSTRATE_CHAINS)

// Export chains outside Polkadot ecosystem (Ethereum)
console.log(EXTERNAL_CHAINS)

// Export all chains implemented in ParaSpell
console.log(CHAINS)

Convert id or symbol to location

Get location for asset id or symbol. Function uses TChain types.

getAssetLocation(TChain, { symbol: symbol } | { id: assetId })

💻 Tests

  • Run compilation using pnpm compile

  • Run linter using pnpm lint

  • Run unit tests using pnpm test

  • Update Parachain registered assets in the map using script - pnpm updateAssets

  • Update existential deposits in the map using script - pnpm updateEds

Assets can be tested in Playground.

Contribute to XCM Tools and earn rewards 💰

We run an open Bug Bounty Program that rewards contributors for reporting and fixing bugs in the project. More information on bug bounty can be found in the official documentation.

Get Support 🚑

License

Made with 💛 by ParaSpell✨

Published under MIT License.

Supported by