Skip to content

Commit

Permalink
fix to address tron
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 committed Sep 26, 2024
1 parent 2c42ca8 commit 3247f09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/universal-swap/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
OSMOSIS_ROUTER_CONTRACT,
cosmosChains,
toDisplay,
EVM_CHAIN_ID_COMMON
ChainIdEnum
} from "@oraichain/oraidex-common";
import { ethers } from "ethers";
import { UniversalSwapHelper } from "./helper";
Expand Down Expand Up @@ -231,7 +231,7 @@ export class UniversalSwapHandler {
if (recipientAddress) {
const isValidRecipient = checkValidateAddressWithNetwork(this.swapData.recipientAddress, toToken.originalChainId);
if (!isValidRecipient.isValid) throw generateError("Recipient address invalid!");
transferAddress = recipientAddress;
transferAddress = toToken.chainId === ChainIdEnum.TRON ? tronToEthAddress(recipientAddress) : recipientAddress;
} else {
transferAddress = this.getTranferAddress(metamaskAddress, tronAddress, channel);
}
Expand Down Expand Up @@ -1161,7 +1161,7 @@ export class UniversalSwapHandler {
if (!isValidRecipient.isValid) throw generateError("Recipient address invalid!");

toAddress =
originalToToken.chainId === EVM_CHAIN_ID_COMMON.TRON_CHAIN_ID
originalToToken.chainId === ChainIdEnum.TRON
? tronToEthAddress(recipientAddress)
: this.swapData.recipientAddress;
} else {
Expand Down

0 comments on commit 3247f09

Please sign in to comment.