Skip to content

Commit

Permalink
Merge pull request #320 from oraichain/fix/add-receipt-address
Browse files Browse the repository at this point in the history
fix receipt address swap oraichain -> other chain
  • Loading branch information
haunv3 authored Aug 16, 2024
2 parents 0ba88e4 + 8caeb16 commit 87e5faa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/universal-swap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/oraidex-universal-swap",
"version": "1.1.0",
"version": "1.1.1",
"main": "build/index.js",
"files": [
"build/"
Expand Down
8 changes: 5 additions & 3 deletions packages/universal-swap/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1370,8 +1370,8 @@ export class UniversalSwapHandler {
const { fund: offerSentFund, info: offerInfo } = parseTokenInfo(fromTokenOnOrai, _fromAmount);
const { fund: askSentFund, info: askInfo } = parseTokenInfo(toTokenInOrai);
const funds = handleSentFunds(offerSentFund, askSentFund);

if (this.swapData.recipientAddress) {
let to = undefined;
if (this.swapData.recipientAddress && originalToToken.chainId === "Oraichain") {
const isValidRecipient = checkValidateAddressWithNetwork(
this.swapData.recipientAddress,
this.swapData.originalToToken.chainId
Expand All @@ -1380,8 +1380,10 @@ export class UniversalSwapHandler {
if (!isValidRecipient.isValid) {
throw generateError("Recipient address invalid!");
}

to = this.swapData.recipientAddress;
}
const to = this.swapData.recipientAddress;

let msgs: ExecuteInstruction[];

if (this.swapData.smartRoutes) {
Expand Down

0 comments on commit 87e5faa

Please sign in to comment.