mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
add eps types to services
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user