Options
All
  • Public
  • Public/Protected
  • All
Menu

@iov/bns Documentation

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

BnsTx

BnsUsernamesQuery

Condition

Condition: Uint8Array & As<"Condition">

A Weave condition

HashId

HashId: Uint8Array & As<"hashid">

Type to differentiate between a raw hash of the data and the id used internally in weave

IovBech32Prefix

IovBech32Prefix: "iov" | "tiov"

PrivkeyBytes

PrivkeyBytes: Uint8Array & As<"privkey-bytes">

ProposalAction

The action to be executed when the proposal is accepted

Variables

Const mainnetChainId

mainnetChainId: string & As<"chain-id"> = "iov-mainnet" as ChainId

Functions

addressPrefix

appendSignBytes

  • appendSignBytes(bz: Uint8Array, chainId: ChainId, nonce: Nonce): SignableBytes
  • Parameters

    • bz: Uint8Array
    • chainId: ChainId
    • nonce: Nonce

    Returns SignableBytes

arraysEqual

  • arraysEqual(a: Uint8Array, b: Uint8Array): boolean
  • Parameters

    • a: Uint8Array
    • b: Uint8Array

    Returns boolean

asIntegerNumber

  • asIntegerNumber(maybeLong: Long | number | null | undefined): number
  • Decodes a protobuf int field (int32/uint32/int64/uint64) into a JavaScript number.

    Parameters

    • maybeLong: Long | number | null | undefined

    Returns number

bnsSwapQueryTag

  • bnsSwapQueryTag(query: AtomicSwapQuery, set?: boolean): QueryTag
  • Parameters

    • query: AtomicSwapQuery
    • Default value set: boolean = true

    Returns QueryTag

bucketKey

  • bucketKey(bucket: string): Uint8Array
  • Parameters

    • bucket: string

    Returns Uint8Array

buildCondition

  • buildCondition(extension: string, type: string, data: Uint8Array): Condition

buildEscrowCondition

  • buildEscrowCondition(id: number): Condition

buildMsg

  • buildMsg(tx: UnsignedTransaction): ITx
  • Parameters

    • tx: UnsignedTransaction

    Returns ITx

buildMultisignatureCondition

  • buildMultisignatureCondition(id: number): Condition

buildQueryString

  • buildQueryString(query: TransactionQuery): QueryString
  • Parameters

    • query: TransactionQuery

    Returns QueryString

buildSignedTx

  • buildSignedTx(tx: SignedTransaction): ITx
  • Parameters

    • tx: SignedTransaction

    Returns ITx

buildUnsignedTx

  • buildUnsignedTx(tx: UnsignedTransaction): ITx
  • Parameters

    • tx: UnsignedTransaction

    Returns ITx

conditionToAddress

  • conditionToAddress(chainId: ChainId, cond: Condition): Address

conditionToWeaveAddress

  • conditionToWeaveAddress(cond: Condition): Uint8Array

createBnsConnector

  • createBnsConnector(url: string, expectedChainId?: ChainId): ChainConnector<BnsConnection>
  • A helper to connect to a bns-based chain at a given url

    Parameters

    • url: string
    • Optional expectedChainId: ChainId

    Returns ChainConnector<BnsConnection>

decodeAmount

  • decodeAmount(coin: ICoin): Amount

decodeBnsAddress

  • decodeBnsAddress(address: Address): object
  • Decodes a printable address into bech32 object

    Parameters

    • address: Address

    Returns object

decodeCashConfiguration

decodeElectionRule

decodeElectorate

decodeFullSig

  • decodeFullSig(sig: IStdSignature): FullSignature
  • Parameters

    • sig: IStdSignature

    Returns FullSignature

decodeNonce

  • decodeNonce(sequence: Long | number | null | undefined): Nonce
  • Parameters

    • sequence: Long | number | null | undefined

    Returns Nonce

decodeNumericId

  • decodeNumericId(id: Uint8Array): number
  • Parameters

    • id: Uint8Array

    Returns number

decodeParticipants

  • decodeParticipants(prefix: IovBech32Prefix, maybeParticipants?: IParticipant[] | null): keyof Participant[]

decodePrivkey

decodeProposal

decodePubkey

  • decodePubkey(publicKey: IPublicKey): PubkeyBundle
  • Parameters

    • publicKey: IPublicKey

    Returns PubkeyBundle

decodeSignature

  • decodeSignature(signature: ISignature): SignatureBytes
  • Parameters

    • signature: ISignature

    Returns SignatureBytes

decodeToken

  • decodeToken(data: ITokenInfo & Keyed): Token

decodeUserData

  • decodeUserData(userData: IUserData): object
  • Parameters

    • userData: IUserData

    Returns object

decodeUsernameNft

decodeVote

electionRuleIdToAddress

  • electionRuleIdToAddress(chainId: ChainId, electionRule: number): Address
  • Parameters

    • chainId: ChainId
    • electionRule: number

    Returns Address

encodeAmount

  • encodeAmount(amount: Amount): ICoin
  • Parameters

    • amount: Amount

    Returns ICoin

encodeBnsAddress

  • Encodes raw bytes into a bech32 address

    Parameters

    Returns Address

encodeFullSignature

  • encodeFullSignature(fullSignature: FullSignature): IStdSignature
  • Parameters

    • fullSignature: FullSignature

    Returns IStdSignature

encodeNumericId

  • encodeNumericId(id: number): Uint8Array
  • Parameters

    • id: number

    Returns Uint8Array

