Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GenericWallet

Hierarchy

  • GenericWallet

Implements

Index

Constructors

constructor

  • new GenericWallet(__namedParameters: { addressCount: number; chainCode: string; chainId: number; publicKey: string; rootDerivationPath: string }): GenericWallet
  • Parameters

    • __namedParameters: { addressCount: number; chainCode: string; chainId: number; publicKey: string; rootDerivationPath: string }
      • addressCount: number
      • chainCode: string
      • chainId: number
      • publicKey: string
      • rootDerivationPath: string

    Returns GenericWallet

Properties

address

address: string

Private addressCount

addressCount: number

chainId

chainId: number

Private internalDerivationPath

internalDerivationPath: string

Private internalOtherAddresses

internalOtherAddresses: AddressObject[]

Private internalPublicKey

internalPublicKey: string

otherAddresses

otherAddresses: string[]

sign

sign: (txData: TransactionObjectTypeWithAddresses) => Promise<string>

Type declaration

signMessage

signMessage: (data: SignMessageData) => Promise<string>

Type declaration

subtype

subtype: WalletSubType

type

verifyMessage

verifyMessage: (data: VerifyMessageData) => Promise<boolean>

Type declaration

Methods

getDerivationPath

  • getDerivationPath(): Promise<string>

getPublicKey

  • getPublicKey(): Promise<string>

setDefaultAddress

  • setDefaultAddress(addressIndex?: number): Promise<boolean>
  • Set the default address/public key/path one of the (other) addresses from the array. This is usefull since most methods (sign, signMessage) use this props as defaults.

    There's an argument to be made here that we can derive new addresses only when this method gets called.

    This would be helpful to offload the initial cost of deriving a number of addressCount addresses.

    On the other hand, if we do this, we won't be able to show the user what addresses are available up front.

    method

    setDefaultAddress

    Parameters

    • Default value addressIndex: number = 0

      The address index from the array

    Returns Promise<boolean>

    True if it was able to set it, false otherwise

Generated using TypeDoc