IntentBuilder
The IntentBuilder is the core component of intents.js
, responsible for executing the array of intents. Once you've created your intents, the next step is to pass them to the IntentBuilder for execution.
Here’s how to use the IntentBuilder:
Parameters for execute
execute
The execute
function takes four parameters:
intents: The array of intents you created.
signer: A signer object to sign the intent with the user's private key.
Here’s how you can create a signer using ethers.js
and MetaMask:
nodeUrl: A string containing your provider's URL, used to make blockchain RPC calls.
salt: An optional parameter representing the salt of your wallet, defaulting to
0
.
Helper Function: getSender
getSender
The IntentBuilder also includes a getSender
helper function, which converts your Externally Owned Account (EOA) wallet to your Smart Wallet (SW) address.
Here’s how to use it:
Last updated