Wallet Standard Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
connect | None | Promise<{ publicKey: string; address: string }> | Initiates wallet connection |
account | None | Promise<AccountResult> | Retrieves active wallet address |
isConnected | None | Promise<boolean> | Verifies connection status |
network | None | Promise<string> | Fetches current network |
onAccountChange | callback: (address: string) => void | void | Handles account switching |
onNetworkChange | callback: (network: string) => void | void | Monitors network changes |
onDisconnect | callback: () => void | void | Tracks disconnection events |
signTransaction | transaction: object | Promise<string> | Signs transaction data |
signMessage | msg: string | Promise<string> | Signs custom messages |
disconnect | None | Promise<void> | Terminates wallet session |
Initializing the Provider
const provider = window.bitkeep.aptos;👉 Explore wallet integration examples
Connecting to Wallet
Response Structure
interface ConnectResult {
publicKey: string; // Base64 encoded public key
address: string; // 32-byte account address
}Implementation
const accountInfo = await provider.connect();Retrieving Account Details
Account Response
interface AccountResult {
publicKey: string;
address: string;
}Usage
const currentAccount = await provider.account();Network Management
Monitoring Account Changes
provider.onAccountChange((newAccount) => {
console.log('Account changed:', newAccount);
});Network Change Events
let activeNetwork = await provider.network();
provider.onNetworkChange((updatedNetwork) => {
activeNetwork = updatedNetwork;
});Message Signing
Message Payload
interface SignMessagePayload {
message: string;
nonce: string;
address?: boolean;
application?: boolean;
chainId?: boolean;
}Response Format
interface AptosSignatureOutput {
signature: string;
fullMessage: string;
publicKey: string;
// ...additional fields
}Usage Example
const signedMessage = await provider.signMessage({
message: "Auth request",
nonce: "123456"
});👉 Learn advanced signing techniques
Transaction Processing
Transaction Structure
interface TransactionInput {
function: string;
arguments: any[];
type: 'entry_function_payload';
type_arguments: string[];
}Signing Transactions
const transaction = {
function: '0x1::coin::transfer',
arguments: [recipient, amount],
type_arguments: ['0x1::aptos_coin::AptosCoin']
};
const signedTx = await provider.signTransaction(transaction);Submitting Transactions
Two submission methods:
Wallet-Submitted:
const txHash = await provider.signAndSubmitTransaction(transaction);DApp-Submitted:
const client = new AptosClient('RPC_ENDPOINT'); await client.waitForTransaction(txHash);
FAQ Section
How do I detect wallet installation?
Check for window.bitkeep.aptos existence before calling methods.
What networks does Aptos support?
Mainnet, Testnet, and Devnet - verify using the network() method.
How to handle transaction errors?
Wrap calls in try/catch blocks and check RPC node status.
Can I sign multiple transactions?
Yes, but sequence them to avoid nonce conflicts.
Is there a fee estimator?
Calculate through simulation or use network gas tables.
How to verify message signatures?
Use the Aptos SDK's verification utilities with original message.