encodeParticipants

  • encodeParticipants(participants: keyof Participant[]): IParticipant[]
  • Parameters

    • participants: keyof Participant[]

    Returns IParticipant[]

encodePrivkey

encodePubkey

  • encodePubkey(pubkey: PubkeyBundle): IPublicKey
  • Parameters

    • pubkey: PubkeyBundle

    Returns IPublicKey

ensure

  • ensure<T>(maybe: T | null | undefined, msg?: undefined | string): T
  • Type parameters

    • T

    Parameters

    • maybe: T | null | undefined
    • Optional msg: undefined | string

    Returns T

escrowIdToAddress

  • escrowIdToAddress(chainId: ChainId, escrowId: number): Address
  • Parameters

    • chainId: ChainId
    • escrowId: number

    Returns Address

hashFromIdentifier

  • hashFromIdentifier(ident: HashId): Hash

hashIdentifier

  • hashIdentifier(hash: Hash): HashId

identityToAddress

  • identityToAddress(identity: Identity): Address
  • Parameters

    • identity: Identity

    Returns Address

indexKey

  • indexKey(bucket: string, index: string): Uint8Array
  • Parameters

    • bucket: string
    • index: string

    Returns Uint8Array

isBnsTx

  • isBnsTx(transaction: LightTransaction): boolean
  • Parameters

    • transaction: LightTransaction

    Returns boolean

isBnsUsernamesByOwnerQuery

isBnsUsernamesByUsernameQuery

isConfirmedWithSwapClaimOrAbortTransaction

  • isConfirmedWithSwapClaimOrAbortTransaction(tx: ConfirmedTransaction<UnsignedTransaction>): boolean
  • Parameters

    • tx: ConfirmedTransaction<UnsignedTransaction>

    Returns boolean

isConfirmedWithSwapOfferTransaction

  • isConfirmedWithSwapOfferTransaction(tx: ConfirmedTransaction<UnsignedTransaction>): boolean
  • Parameters

    • tx: ConfirmedTransaction<UnsignedTransaction>

    Returns boolean

isCreateEscrowTx

  • isCreateEscrowTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isCreateMultisignatureTx

  • isCreateMultisignatureTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isCreateProposalTx

  • isCreateProposalTx(transaction: LightTransaction): boolean
  • Parameters

    • transaction: LightTransaction

    Returns boolean

isCreateTextResolutionAction

isExecuteProposalBatchAction

isHashIdentifier

  • isHashIdentifier(ident: Uint8Array): boolean
  • Parameters

    • ident: Uint8Array

    Returns boolean

isMultisignatureTx

  • isMultisignatureTx(transaction: LightTransaction): boolean
  • Parameters

    • transaction: LightTransaction

    Returns boolean

isRegisterUsernameTx

  • isRegisterUsernameTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isReleaseEscrowAction

isReleaseEscrowTx

  • isReleaseEscrowTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isReturnEscrowTx

  • isReturnEscrowTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isSendAction

isSetMsgFeeAction

isSetValidatorsAction

isTransferUsernameTx

  • isTransferUsernameTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isUpdateElectionRuleAction

isUpdateElectorateAction

isUpdateEscrowPartiesTx

  • isUpdateEscrowPartiesTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isUpdateMultisignatureTx

  • isUpdateMultisignatureTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isUpdateTargetsOfUsernameTx

  • isUpdateTargetsOfUsernameTx(tx: LightTransaction): boolean
  • Parameters

    • tx: LightTransaction

    Returns boolean

isValidAddress

  • isValidAddress(address: string): boolean
  • Parameters

    • address: string

    Returns boolean

isVoteTx

  • isVoteTx(transaction: LightTransaction): boolean
  • Parameters

    • transaction: LightTransaction

    Returns boolean

multisignatureIdToAddress

  • multisignatureIdToAddress(chainId: ChainId, multisignatureId: number): Address
  • Parameters

    • chainId: ChainId
    • multisignatureId: number

    Returns Address

parseMsg

  • parseMsg(base: UnsignedTransaction, tx: ITx): UnsignedTransaction
  • Parameters

    • base: UnsignedTransaction
    • tx: ITx

    Returns UnsignedTransaction

parseTx

  • parseTx(tx: ITx, chainId: ChainId): SignedTransaction
  • Parameters

    • tx: ITx
    • chainId: ChainId

    Returns SignedTransaction

pubkeyToAddress

  • Creates an IOV address from a given Ed25519 pubkey and a prefix that represents the network kind (i.e. mainnet or testnet)

    Parameters

    Returns Address

swapToAddress

  • swapToAddress(chainId: ChainId, swap: object): Address
  • Parameters

    • chainId: ChainId
    • swap: object

    Returns Address

Object literals

Const bnsCodec

bnsCodec: object

identityToAddress

identityToAddress: identityToAddress = identityToAddress

isValidAddress

isValidAddress: isValidAddress = isValidAddress

bytesToPost

  • bytesToPost(tx: SignedTransaction): PostableBytes
  • Parameters

    • tx: SignedTransaction

    Returns PostableBytes

bytesToSign

  • bytesToSign(tx: UnsignedTransaction, nonce: Nonce): SigningJob
  • Parameters

    • tx: UnsignedTransaction
    • nonce: Nonce

    Returns SigningJob

identifier

  • identifier(tx: SignedTransaction): TransactionId
  • Parameters

    • tx: SignedTransaction

    Returns TransactionId

parseBytes

  • parseBytes(bz: PostableBytes, chainId: ChainId): SignedTransaction
  • Parameters

    • bz: PostableBytes
    • chainId: ChainId

    Returns SignedTransaction

Generated using TypeDoc