Skip to content

Commit

Permalink
Fix Tron address case (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doctor-Cyclone authored Mar 27, 2024
2 parents 6baff7e + 617bf97 commit 0e38d1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rubic-sdk",
"version": "5.8.2",
"version": "5.8.3",
"description": "Simplify dApp creation",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BigNumber from 'bignumber.js';
import { PriceTokenAmount } from 'src/common/tokens';
import { BLOCKCHAIN_NAME } from 'src/core/blockchain/models/blockchain-name';
import { BlockchainsInfo } from 'src/core/blockchain/utils/blockchains-info/blockchains-info';
import { blockchainId } from 'src/core/blockchain/utils/blockchains-info/constants/blockchain-id';
import { EvmEncodeConfig } from 'src/core/blockchain/web3-pure/typed-web3-pure/evm-web3-pure/models/evm-encode-config';
Expand Down Expand Up @@ -47,9 +48,14 @@ export async function getMethodArgumentsAndTransactionData<
const amountOutMin = Web3Pure.toWei(toTokenAmountMin, to.decimals);
const fromTokenAddress = createTokenNativeAddressProxy(
fromWithoutFee,
bridgersNativeAddress
bridgersNativeAddress,
!(from.blockchain === BLOCKCHAIN_NAME.TRON)
).address;
const toTokenAddress = createTokenNativeAddressProxy(
to,
bridgersNativeAddress,
!(to.blockchain === BLOCKCHAIN_NAME.TRON)
).address;
const toTokenAddress = createTokenNativeAddressProxy(to, bridgersNativeAddress).address;
const fromAddress = options.fromAddress || walletAddress;
const swapRequest: BridgersSwapRequest = {
fromTokenAddress,
Expand Down

0 comments on commit 0e38d1f

Please sign in to comment.