Query which XCM pallet Parachain uses π¦ β
This functionality allows developers to query the XCM pallets that Parachains currently support.
Getting Started β
You have two options for using presented functionality. Either you install it as standalone package or you can use it by directly importing it from XCM SDK (If you have it installed already).
Standalone Pallet Package β
You do not need to have XCM SDK installed for following functionality. You can also install it as standalone and use it separately. Good approach for vanilla projects.
Choose your package manager:
pnpm add @paraspell/palletsImport all of the functionality:
import {
getDefaultPallet,
getSupportedPallets,
getPalletIndex,
SUPPORTED_PALLETS,
getNativeAssetsPallet,
getOtherAssetsPallets
} from '@paraspell/pallets'Already using XCM SDK β
The pallet package is included with the XCM SDK. If you already have the XCM SDK installed, you can directly import the functionality:
import {
getDefaultPallet,
getSupportedPallets,
getPalletIndex,
SUPPORTED_PALLETS,
getNativeAssetsPallet,
getOtherAssetsPallets
} from '@paraspell/sdk'Get default XCM pallet β
The function returns the default XCM pallet for selected compatible Parachain. Function uses TChain types.
getDefaultPallet(chain: TChain)Example output:
"XTokens"Get all supported XCM pallets β
The function returns all supported XCM pallets for selected compatible Parachain. Function uses TChain types.
getSupportedPallets(chain: TChain)Example output:
[
"PolkadotXcm",
"XTokens"
]Get index of XCM Pallet β
The function returns all index of XCM Pallet for selected Parachain. Function uses TChain types.
getPalletIndex(chain: TChain)Example output:
54Print 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. Function uses TChain types.
getNativeAssetsPallet(chain: TChain)Print local pallets for foreign assets β
Following function returns all pallets for local transfers of foreign assets for specific chain. Function uses TChain types.
getOtherAssetsPallets(chain: TChain)