Polkadot Apps
    Preparing search index...

    Type Alias ChainClient<TChains>

    ChainClient: { [K in string & keyof TChains]: TypedApi<TChains[K]> } & {
        destroy: () => void;
        raw: { [K in string & keyof TChains]: PolkadotClient };
    }

    A connected chain client returned by createChainClient or getChainAPI.

    Each key from your config maps to a fully-typed PAPI TypedApi. Access raw PolkadotClient instances via .raw for advanced use cases like creating an InkSdk for contract interactions.

    Type Parameters

    • TChains extends Record<string, ChainDefinition>

      The chain descriptor record used to create this client.

    Type Declaration

    • destroy: () => void

      Destroy all connections managed by this client.

    • raw: { [K in string & keyof TChains]: PolkadotClient }

      Raw PolkadotClient instances, keyed by chain name. Use for advanced APIs like createInkSdk.

    // Typed API access — fully typed from your descriptors
    const account = await client.assetHub.query.System.Account.getValue(addr);

    // Raw client for advanced use (e.g., InkSdk for contracts)
    import { createInkSdk } from "@polkadot-api/sdk-ink";
    const inkSdk = createInkSdk(client.raw.assetHub, { atBest: true });