Skip to content

Commit 8763876

Browse files
committed
feat: include prices in routes
1 parent 0c0b747 commit 8763876

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/thirdweb/src/bridge/Routes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export async function routes(options: routes.Options): Promise<routes.Result> {
131131
sortBy,
132132
limit,
133133
offset,
134+
includePrices,
134135
} = options;
135136

136137
const clientFetch = getClientFetch(client);
@@ -159,6 +160,9 @@ export async function routes(options: routes.Options): Promise<routes.Result> {
159160
if (sortBy) {
160161
url.searchParams.set("sortBy", sortBy);
161162
}
163+
if (includePrices) {
164+
url.searchParams.set("includePrices", includePrices.toString());
165+
}
162166

163167
const response = await clientFetch(url.toString());
164168
if (!response.ok) {
@@ -185,6 +189,7 @@ export declare namespace routes {
185189
transactionHash?: ox__Hex.Hex;
186190
sortBy?: "popularity";
187191
maxSteps?: number;
192+
includePrices?: boolean;
188193
limit?: number;
189194
offset?: number;
190195
};

packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ export function usePaymentMethods(options: {
6161
destinationChainId: destinationToken.chainId,
6262
destinationTokenAddress: destinationToken.address,
6363
sortBy: "popularity",
64+
includePrices: true,
6465
limit: 100, // Get top 100 most popular routes
6566
});
67+
console.log("allRoutes", allRoutes);
6668

6769
// 1. Resolve all unique chains in the supported token map
6870
const uniqueChains = Array.from(

0 commit comments

Comments
 (0)