Merge pull request #256 from orionprotocol/auto-slippage

auto slippage
This commit is contained in:
kigastu
2024-04-19 17:31:38 +03:00
committed by GitHub
5 changed files with 5 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.83",
"version": "0.20.84-rc1",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -49,6 +49,7 @@ const swapInfoBase = z.object({
mi: z.number().optional(), // market amount in, USD
d: z.string().optional(), // difference in available amount in/out (USD) and market amount out/in (USD) in percentage
}).optional(),
autoSlippage: z.number().optional(),
});
const swapInfoByAmountIn = swapInfoBase.extend({

View File

@@ -541,6 +541,7 @@ class AggregatorWS {
marketAmountIn: json.usd.mi,
difference: json.usd.d,
},
autoSlippage: json.sl,
};
switch (json.k) { // kind

View File

@@ -48,6 +48,7 @@ const swapInfoSchemaBase = baseMessageSchema.extend({
mi: z.number().optional(), // market amount in, USD
d: z.string().optional(), // difference in available amount in/out (USD) and market amount out/in (USD) in percentage
}).optional(),
sl: z.number().optional(),
});
const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({

View File

@@ -210,6 +210,7 @@ export type SwapInfoBase = {
marketAmountIn: number | undefined
difference: string | undefined
} | undefined
autoSlippage: number | undefined
}
export type SwapInfoByAmountIn = SwapInfoBase & {