@orderly.network/types 2.0.1-alpha.6 → 2.0.1-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +114 -5
- package/dist/index.d.ts +114 -5
- package/dist/index.js +113 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ declare global {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
declare const _default: "2.0.1-alpha.
|
|
11
|
+
declare const _default: "2.0.1-alpha.8";
|
|
12
12
|
|
|
13
13
|
declare enum AccountStatusEnum {
|
|
14
14
|
NotConnected = 0,
|
|
@@ -35,6 +35,7 @@ declare enum NetworkStatusEnum {
|
|
|
35
35
|
}
|
|
36
36
|
declare const ARBITRUM_TESTNET_CHAINID = 421614;
|
|
37
37
|
declare const SOLANA_TESTNET_CHAINID = 901901901;
|
|
38
|
+
declare const STORY_TESTNET_CHAINID = 1516;
|
|
38
39
|
declare const ARBITRUM_TESTNET_CHAINID_HEX = "0x66EEE";
|
|
39
40
|
declare const MANTLE_TESTNET_CHAINID = 5003;
|
|
40
41
|
declare const MANTLE_TESTNET_CHAINID_HEX = "0x138b";
|
|
@@ -67,6 +68,19 @@ declare enum OrderType {
|
|
|
67
68
|
*/
|
|
68
69
|
CLOSE_POSITION = "CLOSE_POSITION"
|
|
69
70
|
}
|
|
71
|
+
declare enum BBOOrderType {
|
|
72
|
+
COUNTERPARTY1 = "counterparty1",
|
|
73
|
+
COUNTERPARTY5 = "counterparty5",
|
|
74
|
+
QUEUE1 = "queue1",
|
|
75
|
+
QUEUE5 = "queue5"
|
|
76
|
+
}
|
|
77
|
+
declare enum OrderLevel {
|
|
78
|
+
ONE = 0,
|
|
79
|
+
TWO = 1,
|
|
80
|
+
THREE = 2,
|
|
81
|
+
FOUR = 3,
|
|
82
|
+
FIVE = 4
|
|
83
|
+
}
|
|
70
84
|
declare enum AlgoOrderRootType {
|
|
71
85
|
TP_SL = "TP_SL",
|
|
72
86
|
POSITIONAL_TP_SL = "POSITIONAL_TP_SL",
|
|
@@ -115,7 +129,7 @@ interface BaseOrder {
|
|
|
115
129
|
reduce_only: boolean;
|
|
116
130
|
slippage: number;
|
|
117
131
|
order_tag: string;
|
|
118
|
-
level:
|
|
132
|
+
level: OrderLevel;
|
|
119
133
|
post_only_adjust: boolean;
|
|
120
134
|
}
|
|
121
135
|
interface RegularOrder extends BaseOrder, OrderExt {
|
|
@@ -178,6 +192,7 @@ interface OrderEntity {
|
|
|
178
192
|
isStopOrder?: boolean;
|
|
179
193
|
trigger_price?: string;
|
|
180
194
|
order_tag?: string;
|
|
195
|
+
level?: OrderLevel;
|
|
181
196
|
}
|
|
182
197
|
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
183
198
|
type RequireKeys<T extends object, K extends keyof T> = Required<Pick<T, K>> & Partial<Omit<T, K>>;
|
|
@@ -372,6 +387,24 @@ declare namespace API {
|
|
|
372
387
|
next_funding_time: number;
|
|
373
388
|
sum_unitary_funding: number;
|
|
374
389
|
}
|
|
390
|
+
interface FundingPeriodData {
|
|
391
|
+
rate: number;
|
|
392
|
+
positive: number;
|
|
393
|
+
negative: number;
|
|
394
|
+
}
|
|
395
|
+
interface FundingHistory {
|
|
396
|
+
symbol: string;
|
|
397
|
+
data_start_time: string;
|
|
398
|
+
funding: {
|
|
399
|
+
last: FundingPeriodData;
|
|
400
|
+
"1d": FundingPeriodData;
|
|
401
|
+
"3d": FundingPeriodData;
|
|
402
|
+
"7d": FundingPeriodData;
|
|
403
|
+
"14d": FundingPeriodData;
|
|
404
|
+
"30d": FundingPeriodData;
|
|
405
|
+
"90d": FundingPeriodData;
|
|
406
|
+
};
|
|
407
|
+
}
|
|
375
408
|
interface PositionInfo extends PositionAggregated {
|
|
376
409
|
rows: Position[];
|
|
377
410
|
}
|
|
@@ -563,6 +596,40 @@ declare namespace API {
|
|
|
563
596
|
pnl: number;
|
|
564
597
|
snapshot_time?: number;
|
|
565
598
|
}
|
|
599
|
+
interface PositionHistory {
|
|
600
|
+
position_id: number;
|
|
601
|
+
liquidation_id?: number;
|
|
602
|
+
position_status: string;
|
|
603
|
+
type: string;
|
|
604
|
+
symbol: string;
|
|
605
|
+
avg_open_price: number;
|
|
606
|
+
avg_close_price: number;
|
|
607
|
+
max_position_qty: number;
|
|
608
|
+
closed_position_qty: number;
|
|
609
|
+
side: "LONG" | "SHORT";
|
|
610
|
+
trading_fee: number;
|
|
611
|
+
accumulated_funding_fee: number;
|
|
612
|
+
insurance_fund_fee: number;
|
|
613
|
+
liquidator_fee: number;
|
|
614
|
+
realized_pnl: number;
|
|
615
|
+
open_timestamp: number;
|
|
616
|
+
close_timestamp: number;
|
|
617
|
+
last_update_time: number;
|
|
618
|
+
}
|
|
619
|
+
interface LiquidationPositionByPerp {
|
|
620
|
+
abs_liquidation_fee: number;
|
|
621
|
+
cost_position_transfer: number;
|
|
622
|
+
liquidator_fee: number;
|
|
623
|
+
position_qty: number;
|
|
624
|
+
symbol: string;
|
|
625
|
+
transfer_price: number;
|
|
626
|
+
}
|
|
627
|
+
interface Liquidation {
|
|
628
|
+
liquidation_id: number;
|
|
629
|
+
timestamp: number;
|
|
630
|
+
transfer_amount_to_insurance_fund: number;
|
|
631
|
+
positions_by_perp: LiquidationPositionByPerp[];
|
|
632
|
+
}
|
|
566
633
|
}
|
|
567
634
|
declare namespace WSMessage {
|
|
568
635
|
interface Ticker {
|
|
@@ -1195,8 +1262,7 @@ declare const Sei: {
|
|
|
1195
1262
|
requestRpc: string;
|
|
1196
1263
|
chainLogo: string;
|
|
1197
1264
|
};
|
|
1198
|
-
declare const
|
|
1199
|
-
declare const SolanaDevnet: {
|
|
1265
|
+
declare const StoryTestnet: {
|
|
1200
1266
|
name: string;
|
|
1201
1267
|
public_rpc_url: string;
|
|
1202
1268
|
chain_id: number;
|
|
@@ -1204,6 +1270,31 @@ declare const SolanaDevnet: {
|
|
|
1204
1270
|
explorer_base_url: string;
|
|
1205
1271
|
vault_address: string;
|
|
1206
1272
|
};
|
|
1273
|
+
declare const StoryOdysseyTestnet: {
|
|
1274
|
+
id: number;
|
|
1275
|
+
chainInfo: {
|
|
1276
|
+
chainId: string;
|
|
1277
|
+
chainName: string;
|
|
1278
|
+
nativeCurrency: {
|
|
1279
|
+
name: string;
|
|
1280
|
+
symbol: string;
|
|
1281
|
+
decimals: number;
|
|
1282
|
+
fix: number;
|
|
1283
|
+
};
|
|
1284
|
+
rpcUrls: string[];
|
|
1285
|
+
blockExplorerUrls: never[];
|
|
1286
|
+
};
|
|
1287
|
+
minGasBalance: number;
|
|
1288
|
+
minCrossGasBalance: number;
|
|
1289
|
+
maxPrepayCrossGas: number;
|
|
1290
|
+
blockExplorerName: string;
|
|
1291
|
+
chainName: string;
|
|
1292
|
+
chainNameShort: string;
|
|
1293
|
+
requestRpc: string;
|
|
1294
|
+
chainLogo: string;
|
|
1295
|
+
};
|
|
1296
|
+
declare const chainsInfoMap: Map<number, Chain>;
|
|
1297
|
+
declare const SolanaDevnet: typeof Arbitrum;
|
|
1207
1298
|
declare const TestnetChains: ({
|
|
1208
1299
|
network_infos: {
|
|
1209
1300
|
name: string;
|
|
@@ -1215,6 +1306,7 @@ declare const TestnetChains: ({
|
|
|
1215
1306
|
mainnet: boolean;
|
|
1216
1307
|
explorer_base_url: string;
|
|
1217
1308
|
est_txn_mins: null;
|
|
1309
|
+
vault_address?: undefined;
|
|
1218
1310
|
};
|
|
1219
1311
|
token_infos: {
|
|
1220
1312
|
symbol: string;
|
|
@@ -1229,6 +1321,10 @@ declare const TestnetChains: ({
|
|
|
1229
1321
|
currency_symbol: string;
|
|
1230
1322
|
explorer_base_url: string;
|
|
1231
1323
|
vault_address: string;
|
|
1324
|
+
shortName?: undefined;
|
|
1325
|
+
bridge_enable?: undefined;
|
|
1326
|
+
mainnet?: undefined;
|
|
1327
|
+
est_txn_mins?: undefined;
|
|
1232
1328
|
};
|
|
1233
1329
|
token_infos: {
|
|
1234
1330
|
symbol: string;
|
|
@@ -1287,6 +1383,19 @@ declare enum ChainNamespace {
|
|
|
1287
1383
|
solana = "SOL"
|
|
1288
1384
|
}
|
|
1289
1385
|
|
|
1386
|
+
declare enum EnumTrackerKeys {
|
|
1387
|
+
"WITHDRAW_SUCCESS" = "withdraw:success",
|
|
1388
|
+
"WITHDRAW_FAILED" = "withdraw:failed",
|
|
1389
|
+
"DEPOSIT_SUCCESS" = "deposit:success",
|
|
1390
|
+
"DEPOSIT_FAILED" = "deposit:failed",
|
|
1391
|
+
"SIGNIN_SUCCESS" = "signin:success",
|
|
1392
|
+
"PLACEORDER_SUCCESS" = "place_order:success",
|
|
1393
|
+
"WALLET_CONNECT" = "wallet:connected"
|
|
1394
|
+
}
|
|
1395
|
+
declare const TrackerListenerKeyMap: {
|
|
1396
|
+
[key in EnumTrackerKeys]: string;
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1290
1399
|
type CurrentChain = {
|
|
1291
1400
|
id: number;
|
|
1292
1401
|
info: API.Chain;
|
|
@@ -1390,4 +1499,4 @@ declare const definedTypes: {
|
|
|
1390
1499
|
}];
|
|
1391
1500
|
};
|
|
1392
1501
|
|
|
1393
|
-
export { API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, Avalanche, BNB, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainNamespace, type ChildOrder, type CurrentChain, DEPOSIT_FEE_RATE, Ethereum, ExchangeStatusEnum, Fantom, Fuji, Linea, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, Mantle, MantleSepolia, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, type RegularOrder, type RequireKeys, SDKError, SOLANA_TESTNET_CHAINID, Sei, SolanaDevnet, SystemStateEnum, type TPSLOrderEntry, TestnetChains, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeTokenAddress, _default as version, zkSyncEra };
|
|
1502
|
+
export { API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, Avalanche, BBOOrderType, BNB, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainNamespace, type ChildOrder, type CurrentChain, DEPOSIT_FEE_RATE, EnumTrackerKeys, Ethereum, ExchangeStatusEnum, Fantom, Fuji, Linea, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, Mantle, MantleSepolia, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, OrderLevel, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, type RegularOrder, type RequireKeys, SDKError, SOLANA_TESTNET_CHAINID, STORY_TESTNET_CHAINID, Sei, SolanaDevnet, StoryOdysseyTestnet, StoryTestnet, SystemStateEnum, type TPSLOrderEntry, TestnetChains, TrackerListenerKeyMap, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeTokenAddress, _default as version, zkSyncEra };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare global {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
declare const _default: "2.0.1-alpha.
|
|
11
|
+
declare const _default: "2.0.1-alpha.8";
|
|
12
12
|
|
|
13
13
|
declare enum AccountStatusEnum {
|
|
14
14
|
NotConnected = 0,
|
|
@@ -35,6 +35,7 @@ declare enum NetworkStatusEnum {
|
|
|
35
35
|
}
|
|
36
36
|
declare const ARBITRUM_TESTNET_CHAINID = 421614;
|
|
37
37
|
declare const SOLANA_TESTNET_CHAINID = 901901901;
|
|
38
|
+
declare const STORY_TESTNET_CHAINID = 1516;
|
|
38
39
|
declare const ARBITRUM_TESTNET_CHAINID_HEX = "0x66EEE";
|
|
39
40
|
declare const MANTLE_TESTNET_CHAINID = 5003;
|
|
40
41
|
declare const MANTLE_TESTNET_CHAINID_HEX = "0x138b";
|
|
@@ -67,6 +68,19 @@ declare enum OrderType {
|
|
|
67
68
|
*/
|
|
68
69
|
CLOSE_POSITION = "CLOSE_POSITION"
|
|
69
70
|
}
|
|
71
|
+
declare enum BBOOrderType {
|
|
72
|
+
COUNTERPARTY1 = "counterparty1",
|
|
73
|
+
COUNTERPARTY5 = "counterparty5",
|
|
74
|
+
QUEUE1 = "queue1",
|
|
75
|
+
QUEUE5 = "queue5"
|
|
76
|
+
}
|
|
77
|
+
declare enum OrderLevel {
|
|
78
|
+
ONE = 0,
|
|
79
|
+
TWO = 1,
|
|
80
|
+
THREE = 2,
|
|
81
|
+
FOUR = 3,
|
|
82
|
+
FIVE = 4
|
|
83
|
+
}
|
|
70
84
|
declare enum AlgoOrderRootType {
|
|
71
85
|
TP_SL = "TP_SL",
|
|
72
86
|
POSITIONAL_TP_SL = "POSITIONAL_TP_SL",
|
|
@@ -115,7 +129,7 @@ interface BaseOrder {
|
|
|
115
129
|
reduce_only: boolean;
|
|
116
130
|
slippage: number;
|
|
117
131
|
order_tag: string;
|
|
118
|
-
level:
|
|
132
|
+
level: OrderLevel;
|
|
119
133
|
post_only_adjust: boolean;
|
|
120
134
|
}
|
|
121
135
|
interface RegularOrder extends BaseOrder, OrderExt {
|
|
@@ -178,6 +192,7 @@ interface OrderEntity {
|
|
|
178
192
|
isStopOrder?: boolean;
|
|
179
193
|
trigger_price?: string;
|
|
180
194
|
order_tag?: string;
|
|
195
|
+
level?: OrderLevel;
|
|
181
196
|
}
|
|
182
197
|
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
183
198
|
type RequireKeys<T extends object, K extends keyof T> = Required<Pick<T, K>> & Partial<Omit<T, K>>;
|
|
@@ -372,6 +387,24 @@ declare namespace API {
|
|
|
372
387
|
next_funding_time: number;
|
|
373
388
|
sum_unitary_funding: number;
|
|
374
389
|
}
|
|
390
|
+
interface FundingPeriodData {
|
|
391
|
+
rate: number;
|
|
392
|
+
positive: number;
|
|
393
|
+
negative: number;
|
|
394
|
+
}
|
|
395
|
+
interface FundingHistory {
|
|
396
|
+
symbol: string;
|
|
397
|
+
data_start_time: string;
|
|
398
|
+
funding: {
|
|
399
|
+
last: FundingPeriodData;
|
|
400
|
+
"1d": FundingPeriodData;
|
|
401
|
+
"3d": FundingPeriodData;
|
|
402
|
+
"7d": FundingPeriodData;
|
|
403
|
+
"14d": FundingPeriodData;
|
|
404
|
+
"30d": FundingPeriodData;
|
|
405
|
+
"90d": FundingPeriodData;
|
|
406
|
+
};
|
|
407
|
+
}
|
|
375
408
|
interface PositionInfo extends PositionAggregated {
|
|
376
409
|
rows: Position[];
|
|
377
410
|
}
|
|
@@ -563,6 +596,40 @@ declare namespace API {
|
|
|
563
596
|
pnl: number;
|
|
564
597
|
snapshot_time?: number;
|
|
565
598
|
}
|
|
599
|
+
interface PositionHistory {
|
|
600
|
+
position_id: number;
|
|
601
|
+
liquidation_id?: number;
|
|
602
|
+
position_status: string;
|
|
603
|
+
type: string;
|
|
604
|
+
symbol: string;
|
|
605
|
+
avg_open_price: number;
|
|
606
|
+
avg_close_price: number;
|
|
607
|
+
max_position_qty: number;
|
|
608
|
+
closed_position_qty: number;
|
|
609
|
+
side: "LONG" | "SHORT";
|
|
610
|
+
trading_fee: number;
|
|
611
|
+
accumulated_funding_fee: number;
|
|
612
|
+
insurance_fund_fee: number;
|
|
613
|
+
liquidator_fee: number;
|
|
614
|
+
realized_pnl: number;
|
|
615
|
+
open_timestamp: number;
|
|
616
|
+
close_timestamp: number;
|
|
617
|
+
last_update_time: number;
|
|
618
|
+
}
|
|
619
|
+
interface LiquidationPositionByPerp {
|
|
620
|
+
abs_liquidation_fee: number;
|
|
621
|
+
cost_position_transfer: number;
|
|
622
|
+
liquidator_fee: number;
|
|
623
|
+
position_qty: number;
|
|
624
|
+
symbol: string;
|
|
625
|
+
transfer_price: number;
|
|
626
|
+
}
|
|
627
|
+
interface Liquidation {
|
|
628
|
+
liquidation_id: number;
|
|
629
|
+
timestamp: number;
|
|
630
|
+
transfer_amount_to_insurance_fund: number;
|
|
631
|
+
positions_by_perp: LiquidationPositionByPerp[];
|
|
632
|
+
}
|
|
566
633
|
}
|
|
567
634
|
declare namespace WSMessage {
|
|
568
635
|
interface Ticker {
|
|
@@ -1195,8 +1262,7 @@ declare const Sei: {
|
|
|
1195
1262
|
requestRpc: string;
|
|
1196
1263
|
chainLogo: string;
|
|
1197
1264
|
};
|
|
1198
|
-
declare const
|
|
1199
|
-
declare const SolanaDevnet: {
|
|
1265
|
+
declare const StoryTestnet: {
|
|
1200
1266
|
name: string;
|
|
1201
1267
|
public_rpc_url: string;
|
|
1202
1268
|
chain_id: number;
|
|
@@ -1204,6 +1270,31 @@ declare const SolanaDevnet: {
|
|
|
1204
1270
|
explorer_base_url: string;
|
|
1205
1271
|
vault_address: string;
|
|
1206
1272
|
};
|
|
1273
|
+
declare const StoryOdysseyTestnet: {
|
|
1274
|
+
id: number;
|
|
1275
|
+
chainInfo: {
|
|
1276
|
+
chainId: string;
|
|
1277
|
+
chainName: string;
|
|
1278
|
+
nativeCurrency: {
|
|
1279
|
+
name: string;
|
|
1280
|
+
symbol: string;
|
|
1281
|
+
decimals: number;
|
|
1282
|
+
fix: number;
|
|
1283
|
+
};
|
|
1284
|
+
rpcUrls: string[];
|
|
1285
|
+
blockExplorerUrls: never[];
|
|
1286
|
+
};
|
|
1287
|
+
minGasBalance: number;
|
|
1288
|
+
minCrossGasBalance: number;
|
|
1289
|
+
maxPrepayCrossGas: number;
|
|
1290
|
+
blockExplorerName: string;
|
|
1291
|
+
chainName: string;
|
|
1292
|
+
chainNameShort: string;
|
|
1293
|
+
requestRpc: string;
|
|
1294
|
+
chainLogo: string;
|
|
1295
|
+
};
|
|
1296
|
+
declare const chainsInfoMap: Map<number, Chain>;
|
|
1297
|
+
declare const SolanaDevnet: typeof Arbitrum;
|
|
1207
1298
|
declare const TestnetChains: ({
|
|
1208
1299
|
network_infos: {
|
|
1209
1300
|
name: string;
|
|
@@ -1215,6 +1306,7 @@ declare const TestnetChains: ({
|
|
|
1215
1306
|
mainnet: boolean;
|
|
1216
1307
|
explorer_base_url: string;
|
|
1217
1308
|
est_txn_mins: null;
|
|
1309
|
+
vault_address?: undefined;
|
|
1218
1310
|
};
|
|
1219
1311
|
token_infos: {
|
|
1220
1312
|
symbol: string;
|
|
@@ -1229,6 +1321,10 @@ declare const TestnetChains: ({
|
|
|
1229
1321
|
currency_symbol: string;
|
|
1230
1322
|
explorer_base_url: string;
|
|
1231
1323
|
vault_address: string;
|
|
1324
|
+
shortName?: undefined;
|
|
1325
|
+
bridge_enable?: undefined;
|
|
1326
|
+
mainnet?: undefined;
|
|
1327
|
+
est_txn_mins?: undefined;
|
|
1232
1328
|
};
|
|
1233
1329
|
token_infos: {
|
|
1234
1330
|
symbol: string;
|
|
@@ -1287,6 +1383,19 @@ declare enum ChainNamespace {
|
|
|
1287
1383
|
solana = "SOL"
|
|
1288
1384
|
}
|
|
1289
1385
|
|
|
1386
|
+
declare enum EnumTrackerKeys {
|
|
1387
|
+
"WITHDRAW_SUCCESS" = "withdraw:success",
|
|
1388
|
+
"WITHDRAW_FAILED" = "withdraw:failed",
|
|
1389
|
+
"DEPOSIT_SUCCESS" = "deposit:success",
|
|
1390
|
+
"DEPOSIT_FAILED" = "deposit:failed",
|
|
1391
|
+
"SIGNIN_SUCCESS" = "signin:success",
|
|
1392
|
+
"PLACEORDER_SUCCESS" = "place_order:success",
|
|
1393
|
+
"WALLET_CONNECT" = "wallet:connected"
|
|
1394
|
+
}
|
|
1395
|
+
declare const TrackerListenerKeyMap: {
|
|
1396
|
+
[key in EnumTrackerKeys]: string;
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1290
1399
|
type CurrentChain = {
|
|
1291
1400
|
id: number;
|
|
1292
1401
|
info: API.Chain;
|
|
@@ -1390,4 +1499,4 @@ declare const definedTypes: {
|
|
|
1390
1499
|
}];
|
|
1391
1500
|
};
|
|
1392
1501
|
|
|
1393
|
-
export { API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, Avalanche, BNB, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainNamespace, type ChildOrder, type CurrentChain, DEPOSIT_FEE_RATE, Ethereum, ExchangeStatusEnum, Fantom, Fuji, Linea, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, Mantle, MantleSepolia, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, type RegularOrder, type RequireKeys, SDKError, SOLANA_TESTNET_CHAINID, Sei, SolanaDevnet, SystemStateEnum, type TPSLOrderEntry, TestnetChains, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeTokenAddress, _default as version, zkSyncEra };
|
|
1502
|
+
export { API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, Avalanche, BBOOrderType, BNB, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainNamespace, type ChildOrder, type CurrentChain, DEPOSIT_FEE_RATE, EnumTrackerKeys, Ethereum, ExchangeStatusEnum, Fantom, Fuji, Linea, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, Mantle, MantleSepolia, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, OrderLevel, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, type RegularOrder, type RequireKeys, SDKError, SOLANA_TESTNET_CHAINID, STORY_TESTNET_CHAINID, Sei, SolanaDevnet, StoryOdysseyTestnet, StoryTestnet, SystemStateEnum, type TPSLOrderEntry, TestnetChains, TrackerListenerKeyMap, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeTokenAddress, _default as version, zkSyncEra };
|
package/dist/index.js
CHANGED
|
@@ -42,11 +42,13 @@ __export(src_exports, {
|
|
|
42
42
|
ArbitrumGoerli: () => ArbitrumGoerli,
|
|
43
43
|
ArbitrumSepolia: () => ArbitrumSepolia,
|
|
44
44
|
Avalanche: () => Avalanche,
|
|
45
|
+
BBOOrderType: () => BBOOrderType,
|
|
45
46
|
BNB: () => BNB,
|
|
46
47
|
Base: () => Base,
|
|
47
48
|
BaseSepolia: () => BaseSepolia,
|
|
48
49
|
ChainNamespace: () => ChainNamespace,
|
|
49
50
|
DEPOSIT_FEE_RATE: () => DEPOSIT_FEE_RATE,
|
|
51
|
+
EnumTrackerKeys: () => EnumTrackerKeys,
|
|
50
52
|
Ethereum: () => Ethereum,
|
|
51
53
|
ExchangeStatusEnum: () => ExchangeStatusEnum,
|
|
52
54
|
Fantom: () => Fantom,
|
|
@@ -62,6 +64,7 @@ __export(src_exports, {
|
|
|
62
64
|
Optimism: () => Optimism,
|
|
63
65
|
OptimismGoerli: () => OptimismGoerli,
|
|
64
66
|
OptimismSepolia: () => OptimismSepolia,
|
|
67
|
+
OrderLevel: () => OrderLevel,
|
|
65
68
|
OrderSide: () => OrderSide,
|
|
66
69
|
OrderStatus: () => OrderStatus,
|
|
67
70
|
OrderType: () => OrderType,
|
|
@@ -70,10 +73,14 @@ __export(src_exports, {
|
|
|
70
73
|
PolygonzkEVM: () => PolygonzkEVM,
|
|
71
74
|
SDKError: () => SDKError,
|
|
72
75
|
SOLANA_TESTNET_CHAINID: () => SOLANA_TESTNET_CHAINID,
|
|
76
|
+
STORY_TESTNET_CHAINID: () => STORY_TESTNET_CHAINID,
|
|
73
77
|
Sei: () => Sei,
|
|
74
78
|
SolanaDevnet: () => SolanaDevnet,
|
|
79
|
+
StoryOdysseyTestnet: () => StoryOdysseyTestnet,
|
|
80
|
+
StoryTestnet: () => StoryTestnet,
|
|
75
81
|
SystemStateEnum: () => SystemStateEnum,
|
|
76
82
|
TestnetChains: () => TestnetChains,
|
|
83
|
+
TrackerListenerKeyMap: () => TrackerListenerKeyMap,
|
|
77
84
|
TriggerPriceType: () => TriggerPriceType,
|
|
78
85
|
WS_WalletStatusEnum: () => WS_WalletStatusEnum,
|
|
79
86
|
WithdrawStatus: () => WithdrawStatus,
|
|
@@ -92,9 +99,9 @@ module.exports = __toCommonJS(src_exports);
|
|
|
92
99
|
// src/version.ts
|
|
93
100
|
if (typeof window !== "undefined") {
|
|
94
101
|
window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
|
|
95
|
-
window.__ORDERLY_VERSION__["@orderly.network/types"] = "2.0.1-alpha.
|
|
102
|
+
window.__ORDERLY_VERSION__["@orderly.network/types"] = "2.0.1-alpha.8";
|
|
96
103
|
}
|
|
97
|
-
var version_default = "2.0.1-alpha.
|
|
104
|
+
var version_default = "2.0.1-alpha.8";
|
|
98
105
|
|
|
99
106
|
// src/constants.ts
|
|
100
107
|
var AccountStatusEnum = /* @__PURE__ */ ((AccountStatusEnum2) => {
|
|
@@ -125,6 +132,7 @@ var NetworkStatusEnum = /* @__PURE__ */ ((NetworkStatusEnum2) => {
|
|
|
125
132
|
})(NetworkStatusEnum || {});
|
|
126
133
|
var ARBITRUM_TESTNET_CHAINID = 421614;
|
|
127
134
|
var SOLANA_TESTNET_CHAINID = 901901901;
|
|
135
|
+
var STORY_TESTNET_CHAINID = 1516;
|
|
128
136
|
var ARBITRUM_TESTNET_CHAINID_HEX = "0x66EEE";
|
|
129
137
|
var MANTLE_TESTNET_CHAINID = 5003;
|
|
130
138
|
var MANTLE_TESTNET_CHAINID_HEX = "0x138b";
|
|
@@ -152,6 +160,21 @@ var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
|
152
160
|
OrderType2["CLOSE_POSITION"] = "CLOSE_POSITION";
|
|
153
161
|
return OrderType2;
|
|
154
162
|
})(OrderType || {});
|
|
163
|
+
var BBOOrderType = /* @__PURE__ */ ((BBOOrderType2) => {
|
|
164
|
+
BBOOrderType2["COUNTERPARTY1"] = "counterparty1";
|
|
165
|
+
BBOOrderType2["COUNTERPARTY5"] = "counterparty5";
|
|
166
|
+
BBOOrderType2["QUEUE1"] = "queue1";
|
|
167
|
+
BBOOrderType2["QUEUE5"] = "queue5";
|
|
168
|
+
return BBOOrderType2;
|
|
169
|
+
})(BBOOrderType || {});
|
|
170
|
+
var OrderLevel = /* @__PURE__ */ ((OrderLevel2) => {
|
|
171
|
+
OrderLevel2[OrderLevel2["ONE"] = 0] = "ONE";
|
|
172
|
+
OrderLevel2[OrderLevel2["TWO"] = 1] = "TWO";
|
|
173
|
+
OrderLevel2[OrderLevel2["THREE"] = 2] = "THREE";
|
|
174
|
+
OrderLevel2[OrderLevel2["FOUR"] = 3] = "FOUR";
|
|
175
|
+
OrderLevel2[OrderLevel2["FIVE"] = 4] = "FIVE";
|
|
176
|
+
return OrderLevel2;
|
|
177
|
+
})(OrderLevel || {});
|
|
155
178
|
var AlgoOrderRootType = /* @__PURE__ */ ((AlgoOrderRootType2) => {
|
|
156
179
|
AlgoOrderRootType2["TP_SL"] = "TP_SL";
|
|
157
180
|
AlgoOrderRootType2["POSITIONAL_TP_SL"] = "POSITIONAL_TP_SL";
|
|
@@ -689,6 +712,37 @@ var Sei = {
|
|
|
689
712
|
requestRpc: "https://evm-rpc.sei-apis.com",
|
|
690
713
|
chainLogo: ""
|
|
691
714
|
};
|
|
715
|
+
var StoryTestnet = {
|
|
716
|
+
name: "Story Odyssey Testnet",
|
|
717
|
+
public_rpc_url: "https://rpc.odyssey.storyrpc.io/",
|
|
718
|
+
chain_id: 1516,
|
|
719
|
+
currency_symbol: "IP",
|
|
720
|
+
explorer_base_url: "",
|
|
721
|
+
vault_address: ""
|
|
722
|
+
};
|
|
723
|
+
var StoryOdysseyTestnet = {
|
|
724
|
+
id: 1329,
|
|
725
|
+
chainInfo: {
|
|
726
|
+
chainId: `0x${StoryTestnet.chain_id.toString(16)}`,
|
|
727
|
+
chainName: StoryTestnet.name,
|
|
728
|
+
nativeCurrency: {
|
|
729
|
+
name: "IP",
|
|
730
|
+
symbol: "IP",
|
|
731
|
+
decimals: 18,
|
|
732
|
+
fix: 4
|
|
733
|
+
},
|
|
734
|
+
rpcUrls: [StoryTestnet.public_rpc_url],
|
|
735
|
+
blockExplorerUrls: []
|
|
736
|
+
},
|
|
737
|
+
minGasBalance: 2e-4,
|
|
738
|
+
minCrossGasBalance: 2e-3,
|
|
739
|
+
maxPrepayCrossGas: 0.03,
|
|
740
|
+
blockExplorerName: "SEI",
|
|
741
|
+
chainName: "Sei Network",
|
|
742
|
+
chainNameShort: "SEI",
|
|
743
|
+
requestRpc: "https://evm-rpc.sei-apis.com",
|
|
744
|
+
chainLogo: ""
|
|
745
|
+
};
|
|
692
746
|
var chainsInfoMap = /* @__PURE__ */ new Map([
|
|
693
747
|
[Ethereum.id, Ethereum],
|
|
694
748
|
[Avalanche.id, Avalanche],
|
|
@@ -710,16 +764,19 @@ var chainsInfoMap = /* @__PURE__ */ new Map([
|
|
|
710
764
|
[BaseSepolia.id, BaseSepolia],
|
|
711
765
|
[MantleSepolia.id, MantleSepolia],
|
|
712
766
|
[PolygonAmoy.id, PolygonAmoy],
|
|
713
|
-
[Sei.id, Sei]
|
|
767
|
+
[Sei.id, Sei],
|
|
768
|
+
[StoryOdysseyTestnet.id, StoryOdysseyTestnet]
|
|
714
769
|
]);
|
|
715
770
|
var SolanaDevnet = {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
771
|
+
id: 901901901,
|
|
772
|
+
chainInfo: {
|
|
773
|
+
name: "Solana Devnet",
|
|
774
|
+
public_rpc_url: "",
|
|
775
|
+
chainId: 901901901,
|
|
776
|
+
currency_symbol: "SOL",
|
|
777
|
+
explorer_base_url: "",
|
|
778
|
+
vault_address: ""
|
|
779
|
+
}
|
|
723
780
|
};
|
|
724
781
|
var TestnetChains = [
|
|
725
782
|
{
|
|
@@ -743,7 +800,14 @@ var TestnetChains = [
|
|
|
743
800
|
]
|
|
744
801
|
},
|
|
745
802
|
{
|
|
746
|
-
network_infos:
|
|
803
|
+
network_infos: {
|
|
804
|
+
name: "Solana Devnet",
|
|
805
|
+
public_rpc_url: "",
|
|
806
|
+
chain_id: 901901901,
|
|
807
|
+
currency_symbol: "SOL",
|
|
808
|
+
explorer_base_url: "",
|
|
809
|
+
vault_address: ""
|
|
810
|
+
},
|
|
747
811
|
token_infos: [
|
|
748
812
|
{
|
|
749
813
|
symbol: "USDC",
|
|
@@ -751,6 +815,16 @@ var TestnetChains = [
|
|
|
751
815
|
decimals: 6
|
|
752
816
|
}
|
|
753
817
|
]
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
network_infos: StoryTestnet,
|
|
821
|
+
token_infos: [
|
|
822
|
+
{
|
|
823
|
+
symbol: "USDC",
|
|
824
|
+
address: "0xF1815bd50389c46847f0Bda824eC8da914045D14",
|
|
825
|
+
decimals: 6
|
|
826
|
+
}
|
|
827
|
+
]
|
|
754
828
|
}
|
|
755
829
|
// {
|
|
756
830
|
// network_infos: {
|
|
@@ -815,6 +889,27 @@ var ChainNamespace = /* @__PURE__ */ ((ChainNamespace2) => {
|
|
|
815
889
|
return ChainNamespace2;
|
|
816
890
|
})(ChainNamespace || {});
|
|
817
891
|
|
|
892
|
+
// src/track.ts
|
|
893
|
+
var EnumTrackerKeys = /* @__PURE__ */ ((EnumTrackerKeys2) => {
|
|
894
|
+
EnumTrackerKeys2["WITHDRAW_SUCCESS"] = "withdraw:success";
|
|
895
|
+
EnumTrackerKeys2["WITHDRAW_FAILED"] = "withdraw:failed";
|
|
896
|
+
EnumTrackerKeys2["DEPOSIT_SUCCESS"] = "deposit:success";
|
|
897
|
+
EnumTrackerKeys2["DEPOSIT_FAILED"] = "deposit:failed";
|
|
898
|
+
EnumTrackerKeys2["SIGNIN_SUCCESS"] = "signin:success";
|
|
899
|
+
EnumTrackerKeys2["PLACEORDER_SUCCESS"] = "place_order:success";
|
|
900
|
+
EnumTrackerKeys2["WALLET_CONNECT"] = "wallet:connected";
|
|
901
|
+
return EnumTrackerKeys2;
|
|
902
|
+
})(EnumTrackerKeys || {});
|
|
903
|
+
var TrackerListenerKeyMap = {
|
|
904
|
+
["withdraw:success" /* WITHDRAW_SUCCESS */]: "withdraw_success",
|
|
905
|
+
["withdraw:failed" /* WITHDRAW_FAILED */]: "withdraw_failure",
|
|
906
|
+
["deposit:success" /* DEPOSIT_SUCCESS */]: "deposit_success",
|
|
907
|
+
["deposit:failed" /* DEPOSIT_FAILED */]: "deposit_failure",
|
|
908
|
+
["signin:success" /* SIGNIN_SUCCESS */]: "sign_message_success",
|
|
909
|
+
["wallet:connected" /* WALLET_CONNECT */]: "connect_wallet_success",
|
|
910
|
+
["place_order:success" /* PLACEORDER_SUCCESS */]: "place_order_success"
|
|
911
|
+
};
|
|
912
|
+
|
|
818
913
|
// src/wallet.ts
|
|
819
914
|
var WS_WalletStatusEnum = /* @__PURE__ */ ((WS_WalletStatusEnum2) => {
|
|
820
915
|
WS_WalletStatusEnum2["NO"] = "NO";
|
|
@@ -895,11 +990,13 @@ var superstruct = __toESM(require("superstruct"));
|
|
|
895
990
|
ArbitrumGoerli,
|
|
896
991
|
ArbitrumSepolia,
|
|
897
992
|
Avalanche,
|
|
993
|
+
BBOOrderType,
|
|
898
994
|
BNB,
|
|
899
995
|
Base,
|
|
900
996
|
BaseSepolia,
|
|
901
997
|
ChainNamespace,
|
|
902
998
|
DEPOSIT_FEE_RATE,
|
|
999
|
+
EnumTrackerKeys,
|
|
903
1000
|
Ethereum,
|
|
904
1001
|
ExchangeStatusEnum,
|
|
905
1002
|
Fantom,
|
|
@@ -915,6 +1012,7 @@ var superstruct = __toESM(require("superstruct"));
|
|
|
915
1012
|
Optimism,
|
|
916
1013
|
OptimismGoerli,
|
|
917
1014
|
OptimismSepolia,
|
|
1015
|
+
OrderLevel,
|
|
918
1016
|
OrderSide,
|
|
919
1017
|
OrderStatus,
|
|
920
1018
|
OrderType,
|
|
@@ -923,10 +1021,14 @@ var superstruct = __toESM(require("superstruct"));
|
|
|
923
1021
|
PolygonzkEVM,
|
|
924
1022
|
SDKError,
|
|
925
1023
|
SOLANA_TESTNET_CHAINID,
|
|
1024
|
+
STORY_TESTNET_CHAINID,
|
|
926
1025
|
Sei,
|
|
927
1026
|
SolanaDevnet,
|
|
1027
|
+
StoryOdysseyTestnet,
|
|
1028
|
+
StoryTestnet,
|
|
928
1029
|
SystemStateEnum,
|
|
929
1030
|
TestnetChains,
|
|
1031
|
+
TrackerListenerKeyMap,
|
|
930
1032
|
TriggerPriceType,
|
|
931
1033
|
WS_WalletStatusEnum,
|
|
932
1034
|
WithdrawStatus,
|