Skip to content

Commit

Permalink
Add minReceiveAmount to EdgeSwapQuote
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-edge committed Sep 11, 2024
1 parent 80c0fc0 commit 44624fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- added: `minReceiveAmount` to `EdgeSwapQuote` - the minimum amount that can be received from the swap

## 2.15.0 (2024-09-06)

- added: `EdgeContext.fetchChallenge`, to request an account-creation CAPTCHA.
Expand Down
1 change: 1 addition & 0 deletions src/core/swap/swap-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function wrapQuote(
request: quote.request ?? request,
swapInfo: quote.swapInfo ?? swapPlugins[quote.pluginId].swapInfo,
toNativeAmount: quote.toNativeAmount,
minReceiveAmount: quote.minReceiveAmount,

async approve(opts) {
return await quote.approve(opts)
Expand Down
8 changes: 4 additions & 4 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,6 @@ export interface EdgeGetTransactionsOptions {
startDate?: Date
endDate?: Date
searchString?: string
spamThreshold?: string
tokenId: EdgeTokenId
}

Expand All @@ -818,9 +817,6 @@ export interface EdgeStreamTransactionOptions {
/** Only return transactions matching this string */
searchString?: string

/** Filter incoming transactions with a `nativeAmount` below this */
spamThreshold?: string

/** The token to query, or undefined for the main currency */
tokenId: EdgeTokenId
}
Expand Down Expand Up @@ -1349,6 +1345,10 @@ export interface EdgeSwapQuote {
* Maximum amount of time this quote will take to be fulfilled (in seconds)
*/
readonly maxFulfillmentSeconds?: number

/** Worst-case receive amount */
readonly minReceiveAmount?: string

readonly fromNativeAmount: string
readonly toNativeAmount: string
readonly networkFee: EdgeNetworkFee
Expand Down

0 comments on commit 44624fd

Please sign in to comment.