swap by address fix

This commit is contained in:
Kirill Litvinov
2023-10-02 13:35:15 +03:00
parent 6edb6f3c0c
commit 91c6342813
3 changed files with 5 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.91",
"version": "0.19.93-rc1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.19.91",
"version": "0.19.93-rc1",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.92",
"version": "0.19.93-rc1",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -46,8 +46,8 @@ export default async function generateSwapCalldata({
const curveRegistryAddress = safeGet(unit.contracts, 'curveRegistry')
const { assetToAddress, swapExecutorContractAddress, exchangeContractAddress } = await simpleFetch(unit.blockchainService.getInfo)();
let path = SafeArray.from(path_).map((swapInfo) => {
swapInfo.assetIn = safeGet(assetToAddress, swapInfo.assetIn);
swapInfo.assetOut = safeGet(assetToAddress, swapInfo.assetOut);
swapInfo.assetIn = ethers.utils.isAddress(swapInfo.assetIn) ? swapInfo.assetIn : safeGet(assetToAddress, swapInfo.assetIn);
swapInfo.assetOut = ethers.utils.isAddress(swapInfo.assetOut) ? swapInfo.assetOut : safeGet(assetToAddress, swapInfo.assetOut);
return swapInfo;
})
const factory = path.first().factory