Skip to content

Releases: bcnmy/biconomy-client-sdk

v4.4.0

14 May 15:05
5d85886
Compare
Choose a tag to compare

What's Changed

  • Improved DevEx related to the creating and using of sessions
  • added transferOwnerhsip() method on the Smart Account
  • Added gasOffsets parameter to increase gas values

Full Changelog: v4.2.0...v4.4.0

v4.2.0

29 Apr 11:40
8fc9038
Compare
Choose a tag to compare

What's Changed

Minor Changes

Features:

  • Improved getBalances utility helper (da340f)
  • Added 1271 Signature support (fd832fe)
  • Added withdrawal utility helper (7a93d87)
  • Reduce bundle size (7c594fa)
  • Integrate AAErrors (7c594fa)
  • Added 6492 Signature support (fd832fe)
  • Added Token Balances to getSupportedTokens payload (869436)
  • Added gas estimates utility helper (950a521)
  • Added dummy pnd override (8d34d14)

Chores:

  • Modernise tooling (7c594fa)
    • Add changesets
    • Migrate tests to Amoy
    • Add pr lint
    • Add size report
    • Add tree shaking
    • Add code of conduct
    • Update README (table of contents)
    • Add SECURITY.md
    • Replace prettier with biome
    • Replace yarn with bun
    • Remove deprecated Base class
    • Added "NEXT_PUBLIC_BICONOMY_SDK_DEBUG" to support NextJS debugging information
    • Replace jest with vitest
    • Added size threshold checks to PRs
    • Added test coverage checks to PRs
    • Added tsdoc auto-deploy

Fixes:

  • Fix wrong falsy check for user op nonce (f2567)

Biconomy SDK release 9

06 Mar 12:26
466968d
Compare
Choose a tag to compare

Features:

  • Added Speed optimisation, removing redundant gasEstimate call to bundler (2371b2)
  • Added smartAccount.getBalances() method (4b8bae)
  • Added smartAccount.getSupportedTokens() method (6d2fb27)
  • Added smartAccount.deploy() method (be9dc4)
  • Increased checking of the chainId from the bundler, paymaster and the provider (5d2f3)
  • Added entity name to Logger calls (9278ec)
  • Export a 'getChain' by id helper, which returns a viem chain (ab2ba)
  • Add "stateOverride" optional param (20fd54)

Fixes:

  • Fix for encodeAbiParameters inside batched session module (b27061)
  • added flag to skip calldata approval patch (75698)
  • Fixed the particle auth build

Chores:

  • Added tests for ecdsa module (1a8f29)
  • Increased test coverage (329003)
  • Improved issue reporting guidelines (8b9fb5d)
  • Added e2e tests for optimism, ran from GH actions (5051ba)
  • Added ABI SVM test (49c96)
  • Added tests for batched session router testing (2eb9765)

Biconomy SDK release 8

13 Feb 14:28
11a7e6e
Compare
Choose a tag to compare

#117

Features

  • Export bundler / paymaster instances + helpers from master package (1d1f9d)
  • Export modules aliases from master package (d6205c)
  • Added sendTransaction abstraction for buildUserOp + sendUserOp (335c6e)
  • Reduced bundle size (765a3e3)
  • Added bundler abstraction during SmartAccount init (591bbb4)
  • Added e2e tests that speak with prod bundler / paymasters (4b4a53a)
  • Added support for simultaneous ethers + viem signers (8e4b2c8)
  • E2E tests for multichain modules (ecc86e2)
  • E2E tests for session validation modules (4ad7ea7)
  • Added TSDoc (638dae)
  • Make txs more typesafe and default with valueOrData (b1e5b5e)
  • Added createSmartAccountClient alias (232472)
  • Improve dx of using paymster to build userOps (bb54888)
  • Add ethers v6 signer support (9727fd)
  • Improved dx of using gas payments with erc20 (741806)
  • Abstract away chainId: 0fefb35

Chores

  • Removed SmartAccount Base class (be82732)
  • Migrate to viem v2 (8ce04a)
  • Remove common + core-types dependencies (673514)
  • Reincluded simulation flags (25d2be)

