Skip to content

Biconomy SDK Release 6

Compare
Choose a tag to compare
@AmanRaj1608 AmanRaj1608 released this 15 Nov 19:44
· 379 commits to main since this release
f74b117

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 on biconomy_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 and web3-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

New Contributors

Full Changelog: r5...r6