Contracts

Submit a contract write call

Submit a write call to a smart contract from a signer. The gateway validates the contract address, encodes the call via viem, signs the digest with the signer's key, which never leaves the platform's key custody, and broadcasts to the chain. Lifecycle-gated for non-active projects. Idempotent on optional Idempotency-Key header with request fingerprinting; mismatched replays return 409 carrying the stored call's status/call_error/tx_hash. A matched replay of a call that failed before anything was broadcast (e.g. an estimate-gas revert) re-executes under the same call_id; a matched replay of a broadcast-phase or legacy failure returns the stored failure as 502 with retryable: false and a new_idempotency_key next-action. Cost: chain gas at-cost + $0.000005 signing fee per call. Returns 202 with call_id and tx_hash.

post/contracts/v1/call

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/contracts/v1/call
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Request body

signer_idstring required
chainstring required
contract_addressstring required
function_namestring required
valuestring

Optional native-token value in wei (non-negative decimal string; legacy alias for value_wei)

value_weistring

Optional native-token value in wei (non-negative decimal string)

Response

Submitted, returns { call_id, tx_hash, status: pending }

call_idstring required
tx_hashstring required
status'pending' | 'failed' required

Example response

{
  "call_id": "ccall_0123456789abcdef01234567"
}

Changes

No recorded changes to this operation across all 1 revision of this API.