thirdweb 5.105.37 → 5.105.38

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.
Files changed (55) hide show
  1. package/dist/cjs/adapters/eip1193/to-eip1193.js +12 -3
  2. package/dist/cjs/adapters/eip1193/to-eip1193.js.map +1 -1
  3. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +2 -2
  4. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
  5. package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +6 -0
  6. package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
  7. package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +2 -12
  8. package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -1
  9. package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +2 -2
  10. package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -1
  11. package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +6 -2
  12. package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
  13. package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +14 -1
  14. package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/cjs/wallets/wallet-connect/controller.js +3 -2
  17. package/dist/cjs/wallets/wallet-connect/controller.js.map +1 -1
  18. package/dist/esm/adapters/eip1193/to-eip1193.js +12 -3
  19. package/dist/esm/adapters/eip1193/to-eip1193.js.map +1 -1
  20. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +2 -2
  21. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
  22. package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +7 -1
  23. package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
  24. package/dist/esm/react/web/ui/Bridge/DirectPayment.js +2 -12
  25. package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -1
  26. package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +2 -2
  27. package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -1
  28. package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +6 -2
  29. package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
  30. package/dist/esm/stories/Bridge/SuccessScreen.stories.js +13 -0
  31. package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -1
  32. package/dist/esm/version.js +1 -1
  33. package/dist/esm/wallets/wallet-connect/controller.js +3 -2
  34. package/dist/esm/wallets/wallet-connect/controller.js.map +1 -1
  35. package/dist/types/adapters/eip1193/to-eip1193.d.ts.map +1 -1
  36. package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
  37. package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +1 -6
  38. package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -1
  39. package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +5 -1
  40. package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
  41. package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +1 -0
  42. package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -1
  43. package/dist/types/version.d.ts +1 -1
  44. package/dist/types/wallets/wallet-connect/controller.d.ts.map +1 -1
  45. package/package.json +1 -1
  46. package/src/adapters/eip1193/to-eip1193.test.ts +10 -5
  47. package/src/adapters/eip1193/to-eip1193.ts +16 -5
  48. package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +1 -1
  49. package/src/react/web/ui/Bridge/CheckoutWidget.tsx +16 -0
  50. package/src/react/web/ui/Bridge/DirectPayment.tsx +3 -29
  51. package/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx +3 -3
  52. package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +16 -4
  53. package/src/stories/Bridge/SuccessScreen.stories.tsx +14 -0
  54. package/src/version.ts +1 -1
  55. package/src/wallets/wallet-connect/controller.ts +3 -2
@@ -3,9 +3,6 @@ import type { Token } from "../../../../bridge/types/Token.js";
3
3
  import { defineChain } from "../../../../chains/utils.js";
4
4
  import type { ThirdwebClient } from "../../../../client/client.js";
5
5
  import type { Address } from "../../../../utils/address.js";
6
- import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
7
- import { useActiveAccount } from "../../../core/hooks/wallets/useActiveAccount.js";
8
- import { ConnectButton } from "../ConnectWallet/ConnectButton.js";
9
6
  import { PoweredByThirdweb } from "../ConnectWallet/PoweredByTW.js";
10
7
  import { FiatValue } from "../ConnectWallet/screens/Buy/swap/FiatValue.js";
11
8
  import { Container, Line } from "../components/basic.js";
@@ -13,7 +10,6 @@ import { Button } from "../components/buttons.js";
13
10
  import { ChainName } from "../components/ChainName.js";
14
11
  import { Spacer } from "../components/Spacer.js";
15
12
  import { Text } from "../components/text.js";
16
- import type { PayEmbedConnectOptions } from "../PayEmbed.js";
17
13
  import type { UIOptions } from "./BridgeOrchestrator.js";
18
14
  import { ChainIcon } from "./common/TokenAndChain.js";
19
15
  import { WithHeader } from "./common/WithHeader.js";
@@ -34,11 +30,6 @@ export interface DirectPaymentProps {
34
30
  */
35
31
  onContinue: (amount: string, token: Token, receiverAddress: Address) => void;
36
32
 
37
- /**
38
- * Connect options for wallet connection
39
- */
40
- connectOptions?: PayEmbedConnectOptions;
41
-
42
33
  /**
43
34
  * Whether to show thirdweb branding in the widget.
44
35
  * @default true
@@ -50,12 +41,9 @@ export function DirectPayment({
50
41
  uiOptions,
51
42
  client,
52
43
  onContinue,
53
- connectOptions,
54
44
  showThirdwebBranding = true,
55
45
  }: DirectPaymentProps) {
56
- const activeAccount = useActiveAccount();
57
46
  const chain = defineChain(uiOptions.paymentInfo.token.chainId);
58
- const theme = useCustomTheme();
59
47
  const handleContinue = () => {
60
48
  onContinue(
61
49
  uiOptions.paymentInfo.amount,
@@ -188,23 +176,9 @@ export function DirectPayment({
188
176
 
189
177
  {/* Action button */}
