A networkId is the chain id, as a string
The networkId field uses the EVM chain id as a decimal string: "1", "137", "42161", "43114". Signing payloads can use numeric chainId fields; preserve the types returned by prepare.
Which chains this deployment serves, and which token an operation can pay its fee in.
Two reads answer everything a prepare needs to know about a chain: where this deployment can operate, and what a fee can be charged in there. Both are served by the gateway rather than read off a chain, so treat them as the authority and fetch them instead of hardcoding a list that will drift.
The networkId field uses the EVM chain id as a decimal string: "1", "137", "42161", "43114". Signing payloads can use numeric chainId fields; preserve the types returned by prepare.
GET /network/list is the serviceable set behind this deployment. A chain missing from it is not a chain that is down — it is one this deployment does not carry, and no amount of retrying will prepare an operation there.
GET /network/:networkId/tokens is what an operation can pay its fee in on that network. A token qualifies only if the fee-collecting contracts can value it in USD from a price feed, because the fee has a dollar-denominated part. That is a property of the token, not a preference, so a token's absence is not something a request can work around — name a listed fee token instead.
The tokens you can swap are a far longer list, and they come from the routing provider rather than from us: GET /swap/tokens. A token can be swappable and still be unable to pay a fee. Read the fee list for feeToken and the swap catalog for fromToken and toToken.
The network, asset and project determine the rail. Branch on the prepare response instead of maintaining a local network-to-rail table. On Avalanche, ERC-20 operations and native transfers use different rails.
Worked example
Two reads answer both questions a prepare needs: where you can operate, and what the fee can be charged in.
GET /network/list
The serviceable set comes from the gateway rather than from a chain, so treat this list as the authority on which networkId values a prepare will accept.
curl -X GET "https://api.ugtp.io/v1/network/list" \
-H "X-API-Key: $UGTP_API_KEY"{
"networks": [
{
"name": "Avalanche C-Chain",
"networkId": "43114",
"explorerUrl": "https://snowtrace.io",
"nativeCoin": "AVAX",
"wrappedNative": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"
}
]
}| Status | When |
|---|---|
200 | Networks |
401 | Missing or invalid credentials |
429 | Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header |
500 | Internal server error |
GET /network/:networkId/tokens
A fee token must be one of these. The executor rail always needs one named, so this read is a prerequisite there rather than an optimization.
curl -X GET "https://api.ugtp.io/v1/network/:networkId/tokens" \
-H "X-API-Key: $UGTP_API_KEY"{
"networkId": "43114",
"tokens": [
{
"address": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
"symbol": "USDC",
"decimals": 6
}
]
}| Status | When |
|---|---|
200 | Tokens |
401 | Missing or invalid credentials |
429 | Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header |
500 | Internal server error |
POST /fee/estimate
Reserve against estimatedFee and show expectedFee. On the executor rail also honour requiredBalanceRaw, which is what the account must hold — not always the same as the fee.
curl -X POST "https://api.ugtp.io/v1/fee/estimate" \
-H "X-API-Key: $UGTP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"networkId": "137",
"senderAddress": "0xCa9d43184Cc3179609f77D38433D363833C73c60",
"calls": [
{
"to": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
"value": "0x0",
"data": "0x..."
}
],
"transferredAssets": [
{
"address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
"amount": "0xf4240"
}
],
"feeToken": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F"
}'{
"estimatedFee": "0.0512",
"estimatedFeeRaw": "0xc7f8",
"expectedFee": "0.0410",
"expectedFeeRaw": "0xa028",
"gasFee": "0.0400",
"gasFeeRaw": "0x9c40",
"serviceFee": "0.0010",
"serviceFeeRaw": "0x3e8",
"symbol": "USDT"
}| Status | When |
|---|---|
200 | Fee estimate |
400 | Invalid request body or query parameters |
401 | Missing or invalid credentials |
429 | Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header |
500 | Internal server error |