Skip to Content
Connect to Software

API Reference

Complete reference for OneKey’s Aptos provider methods and types.


Methods

MethodDescription
connect()Connect wallet and get account
disconnect()Disconnect wallet
isConnected()Check connection status
account()Get current account info
network()Get current network name
getNetwork()Get full network info
getNetworkURL()Get network RPC URL
signMessage(request)Sign arbitrary message
signAndSubmitTransaction(payload, options?)Sign and submit transaction
signTransaction(payload, options?)Sign transaction without submitting
signTransactionV2(params)Sign BCS-serialized transaction
signAndSubmitTransactionV2(params)Sign and submit (Standard V1.1.0)
signIn(payload)AIP sign-in flow
onAccountChange(callback)Listen for account changes
onNetworkChange(callback)Listen for network changes
onDisconnect(callback)Listen for disconnect

Types

Account Info

interface AptosAccountInfo { address: string // Hex address with 0x prefix publicKey: string // Ed25519 public key }

Network Info

interface AptosNetwork { name: string // Network name chainId: string // Chain ID url: string // RPC URL }

Sign Message Request

interface SignMessageRequest { message: string // Message to sign nonce?: string // Optional nonce address?: boolean // Include address in message application?: boolean // Include app info chainId?: boolean // Include chain ID }

Sign Message Response

interface SignMessageResponse { signature: string // Hex signature fullMessage: string // Complete signed message prefix: string // APTOS prefix address?: string // Signer address application?: string // Application info chainId?: number // Chain ID nonce: string // Nonce used }

Transaction Payload

interface TransactionPayload { type: 'entry_function_payload' | 'script_payload' | 'module_bundle_payload' function: string // Module::function format type_arguments: string[] arguments: any[] }

Sign Transaction V2 Params

interface SignTransactionV2Params { transaction: string // BCS serialized transaction transactionType: 'simple' | 'multi_agent' asFeePayer?: boolean // Sign as fee payer }

Supported Networks

NetworkDescription
MainnetProduction network
TestnetTesting environment
DevnetDevelopment environment

Events

EventCallback ParametersDescription
accountChangedaddress: string | nullAccount changed
accountChangedV2account: AptosAccountInfo | nullAccount changed (full info)
networkChangenetwork: string | nullNetwork changed
disconnect-Wallet disconnected

Error Codes

CodeDescription
4001User rejected request
4100Unauthorized
4200Unsupported method
4201Unsupported network
-32603Internal error
Last updated on