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", "name": "@orionprotocol/sdk",
"version": "0.19.91", "version": "0.19.93-rc8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@orionprotocol/sdk", "name": "@orionprotocol/sdk",
"version": "0.19.91", "version": "0.19.93-rc8",
"hasInstallScript": true, "hasInstallScript": true,
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {

View File

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

View File

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