Create a contract execution
Non-custodial accounts are available in sandbox only. Production non-custodial accounts are on the roadmap.
Calls a function on an EVM smart contract from a non-custodial account (custodyType self). The call runs asynchronously on the account’s home blockchain; blockchain must match it. Contract execution must be enabled for your entity and the blockchain.
Describe the call in one of two ways:
-
abiFunctionSignatureandabiParameters. SendabiParametersas[]for a function without arguments. -
callData, the encoded call data.
amount is the native value sent with the call. Omit it to send none. The end user doesn’t need to hold the native token to pay network fees. You can’t set the fee level, gas, or nonce.
The request must carry an X-Device-Authorization header that the end user’s authorization key signed over this exact request. The Digital Asset Accounts SDK builds and signs the request, and your backend relay forwards the body and the header unchanged. Don’t reformat the JSON, reorder fields, or add default values. This operation doesn’t need a Strong Customer Authentication (SCA) challenge.
A new request returns 201 with the execution in pending. To retry after a timeout or a lost response, resend the identical body and X-Device-Authorization header, even if the header has since expired. Circle returns 200 with the execution in its current state, including a failure, and doesn’t run the call again. Reusing an idempotencyKey for the same account with a different body or header returns 409.
Get the result with GET /v1/accounts/contractExecutions/{id}, or subscribe to the account.contractExecution webhook. To list executions, call GET /v1/accounts/transactions with accountId set to the account and type set to contract_execution.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Compact ES256 JWS that the Digital Asset Accounts SDK creates on the end user's device. It signs this request's method, path, and exact body bytes (an empty body for GET requests) with the authorization key the end user registered. The SDK creates a new value for every new request.
A missing value returns 400 (error code 420031). A value that isn't a well-formed compact JWS returns 401 (error code 420031).
The SDK gives each value an expiry at most 5 minutes after it signs it. Unless the operation says otherwise, Circle rejects a value whose expiry has passed or whose signing time is in the future, allowing 60 seconds of clock difference either way, with 400 (error code 420031). A device clock that's off by more than 60 seconds causes the same error. Retry within the value's lifetime, or let the SDK sign the request again.
Your backend relay must forward this header, and the request body, exactly as the SDK sent them. Don't parse, reformat, or re-serialize the body. If the bytes change, Circle rejects the request.
Compact ES256 JWS created by the Digital Asset Accounts SDK on the end user's device.
64 - 8192"eyJhbGciOiJFUzI1NiJ9.e30.AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-Pw"
Body
- Option 1
- Option 2
A contract call from a non-custodial account. Describe the call either with abiFunctionSignature and abiParameters, or with callData. Circle rejects unknown fields, duplicate keys, and null values. The body can be at most 64 KiB.
Universally unique identifier (UUID v4) idempotency key. This key is utilized to ensure exactly-once execution of mutating requests.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"ba943ff1-ca16-49b2-ba55-1057e70ca5c7"
ID of the non-custodial account that makes the call. The account must be active and belong to your entity.
"22222222-2222-4222-8222-222222222222"
Home blockchain of the account; must match it. Send CBASE for Base; responses return BASE. The environment, not this value, decides mainnet or testnet. Not every blockchain is available in every environment.
ETH, ARB, CBASE, OP, UNI, ARC "ETH"
Address of the contract to call. Circle checks the format only, not that the contract implements the function.
42^0x[0-9a-fA-F]{40}$"0x1111111111111111111111111111111111111111"
Encoded call data: 0x followed by an even number of hexadecimal digits, between 1 and 16,384 bytes. Can't be combined with abiFunctionSignature or abiParameters.
4 - 32770^0x([0-9a-fA-F]{2})*$"0xd0e30db0"
Canonical signature of the function, such as approve(address,uint256), with no spaces or parameter names. Supported parameter types are address, bool, string, bytes, bytes1 through bytes32, and int8 through int256 and uint8 through uint256 in steps of 8. Supported array types are uint256[], uint256[2], uint256[][], uint256[][2], address[], bool[2], bytes32[], string[], and bytes[]. For other types, such as tuples, uint, or other arrays, use callData.
1 - 1000^[A-Za-z_$][A-Za-z0-9_$]*\((?:(?:(?:address|bool|string|bytes(?:[1-9]|[12][0-9]|3[0-2])?|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256))|uint256\[\]|uint256\[2\]|uint256\[\]\[\]|uint256\[\]\[2\]|address\[\]|bool\[2\]|bytes32\[\]|string\[\]|bytes\[\])(?:,(?:(?:address|bool|string|bytes(?:[1-9]|[12][0-9]|3[0-2])?|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256))|uint256\[\]|uint256\[2\]|uint256\[\]\[\]|uint256\[\]\[2\]|address\[\]|bool\[2\]|bytes32\[\]|string\[\]|bytes\[\]))*)?\)$"approve(address,uint256)"
Arguments in the order of abiFunctionSignature. Send [] for a function without arguments. Each value is a string, a boolean, an integer, or a nested array. Send integers outside the safe JSON range (more than 2^53 - 1 in magnitude) as decimal strings. Arrays can nest up to eight levels, counting this array, and the tree can hold at most 1,024 values below this array.
1024A string, a boolean, an integer, or a nested array. Circle rejects objects, null, numbers with a fractional part or an exponent (including 1.0 and 1e3), and integers outside the safe JSON range. A numeric string stays a string.
Native value to send with the call, in whole units of the blockchain's native asset (ETH, or USDC on Arc). Omit it to send none; don't send "0" unless the end user signed it. This is separate from the network fee and from token amounts in abiParameters.
39^(0|[1-9][0-9]{0,19})(\.[0-9]{1,18})?$"0.1"
Response
Retry of an accepted request. Returns the execution in its current state.
A contract execution: the call that was requested, its status, and, once known, the blockchain transaction hash and network fee. Transaction lists and webhooks carry a shorter summary without callData or abiParameters.
- Option 1
- Option 2