A representation of a blockchain address, which is a user-controlled account on a network.

Hierarchy (view full)

Constructors

  • Initializes a new Address instance.

    Parameters

    • networkId: string

      The network id.

    • id: string

      The onchain address id.

    Returns Address

Properties

_reputation?: AddressReputation
id: string
networkId: string
MAX_HISTORICAL_BALANCE: number = 1000

Methods

  • Get the claimable balance for the supplied asset.

    Parameters

    • asset_id: string

      The asset to check claimable balance for.

    • mode: StakeOptionsMode = StakeOptionsMode.DEFAULT

      The staking mode. Defaults to DEFAULT.

    • options: {
          [key: string]: string;
      } = {}

      Additional options for getting the claimable balance.

      • [key: string]: string

    Returns Promise<Decimal>

    The claimable balance.

  • Private

    Create a shallow copy of given options.

    Parameters

    • Optional options: {
          [key: string]: string;
      }

      The supplied options to be copied

      • [key: string]: string

    Returns {
        [key: string]: string;
    }

    A copy of the options.

    • [key: string]: string
  • Requests faucet funds for the address. Only supported on testnet networks.

    Parameters

    • Optional assetId: string

      The ID of the asset to transfer from the faucet.

    Returns Promise<FaucetTransaction>

    The faucet transaction object.

    Throws

    If the request does not return a transaction hash.

    Throws

    If the request fails.

  • Returns the balance of the provided asset.

    Parameters

    • assetId: string

      The asset ID.

    Returns Promise<Decimal>

    The balance of the asset.

  • Private

    Get the different staking balance types for the supplied asset.

    Parameters

    • assetId: string

      The asset to lookup balances for.

    • Optional mode: StakeOptionsMode

      The staking mode. Defaults to DEFAULT.

    • Optional options: {
          [key: string]: string;
      }

      Additional options for the balance lookup.

      • [key: string]: string

    Returns Promise<{
        [key: string]: Decimal;
    }>

    The different balance types.

  • Lists the historical staking balances for the address.

    Parameters

    • assetId: string

      The asset ID.

    • startTime: string = ...

      The start time.

    • endTime: string = ...

      The end time.

    Returns Promise<StakingBalance[]>

    The staking balances.

  • Get the pending claimable balance for the supplied asset.

    Parameters

    • asset_id: string

      The asset to check pending claimable balance for.

    • mode: StakeOptionsMode = StakeOptionsMode.DEFAULT

      The staking mode. Defaults to DEFAULT.

    • options: {
          [key: string]: string;
      } = {}

      Additional options for getting the pending claimable balance.

      • [key: string]: string

    Returns Promise<Decimal>

    The pending claimable balance.

  • Get the stakeable balance for the supplied asset.

    Parameters

    • asset_id: string

      The asset to check the stakeable balance for.

    • mode: StakeOptionsMode = StakeOptionsMode.DEFAULT

      The staking mode. Defaults to DEFAULT.

    • options: {
          [key: string]: string;
      } = {}

      Additional options for getting the stakeable balance.

      • [key: string]: string

    Returns Promise<Decimal>

    The stakeable balance.

  • Lists the staking rewards for the address.

    Parameters

    • assetId: string

      The asset ID.

    • startTime: string = ...

      The start time.

    • endTime: string = ...

      The end time.

    • format: StakingRewardFormat = StakingRewardFormat.USD

      The format to return the rewards in. (usd, native). Defaults to usd.

    Returns Promise<StakingReward[]>

    The staking rewards.

  • Returns a string representation of the address.

    Returns string

    A string representing the address.

  • Get the unstakeable balance for the supplied asset.

    Parameters

    • asset_id: string

      The asset to check the unstakeable balance for.

    • mode: StakeOptionsMode = StakeOptionsMode.DEFAULT

      The staking mode. Defaults to DEFAULT.

    • options: {
          [key: string]: string;
      } = {}

      Additional options for getting the unstakeable balance. A. Dedicated ETH Staking

      • validator_pub_keys (optional): List of comma separated validator public keys to retrieve unstakeable balance for. Defaults to all validators.
      • [key: string]: string

    Returns Promise<Decimal>

    The unstakeable balance.

  • Private

    Validate if the operation is able to claim stake with the supplied input.

    Parameters

    • amount: Amount

      The amount of the asset to claim stake.

    • assetId: string

      The asset to claim stake.

    • mode: StakeOptionsMode

      The staking mode. Defaults to DEFAULT.

    • options: {
          [key: string]: string;
      }

      Additional options for the claim stake operation.

      • [key: string]: string

    Returns Promise<void>

    Throws

    If the supplied input is not able to create a claim stake operation.

  • Private

    Validate if the operation is able to stake with the supplied input.

    Parameters

    • amount: Amount

      The amount of the asset to stake.

    • assetId: string

      The asset to stake.

    • mode: StakeOptionsMode

      The staking mode. Defaults to DEFAULT.

    • options: {
          [key: string]: string;
      }

      Additional options for the stake operation.

      • [key: string]: string

    Returns Promise<void>

    Throws

    If the supplied input is not able to create a stake operation.

  • Private

    Validate if the operation is able to unstake with the supplied input.

    Parameters

    • amount: Amount

      The amount of the asset to unstake.

    • assetId: string

      The asset to unstake.

    • mode: StakeOptionsMode

      The staking mode. Defaults to DEFAULT.

    • options: {
          [key: string]: string;
      }

      Additional options for the unstake operation.

      • [key: string]: string

    Returns Promise<void>

    Throws

    If the supplied input is not able to create an unstake operation.