Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

depositWithPermit

Credits USDC to the signing user's TxFlow account by asking the API host to submit batchedDepositWithPermit on Bridge2. Use this when the user has USDC on Arbitrum but no ETH to pay gas (typical for email / social login). Wallet users who already hold ETH should USDC.transfer to Bridge2 themselves instead of calling this type.

This is an /info type that writes on Arbitrum. It is answered by the API service behind the same API host as every other type. There is no Try It panel — posting a sample would broadcast a real permit.

POST/infotype depositWithPermit

Deposit Arbitrum USDC for a user who holds no ETH for gas (signs an EIP-2612 permit).

Request body
deadlinestringrequired

Unix seconds. Must be at least 120 seconds in the future and at most 7 days ahead.

signatureobjectrequired
rstringrequired

EIP-2612 permit `r`.

sstringrequired

EIP-2612 permit `s`.

vintegerrequired

EIP-2612 permit `v` (`27` or `28`).

typestringrequired

Must be `depositWithPermit`.

"depositWithPermit"
usdstringrequired

Amount in USDC integer units (6 decimals). `5000000` is 5 USDC, the current minimum.

userstring · addressrequired

Depositor. Must match the permit signer.

waitForReceiptbooleanoptional

`false` returns after broadcast (poll the chain for the hash). Omitted or `true` waits for a receipt on the server (legacy).

Request example
curl -X POST https://rpc.txflow-testnet.xyz/info \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "type": "depositWithPermit",
  "user": "0x0000000000000000000000000000000000000001",
  "usd": "5000000",
  "deadline": "1735689600",
  "signature": {
    "r": "0x<r>",
    "s": "0x<s>",
    "v": 27
  }
}'
Response 200
codeinteger

`0` on success.

dataobject
txHashstring

Arbitrum transaction that submitted `batchedDepositWithPermit`.

successboolean

`false` on error, with `code` set and the text in `message` instead of `data`.

Response example
{
  "success": true,
  "code": 0,
  "data": {
    "txHash": "0xabc123def456abc123def456abc123def456abc123def456abc123def456abc1"
  }
}

usd is integer 6-decimal units, not a decimal string: 5000000 is 5 USDC (the current minimum). Amounts below that return Below minimum deposit amount.

The permit is standard EIP-2612 on the Arbitrum USDC contract:

  • owner = user
  • spender = bridge2_contract_address from settings
  • value = the same integer as usd
  • deadline / nonce = USDC permit nonce and Unix-second deadline

Pass waitForReceipt: false and confirm txHash on Arbitrum yourself. Omitted or true makes the server wait for a receipt before responding.

Bridge2 does not revert on a failed permit; it may emit FailedPermitDeposit. Treat a mined hash that contains that event for user as a failed deposit.

Next steps

Read balances from clearinghouseState / perpClearinghouseState. Cross-chain deposits use TxRelay instead of this type.