API Reference

Complete API reference for OneKey's Conflux provider

Complete reference for OneKey's Conflux provider methods and types.


Methods

Method
Description

request({ method, params })

Send JSON-RPC request

isConnected()

Check connection status

on(event, callback)

Subscribe to events

off(event, callback)

Unsubscribe from events


RPC Methods

Method
Description

cfx_requestAccounts

Request connection

cfx_accounts

Get connected accounts

cfx_chainId

Get chain ID

cfx_sendTransaction

Send transaction

cfx_call

Call contract (read-only)

cfx_estimateGasAndCollateral

Estimate gas

cfx_getBalance

Get account balance

cfx_getTransactionByHash

Get transaction

cfx_getTransactionReceipt

Get receipt

net_version

Get network ID


Events

Event
Parameters
Description

connect

{ chainId, networkId }

Connected to network

disconnect

-

Disconnected

chainChanged

chainId

Network changed

accountsChanged

accounts[]

Accounts changed


Deprecated Methods

These methods still work but are deprecated:


Error Codes

Code
Description

4001

User rejected request

-32700

Parse error

-32600

Invalid request

-32601

Method not found

-32602

Invalid params

-32603

Internal error

Last updated

Was this helpful?