mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-22 21:59:44 +03:00
Merge remote-tracking branch origin/main into generateSwapCallData-fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.20.76-rc107",
|
"version": "0.20.76-rc108",
|
||||||
"description": "Orion Protocol SDK",
|
"description": "Orion Protocol SDK",
|
||||||
"main": "./lib/index.cjs",
|
"main": "./lib/index.cjs",
|
||||||
"module": "./lib/index.js",
|
"module": "./lib/index.js",
|
||||||
|
|||||||
@@ -232,5 +232,18 @@
|
|||||||
"WETH": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
|
"WETH": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
|
||||||
"curveRegistry": ""
|
"curveRegistry": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"8453": {
|
||||||
|
"chainId": "8453",
|
||||||
|
"label": "Base",
|
||||||
|
"shortName": "BASE",
|
||||||
|
"code": "base",
|
||||||
|
"baseCurrencyName": "ETH",
|
||||||
|
"rpc": "https://mainnet.base.org/",
|
||||||
|
"explorer": "https://basescan.org/",
|
||||||
|
"contracts": {
|
||||||
|
"WETH": "0x4200000000000000000000000000000000000006",
|
||||||
|
"curveRegistry": ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,6 +182,24 @@
|
|||||||
"http": "/orion-indexer/"
|
"http": "/orion-indexer/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"8453": {
|
||||||
|
"api": "https://trade.orion.xyz/base-mainnet",
|
||||||
|
"services": {
|
||||||
|
"aggregator": {
|
||||||
|
"http": "/backend",
|
||||||
|
"ws": "/v1"
|
||||||
|
},
|
||||||
|
"blockchain": {
|
||||||
|
"http": ""
|
||||||
|
},
|
||||||
|
"priceFeed": {
|
||||||
|
"all": "/price-feed"
|
||||||
|
},
|
||||||
|
"indexer": {
|
||||||
|
"http": "/orion-indexer/"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -429,7 +447,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"2525": {
|
"2525": {
|
||||||
"api": "https://trade.orion.xyz/inevm-mainnet",
|
"api": "https://staging.orion.xyz/inevm-mainnet",
|
||||||
"services": {
|
"services": {
|
||||||
"aggregator": {
|
"aggregator": {
|
||||||
"http": "/backend",
|
"http": "/backend",
|
||||||
@@ -447,7 +465,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"59144": {
|
"59144": {
|
||||||
"api": "https://trade.orion.xyz/linea-mainnet",
|
"api": "https://staging.orion.xyz/linea-mainnet",
|
||||||
"services": {
|
"services": {
|
||||||
"aggregator": {
|
"aggregator": {
|
||||||
"http": "/backend",
|
"http": "/backend",
|
||||||
@@ -465,7 +483,25 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"43114": {
|
"43114": {
|
||||||
"api": "https://trade.orion.xyz/avalanche-c-chain",
|
"api": "https://staging.orion.xyz/avalanche-c-chain",
|
||||||
|
"services": {
|
||||||
|
"aggregator": {
|
||||||
|
"http": "/backend",
|
||||||
|
"ws": "/v1"
|
||||||
|
},
|
||||||
|
"blockchain": {
|
||||||
|
"http": ""
|
||||||
|
},
|
||||||
|
"priceFeed": {
|
||||||
|
"all": "/price-feed"
|
||||||
|
},
|
||||||
|
"indexer": {
|
||||||
|
"http": "/orion-indexer/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"8453": {
|
||||||
|
"api": "https://staging.orion.xyz/base-mainnet",
|
||||||
"services": {
|
"services": {
|
||||||
"aggregator": {
|
"aggregator": {
|
||||||
"http": "/backend",
|
"http": "/backend",
|
||||||
|
|||||||
@@ -20,4 +20,5 @@ export const productionChains = [
|
|||||||
SupportedChainId.INEVM,
|
SupportedChainId.INEVM,
|
||||||
SupportedChainId.LINEA,
|
SupportedChainId.LINEA,
|
||||||
SupportedChainId.AVAX,
|
SupportedChainId.AVAX,
|
||||||
|
SupportedChainId.BASE,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'opbnb', 'inevm', 'linea', 'avax'] as const;
|
export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'opbnb', 'inevm', 'linea', 'avax', 'base'] as const;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB', 'OPBNB', 'INEVM', 'LINEA', 'AVAX'] as const;
|
export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB', 'OPBNB', 'INEVM', 'LINEA', 'AVAX', 'BASE'] as const;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ const swapInfoBase = z.object({
|
|||||||
mi: z.number().optional(), // market amount in, USD
|
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
|
d: z.string().optional(), // difference in available amount in/out (USD) and market amount out/in (USD) in percentage
|
||||||
}).optional(),
|
}).optional(),
|
||||||
|
autoSlippage: z.number().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const swapInfoByAmountIn = swapInfoBase.extend({
|
const swapInfoByAmountIn = swapInfoBase.extend({
|
||||||
|
|||||||
@@ -543,6 +543,7 @@ class AggregatorWS {
|
|||||||
marketAmountIn: json.usd.mi,
|
marketAmountIn: json.usd.mi,
|
||||||
difference: json.usd.d,
|
difference: json.usd.d,
|
||||||
},
|
},
|
||||||
|
autoSlippage: json.sl,
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (json.k) { // kind
|
switch (json.k) { // kind
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ const swapInfoSchemaBase = baseMessageSchema.extend({
|
|||||||
mi: z.number().optional(), // market amount in, USD
|
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
|
d: z.string().optional(), // difference in available amount in/out (USD) and market amount out/in (USD) in percentage
|
||||||
}).optional(),
|
}).optional(),
|
||||||
|
sl: z.number().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({
|
const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type factories from './constants/factories.js';
|
|||||||
import type { BigNumber } from 'bignumber.js';
|
import type { BigNumber } from 'bignumber.js';
|
||||||
import type subOrderStatuses from './constants/subOrderStatuses.js';
|
import type subOrderStatuses from './constants/subOrderStatuses.js';
|
||||||
import type positionStatuses from './constants/positionStatuses.js';
|
import type positionStatuses from './constants/positionStatuses.js';
|
||||||
import type { knownEnvs } from './config/schemas/index.js';
|
import type { knownEnvs } from './config/schemas';
|
||||||
import type getHistory from './Orion/bridge/getHistory.js';
|
import type getHistory from './Orion/bridge/getHistory.js';
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends object ? {
|
export type DeepPartial<T> = T extends object ? {
|
||||||
@@ -91,6 +91,7 @@ export enum SupportedChainId {
|
|||||||
INEVM = '2525',
|
INEVM = '2525',
|
||||||
LINEA = '59144',
|
LINEA = '59144',
|
||||||
AVAX = '43114',
|
AVAX = '43114',
|
||||||
|
BASE = '8453',
|
||||||
|
|
||||||
POLYGON_TESTNET = '80001',
|
POLYGON_TESTNET = '80001',
|
||||||
FANTOM_TESTNET = '4002',
|
FANTOM_TESTNET = '4002',
|
||||||
@@ -211,6 +212,7 @@ export type SwapInfoBase = {
|
|||||||
marketAmountIn: number | undefined
|
marketAmountIn: number | undefined
|
||||||
difference: string | undefined
|
difference: string | undefined
|
||||||
} | undefined
|
} | undefined
|
||||||
|
autoSlippage: number | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SwapInfoByAmountIn = SwapInfoBase & {
|
export type SwapInfoByAmountIn = SwapInfoBase & {
|
||||||
|
|||||||
Reference in New Issue
Block a user