- Testnets: Using a testnet, transactions with Sequence are free, not requiring a fee option inputted into the SDK call.
- Sponsored Contract or Wallet: Having the smart contract or wallet sponsored, not requiring a fee option inputted into the SDK call. You can learn about sponsoring a contract or wallet here.
- Fee Options: Using a Sequence API to get a custom fee quote and fee options object, pass both into the waas sdk call. See below.
You will know if you need to either sponsor your contract or wallet, or, implement fee options if you receive the following response from the WaaS API:
Implementing Fee Options
Before implementing the following “Fee Options” flow, you will need to ensure that your wallet has sufficienct funds to pay for your transaction on the specific network in the native currency. You can either transfer tokens to your wallet, or, use the on-ramp feature using the Web SDK solution. And ensure that the following packages are installed:1
Generalized API for Fee Options & Fee Quote
To implement fee options passed into the request, a first call to
sequence.feeOptions({...})
is required, which is wrapped in the following function checkTransactionFeeOptions
:In the following examples, the
sequence
variable is an Embbeded Wallet object intialized from the @0xsequence/waas
npm package with the WaasConfigKey
and ProjectAccessKey
. Learn how to do this here2
Crafting Fee Options & Fee Quote with Transaction