fix schemas

This commit is contained in:
Kirill Litvinov
2024-05-13 17:21:51 +03:00
parent 71ba0ca5fc
commit 275547340e
5 changed files with 6 additions and 13 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.86",
"version": "0.20.88-rc2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.20.86",
"version": "0.20.88-rc2",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

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

View File

@@ -52,13 +52,11 @@ const swapInfoBase = z.object({
autoSlippage: z.number().optional(),
});
const swapInfoByAmountIn = swapInfoBase.extend({
const swapInfoSchema = swapInfoBase.extend({
availableAmountOut: z.null(),
availableAmountIn: z.number(),
marketAmountOut: z.number().nullable(),
marketAmountIn: z.null(),
});
const swapInfoSchema = swapInfoByAmountIn;
export default swapInfoSchema;

View File

@@ -51,12 +51,9 @@ const swapInfoSchemaBase = baseMessageSchema.extend({
sl: z.number().optional(),
});
const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({
const swapInfoSchema = swapInfoSchemaBase.extend({
mo: z.number().optional(), // market amount out
aa: z.number(), // available amount in
});
const swapInfoSchema = swapInfoSchemaByAmountIn;
export default swapInfoSchema;

View File

@@ -213,13 +213,11 @@ export type SwapInfoBase = {
autoSlippage: number | undefined
}
export type SwapInfoByAmountIn = SwapInfoBase & {
export type SwapInfo = SwapInfoBase & {
availableAmountIn?: number | undefined
marketAmountOut?: number | undefined
}
export type SwapInfo = SwapInfoByAmountIn;
export enum HistoryTransactionStatus {
PENDING = 'Pending',
DONE = 'Done',