Options
All
  • Public
  • Public/Protected
  • All
Menu

Terra.js

Index

Namespaces

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AccAddress

AccAddress: string

terra- prefixed account address

AccPubKey

AccPubKey: string

terrapub- prefixed account public key

Account

AsyncTxBroadcastResult

AsyncTxBroadcastResult: TxBroadcastResult<Async, {}>

Authorization

BlockTxBroadcastResult

BlockTxBroadcastResult: TxBroadcastResult<Block, TxSuccess | TxError>

Denom

Denom: string

Msg

Msg: BankMsg | DistributionMsg | FeeGrantMsg | GovMsg | MarketMsg | MsgAuthMsg | OracleMsg | SlashingMsg | StakingMsg | WasmMsg | IbcTransferMsg | IbcClientMsg | IbcConnectionMsg | IbcChannelMsg

PublicKey

SyncTxBroadcastResult

SyncTxBroadcastResult: TxBroadcastResult<Sync, TxError | {}>

TendermintEventType

TendermintEventType: "NewBlock" | "NewBlockHeader" | "Evidence" | "Tx" | "ValidatorSetUpdates" | "CompleteProposal" | "Lock" | "NewRound" | "NewRoundStep" | "Polka" | "Relock" | "Relock" | "TimeoutPropose" | "TimeoutWait" | "Unlock" | "ValidBlock" | "Vote"

TxBroadcastResult

TxBroadcastResult<B, C>: B & C

Type parameters

ValAddress

ValAddress: string

terravaloper- prefixed validator operator address

ValConsAddress

ValConsAddress: string

terravalcons- prefixed validator consensus address

ValPubKey

ValPubKey: string

terravaloperpub- prefixed validator public key

Variables

DEC_PRECISION

DEC_PRECISION: 18 = 18

LUNA_COIN_TYPE

LUNA_COIN_TYPE: 330 = 330

Functions

aggregateVoteHash

  • aggregateVoteHash(exchangeRates: Coins, salt: string, validator: string): string

dec

  • dec(strings: TemplateStringsArray): Dec
  • Template tagged literal for creating new Dec objects out of literal string. This does not support literal string interpolation with ${}.

    Usage is:

    import { dec } from "@terra-money/terra.js";

    const dec1 = dec`234.12312`;
    const dec2 = new Dec("234.12312");

    dec1.equals(dec2);

    Parameters

    • strings: TemplateStringsArray

    Returns Dec

getCodeId

getContractAddress

getContractEvents

hashToHex

  • hashToHex(data: string): string
  • Calculates the transaction hash from Amino-encoded string.

    Parameters

    • data: string

      Amino-encoded string (base64)

    Returns string

int

  • int(strings: TemplateStringsArray): Int
  • Template tagged literal for creating new Int objects out of literal string. This does not support literal string interpolation with ${}.

    Usage is:

    import { int } from "@terra-money/terra.js";

    const int1 = int`234`;
    const int2 = new Int("234");

    int1.equals(int2);

    Parameters

    • strings: TemplateStringsArray

    Returns Int

isTxError

  • isTxError<T, B, C>(x: T): x is T & B & TxError

ripemd160

  • ripemd160(data: Uint8Array): Uint8Array

sha256

  • sha256(data: Uint8Array): Uint8Array
  • Calculates the transaction hash from Amino-encoded string.

    Parameters

    • data: Uint8Array

      raw bytes

    Returns Uint8Array