npm.io
14.3.4 • Published 2d ago

@paraspell/pallets

Licence
MIT
Version
14.3.4
Deps
1
Size
34 kB
Vulns
0
Weekly
0
Stars
58



@paraspell/pallets

Pallet queries for Polkadot, Kusama, Paseo and Westend ecosystems.

version downloads build





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 developers to query the XCM pallets that Parachains currently support.

Implementation

Install package
npm install | pnpm add | yarn add @paraspell/pallets
Import functionality

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

import { getDefaultPallet, getSupportedPallets, getPalletIndex, SUPPORTED_PALLETS, getNativeAssetsPallet, getOtherAssetsPallets } from  '@paraspell/pallets'
Get default XCM pallet

The function returns the default XCM pallet for selected compatible Parachain.

getDefaultPallet(chain: TChain)
Get all supported XCM pallets

The function returns all supported XCM pallets for selected compatible Parachain.

getSupportedPallets(chain: TChain)
Get index of XCM Pallet

The function returns all index of XCM Pallet for selected Parachain.

getPalletIndex(chain: TChain)
Print all supported XCM pallets

This returns all supported XCM pallets supported by compatible Parachains as constant.

console.log(SUPPORTED_PALLETS)
Print local pallets for native assets

Following function returns all pallets for local transfers of native assets for specific chain.

getNativeAssetsPallet(chain: TChain)
Print local pallets for foreign assets

Following function returns all pallets for local transfers of foreign assets for specific chain.

getOtherAssetsPallets(chain: TChain)

Tests

  • Run compilation using pnpm compile

  • Run linter using pnpm lint

  • Run unit tests using pnpm test

  • Update XCM pallets in the map using script - pnpm updatePallets

Pallet queries can be tested in XCM 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

Shows a black logo in light color mode and a white one in dark color mode.