v1

latestOpenAPI 3.1.02026-07-13570316.1 KB
Wallets

Write Contract

Executes write operations (transactions) on smart contracts. This is a convenience endpoint that simplifies contract interaction by accepting method signatures and parameters directly, without requiring manual transaction encoding. All calls are executed against the same contract address and chain, making it ideal for batch operations.

Authentication: This endpoint requires project authentication and wallet authentication. For backend usage, use x-secret-key header. For frontend usage, use x-client-id + Authorization: Bearer <jwt> headers.

post/v1/contracts/write

Request body

chainIdinteger required

The blockchain network identifier. Common values include: 1 (Ethereum), 8453 (Base), 137 (Polygon), 56 (BSC), 43114 (Avalanche), 42161 (Arbitrum), 10 (Optimism).

fromstring

The wallet address or ENS name that will send the transaction. If omitted, the project wallet will be used if available.

idempotencyKeystring

An optional unique key to prevent duplicate transactions. If a request with the same idempotency key has already been submitted, the existing transaction will be returned instead of creating a new one.

Example request

{
  "calls": [
    {
      "contractAddress": "0xe352Cf5f74e3ACfd2d59EcCee6373d2Aa996086e",
      "method": "function approve(address spender, uint256 amount)",
      "params": [
        "0x4fA9230f4E8978462cE7Bf8e6b5a2588da5F4264",
        1000000000
      ]
    }
  ],
  "chainId": 84532,
  "from": "0x1234567890123456789012345678901234567890"
}

Response

Contract write operations submitted successfully. Returns transaction IDs for tracking and monitoring.