update version

This commit is contained in:
lomonoshka
2023-08-24 16:00:28 +03:00
6 changed files with 24 additions and 6 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.48-dev.5-rc0",
"version": "0.19.48-dev.6-rc-0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.19.48-dev.5-rc0",
"version": "0.19.48-dev.6-rc-0",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -113,4 +113,4 @@
"overrides": {
"tsconfig-paths": "^4.0.0"
}
}
}

View File

@@ -141,8 +141,6 @@ export default async function generateSwapCalldata({
return { swapDescription, calldata }
}
export async function generateUni2Calls(
exchangeAddress: string,
path: SafeArray<SwapInfo>
@@ -314,4 +312,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

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

View File

@@ -33,6 +33,12 @@ const swapInfoSchemaBase = baseMessageSchema.extend({
}).optional(),
as: alternativeSchema.array(),
anm: z.record(z.string()).optional(), // address to ERC20 names
eps: z.array(z.object({
p: z.string(), // pool address
ai: z.string().toUpperCase(), // asset in
ao: z.string().toUpperCase(), // asset out
f: z.string().toUpperCase(), // factory
}))
});
const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({

View File

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