thirdweb 5.104.1-nightly-c26be2d958283fb77d7689e31356b1cee7c6ff2a-20250624000418 → 5.104.2-nightly-d85ee5fac30b739b69202184eb2e62660790979b-20250625000421
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/bridge/Buy.js +0 -2
- package/dist/cjs/bridge/Buy.js.map +1 -1
- package/dist/cjs/engine/server-wallet.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +14 -4
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +14 -4
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js +13 -1
- package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +20 -1
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +14 -4
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js +14 -1
- package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +27 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +13 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +18 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +4 -4
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +2 -1
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +7 -0
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +6 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/bridge/Buy.js +0 -2
- package/dist/esm/bridge/Buy.js.map +1 -1
- package/dist/esm/engine/server-wallet.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +3 -3
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js +14 -4
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +14 -4
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/ErrorBanner.js +13 -1
- package/dist/esm/react/web/ui/Bridge/ErrorBanner.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +20 -1
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +14 -4
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js +14 -1
- package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +27 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +13 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +18 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +4 -4
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js +2 -1
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js +8 -1
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +6 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/bridge/Buy.d.ts +0 -2
- package/dist/types/bridge/Buy.d.ts.map +1 -1
- package/dist/types/engine/server-wallet.d.ts +2 -2
- package/dist/types/engine/server-wallet.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +1 -3
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +1 -3
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts +3 -1
- package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +2 -1
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +1 -3
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +3 -0
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +3 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/bridge/Buy.ts +0 -2
- package/src/engine/server-wallet.test.ts +31 -0
- package/src/engine/server-wallet.ts +3 -1
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +3 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +21 -4
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +21 -4
- package/src/react/web/ui/Bridge/ErrorBanner.tsx +21 -1
- package/src/react/web/ui/Bridge/QuoteLoader.tsx +24 -0
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +21 -4
- package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +18 -1
- package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +34 -0
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +14 -0
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +22 -0
- package/src/react/web/ui/PayEmbed.tsx +4 -1
- package/src/stories/Bridge/ErrorBanner.stories.tsx +5 -1
- package/src/stories/Bridge/SuccessScreen.stories.tsx +8 -1
- package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +7 -0
- package/src/version.ts +1 -1
@@ -1,6 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
4
|
+
import { trackPayEvent } from "../../../../analytics/track/pay.js";
|
4
5
|
import type { Token } from "../../../../bridge/index.js";
|
5
6
|
import type { Chain } from "../../../../chains/types.js";
|
6
7
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
@@ -267,14 +268,24 @@ type UIOptionsResult =
|
|
267
268
|
*
|
268
269
|
* Refer to the [`TransactionWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/TransactionWidgetConnectOptions) type for more details.
|
269
270
|
*
|
270
|
-
* @bridge
|
271
|
-
* @beta
|
272
|
-
* @react
|
271
|
+
* @bridge Widgets
|
273
272
|
*/
|
274
273
|
export function TransactionWidget(props: TransactionWidgetProps) {
|
275
274
|
const localeQuery = useConnectLocale(props.locale || "en_US");
|
276
275
|
const theme = props.theme || "dark";
|
277
276
|
|
277
|
+
useQuery({
|
278
|
+
queryFn: () => {
|
279
|
+
trackPayEvent({
|
280
|
+
chainId: props.transaction.chain.id,
|
281
|
+
client: props.client,
|
282
|
+
event: "ub:ui:transaction_widget:render",
|
283
|
+
toToken: props.tokenAddress,
|
284
|
+
});
|
285
|
+
},
|
286
|
+
queryKey: ["transaction_widget:render"],
|
287
|
+
});
|
288
|
+
|
278
289
|
const bridgeDataQuery = useQuery({
|
279
290
|
queryFn: async (): Promise<UIOptionsResult> => {
|
280
291
|
let erc20Value = props.transaction.erc20Value;
|
@@ -331,7 +342,13 @@ export function TransactionWidget(props: TransactionWidgetProps) {
|
|
331
342
|
);
|
332
343
|
} else if (bridgeDataQuery.data?.type === "unsupported_token") {
|
333
344
|
// Show unsupported token screen
|
334
|
-
content =
|
345
|
+
content = (
|
346
|
+
<UnsupportedTokenScreen
|
347
|
+
chain={bridgeDataQuery.data.chain}
|
348
|
+
client={props.client}
|
349
|
+
tokenAddress={props.tokenAddress}
|
350
|
+
/>
|
351
|
+
);
|
335
352
|
} else if (bridgeDataQuery.data?.type === "success") {
|
336
353
|
// Show normal bridge orchestrator
|
337
354
|
content = (
|
@@ -1,4 +1,7 @@
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
2
|
+
import { trackPayEvent } from "../../../../analytics/track/pay.js";
|
1
3
|
import type { Chain } from "../../../../chains/types.js";
|
4
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
5
|
import { iconSize } from "../../../core/design-system/index.js";
|
3
6
|
import { useChainMetadata } from "../../../core/hooks/others/useChainQuery.js";
|
4
7
|
import { AccentFailIcon } from "../ConnectWallet/icons/AccentFailIcon.js";
|
@@ -11,6 +14,8 @@ export interface UnsupportedTokenScreenProps {
|
|
11
14
|
* The chain the token is on
|
12
15
|
*/
|
13
16
|
chain: Chain;
|
17
|
+
client: ThirdwebClient;
|
18
|
+
tokenAddress?: string;
|
14
19
|
}
|
15
20
|
|
16
21
|
/**
|
@@ -18,10 +23,22 @@ export interface UnsupportedTokenScreenProps {
|
|
18
23
|
* @internal
|
19
24
|
*/
|
20
25
|
export function UnsupportedTokenScreen(props: UnsupportedTokenScreenProps) {
|
21
|
-
const { chain } = props;
|
26
|
+
const { chain, tokenAddress, client } = props;
|
22
27
|
|
23
28
|
const { data: chainMetadata } = useChainMetadata(chain);
|
24
29
|
|
30
|
+
useQuery({
|
31
|
+
queryFn: () => {
|
32
|
+
trackPayEvent({
|
33
|
+
chainId: chain.id,
|
34
|
+
client,
|
35
|
+
event: "ub:ui:unsupported_token",
|
36
|
+
fromToken: tokenAddress,
|
37
|
+
});
|
38
|
+
},
|
39
|
+
queryKey: ["unsupported_token"],
|
40
|
+
});
|
41
|
+
|
25
42
|
if (chainMetadata?.testnet) {
|
26
43
|
return (
|
27
44
|
<Container
|
@@ -1,4 +1,6 @@
|
|
1
1
|
"use client";
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
3
|
+
import { trackPayEvent } from "../../../../../analytics/track/pay.js";
|
2
4
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
3
5
|
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
|
4
6
|
import { radius, spacing } from "../../../../core/design-system/index.js";
|
@@ -68,6 +70,38 @@ export function PaymentDetails({
|
|
68
70
|
}
|
69
71
|
};
|
70
72
|
|
73
|
+
useQuery({
|
74
|
+
queryFn: () => {
|
75
|
+
if (
|
76
|
+
preparedQuote.type === "buy" ||
|
77
|
+
preparedQuote.type === "sell" ||
|
78
|
+
preparedQuote.type === "transfer"
|
79
|
+
) {
|
80
|
+
trackPayEvent({
|
81
|
+
chainId:
|
82
|
+
preparedQuote.type === "transfer"
|
83
|
+
? preparedQuote.intent.chainId
|
84
|
+
: preparedQuote.intent.originChainId,
|
85
|
+
client,
|
86
|
+
event: "payment_details",
|
87
|
+
fromToken:
|
88
|
+
preparedQuote.type === "transfer"
|
89
|
+
? preparedQuote.intent.tokenAddress
|
90
|
+
: preparedQuote.intent.originTokenAddress,
|
91
|
+
toChainId:
|
92
|
+
preparedQuote.type === "transfer"
|
93
|
+
? preparedQuote.intent.chainId
|
94
|
+
: preparedQuote.intent.destinationChainId,
|
95
|
+
toToken:
|
96
|
+
preparedQuote.type === "transfer"
|
97
|
+
? preparedQuote.intent.tokenAddress
|
98
|
+
: preparedQuote.intent.destinationTokenAddress,
|
99
|
+
});
|
100
|
+
}
|
101
|
+
},
|
102
|
+
queryKey: ["payment_details", preparedQuote.type],
|
103
|
+
});
|
104
|
+
|
71
105
|
// Extract common data based on quote type
|
72
106
|
const getDisplayData = () => {
|
73
107
|
switch (preparedQuote.type) {
|
@@ -1,5 +1,7 @@
|
|
1
1
|
"use client";
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
2
3
|
import { useEffect, useState } from "react";
|
4
|
+
import { trackPayEvent } from "../../../../../analytics/track/pay.js";
|
3
5
|
import type { Token } from "../../../../../bridge/types/Token.js";
|
4
6
|
import { defineChain } from "../../../../../chains/utils.js";
|
5
7
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
@@ -96,6 +98,18 @@ export function PaymentSelection({
|
|
96
98
|
type: "walletSelection",
|
97
99
|
});
|
98
100
|
|
101
|
+
useQuery({
|
102
|
+
queryFn: () => {
|
103
|
+
trackPayEvent({
|
104
|
+
client,
|
105
|
+
event: "payment_selection",
|
106
|
+
toChainId: destinationToken.chainId,
|
107
|
+
toToken: destinationToken.address,
|
108
|
+
});
|
109
|
+
},
|
110
|
+
queryKey: ["payment_selection"],
|
111
|
+
});
|
112
|
+
|
99
113
|
const payerWallet =
|
100
114
|
currentStep.type === "tokenSelection"
|
101
115
|
? currentStep.selectedWallet
|
@@ -1,6 +1,9 @@
|
|
1
1
|
"use client";
|
2
2
|
import { CheckIcon } from "@radix-ui/react-icons";
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
3
4
|
import { useState } from "react";
|
5
|
+
import { trackPayEvent } from "../../../../../analytics/track/pay.js";
|
6
|
+
import type { ThirdwebClient } from "../../../../../client/client.js";
|
4
7
|
import type { WindowAdapter } from "../../../../core/adapters/WindowAdapter.js";
|
5
8
|
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
|
6
9
|
import { iconSize } from "../../../../core/design-system/index.js";
|
@@ -37,6 +40,8 @@ export interface SuccessScreenProps {
|
|
37
40
|
* Window adapter for opening URLs
|
38
41
|
*/
|
39
42
|
windowAdapter: WindowAdapter;
|
43
|
+
|
44
|
+
client: ThirdwebClient;
|
40
45
|
}
|
41
46
|
|
42
47
|
type ViewState = "success" | "detail";
|
@@ -47,10 +52,27 @@ export function SuccessScreen({
|
|
47
52
|
completedStatuses,
|
48
53
|
onDone,
|
49
54
|
windowAdapter,
|
55
|
+
client,
|
50
56
|
}: SuccessScreenProps) {
|
51
57
|
const theme = useCustomTheme();
|
52
58
|
const [viewState, setViewState] = useState<ViewState>("success");
|
53
59
|
|
60
|
+
useQuery({
|
61
|
+
queryFn: () => {
|
62
|
+
if (preparedQuote.type === "buy" || preparedQuote.type === "sell") {
|
63
|
+
trackPayEvent({
|
64
|
+
chainId: preparedQuote.intent.originChainId,
|
65
|
+
client: client,
|
66
|
+
event: "ub:ui:success_screen",
|
67
|
+
fromToken: preparedQuote.intent.originTokenAddress,
|
68
|
+
toChainId: preparedQuote.intent.destinationChainId,
|
69
|
+
toToken: preparedQuote.intent.destinationTokenAddress,
|
70
|
+
});
|
71
|
+
}
|
72
|
+
},
|
73
|
+
queryKey: ["success_screen", preparedQuote.type],
|
74
|
+
});
|
75
|
+
|
54
76
|
if (viewState === "detail") {
|
55
77
|
return (
|
56
78
|
<PaymentReceipt
|
@@ -307,7 +307,7 @@ export type PayEmbedProps = {
|
|
307
307
|
*
|
308
308
|
* Refer to the [`PayEmbedConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/PayEmbedConnectOptions) type for more details.
|
309
309
|
*
|
310
|
-
* @
|
310
|
+
* @deprecated Use `BuyWidget`, `CheckoutWidget` or `TransactionWidget` instead.
|
311
311
|
*/
|
312
312
|
export function PayEmbed(props: PayEmbedProps) {
|
313
313
|
const localeQuery = useConnectLocale(props.locale || "en_US");
|
@@ -356,6 +356,7 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
356
356
|
amount={props.payOptions.prefillBuy.amount || "0.01"}
|
357
357
|
chain={props.payOptions.prefillBuy.chain}
|
358
358
|
client={props.client}
|
359
|
+
onSuccess={() => props.payOptions?.onPurchaseSuccess?.()}
|
359
360
|
theme={theme}
|
360
361
|
title={metadata?.name || "Buy"}
|
361
362
|
tokenAddress={
|
@@ -374,6 +375,7 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
374
375
|
description={metadata?.description}
|
375
376
|
image={metadata?.image}
|
376
377
|
name={metadata?.name || "Checkout"}
|
378
|
+
onSuccess={() => props.payOptions?.onPurchaseSuccess?.()}
|
377
379
|
seller={props.payOptions.paymentInfo.sellerAddress as Address}
|
378
380
|
theme={theme}
|
379
381
|
tokenAddress={
|
@@ -389,6 +391,7 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
389
391
|
client={props.client}
|
390
392
|
description={metadata?.description}
|
391
393
|
image={metadata?.image}
|
394
|
+
onSuccess={() => props.payOptions?.onPurchaseSuccess?.()}
|
392
395
|
theme={theme}
|
393
396
|
title={metadata?.name}
|
394
397
|
transaction={props.payOptions.transaction}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
2
|
+
import { createThirdwebClient } from "../../client/client.js";
|
2
3
|
import type { Theme } from "../../react/core/design-system/index.js";
|
3
4
|
import { ErrorBanner } from "../../react/web/ui/Bridge/ErrorBanner.js";
|
4
5
|
import { ModalThemeWrapper } from "../utils.js";
|
@@ -25,7 +26,10 @@ const ErrorBannerWithTheme = (props: ErrorBannerWithThemeProps) => {
|
|
25
26
|
const { theme, ...componentProps } = props;
|
26
27
|
return (
|
27
28
|
<ModalThemeWrapper theme={theme}>
|
28
|
-
<ErrorBanner
|
29
|
+
<ErrorBanner
|
30
|
+
client={createThirdwebClient({ clientId: "test" })}
|
31
|
+
{...componentProps}
|
32
|
+
/>
|
29
33
|
</ModalThemeWrapper>
|
30
34
|
);
|
31
35
|
};
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
SuccessScreen,
|
8
8
|
type SuccessScreenProps,
|
9
9
|
} from "../../react/web/ui/Bridge/payment-success/SuccessScreen.js";
|
10
|
-
import { ModalThemeWrapper } from "../utils.js";
|
10
|
+
import { ModalThemeWrapper, storyClient } from "../utils.js";
|
11
11
|
import {
|
12
12
|
FUND_WALLET_UI_OPTIONS,
|
13
13
|
simpleBuyQuote,
|
@@ -126,6 +126,7 @@ type Story = StoryObj<typeof meta>;
|
|
126
126
|
|
127
127
|
export const Default: Story = {
|
128
128
|
args: {
|
129
|
+
client: storyClient,
|
129
130
|
theme: "dark",
|
130
131
|
},
|
131
132
|
parameters: {
|
@@ -135,6 +136,7 @@ export const Default: Story = {
|
|
135
136
|
|
136
137
|
export const DefaultLight: Story = {
|
137
138
|
args: {
|
139
|
+
client: storyClient,
|
138
140
|
theme: "light",
|
139
141
|
},
|
140
142
|
parameters: {
|
@@ -144,6 +146,7 @@ export const DefaultLight: Story = {
|
|
144
146
|
|
145
147
|
export const OnrampPayment: Story = {
|
146
148
|
args: {
|
149
|
+
client: storyClient,
|
147
150
|
completedStatuses: mockOnrampCompletedStatuses,
|
148
151
|
preparedQuote: simpleOnrampQuote,
|
149
152
|
theme: "dark",
|
@@ -161,6 +164,7 @@ export const OnrampPayment: Story = {
|
|
161
164
|
|
162
165
|
export const OnrampPaymentLight: Story = {
|
163
166
|
args: {
|
167
|
+
client: storyClient,
|
164
168
|
completedStatuses: mockOnrampCompletedStatuses,
|
165
169
|
preparedQuote: simpleOnrampQuote,
|
166
170
|
theme: "light",
|
@@ -172,6 +176,7 @@ export const OnrampPaymentLight: Story = {
|
|
172
176
|
|
173
177
|
export const ComplexPayment: Story = {
|
174
178
|
args: {
|
179
|
+
client: storyClient,
|
175
180
|
completedStatuses: [
|
176
181
|
...mockOnrampCompletedStatuses,
|
177
182
|
...mockBuyCompletedStatuses,
|
@@ -192,6 +197,7 @@ export const ComplexPayment: Story = {
|
|
192
197
|
|
193
198
|
export const ComplexPaymentLight: Story = {
|
194
199
|
args: {
|
200
|
+
client: storyClient,
|
195
201
|
completedStatuses: [
|
196
202
|
...mockOnrampCompletedStatuses,
|
197
203
|
...mockBuyCompletedStatuses,
|
@@ -206,6 +212,7 @@ export const ComplexPaymentLight: Story = {
|
|
206
212
|
|
207
213
|
export const TransactionPayment: Story = {
|
208
214
|
args: {
|
215
|
+
client: storyClient,
|
209
216
|
completedStatuses: mockBuyCompletedStatuses,
|
210
217
|
preparedQuote: simpleBuyQuote,
|
211
218
|
theme: "light",
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
2
2
|
import { defineChain } from "../../chains/utils.js";
|
3
|
+
import { createThirdwebClient } from "../../client/client.js";
|
3
4
|
import type { Theme } from "../../react/core/design-system/index.js";
|
4
5
|
import {
|
5
6
|
UnsupportedTokenScreen,
|
@@ -7,6 +8,8 @@ import {
|
|
7
8
|
} from "../../react/web/ui/Bridge/UnsupportedTokenScreen.js";
|
8
9
|
import { ModalThemeWrapper } from "../utils.js";
|
9
10
|
|
11
|
+
const TEST_CLIENT = createThirdwebClient({ clientId: "test" });
|
12
|
+
|
10
13
|
// Props interface for the wrapper component
|
11
14
|
interface UnsupportedTokenScreenWithThemeProps
|
12
15
|
extends UnsupportedTokenScreenProps {
|
@@ -57,6 +60,7 @@ type Story = StoryObj<typeof meta>;
|
|
57
60
|
export const TokenNotSupported: Story = {
|
58
61
|
args: {
|
59
62
|
chain: defineChain(1),
|
63
|
+
client: TEST_CLIENT,
|
60
64
|
theme: "dark", // Ethereum mainnet - will show indexing spinner
|
61
65
|
},
|
62
66
|
parameters: {
|
@@ -73,6 +77,7 @@ export const TokenNotSupported: Story = {
|
|
73
77
|
export const TokenNotSupportedLight: Story = {
|
74
78
|
args: {
|
75
79
|
chain: defineChain(1),
|
80
|
+
client: TEST_CLIENT,
|
76
81
|
theme: "light", // Ethereum mainnet - will show indexing spinner
|
77
82
|
},
|
78
83
|
parameters: {
|
@@ -89,6 +94,7 @@ export const TokenNotSupportedLight: Story = {
|
|
89
94
|
export const TestnetNotSupported: Story = {
|
90
95
|
args: {
|
91
96
|
chain: defineChain(11155111),
|
97
|
+
client: TEST_CLIENT,
|
92
98
|
theme: "dark", // Sepolia testnet - will show error state
|
93
99
|
},
|
94
100
|
parameters: {
|
@@ -105,6 +111,7 @@ export const TestnetNotSupported: Story = {
|
|
105
111
|
export const TestnetNotSupportedLight: Story = {
|
106
112
|
args: {
|
107
113
|
chain: defineChain(11155111),
|
114
|
+
client: TEST_CLIENT,
|
108
115
|
theme: "light", // Sepolia testnet - will show error state
|
109
116
|
},
|
110
117
|
parameters: {
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.104.
|
1
|
+
export const version = "5.104.2-nightly-d85ee5fac30b739b69202184eb2e62660790979b-20250625000421";
|