Skip to Content
dApps

API Reference

Reference for OneKey’s Cardano provider methods and types.


Wallet Interface (CIP-30)

Property/MethodDescription
nameWallet name (‘OneKey’)
iconWallet icon URL
apiVersionAPI version
isEnabled()Check if enabled
enable()Request wallet access

dApp API (after enable)

MethodDescription
getNetworkId()Get network (0=testnet, 1=mainnet)
getBalance()Get total balance (CBOR)
getUtxos(amount?, paginate?)Get UTxOs
getUsedAddresses()Get used addresses
getUnusedAddresses()Get unused addresses
getChangeAddress()Get change address
getRewardAddresses()Get staking addresses
signTx(tx, partialSign?)Return the signed portions of a witness set
signData(addr, payload)Sign data (CIP-8)
submitTx(tx)Submit transaction

Experimental API

MethodDescription
experimental.getCollateral()Get collateral UTxOs
experimental.on(event, cb)Subscribe to events
experimental.off()Unsubscribe

Types

type Cbor = string // Hex-encoded CBOR interface Paginate { page: number limit: number } interface Cip30DataSignature { signature: string // COSE_Sign1 hex key: string // COSE_Key hex } type NetworkId = 0 | 1 // 0=testnet, 1=mainnet

Events

EventDescription
accountChangeAccount changed

Error Codes

CodeDescription
-1Invalid request
-2Internal error
-3Refused request
-4Account changed

The current provider implementation returns an empty array from experimental.getCollateral(). Do not infer Plutus collateral availability from the method existing. The wallet-info isEnabled() helper also does not replace a successful enable() call. CIP-30 operation-specific errors differ from the general API errors above.

Last updated on