@getpara/aa-biconomy 2.16.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/action.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { MeeClient } from '@biconomy/abstractjs';
2
- import type { SmartAccount4337, SmartAccount7702 } from '@getpara/viem-v2-integration';
2
+ import type { SmartAccount4337, SmartAccount7702 } from '@getpara/viem-v2-integration/aa';
3
3
  import type { CreateBiconomySmartAccountParams } from './types.js';
4
4
  export type { CreateBiconomySmartAccountParams } from './types.js';
5
5
  /**
package/dist/action.js CHANGED
@@ -6,15 +6,22 @@ import {
6
6
  getDefaultMEENetworkUrl,
7
7
  getDefaultMeeGasTank
8
8
  } from "@biconomy/abstractjs";
9
- import { createParaAccount } from "@getpara/viem-v2-integration";
10
- import { SmartAccountError, wrapProviderError, resolveWalletIdentifier } from "@getpara/viem-v2-integration";
9
+ import {
10
+ SmartAccountError,
11
+ wrapProviderError,
12
+ ensureExternalWalletChain,
13
+ resolveSigner,
14
+ rejectExternalWallet7702,
15
+ assertAccountAddress
16
+ } from "@getpara/viem-v2-integration/aa";
11
17
  import { http } from "viem";
12
18
  const TESTNET_MEE_NETWORK_API_KEY = "mee_3Zmc7H6Pbd5wUfUGu27aGzdf";
13
19
  async function createBiconomySmartAccount(params) {
14
- const { para, chain, rpcUrl, meeUrl, apiKey, mode = "4337" } = params;
15
- const walletAddress = resolveWalletIdentifier(para, params);
16
- if (!walletAddress) return null;
17
- const viemAccount = createParaAccount(para, walletAddress);
20
+ const { para, chain, rpcUrl, meeUrl, apiKey, mode: rawMode = "4337" } = params;
21
+ const mode = rawMode;
22
+ if (mode === "7702") rejectExternalWallet7702(params.signer, "BICONOMY");
23
+ const viemAccount = resolveSigner(para, params);
24
+ if (!viemAccount) return null;
18
25
  const isTestnet = chain.testnet;
19
26
  const resolvedUrl = meeUrl || (isTestnet ? getDefaultMEENetworkUrl(true) : void 0);
20
27
  const resolvedApiKey = isTestnet ? TESTNET_MEE_NETWORK_API_KEY : apiKey;
@@ -44,13 +51,7 @@ async function createBiconomySmartAccount(params) {
44
51
  (d) => (d.chainId ?? d.chain?.id) === chainId
45
52
  );
46
53
  const accountAddress = deployment?.address ?? meeClient.account.deployments[0]?.address;
47
- if (!accountAddress) {
48
- throw new SmartAccountError({
49
- code: "MISSING_ACCOUNT_ADDRESS",
50
- message: "Unable to determine account address from Biconomy MEE client",
51
- provider: "BICONOMY"
52
- });
53
- }
54
+ assertAccountAddress(accountAddress, "Biconomy MEE client", "BICONOMY");
54
55
  const sponsorshipConfig = {
55
56
  sponsorship: true,
56
57
  sponsorshipOptions: {
@@ -60,6 +61,7 @@ async function createBiconomySmartAccount(params) {
60
61
  }
61
62
  };
62
63
  const sendBatchTransaction = async (calls) => {
64
+ await ensureExternalWalletChain(params.signer, chain, "BICONOMY");
63
65
  const quoteParams = {
64
66
  instructions: [
65
67
  {
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Url } from '@biconomy/abstractjs';
2
- import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams, SmartAccountModeParam } from '@getpara/viem-v2-integration';
2
+ import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams, SmartAccountModeParam } from '@getpara/viem-v2-integration/aa';
3
3
  /**
4
4
  * Configuration for Biconomy smart account.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/aa-biconomy",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "Biconomy smart account integration for Para",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@biconomy/abstractjs": "1.1.21",
26
- "@getpara/viem-v2-integration": "2.16.0",
26
+ "@getpara/viem-v2-integration": "2.17.0",
27
27
  "@safe-global/types-kit": "^3.0.0"
28
28
  },
29
29
  "peerDependencies": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "fbe96a062b308d04105213378c12c38ee973c798"
38
+ "gitHead": "3ed1f835b97ae720f1ac747611296e3b86f61138"
39
39
  }