useink/chains is an extension of useink that provides hundreds of chain configurations. Configurations are necessary to set up core useink React hooks and display user-facing content. They contain RPC urls, links to block explorers, official websites, and metadata QR codes, and contain native token information, and more.
It is important to note that most of these chains do not implement pallet-contracts, and therefore do not support ink! contracts, but many of the features in useink are compatible with all of these chains. We have added them here for convenience. In addition, many chains are in the process of adding pallet-contracts as they adopt the hybrid chain design, so we expect more and more compatibility with the useink library in the near future.
Set moduleResolution to nodenext or bundler inside of your tsconfig.json. This feature allows your application to discover the useink/chains import paths defined in the useinkpackage.json.
{
"compilerOptions": {
"moduleResolution": "nodenext", // or `bundler`
}
}
You can now import any of the chain configurations in useink/chains.
// Example
import { RococoContractsTestnet, ShibuyaTestnet } from 'useink/chains';
interface Chain {
id: ChainId; // See https://use.ink/frontend/chains/chain-id for a list of all possible values.
name: string;
account: '*25519' | 'secp256k1' | 'Sr25519';
subscanUrl?: string;
overrideNativeTokenId?: string;
chainspecQrUrl?: string;
latestMetadataQrUrl?: string;
rpcs: readonly `ws://${string}` | `wss://${string}`[];
coingeckoId?: string | null;
paraId?: number;
relay?: {
id: string;
};
balanceModuleConfigs?: {
[k: string]: {
disable?: boolean;
tokens?: readonly (Token | TokenAsset)[];
};
};
}
interface Token {
symbol: string;
decimals: number;
// existentialDeposit is the minimum amount an account must hold to stay alive.
// Balances held below this amount will be removed from storage
existentialDeposit: string;
// onChainId is the ID for a token in the pallet
onChainId: string | number;
coingeckoId?: string;
}
interface TokenAsset {
assetId: string | number;
symbol: string;
coingeckoId?: string;
}