Send transactions
This guide will teach you how to send a single EVM transaction. Smart Wallets make it easy!
Prerequisites
- API key from your dashboard
- A funded Smart Wallet to cover gas fees (or a gas manager policy to sponsor gas)
Implementation
React
JavaScript
API
Prerequisites
You can use the useSendCalls
hook to send calls, followed by the useWaitForCallsStatus
hook to wait for confirmation.
See the useSendCalls
SDK reference for
full descriptions of the parameters used in the above example.
Advanced
Encoding function data
If you need to encode function data (instead of just sending value), it is easy to do so using Viem or Foundry.
React
JavaScript
API
Usage with prepare calls
Instead of using the sendCalls
abstraction, you can prepare and send calls using underlying methods in React or using the JavaScript client. Usage of the capability will be the same as when using send calls. It is recommended to use prepareCalls
if you want to inspect the prepared call prior to prompting the user for signature.
React
JavaScript
Prerequisites
You can use React hooks to prepare, sign, and send transactions.
See the usePrepareCalls
,
useSendPreparedCalls
, and
useSmartWalletClient
SDK reference for
full descriptions of the parameters used in the above example.
Next steps
Build more:
Troubleshooting: