Skip to main content
POST
/
v1
/
w3s
/
templates
/
{id}
/
deploy
/
estimateFee
Estimate fee for a contract template deployment
curl --request POST \
  --url https://api.circle.com/v1/w3s/templates/{id}/deploy/estimateFee \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "blockchain": "MATIC-AMOY",
  "sourceAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",
  "templateParameters": {},
  "walletId": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"
}'
{
  "data": {
    "high": {
      "gasLimit": "21000",
      "gasPrice": "<string>",
      "maxFee": "5.935224468",
      "priorityFee": "1.022783914",
      "baseFee": "1.022783914",
      "networkFee": "0.0001246397138",
      "networkFeeRaw": "0.0001246397138"
    },
    "low": {
      "gasLimit": "21000",
      "gasPrice": "<string>",
      "maxFee": "5.935224468",
      "priorityFee": "1.022783914",
      "baseFee": "1.022783914",
      "networkFee": "0.0001246397138",
      "networkFeeRaw": "0.0001246397138"
    },
    "medium": {
      "gasLimit": "21000",
      "gasPrice": "<string>",
      "maxFee": "5.935224468",
      "priorityFee": "1.022783914",
      "baseFee": "1.022783914",
      "networkFee": "0.0001246397138",
      "networkFeeRaw": "0.0001246397138"
    }
  }
}

Authorizations

Authorization
string
header
required

Circle's API Keys are formatted in the following structure "PREFIX:ID:SECRET". All three parts are requred to make a successful request.

Headers

X-Request-Id
string

Developer-provided parameter used to identify this request. Useful when communicating with Circle Support.

Example:

"2adba88e-9d63-44bc-b975-9b6ae3440dde"

Path Parameters

id
string<uuid>
required

The universally unique identifier of the resource.

Example:

"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"

Body

application/json

Request object for estimating the transaction fees for deploying a contract from a template.

blockchain
enum<string>
required

The blockchain network that the resource is to be created on or is currently on. Required along with sourceAddress if you don't provide walletId. The blockchain and walletId fields are mutually exclusive.

Available options:
ETH,
ETH-SEPOLIA,
MATIC,
MATIC-AMOY,
ARB,
ARB-SEPOLIA,
UNI,
UNI-SEPOLIA,
BASE,
BASE-SEPOLIA,
OP,
OP-SEPOLIA
Example:

"MATIC-AMOY"

sourceAddress
string

Source address of the transaction. Required along with blockchain if walletId is not provided. The sourceAddress and walletId fields are mutually exclusive.

Example:

"0x1bf9ad0cc2ad298c69a2995aa806ee832788218c"

templateParameters
object

JSON object that contains the template deployment parameters used to initialize the contract(s) on-chain.

walletId
string<uuid>

Unique system generated identifier of the wallet. Required when sourceAddress and blockchain are not provided. Mutually exclusive with sourceAddress and blockchain. For contract deploys this wallet ID will be used as the source.

Example:

"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"

Response

Response object with estimated transaction fee values.

data
object
required