Transfer Quote

Transfer USDC between subaccounts under the same wallet.

Rate limits

  • 60 transfer quotes/min or 10 every 10 seconds per wallet. (weight=10)

  • A max of 5 transfer quotes to new recipients (subaccounts) every 24hrs.

    • Note: Transferring quote to a subaccount that doesn't exist, creates the subaccount.

See more details in API Rate limits.

Request

Connect

WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]

Message


{
  "transfer_quote": {
    "tx": {
      "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000",
      "recipient": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743100000000000000",
      "amount": "10000000000000000000",
      "nonce": "1"
    },
    "signature": "0x"
  }
}

Request Parameters

ParameterTypeRequiredDescription

tx

object

Yes

Transfer Quote transaction object. See Signing section for details on the transaction fields.

tx.sender

string

Yes

Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender.

tx.recipient

string

Yes

Hex string representing the subaccount's 32 bytes (address + subaccount name) of the quote recipient.

tx.amount

string

Yes

The amount of USDC to transfer, denominated in x18. Transfr amount must be >= 5 USDC . See Signing section for more details.

tx.nonce

string

Yes

This is an incrementing nonce, can be obtained using the Nonces query.

signature

string

Yes

Hex string representing hash of the signed transaction. See Signing section for more details.

Signing

See more details and examples in our signing page.

The solidity typed data struct that needs to be signed is:

struct TransferQuote {
    bytes32 sender;
    bytes32 recipient;
    uint128 amount;
    uint64 nonce;
}

sender: a bytes32 sent as a hex string; includes the address and the subaccount identifier.

recipient: a bytes32 sent as a hex string; includes the address and the subaccount identifier.

amount: the amount of quote to transfer, sent as an x18 string.

Notes:

  • If you are transferring 5 USDC, must specify 5000000000000000000 i.e 5 USDC * 1e18.

  • Transfer amount should be >= 5 USDC.

nonce: the tx_nonce. This is an incrementing nonce, can be obtained using the Nonces query.

Note: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: nonce should be an uint64 for Signing but should be sent as a string in the final payload.

Response

Success

{
  "status": "success",
  "signature": {signature},
  "request_type": "execute_transfer_quote"
}

Failure

{
  "status": "failure",
  "signature": {signature},
  "error": "{error_msg}",
  "error_code": {error_code},
  "request_type": "execute_transfer_quote"
}

Last updated