thirdweb 5.43.2 → 5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841
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/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/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/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/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
@@ -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
|
*/
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.43.
|
1
|
+
export const version = "5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841";
|
@@ -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,
|