Skip to Content
dApps

API リファレンス

OneKey の TON プロバイダーのメソッドと型のリファレンス。


メソッド

メソッド説明
connect(version?, request?)ウォレットに接続
restoreConnection()以前のセッションを復元
disconnect()ウォレットを切断
send(message)RPC リクエストを送信
listen(callback)ウォレットイベントを監視

送信メソッド

メソッド説明
sendTransactionTON を送信またはコントラクトを操作
signData任意のデータセルに署名
disconnectRPC 経由で切断

型

アカウント情報

interface AccountInfo { address: string // Raw address (0:<hex>) network: string // Network ID (-239 mainnet, -3 testnet) publicKey: string // Hex public key (no 0x) walletStateInit: string // Base64 encoded state init }

トランザクションリクエスト

interface TransactionRequest { valid_until?: number // UNIX timestamp for validity network?: string // Network ID from?: string // Sender address messages: Message[] // Respect the wallet-advertised maximum }

メッセージ

interface Message { address: string // Recipient (raw format) amount: string // Amount in nanotons payload?: string // Base64 BOC for contract calls stateInit?: string // Base64 StateInit for deployment }

データ署名リクエスト

interface SignDataRequest { schema_crc: number // Schema identifier cell: string // Base64 encoded cell publicKey?: string // Optional specific key }

データ署名の結果

interface SignDataResult { signature: string // Base64 signature timestamp: number // UNIX timestamp (UTC) }

デバイス情報

interface DeviceInfo { platform: string // 'iphone' | 'android' | 'windows' | 'mac' | 'linux' appName: string // 'onekey' appVersion: string // Wallet version maxProtocolVersion: number // 2 features: Array<string | { name: string; maxMessages?: number; [key: string]: unknown }> // Advertised capabilities }

ネットワーク

ネットワークネットワーク ID
メインネット-239
テストネット-3

イベント

イベント説明
accountChangedアカウント変更時
disconnectウォレット切断時

エラーコード

コード説明
0不明なエラー
1不正なリクエスト
100不明なアプリ
300ユーザーがリクエストを拒否
400未対応のメソッド
最終更新日