@getpara/aa-thirdweb 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 Account } from 'thirdweb/wallets';
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 { CreateThirdwebSmartAccountParams } from './types.js';
4
4
  export type { CreateThirdwebSmartAccountParams } from './types.js';
5
5
  /**
package/dist/action.js CHANGED
@@ -2,14 +2,19 @@ import { createThirdwebClient } from "thirdweb";
2
2
  import { defineChain } from "thirdweb/chains";
3
3
  import { smartWallet } from "thirdweb/wallets";
4
4
  import { create7702MinimalAccount } from "thirdweb/wallets/smart";
5
- import { createParaAccount } from "@getpara/viem-v2-integration";
6
- import { wrapProviderError, resolveWalletIdentifier } from "@getpara/viem-v2-integration";
5
+ import {
6
+ wrapProviderError,
7
+ ensureExternalWalletChain,
8
+ resolveSigner,
9
+ rejectExternalWallet7702
10
+ } from "@getpara/viem-v2-integration/aa";
7
11
  import { createPublicClient, http } from "viem";
8
12
  async function createThirdwebSmartAccount(params) {
9
- const { para, clientId, chain, mode = "4337", sponsorGas = true, factoryAddress, accountAddress } = params;
10
- const walletAddress = resolveWalletIdentifier(para, params);
11
- if (!walletAddress) return null;
12
- const viemAccount = createParaAccount(para, walletAddress);
13
+ const { para, clientId, chain, mode: rawMode = "4337", sponsorGas = true, factoryAddress, accountAddress } = params;
14
+ const mode = rawMode;
15
+ if (mode === "7702") rejectExternalWallet7702(params.signer, "THIRDWEB");
16
+ const viemAccount = resolveSigner(para, params);
17
+ if (!viemAccount) return null;
13
18
  const publicClient = createPublicClient({
14
19
  chain,
15
20
  transport: http()
@@ -78,6 +83,7 @@ async function createThirdwebSmartAccount(params) {
78
83
  });
79
84
  }
80
85
  const sendTransaction = async ({ to, value, data }, txOptions) => {
86
+ await ensureExternalWalletChain(params.signer, chain, "THIRDWEB");
81
87
  const thirdwebOptions = txOptions;
82
88
  try {
83
89
  const result = await thirdwebAccount.sendTransaction({
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams, SmartAccountModeParam } from '@getpara/viem-v2-integration';
1
+ import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams, SmartAccountModeParam } from '@getpara/viem-v2-integration/aa';
2
2
  /**
3
3
  * Configuration for Thirdweb smart account.
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/aa-thirdweb",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "Thirdweb smart account integration for Para",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "test": "vitest run --coverage"
23
23
  },
24
24
  "dependencies": {
25
- "@getpara/viem-v2-integration": "2.16.0",
25
+ "@getpara/viem-v2-integration": "2.17.0",
26
26
  "thirdweb": "^5.118.2"
27
27
  },
28
28
  "peerDependencies": {
@@ -34,5 +34,5 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "fbe96a062b308d04105213378c12c38ee973c798"
37
+ "gitHead": "3ed1f835b97ae720f1ac747611296e3b86f61138"
38
38
  }