Learn how to setup gas-less transactions with thirdweb.
Learn more about Gassless User Experience here.
Gasless Transactions require a Relayer to forward the transactions to the blockchain and pay the gas costs.
Relayer can be self-managed or through various service providers:
Using OpenZeppelin Defender
To setup gasless transaction using OpenZeppelin Defender we would need to setup Autotask and Relay.
- Sign up for OpenZeppelin Defender
- Create a Relayer in the Dashboard under Relay.
- Name: your desire name for the relayer
- Network: the network that you want the relayer to operates in
- Deposit gas funds into the Relayer. Transferring ETH / MATIC into the Relayer address.
- Create an Autotask in the Dashboard under
Autotask
.- Name: your desire name for the autotask.
- Trigger: set to
Webhook
- Connect to a relayer: Select the Relayer you just created.
- Code: Copy the code from our GitHub and paste it in the Code box.
- Copy the Webhook URI from the Autotask dashboard.
- Paste the Webhook URI into the SDK constructor options. For example:
new ThirdwebSDK(signerOrProvider, {
gasless: {
openzeppelin: {
relayerUrl: "https://api.defender.openzeppelin.com/autotasks/...",
},
},
});