@getpara/aa-safe 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 SmartAccountClient } from 'permissionless';
2
- import type { SmartAccount4337 } from '@getpara/viem-v2-integration';
2
+ import type { SmartAccount4337 } from '@getpara/viem-v2-integration/aa';
3
3
  import type { CreateSafeSmartAccountParams } from './types.js';
4
4
  export type { CreateSafeSmartAccountParams, SafeTransactionOptions } from './types.js';
5
5
  /**
package/dist/action.js CHANGED
@@ -1,17 +1,20 @@
1
1
  import { createSmartAccountClient } from "permissionless";
2
2
  import { toSafeSmartAccount } from "permissionless/accounts";
3
3
  import { createPimlicoClient } from "permissionless/clients/pimlico";
4
- import { createParaAccount } from "@getpara/viem-v2-integration";
5
- import { SmartAccountError, wrapProviderError, resolveWalletIdentifier } from "@getpara/viem-v2-integration";
4
+ import {
5
+ wrapProviderError,
6
+ ensureExternalWalletChain,
7
+ resolveSigner,
8
+ assertAccountAddress
9
+ } from "@getpara/viem-v2-integration/aa";
6
10
  import { buildPimlicoRpcUrl } from "@getpara/aa-pimlico";
7
11
  import { createPublicClient, http } from "viem";
8
12
  import { entryPoint07Address } from "viem/account-abstraction";
9
13
  async function createSafeSmartAccount(params) {
10
14
  const { para, pimlicoApiKey, chain, rpcUrl, safeVersion = "1.4.1", saltNonce } = params;
11
- const walletAddress = resolveWalletIdentifier(para, params);
12
- if (!walletAddress) return null;
13
15
  const pimlicoRpcUrl = buildPimlicoRpcUrl(chain, pimlicoApiKey);
14
- const viemAccount = createParaAccount(para, walletAddress);
16
+ const viemAccount = resolveSigner(para, params);
17
+ if (!viemAccount) return null;
15
18
  const publicClient = createPublicClient({ chain, transport: http(rpcUrl) });
16
19
  const paymasterClient = createPimlicoClient({
17
20
  entryPoint: {
@@ -42,14 +45,9 @@ async function createSafeSmartAccount(params) {
42
45
  }
43
46
  }
44
47
  });
45
- if (!smartAccountClient.account?.address) {
46
- throw new SmartAccountError({
47
- code: "MISSING_ACCOUNT_ADDRESS",
48
- message: "Safe client must have an account address",
49
- provider: "SAFE"
50
- });
51
- }
48
+ assertAccountAddress(smartAccountClient.account?.address, "Safe client", "SAFE");
52
49
  const sendBatchTransaction = async (calls, options) => {
50
+ await ensureExternalWalletChain(params.signer, chain, "SAFE");
53
51
  const safeOptions = options;
54
52
  try {
55
53
  const hash = await smartAccountClient.sendTransaction({
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Chain } from 'viem';
2
- import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams } from '@getpara/viem-v2-integration';
2
+ import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams } from '@getpara/viem-v2-integration/aa';
3
3
  /**
4
4
  * Configuration for Safe smart account.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/aa-safe",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "Safe smart account integration for Para",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,8 +22,8 @@
22
22
  "test": "vitest run --coverage"
23
23
  },
24
24
  "dependencies": {
25
- "@getpara/aa-pimlico": "2.16.0",
26
- "@getpara/viem-v2-integration": "2.16.0",
25
+ "@getpara/aa-pimlico": "2.17.0",
26
+ "@getpara/viem-v2-integration": "2.17.0",
27
27
  "permissionless": "^0.2.12"
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
  }