Skip to content

Commit 262d096

Browse files
committed
chore: update changeset examples
1 parent 11c4394 commit 262d096

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

.changeset/clear-olives-know.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ Each operation provides two functions:
2020
#### Buy Example
2121

2222
```typescript
23-
import { Bridge, toWei } from "thirdweb";
23+
import { Bridge, toWei, NATIVE_TOKEN_ADDRESS } from "thirdweb";
2424

2525
// First, get a quote to see approximately how much you'll pay
2626
const buyQuote = await Bridge.Buy.quote({
2727
originChainId: 1, // Ethereum
28-
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH
28+
originTokenAddress: NATIVE_TOKEN_ADDRESS,
2929
destinationChainId: 10, // Optimism
30-
destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH
30+
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
3131
buyAmountWei: toWei("0.01"), // I want to receive 0.01 ETH on Optimism
3232
client: thirdwebClient,
3333
});
@@ -37,9 +37,9 @@ console.log(`To get ${buyQuote.destinationAmount} wei on destination chain, you
3737
// When ready to execute, prepare the transaction
3838
const preparedBuy = await Bridge.Buy.prepare({
3939
originChainId: 1,
40-
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
40+
originTokenAddress: NATIVE_TOKEN_ADDRESS,
4141
destinationChainId: 10,
42-
destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
42+
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
4343
buyAmountWei: toWei("0.01"),
4444
sender: "0x...", // Your wallet address
4545
receiver: "0x...", // Recipient address (can be the same as sender)
@@ -58,9 +58,9 @@ import { Bridge, toWei } from "thirdweb";
5858
// First, get a quote to see approximately how much you'll receive
5959
const sellQuote = await Bridge.Sell.quote({
6060
originChainId: 1, // Ethereum
61-
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH
61+
originTokenAddress: NATIVE_TOKEN_ADDRESS,
6262
destinationChainId: 10, // Optimism
63-
destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH
63+
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
6464
sellAmountWei: toWei("0.01"), // I want to sell 0.01 ETH from Ethereum
6565
client: thirdwebClient,
6666
});
@@ -70,9 +70,9 @@ console.log(`If you send ${sellQuote.originAmount} wei, you'll receive approxima
7070
// When ready to execute, prepare the transaction
7171
const preparedSell = await Bridge.Sell.prepare({
7272
originChainId: 1,
73-
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
73+
originTokenAddress: NATIVE_TOKEN_ADDRESS,
7474
destinationChainId: 10,
75-
destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
75+
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
7676
sellAmountWei: toWei("0.01"),
7777
sender: "0x...", // Your wallet address
7878
receiver: "0x...", // Recipient address (can be the same as sender)
@@ -91,7 +91,7 @@ for (const tx of preparedSell.transactions) {
9191
You can discover available bridge routes using the `routes` function:
9292

9393
```typescript
94-
import { Bridge } from "thirdweb";
94+
import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
9595

9696
// Get all available routes
9797
const allRoutes = await Bridge.routes({
@@ -101,7 +101,7 @@ const allRoutes = await Bridge.routes({
101101
// Filter routes for a specific token or chain
102102
const filteredRoutes = await Bridge.routes({
103103
originChainId: 1, // From Ethereum
104-
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH
104+
originTokenAddress: NATIVE_TOKEN_ADDRESS,
105105
destinationChainId: 10, // To Optimism
106106
client: thirdwebClient,
107107
});

packages/thirdweb/src/bridge/Buy.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import type { PreparedQuote, Quote } from "./types/Quote.js";
99
*
1010
* @example
1111
* ```typescript
12-
* import { Bridge } from "thirdweb";
12+
* import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
1313
*
1414
* const quote = await Bridge.Buy.quote({
1515
* originChainId: 1,
16-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
16+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
1717
* destinationChainId: 10,
18-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
18+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
1919
* buyAmountWei: toWei("0.01"),
2020
* client: thirdwebClient,
2121
* });
@@ -31,9 +31,9 @@ import type { PreparedQuote, Quote } from "./types/Quote.js";
3131
* estimatedExecutionTimeMs: 1000
3232
* intent: {
3333
* originChainId: 1,
34-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
34+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
3535
* destinationChainId: 10,
36-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
36+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
3737
* buyAmountWei: 1000000000000000000n
3838
* }
3939
* }
@@ -123,13 +123,13 @@ export declare namespace quote {
123123
*
124124
* @example
125125
* ```typescript
126-
* import { Bridge } from "thirdweb";
126+
* import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
127127
*
128128
* const quote = await Bridge.Buy.prepare({
129129
* originChainId: 1,
130-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
130+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
131131
* destinationChainId: 10,
132-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
132+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
133133
* buyAmountWei: toWei("0.01"),
134134
* client: thirdwebClient,
135135
* });
@@ -145,7 +145,7 @@ export declare namespace quote {
145145
* estimatedExecutionTimeMs: 1000
146146
* transactions: [
147147
* {
148-
* to: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
148+
* to: NATIVE_TOKEN_ADDRESS,
149149
* value: 10000026098875381n,
150150
* data: "0x",
151151
* chainId: 10,
@@ -155,9 +155,9 @@ export declare namespace quote {
155155
* expiration: 1741730936680,
156156
* intent: {
157157
* originChainId: 1,
158-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
158+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
159159
* destinationChainId: 10,
160-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
160+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
161161
* buyAmountWei: 1000000000000000000n
162162
* }
163163
* }

packages/thirdweb/src/bridge/Sell.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import type { PreparedQuote, Quote } from "./types/Quote.js";
99
*
1010
* @example
1111
* ```typescript
12-
* import { Bridge } from "thirdweb";
12+
* import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
1313
*
1414
* const quote = await Bridge.Sell.quote({
1515
* originChainId: 1,
16-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
16+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
1717
* destinationChainId: 10,
18-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
18+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
1919
* sellAmountWei: toWei("0.01"),
2020
* client: thirdwebClient,
2121
* });
@@ -31,9 +31,9 @@ import type { PreparedQuote, Quote } from "./types/Quote.js";
3131
* estimatedExecutionTimeMs: 1000
3232
* intent: {
3333
* originChainId: 1,
34-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
34+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
3535
* destinationChainId: 10,
36-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
36+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
3737
* sellAmountWei: 1000000000000000000n
3838
* }
3939
* }
@@ -123,13 +123,13 @@ export declare namespace quote {
123123
*
124124
* @example
125125
* ```typescript
126-
* import { Bridge } from "thirdweb";
126+
* import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
127127
*
128128
* const quote = await Bridge.Sell.prepare({
129129
* originChainId: 1,
130-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
130+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
131131
* destinationChainId: 10,
132-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
132+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
133133
* sellAmountWei: toWei("0.01"),
134134
* client: thirdwebClient,
135135
* });
@@ -145,7 +145,7 @@ export declare namespace quote {
145145
* estimatedExecutionTimeMs: 1000
146146
* transactions: [
147147
* {
148-
* to: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
148+
* to: NATIVE_TOKEN_ADDRESS,
149149
* value: 9980000000000000000n,
150150
* data: "0x",
151151
* chainId: 10,
@@ -155,9 +155,9 @@ export declare namespace quote {
155155
* expiration: 1741730936680,
156156
* intent: {
157157
* originChainId: 1,
158-
* originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
158+
* originTokenAddress: NATIVE_TOKEN_ADDRESS,
159159
* destinationChainId: 10,
160-
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
160+
* destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
161161
* sellAmountWei: 1000000000000000000n
162162
* }
163163
* }

0 commit comments

Comments
 (0)