This tutorial guides you through the process of creating a user operation, obtaining sponsorship from FuseBox’s verifying paymaster, and submitting this sponsored user operation on-chain using the bundler. By leveraging FuseBox’s capabilities, you can execute on-chain transactions efficiently and without the need for gas.Documentation Index
Fetch the complete documentation index at: https://docs.fuse.io/llms.txt
Use this file to discover all available pages before exploring further.
Obtain an API Key
Start by visiting our Operator Dashboard to generate an API key, a crucial step for accessing our services.Clone the FuseBox Tutorial Template Repository
We’ve prepared a FuseBox tutorial template repository with Typescript, viem, and @fuseio/fusebox-web-sdk to help you get started. Clone the repository and prepare your development environment by executing the following commands:index.ts. Verify your setup by running npm start; you should see Hello world! in the console.
Generate a Private Key
Securely generate and store a private key using the code snippet below inindex.ts:
Initialize the SDK
With FuseSDK, you can create User Operations for ERC-4337 Etherspot Smart Accounts, Bundler services, or Paymasters. It is open source and MIT licensed for maximum flexibility. Ensure you replaceYOUR_FUSEBOX_API_KEY with your actual API key:
Create a Smart Contract Wallet
Use the SDK and your private key to initialize the Etherspot Smart Account. Display the smart account address by running:Submit a Transaction
Submit a transaction from the smart account to0xd8da6bf26964af9d7eed9e03e53415d37aa96045 (vitalik.eth) using 0x1234 as the call data. The FuseSDK will facilitate this operation, including obtaining sponsorship and submission:
vitalik.eth - all seamlessly with a few lines of code.
Should you have any questions or wish to share your project, please reach out to us.