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

tokenSend

Moves a token between TxFlow sub-accounts, or sends it to another address when toAddress is present. Outcome trading settles on the outcome sub-account, so collateral commonly moves from perp to outcome before the first trade. The same action also sends to another user or a TxRelay peg. Direct EIP-712, signed by the account key — an agent cannot move funds.

POST/exchangetype tokenSend

Move funds between your sub-accounts (e.g. perp → outcome), to another user, or to a TxRelay peg.Direct EIP-712, signed by the account key

Action fields
amountstringrequired

Decimal amount in token units, not wei.

apiVersioninteger · uint32required

TxFlow signing API version.

chainIdinteger · uint32required

TxFlow chain ID.

fromAccountTypestringrequired

Source sub-account. `perps` is accepted as an alias of `perp`.

"perp""spot""outcome"
nonceinteger · uint64required

Fresh millisecond timestamp. Direct EIP-712 actions carry the nonce inside the action as well as in the outer payload; the two must match.

toAccountTypestringrequired

Destination sub-account on the recipient.

"perp""spot""outcome"
tokenstringrequired

`NAME:address` of the TxFlow-side token. USDC uses the network USDC contract.

txflowNetworkstringrequired

TxFlow network name used by the EIP-712 action and domain.

typestringrequired

Must be `tokenSend`.

"tokenSend"
toAddressstring · addressnullableoptional

`null` or omitted transfers between your own sub-accounts (`TransferToken`). A non-null address sends to that user or a TxRelay peg (`SendToken`) and may charge a one-time activation fee.

Request example
curl -X POST https://rpc.txflow-testnet.xyz/exchange \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "action": {
    "type": "tokenSend",
    "txflowNetwork": "TxFlow-Testnet",
    "chainId": 2511,
    "apiVersion": 1,
    "token": "USDC:0xd04f0d19E8FbA49cfA541E272F9C60a2ad720464",
    "amount": "100",
    "nonce": 1757992743994,
    "fromAccountType": "perp",
    "toAccountType": "outcome"
  },
  "signature": {
    "r": "0x<r>",
    "s": "0x<s>",
    "v": 27
  },
  "nonce": 1757992743994,
  "vaultAddress": null,
  "signatureChainId": null
}'
Try it
testnet · no account yet
Generates a throwaway key in your browser, claims testnet USDC and authorizes an agent key. The account is kept while you browse the docs and lost on reload.
Response · TokenSend 200
codeinteger

`0` on success.

dataobject
dataobject
typestring

The action's internal name, which does not always match the request `type`.

"TokenSend"
statusstring

A rejected request returns `err` with a non-zero `code` and the reason in `message` (or `response`).

"ok"
Response example
{
  "status": "ok",
  "code": 0,
  "data": {
    "type": "TokenSend",
    "data": {
      "statuses": [
        "success"
      ]
    }
  }
}

For a transfer between your own sub-accounts, omit toAddress. The EIP-712 primary type is TransferToken. When toAddress is present, the primary type is SendToken.

token is NAME:address (for example the testnet USDC id used in Try Testnet). fromAccountType and toAccountType name the sub-accounts: perp, outcome, or spot (non-USDC token balances, used for cross-chain withdrawals below). Both the action and the outer exchange envelope carry the same nonce.

Two EIP-712 primary types

toAddressPrimary typeTypical use
null or omittedTransferTokenBetween your own sub-accounts (e.g. perp ↔ outcome)
A non-zero addressSendTokenAnother TxFlow user, or the TxRelay peg for a cross-chain withdraw
TransferToken(string txflowNetwork,string amount,string fromAccountType,string toAccountType,string token,uint64 nonce)
SendToken(string txflowNetwork,address toAddress,string amount,string fromAccountType,string toAccountType,string token,uint64 nonce)

The wire action always uses type: "tokenSend". Hash the empty string for omitted toAddress is not used — the TransferToken typehash is selected instead.

The first SendToken to a new destination may charge a one-time 1 USDC activation fee (0 after that destination has been activated, when sending to yourself, or when the destination is waived).

Cross-chain withdraw (USDC and other assets)

  1. POST TxRelay deposit-address with src_chain: "txflow", dst_chain set to the external network, and dst_address set to the user's destination.
  2. tokenSend the asset to the peg returned as deposit_address:
    • USDC: fromAccountType / toAccountType = perp
    • other assets: spot → spot

Native Arbitrum USDC outflows use withdraw3, not this action.

Signing

This action is signed directly by the account key; an agent key cannot move funds. signatureChainId, when supplied in the outer envelope, selects the EIP-712 domain chain id without changing the action's business chainId. See Signing.

Next steps

Confirm with userNonFundingLedgerUpdates (deltaTypes including tokenSend) and sub-account reads such as perpClearinghouseState.