Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Wallet

Hierarchy

  • Wallet

Index

Constructors

constructor

  • new Wallet(__namedParameters: { bitcoinPublicKeychain: string; chain: ChainID; configPrivateKey: string; encryptedBackupPhrase: string; firstBitcoinAddress: string; identities: Identity[]; identityAddresses: string[]; identityKeypairs: IdentityKeyPair[]; identityPublicKeychain: string; stacksPrivateKey: Buffer; walletConfig: undefined | WalletConfig }): Wallet
  • Parameters

    • __namedParameters: { bitcoinPublicKeychain: string; chain: ChainID; configPrivateKey: string; encryptedBackupPhrase: string; firstBitcoinAddress: string; identities: Identity[]; identityAddresses: string[]; identityKeypairs: IdentityKeyPair[]; identityPublicKeychain: string; stacksPrivateKey: Buffer; walletConfig: undefined | WalletConfig }
      • bitcoinPublicKeychain: string
      • chain: ChainID
      • configPrivateKey: string
      • encryptedBackupPhrase: string
      • firstBitcoinAddress: string
      • identities: Identity[]
      • identityAddresses: string[]
      • identityKeypairs: IdentityKeyPair[]
      • identityPublicKeychain: string
      • stacksPrivateKey: Buffer
      • walletConfig: undefined | WalletConfig

    Returns Wallet

Properties

bitcoinPublicKeychain

bitcoinPublicKeychain: string

chain

chain: ChainID

configPrivateKey

configPrivateKey: string

encryptedBackupPhrase

encryptedBackupPhrase: string

firstBitcoinAddress

firstBitcoinAddress: string

identities

identities: Identity[]

identityAddresses

identityAddresses: string[]

identityKeypairs

identityKeypairs: IdentityKeyPair[]

identityPublicKeychain

identityPublicKeychain: string

stacksPrivateKey

stacksPrivateKey: Buffer

Optional walletConfig

walletConfig: WalletConfig

Methods

createGaiaConfig

  • createGaiaConfig(gaiaHubUrl: string): Promise<GaiaHubConfig>

createNewIdentity

  • createNewIdentity(password: string): Promise<Identity>

fetchConfig

  • fetchConfig(gaiaConfig: GaiaHubConfig): Promise<WalletConfig | null>

getOrCreateConfig

  • getOrCreateConfig(__namedParameters: { gaiaConfig: GaiaHubConfig; skipUpload: undefined | false | true }): Promise<WalletConfig>

getSigner

restoreIdentities

  • restoreIdentities(__namedParameters: { gaiaReadURL: string; rootNode: BIP32Interface }): Promise<this>
  • Restore all previously used identities. This is meant to be used when 'restoring' a wallet. First, it will check for a walletConfig. If present, then we use that to determine how many identities to generate, and auto-populate their username.

    If walletConfig is empty, then this is being restored from an authenticator that doesn't support walletConfig. In that case, we will recursively generate identities, and check for on-chain names.

    Parameters

    • __namedParameters: { gaiaReadURL: string; rootNode: BIP32Interface }
      • gaiaReadURL: string
      • rootNode: BIP32Interface

    Returns Promise<this>

updateConfig

  • updateConfig(gaiaConfig: GaiaHubConfig): Promise<void>

updateConfigForReuseWarning

  • updateConfigForReuseWarning(__namedParameters: { gaiaConfig: GaiaHubConfig }): Promise<void>

updateConfigWithAuth

  • updateConfigWithAuth(__namedParameters: { app: ConfigApp; gaiaConfig: GaiaHubConfig; identityIndex: number }): Promise<void>

Static createAccount

  • createAccount(__namedParameters: { chain: ChainID; encryptedBackupPhrase: string; identitiesToGenerate: number; rootNode: BIP32Interface }): Promise<Wallet>
  • Parameters

    • __namedParameters: { chain: ChainID; encryptedBackupPhrase: string; identitiesToGenerate: number; rootNode: BIP32Interface }
      • chain: ChainID
      • encryptedBackupPhrase: string
      • identitiesToGenerate: number
      • rootNode: BIP32Interface

    Returns Promise<Wallet>

Static generate

Static generateFactory

Static generateStrong

  • generateStrong(password: string, chain: ChainID): Promise<Wallet>

Static restore

  • restore(password: string, seedPhrase: string, chain: ChainID): Promise<Wallet>

Generated using TypeDoc