REST APIWallet & TransactWallet

POST

Build a transaction to consolidate unspents in a wallet. Once built, you must sign and sent the transaction. Consolidating unspents is only for UTXO-based assets.

Path Params

  • coin string required
    A cryptocurrency or token ticker symbol.
  • walletId string required
    The wallet ID.

    matches ^[0-9a-f]{32}$

Body Params

object

  • feeRate string or integer

    Custom fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte.

    If the feeRate is less than the minimum required network fee, then the minimum fee applies. For example, 1000 sat/kvByte, a flat 1000 microAlgos, or a flat 10 drops of xrp. For XRP, the actual fee is usually 4.5 times the open ledger fee.

    Note: The feeRate overrides the maxFeeRate and minFeeRate.

  • maxFeeRate string or integer

    (BTC only) The maximum fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. The maxFeeRate limits the fee rate generated by both feeMultiplier and numBlocks.

    Note: The feeRate overrides the maxFeeRate.

  • maxFeePercentage integer
    Maximum relative portion that can be spent towards fees
  • feeTxConfirmTarget integer
    Block target for fee estimation
  • bulk boolean
    Build multiple transactions at the same time. This enables you to increase the maximum number of unspents on the limit parameter up to 2,000. If true, you must pass the txFormat as psbt and you can't pass the targetAddress or numUnspentsToMake parameters.
  • minValue string or integer
    Minimum value of unspents to use in base units (e.g. satoshis). Can be used to skip very small unspents when consolidating at higher fee rates. For doge, only string is allowed.
  • maxValue string or integer
    Maximum value of unspents to use in base units (e.g. satoshis). Should be used to prevent larger unspents from being consolidated needlessly, and that some funds remain available for spending while the consolidation transactions are in flight. For doge, only string is allowed.
  • minHeight integer
    Minimum height of unspents on the block chain to use
  • minConfirms integer
    Minimum confirmation threshold for external inputs
  • enforceMinConfirmsForChange boolean
    Flag for enforcing minConfirms for change inputs
  • limit integer
    Maximum number of unspents to use in the transaction
  • numUnspentsToMake integer
    Number of new unspents to make
  • targetAddress string
    address to use for generated outputs. Must be wallet address.
  • txFormat string enum
    [UTXO only] Format of the returned transaction hex serialization. legacy for serialized transaction in custom bitcoinjs-lib format. psbt for BIP174 serialized transaction

    Defaults to legacy

    legacypsbtpsbt-lite

Responses

200
OK

Response Body

object

  • txHex string
  • txInfo object
    txInfo (UTXO)
    txInfo object
    • changeAddresses array of strings
    • nOutputs integer
      Number of outputs
    • nP2SHInputs integer
    • nSegwitInputs integer
    • unspents array of objects
      unspents object
      • id string
        The id of the unspent in the form :<tx_index>
      • address string
        The address of this unspent
      • value integer
      • valueString string

        matches ^-?\d+$

      • blockHeight integer
        The block this Unspent was created in
      • date string date-time
        The date this unspent was created
      • coinbase boolean
        True if this unspent came from the coinbase transaction
      • wallet string

        matches ^[0-9a-f]{32}$

      • fromWallet string

        matches ^[0-9a-f]{32}$

      • chain integer
        The type of this unspent's address (P2SH, P2WSH, etc...)
      • index integer
        A monotonic counter used when creating new addresses
      • redeemScript string
        The Script program used to cryptographically verify spending this unspent
      • witnessScript string
        The segwit Script program used to cryptographically verify spending this unspent
      • isSegwit boolean
    • walletAddressDetails object
      walletAddressDetails object
      • id string
        platform public id for an address
      • address string

        up to 500 characters

      • chain integer enum
        011011202130314041
      • index integer
      • coin string
      • lastNonce integer

        Defaults to -1

      • wallet string
        The wallet which contains this address
      • coinSpecific object
        Properties which are specific to certain coin types
        coinSpecific object
        • xlm object
          xlm object
          • memoId string
            Latest memo id generated for the wallet
          • rootAddress string
            Root address of the wallet
        • txlm object
          txlm object
          • Same shape as AddressCoinSpecificXlm.
      • balance object
        Balance of the address. In case of Eth and Celo, if returnBalancesForToken is passed with includeBalances, then it will return token balance in the address object. This field will be present only when includeBalances query param is passed as true.
        balance object
        • updated string date-time
          The last time a transaction affected the balance of this address
        • balance integer
          The cleared balance of the address
        • balanceString string
          String representation of balance. Guaranteed to not lose precision.
        • totalReceived integer
          The total amount received on this address (in the chain's base unit)
        • totalSent integer
          The total amount send from this address (in the chain's base unit)
        • confirmedBalanceString string
          The total balance of confirmed transactions for the address (in the chain's base unit). Guaranteed to not lose precision.
        • spendableBalanceString string
          The total balance of the address (in the chain's base unit) which may be used as inputs for creating new transactions in string representation. Guaranteed to not lose precision.
      • label string nullable
        A human-readable label for the address.

        up to 250 characters

      • addressType string enum
        p2shp2shP2wshp2wshp2trp2trMusig2
  • feeInfo object
    feeInfo (UTXO)
    feeInfo object
    • size integer
      Estimated size of the transaction in bytes
    • fee integer
      Estimated fee in base unit for the transaction
    • feeRate string or integer
      Custom minimum fee rate in a coin's base unit per kilobyte (or virtual kilobyte)--for example, satoshis per kvByte or microAlgos per kByte. If the applied feeRate does not meet a coin's required minimum transaction fee amount, the minimum is still applied (for example, 1000 sat/kvByte or a flat 1000 microAlgos).
    • payGoFee integer
      BitGo fee of the transaction (in base units)
    • payGoFeeString integer
      BitGo fee of the transaction (in base units) represented as a String
400
Bad Request

Response Body

ONE OF

  • error string required
    Human-readable error message
  • requestId string required
    Client request id
  • context object
    Properties that apply to a specific error name
  • name string required
    Error code