@@ -11,7 +11,9 @@ export function PayEmbedFTUX(props: { clientId: string }) {
1111 return (
1212 < div className = "rounded-lg border bg-card" >
1313 < div className = "border-b px-4 py-4 lg:px-6" >
14- < h2 className = "font-semibold text-xl tracking-tight" > Integrate Pay</ h2 >
14+ < h2 className = "font-semibold text-xl tracking-tight" >
15+ Start Monetizing Your App
16+ </ h2 >
1517 </ div >
1618
1719 < div className = "px-4 py-6 lg:p-6" >
@@ -44,13 +46,19 @@ export function PayEmbedFTUX(props: { clientId: string }) {
4446 />
4547 ) }
4648 { tab === "sdk" && (
47- < CodeServer code = { sdkCode } lang = "ts" className = "bg-background" />
49+ < CodeServer
50+ code = { sdkCode ( props . clientId ) }
51+ lang = "ts"
52+ className = "bg-background"
53+ ignoreFormattingErrors
54+ />
4855 ) }
4956 { tab === "api" && (
5057 < CodeServer
5158 code = { apiCode ( props . clientId ) }
5259 lang = "bash"
5360 className = "bg-background"
61+ ignoreFormattingErrors
5462 />
5563 ) }
5664 </ div >
@@ -75,7 +83,7 @@ export function PayEmbedFTUX(props: { clientId: string }) {
7583 ) ;
7684}
7785
78- const embedCode = ( clientId : string ) => `
86+ const embedCode = ( clientId : string ) => `\
7987import { createThirdwebClient } from "thirdweb";
8088import { PayEmbed } from "thirdweb/react";
8189
@@ -85,25 +93,28 @@ const client = createThirdwebClient({
8593
8694export default function App() {
8795 return <PayEmbed client={client} />;
88- }
89- ` ;
96+ }` ;
9097
91- const sdkCode = `
92- import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
98+ const sdkCode = ( clientId : string ) => `\
99+ import { Bridge, NATIVE_TOKEN_ADDRESS, createThirdwebClient, toWei } from "thirdweb";
100+
101+ const client = createThirdwebClient({
102+ clientId: "${ clientId } ",
103+ });
93104
94105const quote = await Bridge.Buy.prepare({
95106 originChainId: 1,
96- originTokenAddress: NATIVE_TOKEN_ADDRESS ,
107+ originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" ,
97108 destinationChainId: 10,
98- destinationTokenAddress: NATIVE_TOKEN_ADDRESS ,
109+ destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" ,
99110 amount: toWei("0.01"),
100- client: thirdwebClient,
101- });
102- ` ;
111+ sender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
112+ receiver: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
113+ client,
114+ });` ;
103115
104- const apiCode = ( clientId : string ) => `
105- curl -X POST https://pay.thirdweb.com/v1/buy/quote \
106- -H "Content-Type: application/json" \
107- -H "x-client-id: ${ clientId } " \
108- -d '{"originChainId":1,"originTokenAddress":"0x...","destinationChainId":10,"destinationTokenAddress":"0x...","amount":"0.01"}'
109- ` ;
116+ const apiCode = ( clientId : string ) => `\
117+ curl -X POST https://pay.thirdweb.com/v1/buy/prepare
118+ -H "Content-Type: application/json"
119+ -H "x-client-id: ${ clientId } "
120+ -d '{"originChainId":"1","originTokenAddress":"0x...","destinationChainId":"10","destinationTokenAddress":"0x...","amount":"0.01"}'` ;
0 commit comments