Swagger

Quickstart

Make the first authenticated call, then build the same prepare–sign–submit loop for every operation.

Quickstart

Make your first authenticated request

Keep secrets server-side, verify your environment, then build the same prepare–sign–submit loop for every operation.

  1. 01

    Authenticate

    Use a session JWT for onboarding and a project X-API-Key for data-plane requests.

    Read the guide →
  2. 02

    Prepare and sign

    Prepare the operation, read its rail, and sign what that rail returned client-side.

    Read the guide →
  3. 03

    Submit and track

    Submit the signature and poll the returned operation id until terminal status.

    Read the guide →
curl "https://api.ugtp.io/v1/network/list" \
  -H "X-API-Key: $UGTP_API_KEY"

Worked example

Your first three calls

One read to prove the host and the key, one to see what a network charges in, one price check. Nothing is created and nothing is spent.

  1. 01

    Prove the host and the key at once

    GET /network/list

    Confirm the API host and that the key is accepted for this read. Operation endpoints use the same header, but can require additional key scopes.

    Input — the request

    curl -X GET "https://api.ugtp.io/v1/network/list" \
      -H "X-API-Key: $UGTP_API_KEY"

    Output — 200 response

    {
      "networks": [
        {
          "name": "Avalanche C-Chain",
          "networkId": "43114",
          "explorerUrl": "https://snowtrace.io",
          "nativeCoin": "AVAX",
          "wrappedNative": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"
        }
      ]
    }

    Every status this call can answer with
    StatusWhen
    200Networks
    401Missing or invalid credentials
    429Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header
    500Internal server error
  2. 02

    See what a network will charge in

    GET /network/:networkId/tokens

    The fee-token list for one chain. An operation's fee must be charged in one of these, so this is the second read every integration ends up making.

    Input — the request

    curl -X GET "https://api.ugtp.io/v1/network/:networkId/tokens" \
      -H "X-API-Key: $UGTP_API_KEY"

    Output — 200 response

    {
      "networkId": "43114",
      "tokens": [
        {
          "address": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
          "symbol": "USDC",
          "decimals": 6
        }
      ]
    }

    Every status this call can answer with
    StatusWhen
    200Tokens
    401Missing or invalid credentials
    429Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header
    500Internal server error
  3. 03

    Price something before you build it

    POST /fee/estimate

    The last read-only step. Reserve against estimatedFee and show expectedFee; that split is what keeps a Max button from submitting an operation that cannot pay for itself.

    Input — the request

    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"
    }'

    Output — 200 response

    {
      "estimatedFee": "0.0512",
      "estimatedFeeRaw": "0xc7f8",
      "expectedFee": "0.0410",
      "expectedFeeRaw": "0xa028",
      "gasFee": "0.0400",
      "gasFeeRaw": "0x9c40",
      "serviceFee": "0.0010",
      "serviceFeeRaw": "0x3e8",
      "symbol": "USDT"
    }

    Every status this call can answer with
    StatusWhen
    200Fee estimate
    400Invalid request body or query parameters
    401Missing or invalid credentials
    429Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header
    500Internal server error