Optionaloptions: ContractManagerOptionsGet a typed contract handle.
Each method on the returned object has .query() for read-only calls
and .tx() for signed transactions. When codegen augments
Contracts, passing a known library name returns a fully-typed
handle. Without codegen the generic overload still works — methods are
accessible but untyped.
Get a typed contract handle.
Each method on the returned object has .query() for read-only calls
and .tx() for signed transactions. When codegen augments
Contracts, passing a known library name returns a fully-typed
handle. Without codegen the generic overload still works — methods are
accessible but untyped.
Update the default origin, signer, or signerManager used by all contract handles.
StaticfromCreate a ContractManager from a raw PolkadotClient.
Convenience factory that creates the InkSdk internally via dynamic import
of @polkadot-api/sdk-ink. The ~4 MB sdk-ink metadata is loaded lazily
only when this method is called.
For size-sensitive apps, prefer the constructor with a pre-created InkSdk
to control exactly when @polkadot-api/sdk-ink is loaded.
The CDM manifest.
A PolkadotClient for the chain where contracts are deployed (e.g., client.raw.assetHub).
Optionaloptions: ContractManagerOptionsOptional configuration (signerManager, defaults).
import { createChainClient } from "@polkadot-apps/chain-client";
import { paseo_asset_hub } from "@polkadot-apps/descriptors/paseo-asset-hub";
import { ContractManager } from "@polkadot-apps/contracts";
const client = await createChainClient({
chains: { assetHub: paseo_asset_hub },
rpcs: { assetHub: ["wss://sys.ibp.network/asset-hub-paseo"] },
});
const manager = await ContractManager.fromClient(cdmJson, client.raw.assetHub, {
signerManager,
});
Manages typed contract interactions backed by a
cdm.jsonmanifest.Pass a
signerManager(e.g. aSignerManagerfrom@polkadot-apps/signer) so the currently logged-in account is used automatically — no manual signer/origin wiring needed.Example