Skip to main content
POST
/
2
/
pm
/
approval
/
build
Build approval transactions
curl --request POST \
  --url https://demo-api.mobula.io/api/2/pm/approval/build \
  --header 'Content-Type: application/json' \
  --data '
{
  "address": "<string>",
  "isNegRisk": false
}
'
{
  "data": [
    {
      "to": "<string>",
      "calldata": "<string>",
      "chainId": 123
    }
  ],
  "hostname": "<string>",
  "took": 123
}

Request Body

address
string
required
The wallet address that will approve tokens.
isNegRisk
boolean
default:"false"
Reserved. Currently ignored; both standard and neg-risk exchange approvals are always returned.

Response

data
array
Array of transaction calldata objects to send on-chain.
hostname
string
Server node identifier.
took
number
Request processing time in milliseconds.

Transactions Returned

Always returns 4 approval transactions (both standard and neg-risk exchange contracts).
  1. USDC.approve() for the CTF Exchange contract
  2. ConditionalTokens.setApprovalForAll() for the CTF Exchange contract
  3. USDC.approve() for the Neg-Risk CTF Exchange contract
  4. ConditionalTokens.setApprovalForAll() for the Neg-Risk CTF Exchange contract

Usage Example

curl -X POST "https://api.mobula.io/api/2/pm/approval/build" \
  -H "Content-Type: application/json" \
  -d '{ "address": "0xYourWalletAddress" }'

Integration Example

// Build approval transactions
const res = await fetch('https://api.mobula.io/api/2/pm/approval/build', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ address: walletAddress })
});
const { data: approvals } = await res.json();

// Send each approval transaction on-chain (Polygon)
for (const tx of approvals) {
  await walletClient.sendTransaction({
    to: tx.to,
    data: tx.calldata,
    chain: polygon
  });
}
The approval transaction is sent by the EOA (not the Safe). The EOA approves the exchange contracts to transfer USDC and conditional tokens on behalf of the Safe.
Approvals only need to be done once per wallet. After approval, you can place unlimited orders without re-approving.

Body

application/json
address
string
required

Wallet address

isNegRisk
boolean
default:false

Response

200 - application/json

Approval transactions

data
object[]
hostname
string
took
number