Bug Fixes

  • Make silently failing paymaster calls throw an error instead (693bf0)
  • Added string as a supported Transaction value type (b905dc)
  • Removed skipBundlerGasEstimation option (b905dc)
  • Ingest rpcUrl from SupportedSigners (ethers + viem) (f56b4d)

Biconomy SDK Release 7

10 Jan 07:24
7a165b0
Compare
Choose a tag to compare

What's Changed

Smart Account Abstraction

Abstracted the smart account creation process to improve UX and reduce boilerplate code.

Example of creating a smart a smart account and sending user gasless user op.

Before

  import { ethers } from "ethers";	
  import { BiconomySmartAccountV2, DEFAULT_ENTRYPOINT_ADDRESS} from "@biconomy/account";
	import { Bundler } from "@biconomy/bundler";
	import { BiconomyPaymaster } from "@biconomy/paymaster";
	import { PaymasterMode } from "@biconomy/paymaster";
	import {
	  DEFAULT_ECDSA_OWNERSHIP_MODULE,
	  ECDSAOwnershipValidationModule,
	} from "@biconomy/modules";

  let provider = new ethers.providers.JsonRpcProvider("rpcUrl");
  let signer = new ethers.Wallet("private key", provider);

  const bundler = new Bundler({
    bundlerUrl: "bundler url",
    chainId: 80001,
    entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
  });

  const paymaster = new BiconomyPaymaster({
    paymasterUrl: "paymaster url",
    strictMode: false,
  });

  const ecdsaModule = await ECDSAOwnershipValidationModule.create({
    signer: signer,
    moduleAddress: DEFAULT_ECDSA_OWNERSHIP_MODULE,
  });

  const biconomySmartAccountConfig = {
    signer: signer,
    chainId: 80001,
    paymaster: paymaster,
    bundler: bundler,
    entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
    defaultValidationModule: ecdsaModule,
    activeValidationModule: ecdsaModule,
  };

  const biconomySmartAccount = await BiconomySmartAccountV2.create(
    biconomySmartAccountConfig
  );

	const transaction = {
      to: "0xd3C85Fdd3695Aee3f0A12B3376aCD8DC54020221",
      data: "0x"
  }

  let partialUserOp = await biconomySmartAccount.buildUserOp([transaction], 
    paymasterServiceData: {
      mode: PaymasterMode.SPONSORED,
    },
  });

  const userOpResponse = await biconomySmartAccount.sendUserOp(partialUserOp);
  await userOpResponse.wait();

After

  import { ethers } from "ethers";	
  import { BiconomySmartAccountV2} from "@biconomy/account";
	import { PaymasterMode } from "@biconomy/paymaster";

  let provider = new ethers.providers.JsonRpcProvider("rpcUrl");
  let signer = new ethers.Wallet("private key", provider);

  const biconomySmartAccountConfig = {
    signer: signer,
    chainId: 80001
    biconomyPaymasterApiKey: "paymaster api key",
    bundlerUrl: "bundler url"
  };

  const biconomySmartAccount = await BiconomySmartAccountV2.create(
    biconomySmartAccountConfig
  );

	const transaction = {
      to: "0xd3C85Fdd3695Aee3f0A12B3376aCD8DC54020221",
      data: "0x"
  }

  let partialUserOp = await biconomySmartAccount.buildUserOp([transaction], 
    paymasterServiceData: {
      mode: PaymasterMode.SPONSORED,
    },
  );

  const userOpResponse = await biconomySmartAccount.sendUserOp(partialUserOp);
  await userOpResponse.wait();

