Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rango amount metadata #363

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- changed: (SwapKit) Use `data` provided by quote endpoint instead of encoding it locally
- fixed: Incorrect date timestamp for 0xGasless transactions.
- fixed: Rango amount metadata

## 2.16.0 (2024-12-16)

Expand Down
5 changes: 1 addition & 4 deletions src/swap/defi/rango.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ export function makeRangoPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin {
throw new SwapCurrencyError(swapInfo, request)
}

let ethNativeAmount = nativeAmount

const fromToken =
fromTokenId != null
? fromWallet.currencyConfig.allTokens[fromTokenId]
Expand All @@ -241,7 +239,6 @@ export function makeRangoPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin {
fromContractAddress = PARENT_TOKEN_CONTRACT_ADDRESS
} else {
fromContractAddress = fromToken?.networkLocation?.contractAddress
ethNativeAmount = '0'
}

const toToken =
Expand Down Expand Up @@ -502,7 +499,7 @@ export function makeRangoPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin {
spendTargets: [
{
memo: evmTransaction.txData,
nativeAmount: ethNativeAmount,
nativeAmount: nativeAmount,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be nativeAmount, since the left & right are the same name.

publicAddress: evmTransaction.txTo
}
],
Expand Down
Loading