190
178
  <Container flex="column">
191
- {activeAccount ? (
192
- <Button fullWidth onClick={handleContinue} variant="primary">
193
- {buyNow}
194
- </Button>
195
- ) : (
196
- <ConnectButton
197
- client={client}
198
- connectButton={{
199
- label: buyNow,
200
- style: {
201
- width: "100%",
202
- },
203
- }}
204
- theme={theme}
205
- {...connectOptions}
206
- />
207
- )}
179
+ <Button fullWidth onClick={handleContinue} variant="primary">
180
+ {buyNow}
181
+ </Button>
208
182
 
209
183
  {showThirdwebBranding ? (
210
184
  <div>
@@ -121,10 +121,10 @@ export function WalletFiatSelection({
121
121
  </Container>
122
122
  <Container flex="column" gap="3xs" style={{ flex: 1 }}>
123
123
  <Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
124
- Connect Another Wallet
124
+ Connect a Wallet
125
125
  </Text>
126
126
  <Text color="secondaryText" size="xs">
127
- Use a different wallet to pay
127
+ Pay with any web3 wallet
128
128
  </Text>
129
129
  </Container>
130
130
  </Container>
@@ -169,7 +169,7 @@ export function WalletFiatSelection({
169
169
  Pay with Card
170
170
  </Text>
171
171
  <Text color="secondaryText" size="xs">
172
- Buy crypto and bridge in one step
172
+ Onramp and pay in one step
173
173
  </Text>
174
174
  </Container>
175
175
  </Container>
@@ -42,6 +42,11 @@ export interface SuccessScreenProps {
42
42
  windowAdapter: WindowAdapter;
43
43
 
44
44
  client: ThirdwebClient;
45
+
46
+ /**
47
+ * Whether or not this payment is associated with a payment ID. If it does, we show a different message.
48
+ */
49
+ hasPaymentId?: boolean;
45
50
  }
46
51
 
47
52
  type ViewState = "success" | "detail";
@@ -53,6 +58,7 @@ export function SuccessScreen({
53
58
  onDone,
54
59
  windowAdapter,
55
60
  client,
61
+ hasPaymentId = false,
56
62
  }: SuccessScreenProps) {
57
63
  const theme = useCustomTheme();
58
64
  const [viewState, setViewState] = useState<ViewState>("success");
@@ -120,7 +126,11 @@ export function SuccessScreen({
120
126
  </Text>
121
127
 
122
128
  <Text center color="secondaryText" size="sm">
123
- Your cross-chain payment has been completed successfully.
129
+ {hasPaymentId
130
+ ? "You can now close this page and return to the application."
131
+ : uiOptions.mode === "transaction"
132
+ ? "Click continue to execute your transaction."
133
+ : "Your payment has been completed successfully."}
124
134
  </Text>
125
135
  </Container>
126
136
  <Spacer y="lg" />
@@ -135,9 +145,11 @@ export function SuccessScreen({
135
145
  View Payment Receipt
136
146
  </Button>
137
147
 
138
- <Button fullWidth onClick={onDone} variant="accent">
139
- {uiOptions.mode === "transaction" ? "Continue" : "Done"}
140
- </Button>
148
+ {!hasPaymentId && (
149
+ <Button fullWidth onClick={onDone} variant="accent">
150
+ {uiOptions.mode === "transaction" ? "Continue" : "Done"}
151
+ </Button>
152
+ )}
141
153
  </Container>
142
154
 
143
155
  {/* CSS Animations */}
@@ -222,3 +222,17 @@ export const TransactionPayment: Story = {
222
222
  backgrounds: { default: "light" },
223
223
  },
224
224
  };
225
+
226
+ export const PaymentId: Story = {
227
+ args: {
228
+ client: storyClient,
229
+ completedStatuses: mockBuyCompletedStatuses,
230
+ hasPaymentId: true,
231
+ preparedQuote: simpleBuyQuote,
232
+ theme: "light",
233
+ uiOptions: TRANSACTION_UI_OPTIONS.contractInteraction,
234
+ },
235
+ parameters: {
236
+ backgrounds: { default: "light" },
237
+ },
238
+ };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.105.37";
1
+ export const version = "5.105.38";
@@ -142,6 +142,7 @@ export async function connectWC(
142
142
  "eth_sign",
143
143
  "personal_sign",
144
144
  "eth_signTypedData",
145
+ "eth_signTypedData_v4",
145
146
  "wallet_switchEthereumChain",
146
147
  "wallet_addEthereumChain",
147
148
  ],
@@ -185,8 +186,8 @@ export async function connectWC(
185
186
  }
186
187
  }
187
188
 
188
- if (wcOptions?.onDisplayUri) {
189
- provider.events.removeListener("display_uri", wcOptions.onDisplayUri);
189
+ if (onDisplayUri) {
190
+ provider.events.removeListener("display_uri", onDisplayUri);
190
191
  }
191
192
 
192
193
  return onConnect(