mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-22 21:59:44 +03:00
Merge pull request #187 from orionprotocol/swap-by-address
swap by address
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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": {
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user