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", "name": "@orionprotocol/sdk",
"version": "0.19.48-dev.2-rc-0", "version": "0.19.48-dev.2-rc-1",
"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

@@ -125,8 +125,6 @@ export default async function generateSwapCalldata({
return { swapDescription, calldata } return { swapDescription, calldata }
} }
export async function generateUni2Calls( export async function generateUni2Calls(
exchangeAddress: string, exchangeAddress: string,
path: SafeArray<SwapInfo> path: SafeArray<SwapInfo>

View File

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

View File

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