Merge pull request #187 from orionprotocol/swap-by-address

swap by address
This commit is contained in:
kigastu
2023-10-02 17:11:19 +03:00
committed by GitHub
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-rc8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.19.91",
"version": "0.19.93-rc8",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.92",
"version": "0.19.93-rc8",
"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 = assetToAddress[swapInfo.assetIn] ?? swapInfo.assetIn.toLowerCase();
swapInfo.assetOut = assetToAddress[swapInfo.assetOut] ?? swapInfo.assetOut.toLowerCase();
return swapInfo;
})
const factory = path.first().factory