The smart account uses ECDSA by default, entry point address is also set by default by the SDK.

  1. Abstracted Bundler

    Bundler is now required, this will help us remove the need of providing a chainId as a param in the create method in the future because we can get it from bundler instance or bundler url. Making sure a smart account has a bundler is essential as the smart account is not functional without the bundler.

    The user can now skip creating the instance of the bundler and provide just the bundler url instead to the “create” method of BiconomySmartAccountV2.

    Example of creating a smart account and sending a user op.

     	const provider = new ethers.providers.JsonRpcProvider("https://rpc.ankr.com/polygon_mumbai");
      const signer = new ethers.Wallet("private key", provider);
    
      const bundlerUrl = "bundler url";
      const biconomyPaymasterApiKey = "paymaster api key";
      const chainId = 80001;
    
      let smartAccount = await BiconomySmartAccountV2.create({
          signer,
          chainId,
          bundlerUrl
      })
  2. Abstracted Paymaster

    Paymaster is now abstracted, added a new optional param, “biconomyPaymasterApiKey” which can be provided instead of having to manually create the instance of paymaster by the user.

      const provider = new ethers.providers.JsonRpcProvider("https://rpc.ankr.com/polygon_mumbai");
      const signer = new ethers.Wallet("private key", provider);
    
      const bundlerUrl = "bundler url";
      const biconomyPaymasterApiKey = "paymaster api key";
      const chainId = 80001;
    
      let smartAccount = await BiconomySmartAccountV2.create({
          signer,
          chainId,
          biconomyPaymasterApiKey
      })
  3. Default validation module to ECDSA

    User does not need to provide a “defaultValidationModule” and “activeValidationModule” if the module that he wants to use is ECDSA, this will be set by default on the smart accounts.

      const provider = new ethers.providers.JsonRpcProvider("https://rpc.ankr.com/polygon_mumbai");
      const signer = new ethers.Wallet("private key", provider);
    
      const bundlerUrl = "bundler url";
      const chainId = 80001;
    
    	// ECDSA validation module is assigned by the SDK by default
      let smartAccount = await BiconomySmartAccountV2.create({
          signer,
          chainId,
          bundlerUrl
      })
  4. Abstracted entry point address

    The “entryPointAddress” is now optional. User can skip providing an entry point address and the SDK will set it to “DEFAULT_ENTRYPOINT_ADDRESS” by default.

      const provider = new ethers.providers.JsonRpcProvider("https://rpc.ankr.com/polygon_mumbai");
      const signer = new ethers.Wallet("private key", provider);
    
      const bundlerUrl = "bundler url";
      const chainId = 80001;
    
    	// Entry point address is automatically set to **DEFAULT_ENTRYPOINT_ADDRESS**
      let smartAccount = await BiconomySmartAccountV2.create({
          signer,
          chainId,
          bundlerUrl
      })

    Support for WalletClientSigner

    Our smart accounts now supports WalletClientSigner from “@alchemy/aa-core”.

    User can now pass WalletClientSigner instead of ethers.Signer or keep using ethers.Signer if preferred.

    	 import { WalletClientSigner } from "@alchemy/aa-core";
    	 import { privateKeyToAccount } from "viem/accounts";  	
       import { createWalletClient, http } from "viem";
       import { polygonMumbai } from "viem/chains";
       import { BiconomySmartAccountV2 } from "../src/BiconomySmartAccountV2";
       import { ChainId } from "@biconomy/core-types";
    
        const wallet = privateKeyToAccount(`0x${privKey}`);
    
        const walletClient = createWalletClient({
          account: wallet,
          chain: polygonMumbai,
          transport: http("https://rpc-mumbai.maticvigil.com"),
        });
    
        const ecdsaSigner: WalletClientSigner = new WalletClientSigner(walletClient, "json-rpc");
    
        const account = await BiconomySmartAccountV2.create({
          chainId: ChainId.POLYGON_MUMBAI,
          signer: ecdsaSigner,
          bundlerUrl: "https://bundler.biconomy.io/api/v2/80001/..."
        });

What's Changed

New Contributors

Full Changelog: r6...r7

Biconomy SDK Release 6

15 Nov 19:44
f74b117
Compare
Choose a tag to compare

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

Biconomy SDK Release 5

28 Sep 16:53
5053831
Compare
Choose a tag to compare

Successfully published:

  • @biconomy/account@3.1.0
  • @biconomy/bundler@3.1.0
  • @biconomy/common@3.1.0
  • @biconomy/core-types@3.1.0
  • @biconomy/modules@3.1.0
  • @biconomy/node-client@3.1.0
  • @biconomy/particle-auth@3.1.0
  • @biconomy/paymaster@3.1.0
  • @biconomy/transak@3.1.0
  • @biconomy/web3-auth@3.1.0
  • @biconomy/web3-auth-native@3.1.0

Includes access to modular smart account (BiconomySmartAccountV2)

What's Changed

New Contributors

Full Changelog: r4...r5

Biconomy SDK Release 4

29 Aug 07:57
1615f94
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: r3...r4