File tree Expand file tree Collapse file tree 5 files changed +513
-42
lines changed Expand file tree Collapse file tree 5 files changed +513
-42
lines changed Original file line number Diff line number Diff line change @@ -46,29 +46,22 @@ function BuyMerch() {
46
46
) ,
47
47
} }
48
48
preview = { < BuyMerchPreview /> }
49
- code = { `import { PayEmbed , getDefaultToken } from "thirdweb/react";
49
+ code = { `import { CheckoutWidget , getDefaultToken } from "thirdweb/react";
50
50
import { base } from "thirdweb/chains";
51
51
52
52
function App() {
53
53
return (
54
- <PayEmbed
55
- client={client}
56
- theme={"light"}
57
- payOptions={{
58
- mode: "direct_payment",
59
- paymentInfo: {
60
- amount: "35",
61
- chain: base,
62
- token: getDefaultToken(base, "USDC"),
63
- sellerAddress: "0xEb0effdFB4dC5b3d5d3aC6ce29F3ED213E95d675",
64
- },
65
- metadata: {
66
- name: "Black Hoodie",
67
- description: "Size L. Ships worldwide.",
68
- image: "/drip-hoodie.png",
69
- },
70
- }}
71
- />
54
+ <CheckoutWidget
55
+ client={THIRDWEB_CLIENT}
56
+ theme="light"
57
+ chain={base}
58
+ amount={toUnits("2", 6)}
59
+ tokenAddress="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
60
+ seller="0xEb0effdFB4dC5b3d5d3aC6ce29F3ED213E95d675"
61
+ feePayer="seller"
62
+ name="Black Hoodie"
63
+ description="Size L. Ships worldwide."
64
+ />
72
65
);
73
66
};` }
74
67
lang = "tsx"
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
- import { base } from "thirdweb/chains" ;
3
- import { PayEmbed , getDefaultToken } from "thirdweb/react" ;
2
+ import { CheckoutWidget } from "thirdweb/react" ;
4
3
import { THIRDWEB_CLIENT } from "../../lib/client" ;
4
+ import { toUnits } from "thirdweb" ;
5
+ import { base } from "thirdweb/chains" ;
5
6
6
7
export function BuyMerchPreview ( ) {
7
8
return (
8
9
< >
9
- < PayEmbed
10
+ < CheckoutWidget
10
11
client = { THIRDWEB_CLIENT }
11
12
theme = "light"
12
- payOptions = { {
13
- mode : "direct_payment" ,
14
- paymentInfo : {
15
- amount : "2" ,
16
- chain : base ,
17
- token : getDefaultToken ( base , "USDC" ) ,
18
- sellerAddress : "0xEb0effdFB4dC5b3d5d3aC6ce29F3ED213E95d675" ,
19
- feePayer : "receiver" ,
20
- } ,
21
- metadata : {
22
- name : "Black Hoodie (Size L)" ,
23
- description : "Size L. Ships worldwide." ,
24
- image : "/drip-hoodie.png" ,
25
- } ,
26
- } }
13
+ chain = { base }
14
+ amount = { toUnits ( "2" , 6 ) }
15
+ tokenAddress = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
16
+ seller = "0xEb0effdFB4dC5b3d5d3aC6ce29F3ED213E95d675"
17
+ feePayer = "seller"
18
+ name = "Black Hoodie"
19
+ description = "Size L. Ships worldwide."
27
20
/>
28
21
</ >
29
22
) ;
Original file line number Diff line number Diff line change @@ -134,6 +134,10 @@ export {
134
134
BuyWidget ,
135
135
type BuyWidgetProps ,
136
136
} from "../react/web/ui/Bridge/BuyWidget.js" ;
137
+ export {
138
+ CheckoutWidget ,
139
+ type CheckoutWidgetProps ,
140
+ } from "../react/web/ui/Bridge/CheckoutWidget.js" ;
137
141
export {
138
142
PayEmbed ,
139
143
type PayEmbedProps ,
You can’t perform that action at this time.
0 commit comments