Skip to Content
ハードウェア
このページの内容

evmGetAddress

Ethereum: アドレスを取得

指定パスのアドレスを導出して返します。showOnOneKey が true の場合は、 ユーザーがデバイス上でアドレスを確認する必要があります。

const response = await HardwareSDK.evmGetAddress(connectId, deviceId, params)

パラメーター

任意の共通パラメーター

単一のアドレス

  • path - 必須 string | Array<number> SDK の最小長は 3. 詳細情報
  • showOnOneKey - 任意 boolean アドレスをデバイスに表示するかどうか。デフォルトは true.
  • chainId - 任意 number ETH の ChainId は、特定の Ethereum ネットワークを一意に識別し、ブロックチェーンの異なるバージョンを区別するための識別子です。 リファレンス .

複数のアドレス

  • bundle - path および showOnOneKey フィールドを持つオブジェクトの配列

例

最初の ethereum アカウントのアドレスを表示します:

HardwareSDK.evmGetAddress(connectId, deviceId, { path: "m/44'/60'/0'/0/0", chainId: 1 });

デバイスに表示せず、ethereum アドレスをまとめて返します:

HardwareSDK.evmGetAddress(connectId, deviceId, { bundle: [ { path: "m/44'/60'/0'/0/0", chainId: 1, showOnOneKey: false }, // account 1 { path: "m/44'/60'/1'/0/0", chainId: 1, showOnOneKey: false }, // account 2 { path: "m/44'/60'/2'/0/0", chainId: 1, showOnOneKey: false } // account 3 ] });

結果

単一アドレスのレスポンス

{ success: true, payload: { address: string, // displayed address path: string // serialized BIP32 path } }

リクエストと同じ順序のバッチレスポンス

{ success: true, payload: [ { address: string, path: string }, // account 1 { address: string, path: string }, // account 2 { address: string, path: string } // account 3 ] }

エラー

{ success: false, payload: { error: string, // error message code?: string | number // error code } }
最終更新日