Repository navigation
v0.2.0
Quote routes now have one standard fee measure, priced at reference prices, instead of the per-provider fee fields. This follows Pegaroute's new fee API and is a breaking change.
npm install @pegaroute/sdk@0.2.0Breaking changes
| Before | Now |
|---|---|
QuoteRoute.fees: QuoteFees |
QuoteRouteFees | NoQuoteRouteFees: total in USD and bps, split into affiliate, route and gas. {} means no fee data, not a zero fee |
QuoteRoute.resolvedFee |
removed |
| (none) | QuoteRoute.additionalFee: AdditionalFee | null: a fee the wallet pays on top, in the source chain's native coin |
RouteInfo.fees, GetSwapResponse.fees, Transaction.fees, TransactionWebhookData.fees |
removed |
QuoteFees type |
removed; new QuoteRouteFees, NoQuoteRouteFees, FeeAmount, AdditionalFee |
Routes are now ranked by expectedOutput minus additionalFee, then by speed.
Added
hasQuoteRouteFees(fees)tells full fees from{}. It's exported from@pegaroute/sdkand@pegaroute/sdk/types.
Upgrading
if (hasQuoteRouteFees(route.fees)) show(`$${route.fees.totalUsd} (${route.fees.totalBps} bps)`);
if (route.additionalFee) show(`+ ${route.additionalFee.amount} ${route.additionalFee.token}`);fees.totalUsd is never negative, so compare routes by expectedOutput. See the README.
Full changelog: v0.1.0...v0.2.0