Helpful code snippets to interact with Safe Smart Accounts using Gelato’s bundler service and the permissionless.js library. This project includes scripts for gas estimation and sending transactions with Safe Smart Accounts.
- Install dependencies:
pnpm install
- Create a
.env
file with the following variables:
GELATO_API_KEY=your_gelato_api_key
PRIVATE_KEY=your_private_key
RPC_URL=your_rpc_url
To estimate gas for a transaction:
pnpm tsx src/estimate.ts
To send a transaction using Safe Smart Account:
pnpm tsx src/sendTxn.ts
- Safe Smart Account integration
- Gas estimation for UserOperations
- Transaction sending through Gelato's bundler service
- Support for Polygon mainnet (chainId: 137)
├── src/
│ ├── estimate.ts # Gas estimation script
│ └── sendTxn.ts # Transaction sending script
├── .env # Environment variables (not tracked in git)
├── .gitignore # Git ignore file
└── package.json # Project dependencies
@safe-global/protocol-kit
@safe-global/safe-core-sdk-types
@gelatonetwork/relay-sdk
ethers
dotenv
permissionless
viem