Skip to content

Commit

Permalink
Merge pull request #91 from soramitsu/fix/bigBalance
Browse files Browse the repository at this point in the history
big numbers balance fix
  • Loading branch information
timofeytrepalin authored Jan 26, 2023
2 parents 0e8ffde + ac44d63 commit 434dfc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/store/routeAssets/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ function getTransferParams(context, inputAsset, recipient) {
assetAddress: recipient.asset.address,
};
} catch (error: any) {
throw new Error(error);
return {
recipient,
};
Expand Down Expand Up @@ -520,7 +521,7 @@ function calcTxParams(
const desiredDecimals = (!isExchangeB ? assetA : assetB).decimals;
const resultDecimals = (!isExchangeB ? assetB : assetA).decimals;
const desiredCodecString = new FPNumber(amountB, desiredDecimals).toCodecString();
const result = new FPNumber(amountB, resultDecimals);
const result = new FPNumber(amountB, desiredDecimals);
const resultMulSlippage = result.mul(new FPNumber(Number(slippageTolerance) / 100));
const liquiditySources = liquiditySource ? [liquiditySource] : [];
const params = {} as any;
Expand All @@ -541,7 +542,8 @@ function calcTxParams(
assetA.address,
assetB.address,
// params,
result.toCodecString(),
// result.toCodecString(),
FPNumber.fromCodecValue(amountB, assetB.decimals).toCodecString(),
liquiditySources,
liquiditySource === LiquiditySourceTypes.Default ? 'Disabled' : 'AllowSelected',
],
Expand Down

0 comments on commit 434dfc5

Please sign in to comment.