Skip to main content

API Notes

This guide lists the UKey Wallet Polkadot Provider's methods, types, and support chains. Before calling the signature method, please complete authorization through web3Enable and confirm that the account belongs to the target network.


Methods

MethodDetails
web3Enable(dappName)Enable extensions for dApps
web3Accounts(anyType?)Get all accounts
web3AccountsSubscribe(callback)Subscribe to account changes
web3SignPayload(payload)Signature transaction payload
web3SignRaw(payload)Sign original message
web3RpcSend(request)Send RPC request
web3RpcSubscribe(request, callback)Subscribe to RPC events
web3RpcUnSubscribe()Cancel all subscriptions
web3RpcListProviders()List RPC providers
web3RpcStartProvider(key)Start a specific provider

Types

Inject account

interface InjectedAccount {
address: string; // Note: Substrate address
name?: string; // Note: Account name
type?: "sr25519" | "ed25519" | "ecdsa";
genesisHash?: string; // Chain restriction when needed
}

Signer Payload JSON

interface SignerPayloadJSON {
address: string;
blockHash: string;
blockNumber: string;
era: string;
genesisHash: string;
method: string;
nonce: string;
specVersion: string;
tip: string;
transactionVersion: string;
signedExtensions: string[];
version: number;
}

Signed by Payload Raw

interface SignerPayloadRaw {
address: string;
data: string; // Note: Hexadecimal encoded data
type: "bytes" | "payload";
}

Signature result

interface SignerResult {
id: number;
signature: string; // Note: Hexadecimal signature
}

Chain List

NetworkDetails
PolkadotPrimary relay network
KusamaExperimental canary network
AcalaDeFi-focused network
MoonbeamEVM-ready network
AstarSmart-contract focused network
Any SubstrateUser-defined chain