diff --git a/.changeset/icy-points-wish.md b/.changeset/icy-points-wish.md
new file mode 100644
index 00000000000..a34dfb6c65c
--- /dev/null
+++ b/.changeset/icy-points-wish.md
@@ -0,0 +1,5 @@
+---
+"thirdweb": patch
+---
+
++Deprecate legacy Pay functions
diff --git a/apps/portal/src/app/connect/pay/overview/page.mdx b/apps/portal/src/app/connect/pay/overview/page.mdx
index 3b54a45c9cf..7d71ce33785 100644
--- a/apps/portal/src/app/connect/pay/overview/page.mdx
+++ b/apps/portal/src/app/connect/pay/overview/page.mdx
@@ -13,9 +13,9 @@ export const metadata = createMetadata({
"Learn everything about thirdweb’s web3 payments solution, Universal Bridge. Technical docs on onramping, bridging + swapping.",
});
-# Overview
+# Universal Bridge
-Universal Bridge allows your users to bridge, swap, and purchase cryptocurrencies and execute transactions with any fiat options or tokens via cross-chain routing. It enables users to purchase or complete in-app transactions with any token they hold.
+Universal Bridge allows you to create both simple and advanced payment flows for bridging, swapping, onramping, and peer-to-peer purchases. It's been used to drive millions in NFT sales, bridge native tokens to brand new chains, send stablecoins between users, and more. To get started check out the [SDK functions](https://portal.thirdweb.com/typescript/v5/buy/quote), [API reference](https://bridge.thirdweb.com/reference), or [playground](https://playground.thirdweb.com/connect/pay).
@@ -35,7 +35,7 @@ Universal Bridge allows your users to bridge, swap, and purchase cryptocurrencie
description="Bridging support in over 160+ countries to reach a truly global audience."
iconUrl={}
/>
- }
@@ -80,7 +80,6 @@ Universal Bridge is supported on select EVM compatible chains. To view the full
| Provider | Supported Countries |
| -------- | ------------------------------------------------------------------------------------------------------- |
| Transak | https://transak.notion.site/On-Ramp-Payment-Methods-Fees-Other-Details-b0761634feed4b338a69f4f186d906a5 |
-| Kado | https://www.kado.money/supported-countries |
| Stripe | https://docs.stripe.com/crypto/onramp |
| Coinbase | https://docs.cdp.coinbase.com/onramp/docs/payment-methods/ |
@@ -91,4 +90,5 @@ Universal Bridge is supported on select EVM compatible chains. To view the full
| [Buy Crypto](https://playground.thirdweb.com/connect/pay/) | Developers who want onramp and crypto purchase experiences directly in their application. |
| [Transactions](https://playground.thirdweb.com/connect/pay/transactions) | Developers who want users to onramp or purchase crypto directly into a transaction. Great for minting and NFT purchase flows. |
| [In-App Purchases](https://playground.thirdweb.com/connect/pay/commerce) | Developers who want to take payments from Fiat or Crypto directly to a seller wallet |
-| [Headless](https://playground.thirdweb.com/connect/pay/backend) | Developers who prefer a headless customized flow using APIs. |
+| [SDK](https://portal.thirdweb.com/typescript/v5/buy/quote) | Build your own UI with the SDK. |
+| [API](https://playground.thirdweb.com/connect/pay/backend) | Control the full experience with the API. |
diff --git a/apps/portal/src/app/connect/pay/webhooks/page.mdx b/apps/portal/src/app/connect/pay/webhooks/page.mdx
index 141e23495bd..08a888fd7bf 100644
--- a/apps/portal/src/app/connect/pay/webhooks/page.mdx
+++ b/apps/portal/src/app/connect/pay/webhooks/page.mdx
@@ -4,279 +4,120 @@ import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
export const metadata = createMetadata({
title: "Universal Bridge Webhooks Implementation Guide — thirdweb Docs",
description:
- "Learn how to set up webhooks for web3 payments with thirdweb’s Universal bridge feature: the technical docs",
+ "Learn how to set up webhooks for any Universal Bridge transactions.",
});
# Webhooks
-Universal Bridge can be configured to send webhook events to notify your application any time an event happens on your transaction. Universal Bridge sends a response, via a HTTP request, to any endpoint URLs that you have provided us in your Team > Project > Connect > Universal Bridge > Webhooks page in [thirdweb dashboard](https://thirdweb.com/team).
+You can create a webhook in your project dashboard under the Universal Bridge tab. You'll be prompted to copy a secret key before saving the webhook. This will be used for verification on all webhook requests received by your backend.
-## Events
+## Response Objects
-To listen to events, create a webhook in your Team > Project > Connect > Pay > Webhooks page in [thirdweb dashboard](https://thirdweb.com/team). Webhook URLs must start with `https://`.
+To get the TypeScript type for webhook responses, see the [`Webhook.Payload`](https://portal.thirdweb.com/typescript/v5/webhook/payload) type in the SDK.
-| Event | Description |
-| ------------------- | ----------------------------------- |
-| `purchase_complete` | A transaction is confirmed onchain. |
+### Example Payloads
-### Purchase Complete
-
-Triggered when a transaction is confirmed onchain. This event provides information about the new status of the order and its transactionHash, as well as other relevant information.
-
-Example Response:
-
-
+
- Fiat Purchase
- Crypto Purchase
+ Bridge & Swap
+ Onramp
-
-
+
```json
{
+ "version": 2,
"data": {
- "buyWithFiatStatus": {
- "intentId": "f4cf8ab7-bb62-4b3b-a180-70fc7d72446c",
- "status": "ON_RAMP_TRANSFER_COMPLETED",
- "toAddress": "0xebfb127320fcbe8e07e5a03a4bfb782219f4735b",
- "quote": {
- "createdAt": "2024-06-18T23:46:46.024Z",
- "fromCurrency": {
- "amountUnits": "279",
- "amount": "2.79",
- "currencySymbol": "USD",
- "decimals": 2,
- "amountUSDCents": 279
- },
- "fromCurrencyWithFees": {
- "amountUnits": "294",
- "amount": "2.94",
- "currencySymbol": "USD",
- "decimals": 2,
- "amountUSDCents": 279
- },
- "onRampToken": {
- "chainId": 137,
- "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "name": "Matic",
- "symbol": "MATIC",
- "decimals": 18,
- "priceUSDCents": 54.797200000000004
- },
- "toToken": {
- "chainId": 137,
- "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "name": "Matic",
- "symbol": "MATIC",
- "decimals": 18,
- "priceUSDCents": 54.797200000000004
- },
- "estimatedOnRampAmountWei": "5000000000000000000",
- "estimatedOnRampAmount": "5",
- "estimatedToTokenAmount": "5",
- "estimatedToTokenAmountWei": "5000000000000000000",
- "estimatedDurationSeconds": 30
- },
- "source": {
- "completedAt": "2024-06-18T23:49:00.347Z",
- "amount": "5",
- "amountWei": "5000000000000000000",
- "token": {
- "chainId": 137,
- "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "name": "Matic",
- "symbol": "MATIC",
- "decimals": 18,
- "priceUSDCents": 54.797200000000004
- },
- "transactionHash": "0x4bb089f6a60b49235a817b52bf39bc078f1246df15731b85837526bb62cf4e70",
- "explorerLink": "https://polygonscan.com/tx/0x4bb089f6a60b49235a817b52bf39bc078f1246df15731b85837526bb62cf4e70",
- "amountUSDCents": 275
- }
- }
+ "id": "d5d33244-f855-441d-af62-4593094a3eb1",
+ "onramp": "stripe",
+ "token": {
+ "chainId": 8453,
+ "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
+ "symbol": "USDC",
+ "name": "USD Coin",
+ "decimals": 6,
+ "priceUsd": 0.99995,
+ "iconUri": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
+ },
+ "amount": "5100000",
+ "currency": "USDC",
+ "currencyAmount": 5.36,
+ "receiver": "0xa5a484Af10FF67257A06DDbf8DdE6A99a483f098",
+ "status": "PENDING",
+ "purchaseData": null
}
}
```
-
+
```json
{
+ "version": 2,
"data": {
- "buyWithCryptoStatus": {
- "swapType": "SAME_CHAIN",
- "source": {
- "transactionHash": "0x74d6c619a09e78f03f4bd495f29d5937a2539d0bbe8973e7710dce3e88c30b8b",
- "token": {
- "chainId": 10,
- "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "decimals": 18,
- "name": "ETH",
- "symbol": "ETH",
- "priceUSDCents": 346529
- },
- "amountWei": "318486512146714",
- "amount": "0.000318486512146714",
- "amountUSDCents": 110,
- "completedAt": "2024-06-18T23:44:07.000Z"
- },
- "status": "COMPLETED",
- "subStatus": "SUCCESS",
- "fromAddress": "0xebfb127320fcbe8e07e5a03a4bfb782219f4735b",
- "toAddress": "0xebfb127320fcbe8e07e5a03a4bfb782219f4735b",
- "quote": {
- "fromToken": {
- "chainId": 10,
- "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "decimals": 18,
- "name": "ETH",
- "symbol": "ETH",
- "priceUSDCents": 346529
- },
- "toToken": {
- "chainId": 10,
- "tokenAddress": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
- "decimals": 6,
- "name": "USD Coin",
- "symbol": "USDC",
- "priceUSDCents": 99
- },
- "fromAmountWei": "318486512146714",
- "fromAmount": "0.000318486512146714",
- "toAmountWei": "1100000",
- "toAmount": "1.1",
- "toAmountMinWei": "1100000",
- "toAmountMin": "1.1",
- "estimated": {
- "fromAmountUSDCents": 110,
- "toAmountMinUSDCents": 109,
- "toAmountUSDCents": 109,
- "slippageBPS": 91,
- "feesUSDCents": 32,
- "gasCostUSDCents": 40,
- "durationSeconds": 30
- },
- "createdAt": "2024-06-18T23:43:45.900Z"
+ "transactionId": "0x7baae858e28628fe57cb0ca93c86fcda68f556563199cb4472044bfd9fbe5ec8",
+ "paymentId": "0xbea711bf1da223b29b176cff7f01596834dd63c7ad85477a3504f4b9285b33a2",
+ "clientId": "c56b27030ad22846003fafbb4302b5d7",
+ "action": "SELL",
+ "status": "COMPLETED",
+ "originToken": {
+ "chainId": 466,
+ "address": "0x675C3ce7F43b00045a4Dab954AF36160fb57cB45",
+ "symbol": "USDC",
+ "name": "USD Coin",
+ "decimals": 6,
+ "priceUsd": 0.99995,
+ "iconUri": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
+ },
+ "originAmount": "24875000",
+ "destinationToken": {
+ "chainId": 8453,
+ "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
+ "symbol": "USDC",
+ "name": "USD Coin",
+ "decimals": 6,
+ "priceUsd": 0.99995,
+ "iconUri": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
+ },
+ "destinationAmount": "24794905",
+ "sender": "0xb4523A0D69612B9A4629A70E42021B2F384CC8Fa",
+ "receiver": "0x044A83bA68f36CF1F27836Cb93614f86d8B0ea96",
+ "type": "sell",
+ "transactions": [
+ {
+ "chainId": 466,
+ "transactionHash": "0xc507bde1da0832d097c2160aacc2c9333ac3a0516c8dca4fb955f4c949da1ef6"
},
- "destination": {
- "transactionHash": "0x74d6c619a09e78f03f4bd495f29d5937a2539d0bbe8973e7710dce3e88c30b8b",
- "token": {
- "chainId": 10,
- "tokenAddress": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
- "decimals": 6,
- "name": "USD Coin",
- "symbol": "USDC",
- "priceUSDCents": 99
- },
- "amountWei": "1100000",
- "amount": "1.1",
- "amountUSDCents": 109,
- "completedAt": "2024-06-18T23:44:07.000Z"
+ {
+ "chainId": 8453,
+ "transactionHash": "0xc44b372284061a11ec96c67acfc96a67cc6180d14753b55a93c1f780d16ddc95"
}
- }
+ ],
+ "developerFeeBps": 20,
+ "developerFeeRecipient": "0x66d3d733e597bdf8b794ab6e13c8f2be0fcda39b"
}
}
```
-## Webhook Verification (Recommended)
-
-Since any outside origin can call your webhook endpoint, it is recommended to verify the webhook signature to ensure a request comes from your Pay instance.
-
-### Check the Signature
-
-The payload body is signed with the webhook secret and provided in the X-Pay-Signature request header.
-
-Get the webhook secret for your webhook endpoint from the dashboard.
-
-This code example checks if the signature is valid:
-
-```tsx
-const generateSignature = (
- body: string,
- timestamp: string,
- secret: string,
-): string => {
- const payload = `${timestamp}.${body}`;
- return crypto.createHmac("sha256", secret).update(payload).digest("hex");
-};
-
-const isValidSignature = (
- body: string,
- timestamp: string,
- signature: string,
- secret: string,
-): boolean => {
- const expectedSignature = generateSignature(body, timestamp, secret);
- return crypto.timingSafeEqual(
- Buffer.from(expectedSignature),
- Buffer.from(signature),
- );
-};
-```
+## Webhook Verification
-Check the timestamp
-The event timestamp is provided in the X-Pay-Timestamp request header.
+There are two ways to verify a webhook request authenticity:
+1. Checking that the bearer token in the `Authorization` header matches the secret key received when you created the webhook.
+2. Decrypting the payload signature from the `x-payload-signature` header and verifying it against the received webhook body.
-This code example checks if the event exceeds a given expiration duration:
+### Decrypting the Payload Signature
-```tsx
-export const isExpired = (
- timestamp: string,
- expirationInSeconds: number,
-): boolean => {
- const currentTime = Math.floor(Date.now() / 1000);
- return currentTime - parseInt(timestamp) > expirationInSeconds;
-};
+The payload signature is constructed using the `x-timestamp` header and the webhook's full body:
+```ts
+const signature = crypto
+ .createHmac("sha256", decryptedSecret)
+ .update(`${timestamp}.${payload}`)
+ .digest("hex");
```
+The `x-timestamp` header is a UNIX timestamp in seconds, and the webhook body is the JSON payload received by your webhook endpoint.
-### Example webhook endpoint
-
-This NodeJS code example listens for event notifications on the /webhook endpoint:
-
-```tsx
-import express from "express";
-import bodyParser from "body-parser";
-import { isValidSignature, isExpired } from "./webhookHelper";
-
-const app = express();
-const port = 3000;
-
-const WEBHOOK_SECRET = "";
-
-app.use(bodyParser.text());
-
-app.post("/webhook", (req, res) => {
- const signatureFromHeader = req.header("X-Pay-Signature");
- const timestampFromHeader = req.header("X-Pay-Timestamp");
+Then verify that the signature matches the `x-payload-signature` header.
- if (!signatureFromHeader || !timestampFromHeader) {
- return res.status(401).send("Missing signature or timestamp header");
- }
-
- if (
- !isValidSignature(
- req.body,
- timestampFromHeader,
- signatureFromHeader,
- WEBHOOK_SECRET,
- )
- ) {
- return res.status(401).send("Invalid signature");
- }
-
- if (isExpired(timestampFromHeader, 300)) {
- // Assuming expiration time is 5 minutes (300 seconds)
- return res.status(401).send("Request has expired");
- }
-
- // Process the request
- res.status(200).send("Webhook received!");
-});
-
-app.listen(port, () => {
- console.log(`Server started on http://localhost:${port}`);
-});
-```
+**When using webhooks to distribute purchased items, always verify that the proper amount was paid to the proper address.**
diff --git a/apps/portal/src/app/connect/sidebar.tsx b/apps/portal/src/app/connect/sidebar.tsx
index 33e86eb472d..4a92fd885f9 100644
--- a/apps/portal/src/app/connect/sidebar.tsx
+++ b/apps/portal/src/app/connect/sidebar.tsx
@@ -236,6 +236,10 @@ export const sidebar: SideBar = {
name: "Service Fees",
href: `${paySlug}/fees`,
},
+ {
+ name: "API",
+ href: "https://bridge.thirdweb.com/reference",
+ },
{
name: "Get Started",
href: `${paySlug}/get-started`,
@@ -246,7 +250,7 @@ export const sidebar: SideBar = {
href: `${paySlug}/get-started#option-1-connectbutton`,
},
{
- name: "Embed Pay",
+ name: "Embed",
href: `${paySlug}/get-started#option-2-embed-pay`,
},
{
diff --git a/apps/portal/src/app/references/components/TDoc/Function.tsx b/apps/portal/src/app/references/components/TDoc/Function.tsx
index 6343228a432..512f84883df 100644
--- a/apps/portal/src/app/references/components/TDoc/Function.tsx
+++ b/apps/portal/src/app/references/components/TDoc/Function.tsx
@@ -19,6 +19,7 @@ import { DeprecatedCalloutTDoc } from "./Deprecated";
import { SourceLinkTypeDoc } from "./SourceLink";
import { TypedocSummary } from "./Summary";
import fetchDocBySlug from "./fetchDocs/fetchDocBySlug";
+import { getExtensionName } from "./utils/getSidebarLinkgroups";
import { getTags } from "./utils/getTags";
import { getTokenLinks } from "./utils/getTokenLinks";
@@ -35,11 +36,17 @@ export function FunctionTDoc(props: {
? doc.signatures?.length > 1
: false;
+ const blockTag = doc.signatures?.[0]?.blockTags?.find(
+ (b) =>
+ b.tag === "@extension" || b.tag === "@modules" || b.tag === "@bridge",
+ );
+ const extensionName = blockTag ? getExtensionName(blockTag) : undefined;
+
return (
<>
{props.showHeading !== false && (
- {doc.name}
+ {extensionName ? `${extensionName}.${doc.name}` : doc.name}
)}
diff --git a/apps/portal/src/app/references/components/TDoc/PageLayout.tsx b/apps/portal/src/app/references/components/TDoc/PageLayout.tsx
index f40623d3ea4..210dabea524 100644
--- a/apps/portal/src/app/references/components/TDoc/PageLayout.tsx
+++ b/apps/portal/src/app/references/components/TDoc/PageLayout.tsx
@@ -64,7 +64,8 @@ export function getTDocPage(options: {
);
}
- const selectedDoc = docSlug && slugToDoc[docSlug];
+ const selectedDoc =
+ docSlug && (slugToDoc[docSlug] || slugToDoc[`common/${docSlug}`]);
if (!selectedDoc) {
notFound();
diff --git a/apps/portal/src/app/references/components/TDoc/Summary.tsx b/apps/portal/src/app/references/components/TDoc/Summary.tsx
index d5c4df952a3..d037b195179 100644
--- a/apps/portal/src/app/references/components/TDoc/Summary.tsx
+++ b/apps/portal/src/app/references/components/TDoc/Summary.tsx
@@ -23,12 +23,14 @@ export function TypedocSummary(props: {
{props.summary.map((s) => {
switch (s.type) {
case "code": {
- return ;
+ return (
+
+ );
}
case "html":
case "inlineCode": {
- return ;
+ return ;
}
case "link": {
@@ -36,7 +38,7 @@ export function TypedocSummary(props: {
// TODO - link to doc
return (
-
+
);
@@ -44,27 +46,27 @@ export function TypedocSummary(props: {
case "paragraph": {
return (
-
+
);
}
case "text": {
- return {s.value};
+ return {s.value};
}
case "list": {
if (s.ordered) {
return (
-
+
);
}
return (
-
+
);
@@ -72,7 +74,7 @@ export function TypedocSummary(props: {
case "listItem": {
return (
-
+
);
@@ -81,6 +83,7 @@ export function TypedocSummary(props: {
case "heading": {
return (
@@ -92,7 +95,7 @@ export function TypedocSummary(props: {
case "strong":
case "emphasis": {
return (
-
+
);
diff --git a/apps/portal/src/app/typescript/v5/[...slug]/page.tsx b/apps/portal/src/app/typescript/v5/[...slug]/page.tsx
index 588c390b517..bc8c4bc982d 100644
--- a/apps/portal/src/app/typescript/v5/[...slug]/page.tsx
+++ b/apps/portal/src/app/typescript/v5/[...slug]/page.tsx
@@ -15,7 +15,8 @@ export default async function Page(props: PageProps) {
}
// API page
- const selectedDoc = docSlug && slugToDoc[docSlug];
+ const selectedDoc =
+ docSlug && (slugToDoc[docSlug] || slugToDoc[`common/${docSlug}`]);
if (selectedDoc) {
return (
diff --git a/apps/portal/src/app/typescript/v5/sidebar.tsx b/apps/portal/src/app/typescript/v5/sidebar.tsx
index 71474466095..6b53ae4c23f 100644
--- a/apps/portal/src/app/typescript/v5/sidebar.tsx
+++ b/apps/portal/src/app/typescript/v5/sidebar.tsx
@@ -1,7 +1,10 @@
import { CodeIcon, ExternalLink, ZapIcon } from "lucide-react";
import type { SideBar } from "../../../components/Layouts/DocLayout";
import { fetchTypeScriptDoc } from "../../references/components/TDoc/fetchDocs/fetchTypeScriptDoc";
-import { getCustomTag } from "../../references/components/TDoc/utils/getSidebarLinkgroups";
+import {
+ getCustomTag,
+ getExtensionName,
+} from "../../references/components/TDoc/utils/getSidebarLinkgroups";
const slug = "/typescript/v5";
const docs = await fetchTypeScriptDoc();
@@ -221,30 +224,86 @@ export const sidebar: SideBar = {
href: `${slug}/storage`,
},
{
- name: "Pay with Fiat",
- links:
- docs.functions
- ?.filter((f) => {
- const [tag] = getCustomTag(f) || [];
- return tag === "@buyCrypto" && f.name.includes("Fiat");
- })
- ?.map((f) => ({
- name: f.name,
- href: `${slug}/${f.name}`,
- })) || [],
- },
- {
- name: "Bridge & Swap",
- links:
- docs.functions
+ name: "Bridge, Swap, and Onramp",
+ links: [
+ {
+ name: "Buy",
+ links:
+ docs.functions
+ ?.filter((f) => {
+ const [tag] = getCustomTag(f) || [];
+ if (tag !== "@bridge") return false;
+ const blockTag = f.signatures?.[0]?.blockTags?.find(
+ (b) => b.tag === "@bridge",
+ );
+ const extensionName = blockTag
+ ? getExtensionName(blockTag) || "Common"
+ : "Common";
+ if (extensionName !== "Buy") return false;
+ return true;
+ })
+ .map((f) => {
+ const blockTag = f.signatures?.[0]?.blockTags?.find(
+ (b) => b.tag === "@bridge",
+ );
+ const extensionName = blockTag
+ ? getExtensionName(blockTag) || "Common"
+ : "Common";
+ return {
+ name: f.name,
+ href: `${slug}/${extensionName.toLowerCase()}/${f.name}`,
+ };
+ }) || [],
+ },
+ {
+ name: "Sell",
+ links:
+ docs.functions
+ ?.filter((f) => {
+ const [tag] = getCustomTag(f) || [];
+ if (tag !== "@bridge") return false;
+ const blockTag = f.signatures?.[0]?.blockTags?.find(
+ (b) => b.tag === "@bridge",
+ );
+ const extensionName = blockTag
+ ? getExtensionName(blockTag) || "Common"
+ : "Common";
+ if (extensionName !== "Sell") return false;
+ return true;
+ })
+ .map((f) => {
+ const blockTag = f.signatures?.[0]?.blockTags?.find(
+ (b) => b.tag === "@bridge",
+ );
+ const extensionName = blockTag
+ ? getExtensionName(blockTag) || "Common"
+ : "Common";
+ return {
+ name: f.name,
+ href: `${slug}/${extensionName.toLowerCase()}/${f.name}`,
+ };
+ }) || [],
+ },
+ ...(docs.functions
?.filter((f) => {
const [tag] = getCustomTag(f) || [];
- return tag === "@buyCrypto" && f.name.includes("Crypto");
+ if (tag !== "@bridge") return false;
+ const blockTag = f.signatures?.[0]?.blockTags?.find(
+ (b) => b.tag === "@bridge",
+ );
+ const extensionName = blockTag
+ ? getExtensionName(blockTag) || "Common"
+ : "Common";
+ if (extensionName !== "Common") return false;
+ return true;
})
- ?.map((f) => ({
- name: f.name,
- href: `${slug}/${f.name}`,
- })) || [],
+ ?.map((f) => {
+ return {
+ name: f.name,
+ href: `${slug}/${f.name}`,
+ };
+ }) || []),
+ ],
},
],
},
diff --git a/packages/thirdweb/src/pay/buyWithCrypto/getHistory.ts b/packages/thirdweb/src/pay/buyWithCrypto/getHistory.ts
index bb564769cc4..dd273b6bff6 100644
--- a/packages/thirdweb/src/pay/buyWithCrypto/getHistory.ts
+++ b/packages/thirdweb/src/pay/buyWithCrypto/getHistory.ts
@@ -61,6 +61,7 @@ export type BuyWithCryptoHistoryData = {
* const status = await getBuyWithCryptoHistory(params)
* ```
* @returns Object of type [`BuyWithCryptoHistoryData`](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData)
+ * @deprecated
* @buyCrypto
*/
export async function getBuyWithCryptoHistory(
diff --git a/packages/thirdweb/src/pay/buyWithCrypto/getQuote.ts b/packages/thirdweb/src/pay/buyWithCrypto/getQuote.ts
index 47a0774707b..42c9760dadc 100644
--- a/packages/thirdweb/src/pay/buyWithCrypto/getQuote.ts
+++ b/packages/thirdweb/src/pay/buyWithCrypto/getQuote.ts
@@ -208,6 +208,7 @@ export type BuyWithCryptoQuote = {
* maxSlippageBPS: 50, // optional: max 0.5% slippage
* });
* ```
+ * @deprecated
* @buyCrypto
*/
export async function getBuyWithCryptoQuote(
diff --git a/packages/thirdweb/src/pay/buyWithCrypto/getStatus.ts b/packages/thirdweb/src/pay/buyWithCrypto/getStatus.ts
index 7c74d572039..8515b68a9af 100644
--- a/packages/thirdweb/src/pay/buyWithCrypto/getStatus.ts
+++ b/packages/thirdweb/src/pay/buyWithCrypto/getStatus.ts
@@ -123,6 +123,7 @@ export type ValidBuyWithCryptoStatus = Exclude<
* }});
* ```
* @returns Object of type [`BuyWithCryptoStatus`](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus)
+ * @deprecated
* @buyCrypto
*/
export async function getBuyWithCryptoStatus(
diff --git a/packages/thirdweb/src/pay/buyWithCrypto/getTransfer.ts b/packages/thirdweb/src/pay/buyWithCrypto/getTransfer.ts
index 5681afd4ab8..74e480db7b0 100644
--- a/packages/thirdweb/src/pay/buyWithCrypto/getTransfer.ts
+++ b/packages/thirdweb/src/pay/buyWithCrypto/getTransfer.ts
@@ -119,6 +119,7 @@ export type BuyWithCryptoTransfer = {
* }
* });
* ```
+ * @deprecated
* @buyCrypto
*/
export async function getBuyWithCryptoTransfer(
diff --git a/packages/thirdweb/src/pay/buyWithFiat/getHistory.ts b/packages/thirdweb/src/pay/buyWithFiat/getHistory.ts
index a6e557b1d80..22ac53117a3 100644
--- a/packages/thirdweb/src/pay/buyWithFiat/getHistory.ts
+++ b/packages/thirdweb/src/pay/buyWithFiat/getHistory.ts
@@ -5,6 +5,7 @@ import type { BuyWithFiatStatus } from "./getStatus.js";
/**
* The parameters for [`getBuyWithFiatHistory`](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatHistory) function
+ * @deprecated
* @buyCrypto
*/
export type BuyWithFiatHistoryParams = {
@@ -60,6 +61,7 @@ export type BuyWithFiatHistoryData = {
* })
* ```
* @returns Object of type [`BuyWithFiatHistoryData`](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData)
+ * @deprecated
* @buyCrypto
*/
export async function getBuyWithFiatHistory(
diff --git a/packages/thirdweb/src/pay/buyWithFiat/getPostOnRampQuote.ts b/packages/thirdweb/src/pay/buyWithFiat/getPostOnRampQuote.ts
index dbc5fb23a29..e40a905285e 100644
--- a/packages/thirdweb/src/pay/buyWithFiat/getPostOnRampQuote.ts
+++ b/packages/thirdweb/src/pay/buyWithFiat/getPostOnRampQuote.ts
@@ -55,6 +55,7 @@ export type GetPostOnRampQuoteParams = {
* });
* }
* ```
+ * @deprecated
* @buyCrypto
*/
export async function getPostOnRampQuote({
diff --git a/packages/thirdweb/src/pay/buyWithFiat/getQuote.ts b/packages/thirdweb/src/pay/buyWithFiat/getQuote.ts
index 03f4ed3dcbd..d30b22406c0 100644
--- a/packages/thirdweb/src/pay/buyWithFiat/getQuote.ts
+++ b/packages/thirdweb/src/pay/buyWithFiat/getQuote.ts
@@ -6,6 +6,7 @@ import type { FiatProvider, PayTokenInfo } from "../utils/commonTypes.js";
import { getPayBuyWithFiatQuoteEndpoint } from "../utils/definitions.js";
/**
* Parameters for [`getBuyWithFiatQuote`](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote) function
+ * @deprecated
* @buyCrypto
*/
export type GetBuyWithFiatQuoteParams = {
@@ -102,6 +103,7 @@ export type GetBuyWithFiatQuoteParams = {
* - The on-ramp and destination token information.
* - Processing fees
*
+ * @deprecated
* @buyCrypto
*/
export type BuyWithFiatQuote = {
diff --git a/packages/thirdweb/src/pay/buyWithFiat/getStatus.ts b/packages/thirdweb/src/pay/buyWithFiat/getStatus.ts
index 89f95e88b24..082dc4003a5 100644
--- a/packages/thirdweb/src/pay/buyWithFiat/getStatus.ts
+++ b/packages/thirdweb/src/pay/buyWithFiat/getStatus.ts
@@ -8,6 +8,7 @@ import { getPayBuyWithFiatStatusEndpoint } from "../utils/definitions.js";
/**
* Parameters for the [`getBuyWithFiatStatus`](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatStatus) function
+ * @deprecated
* @buyCrypto
*/
export type GetBuyWithFiatStatusParams = {
@@ -172,6 +173,7 @@ export type BuyWithFiatStatus =
* // when the fiatStatus.status is "ON_RAMP_TRANSFER_COMPLETED" - the process is complete
* // when the fiatStatus.status is "CRYPTO_SWAP_REQUIRED" - start the swap process
* ```
+ * @deprecated
* @buyCrypto
*/
export async function getBuyWithFiatStatus(
diff --git a/packages/thirdweb/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts b/packages/thirdweb/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts
index f0856904143..ed0a2076d41 100644
--- a/packages/thirdweb/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts
+++ b/packages/thirdweb/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts
@@ -12,6 +12,7 @@ import type { BuyWithFiatQuote } from "./getQuote.js";
*
* @param buyWithFiatQuote - The quote of type [`BuyWithFiatQuote`](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote) returned
* by the [`getBuyWithFiatQuote`](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote) function.
+ * @deprecated
* @buyCrypto
*/
export function isSwapRequiredPostOnramp(
diff --git a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoHistory.ts b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoHistory.ts
index 6e1fc94615f..a363569e177 100644
--- a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoHistory.ts
+++ b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoHistory.ts
@@ -34,6 +34,7 @@ export type BuyWithCryptoHistoryQueryOptions = Omit<
* return ...
* }
* ```
+ * @deprecated
* @buyCrypto
*/
export function useBuyWithCryptoHistory(
diff --git a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoQuote.ts b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoQuote.ts
index 334cfe948d4..5e79673dc8a 100644
--- a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoQuote.ts
+++ b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoQuote.ts
@@ -71,6 +71,7 @@ export type BuyWithCryptoQuoteQueryOptions = Omit<
* return
* }
* ```
+ * @deprecated
* @buyCrypto
*/
export function useBuyWithCryptoQuote(
diff --git a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoStatus.ts b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoStatus.ts
index f21838fa3b7..4879bd84384 100644
--- a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoStatus.ts
+++ b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithCryptoStatus.ts
@@ -52,6 +52,7 @@ import {
* return
* }
* ```
+ * @deprecated
* @buyCrypto
*/
export function useBuyWithCryptoStatus(params?: BuyWithCryptoTransaction) {
diff --git a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatHistory.ts b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatHistory.ts
index e414e85b99e..292295c665e 100644
--- a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatHistory.ts
+++ b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatHistory.ts
@@ -34,6 +34,7 @@ export type BuyWithFiatHistoryQueryOptions = Omit<
* return ...
* }
* ```
+ * @deprecated
* @buyCrypto
*/
export function useBuyWithFiatHistory(
diff --git a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuote.ts b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuote.ts
index c645d974a46..9594596c2c5 100644
--- a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuote.ts
+++ b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuote.ts
@@ -60,6 +60,7 @@ export type BuyWithFiatQuoteQueryOptions = Omit<
* );
* }
* ```
+ * @deprecated
* @buyCrypto
*/
export function useBuyWithFiatQuote(
diff --git a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatStatus.ts b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatStatus.ts
index 9316d45fdf4..6a54845518d 100644
--- a/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatStatus.ts
+++ b/packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatStatus.ts
@@ -32,6 +32,7 @@ import type { WithPickedOnceQueryOptions } from "../types.js";
* return ...
;
* }
* ```
+ * @deprecated
* @buyCrypto
*/
export function useBuyWithFiatStatus(