Options
All
  • Public
  • Public/Protected
  • All
Menu

@cosmjs/proto-signing Documentation

Index

Type Aliases

Algo: "secp256k1" | "ed25519" | "sr25519"
OfflineSigner: OfflineAminoSigner | OfflineDirectSigner

Functions

  • anyToSinglePubkey(pubkey: Any): SinglePubkey
  • Decodes a single pubkey (i.e. not a multisig pubkey) from Any into SinglePubkey.

    In most cases you probably want to use decodePubkey.

    Parameters

    • pubkey: Any

    Returns SinglePubkey

  • coin(amount: string | number, denom: string): Coin
  • Creates a coin.

    If your values do not exceed the safe integer range of JS numbers (53 bit), you can use the number type here. This is the case for all typical Cosmos SDK chains that use the default 6 decimals.

    In case you need to supportr larger values, use unsigned integer strings instead.

    Parameters

    • amount: string | number
    • denom: string

    Returns Coin

  • coins(amount: string | number, denom: string): Coin[]
  • Creates a list of coins with one element.

    Parameters

    • amount: string | number
    • denom: string

    Returns Coin[]

  • decodePubkey(pubkey: Any): Pubkey
  • Decodes a pubkey from a protobuf Any into Pubkey. This supports single pubkeys such as Cosmos ed25519 and secp256k1 keys as well as multisig threshold pubkeys.

    Parameters

    • pubkey: Any

    Returns Pubkey

  • encodePubkey(pubkey: Pubkey): Any
  • Takes a pubkey in the Amino JSON object style (type/value wrapper) and convertes it into a protobuf Any.

    This is the reverse operation to decodePubkey.

    Parameters

    • pubkey: Pubkey

    Returns Any

  • executeKdf(password: string, configuration: KdfConfiguration): Promise<Uint8Array>
  • makeAuthInfoBytes(signers: readonly { pubkey: Any; sequence: number }[], feeAmount: readonly Coin[], gasLimit: number, feeGranter: undefined | string, feePayer: undefined | string, signMode?: SignMode): Uint8Array
  • Creates and serializes an AuthInfo document.

    This implementation does not support different signing modes for the different signers.

    Parameters

    • signers: readonly { pubkey: Any; sequence: number }[]
    • feeAmount: readonly Coin[]
    • gasLimit: number
    • feeGranter: undefined | string
    • feePayer: undefined | string
    • signMode: SignMode = SignMode.SIGN_MODE_DIRECT

    Returns Uint8Array

  • makeCosmoshubPath(a: number): HdPath
  • The Cosmos Hub derivation path in the form m/44'/118'/0'/0/a with 0-based account index a.

    Parameters

    • a: number

    Returns HdPath

  • makeSignBytes(__namedParameters: SignDoc): Uint8Array
  • makeSignDoc(bodyBytes: Uint8Array, authInfoBytes: Uint8Array, chainId: string, accountNumber: number): SignDoc
  • parseCoins(input: string): Coin[]
  • Takes a coins list like "819966000ucosm,700000000ustake" and parses it.

    This is a Stargate ready version of parseCoins from @cosmjs/amino. It supports more denoms.

    Parameters

    • input: string

    Returns Coin[]

Generated using TypeDoc