On this page
API Reference
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?) | Return the signed portions of a witness set |
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 | Invalid request |
| -2 | Internal error |
| -3 | Refused request |
| -4 | Account 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