Options
All
  • Public
  • Public/Protected
  • All
Menu

@cosmjs/stargate Documentation

Index

Namespaces

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AccountParser: ((any: Any) => Account)

Type declaration

    • Represents a generic function that takes an Any encoded account from the chain and extracts some common Account information from it.

      Parameters

      • any: Any

      Returns Account

AminoConverters: Record<string, AminoConverter | "not_supported_by_chain">

A map from protobuf type URL to the AminoConverter implementation if supported on chain

GovParamsType: "deposit" | "tallying" | "voting"
GovProposalId: string | number | Long | Uint64

Variables

defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = ...

Functions

  • accountFromAny(input: Any): Account
  • Basic implementation of AccountParser. This is supposed to support the most relevant common Cosmos SDK account types. If you need support for exotic account types, you'll need to write your own account decoder.

    Parameters

    • input: Any

    Returns Account

  • 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[]

  • createDistributionAminoConverters(): Record<string, AminoConverter | "not_supported_by_chain">
  • createPagination(paginationKey?: Uint8Array): PageRequest | undefined
  • If paginationKey is set, return a PageRequest with the given key. If paginationKey is unset, return undefined.

    Use this with a query response's pagination next key to request the next page.

    Parameters

    • Optional paginationKey: Uint8Array

    Returns PageRequest | undefined

  • createStakingAminoConverters(): Record<string, AminoConverter | "not_supported_by_chain">
  • decodeCosmosSdkDecFromProto(input: string | Uint8Array): Decimal
  • fromTendermint34Event(event: Event): Event
  • Takes a Tendemrint 0.34 event with binary encoded key and value and converts it into an Event with string attributes.

    Parameters

    • event: Event

    Returns Event

  • 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

  • makeMultisignedTx(multisigPubkey: MultisigThresholdPubkey, sequence: number, fee: StdFee, bodyBytes: Uint8Array, signatures: Map<string, Uint8Array>): TxRaw
  • Creates a signed transaction from signer info, transaction body and signatures. The result can be broadcasted after serialization.

    Consider using makeMultisignedTxBytes instead if you want to broadcast the transaction immediately.

    Parameters

    • multisigPubkey: MultisigThresholdPubkey
    • sequence: number
    • fee: StdFee
    • bodyBytes: Uint8Array
    • signatures: Map<string, Uint8Array>

    Returns TxRaw

  • makeMultisignedTxBytes(multisigPubkey: MultisigThresholdPubkey, sequence: number, fee: StdFee, bodyBytes: Uint8Array, signatures: Map<string, Uint8Array>): Uint8Array
  • Creates a signed transaction from signer info, transaction body and signatures. The result can be broadcasted.

    This is a wrapper around makeMultisignedTx that encodes the transaction for broadcasting.

    Parameters

    • multisigPubkey: MultisigThresholdPubkey
    • sequence: number
    • fee: StdFee
    • bodyBytes: Uint8Array
    • signatures: Map<string, Uint8Array>

    Returns Uint8Array

  • 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[]

  • setupFeegrantExtension(base: QueryClient): FeegrantExtension
  • setupSlashingExtension(base: QueryClient): SlashingExtension

Generated using TypeDoc