Skip to content

Commit fe13706

Browse files
committed
fix: update docs with beta and bridge tags
1 parent 95423cf commit fe13706

File tree

7 files changed

+31
-11
lines changed

7 files changed

+31
-11
lines changed

.changeset/clear-olives-know.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const bridgeStatus = await Bridge.status({
128128
client: thirdwebClient,
129129
});
130130

131-
// The status will be one of: "completed", "pending", or "failed"
131+
// The status will be one of: "COMPLETED", "PENDING", "FAILED", or "NOT_FOUND"
132132
if (bridgeStatus.status === "completed") {
133133
console.log(`
134134
Bridge completed!

packages/thirdweb/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
"import": "./dist/esm/exports/chains.js",
4141
"default": "./dist/cjs/exports/chains.js"
4242
},
43-
"./universal": {
44-
"types": "./dist/types/exports/universal.d.ts",
45-
"import": "./dist/esm/exports/universal.js",
46-
"default": "./dist/cjs/exports/universal.js"
47-
},
4843
"./contract": {
4944
"types": "./dist/types/exports/contract.d.ts",
5045
"import": "./dist/esm/exports/contract.js",

packages/thirdweb/src/bridge/Buy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ import type { PreparedQuote, Quote } from "./types/Quote.js";
5555
* @returns A promise that resolves to a non-finalized quote for the requested buy.
5656
*
5757
* @throws Will throw an error if there is an issue fetching the quote.
58+
* @bridge
59+
* @beta
5860
*/
5961
export async function quote(options: quote.Options): Promise<quote.Result> {
6062
const {
@@ -186,6 +188,8 @@ export declare namespace quote {
186188
* @returns A promise that resolves to a non-finalized quote for the requested buy.
187189
*
188190
* @throws Will throw an error if there is an issue fetching the quote.
191+
* @bridge
192+
* @beta
189193
*/
190194
export async function prepare(
191195
options: prepare.Options,

packages/thirdweb/src/bridge/Routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ import type { Route } from "./types/Route.js";
9999
* @returns A promise that resolves to an array of routes.
100100
*
101101
* @throws Will throw an error if there is an issue fetching the routes.
102+
* @bridge
103+
* @beta
102104
*/
103105
export async function routes(options: routes.Options): Promise<routes.Result> {
104106
const {

packages/thirdweb/src/bridge/Sell.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ import type { PreparedQuote, Quote } from "./types/Quote.js";
4949
* @param options.originTokenAddress - The address of the origin token.
5050
* @param options.destinationChainId - The chain ID of the destination token.
5151
* @param options.destinationTokenAddress - The address of the destination token.
52-
+ * @param options.sellAmountWei - The amount of the origin token to sell.
52+
* @param options.sellAmountWei - The amount of the origin token to sell.
5353
* @param options.client - Your thirdweb client.
5454
*
5555
* @returns A promise that resolves to a non-finalized quote for the requested sell.
5656
*
5757
* @throws Will throw an error if there is an issue fetching the quote.
58+
* @bridge
59+
* @beta
5860
*/
5961
export async function quote(options: quote.Options): Promise<quote.Result> {
6062
const {
@@ -186,6 +188,8 @@ export declare namespace quote {
186188
* @returns A promise that resolves to a non-finalized quote for the requested buy.
187189
*
188190
* @throws Will throw an error if there is an issue fetching the quote.
191+
* @bridge
192+
* @beta
189193
*/
190194
export async function prepare(
191195
options: prepare.Options,

packages/thirdweb/src/bridge/Status.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import type { Status } from "./types/Status.js";
2323
* If the transaction is complete, a response might look like:
2424
* ```typescript
2525
* {
26-
* status: 'completed',
26+
* status: 'COMPLETED',
2727
* originAmount: 200000000000000n,
2828
* destinationAmount: 188625148000000n,
2929
* originChainId: 8453,
@@ -43,10 +43,18 @@ import type { Status } from "./types/Status.js";
4343
* }
4444
* ```
4545
*
46+
* If the origin transaction hasn't been mined yet, a response might look like:
47+
* ```typescript
48+
* {
49+
* status: "NOT_FOUND",
50+
* }
51+
* ```
52+
* This is to allow you to poll for the status without catching an error. Be sure your transaction hash and chain are correct though, as this could also represent a legitimate 404 if the transaction doesn't exist.
53+
*
4654
* If the transaction is still pending, a response might look like:
4755
* ```typescript
4856
* {
49-
* status: "pending",
57+
* status: "PENDING",
5058
* originAmount: 1000000000000000000n,
5159
* originChainId: 466,
5260
* destinationChainId: 1,
@@ -64,7 +72,7 @@ import type { Status } from "./types/Status.js";
6472
* If the transaction failed, a response might look like:
6573
* ```typescript
6674
* {
67-
* status: "failed",
75+
* status: "FAILED",
6876
* transactions: [
6977
* {
7078
* transactionHash: "0xe199ef82a0b6215221536e18ec512813c1aa10b4f5ed0d4dfdfcd703578da56d",
@@ -76,7 +84,7 @@ import type { Status } from "./types/Status.js";
7684
*
7785
* This status is for a **single origin transaction only**. If your route involves multiple transactions, you'll need to get the status for each of them individually.
7886
*
79-
* If sending multiple dependent sequential transactions, wait until `status` returns `completed` before sending the next transaction.
87+
* If sending multiple dependent sequential transactions, wait until `status` returns `COMPLETED` before sending the next transaction.
8088
*
8189
* You can access this function's input and output types with `status.Options` and `status.Result`, respectively.
8290
*
@@ -88,6 +96,8 @@ import type { Status } from "./types/Status.js";
8896
* @returns A promise that resolves to a status object for the transaction.
8997
*
9098
* @throws Will throw an error if there is an issue fetching the status.
99+
* @bridge
100+
* @beta
91101
*/
92102
export async function status(options: status.Options): Promise<status.Result> {
93103
const { transactionHash, chainId, client } = options;

packages/thirdweb/tsdoc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
"tagName": "@buyCrypto",
5858
"syntaxKind": "block"
5959
},
60+
{
61+
"tagName": "@bridge",
62+
"syntaxKind": "block"
63+
},
6064
{
6165
"tagName": "@storage",
6266
"syntaxKind": "block"
@@ -112,6 +116,7 @@
112116
"@walletConnection": true,
113117
"@walletUtils": true,
114118
"@buyCrypto": true,
119+
"@bridge": true,
115120
"@storage": true,
116121
"@auth": true,
117122
"@utils": true,

0 commit comments

Comments
 (0)