Options
All
  • Public
  • Public/Protected
  • All
Menu

Leap Keychain

Index

Type Aliases

AminoMsg: { type: string; value: any }

Type declaration

  • type: string
  • value: any
BTCWalletOptions: WalletOptions & { network: typeof NETWORK }
ChainInfo: { addressPrefix: string; btcNetwork?: typeof NETWORK; coinType: string; key: string; useBip84?: boolean; customKeygenfn?: any }

Type declaration

  • addressPrefix: string
  • Optional btcNetwork?: typeof NETWORK
  • coinType: string
  • key: string
  • Optional useBip84?: boolean
  • customKeygenfn?:function
    • customKeygenfn(key: string, path: string, keyType: "privateKey" | "seedPhrase"): Promise<{ address: string; pubkey: string }>
    • Parameters

      • key: string
      • path: string
      • keyType: "privateKey" | "seedPhrase"

      Returns Promise<{ address: string; pubkey: string }>

Coin: { amount: string; denom: string }

Type declaration

  • amount: string
  • denom: string
CreateWalletParams: { addressIndex: number; chainInfos: ChainInfo[]; colorIndex: number; mnemonic: string; name: string; password: string | Uint8Array; type: "create" | "import" }

Type declaration

  • addressIndex: number
  • chainInfos: ChainInfo[]
  • colorIndex: number
  • mnemonic: string
  • name: string
  • password: string | Uint8Array
  • type: "create" | "import"
GetSignerParams: { addressPrefix: string; btcNetwork?: typeof NETWORK; coinType: string; ethWallet?: boolean; pubKeyBech32Address?: boolean }

Type declaration

  • addressPrefix: string
  • Optional btcNetwork?: typeof NETWORK
  • coinType: string
  • Optional ethWallet?: boolean
  • Optional pubKeyBech32Address?: boolean
IChildKey: { privateKey: Uint8Array | null; publicKey: Uint8Array | null; sign: any }

Type declaration

  • privateKey: Uint8Array | null
  • publicKey: Uint8Array | null
  • sign:function
    • sign(hash: Uint8Array): Uint8Array
IHDKey: { privateKey: Uint8Array | null; publicKey: Uint8Array | null; derive: any }

Type declaration

Key<T>: { addressIndex: number; addresses: Record<T, string>; cipher: string; colorIndex: number; id: string; name: string; pubKeys?: Record<T, string>; walletType: WALLETTYPE }

Type Parameters

  • T extends string

Type declaration

  • addressIndex: number
  • addresses: Record<T, string>
  • cipher: string
  • colorIndex: number
  • id: string
  • name: string
  • Optional pubKeys?: Record<T, string>
  • walletType: WALLETTYPE
Keystore<T>: Record<string, Key<T>>

Type Parameters

  • T extends string

LeapSigner: EthWallet | Wallet | PvtKeyWallet
Pubkey: { type: string; value: any }

Type declaration

  • Readonly type: string
  • Readonly value: any
SignDoc: { accountNumber: Long; authInfoBytes: Uint8Array; bodyBytes: Uint8Array; chainId: string }

Type declaration

  • accountNumber: Long
  • authInfoBytes: Uint8Array
  • bodyBytes: Uint8Array
  • chainId: string
StdFee: { amount: readonly Coin[]; gas: string; granter?: string }

Type declaration

  • Readonly amount: readonly Coin[]
  • Readonly gas: string
  • Optional Readonly granter?: string
StdSignDoc: { account_number: string; chain_id: string; fee: StdFee; memo: string; msgs: readonly AminoMsg[]; sequence: string }

Type declaration

  • Readonly account_number: string
  • Readonly chain_id: string
  • Readonly fee: StdFee
  • Readonly memo: string
  • Readonly msgs: readonly AminoMsg[]
  • Readonly sequence: string
StdSignature: { pub_key: Pubkey; signature: string }

Type declaration

  • Readonly pub_key: Pubkey
  • Readonly signature: string
WalletOptions: { addressPrefix: string; paths: string[]; pubKeyBech32Address?: boolean }

Type declaration

  • addressPrefix: string
  • paths: string[]
  • Optional pubKeyBech32Address?: boolean

Variables

ACTIVE_WALLET: "active-wallet" = 'active-wallet'
ENCRYPTED_ACTIVE_WALLET: "encrypted-active-wallet" = 'encrypted-active-wallet'
ENCRYPTED_KEYCHAIN: "encrypted-keystore" = 'encrypted-keystore'
KEYCHAIN: "keystore" = 'keystore'
bip32Token: Token<IBip32> = ...
bip39Token: Token<IBip39> = ...
ripemd160Token: Token<ripemd160> = ...
secp256k1Token: Token<typeof Secp256k1> = ...
sha256Token: Token<sha256> = ...

Functions

  • compressSignature(recoveryParam: number, signature: Uint8Array): string
  • compressedPublicKey(publicKey: Uint8Array): string
  • decrypt(transitmessage: string, pass: Input, iterations?: number): string
  • encodeSecp256k1Pubkey(pubkey: Uint8Array): Pubkey
  • encodeSecp256k1Signature(pubkey: Uint8Array, signature: Uint8Array): StdSignature
  • encrypt(msg: string, pass: Input, iterations?: number): string
  • fromHex(hexstring: string): Uint8Array
  • generateWalletFromMnemonic(mnemonic: string, options: { addressPrefix: string; btcNetwork?: {}; ethWallet: boolean; hdPath: string; pubKeyBech32Address?: boolean }): EthWallet | Wallet | BtcWalletHD
  • Generate a wallet from a mnemonic

    Parameters

    • mnemonic: string
    • options: { addressPrefix: string; btcNetwork?: {}; ethWallet: boolean; hdPath: string; pubKeyBech32Address?: boolean }

      { hdPath: string, addressPrefix: string, ethWallet: boolean, - if true, it generates an ethereum wallet regardless of cointype pubKeyBech32Address: boolean - if true, it generates a bech32 address from public key instead of ethereum address. }

      • addressPrefix: string
      • Optional btcNetwork?: {}
        • ethWallet: boolean
        • hdPath: string
        • Optional pubKeyBech32Address?: boolean

      Returns EthWallet | Wallet | BtcWalletHD

    • generateWalletFromPrivateKey(privateKey: string, hdPath: string, prefix: string, btcNetwork?: {}, ethWallet?: boolean, pubKeyBech32Address?: boolean): EthWallet | PvtKeyWallet | BtcWalletPk
    • getFullHDPath(purpose?: string, coinType?: string, index?: string, account?: string, chain?: string): string
    • Parameters

      • purpose: string = '44'
      • coinType: string = '0'
      • index: string = '0'
      • account: string = '0'
      • chain: string = '0'

      Returns string

    • getHardenedPath(path: string): string
    • initCrypto(): void
    • isBtcCoinType(coinType: string): boolean
    • pubkeyToAddress(prefix: string, publicKey: Uint8Array): string
    • Parameters

      • prefix: string
      • publicKey: Uint8Array

      Returns string

    • serializeSignDoc(signDoc: SignDoc): Uint8Array
    • serializeStdSignDoc(signDoc: StdSignDoc): Uint8Array
    • setSecp256k1(secp256k1: typeof Secp256k1): void
    • setsha256(sha256: sha256): void
    • sortObject(obj: any): any