Skip to Content
このページの内容

CryptoHDKey

この CryptoHDKey クラスは階層的決定性鍵の情報を表します。

OneKey はこのレジストリオブジェクトを QR コードとしてエクスポートでき、ウォレットは公開鍵データからアドレスを導出できます。

パラメーター

パラメーター型説明
isMasterbooleanマスターキーかどうか
isPrivateKeyboolean秘密鍵かどうか
keyBuffer鍵データ
chainCodeBufferチェーンコード
useInfoCryptoCoinInfo用途に関する情報
originCryptoKeypath元のパス
childrenCryptoKeypath子のパス
parentFingerprintBuffer親のフィンガープリント
namestring名前 (任意)
notestringメモ (任意)

メモの値

  • 'account.standard' – BIP44 標準アカウント
  • 'account.ledger_live' – Ledger Live アカウント
  • 'account.ledger_legacy' – Ledger Legacy アカウント

UR の例

UR:CRYPTO-HDKEY/PDAXHDCLAOZTRDKBTKFPRFKBCWVEWYBGDPNTCPVLEOENJSWMBKFTLTRESNWTNLTLMKJYVYMWBSAAHDCXCSBNNLLNBZIAJZTPKPPKJOSTCEZSJEKGYKJOCSKNHFTPSWTIGHVABDIEGTBWWLTEAHTAADEHOYADCSFNAMTAADDYOYADLNCSDWYKCSFNYKAEYKATTAADDYOYADLRAEWKLAWKAYAEASINFPIAIAJLKPJTJYCXEHBKKOGHISINJKCXINJKCXHSC

デコードの例

import { URDecoder } from '@ngraveio/bc-ur'; import { CryptoHDKey } from '@keystonehq/bc-ur-registry'; const dec = new URDecoder(); // push each scanned frame string into the decoder // dec.receivePart(frame) if (dec.isError()) throw new Error('Could not decode account QR code'); if (dec.isSuccess()) { const ur = dec.resultUR(); if (ur.type !== 'crypto-hdkey') throw new Error('Expected crypto-hdkey'); const hdkey = CryptoHDKey.fromCBOR(ur.cbor); if (hdkey.isPrivateKey()) throw new Error('Expected a public account export'); const name = hdkey.getName(); const note = hdkey.getNote(); const chainCode = hdkey.getChainCode(); const origin = hdkey.getOrigin(); const xfp = origin?.getSourceFingerprint(); }
最終更新日