thirdweb 5.105.40-nightly-89eeac1f8a20596ab93b92cf2bbcc76175ceec09-20250831000413 → 5.105.41
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/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +1 -0
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +2 -2
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +2 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +2 -2
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +1 -0
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +1 -0
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +1 -0
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +2 -2
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js +1 -1
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +1 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +2 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +2 -2
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +1 -0
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js +1 -0
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts +4 -0
- package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +4 -0
- 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/Bridge/BridgeOrchestrator.d.ts +5 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +4 -0
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +4 -0
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +2 -0
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts +2 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +5 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.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/stories/Bridge/BridgeOrchestrator.stories.d.ts +1 -0
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +1 -0
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.ts +5 -0
- package/src/react/core/hooks/transaction/useSendTransaction.ts +4 -0
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +7 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +6 -0
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +6 -0
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +4 -0
- package/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx +3 -0
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +7 -0
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +2 -0
- package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +1 -0
- package/src/stories/Bridge/PaymentSelection.stories.tsx +1 -0
- package/src/version.ts +1 -1
package/package.json
CHANGED
@@ -39,8 +39,8 @@
|
|
39
39
|
"uqr": "0.1.2",
|
40
40
|
"viem": "2.33.2",
|
41
41
|
"zod": "3.25.75",
|
42
|
-
"@thirdweb-dev/
|
43
|
-
"@thirdweb-dev/
|
42
|
+
"@thirdweb-dev/engine": "3.2.1",
|
43
|
+
"@thirdweb-dev/insight": "1.1.1"
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
46
|
"@aws-sdk/client-kms": "3.592.0",
|
@@ -388,7 +388,7 @@
|
|
388
388
|
}
|
389
389
|
},
|
390
390
|
"typings": "./dist/types/exports/thirdweb.d.ts",
|
391
|
-
"version": "5.105.
|
391
|
+
"version": "5.105.41",
|
392
392
|
"scripts": {
|
393
393
|
"bench": "vitest -c ./test/vitest.config.ts bench",
|
394
394
|
"bench:compare": "bun run ./benchmarks/run.ts",
|
@@ -33,6 +33,10 @@ type UseBuyWithFiatQuotesForProvidersParams = {
|
|
33
33
|
* The fiat currency (e.g., "USD"). Defaults to "USD".
|
34
34
|
*/
|
35
35
|
currency?: string;
|
36
|
+
/**
|
37
|
+
* The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
|
38
|
+
*/
|
39
|
+
country?: string;
|
36
40
|
};
|
37
41
|
|
38
42
|
/**
|
@@ -89,6 +93,7 @@ export function useBuyWithFiatQuotesForProviders(
|
|
89
93
|
onramp: provider,
|
90
94
|
receiver: params.receiver,
|
91
95
|
tokenAddress: params.tokenAddress,
|
96
|
+
country: params.country,
|
92
97
|
});
|
93
98
|
},
|
94
99
|
queryKey: ["onramp-prepare", provider, params],
|
@@ -137,6 +137,7 @@ export function useSendTransaction(config: SendTransactionConfig = {}) {
|
|
137
137
|
if (payModal === false) return;
|
138
138
|
setRootEl(
|
139
139
|
<TransactionModal
|
140
|
+
country={payModal?.country}
|
140
141
|
client={data.tx.client}
|
141
142
|
localeId={payModal?.locale || "en_US"}
|
142
143
|
modalMode={data.mode}
|
@@ -125,6 +125,11 @@ export interface BridgeOrchestratorProps {
|
|
125
125
|
*/
|
126
126
|
paymentMethods?: ("crypto" | "card")[];
|
127
127
|
|
128
|
+
/**
|
129
|
+
* The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
|
130
|
+
*/
|
131
|
+
country: string | undefined;
|
132
|
+
|
128
133
|
/**
|
129
134
|
* Whether to show thirdweb branding in the widget.
|
130
135
|
* @default true
|
@@ -148,6 +153,7 @@ export function BridgeOrchestrator({
|
|
148
153
|
paymentMethods = ["crypto", "card"],
|
149
154
|
showThirdwebBranding = true,
|
150
155
|
supportedTokens,
|
156
|
+
country = "US",
|
151
157
|
}: BridgeOrchestratorProps) {
|
152
158
|
// Initialize adapters
|
153
159
|
const adapters = useMemo(
|
@@ -319,6 +325,7 @@ export function BridgeOrchestrator({
|
|
319
325
|
receiverAddress={state.context.receiverAddress}
|
320
326
|
currency={uiOptions.currency}
|
321
327
|
supportedTokens={supportedTokens}
|
328
|
+
country={country}
|
322
329
|
/>
|
323
330
|
)}
|
324
331
|
|
@@ -184,6 +184,11 @@ export type BuyWidgetProps = {
|
|
184
184
|
*/
|
185
185
|
currency?: SupportedFiatCurrency;
|
186
186
|
|
187
|
+
/**
|
188
|
+
* The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
|
189
|
+
*/
|
190
|
+
country?: string;
|
191
|
+
|
187
192
|
/**
|
188
193
|
* Custom label for the main action button.
|
189
194
|
*/
|
@@ -432,6 +437,7 @@ export function BuyWidget(props: BuyWidgetProps) {
|
|
432
437
|
// Show normal bridge orchestrator
|
433
438
|
content = (
|
434
439
|
<BridgeOrchestrator
|
440
|
+
country={props.country}
|
435
441
|
supportedTokens={props.supportedTokens}
|
436
442
|
client={props.client}
|
437
443
|
connectLocale={localeQuery.data}
|
@@ -193,6 +193,11 @@ export type CheckoutWidgetProps = {
|
|
193
193
|
*/
|
194
194
|
currency?: SupportedFiatCurrency;
|
195
195
|
|
196
|
+
/**
|
197
|
+
* The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
|
198
|
+
*/
|
199
|
+
country?: string;
|
200
|
+
|
196
201
|
/**
|
197
202
|
* Custom label for the main action button.
|
198
203
|
*/
|
@@ -400,6 +405,7 @@ export function CheckoutWidget(props: CheckoutWidgetProps) {
|
|
400
405
|
// Show normal bridge orchestrator
|
401
406
|
content = (
|
402
407
|
<BridgeOrchestrator
|
408
|
+
country={props.country}
|
403
409
|
client={props.client}
|
404
410
|
connectLocale={localeQuery.data}
|
405
411
|
connectOptions={props.connectOptions}
|
@@ -193,6 +193,9 @@ export type TransactionWidgetProps = {
|
|
193
193
|
*/
|
194
194
|
currency?: SupportedFiatCurrency;
|
195
195
|
|
196
|
+
/** The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support. */
|
197
|
+
country?: string;
|
198
|
+
|
196
199
|
/**
|
197
200
|
* Custom label for the main action button.
|
198
201
|
*/
|
@@ -442,6 +445,7 @@ export function TransactionWidget(props: TransactionWidgetProps) {
|
|
442
445
|
// Show normal bridge orchestrator
|
443
446
|
content = (
|
444
447
|
<BridgeOrchestrator
|
448
|
+
country={props.country}
|
445
449
|
supportedTokens={props.supportedTokens}
|
446
450
|
client={props.client}
|
447
451
|
connectLocale={localeQuery.data}
|
@@ -28,6 +28,7 @@ interface FiatProviderSelectionProps {
|
|
28
28
|
toAddress: string;
|
29
29
|
toAmount?: string;
|
30
30
|
currency?: SupportedFiatCurrency;
|
31
|
+
country: string | undefined;
|
31
32
|
}
|
32
33
|
|
33
34
|
const PROVIDERS = [
|
@@ -59,6 +60,7 @@ export function FiatProviderSelection({
|
|
59
60
|
toAddress,
|
60
61
|
toAmount,
|
61
62
|
currency,
|
63
|
+
country,
|
62
64
|
}: FiatProviderSelectionProps) {
|
63
65
|
const theme = useCustomTheme();
|
64
66
|
|
@@ -70,6 +72,7 @@ export function FiatProviderSelection({
|
|
70
72
|
currency: currency || "USD",
|
71
73
|
receiver: checksumAddress(toAddress),
|
72
74
|
tokenAddress: checksumAddress(toTokenAddress),
|
75
|
+
country,
|
73
76
|
});
|
74
77
|
|
75
78
|
const quotes = useMemo(() => {
|
@@ -91,6 +91,11 @@ export interface PaymentSelectionProps {
|
|
91
91
|
*/
|
92
92
|
currency?: SupportedFiatCurrency;
|
93
93
|
|
94
|
+
/**
|
95
|
+
* The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
|
96
|
+
*/
|
97
|
+
country: string | undefined;
|
98
|
+
|
94
99
|
supportedTokens?: SupportedTokens;
|
95
100
|
}
|
96
101
|
|
@@ -115,6 +120,7 @@ export function PaymentSelection({
|
|
115
120
|
supportedTokens,
|
116
121
|
feePayer,
|
117
122
|
currency,
|
123
|
+
country,
|
118
124
|
}: PaymentSelectionProps) {
|
119
125
|
const connectedWallets = useConnectedWallets();
|
120
126
|
const activeWallet = useActiveWallet();
|
@@ -298,6 +304,7 @@ export function PaymentSelection({
|
|
298
304
|
|
299
305
|
{currentStep.type === "fiatProviderSelection" && (
|
300
306
|
<FiatProviderSelection
|
307
|
+
country={country}
|
301
308
|
client={client}
|
302
309
|
onProviderSelected={handleOnrampProviderSelected}
|
303
310
|
toAddress={receiverAddress || ""}
|
@@ -33,6 +33,7 @@ type ModalProps = {
|
|
33
33
|
payOptions: PayUIOptions;
|
34
34
|
onTxSent: (data: WaitForReceiptOptions) => void;
|
35
35
|
modalMode: "buy" | "deposit";
|
36
|
+
country?: string;
|
36
37
|
};
|
37
38
|
|
38
39
|
export function TransactionModal(props: ModalProps) {
|
@@ -116,6 +117,7 @@ function TransactionModalContent(props: ModalProps & { onBack?: () => void }) {
|
|
116
117
|
|
117
118
|
return (
|
118
119
|
<BridgeOrchestrator
|
120
|
+
country={props.country}
|
119
121
|
client={props.client}
|
120
122
|
connectLocale={localeQuery.data}
|
121
123
|
connectOptions={undefined}
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.105.
|
1
|
+
export const version = "5.105.41";
|