A representation of a blockchain Address, which is a user-controlled account on a Network. Addresses are used to send and receive Assets. An ExternalAddress is an Address that is not controlled by the developer, but is instead controlled by the user.

Hierarchy (view full)

Constructors

Properties

_reputation?: AddressReputation
id: string
networkId: string

Methods

  • Builds a claim stake operation for the supplied asset.

    Parameters

    • amount: Amount

      The amount of the asset to claim stake.

    • assetId: string

      The asset to claim stake.

    • mode: StakeOptionsMode = StakeOptionsMode.DEFAULT

      The staking mode. Defaults to DEFAULT.

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

      Additional options for the claim stake operation.

      A. Shared ETH Staking

      • integrator_contract_address (optional): The contract address to which the claim stake operation is directed to. Defaults to the integrator contract address associated with CDP account (if available) or else defaults to a shared integrator contract address for that network.
      • [key: string]: string

    Returns Promise<StakingOperation>

    The claim stake operation.

  • Builds a stake operation for the supplied asset. The stake operation may take a few minutes to complete in the case when infrastructure is spun up.

    Parameters

    • amount: Amount

      The amount of the asset to stake.

    • assetId: string

      The asset to stake.

    • mode: StakeOptionsMode = StakeOptionsMode.DEFAULT

      The staking mode. Defaults to DEFAULT.

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

      Additional options for the stake operation:

      A. Shared ETH Staking

      • integrator_contract_address (optional): The contract address to which the stake operation is directed to. Defaults to the integrator contract address associated with CDP account (if available) or else defaults to a shared integrator contract address for that network.

      B. Dedicated ETH Staking

      • funding_address (optional): Ethereum address for funding the stake operation. Defaults to the address initiating the stake operation.
      • withdrawal_address (optional): Ethereum address for receiving rewards and withdrawal funds. Defaults to the address initiating the stake operation.
      • fee_recipient_address (optional): Ethereum address for receiving transaction fees. Defaults to the address initiating the stake operation.
      • [key: string]: string

    Returns Promise<StakingOperation>

    The stake operation.

  • Private

    Builds the staking operation based on the supplied input.

    Parameters

    • amount: Amount

      The amount for the staking operation.

    • assetId: string

      The asset for the staking operation.

    • action: string

      The specific action for the staking operation. e.g. stake, unstake, claim_stake

    • mode: StakeOptionsMode

      The staking mode. Defaults to DEFAULT.

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

      Additional options to build a stake operation.

      • [key: string]: string

    Returns Promise<StakingOperation>

    The staking operation.

    Throws

    If the supplied input cannot build a valid staking operation.

  • Builds an unstake operation for the supplied asset.

    Parameters

    • amount: Amount

      The amount of the asset to unstake.

    • assetId: string

      The asset to unstake.

    • mode: StakeOptionsMode = StakeOptionsMode.DEFAULT

      The staking mode. Defaults to DEFAULT.

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

      Additional options for the unstake operation:

      A. Shared ETH Staking

      • integrator_contract_address (optional): The contract address to which the unstake operation is directed to. Defaults to the integrator contract address associated with CDP account (if available) or else defaults to a shared integrator contract address for that network.

      B. Dedicated ETH Staking

      • immediate (optional): Set this to "true" to unstake immediately i.e. leverage "Coinbase managed unstake" process . Defaults to "false" i.e. "User managed unstake" process.
      • validator_pub_keys (optional): List of comma separated validator public keys to unstake. Defaults to validators being picked up on your behalf corresponding to the unstake amount.
      • [key: string]: string

    Returns Promise<StakingOperation>

    The unstake operation.

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

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

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