update swapinfo schema

This commit is contained in:
TheJuze
2024-05-16 18:26:50 +03:00
parent ef099f3f63
commit 14c2f3bb5f
3 changed files with 6 additions and 3 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.21.0-rc3",
"version": "0.21.0-rc4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.21.0-rc3",
"version": "0.21.0-rc4",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

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

View File

@@ -1,4 +1,5 @@
import { z } from 'zod';
import uppercasedNetworkCodes from '../../../constants/uppercasedNetworkCodes';
const orderInfoSchema = z.object({
assetPair: z.string().toUpperCase(),
@@ -50,6 +51,8 @@ const swapInfoBase = z.object({
d: z.string().optional(), // difference in available amount in/out (USD) and market amount out/in (USD) in percentage
}).optional(),
autoSlippage: z.number().optional(),
sourceChain: z.enum(uppercasedNetworkCodes).optional(),
targetChain: z.enum(uppercasedNetworkCodes).optional(),
});
const swapInfoByAmountIn = swapInfoBase.extend({