Skip to main content
Cashmere runs two public HTTPS APIs. Neither needs an API key. The API Reference lists every parameter and field. This page covers what an integration needs to get right.

Gas API (gas.cashmere.exchange)

Purpose

The Gas API prices each route and signs a fee quote that the Cashmere contracts verify on-chain. A quote is valid for about 100 seconds.

REST Endpoints

GET /getEcdsaSig_native

  • fee is in USDC base units (6 decimals) with isNative=false, and in wei with isNative=true. It pays for the mint on the destination chain, so it depends mostly on where the USDC goes: in October 2026, 0.19 USDC into most chains, 0.79 into Solana and about 1.48 into Ethereum. Request a quote for every transfer instead of hardcoding a fee.
  • deadline is in unix seconds, about 100 seconds after the quote was issued. The contract reverts after it.
  • signature is a 65-byte ECDSA signature. Pass fee, deadline and signature to the contract unchanged, and with isNative=true send fee as the transaction’s value.
Signature payload The contract recomputes this digest and checks the signature against it with ecrecover, without the \x19Ethereum Signed Message prefix:

GET /getEd25519Sig_native

fee is in USDC base units with isNative=false. With isNative=true it is in lamports on Solana (9 decimals), octas on Aptos (8) or MIST on Sui (9). Message encoding message holds exactly the bytes that were signed, little-endian: 26 bytes, or 25 without version. This is the Borsh layout the Solana program verifies, and the BCS layout of TransferParamsV2 on Aptos and Sui. On Solana, put publicKey, message and signature in an Ed25519Program instruction right before the transfer instruction. Aptos and Sui take the signature as a call argument. See Signed Payloads.

WebSocket Broadcast

wss://gas.cashmere.exchange/subscribe sends the current fees and token prices as soon as you connect. Use it to show live fees in a UI, but request a signed quote right before each transfer: only a quote carries a signature.
  • Keys are chain names (ethereum, arbitrum, solana…), not domain IDs.
  • fee.<destination>.native is in the source chain’s smallest native unit, and usd is in USDC base units ("190000" is 0.19 USDC).
  • Token prices are USD amounts as decimal strings, the same as GET /tokenPrices.

Operational Notes

  • Request a quote right before the user signs, and a fresh one if more than about 70 seconds have passed: the contracts revert once block.timestamp passes deadline.
  • Booleans must be lowercase true or false.
  • A missing isNative, an unknown domain or any other bad input returns HTTP 500 with {"error":"Internal Server Error"}, not 400. Check your parameters before retrying.
  • A 5xx on a valid request means the API can’t price the route right now: retry with backoff, and never sign with an expired quote.
  • For live fees, use the WebSocket instead of polling the quote endpoints.

Transaction APIs (kapi.cashmere.exchange)

/transactionsmainnet

Every mainnet transfer made through Cashmere, newest first.
  • Native fees in wei can exceed Number.MAX_SAFE_INTEGER, and JSON.parse then rounds them. Use them for display, or parse the body with a big-integer JSON parser.
  • destination_tx_hash can be all zeros even when the status is success.
  • Responses are cached for 5 seconds, so polling more often than that returns the same page.

/transactions

The same query parameters and schema, for testnet transfers. It has no data newer than October 2025.

Points & Leaderboard API (kapi.cashmere.exchange)

Public endpoints for Cashmere’s points program and protocol stats. Stats responses are cached for 60 seconds, and leaderboard responses for 5. The Analytics reference shows every payload. Points and multipliers are floats; round them for display. An unknown profile returns 404 {"error":"user not found"}.

Smart Contract Integration (Quick Ref)

  1. Request a quote. On EVM, call /getEcdsaSig_native with isV2=true; on Solana, Aptos and Sui, call /getEd25519Sig_native with version=2. Always pass isNative.
  2. Fill the contract parameters:
    • fee, deadline and signature from the quote, unchanged;
    • maxFee from Circle’s minimumFee at https://iris-api.circle.com/v2/burn/USDC/fees/{source}/{destination} (see From Quote to Call);
    • gasDropAmount 0, since gas drop is not offered;
    • on EVM, hookData 0x00: Circle rejects empty hook data.
  3. Approve amount USDC (EVM). With isNative=true, send fee as the transaction’s value on EVM, and on Sui pass it as a coin split from gas; the Solana and Aptos contracts take it from the sender’s balance.
  4. Submit before deadline.
  5. Poll /transactionsmainnet until destination_tx_status is success.
Don’t cache or reuse quotes. Each one is signed for a single route, fee mode and CCTP version, and expires about 100 seconds after it is issued.