API Reference
Complete reference for OneKey’s Cardano provider methods and types.
Wallet Interface (CIP-30)
| Property/Method | Description |
|---|---|
name | Wallet name (‘OneKey’) |
icon | Wallet icon URL |
apiVersion | API version |
isEnabled() | Check if enabled |
enable() | Request wallet access |
dApp API (after enable)
| Method | Description |
|---|---|
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?) | Sign transaction |
signData(addr, payload) | Sign data (CIP-8) |
submitTx(tx) | Submit transaction |
Experimental API
| Method | Description |
|---|---|
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=mainnetEvents
| Event | Description |
|---|---|
accountChange | Account changed |
Error Codes
| Code | Description |
|---|---|
| -1 | User rejected |
| -2 | Account not found |
| -3 | Invalid network |
Last updated on