thirdweb 5.96.5 → 5.96.6
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/analytics/track/pay.js +14 -13
- package/dist/cjs/analytics/track/pay.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +6 -4
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +2 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +10 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +2 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +3 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +12 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +12 -13
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +8 -12
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +13 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +44 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +41 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +8 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +7 -3
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/analytics/track/pay.js +14 -13
- package/dist/esm/analytics/track/pay.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +6 -4
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +2 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +10 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +2 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +3 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +12 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +12 -13
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +8 -12
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +13 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +44 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +41 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +7 -3
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/analytics/track/pay.d.ts +3 -4
- package/dist/types/analytics/track/pay.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +1 -0
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/analytics/track/pay.test.ts +5 -7
- package/src/analytics/track/pay.ts +17 -17
- package/src/react/core/hooks/transaction/useSendTransaction.ts +6 -4
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +2 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +10 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +2 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +3 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +12 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +12 -13
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +8 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx +13 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +44 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +43 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +10 -0
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +8 -3
- package/src/version.ts +1 -1
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
getPaySupportedSources,
|
8
8
|
} from "../../../../../../../pay/utils/definitions.js";
|
9
9
|
import { getClientFetch } from "../../../../../../../utils/fetch.js";
|
10
|
+
import { stringify } from "../../../../../../../utils/json.js";
|
10
11
|
import { withCache } from "../../../../../../../utils/promise/withCache.js";
|
11
12
|
|
12
13
|
type Response = {
|
@@ -44,7 +45,16 @@ export async function fetchBuySupportedDestinations(
|
|
44
45
|
const res = await fetchWithHeaders(
|
45
46
|
`${getPaySupportedDestinations()}${isTestMode ? "?isTestMode=true" : ""}`,
|
46
47
|
);
|
48
|
+
if (!res.ok) {
|
49
|
+
const error = await res.text();
|
50
|
+
throw new Error(`Failed to fetch supported destinations: ${error}`);
|
51
|
+
}
|
47
52
|
const data = (await res.json()) as Response;
|
53
|
+
if (!data.result) {
|
54
|
+
throw new Error(
|
55
|
+
`Failed to parse supported destinations: ${data ? stringify(data) : undefined}`,
|
56
|
+
);
|
57
|
+
}
|
48
58
|
return data.result.map((item) => ({
|
49
59
|
chain: defineChain({
|
50
60
|
id: item.chainId,
|
@@ -4,6 +4,7 @@ import { trackPayEvent } from "../../../../analytics/track/pay.js";
|
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
5
|
import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait-for-tx-receipt.js";
|
6
6
|
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
7
|
+
import { resolvePromisedValue } from "../../../../utils/promise/resolve-promised-value.js";
|
7
8
|
import { CustomThemeProvider } from "../../../core/design-system/CustomThemeProvider.js";
|
8
9
|
import type { Theme } from "../../../core/design-system/index.js";
|
9
10
|
import type { PayUIOptions } from "../../../core/hooks/connection/ConnectButtonProps.js";
|
@@ -19,6 +20,7 @@ import { ExecutingTxScreen } from "./ExecutingScreen.js";
|
|
19
20
|
|
20
21
|
type ModalProps = {
|
21
22
|
title: string;
|
23
|
+
txId: string;
|
22
24
|
onComplete: () => void;
|
23
25
|
onClose: () => void;
|
24
26
|
client: ThirdwebClient;
|
@@ -35,8 +37,8 @@ export function TransactionModal(props: ModalProps) {
|
|
35
37
|
const wallet = useActiveWallet();
|
36
38
|
|
37
39
|
useQuery({
|
38
|
-
queryKey: ["transaction-modal-event"],
|
39
|
-
queryFn: () => {
|
40
|
+
queryKey: ["transaction-modal-event", props.txId],
|
41
|
+
queryFn: async () => {
|
40
42
|
if (!account || !wallet) {
|
41
43
|
throw new Error(); // never happens, because enabled is false
|
42
44
|
}
|
@@ -44,7 +46,10 @@ export function TransactionModal(props: ModalProps) {
|
|
44
46
|
client: props.client,
|
45
47
|
walletAddress: account.address,
|
46
48
|
walletType: wallet.id,
|
47
|
-
|
49
|
+
toChainId: props.tx.chain.id,
|
50
|
+
toToken: props.tx.erc20Value
|
51
|
+
? (await resolvePromisedValue(props.tx.erc20Value))?.tokenAddress
|
52
|
+
: undefined,
|
48
53
|
event: "open_pay_transaction_modal",
|
49
54
|
});
|
50
55
|
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.96.
|
1
|
+
export const version = "5.96.6";
|