quote

Retrieves a Universal Bridge quote for the provided buy intent. The quote will specify the necessary originAmount to receive the desired destinationAmount , which is specified with the buyAmountWei option.

Example

import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
const quote = await Bridge.Buy.quote({
originChainId: 1,
originTokenAddress: NATIVE_TOKEN_ADDRESS,
destinationChainId: 10,
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
buyAmountWei: toWei("0.01"),
client: thirdwebClient,
});

This will return a quote that might look like:

{
originAmount: 10000026098875381n,
destinationAmount: 1000000000000000000n,
blockNumber: 22026509n,
timestamp: 1741730936680,
estimatedExecutionTimeMs: 1000
intent: {
originChainId: 1,
originTokenAddress: NATIVE_TOKEN_ADDRESS,
destinationChainId: 10,
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
buyAmountWei: 1000000000000000000n
}
}

The quote is an estimate for how much you would expect to pay for a specific buy. This quote is not guaranteed and you should use Buy.prepare to get a finalized quote with transaction data ready for execution. So why use quote ? The quote function is sometimes slightly faster than prepare , and can be used before the user connects their wallet.

You can access this functions input and output types with Buy.quote.Options and Buy.quote.Result , respectively.

function quote(options: Options): Promise<Result>;

Parameters

The options for the quote.

Type

let options: Options;

Returns

let returnType: Promise<Result>;

A promise that resolves to a non-finalized quote for the requested buy.