Polkadot

Polkadot integration via OneKey's Polkadot.js-compatible provider

Integrate Polkadot and Substrate-based chains using OneKey's provider. Access via window.$onekey.polkadot or the Polkadot.js extension API.

OneKey implements the Polkadot.js extension interface, ensuring compatibility with all Substrate dApps.



Provider Detection

// OneKey registers as a Polkadot.js extension
const provider = window.$onekey?.polkadot

// Or use the standard web3Enable API

Quick Start

Enable Extension


Account Management

Get Accounts

Subscribe to Account Changes


Signing

Sign Transaction Payload

Sign extrinsic payloads:

Sign Raw Message


Using with Polkadot.js API

Setup

Connect and Sign Transaction

Listen for Transaction Events


RPC Methods

Send RPC Request

Subscribe to RPC Events

List Available Providers


API Reference

Methods

Method
Description

web3Enable(dappName)

Enable extension for dApp

web3Accounts(anyType?)

Get all accounts

web3AccountsSubscribe(callback)

Subscribe to account changes

web3SignPayload(payload)

Sign transaction payload

web3SignRaw(payload)

Sign raw message

web3RpcSend(request)

Send RPC request

web3RpcSubscribe(request, callback)

Subscribe to RPC events

web3RpcUnSubscribe()

Unsubscribe from all

web3RpcListProviders()

List RPC providers

web3RpcStartProvider(key)

Start specific provider

Types

Supported Chains

Chain
Description

Polkadot

Main relay chain

Kusama

Canary network

Acala

DeFi hub

Moonbeam

EVM-compatible

Astar

Smart contract platform

Any Substrate

Custom chains


Error Handling


Using with React

Last updated

Was this helpful?