GetBuyWithCryptoQuote

Get a quote containing a TransactionRequest for swapping any token pair.

Usage

using Thirdweb.Pay;
var swapQuoteParams = new BuyWithCryptoQuoteParams(
fromAddress: connectedAddress,
fromChainId: 137,
fromTokenAddress: Thirdweb.Constants.NATIVE_TOKEN_ADDRESS; // MATIC
toTokenAddress: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"; // WMATIC
toAmount: "2" // I want to buy 2 WMATIC
);
var quote = await ThirdwebPay.GetBuyWithCryptoQuote(client, swapQuoteParams);