Skip to content

Commit 26df50c

Browse files
committed
changeset
1 parent 845963f commit 26df50c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.changeset/forty-states-shake.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Adds the `maxSteps` option to Buy.quote, Buy.prepare, Sell.quote, and Sell.prepare functions. This allows users to limit quotes to routes with a specific number of steps or fewer. For example:
6+
7+
```ts
8+
const quote = await bridge.Buy.quote({
9+
originChainId: 1,
10+
originTokenAddress: "0x...",
11+
destinationChainId: 137,
12+
destinationTokenAddress: "0x...",
13+
amount: 1000000n,
14+
maxSteps: 2
15+
});
16+
17+
const preparedQuote = await bridge.Buy.prepare({
18+
originChainId: 1,
19+
originTokenAddress: "0x...",
20+
destinationChainId: 137,
21+
destinationTokenAddress: "0x...",
22+
amount: 1000000n,
23+
sender: "0x...",
24+
receiver: "0x...",
25+
maxSteps: 2
26+
});
27+
28+
const quote = await bridge.Sell.quote({
29+
originChainId: 1,
30+
originTokenAddress: "0x...",
31+
destinationChainId: 137,
32+
destinationTokenAddress: "0x...",
33+
amount: 1000000n,
34+
maxSteps: 3
35+
});
36+
37+
const preparedQuote = await bridge.Sell.prepare({
38+
originChainId: 1,
39+
originTokenAddress: "0x...",
40+
destinationChainId: 137,
41+
destinationTokenAddress: "0x...",
42+
amount: 1000000n,
43+
sender: "0x...",
44+
receiver: "0x...",
45+
maxSteps: 3
46+
});
47+
```

0 commit comments

Comments
 (0)