thirdweb 5.43.2 → 5.43.3-nightly-baefa5e9c7d72fd8645b0e33452a83fc0ef229d4-20240804000345
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/cjs/extensions/marketplace/direct-listings/utils.js +1 -0
- package/dist/cjs/extensions/marketplace/direct-listings/utils.js.map +1 -1
- package/dist/cjs/extensions/marketplace/english-auctions/utils.js +1 -0
- package/dist/cjs/extensions/marketplace/english-auctions/utils.js.map +1 -1
- package/dist/cjs/react/core/hooks/contract/useContractEvents.js +32 -2
- package/dist/cjs/react/core/hooks/contract/useContractEvents.js.map +1 -1
- package/dist/cjs/react/core/hooks/contract/useReadContract.js.map +1 -1
- package/dist/cjs/react/core/hooks/others/useWalletBalance.js +17 -2
- package/dist/cjs/react/core/hooks/others/useWalletBalance.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js +1 -0
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/cjs/react/core/utils/wallet.js +19 -1
- package/dist/cjs/react/core/utils/wallet.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +74 -4
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +8 -9
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/transaction/actions/send-transaction.js +76 -5
- package/dist/cjs/transaction/actions/send-transaction.js.map +1 -1
- package/dist/cjs/transaction/prepare-contract-call.js +18 -13
- package/dist/cjs/transaction/prepare-contract-call.js.map +1 -1
- package/dist/cjs/transaction/read-contract.js +39 -6
- package/dist/cjs/transaction/read-contract.js.map +1 -1
- package/dist/cjs/utils/fetch.js +12 -1
- package/dist/cjs/utils/fetch.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/in-app.js +4 -1
- package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js +1 -0
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/esm/extensions/marketplace/direct-listings/utils.js +1 -0
- package/dist/esm/extensions/marketplace/direct-listings/utils.js.map +1 -1
- package/dist/esm/extensions/marketplace/english-auctions/utils.js +1 -0
- package/dist/esm/extensions/marketplace/english-auctions/utils.js.map +1 -1
- package/dist/esm/react/core/hooks/contract/useContractEvents.js +32 -2
- package/dist/esm/react/core/hooks/contract/useContractEvents.js.map +1 -1
- package/dist/esm/react/core/hooks/contract/useReadContract.js.map +1 -1
- package/dist/esm/react/core/hooks/others/useWalletBalance.js +17 -2
- package/dist/esm/react/core/hooks/others/useWalletBalance.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js +1 -0
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/esm/react/core/utils/wallet.js +19 -1
- package/dist/esm/react/core/utils/wallet.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +74 -4
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +8 -9
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/transaction/actions/send-transaction.js +76 -5
- package/dist/esm/transaction/actions/send-transaction.js.map +1 -1
- package/dist/esm/transaction/prepare-contract-call.js +18 -13
- package/dist/esm/transaction/prepare-contract-call.js.map +1 -1
- package/dist/esm/transaction/read-contract.js +39 -6
- package/dist/esm/transaction/read-contract.js.map +1 -1
- package/dist/esm/utils/fetch.js +12 -1
- package/dist/esm/utils/fetch.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/in-app/web/in-app.js +4 -1
- package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/index.js +1 -0
- package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/types.d.ts +1 -0
- package/dist/types/extensions/marketplace/direct-listings/types.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/utils.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/types.d.ts +1 -0
- package/dist/types/extensions/marketplace/english-auctions/types.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/utils.d.ts.map +1 -1
- package/dist/types/react/core/hooks/contract/useContractEvents.d.ts +32 -2
- package/dist/types/react/core/hooks/contract/useContractEvents.d.ts.map +1 -1
- package/dist/types/react/core/hooks/contract/useReadContract.d.ts +28 -6
- package/dist/types/react/core/hooks/contract/useReadContract.d.ts.map +1 -1
- package/dist/types/react/core/hooks/others/useWalletBalance.d.ts +17 -2
- package/dist/types/react/core/hooks/others/useWalletBalance.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts +1 -0
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts +19 -1
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +74 -4
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +17 -2
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +15 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +1 -0
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/transaction/actions/send-transaction.d.ts +76 -5
- package/dist/types/transaction/actions/send-transaction.d.ts.map +1 -1
- package/dist/types/transaction/prepare-contract-call.d.ts +18 -13
- package/dist/types/transaction/prepare-contract-call.d.ts.map +1 -1
- package/dist/types/transaction/read-contract.d.ts +39 -6
- package/dist/types/transaction/read-contract.d.ts.map +1 -1
- package/dist/types/utils/fetch.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts +4 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +1 -0
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/extensions/marketplace/direct-listings/types.ts +1 -0
- package/src/extensions/marketplace/direct-listings/utils.ts +1 -0
- package/src/extensions/marketplace/english-auctions/types.ts +1 -0
- package/src/extensions/marketplace/english-auctions/utils.ts +1 -0
- package/src/react/core/hooks/contract/useContractEvents.ts +32 -2
- package/src/react/core/hooks/contract/useReadContract.ts +28 -6
- package/src/react/core/hooks/others/useWalletBalance.ts +17 -2
- package/src/react/core/hooks/wallets/useActiveAccount.ts +1 -0
- package/src/react/core/utils/wallet.ts +19 -1
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +74 -4
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +17 -2
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +15 -0
- package/src/react/web/ui/PayEmbed-disconnected.test.tsx +5 -3
- package/src/react/web/ui/PayEmbed.test.tsx +17 -16
- package/src/react/web/ui/PayEmbed.tsx +9 -4
- package/src/transaction/actions/send-transaction.ts +76 -5
- package/src/transaction/prepare-contract-call.ts +18 -13
- package/src/transaction/read-contract.ts +39 -6
- package/src/utils/encoding/hex.test.ts +11 -0
- package/src/utils/fetch.ts +12 -1
- package/src/version.ts +1 -1
- package/src/wallets/in-app/web/in-app.ts +4 -1
- package/src/wallets/in-app/web/lib/auth/index.ts +1 -0
- package/src/wallets/smart/smart-wallet-integration.test.ts +6 -0
@@ -14,18 +14,89 @@ export type SendTransactionOptions = {
|
|
14
14
|
};
|
15
15
|
|
16
16
|
/**
|
17
|
-
* Sends a transaction using the provided
|
17
|
+
* Sends a transaction using the provided account.
|
18
|
+
*
|
19
|
+
* You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/typescript/v5/extensions/use).
|
18
20
|
* @param options - The options for sending the transaction.
|
19
|
-
* @returns A promise that resolves to the transaction
|
20
|
-
* @throws An error if the
|
21
|
+
* @returns A promise that resolves to the transaction result.
|
22
|
+
* @throws An error if the transaction reverts.
|
21
23
|
* @transaction
|
22
24
|
* @example
|
25
|
+
*
|
26
|
+
* ### Using a prepared contract call
|
27
|
+
*
|
28
|
+
* ```ts
|
29
|
+
* import { sendTransaction, getContract, prepareContractCall } from "thirdweb";
|
30
|
+
* import { sepolia } from "thirdweb/chains";
|
31
|
+
*
|
32
|
+
* const contract = getContract({
|
33
|
+
* address: "0x...",
|
34
|
+
* chain: sepolia,
|
35
|
+
* client,
|
36
|
+
* });
|
37
|
+
*
|
38
|
+
* const transaction = prepareContractCall({
|
39
|
+
* contract,
|
40
|
+
* method: "function transfer(address to, uint256 value)",
|
41
|
+
* params: [to, value],
|
42
|
+
* });
|
43
|
+
*
|
44
|
+
* const { transactionHash } = await sendTransaction({
|
45
|
+
* account,
|
46
|
+
* transaction,
|
47
|
+
* });
|
48
|
+
* ```
|
49
|
+
*
|
50
|
+
* ### Using a write extension
|
51
|
+
*
|
23
52
|
* ```ts
|
24
|
-
* import { sendTransaction } from "thirdweb";
|
53
|
+
* import { sendTransaction, getContract } from "thirdweb";
|
54
|
+
* import { sepolia } from "thirdweb/chains";
|
55
|
+
* import { mintTo } from "thirdweb/extensions/erc721";
|
56
|
+
*
|
57
|
+
* const contract = getContract({
|
58
|
+
* address: "0x...",
|
59
|
+
* chain: sepolia,
|
60
|
+
* client,
|
61
|
+
* });
|
62
|
+
*
|
63
|
+
* const transaction = mintTo({
|
64
|
+
* contract,
|
65
|
+
* to: "0x...",
|
66
|
+
* nft: {
|
67
|
+
* name: "NFT Name",
|
68
|
+
* description: "NFT Description",
|
69
|
+
* image: "https://example.com/image.png",
|
70
|
+
* },
|
71
|
+
* });
|
72
|
+
*
|
73
|
+
* const { transactionHash } = await sendTransaction({
|
74
|
+
* account,
|
75
|
+
* transaction,
|
76
|
+
* });
|
77
|
+
* ```
|
78
|
+
*
|
79
|
+
* ### Using a prepared transaction
|
80
|
+
*
|
81
|
+
* ```ts
|
82
|
+
* import { sendTransaction, getContract, prepareTransaction } from "thirdweb";
|
83
|
+
* import { sepolia } from "thirdweb/chains";
|
84
|
+
*
|
85
|
+
* const contract = getContract({
|
86
|
+
* address: "0x...",
|
87
|
+
* chain: sepolia,
|
88
|
+
* client,
|
89
|
+
* });
|
90
|
+
*
|
91
|
+
* const transaction = prepareTransaction({
|
92
|
+
* contract,
|
93
|
+
* to: "0x...",
|
94
|
+
* value: toWei("0.1"),
|
95
|
+
* });
|
25
96
|
*
|
26
97
|
* const { transactionHash } = await sendTransaction({
|
27
98
|
* account,
|
28
|
-
* transaction
|
99
|
+
* transaction,
|
29
100
|
* });
|
30
101
|
* ```
|
31
102
|
*/
|
@@ -63,36 +63,41 @@ export type PrepareContractCallOptions<
|
|
63
63
|
* @returns A promise that resolves to the prepared transaction.
|
64
64
|
* @transaction
|
65
65
|
* @example
|
66
|
-
*
|
66
|
+
*
|
67
|
+
* ### Usage with a human-readable method signature:
|
68
|
+
*
|
67
69
|
* ```ts
|
68
70
|
* import { prepareContractCall } from "thirdweb";
|
69
71
|
*
|
70
|
-
* const transaction =
|
72
|
+
* const transaction = prepareContractCall({
|
71
73
|
* contract,
|
72
74
|
* method: "function transfer(address to, uint256 value)",
|
73
75
|
* params: [to, value],
|
74
76
|
* });
|
75
77
|
* ```
|
76
|
-
*
|
77
|
-
* Usage with explicit gas price and/or value:
|
78
|
+
*
|
79
|
+
* ### Usage with explicit gas price and/or value:
|
80
|
+
*
|
78
81
|
* ```ts
|
79
82
|
* import { prepareContractCall } from "thirdweb";
|
83
|
+
* import { toWei } from "thirdweb/utils";
|
80
84
|
*
|
81
|
-
* const transaction =
|
85
|
+
* const transaction = prepareContractCall({
|
82
86
|
* contract,
|
83
87
|
* method: "function transfer(address to, uint256 value)",
|
84
88
|
* params: [to, value],
|
85
89
|
* maxFeePerGas: 30n,
|
86
90
|
* maxPriorityFeePerGas: 1n,
|
87
|
-
* value:
|
91
|
+
* value: toWei("0.01"),
|
88
92
|
* });
|
89
93
|
* ```
|
90
|
-
*
|
91
|
-
* Usage with a JSON ABI function object:
|
94
|
+
*
|
95
|
+
* ### Usage with a JSON ABI function object:
|
96
|
+
*
|
92
97
|
* ```ts
|
93
98
|
* import { prepareContractCall } from "thirdweb";
|
94
99
|
*
|
95
|
-
* const transaction =
|
100
|
+
* const transaction = prepareContractCall({
|
96
101
|
* contract,
|
97
102
|
* method: {
|
98
103
|
* name: "transfer",
|
@@ -107,8 +112,9 @@ export type PrepareContractCallOptions<
|
|
107
112
|
* params: [to, value],
|
108
113
|
* });
|
109
114
|
* ```
|
110
|
-
*
|
111
|
-
* Usage with a the ABI defined on the contract:
|
115
|
+
*
|
116
|
+
* ### Usage with a the ABI defined on the contract:
|
117
|
+
*
|
112
118
|
* ```ts
|
113
119
|
* import { getContract, prepareContractCall } from "thirdweb";
|
114
120
|
* const contract = getContract({
|
@@ -122,8 +128,7 @@ export type PrepareContractCallOptions<
|
|
122
128
|
* });
|
123
129
|
* ```
|
124
130
|
*
|
125
|
-
*
|
126
|
-
* Passing extra call data to the transaction
|
131
|
+
* ### Passing extra call data to the transaction
|
127
132
|
* ```ts
|
128
133
|
* import { getContract, prepareContractCall } from "thirdweb";
|
129
134
|
* const contract = getContract({
|
@@ -70,16 +70,49 @@ export type ReadContractOptions<
|
|
70
70
|
>;
|
71
71
|
|
72
72
|
/**
|
73
|
-
* Reads
|
73
|
+
* Reads state from a deployed smart contract.
|
74
|
+
*
|
75
|
+
* You can use raw read calls or read [extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) to read from a contract.
|
76
|
+
*
|
74
77
|
* @param options - The transaction options.
|
75
|
-
* @returns A promise that resolves with the result of the read
|
78
|
+
* @returns A promise that resolves with the result of the read call.
|
76
79
|
* @transaction
|
77
80
|
* @example
|
81
|
+
*
|
82
|
+
* ### Using a contract read extension
|
83
|
+
*
|
78
84
|
* ```ts
|
79
|
-
* import {
|
80
|
-
*
|
81
|
-
*
|
82
|
-
*
|
85
|
+
* import { getContract } from "thirdweb";
|
86
|
+
* import { sepolia } from "thirdweb/chains";
|
87
|
+
* import { useReadContract } from "thirdweb/react";
|
88
|
+
* import { getOwnedNFTs } form "thirdweb/extensions/erc721";
|
89
|
+
*
|
90
|
+
* const contract = getContract({
|
91
|
+
* client,
|
92
|
+
* address: "0x...",
|
93
|
+
* chain: sepolia,
|
94
|
+
* });
|
95
|
+
*
|
96
|
+
* const { data, isLoading } = useReadContract(getOwnedNFTs, { contract, owner: address });
|
97
|
+
* ```
|
98
|
+
*
|
99
|
+
* ### Using a raw contract call
|
100
|
+
*
|
101
|
+
* ```ts
|
102
|
+
* import { getContract } from "thirdweb";
|
103
|
+
* import { sepolia } from "thirdweb/chains";
|
104
|
+
* import { useReadContract } from "thirdweb/react";
|
105
|
+
*
|
106
|
+
* const contract = getContract({
|
107
|
+
* client,
|
108
|
+
* address: "0x...",
|
109
|
+
* chain: sepolia,
|
110
|
+
* });
|
111
|
+
*
|
112
|
+
* const { data, isLoading } = useReadContract({
|
113
|
+
* contract,
|
114
|
+
* method: "function tokenURI(uint256 tokenId) returns (string)"});
|
115
|
+
* params: [1n],
|
83
116
|
* });
|
84
117
|
* ```
|
85
118
|
*/
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
2
|
+
import { numberToHex } from "./hex.js";
|
3
|
+
|
4
|
+
describe("hex.ts", () => {
|
5
|
+
it("should convert", () => {
|
6
|
+
const result = numberToHex(100n, { size: 32, signed: false });
|
7
|
+
expect(result).toBe(
|
8
|
+
"0x0000000000000000000000000000000000000000000000000000000000000064",
|
9
|
+
);
|
10
|
+
});
|
11
|
+
});
|
package/src/utils/fetch.ts
CHANGED
@@ -43,7 +43,8 @@ export function getClientFetch(client: ThirdwebClient, ecosystem?: Ecosystem) {
|
|
43
43
|
}
|
44
44
|
const authToken = getTWAuthToken();
|
45
45
|
// if we have an auth token set, use that (thirdweb.com/dashboard sets this for the user)
|
46
|
-
|
46
|
+
// pay urls should never send the auth token, because we always want the "developer" to be the one making the request, not the "end user"
|
47
|
+
if (authToken && !isPayUrl(url)) {
|
47
48
|
headers.set("authorization", `Bearer ${authToken}`);
|
48
49
|
} else if (client.secretKey) {
|
49
50
|
headers.set("x-secret-key", client.secretKey);
|
@@ -127,6 +128,16 @@ export function isThirdwebUrl(url: string): boolean {
|
|
127
128
|
}
|
128
129
|
}
|
129
130
|
|
131
|
+
function isPayUrl(url: string): boolean {
|
132
|
+
try {
|
133
|
+
const { hostname } = new URL(url);
|
134
|
+
// pay service hostname always starts with "pay."
|
135
|
+
return hostname.startsWith("pay.");
|
136
|
+
} catch {
|
137
|
+
return false;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
130
141
|
const SDK_NAME = "unified-sdk";
|
131
142
|
|
132
143
|
let previousPlatform: [string, string][] | undefined;
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.43.
|
1
|
+
export const version = "5.43.3-nightly-baefa5e9c7d72fd8645b0e33452a83fc0ef229d4-20240804000345";
|
@@ -39,7 +39,7 @@ import { createInAppWallet } from "../core/wallet/in-app-core.js";
|
|
39
39
|
*
|
40
40
|
* [View all available social auth methods](https://portal.thirdweb.com/references/typescript/v5/InAppWalletSocialAuth)
|
41
41
|
*
|
42
|
-
*
|
42
|
+
* ### Login with email
|
43
43
|
*
|
44
44
|
* ```ts
|
45
45
|
* import { inAppWallet, preAuthenticate } from "thirdweb/wallets/in-app";
|
@@ -58,6 +58,7 @@ import { createInAppWallet } from "../core/wallet/in-app-core.js";
|
|
58
58
|
* client,
|
59
59
|
* chain,
|
60
60
|
* strategy: "email",
|
61
|
+
* email: "example@example.com",
|
61
62
|
* verificationCode: "123456",
|
62
63
|
* });
|
63
64
|
* ```
|
@@ -80,8 +81,10 @@ import { createInAppWallet } from "../core/wallet/in-app-core.js";
|
|
80
81
|
* client,
|
81
82
|
* chain,
|
82
83
|
* strategy: "phone",
|
84
|
+
* honeNumber: "+1234567890",
|
83
85
|
* verificationCode: "123456",
|
84
86
|
* });
|
87
|
+
* ```
|
85
88
|
*
|
86
89
|
* ### Login with passkey
|
87
90
|
*
|
@@ -106,6 +106,7 @@ export async function getUserPhoneNumber(options: GetAuthenticatedUserParams) {
|
|
106
106
|
|
107
107
|
/**
|
108
108
|
* Pre-authenticates the user based on the provided authentication strategy.
|
109
|
+
* Use this function to send a verification code to the user's email or phone number.
|
109
110
|
* @param args - The arguments required for pre-authentication.
|
110
111
|
* @returns A promise that resolves to the pre-authentication result.
|
111
112
|
* @throws An error if the provided authentication strategy doesn't require pre-authentication.
|
@@ -18,6 +18,7 @@ import { setContractURI } from "../../extensions/marketplace/__generated__/IMark
|
|
18
18
|
import { estimateGasCost } from "../../transaction/actions/estimate-gas-cost.js";
|
19
19
|
import { sendAndConfirmTransaction } from "../../transaction/actions/send-and-confirm-transaction.js";
|
20
20
|
import { sendBatchTransaction } from "../../transaction/actions/send-batch-transaction.js";
|
21
|
+
import { waitForReceipt } from "../../transaction/actions/wait-for-tx-receipt.js";
|
21
22
|
import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js";
|
22
23
|
import type { Account, Wallet } from "../interfaces/wallet.js";
|
23
24
|
import { generateAccount } from "../utils/generateAccount.js";
|
@@ -139,6 +140,11 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
139
140
|
],
|
140
141
|
});
|
141
142
|
expect(tx.transactionHash).toHaveLength(66);
|
143
|
+
await waitForReceipt({
|
144
|
+
client,
|
145
|
+
transactionHash: tx.transactionHash,
|
146
|
+
chain,
|
147
|
+
});
|
142
148
|
const balance = await balanceOf({
|
143
149
|
contract,
|
144
150
|
owner: smartWalletAddress,
|