Biconomy SDK Release 6
What's Changed
-
Security Fix 🐞: Batched Session Router Module signing method and address are updated. Please update to this latest batched session router version. Necessary fix has been done in Batched Session Router module. the module has been redeployed at the address :
0x00000D09967410f8C76752A104c9848b57ebba55
-
Major latency 💨: improvements in 3.1.1 🎉
-
buildUserOp
is updated with default skipBundlerGasEstimation as true. -
buildUserOp now calls the paymaster by default and add completes the userOp.
Code sample before
let partialUserOp = await biconomySmartAccount.buildUserOp([transaction]);
let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: "BICONOMY",
version: "2.0.0",
},
// optional params...
calculateGasLimits: true,
};
const paymasterAndDataResponse =
await biconomyPaymaster.getPaymasterAndData(
partialUserOp,
paymasterServiceData
);
partialUserOp.paymasterAndData = paymasterAndDataResponse.paymasterAndData;
Code sample Now
let partialUserOp = await biconomySmartAccount.buildUserOp(
[transaction],
{
paymasterServiceData: {
mode: PaymasterMode.SPONSORED,
}
}
);
Here we are not passing SmartAccount version as default version is set to 2.0.0
- In paymaster package, the default Smart Account version used is 2.0.0. Earlier it was 1.0.0. So if you are using Smart Account V1 and upgrading to this package, you need to explicitly pass the Smart account version as 1.0.0 as mentioned below:
let partialUserOp = await biconomySmartAccount.buildUserOp([transaction], {}, true, {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: "BICONOMY",
version: "1.0.0",
},
});
-
New Chains support added:
Chiliz (88888, 88882), Astar (592, 81)
-
Helpers method added to update the implementation of Smart Account from V1 to V2 modular smart account
Full example code can be found here bcnmy/sdk-examples@d4c395e
// create the V1 instance
const biconomySmartAccount = await biconomyAccount.init( {accountIndex: config.accountIndex} );
// create partial userOp to update implementation
const tx = await biconomySmartAccount.getUpdateImplementationData();
const moduleSetupData = await biconomySmartAccount.getModuleSetupData();
const partialUserOp = await biconomySmartAccount.updateImplementationUserOp()
console.log('requiredUserOp', partialUserOp);
// send the userOp on chain
// initialize V2 instance and use the flag `scanForUpgradedAccountsFromV1` to set the upgraded address instead of default V2 address generated
const biconomySmartAccountConfigV2 = {
chainId: config.chainId,
rpcUrl: config.rpcUrl,
paymaster: paymaster,
bundler: bundler,
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
defaultValidationModule: ecdsaModule,
activeValidationModule: ecdsaModule,
scanForUpgradedAccountsFromV1: true, // <----------------- important
senderAddress: await biconomySmartAccount.getSmartAccountAddress(config.accountIndex)
};
const biconomySmartAccountV2 = await BiconomySmartAccountV2.create(biconomySmartAccountConfigV2);
- Added
waitForTxHash
hook in UserOperation response. Devs can optionally just rely onbiconomy_getUserOpStatus
to reduce overall time just to get userOpHash or transactionHash and not wait for transaction mined (receipt).
let userOpResponse = await biconomySmartAccount.sendUserOp(userOp)
const transactionDetails1: UserOpStatus = await userOpResponse.waitForTxHash();
console.log('transachion hash', transactionDetails1.transactionHash)
-
Add simulation param. If someone wants to have this call data check on their end for every transaction we have enabled more parameters in our
eth_sendUserOperation
.simulationType
can be:validation (default - only does validation checks)
validation_and_execution
(performs validation & execution checks) former with improved latency
-
Custom session storage client for Session Key Manager module. Anyone can make their own implementation of Session Storage by implementing ISessionStorage interface and pass it to the SessionKeyManager module instance.
-
Internal dependencies version bump for particle-auth.
-
web3-auth
andweb3-auth-native
packages are being deprecated from this release. You can still use the web3Auth directly using the web3Auth packages. Go to the web3Auth dashboard and setup a account and integrate directly for web/native.
Note: Biconomy SDK just takes a signer to initialise the SmartAccount instance for your smart contract wallets. This signer can be anything you pass in the params, web3Auth, privy, particle-auth or any.
auto generated release notes
What's Changed
- Latency Optimisations for buildUserOp by @ankurdubey521 in #307
- add simulation type param by @AmanRaj1608 in #304
- Enable custom session storage client by @innovation-stack in #309
- remove web3auth packages by @livingrockrises in #310
- Add void signer to support smart account address overrides by @livingrockrises in #311
- feat paymaster call for buildUserOp by @AmanRaj1608 in #305
- setup: devs can optionally just rely on biconomy_getUserOpStatus by @livingrockrises in #315
- SMA 294 features/chain-integration by @AmanRaj1608 in #318
- update eoaAddress -> address in Balances Dto by @livingrockrises in #319
- fix/update batched session router address and signing logic by @livingrockrises in #320
- init update readme and keywords in packages by @livingrockrises in #317
- fix/bump particle auth packages by @livingrockrises in #322
- Upgrades methods in Account V1 by @livingrockrises in #306
- default storage client by @livingrockrises in #324
- version bump and changelog by @livingrockrises in #325
- release r6 by @livingrockrises in #326
- chore/update simulation types and names for bundler by @livingrockrises in #327
- Refactor/estimation of userop by @livingrockrises in #329
New Contributors
- @ankurdubey521 made their first contribution in #307
- @innovation-stack made their first contribution in #309
Full Changelog: r5...r6