Skip to main content
POST
/
account
/
migration
/
migrate-funds
Execute sponsored legacy funds migration
curl --request POST \
  --url https://api.context.markets/v2/account/migration/migrate-funds \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "batchWithdraw": {
    "nonce": "1000000",
    "deadline": "1000000",
    "signature": "0xabc123"
  },
  "setOperator": {
    "nonce": "1000000",
    "deadline": "1000000",
    "signature": "0xabc123"
  }
}
'
{
  "success": true,
  "userOperationHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
  "txHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
  "executions": [
    {
      "userOperationHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
      "txHash": "0x1111111111111111111111111111111111111111111111111111111111111111"
    }
  ],
  "legacyBalances": [
    {
      "token": "0x1111111111111111111111111111111111111111",
      "balance": "1000000"
    }
  ],
  "newBalances": [
    {
      "token": "0x1111111111111111111111111111111111111111",
      "balance": "1000000"
    }
  ],
  "v2OperatorApproved": true
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Body

application/json
batchWithdraw
object
required
setOperator
object
required
address
string

Optional wallet address override for SDK/API flows. When omitted, the server uses the authenticated API account wallet.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x1111111111111111111111111111111111111111"

Response

Sponsored migration executed

success
enum<boolean>
required
Available options:
true
userOperationHash
string
required

32-byte hex hash

Pattern: ^0x[a-fA-F0-9]{64}$
Example:

"0x1111111111111111111111111111111111111111111111111111111111111111"

txHash
string
required

32-byte hex hash

Pattern: ^0x[a-fA-F0-9]{64}$
Example:

"0x1111111111111111111111111111111111111111111111111111111111111111"

executions
object[]
required
legacyBalances
object[]
required
newBalances
object[]
required
v2OperatorApproved
boolean
required