Skip to content

Commit b33d30d

Browse files
joaquim-vergesIDubuque
authored andcommitted
[SmartWallet] expose data in smart wallet utils (#1867)
1 parent f6b49c7 commit b33d30d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.changeset/new-poems-exercise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/wallets": patch
3+
---
4+
5+
Expose data param for smart wallet util functions

packages/wallets/src/evm/connectors/smart-wallet/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
isContractDeployed,
44
ThirdwebSDK,
55
} from "@thirdweb-dev/sdk";
6+
import { BytesLike } from "ethers";
67

78
export type AccessibleSmartWallets = {
89
owned: string;
@@ -81,12 +82,13 @@ export async function isSmartWalletDeployed(
8182
chain: ChainOrRpcUrl,
8283
factoryAddress: string,
8384
personalWalletAddress: string,
85+
data: BytesLike = "0x",
8486
) {
8587
const readOnlySDK = getSDK(chain);
8688
const factoryContract = await readOnlySDK.getContract(factoryAddress);
8789
const accountAddress = await factoryContract.call("getAddress", [
8890
personalWalletAddress,
89-
"0x",
91+
data,
9092
]);
9193
const isDeployed = await isContractDeployed(
9294
accountAddress,
@@ -106,12 +108,13 @@ export async function getSmartWalletAddress(
106108
chain: ChainOrRpcUrl,
107109
factoryAddress: string,
108110
personalWalletAddress: string,
111+
data: BytesLike = "0x",
109112
): Promise<string> {
110113
const readOnlySDK = getSDK(chain);
111114
const factoryContract = await readOnlySDK.getContract(factoryAddress);
112115
const accountAddress = await factoryContract.call("getAddress", [
113116
personalWalletAddress,
114-
"0x",
117+
data,
115118
]);
116119
return accountAddress;
117120
}

0 commit comments

Comments
 (0)