add eps types to services

This commit is contained in:
Dmitriy Pavlov
2023-08-10 18:46:10 +03:00
parent 2acc918a1a
commit df38bfdc2c
4 changed files with 16 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.48-dev.2-rc-0",
"version": "0.19.48-dev.2-rc-1",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -125,8 +125,6 @@ export default async function generateSwapCalldata({
return { swapDescription, calldata }
}
export async function generateUni2Calls(
exchangeAddress: string,
path: SafeArray<SwapInfo>
@@ -306,4 +304,4 @@ function addCallParams(
async function generateCalls(calls: BytesLike[]) {
const executorInterface = SwapExecutor__factory.createInterface()
return "0x" + executorInterface.encodeFunctionData(EXECUTOR_SWAP_FUNCTION, [ethers.constants.AddressZero, calls]).slice(74)
}
}

View File

@@ -500,6 +500,12 @@ class AggregatorWS {
minAmountIn: json.ma,
path: json.ps,
exchanges: json.e,
exchangeContractPath: json.eps.map((path) => ({
poolAddress: path.p,
assetIn: path.ai,
assetOut: path.ao,
factory: path.f,
})),
poolOptimal: json.po,
...(json.oi) && {
orderInfo: {

View File

@@ -164,6 +164,13 @@ export type SwapInfoAlternative = {
availableAmountOut?: number | undefined
}
type ExchangeContractPath = {
poolAddress: string
assetIn: string
assetOut: string
factory: string
}
export type SwapInfoBase = {
swapRequestId: string
assetIn: string
@@ -174,6 +181,7 @@ export type SwapInfoBase = {
minAmountOut: number
path: string[]
exchangeContractPath: ExchangeContractPath[]
exchanges?: string[] | undefined
poolOptimal: boolean