API Notes
This guide lists the methods, types, properties, events and error codes of UKey Wallet Algorand Provider. New projects should prioritize using ARC-0001 related interfaces.
Methods
| Method | Details |
|---|---|
connect() | Connected wallet (legacy) |
disconnect() | Disconnect wallet |
enable(opts?) | Enable wallet (ARC-0001) |
signTxns(transactions) | Sign transaction (ARC-0001) |
postTxns(signedTxns) | Broadcast signed transactions |
signAndPostTxns(transactions) | Sign and broadcast |
signTransaction(txns) | Sign transaction (traditional) |
signAndSendTransaction(txns) | Sign and send (traditional) |
signMessage(message, encoding?) | Sign any message |
getAlgodv2Client() | Get the Algod client |
getIndexerClient() | Get Indexer client |
Types
Enable option
interface EnableOpts {
genesisID?: string;
genesisHash?: string;
}
Enable results
interface EnableResult {
genesisID: string;
genesisHash: string;
accounts: string[];
}
wallet transaction
interface WalletTransaction {
txn: string; // Note: Base64 encoded unsigned transaction
signers?: string[]; // addresses that should sign (null means skip)
stxn?: string; // Note: Pre-signed transaction
message?: string; // Note: message to display
msig?: MultisigMetadata;
authAddr?: string; // Note: Reauthorized authentication address
}
SignTxns results
interface SignTxnsResult {
// Base64 数组,对应已签名交易(null 表示跳过该项)
[index: number]: string | null;
}
PostTxns results
interface PostTxnsResult {
txIDs: string[];
}
property
| Property | Type | Description |
|---|---|---|
isConnected | boolean | connection status |
address | string | null | Connected address |
isUKey | boolean | UKey Wallet logo |
Events
| Event | Inputs | Details |
|---|---|---|
connect | { address } | Wallet is connected |
disconnect | - | Wallet session closed |
accountChanged | address | Selected account changed |
error code
| Code | Details |
|---|---|
| 4001 | User rejected the request |
| 4100 | Authorization required |
| 4200 | Action is unavailable |
| 4300 | Input value is invalid |