import { Bridge } from "thirdweb";
import { ethereum } from "thirdweb/chains";
import { NATIVE_TOKEN_ADDRESS, toWei } from "thirdweb/utils";
const preparedOnramp = await Bridge.Onramp.prepare({
client: thirdwebClient,
onramp: "stripe",
chainId: ethereum.id,
tokenAddress: NATIVE_TOKEN_ADDRESS,
receiver: "0x...", // receiver's address
amount: toWei("10"), // 10 of the destination token
// Optional params:
// sender: "0x...", // sender's address
// onrampTokenAddress: NATIVE_TOKEN_ADDRESS, // token to initially onramp to
// onrampChainId: 1, // chain to initially onramp to
// currency: "USD",
// maxSteps: 2,
// purchaseData: { customId: "123" }
});
console.log(preparedOnramp.link); // URL to redirect the user to
console.log(preparedOnramp.currencyAmount); // Amount in fiat the user will pay