Custom MayaChain client.

Hierarchy

  • default
    • Client

Implements

Constructors

  • Constructor for the MayaChain client.

    Parameters

    • config: Partial<CosmosSdkClientParams> = defaultClientConfig

      Optional configuration for the client. Default values will be used if not provided.

    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

  • Get the asset corresponding to the provided denomination.

    Parameters

    • denom: string

      The denomination for which to retrieve the asset.

    Returns null | Asset

    The asset corresponding to the denomination, 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

  • Get the number of decimals for a given asset.

    Parameters

    • asset: Asset

      The asset for which to retrieve the decimals.

    Returns number

    The number of decimals.

  • Get information about the native asset of the MayaChain.

    Returns AssetInfo

    Information about the native 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

  • Get the denomination of the provided asset.

    Parameters

    • asset: Asset

      The asset for which to retrieve the denomination.

    Returns null | string

    The denomination of the asset, or null if not found.

  • Get the explorer URL for the given address.

    Parameters

    • address: string

      The address for which to retrieve the explorer URL.

    Returns string

    The explorer URL for the given address.

  • Get the explorer URL for the given transaction ID.

    Parameters

    • txID: string

      The transaction ID for which to retrieve the explorer URL.

    Returns string

    The explorer URL for the given transaction ID.

  • Get the explorer URL for the current network.

    Returns string

    The explorer URL for the current network.

  • 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.

  • Retrieve the message type URL by type used by the Cosmos SDK client to make certain actions.

    Parameters

    • msgType: TRANSFER

      The message type of which to return the type URL.

    Returns string

    The type URL of the message.

  • Get the current network.

    Returns Network

  • Get the address prefix for the given network.

    Parameters

    • network: Network

      The network identifier.

    Returns string

    The address prefix.

  • Retrieve the private key associated with the specified index.

    Parameters

    • index: number = 0

      Optional - The index to use to generate the private key. If it is not set, address associated with index 0 will be used

    Returns Promise<Uint8Array>

    The private key

  • Retrieve the compressed public key associated with the specified index.

    Parameters

    • index: number = 0

      Optional - The index to use to generate the public key. If not set, the address associated with index 0 will be used.

    Returns Promise<Uint8Array>

    The compressed public key

  • Retrieve the standard fee used by the client.

    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

  • Prepare a transaction for transfer.

    Parameters

    • params: TxParams & {
          sender: string;
      }

      The transfer options.

    Returns Promise<PreparedTx>

    The raw unsigned transaction.

    Throws

    If sender or recipient addresses are invalid, or if the asset symbol 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>

  • Create and sign a transaction without broadcasting it.

    Parameters

    • params: TxParams & {
          gasLimit?: BigNumber;
      } & {
          gasLimit?: BigNumber;
      }

      The offline transaction parameters.

    Returns Promise<string>

    The raw unsigned transaction.

    Deprecated

    Use prepareTx instead.

  • Validate the address format.

    Parameters

    • address: string

      address to be validated

    Returns boolean

    represents whether the address is valid or invalid

Generated using TypeDoc