Skip to main content

Overview

Use the Gas API to calculate relayer fees and obtain the cryptographic signatures required by the CashmereCCTP contracts. Quotes are deterministic for the current block state and expire 100 seconds after issuance.

GET /getEcdsaSig_native

Generates an ECDSA signature for EVM contracts (transfer, transferWithPermit, transferV2, transferV2WithPermit).
GET https://gas.cashmere.exchange/getEcdsaSig_native

Query Parameters

NameTypeRequiredDescription
localDomainnumberOrigin Circle domain (Ethereum = 0, Arbitrum = 3, etc.).
destinationDomainnumberTarget Circle domain.
isV2booleantrue for CCTP v2 flows (transferV2*), false for legacy v1.
isNativebooleantrue if relayer fee + gas drop will be paid in the origin’s native token.

Example

curl "https://gas.cashmere.exchange/getEcdsaSig_native\
?localDomain=0\
&destinationDomain=3\
&isV2=true\
&isNative=false"
{
  "fee": "1500000",
  "deadline": "1729281534",
  "signature": "0x8b6aa1…1f9d",
  "isNative": false,
  "cctpVersion": 2
}

Response Fields

FieldDescription
feeRelayer fee (USDC, 6 decimals when isNative=false, native units otherwise).
deadlineUNIX timestamp that the contracts enforce (now + 100s).
signatureECDSA signature over (localDomain, destinationDomain, fee, deadline, isNative, cctpVersion).
isNativeEcho of the query flag.
cctpVersion1 or 2, matching the target function.
Gas drops are not returned explicitly. When isNative=false, include your desired gasDropAmount in TransferParams and pass the same value to the contract.

GET /getEd25519Sig_native

Generates an Ed25519 signature for Solana, Aptos, or Sui transfers.
GET https://gas.cashmere.exchange/getEd25519Sig_native

Query Parameters

NameTypeRequiredDescription
localDomainnumberOrigin domain.
destinationDomainnumberTarget domain.
isNativebooleantrue for native fee flows.
versionnumberSet to 2 when calling Solana transfer_v2.

Example

curl "https://gas.cashmere.exchange/getEd25519Sig_native\
?localDomain=5\
&destinationDomain=0\
&isNative=false\
&version=2"
{
  "signature": "0x6c80e3…d4",
  "message": "0x0200000000000000000000000000000000000000000000000000000000000000e0fb080000000000",
  "publicKey": "0x93ab6f…af",
  "destinationDomain": "0",
  "fee": "590000",
  "deadline": "1729281534",
  "isNative": false,
  "version": 2
}

Message Layout

BCS-encoded fields (in order):
  1. Optional version (u8).
  2. Optional localDomain (u32) when isNative is provided.
  3. destinationDomain (u32).
  4. fee (u64).
  5. deadline (u64).
  6. Optional isNative (bool).
Reproduce this byte order on-chain before verifying the signature.

Token Pricing

GET https://gas.cashmere.exchange/tokenPrices
Returns a JSON map of { domainId: priceInUsd } pulled from Redis.

WebSocket Updates

GET wss://gas.cashmere.exchange/subscribe
  • { "type": "fees", "data": { <sourceChain>: { fee: { <dest>: { native, usd } }, gas: { native, usd } } } }
  • { "type": "tokenPrices", "data": { <domainId>: "<price>" } }
Use the socket to keep frontends in sync without repeatedly polling the REST endpoints.

Failure Modes

HTTP StatusDescription
400Missing or invalid query parameters.
500Redis cache is incomplete (MISSING_PRICE_DATA) or an internal error occurred.
Retries are usually safe after a brief delay if the issue is cache-related.