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.
- package/dist/cjs/adapters/eip1193/to-eip1193.js +12 -3
- package/dist/cjs/adapters/eip1193/to-eip1193.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/CheckoutWidget.js +6 -0
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +2 -12
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +2 -2
- package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +6 -2
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +14 -1
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/wallet-connect/controller.js +3 -2
- package/dist/cjs/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/esm/adapters/eip1193/to-eip1193.js +12 -3
- package/dist/esm/adapters/eip1193/to-eip1193.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/CheckoutWidget.js +7 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js +2 -12
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +2 -2
- package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +6 -2
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js +13 -0
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/wallet-connect/controller.js +3 -2
- package/dist/esm/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/types/adapters/eip1193/to-eip1193.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +1 -6
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +5 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +1 -0
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/wallet-connect/controller.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/eip1193/to-eip1193.test.ts +10 -5
- package/src/adapters/eip1193/to-eip1193.ts +16 -5
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +1 -1
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +16 -0
- package/src/react/web/ui/Bridge/DirectPayment.tsx +3 -29
- package/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx +3 -3
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +16 -4
- package/src/stories/Bridge/SuccessScreen.stories.tsx +14 -0
- package/src/version.ts +1 -1
- 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
|
-
{
|
192
|
-
|
193
|
-
|
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
|
124
|
+
Connect a Wallet
|
125
125
|
</Text>
|
126
126
|
<Text color="secondaryText" size="xs">
|
127
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
139
|
-
|
140
|
-
|
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.
|
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 (
|
189
|
-
provider.events.removeListener("display_uri",
|
189
|
+
if (onDisplayUri) {
|
190
|
+
provider.events.removeListener("display_uri", onDisplayUri);
|
190
191
|
}
|
191
192
|
|
192
193
|
return onConnect(
|