Options
All
  • Public
  • Public/Protected
  • All
Menu

The symbol ledger clients that knows who to talk to the symbol app installed in the ledger device.

This facade simplifies provides an simplifies the basic methods.

Hierarchy

  • SymbolLedger

Index

Constructors

constructor

  • new SymbolLedger(transport: Transport<string>, scrambleKey: string): SymbolLedger

Properties

Private Readonly transport

transport: Transport<string>

The transport to be used when talking to ledger.

Methods

close

  • close(): Promise<void>

getAccount

  • getAccount(path: string, networkType: LedgerNetworkType, display: boolean, chainCode: boolean, isOptinLedgerWallet: boolean): Promise<string>
  • get Symbol's address for a given BIP 44 path from the Ledger

    Parameters

    • path: string

      a path in BIP 44 format

    • networkType: LedgerNetworkType

      the symbol network type number

    • display: boolean

      optionally enable or not the display

    • chainCode: boolean

      optionally enable or not the chainCode request

    • isOptinLedgerWallet: boolean

      if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519

    Returns Promise<string>

    the public key of the account.

getAppVersion

  • Get Symbol app version on Ledger device

    Returns Promise<AppVersion>

    an object contain major, minor, patch version of the Symbol app on Ledger device

getExpectedAppVersion

isAppSupported

  • isAppSupported(): Promise<boolean>
  • Return true if the installed app version is above the supported Symbol app version

    Returns Promise<boolean>

    promise of boolean

isVersionSupported

  • Compares the current app version to a expected version. Returns if the app version is greater equals te expected one

    Parameters

    Returns boolean

Private ledgerMessageHandler

  • ledgerMessageHandler(path: string, rawTx: Buffer, chainCode: boolean, isOptinSymbolWallet: boolean): Promise<Buffer>
  • It handles sending and receiving packages between Ledger and Wallet

    Parameters

    • path: string

      a path in BIP 44 format

    • rawTx: Buffer

      a raw payload transaction hex string

    • chainCode: boolean

      optionally enable or not the chainCode request

    • isOptinSymbolWallet: boolean

      if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519

    Returns Promise<Buffer>

    respond package from Ledger

Private sendPackage

signCosignatureTransaction

  • signCosignatureTransaction(path: string, aggregateTransaction: LedgerTransaction, aggregateTransactionHash: string, signerPublicKey: string, isOptinSymbolWallet: boolean): Promise<string>
  • it signs a Symbol Cosignature transaction with a given BIP 44 path

    Parameters

    • path: string

      a path in BIP 44 format

    • aggregateTransaction: LedgerTransaction

      the original aggregate transaction transaction needs to be cosigned

    • aggregateTransactionHash: string

      the aggregate transaction hash

    • signerPublicKey: string

      the public key of signer

    • isOptinSymbolWallet: boolean

      if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519

    Returns Promise<string>

    a Signed Cosignature Transaction which is signed by account at path on Ledger

signTransaction

  • signTransaction(path: string, transaction: LedgerTransaction, networkGenerationHash: string, signerPublicKey: string, isOptinLedgerWallet: boolean): Promise<{ payload: string; signature: string }>
  • sign a Symbol transaction by account on Ledger at given BIP 44 path

    Parameters

    • path: string

      a path in BIP 44 format

    • transaction: LedgerTransaction

      a transaction needs to be signed

    • networkGenerationHash: string

      the network generation hash of block 1

    • signerPublicKey: string

      the public key of signer

    • isOptinLedgerWallet: boolean

      if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519

    Returns Promise<{ payload: string; signature: string }>

    a signed Transaction which is signed by account at path on Ledger

Generated using TypeDoc