Represents a client for interacting with the Kujira blockchain network. Inherits from the CosmosSdkClient class.

Hierarchy

  • default
    • Client

Constructors

  • Constructs a new instance of the Kujira client.

    Parameters

    • config: Partial<CosmosSdkClientParams> = defaultClientConfig

      The client configuration parameters.

    Returns Client

Properties

baseDenom: string
chain: string
clientUrls: Record<Network, string>
defaultDecimals: number
feeBounds: FeeBounds
network: Network
phrase: string
prefix: string
registry: Registry
rootDerivationPaths: undefined | RootDerivationPaths
startgateClient: CachedValue<StargateClient>

Methods

  • Retrieves the asset from the given denomination.

    Parameters

    • denom: string

      The denomination to retrieve the asset for.

    Returns null | Asset

    The corresponding asset, or null if not found.

  • Parameters

    • txHex: string

    Returns Promise<string>

  • Parameters

    • Optional walletIndex: number

    Returns string

    Deprecated

    this function eventually will be removed use getAddressAsync instead

  • Get an address derived from the phrase defined in the constructor.

    Parameters

    • Optional index: number

    Returns Promise<string>

    user address at index defined on walletIndex

  • Retrieves the number of decimals for a given asset.

    Parameters

    • asset: Asset

      The asset for which to retrieve the number of decimals.

    Returns number

    The number of decimals.

  • Retrieves information about the assets used in the Kujira network.

    Returns AssetInfo

    Information about the asset.

  • Obtains all the balances of the address passed as parameter for all the assets of the network. For the moment for this client the assets parameter is ignored. Do not hesitate to open a PR if you need it and it is not yet available.

    Parameters

    • address: string

      address to be validated

    • Optional _assets: Asset[]

      IGNORED FOR THIS IMPLEMENTATION

    Returns Promise<Balance[]>

    array of balances

  • Retrieves the denomination of the given asset.

    Parameters

    • asset: Asset

      The asset for which to retrieve the denomination.

    Returns null | string

    The denomination, or null if not found.

  • Constructs the URL for viewing the address on the blockchain explorer.

    Parameters

    • address: string

      The address to view.

    Returns string

    The explorer address URL.

  • Constructs the URL for viewing the transaction on the blockchain explorer.

    Parameters

    • txID: string

      The transaction ID to view.

    Returns string

    The explorer transaction URL.

  • Retrieves the URL of the blockchain explorer for the current network.

    Returns string

    The explorer URL.

  • Returns Promise<number>

  • This function returns the fee object in a generalised way for a simple transfer function. In this case this funcion use the default fee defined in the constructor.

    Returns Promise<Fees>

    fees estimation for average, fast and fastests scenarios.

  • Get getFullDerivationPath

    Parameters

    • walletIndex: number

      HD wallet index

    Returns string

    The bitcoin derivation path based on the network.

  • Retrieves the message type URL by message type for cosmos-sdk client actions.

    Parameters

    • msgType: TRANSFER

      The message type.

    Returns string

    The type URL of the message.

  • Get the current network.

    Returns Network

  • Retrieves the address prefix used by the Kujira network.

    Returns string

    the address prefix

  • Retrieves the standard fee used by the client for a given asset.

    Parameters

    • asset: Asset

      The asset to retrieve the fee for.

    Returns StdFee

    The standard fee.

  • Get transaction info using txId

    Parameters

    • txId: string

      Idetifier of transaction

    • Optional _assetAddress: string

    Returns Promise<Tx>

    Transaction data

  • Get transactions filtered using params

    Parameters

    • Optional params: TxHistoryParams

      Only param address IS SUPPORTED FOR THIS CLIENT, new feature will be added in the future

    Returns Promise<TxsPage>

    array of balances

  • Prepares a transaction for transfer.

    Parameters

    • params: TxParams & {
          sender: string;
      }

      The transfer options.

    Returns Promise<PreparedTx>

    The raw unsigned transaction.

    Throws

    Thrown if sender or recipient address is invalid or if the asset is invalid.

  • Purge client.

    Returns void

  • Set client network to work with.

    Parameters

    • network: Network

    Returns void

  • Set/update a new phrase

    Parameters

    • phrase: string

      A new phrase.

    • Optional walletIndex: number

      (optional) HD wallet index

    Returns string

    The address from the given phrase

    Throws

    Thrown if the given phase is invalid.

  • Parameters

    • endpoint: string

    Returns Promise<unknown>

  • Parameters

    • params: TxParams

    Returns Promise<string>

  • Validate the address format.

    Parameters

    • address: string

      address to be validated

    Returns boolean

    represents whether the address is valid or invalid

Generated using TypeDoc