Skip to main content
To get started with Warp, let’s get a quote for a cross-chain intent. You can do that using the /intents/route endpoint. To get a quote, you’ll need the destination chain, the token and amount on that chain, and the account address:
Get Quote
const baseUrl = "https://v1.orchestrator.rhinestone.dev";
const endpoint = `${baseUrl}/intents/route`;
const apiKey = "YOUR_RHINESTONE_API_KEY";

const payload = {
  destinationChainId: 8453,
  tokenRequests: [
    {
      tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      amount: "5000000",
    },
  ],
  account: {
    address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    accountType: "EOA",
  },
};

const res = await fetch(endpoint, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": apiKey,
    Accept: "application/json",
  },
  body: JSON.stringify(payload),
});

if (!res.ok) {
  const errorBody = await res.text().catch(() => "");
  throw new Error(
    `Request failed: ${res.status} ${res.statusText}${errorBody ? ` - ${errorBody}` : ""}`
  );
}

const data = await res.json();
console.log("Quote:", data);
The API response includes:
  • intentOp: the list of intent elements for the user to sign, along with intent metadata such as token prices
  • intentCost: the cost of the intent in input tokens
  • tokenRequirements: the list of token requirements to fulfill

Sponsorship

You can mark the intent as sponsored (covering the gas and bridging costs for the user) by setting the sponsorSettings field:
Sponsor the Intent
const payload = {
  destinationChainId: 8453,
  tokenRequests: [
    {
      tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      amount: "5000000",
    },
  ],
  account: {
    address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    accountType: "EOA",
  },
  options: {
    sponsorSettings: {
      gasSponsored: true,
      bridgeFeesSponsored: true,
      swapFeesSponsored: false
    }
  }
};

Source Chain / Token

You can select which tokens and/or chains to use as the source of funds. To limit the source of funds to specific chains:
Select Input Chains
const payload = {
  // …
  accountAccessList: {
    chainIds: [10, 8453]
  }
};
To limit the source of funds to specific tokens:
Select Input Tokens
const payload = {
  // …
  accountAccessList: {
    tokens: ["USDC", "0x4200000000000000000000000000000000000006"]
  }
};
To limit the source of funds to specific chains and tokens:
Select Input Chains and Tokens
const payload = {
  // …
  accountAccessList: {
    chainIds: [10, 8453],
    tokens: ["USDC"]
  }
};
or:
Select Input Chains and Tokens
const payload = {
  // …
  accountAccessList: {
    chainTokens: {
      "10": ["USDC"],
      "8453": ["WETH"]
    }
  }
};

Next Steps

Token Requirements

What the intent requirements are and how to fulfill them