@kodiak-finance/orderly-types 2.8.32 → 2.9.0-rc.1
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 +82 -2
- package/dist/index.d.ts +82 -2
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -50,6 +50,7 @@ declare const ARBITRUM_MAINNET_CHAINID = 42161;
|
|
|
50
50
|
declare const ETHEREUM_MAINNET_CHAINID = 1;
|
|
51
51
|
declare const ARBITRUM_MAINNET_CHAINID_HEX = "0xa4b1";
|
|
52
52
|
declare const MEDIA_TABLET = "(max-width: 768px)";
|
|
53
|
+
/** deposit buffer factor */
|
|
53
54
|
declare const DEPOSIT_FEE_RATE = 1.05;
|
|
54
55
|
/**
|
|
55
56
|
* A constant for the maximum value for a ``uint256``.
|
|
@@ -57,7 +58,7 @@ declare const DEPOSIT_FEE_RATE = 1.05;
|
|
|
57
58
|
declare const MaxUint256: bigint;
|
|
58
59
|
declare const nativeTokenAddress = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
59
60
|
declare const nativeETHAddress = "0x0000000000000000000000000000000000000000";
|
|
60
|
-
declare const isNativeTokenChecker: (address
|
|
61
|
+
declare const isNativeTokenChecker: (address?: string) => boolean;
|
|
61
62
|
declare const ArbitrumSepoliaChainInfo: {
|
|
62
63
|
name: string;
|
|
63
64
|
public_rpc_url: string;
|
|
@@ -119,6 +120,22 @@ declare const TesnetTokenFallback: (testnetTokens: any) => {
|
|
|
119
120
|
declare const EMPTY_LIST: ReadonlyArray<any>;
|
|
120
121
|
declare const EMPTY_OBJECT: Readonly<Record<PropertyKey, any>>;
|
|
121
122
|
declare const EMPTY_OPERATION: () => void;
|
|
123
|
+
/**
|
|
124
|
+
* Event name for broadcasting Order Entry estimated liquidation price changes
|
|
125
|
+
* so that UI consumers (e.g. TradingView adapters) can update their visuals
|
|
126
|
+
* without introducing tight coupling between widgets.
|
|
127
|
+
*/
|
|
128
|
+
declare const ORDER_ENTRY_EST_LIQ_PRICE_CHANGE: "orderEntry:estLiqPriceChange";
|
|
129
|
+
/**
|
|
130
|
+
* Payload for the ORDER_ENTRY_EST_LIQ_PRICE_CHANGE event, carrying the symbol
|
|
131
|
+
* and the latest estimated liquidation price derived from the order form.
|
|
132
|
+
*/
|
|
133
|
+
interface OrderEntryEstLiqPriceChangePayload {
|
|
134
|
+
symbol: string;
|
|
135
|
+
estLiqPrice: number | null;
|
|
136
|
+
/** Whether the user is considered active when this payload is emitted (within the active window). */
|
|
137
|
+
isUserActive?: boolean;
|
|
138
|
+
}
|
|
122
139
|
|
|
123
140
|
/**
|
|
124
141
|
* Supported types for placing an order
|
|
@@ -146,6 +163,13 @@ declare enum OrderType {
|
|
|
146
163
|
*/
|
|
147
164
|
TRAILING_STOP = "TRAILING_STOP"
|
|
148
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Margin mode for the order
|
|
168
|
+
*/
|
|
169
|
+
declare enum MarginMode {
|
|
170
|
+
ISOLATED = "ISOLATED",
|
|
171
|
+
CROSS = "CROSS"
|
|
172
|
+
}
|
|
149
173
|
declare enum BBOOrderType {
|
|
150
174
|
COUNTERPARTY1 = "counterparty1",
|
|
151
175
|
COUNTERPARTY5 = "counterparty5",
|
|
@@ -203,6 +227,7 @@ interface OrderExt {
|
|
|
203
227
|
interface BaseOrder {
|
|
204
228
|
symbol: string;
|
|
205
229
|
order_type: OrderType;
|
|
230
|
+
margin_mode: MarginMode;
|
|
206
231
|
order_type_ext?: OrderType;
|
|
207
232
|
order_price: string;
|
|
208
233
|
order_quantity: string;
|
|
@@ -311,6 +336,7 @@ interface TrailingStopOrder {
|
|
|
311
336
|
interface OrderEntity extends ScaledOrder, TrailingStopOrder {
|
|
312
337
|
symbol: string;
|
|
313
338
|
order_type: OrderType;
|
|
339
|
+
margin_mode?: MarginMode;
|
|
314
340
|
algo_type?: AlgoOrderRootType;
|
|
315
341
|
order_type_ext?: OrderType;
|
|
316
342
|
order_price?: string;
|
|
@@ -520,6 +546,7 @@ declare namespace API {
|
|
|
520
546
|
reduce_only: boolean;
|
|
521
547
|
trigger_price?: number;
|
|
522
548
|
order_tag?: string;
|
|
549
|
+
margin_mode?: MarginMode;
|
|
523
550
|
}
|
|
524
551
|
interface OrderExt extends Order {
|
|
525
552
|
mark_price: string;
|
|
@@ -555,6 +582,7 @@ declare namespace API {
|
|
|
555
582
|
callback_value?: number;
|
|
556
583
|
callback_rate?: number;
|
|
557
584
|
extreme_price?: number;
|
|
585
|
+
margin_mode?: MarginMode;
|
|
558
586
|
}
|
|
559
587
|
interface AlgoOrderExt extends AlgoOrder {
|
|
560
588
|
mark_price: string;
|
|
@@ -688,6 +716,8 @@ declare namespace API {
|
|
|
688
716
|
fee_24_h: number;
|
|
689
717
|
fundingFee?: number;
|
|
690
718
|
leverage: number;
|
|
719
|
+
margin?: number;
|
|
720
|
+
margin_mode?: MarginMode;
|
|
691
721
|
}
|
|
692
722
|
interface PositionExt extends Position {
|
|
693
723
|
notional: number;
|
|
@@ -726,6 +756,8 @@ declare namespace API {
|
|
|
726
756
|
holding: number;
|
|
727
757
|
frozen: number;
|
|
728
758
|
pending_short: number;
|
|
759
|
+
isolated_margin: number;
|
|
760
|
+
isolated_order_frozen: number;
|
|
729
761
|
updated_time: number;
|
|
730
762
|
}
|
|
731
763
|
interface AccountInfo {
|
|
@@ -915,6 +947,7 @@ declare namespace API {
|
|
|
915
947
|
close_timestamp: number;
|
|
916
948
|
last_update_time: number;
|
|
917
949
|
leverage: number;
|
|
950
|
+
margin_mode?: MarginMode | 1 | 0;
|
|
918
951
|
}
|
|
919
952
|
interface LiquidationPositionByPerp {
|
|
920
953
|
abs_liquidation_fee: number;
|
|
@@ -954,6 +987,50 @@ declare namespace API {
|
|
|
954
987
|
interface LeverageInfo {
|
|
955
988
|
symbol: string;
|
|
956
989
|
leverage: number;
|
|
990
|
+
margin_mode?: MarginMode;
|
|
991
|
+
}
|
|
992
|
+
namespace Referral {
|
|
993
|
+
/** /v1/referral/multi_level/volume_prerequisite */
|
|
994
|
+
interface VolumePrerequisite {
|
|
995
|
+
required_volume: number;
|
|
996
|
+
current_volume: number;
|
|
997
|
+
}
|
|
998
|
+
/** /v1/referral/multi_level/max_rebate_rate */
|
|
999
|
+
interface MaxRebateRate {
|
|
1000
|
+
max_rebate_rate: number;
|
|
1001
|
+
}
|
|
1002
|
+
/** /v1/referral/multi_level/rebate_info */
|
|
1003
|
+
interface MultiLevelRebateInfo {
|
|
1004
|
+
referral_code: string;
|
|
1005
|
+
max_rebate_rate: number;
|
|
1006
|
+
default_referee_rebate_rate: number;
|
|
1007
|
+
direct_invites?: number;
|
|
1008
|
+
indirect_invites?: number;
|
|
1009
|
+
direct_volume?: number;
|
|
1010
|
+
indirect_volume?: number;
|
|
1011
|
+
direct_rebate?: number;
|
|
1012
|
+
indirect_rebate?: number;
|
|
1013
|
+
direct_bonus_rebate_rate?: number;
|
|
1014
|
+
direct_bonus_rebate?: number;
|
|
1015
|
+
}
|
|
1016
|
+
/** /v1/referral/multi_level/admin */
|
|
1017
|
+
interface MultiLevelReferralConfig {
|
|
1018
|
+
enable: boolean;
|
|
1019
|
+
required_volume: number;
|
|
1020
|
+
max_rebate_rate: number;
|
|
1021
|
+
}
|
|
1022
|
+
/** /v1/referral/multi_level/statistics */
|
|
1023
|
+
interface MultiLevelStatistics {
|
|
1024
|
+
direct_invites: number;
|
|
1025
|
+
indirect_invites: number;
|
|
1026
|
+
direct_traded: number;
|
|
1027
|
+
indirect_traded: number;
|
|
1028
|
+
direct_volume: number;
|
|
1029
|
+
indirect_volume: number;
|
|
1030
|
+
direct_rebate: number;
|
|
1031
|
+
indirect_rebate: number;
|
|
1032
|
+
direct_bonus_rebate?: number;
|
|
1033
|
+
}
|
|
957
1034
|
}
|
|
958
1035
|
}
|
|
959
1036
|
declare namespace WSMessage {
|
|
@@ -976,6 +1053,7 @@ declare namespace WSMessage {
|
|
|
976
1053
|
}
|
|
977
1054
|
interface Position {
|
|
978
1055
|
symbol: string;
|
|
1056
|
+
marginMode?: MarginMode;
|
|
979
1057
|
positionQty: number;
|
|
980
1058
|
costPosition: number;
|
|
981
1059
|
lastSumUnitaryFunding: number;
|
|
@@ -1026,6 +1104,7 @@ declare namespace WSMessage {
|
|
|
1026
1104
|
timestamp: number;
|
|
1027
1105
|
reduceOnly: boolean;
|
|
1028
1106
|
maker: boolean;
|
|
1107
|
+
marginMode?: MarginMode;
|
|
1029
1108
|
}
|
|
1030
1109
|
interface Holding {
|
|
1031
1110
|
holding: number;
|
|
@@ -1071,6 +1150,7 @@ declare namespace WSMessage {
|
|
|
1071
1150
|
maker: boolean;
|
|
1072
1151
|
rootAlgoStatus: string;
|
|
1073
1152
|
algoStatus: string;
|
|
1153
|
+
marginMode?: MarginMode;
|
|
1074
1154
|
}
|
|
1075
1155
|
interface Announcement {
|
|
1076
1156
|
announcement_id: string;
|
|
@@ -1926,4 +2006,4 @@ declare enum AssetHistorySideEnum {
|
|
|
1926
2006
|
|
|
1927
2007
|
declare const DEFAUL_ORDERLY_KEY_SCOPE = "read,trading";
|
|
1928
2008
|
|
|
1929
|
-
export { ABSTRACT_CHAIN_ID_MAP, ABSTRACT_MAINNET_CHAINID, ABSTRACT_TESTNET_CHAINID, API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AbstractChains, AbstractTestnetChainInfo, AbstractTestnetTokenInfo, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, AnnouncementType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, ArbitrumSepoliaChainInfo, ArbitrumSepoliaTokenInfo, AssetHistorySideEnum, AssetHistoryStatusEnum, Avalanche, BBOOrderType, BNB, BSC_TESTNET_CHAINID, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainKey, ChainNamespace, type ChildOrder, ConnectorKey, type CurrentChain, DEFAUL_ORDERLY_KEY_SCOPE, DEPOSIT_FEE_RATE, DistributionType, EMPTY_LIST, EMPTY_OBJECT, EMPTY_OPERATION, ETHEREUM_MAINNET_CHAINID, Ethereum, ExchangeStatusEnum, Fantom, Fuji, LedgerWalletKey, Linea, LinkDeviceKey, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, MONAD_TESTNET_CHAINID, Mantle, MantleSepolia, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, OrderEntrySortKeys, OrderLevel, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, PositionType, type RegularOrder, type RequireKeys, type RouteOption, type RouterAdapter, SDKError, SOLANA_MAINNET_CHAINID, SOLANA_TESTNET_CHAINID, STORY_TESTNET_CHAINID, Sei, SolanaChains, SolanaDevnet, SolanaDevnetChainInfo, SolanaDevnetTokenInfo, StoryOdysseyTestnet, StoryTestnet, SystemStateEnum, type TPSLOrderEntry, TesnetTokenFallback, TestnetChains, TrackerEventName, TradingviewFullscreenKey, TrailingCallbackType, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeETHAddress, nativeTokenAddress, _default as version, zkSyncEra };
|
|
2009
|
+
export { ABSTRACT_CHAIN_ID_MAP, ABSTRACT_MAINNET_CHAINID, ABSTRACT_TESTNET_CHAINID, API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AbstractChains, AbstractTestnetChainInfo, AbstractTestnetTokenInfo, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, AnnouncementType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, ArbitrumSepoliaChainInfo, ArbitrumSepoliaTokenInfo, AssetHistorySideEnum, AssetHistoryStatusEnum, Avalanche, BBOOrderType, BNB, BSC_TESTNET_CHAINID, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainKey, ChainNamespace, type ChildOrder, ConnectorKey, type CurrentChain, DEFAUL_ORDERLY_KEY_SCOPE, DEPOSIT_FEE_RATE, DistributionType, EMPTY_LIST, EMPTY_OBJECT, EMPTY_OPERATION, ETHEREUM_MAINNET_CHAINID, Ethereum, ExchangeStatusEnum, Fantom, Fuji, LedgerWalletKey, Linea, LinkDeviceKey, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, MONAD_TESTNET_CHAINID, Mantle, MantleSepolia, MarginMode, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, ORDER_ENTRY_EST_LIQ_PRICE_CHANGE, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, type OrderEntryEstLiqPriceChangePayload, OrderEntrySortKeys, OrderLevel, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, PositionType, type RegularOrder, type RequireKeys, type RouteOption, type RouterAdapter, SDKError, SOLANA_MAINNET_CHAINID, SOLANA_TESTNET_CHAINID, STORY_TESTNET_CHAINID, Sei, SolanaChains, SolanaDevnet, SolanaDevnetChainInfo, SolanaDevnetTokenInfo, StoryOdysseyTestnet, StoryTestnet, SystemStateEnum, type TPSLOrderEntry, TesnetTokenFallback, TestnetChains, TrackerEventName, TradingviewFullscreenKey, TrailingCallbackType, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeETHAddress, nativeTokenAddress, _default as version, zkSyncEra };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ declare const ARBITRUM_MAINNET_CHAINID = 42161;
|
|
|
50
50
|
declare const ETHEREUM_MAINNET_CHAINID = 1;
|
|
51
51
|
declare const ARBITRUM_MAINNET_CHAINID_HEX = "0xa4b1";
|
|
52
52
|
declare const MEDIA_TABLET = "(max-width: 768px)";
|
|
53
|
+
/** deposit buffer factor */
|
|
53
54
|
declare const DEPOSIT_FEE_RATE = 1.05;
|
|
54
55
|
/**
|
|
55
56
|
* A constant for the maximum value for a ``uint256``.
|
|
@@ -57,7 +58,7 @@ declare const DEPOSIT_FEE_RATE = 1.05;
|
|
|
57
58
|
declare const MaxUint256: bigint;
|
|
58
59
|
declare const nativeTokenAddress = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
59
60
|
declare const nativeETHAddress = "0x0000000000000000000000000000000000000000";
|
|
60
|
-
declare const isNativeTokenChecker: (address
|
|
61
|
+
declare const isNativeTokenChecker: (address?: string) => boolean;
|
|
61
62
|
declare const ArbitrumSepoliaChainInfo: {
|
|
62
63
|
name: string;
|
|
63
64
|
public_rpc_url: string;
|
|
@@ -119,6 +120,22 @@ declare const TesnetTokenFallback: (testnetTokens: any) => {
|
|
|
119
120
|
declare const EMPTY_LIST: ReadonlyArray<any>;
|
|
120
121
|
declare const EMPTY_OBJECT: Readonly<Record<PropertyKey, any>>;
|
|
121
122
|
declare const EMPTY_OPERATION: () => void;
|
|
123
|
+
/**
|
|
124
|
+
* Event name for broadcasting Order Entry estimated liquidation price changes
|
|
125
|
+
* so that UI consumers (e.g. TradingView adapters) can update their visuals
|
|
126
|
+
* without introducing tight coupling between widgets.
|
|
127
|
+
*/
|
|
128
|
+
declare const ORDER_ENTRY_EST_LIQ_PRICE_CHANGE: "orderEntry:estLiqPriceChange";
|
|
129
|
+
/**
|
|
130
|
+
* Payload for the ORDER_ENTRY_EST_LIQ_PRICE_CHANGE event, carrying the symbol
|
|
131
|
+
* and the latest estimated liquidation price derived from the order form.
|
|
132
|
+
*/
|
|
133
|
+
interface OrderEntryEstLiqPriceChangePayload {
|
|
134
|
+
symbol: string;
|
|
135
|
+
estLiqPrice: number | null;
|
|
136
|
+
/** Whether the user is considered active when this payload is emitted (within the active window). */
|
|
137
|
+
isUserActive?: boolean;
|
|
138
|
+
}
|
|
122
139
|
|
|
123
140
|
/**
|
|
124
141
|
* Supported types for placing an order
|
|
@@ -146,6 +163,13 @@ declare enum OrderType {
|
|
|
146
163
|
*/
|
|
147
164
|
TRAILING_STOP = "TRAILING_STOP"
|
|
148
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Margin mode for the order
|
|
168
|
+
*/
|
|
169
|
+
declare enum MarginMode {
|
|
170
|
+
ISOLATED = "ISOLATED",
|
|
171
|
+
CROSS = "CROSS"
|
|
172
|
+
}
|
|
149
173
|
declare enum BBOOrderType {
|
|
150
174
|
COUNTERPARTY1 = "counterparty1",
|
|
151
175
|
COUNTERPARTY5 = "counterparty5",
|
|
@@ -203,6 +227,7 @@ interface OrderExt {
|
|
|
203
227
|
interface BaseOrder {
|
|
204
228
|
symbol: string;
|
|
205
229
|
order_type: OrderType;
|
|
230
|
+
margin_mode: MarginMode;
|
|
206
231
|
order_type_ext?: OrderType;
|
|
207
232
|
order_price: string;
|
|
208
233
|
order_quantity: string;
|
|
@@ -311,6 +336,7 @@ interface TrailingStopOrder {
|
|
|
311
336
|
interface OrderEntity extends ScaledOrder, TrailingStopOrder {
|
|
312
337
|
symbol: string;
|
|
313
338
|
order_type: OrderType;
|
|
339
|
+
margin_mode?: MarginMode;
|
|
314
340
|
algo_type?: AlgoOrderRootType;
|
|
315
341
|
order_type_ext?: OrderType;
|
|
316
342
|
order_price?: string;
|
|
@@ -520,6 +546,7 @@ declare namespace API {
|
|
|
520
546
|
reduce_only: boolean;
|
|
521
547
|
trigger_price?: number;
|
|
522
548
|
order_tag?: string;
|
|
549
|
+
margin_mode?: MarginMode;
|
|
523
550
|
}
|
|
524
551
|
interface OrderExt extends Order {
|
|
525
552
|
mark_price: string;
|
|
@@ -555,6 +582,7 @@ declare namespace API {
|
|
|
555
582
|
callback_value?: number;
|
|
556
583
|
callback_rate?: number;
|
|
557
584
|
extreme_price?: number;
|
|
585
|
+
margin_mode?: MarginMode;
|
|
558
586
|
}
|
|
559
587
|
interface AlgoOrderExt extends AlgoOrder {
|
|
560
588
|
mark_price: string;
|
|
@@ -688,6 +716,8 @@ declare namespace API {
|
|
|
688
716
|
fee_24_h: number;
|
|
689
717
|
fundingFee?: number;
|
|
690
718
|
leverage: number;
|
|
719
|
+
margin?: number;
|
|
720
|
+
margin_mode?: MarginMode;
|
|
691
721
|
}
|
|
692
722
|
interface PositionExt extends Position {
|
|
693
723
|
notional: number;
|
|
@@ -726,6 +756,8 @@ declare namespace API {
|
|
|
726
756
|
holding: number;
|
|
727
757
|
frozen: number;
|
|
728
758
|
pending_short: number;
|
|
759
|
+
isolated_margin: number;
|
|
760
|
+
isolated_order_frozen: number;
|
|
729
761
|
updated_time: number;
|
|
730
762
|
}
|
|
731
763
|
interface AccountInfo {
|
|
@@ -915,6 +947,7 @@ declare namespace API {
|
|
|
915
947
|
close_timestamp: number;
|
|
916
948
|
last_update_time: number;
|
|
917
949
|
leverage: number;
|
|
950
|
+
margin_mode?: MarginMode | 1 | 0;
|
|
918
951
|
}
|
|
919
952
|
interface LiquidationPositionByPerp {
|
|
920
953
|
abs_liquidation_fee: number;
|
|
@@ -954,6 +987,50 @@ declare namespace API {
|
|
|
954
987
|
interface LeverageInfo {
|
|
955
988
|
symbol: string;
|
|
956
989
|
leverage: number;
|
|
990
|
+
margin_mode?: MarginMode;
|
|
991
|
+
}
|
|
992
|
+
namespace Referral {
|
|
993
|
+
/** /v1/referral/multi_level/volume_prerequisite */
|
|
994
|
+
interface VolumePrerequisite {
|
|
995
|
+
required_volume: number;
|
|
996
|
+
current_volume: number;
|
|
997
|
+
}
|
|
998
|
+
/** /v1/referral/multi_level/max_rebate_rate */
|
|
999
|
+
interface MaxRebateRate {
|
|
1000
|
+
max_rebate_rate: number;
|
|
1001
|
+
}
|
|
1002
|
+
/** /v1/referral/multi_level/rebate_info */
|
|
1003
|
+
interface MultiLevelRebateInfo {
|
|
1004
|
+
referral_code: string;
|
|
1005
|
+
max_rebate_rate: number;
|
|
1006
|
+
default_referee_rebate_rate: number;
|
|
1007
|
+
direct_invites?: number;
|
|
1008
|
+
indirect_invites?: number;
|
|
1009
|
+
direct_volume?: number;
|
|
1010
|
+
indirect_volume?: number;
|
|
1011
|
+
direct_rebate?: number;
|
|
1012
|
+
indirect_rebate?: number;
|
|
1013
|
+
direct_bonus_rebate_rate?: number;
|
|
1014
|
+
direct_bonus_rebate?: number;
|
|
1015
|
+
}
|
|
1016
|
+
/** /v1/referral/multi_level/admin */
|
|
1017
|
+
interface MultiLevelReferralConfig {
|
|
1018
|
+
enable: boolean;
|
|
1019
|
+
required_volume: number;
|
|
1020
|
+
max_rebate_rate: number;
|
|
1021
|
+
}
|
|
1022
|
+
/** /v1/referral/multi_level/statistics */
|
|
1023
|
+
interface MultiLevelStatistics {
|
|
1024
|
+
direct_invites: number;
|
|
1025
|
+
indirect_invites: number;
|
|
1026
|
+
direct_traded: number;
|
|
1027
|
+
indirect_traded: number;
|
|
1028
|
+
direct_volume: number;
|
|
1029
|
+
indirect_volume: number;
|
|
1030
|
+
direct_rebate: number;
|
|
1031
|
+
indirect_rebate: number;
|
|
1032
|
+
direct_bonus_rebate?: number;
|
|
1033
|
+
}
|
|
957
1034
|
}
|
|
958
1035
|
}
|
|
959
1036
|
declare namespace WSMessage {
|
|
@@ -976,6 +1053,7 @@ declare namespace WSMessage {
|
|
|
976
1053
|
}
|
|
977
1054
|
interface Position {
|
|
978
1055
|
symbol: string;
|
|
1056
|
+
marginMode?: MarginMode;
|
|
979
1057
|
positionQty: number;
|
|
980
1058
|
costPosition: number;
|
|
981
1059
|
lastSumUnitaryFunding: number;
|
|
@@ -1026,6 +1104,7 @@ declare namespace WSMessage {
|
|
|
1026
1104
|
timestamp: number;
|
|
1027
1105
|
reduceOnly: boolean;
|
|
1028
1106
|
maker: boolean;
|
|
1107
|
+
marginMode?: MarginMode;
|
|
1029
1108
|
}
|
|
1030
1109
|
interface Holding {
|
|
1031
1110
|
holding: number;
|
|
@@ -1071,6 +1150,7 @@ declare namespace WSMessage {
|
|
|
1071
1150
|
maker: boolean;
|
|
1072
1151
|
rootAlgoStatus: string;
|
|
1073
1152
|
algoStatus: string;
|
|
1153
|
+
marginMode?: MarginMode;
|
|
1074
1154
|
}
|
|
1075
1155
|
interface Announcement {
|
|
1076
1156
|
announcement_id: string;
|
|
@@ -1926,4 +2006,4 @@ declare enum AssetHistorySideEnum {
|
|
|
1926
2006
|
|
|
1927
2007
|
declare const DEFAUL_ORDERLY_KEY_SCOPE = "read,trading";
|
|
1928
2008
|
|
|
1929
|
-
export { ABSTRACT_CHAIN_ID_MAP, ABSTRACT_MAINNET_CHAINID, ABSTRACT_TESTNET_CHAINID, API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AbstractChains, AbstractTestnetChainInfo, AbstractTestnetTokenInfo, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, AnnouncementType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, ArbitrumSepoliaChainInfo, ArbitrumSepoliaTokenInfo, AssetHistorySideEnum, AssetHistoryStatusEnum, Avalanche, BBOOrderType, BNB, BSC_TESTNET_CHAINID, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainKey, ChainNamespace, type ChildOrder, ConnectorKey, type CurrentChain, DEFAUL_ORDERLY_KEY_SCOPE, DEPOSIT_FEE_RATE, DistributionType, EMPTY_LIST, EMPTY_OBJECT, EMPTY_OPERATION, ETHEREUM_MAINNET_CHAINID, Ethereum, ExchangeStatusEnum, Fantom, Fuji, LedgerWalletKey, Linea, LinkDeviceKey, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, MONAD_TESTNET_CHAINID, Mantle, MantleSepolia, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, OrderEntrySortKeys, OrderLevel, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, PositionType, type RegularOrder, type RequireKeys, type RouteOption, type RouterAdapter, SDKError, SOLANA_MAINNET_CHAINID, SOLANA_TESTNET_CHAINID, STORY_TESTNET_CHAINID, Sei, SolanaChains, SolanaDevnet, SolanaDevnetChainInfo, SolanaDevnetTokenInfo, StoryOdysseyTestnet, StoryTestnet, SystemStateEnum, type TPSLOrderEntry, TesnetTokenFallback, TestnetChains, TrackerEventName, TradingviewFullscreenKey, TrailingCallbackType, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeETHAddress, nativeTokenAddress, _default as version, zkSyncEra };
|
|
2009
|
+
export { ABSTRACT_CHAIN_ID_MAP, ABSTRACT_MAINNET_CHAINID, ABSTRACT_TESTNET_CHAINID, API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AbstractChains, AbstractTestnetChainInfo, AbstractTestnetTokenInfo, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, AnnouncementType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, ArbitrumSepoliaChainInfo, ArbitrumSepoliaTokenInfo, AssetHistorySideEnum, AssetHistoryStatusEnum, Avalanche, BBOOrderType, BNB, BSC_TESTNET_CHAINID, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainKey, ChainNamespace, type ChildOrder, ConnectorKey, type CurrentChain, DEFAUL_ORDERLY_KEY_SCOPE, DEPOSIT_FEE_RATE, DistributionType, EMPTY_LIST, EMPTY_OBJECT, EMPTY_OPERATION, ETHEREUM_MAINNET_CHAINID, Ethereum, ExchangeStatusEnum, Fantom, Fuji, LedgerWalletKey, Linea, LinkDeviceKey, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, MONAD_TESTNET_CHAINID, Mantle, MantleSepolia, MarginMode, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, ORDER_ENTRY_EST_LIQ_PRICE_CHANGE, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, type OrderEntryEstLiqPriceChangePayload, OrderEntrySortKeys, OrderLevel, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, PositionType, type RegularOrder, type RequireKeys, type RouteOption, type RouterAdapter, SDKError, SOLANA_MAINNET_CHAINID, SOLANA_TESTNET_CHAINID, STORY_TESTNET_CHAINID, Sei, SolanaChains, SolanaDevnet, SolanaDevnetChainInfo, SolanaDevnetTokenInfo, StoryOdysseyTestnet, StoryTestnet, SystemStateEnum, type TPSLOrderEntry, TesnetTokenFallback, TestnetChains, TrackerEventName, TradingviewFullscreenKey, TrailingCallbackType, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeETHAddress, nativeTokenAddress, _default as version, zkSyncEra };
|
package/dist/index.js
CHANGED
|
@@ -81,8 +81,10 @@ __export(index_exports, {
|
|
|
81
81
|
MONAD_TESTNET_CHAINID: () => MONAD_TESTNET_CHAINID,
|
|
82
82
|
Mantle: () => Mantle,
|
|
83
83
|
MantleSepolia: () => MantleSepolia,
|
|
84
|
+
MarginMode: () => MarginMode,
|
|
84
85
|
MaxUint256: () => MaxUint256,
|
|
85
86
|
NetworkStatusEnum: () => NetworkStatusEnum,
|
|
87
|
+
ORDER_ENTRY_EST_LIQ_PRICE_CHANGE: () => ORDER_ENTRY_EST_LIQ_PRICE_CHANGE,
|
|
86
88
|
Optimism: () => Optimism,
|
|
87
89
|
OptimismGoerli: () => OptimismGoerli,
|
|
88
90
|
OptimismSepolia: () => OptimismSepolia,
|
|
@@ -188,7 +190,12 @@ var MaxUint256 = BigInt(
|
|
|
188
190
|
);
|
|
189
191
|
var nativeTokenAddress = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
190
192
|
var nativeETHAddress = "0x0000000000000000000000000000000000000000";
|
|
191
|
-
var isNativeTokenChecker = (address) =>
|
|
193
|
+
var isNativeTokenChecker = (address) => {
|
|
194
|
+
if (!address) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
return (address == null ? void 0 : address.toLowerCase()) === nativeTokenAddress.toLowerCase() || address === nativeETHAddress;
|
|
198
|
+
};
|
|
192
199
|
var ArbitrumSepoliaChainInfo = {
|
|
193
200
|
name: "Arbitrum Sepolia",
|
|
194
201
|
public_rpc_url: "https://arbitrum-sepolia.gateway.tenderly.co",
|
|
@@ -253,6 +260,7 @@ var EMPTY_LIST = [];
|
|
|
253
260
|
var EMPTY_OBJECT = {};
|
|
254
261
|
var EMPTY_OPERATION = () => {
|
|
255
262
|
};
|
|
263
|
+
var ORDER_ENTRY_EST_LIQ_PRICE_CHANGE = "orderEntry:estLiqPriceChange";
|
|
256
264
|
|
|
257
265
|
// src/types/api.ts
|
|
258
266
|
var AnnouncementType = /* @__PURE__ */ ((AnnouncementType2) => {
|
|
@@ -281,6 +289,11 @@ var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
|
281
289
|
OrderType2["TRAILING_STOP"] = "TRAILING_STOP";
|
|
282
290
|
return OrderType2;
|
|
283
291
|
})(OrderType || {});
|
|
292
|
+
var MarginMode = /* @__PURE__ */ ((MarginMode2) => {
|
|
293
|
+
MarginMode2["ISOLATED"] = "ISOLATED";
|
|
294
|
+
MarginMode2["CROSS"] = "CROSS";
|
|
295
|
+
return MarginMode2;
|
|
296
|
+
})(MarginMode || {});
|
|
284
297
|
var BBOOrderType = /* @__PURE__ */ ((BBOOrderType2) => {
|
|
285
298
|
BBOOrderType2["COUNTERPARTY1"] = "counterparty1";
|
|
286
299
|
BBOOrderType2["COUNTERPARTY5"] = "counterparty5";
|
|
@@ -1224,8 +1237,10 @@ var DEFAUL_ORDERLY_KEY_SCOPE = "read,trading";
|
|
|
1224
1237
|
MONAD_TESTNET_CHAINID,
|
|
1225
1238
|
Mantle,
|
|
1226
1239
|
MantleSepolia,
|
|
1240
|
+
MarginMode,
|
|
1227
1241
|
MaxUint256,
|
|
1228
1242
|
NetworkStatusEnum,
|
|
1243
|
+
ORDER_ENTRY_EST_LIQ_PRICE_CHANGE,
|
|
1229
1244
|
Optimism,
|
|
1230
1245
|
OptimismGoerli,
|
|
1231
1246
|
OptimismSepolia,
|