ccxt 4.5.18 → 4.5.20

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.
Files changed (152) hide show
  1. package/README.md +7 -6
  2. package/dist/ccxt.browser.min.js +40 -16
  3. package/dist/cjs/_virtual/index.cjs.js +1459 -9
  4. package/dist/cjs/ccxt.js +8 -2
  5. package/dist/cjs/src/abstract/dydx.js +11 -0
  6. package/dist/cjs/src/base/Exchange.js +164 -10
  7. package/dist/cjs/src/base/ws/Client.js +3 -1
  8. package/dist/cjs/src/binance.js +8 -1
  9. package/dist/cjs/src/bingx.js +20 -0
  10. package/dist/cjs/src/bitget.js +43 -41
  11. package/dist/cjs/src/bybit.js +21 -23
  12. package/dist/cjs/src/deribit.js +6 -0
  13. package/dist/cjs/src/dydx.js +2454 -0
  14. package/dist/cjs/src/gate.js +4 -4
  15. package/dist/cjs/src/hibachi.js +1 -1
  16. package/dist/cjs/src/hyperliquid.js +207 -9
  17. package/dist/cjs/src/kucoin.js +711 -109
  18. package/dist/cjs/src/mexc.js +2 -3
  19. package/dist/cjs/src/pro/binance.js +59 -144
  20. package/dist/cjs/src/pro/dydx.js +418 -0
  21. package/dist/cjs/src/pro/kraken.js +4 -3
  22. package/dist/cjs/src/pro/xt.js +218 -4
  23. package/dist/cjs/src/protobuf/mexc/compiled.cjs.js +1 -0
  24. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +56 -0
  25. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +56 -0
  26. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +48 -0
  27. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +343 -0
  28. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +717 -0
  29. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +60 -0
  30. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +45 -0
  31. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +380 -0
  32. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +72 -0
  33. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +211 -0
  34. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +195 -0
  35. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +49 -0
  36. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +57 -0
  37. package/dist/cjs/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +56 -0
  38. package/dist/cjs/src/static_dependencies/dydx-v4-client/helpers.js +79 -0
  39. package/dist/cjs/src/static_dependencies/dydx-v4-client/long/index.cjs.js +9 -0
  40. package/dist/cjs/src/static_dependencies/dydx-v4-client/onboarding.js +59 -0
  41. package/dist/cjs/src/static_dependencies/dydx-v4-client/registry.js +39 -0
  42. package/dist/cjs/src/static_dependencies/noble-hashes/pbkdf2.js +69 -0
  43. package/dist/cjs/src/static_dependencies/noble-hashes/ripemd160.js +108 -0
  44. package/dist/cjs/src/static_dependencies/noble-hashes/utils.js +50 -1
  45. package/dist/cjs/src/static_dependencies/scure-base/index.js +29 -0
  46. package/dist/cjs/src/static_dependencies/scure-bip32/index.js +278 -0
  47. package/dist/cjs/src/static_dependencies/scure-bip39/index.js +97 -0
  48. package/dist/cjs/src/static_dependencies/scure-bip39/wordlists/english.js +2060 -0
  49. package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2 -0
  50. package/dist/cjs/src/toobit.js +2 -1
  51. package/js/ccxt.d.ts +8 -2
  52. package/js/ccxt.js +6 -2
  53. package/js/src/abstract/binance.d.ts +7 -0
  54. package/js/src/abstract/binancecoinm.d.ts +7 -0
  55. package/js/src/abstract/binanceus.d.ts +7 -0
  56. package/js/src/abstract/binanceusdm.d.ts +7 -0
  57. package/js/src/abstract/bitget.d.ts +1 -0
  58. package/js/src/abstract/dydx.d.ts +61 -0
  59. package/js/src/abstract/dydx.js +11 -0
  60. package/js/src/abstract/kucoin.d.ts +1 -1
  61. package/js/src/abstract/kucoinfutures.d.ts +1 -1
  62. package/js/src/base/Exchange.d.ts +7 -0
  63. package/js/src/base/Exchange.js +163 -10
  64. package/js/src/base/ws/Client.js +3 -1
  65. package/js/src/binance.js +8 -1
  66. package/js/src/bingx.js +20 -0
  67. package/js/src/bitget.d.ts +3 -3
  68. package/js/src/bitget.js +43 -41
  69. package/js/src/bybit.d.ts +3 -3
  70. package/js/src/bybit.js +21 -23
  71. package/js/src/deribit.js +6 -0
  72. package/js/src/dydx.d.ts +364 -0
  73. package/js/src/dydx.js +2453 -0
  74. package/js/src/gate.d.ts +2 -2
  75. package/js/src/gate.js +4 -4
  76. package/js/src/hibachi.js +1 -1
  77. package/js/src/hyperliquid.d.ts +17 -0
  78. package/js/src/hyperliquid.js +207 -9
  79. package/js/src/kucoin.d.ts +48 -1
  80. package/js/src/kucoin.js +711 -109
  81. package/js/src/mexc.js +2 -3
  82. package/js/src/pro/binance.d.ts +2 -2
  83. package/js/src/pro/binance.js +59 -144
  84. package/js/src/pro/dydx.d.ts +81 -0
  85. package/js/src/pro/dydx.js +417 -0
  86. package/js/src/pro/kraken.js +4 -3
  87. package/js/src/pro/xt.d.ts +85 -2
  88. package/js/src/pro/xt.js +218 -4
  89. package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.d.ts +90 -0
  90. package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +163 -0
  91. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.d.ts +26 -0
  92. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.js +51 -0
  93. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.d.ts +48 -0
  94. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +85 -0
  95. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.d.ts +40 -0
  96. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +77 -0
  97. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.d.ts +162 -0
  98. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +329 -0
  99. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.d.ts +460 -0
  100. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +698 -0
  101. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.d.ts +127 -0
  102. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +286 -0
  103. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.d.ts +66 -0
  104. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.js +109 -0
  105. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.d.ts +127 -0
  106. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +257 -0
  107. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.d.ts +48 -0
  108. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.js +93 -0
  109. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.d.ts +23 -0
  110. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.js +43 -0
  111. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.d.ts +92 -0
  112. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.js +164 -0
  113. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.d.ts +124 -0
  114. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.js +196 -0
  115. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.d.ts +159 -0
  116. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.js +324 -0
  117. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.d.ts +546 -0
  118. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +872 -0
  119. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.d.ts +84 -0
  120. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +181 -0
  121. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.d.ts +397 -0
  122. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +757 -0
  123. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.d.ts +120 -0
  124. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +246 -0
  125. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.d.ts +79 -0
  126. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +147 -0
  127. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.d.ts +32 -0
  128. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.js +59 -0
  129. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.d.ts +34 -0
  130. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.js +66 -0
  131. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.d.ts +62 -0
  132. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +111 -0
  133. package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.d.ts +207 -0
  134. package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +50 -0
  135. package/js/src/static_dependencies/dydx-v4-client/helpers.d.ts +82 -0
  136. package/js/src/static_dependencies/dydx-v4-client/helpers.js +172 -0
  137. package/js/src/static_dependencies/dydx-v4-client/long/index.cjs +1473 -0
  138. package/js/src/static_dependencies/dydx-v4-client/long/index.d.cts +2 -0
  139. package/js/src/static_dependencies/dydx-v4-client/onboarding.d.ts +35 -0
  140. package/js/src/static_dependencies/dydx-v4-client/onboarding.js +56 -0
  141. package/js/src/static_dependencies/dydx-v4-client/registry.d.ts +7 -0
  142. package/js/src/static_dependencies/dydx-v4-client/registry.js +36 -0
  143. package/js/src/static_dependencies/noble-hashes/utils.d.ts +1 -0
  144. package/js/src/static_dependencies/noble-hashes/utils.js +4 -0
  145. package/js/src/static_dependencies/scure-bip32/index.d.ts +49 -0
  146. package/js/src/static_dependencies/scure-bip32/index.js +295 -0
  147. package/js/src/static_dependencies/scure-bip39/index.d.ts +54 -0
  148. package/js/src/static_dependencies/scure-bip39/index.js +140 -0
  149. package/js/src/static_dependencies/scure-bip39/wordlists/english.d.ts +1 -0
  150. package/js/src/static_dependencies/scure-bip39/wordlists/english.js +2054 -0
  151. package/js/src/toobit.js +2 -1
  152. package/package.json +9 -3
@@ -0,0 +1,127 @@
1
+ import _m0 from "protobufjs/minimal.js";
2
+ import { DeepPartial } from "../../helpers.js";
3
+ /** Status of the CLOB. */
4
+ export declare enum ClobPair_Status {
5
+ /** STATUS_UNSPECIFIED - Default value. This value is invalid and unused. */
6
+ STATUS_UNSPECIFIED = 0,
7
+ /** STATUS_ACTIVE - STATUS_ACTIVE represents an active clob pair. */
8
+ STATUS_ACTIVE = 1,
9
+ /**
10
+ * STATUS_PAUSED - STATUS_PAUSED behavior is unfinalized.
11
+ * TODO(DEC-600): update this documentation.
12
+ */
13
+ STATUS_PAUSED = 2,
14
+ /**
15
+ * STATUS_CANCEL_ONLY - STATUS_CANCEL_ONLY behavior is unfinalized.
16
+ * TODO(DEC-600): update this documentation.
17
+ */
18
+ STATUS_CANCEL_ONLY = 3,
19
+ /**
20
+ * STATUS_POST_ONLY - STATUS_POST_ONLY behavior is unfinalized.
21
+ * TODO(DEC-600): update this documentation.
22
+ */
23
+ STATUS_POST_ONLY = 4,
24
+ /**
25
+ * STATUS_INITIALIZING - STATUS_INITIALIZING represents a newly-added clob pair.
26
+ * Clob pairs in this state only accept orders which are
27
+ * both short-term and post-only.
28
+ */
29
+ STATUS_INITIALIZING = 5,
30
+ /**
31
+ * STATUS_FINAL_SETTLEMENT - STATUS_FINAL_SETTLEMENT represents a clob pair which is deactivated
32
+ * and trading has ceased. All open positions will be closed by the
33
+ * protocol. Open stateful orders will be cancelled. Open short-term
34
+ * orders will be left to expire.
35
+ */
36
+ STATUS_FINAL_SETTLEMENT = 6,
37
+ UNRECOGNIZED = -1
38
+ }
39
+ export declare const ClobPair_StatusSDKType: typeof ClobPair_Status;
40
+ export declare function clobPair_StatusFromJSON(object: any): ClobPair_Status;
41
+ export declare function clobPair_StatusToJSON(object: ClobPair_Status): string;
42
+ /**
43
+ * PerpetualClobMetadata contains metadata for a `ClobPair`
44
+ * representing a Perpetual product.
45
+ */
46
+ export interface PerpetualClobMetadata {
47
+ /** Id of the Perpetual the CLOB allows trading of. */
48
+ perpetualId: number;
49
+ }
50
+ /**
51
+ * PerpetualClobMetadata contains metadata for a `ClobPair`
52
+ * representing a Perpetual product.
53
+ */
54
+ export interface PerpetualClobMetadataSDKType {
55
+ perpetual_id: number;
56
+ }
57
+ /**
58
+ * PerpetualClobMetadata contains metadata for a `ClobPair`
59
+ * representing a Spot product.
60
+ */
61
+ export interface SpotClobMetadata {
62
+ /** Id of the base Asset in the trading pair. */
63
+ baseAssetId: number;
64
+ /** Id of the quote Asset in the trading pair. */
65
+ quoteAssetId: number;
66
+ }
67
+ /**
68
+ * PerpetualClobMetadata contains metadata for a `ClobPair`
69
+ * representing a Spot product.
70
+ */
71
+ export interface SpotClobMetadataSDKType {
72
+ base_asset_id: number;
73
+ quote_asset_id: number;
74
+ }
75
+ /**
76
+ * ClobPair represents a single CLOB pair for a given product
77
+ * in state.
78
+ */
79
+ export interface ClobPair {
80
+ /** ID of the orderbook that stores all resting liquidity for this CLOB. */
81
+ id: number;
82
+ perpetualClobMetadata?: PerpetualClobMetadata;
83
+ spotClobMetadata?: SpotClobMetadata;
84
+ /** Minimum increment in the size of orders on the CLOB, in base quantums. */
85
+ stepBaseQuantums: Long;
86
+ /**
87
+ * Defines the tick size of the orderbook by defining how many subticks
88
+ * are in one tick. That is, the subticks of any valid order must be a
89
+ * multiple of this value. Generally this value should start `>= 100`to
90
+ * allow room for decreasing it.
91
+ */
92
+ subticksPerTick: number;
93
+ /**
94
+ * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum
95
+ * per Subtick.
96
+ */
97
+ quantumConversionExponent: number;
98
+ status: ClobPair_Status;
99
+ }
100
+ /**
101
+ * ClobPair represents a single CLOB pair for a given product
102
+ * in state.
103
+ */
104
+ export interface ClobPairSDKType {
105
+ id: number;
106
+ perpetual_clob_metadata?: PerpetualClobMetadataSDKType;
107
+ spot_clob_metadata?: SpotClobMetadataSDKType;
108
+ step_base_quantums: Long;
109
+ subticks_per_tick: number;
110
+ quantum_conversion_exponent: number;
111
+ status: ClobPair_Status;
112
+ }
113
+ export declare const PerpetualClobMetadata: {
114
+ encode(message: PerpetualClobMetadata, writer?: _m0.Writer): _m0.Writer;
115
+ decode(input: _m0.Reader | Uint8Array, length?: number): PerpetualClobMetadata;
116
+ fromPartial(object: DeepPartial<PerpetualClobMetadata>): PerpetualClobMetadata;
117
+ };
118
+ export declare const SpotClobMetadata: {
119
+ encode(message: SpotClobMetadata, writer?: _m0.Writer): _m0.Writer;
120
+ decode(input: _m0.Reader | Uint8Array, length?: number): SpotClobMetadata;
121
+ fromPartial(object: DeepPartial<SpotClobMetadata>): SpotClobMetadata;
122
+ };
123
+ export declare const ClobPair: {
124
+ encode(message: ClobPair, writer?: _m0.Writer): _m0.Writer;
125
+ decode(input: _m0.Reader | Uint8Array, length?: number): ClobPair;
126
+ fromPartial(object: DeepPartial<ClobPair>): ClobPair;
127
+ };
@@ -0,0 +1,257 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ import _m0 from "protobufjs/minimal.js";
8
+ import { Long } from "../../helpers.js";
9
+ /** Status of the CLOB. */
10
+ export var ClobPair_Status;
11
+ (function (ClobPair_Status) {
12
+ /** STATUS_UNSPECIFIED - Default value. This value is invalid and unused. */
13
+ ClobPair_Status[ClobPair_Status["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED";
14
+ /** STATUS_ACTIVE - STATUS_ACTIVE represents an active clob pair. */
15
+ ClobPair_Status[ClobPair_Status["STATUS_ACTIVE"] = 1] = "STATUS_ACTIVE";
16
+ /**
17
+ * STATUS_PAUSED - STATUS_PAUSED behavior is unfinalized.
18
+ * TODO(DEC-600): update this documentation.
19
+ */
20
+ ClobPair_Status[ClobPair_Status["STATUS_PAUSED"] = 2] = "STATUS_PAUSED";
21
+ /**
22
+ * STATUS_CANCEL_ONLY - STATUS_CANCEL_ONLY behavior is unfinalized.
23
+ * TODO(DEC-600): update this documentation.
24
+ */
25
+ ClobPair_Status[ClobPair_Status["STATUS_CANCEL_ONLY"] = 3] = "STATUS_CANCEL_ONLY";
26
+ /**
27
+ * STATUS_POST_ONLY - STATUS_POST_ONLY behavior is unfinalized.
28
+ * TODO(DEC-600): update this documentation.
29
+ */
30
+ ClobPair_Status[ClobPair_Status["STATUS_POST_ONLY"] = 4] = "STATUS_POST_ONLY";
31
+ /**
32
+ * STATUS_INITIALIZING - STATUS_INITIALIZING represents a newly-added clob pair.
33
+ * Clob pairs in this state only accept orders which are
34
+ * both short-term and post-only.
35
+ */
36
+ ClobPair_Status[ClobPair_Status["STATUS_INITIALIZING"] = 5] = "STATUS_INITIALIZING";
37
+ /**
38
+ * STATUS_FINAL_SETTLEMENT - STATUS_FINAL_SETTLEMENT represents a clob pair which is deactivated
39
+ * and trading has ceased. All open positions will be closed by the
40
+ * protocol. Open stateful orders will be cancelled. Open short-term
41
+ * orders will be left to expire.
42
+ */
43
+ ClobPair_Status[ClobPair_Status["STATUS_FINAL_SETTLEMENT"] = 6] = "STATUS_FINAL_SETTLEMENT";
44
+ ClobPair_Status[ClobPair_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
45
+ })(ClobPair_Status || (ClobPair_Status = {}));
46
+ export const ClobPair_StatusSDKType = ClobPair_Status;
47
+ export function clobPair_StatusFromJSON(object) {
48
+ switch (object) {
49
+ case 0:
50
+ case "STATUS_UNSPECIFIED":
51
+ return ClobPair_Status.STATUS_UNSPECIFIED;
52
+ case 1:
53
+ case "STATUS_ACTIVE":
54
+ return ClobPair_Status.STATUS_ACTIVE;
55
+ case 2:
56
+ case "STATUS_PAUSED":
57
+ return ClobPair_Status.STATUS_PAUSED;
58
+ case 3:
59
+ case "STATUS_CANCEL_ONLY":
60
+ return ClobPair_Status.STATUS_CANCEL_ONLY;
61
+ case 4:
62
+ case "STATUS_POST_ONLY":
63
+ return ClobPair_Status.STATUS_POST_ONLY;
64
+ case 5:
65
+ case "STATUS_INITIALIZING":
66
+ return ClobPair_Status.STATUS_INITIALIZING;
67
+ case 6:
68
+ case "STATUS_FINAL_SETTLEMENT":
69
+ return ClobPair_Status.STATUS_FINAL_SETTLEMENT;
70
+ case -1:
71
+ case "UNRECOGNIZED":
72
+ default:
73
+ return ClobPair_Status.UNRECOGNIZED;
74
+ }
75
+ }
76
+ export function clobPair_StatusToJSON(object) {
77
+ switch (object) {
78
+ case ClobPair_Status.STATUS_UNSPECIFIED:
79
+ return "STATUS_UNSPECIFIED";
80
+ case ClobPair_Status.STATUS_ACTIVE:
81
+ return "STATUS_ACTIVE";
82
+ case ClobPair_Status.STATUS_PAUSED:
83
+ return "STATUS_PAUSED";
84
+ case ClobPair_Status.STATUS_CANCEL_ONLY:
85
+ return "STATUS_CANCEL_ONLY";
86
+ case ClobPair_Status.STATUS_POST_ONLY:
87
+ return "STATUS_POST_ONLY";
88
+ case ClobPair_Status.STATUS_INITIALIZING:
89
+ return "STATUS_INITIALIZING";
90
+ case ClobPair_Status.STATUS_FINAL_SETTLEMENT:
91
+ return "STATUS_FINAL_SETTLEMENT";
92
+ case ClobPair_Status.UNRECOGNIZED:
93
+ default:
94
+ return "UNRECOGNIZED";
95
+ }
96
+ }
97
+ function createBasePerpetualClobMetadata() {
98
+ return {
99
+ perpetualId: 0
100
+ };
101
+ }
102
+ export const PerpetualClobMetadata = {
103
+ encode(message, writer = _m0.Writer.create()) {
104
+ if (message.perpetualId !== 0) {
105
+ writer.uint32(8).uint32(message.perpetualId);
106
+ }
107
+ return writer;
108
+ },
109
+ decode(input, length) {
110
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
111
+ let end = length === undefined ? reader.len : reader.pos + length;
112
+ const message = createBasePerpetualClobMetadata();
113
+ while (reader.pos < end) {
114
+ const tag = reader.uint32();
115
+ switch (tag >>> 3) {
116
+ case 1:
117
+ message.perpetualId = reader.uint32();
118
+ break;
119
+ default:
120
+ reader.skipType(tag & 7);
121
+ break;
122
+ }
123
+ }
124
+ return message;
125
+ },
126
+ fromPartial(object) {
127
+ const message = createBasePerpetualClobMetadata();
128
+ message.perpetualId = object.perpetualId ?? 0;
129
+ return message;
130
+ }
131
+ };
132
+ function createBaseSpotClobMetadata() {
133
+ return {
134
+ baseAssetId: 0,
135
+ quoteAssetId: 0
136
+ };
137
+ }
138
+ export const SpotClobMetadata = {
139
+ encode(message, writer = _m0.Writer.create()) {
140
+ if (message.baseAssetId !== 0) {
141
+ writer.uint32(8).uint32(message.baseAssetId);
142
+ }
143
+ if (message.quoteAssetId !== 0) {
144
+ writer.uint32(16).uint32(message.quoteAssetId);
145
+ }
146
+ return writer;
147
+ },
148
+ decode(input, length) {
149
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
150
+ let end = length === undefined ? reader.len : reader.pos + length;
151
+ const message = createBaseSpotClobMetadata();
152
+ while (reader.pos < end) {
153
+ const tag = reader.uint32();
154
+ switch (tag >>> 3) {
155
+ case 1:
156
+ message.baseAssetId = reader.uint32();
157
+ break;
158
+ case 2:
159
+ message.quoteAssetId = reader.uint32();
160
+ break;
161
+ default:
162
+ reader.skipType(tag & 7);
163
+ break;
164
+ }
165
+ }
166
+ return message;
167
+ },
168
+ fromPartial(object) {
169
+ const message = createBaseSpotClobMetadata();
170
+ message.baseAssetId = object.baseAssetId ?? 0;
171
+ message.quoteAssetId = object.quoteAssetId ?? 0;
172
+ return message;
173
+ }
174
+ };
175
+ function createBaseClobPair() {
176
+ return {
177
+ id: 0,
178
+ perpetualClobMetadata: undefined,
179
+ spotClobMetadata: undefined,
180
+ stepBaseQuantums: Long.UZERO,
181
+ subticksPerTick: 0,
182
+ quantumConversionExponent: 0,
183
+ status: 0
184
+ };
185
+ }
186
+ export const ClobPair = {
187
+ encode(message, writer = _m0.Writer.create()) {
188
+ if (message.id !== 0) {
189
+ writer.uint32(8).uint32(message.id);
190
+ }
191
+ if (message.perpetualClobMetadata !== undefined) {
192
+ PerpetualClobMetadata.encode(message.perpetualClobMetadata, writer.uint32(18).fork()).ldelim();
193
+ }
194
+ if (message.spotClobMetadata !== undefined) {
195
+ SpotClobMetadata.encode(message.spotClobMetadata, writer.uint32(26).fork()).ldelim();
196
+ }
197
+ if (!message.stepBaseQuantums.isZero()) {
198
+ writer.uint32(32).uint64(message.stepBaseQuantums);
199
+ }
200
+ if (message.subticksPerTick !== 0) {
201
+ writer.uint32(40).uint32(message.subticksPerTick);
202
+ }
203
+ if (message.quantumConversionExponent !== 0) {
204
+ writer.uint32(48).sint32(message.quantumConversionExponent);
205
+ }
206
+ if (message.status !== 0) {
207
+ writer.uint32(56).int32(message.status);
208
+ }
209
+ return writer;
210
+ },
211
+ decode(input, length) {
212
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
213
+ let end = length === undefined ? reader.len : reader.pos + length;
214
+ const message = createBaseClobPair();
215
+ while (reader.pos < end) {
216
+ const tag = reader.uint32();
217
+ switch (tag >>> 3) {
218
+ case 1:
219
+ message.id = reader.uint32();
220
+ break;
221
+ case 2:
222
+ message.perpetualClobMetadata = PerpetualClobMetadata.decode(reader, reader.uint32());
223
+ break;
224
+ case 3:
225
+ message.spotClobMetadata = SpotClobMetadata.decode(reader, reader.uint32());
226
+ break;
227
+ case 4:
228
+ message.stepBaseQuantums = reader.uint64();
229
+ break;
230
+ case 5:
231
+ message.subticksPerTick = reader.uint32();
232
+ break;
233
+ case 6:
234
+ message.quantumConversionExponent = reader.sint32();
235
+ break;
236
+ case 7:
237
+ message.status = reader.int32();
238
+ break;
239
+ default:
240
+ reader.skipType(tag & 7);
241
+ break;
242
+ }
243
+ }
244
+ return message;
245
+ },
246
+ fromPartial(object) {
247
+ const message = createBaseClobPair();
248
+ message.id = object.id ?? 0;
249
+ message.perpetualClobMetadata = object.perpetualClobMetadata !== undefined && object.perpetualClobMetadata !== null ? PerpetualClobMetadata.fromPartial(object.perpetualClobMetadata) : undefined;
250
+ message.spotClobMetadata = object.spotClobMetadata !== undefined && object.spotClobMetadata !== null ? SpotClobMetadata.fromPartial(object.spotClobMetadata) : undefined;
251
+ message.stepBaseQuantums = object.stepBaseQuantums !== undefined && object.stepBaseQuantums !== null ? Long.fromValue(object.stepBaseQuantums) : Long.UZERO;
252
+ message.subticksPerTick = object.subticksPerTick ?? 0;
253
+ message.quantumConversionExponent = object.quantumConversionExponent ?? 0;
254
+ message.status = object.status ?? 0;
255
+ return message;
256
+ }
257
+ };
@@ -0,0 +1,48 @@
1
+ import _m0 from "protobufjs/minimal.js";
2
+ import { DeepPartial } from "../../helpers.js";
3
+ /**
4
+ * Defines the set of equity tiers to limit how many open orders
5
+ * a subaccount is allowed to have.
6
+ */
7
+ export interface EquityTierLimitConfiguration {
8
+ /**
9
+ * How many short term stateful orders are allowed per equity tier.
10
+ * Specifying 0 values disables this limit.
11
+ */
12
+ shortTermOrderEquityTiers: EquityTierLimit[];
13
+ /**
14
+ * How many open stateful orders are allowed per equity tier.
15
+ * Specifying 0 values disables this limit.
16
+ */
17
+ statefulOrderEquityTiers: EquityTierLimit[];
18
+ }
19
+ /**
20
+ * Defines the set of equity tiers to limit how many open orders
21
+ * a subaccount is allowed to have.
22
+ */
23
+ export interface EquityTierLimitConfigurationSDKType {
24
+ short_term_order_equity_tiers: EquityTierLimitSDKType[];
25
+ stateful_order_equity_tiers: EquityTierLimitSDKType[];
26
+ }
27
+ /** Defines an equity tier limit. */
28
+ export interface EquityTierLimit {
29
+ /** The total net collateral in USDC quote quantums of equity required. */
30
+ usdTncRequired: Uint8Array;
31
+ /** What the limit is for `usd_tnc_required`. */
32
+ limit: number;
33
+ }
34
+ /** Defines an equity tier limit. */
35
+ export interface EquityTierLimitSDKType {
36
+ usd_tnc_required: Uint8Array;
37
+ limit: number;
38
+ }
39
+ export declare const EquityTierLimitConfiguration: {
40
+ encode(message: EquityTierLimitConfiguration, writer?: _m0.Writer): _m0.Writer;
41
+ decode(input: _m0.Reader | Uint8Array, length?: number): EquityTierLimitConfiguration;
42
+ fromPartial(object: DeepPartial<EquityTierLimitConfiguration>): EquityTierLimitConfiguration;
43
+ };
44
+ export declare const EquityTierLimit: {
45
+ encode(message: EquityTierLimit, writer?: _m0.Writer): _m0.Writer;
46
+ decode(input: _m0.Reader | Uint8Array, length?: number): EquityTierLimit;
47
+ fromPartial(object: DeepPartial<EquityTierLimit>): EquityTierLimit;
48
+ };
@@ -0,0 +1,93 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ import _m0 from "protobufjs/minimal.js";
8
+ function createBaseEquityTierLimitConfiguration() {
9
+ return {
10
+ shortTermOrderEquityTiers: [],
11
+ statefulOrderEquityTiers: []
12
+ };
13
+ }
14
+ export const EquityTierLimitConfiguration = {
15
+ encode(message, writer = _m0.Writer.create()) {
16
+ for (const v of message.shortTermOrderEquityTiers) {
17
+ EquityTierLimit.encode(v, writer.uint32(10).fork()).ldelim();
18
+ }
19
+ for (const v of message.statefulOrderEquityTiers) {
20
+ EquityTierLimit.encode(v, writer.uint32(18).fork()).ldelim();
21
+ }
22
+ return writer;
23
+ },
24
+ decode(input, length) {
25
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
26
+ let end = length === undefined ? reader.len : reader.pos + length;
27
+ const message = createBaseEquityTierLimitConfiguration();
28
+ while (reader.pos < end) {
29
+ const tag = reader.uint32();
30
+ switch (tag >>> 3) {
31
+ case 1:
32
+ message.shortTermOrderEquityTiers.push(EquityTierLimit.decode(reader, reader.uint32()));
33
+ break;
34
+ case 2:
35
+ message.statefulOrderEquityTiers.push(EquityTierLimit.decode(reader, reader.uint32()));
36
+ break;
37
+ default:
38
+ reader.skipType(tag & 7);
39
+ break;
40
+ }
41
+ }
42
+ return message;
43
+ },
44
+ fromPartial(object) {
45
+ const message = createBaseEquityTierLimitConfiguration();
46
+ message.shortTermOrderEquityTiers = object.shortTermOrderEquityTiers?.map(e => EquityTierLimit.fromPartial(e)) || [];
47
+ message.statefulOrderEquityTiers = object.statefulOrderEquityTiers?.map(e => EquityTierLimit.fromPartial(e)) || [];
48
+ return message;
49
+ }
50
+ };
51
+ function createBaseEquityTierLimit() {
52
+ return {
53
+ usdTncRequired: new Uint8Array(),
54
+ limit: 0
55
+ };
56
+ }
57
+ export const EquityTierLimit = {
58
+ encode(message, writer = _m0.Writer.create()) {
59
+ if (message.usdTncRequired.length !== 0) {
60
+ writer.uint32(10).bytes(message.usdTncRequired);
61
+ }
62
+ if (message.limit !== 0) {
63
+ writer.uint32(16).uint32(message.limit);
64
+ }
65
+ return writer;
66
+ },
67
+ decode(input, length) {
68
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
69
+ let end = length === undefined ? reader.len : reader.pos + length;
70
+ const message = createBaseEquityTierLimit();
71
+ while (reader.pos < end) {
72
+ const tag = reader.uint32();
73
+ switch (tag >>> 3) {
74
+ case 1:
75
+ message.usdTncRequired = reader.bytes();
76
+ break;
77
+ case 2:
78
+ message.limit = reader.uint32();
79
+ break;
80
+ default:
81
+ reader.skipType(tag & 7);
82
+ break;
83
+ }
84
+ }
85
+ return message;
86
+ },
87
+ fromPartial(object) {
88
+ const message = createBaseEquityTierLimit();
89
+ message.usdTncRequired = object.usdTncRequired ?? new Uint8Array();
90
+ message.limit = object.limit ?? 0;
91
+ return message;
92
+ }
93
+ };
@@ -0,0 +1,23 @@
1
+ import { ClobPair, ClobPairSDKType } from "./clob_pair.js";
2
+ import _m0 from "protobufjs/minimal.js";
3
+ import { DeepPartial } from "../../helpers.js";
4
+ /**
5
+ * ClobStagedFinalizeBlockEvent defines a CLOB event staged during
6
+ * FinalizeBlock.
7
+ */
8
+ export interface ClobStagedFinalizeBlockEvent {
9
+ /** create_clob_pair indicates a new CLOB pair creation. */
10
+ createClobPair?: ClobPair;
11
+ }
12
+ /**
13
+ * ClobStagedFinalizeBlockEvent defines a CLOB event staged during
14
+ * FinalizeBlock.
15
+ */
16
+ export interface ClobStagedFinalizeBlockEventSDKType {
17
+ create_clob_pair?: ClobPairSDKType;
18
+ }
19
+ export declare const ClobStagedFinalizeBlockEvent: {
20
+ encode(message: ClobStagedFinalizeBlockEvent, writer?: _m0.Writer): _m0.Writer;
21
+ decode(input: _m0.Reader | Uint8Array, length?: number): ClobStagedFinalizeBlockEvent;
22
+ fromPartial(object: DeepPartial<ClobStagedFinalizeBlockEvent>): ClobStagedFinalizeBlockEvent;
23
+ };
@@ -0,0 +1,43 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ import { ClobPair } from "./clob_pair.js";
8
+ import _m0 from "protobufjs/minimal.js";
9
+ function createBaseClobStagedFinalizeBlockEvent() {
10
+ return {
11
+ createClobPair: undefined
12
+ };
13
+ }
14
+ export const ClobStagedFinalizeBlockEvent = {
15
+ encode(message, writer = _m0.Writer.create()) {
16
+ if (message.createClobPair !== undefined) {
17
+ ClobPair.encode(message.createClobPair, writer.uint32(10).fork()).ldelim();
18
+ }
19
+ return writer;
20
+ },
21
+ decode(input, length) {
22
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
23
+ let end = length === undefined ? reader.len : reader.pos + length;
24
+ const message = createBaseClobStagedFinalizeBlockEvent();
25
+ while (reader.pos < end) {
26
+ const tag = reader.uint32();
27
+ switch (tag >>> 3) {
28
+ case 1:
29
+ message.createClobPair = ClobPair.decode(reader, reader.uint32());
30
+ break;
31
+ default:
32
+ reader.skipType(tag & 7);
33
+ break;
34
+ }
35
+ }
36
+ return message;
37
+ },
38
+ fromPartial(object) {
39
+ const message = createBaseClobStagedFinalizeBlockEvent();
40
+ message.createClobPair = object.createClobPair !== undefined && object.createClobPair !== null ? ClobPair.fromPartial(object.createClobPair) : undefined;
41
+ return message;
42
+ }
43
+ };
@@ -0,0 +1,92 @@
1
+ import { SubaccountId, SubaccountIdSDKType } from "../subaccounts/subaccount.js";
2
+ import * as _m0 from "protobufjs/minimal.js";
3
+ import { DeepPartial } from "../../helpers.js";
4
+ /**
5
+ * PerpetualLiquidationInfo holds information about a liquidation that occurred
6
+ * for a position held by a subaccount.
7
+ * Note this proto is defined to make it easier to hash
8
+ * the metadata of a liquidation, and is never written to state.
9
+ */
10
+ export interface PerpetualLiquidationInfo {
11
+ /**
12
+ * The id of the subaccount that got liquidated/deleveraged or was deleveraged
13
+ * onto.
14
+ */
15
+ subaccountId?: SubaccountId;
16
+ /** The id of the perpetual involved. */
17
+ perpetualId: number;
18
+ }
19
+ /**
20
+ * PerpetualLiquidationInfo holds information about a liquidation that occurred
21
+ * for a position held by a subaccount.
22
+ * Note this proto is defined to make it easier to hash
23
+ * the metadata of a liquidation, and is never written to state.
24
+ */
25
+ export interface PerpetualLiquidationInfoSDKType {
26
+ subaccount_id?: SubaccountIdSDKType;
27
+ perpetual_id: number;
28
+ }
29
+ /**
30
+ * SubaccountLiquidationInfo holds liquidation information per-subaccount in the
31
+ * current block.
32
+ */
33
+ export interface SubaccountLiquidationInfo {
34
+ /**
35
+ * An unsorted list of unique perpetual IDs that the subaccount has previously
36
+ * liquidated.
37
+ */
38
+ perpetualsLiquidated: number[];
39
+ /**
40
+ * The notional value (in quote quantums, determined by the oracle price) of
41
+ * all positions liquidated for this subaccount.
42
+ */
43
+ notionalLiquidated: Long;
44
+ /**
45
+ * The amount of funds that the insurance fund has lost
46
+ * covering this subaccount.
47
+ */
48
+ quantumsInsuranceLost: Long;
49
+ }
50
+ /**
51
+ * SubaccountLiquidationInfo holds liquidation information per-subaccount in the
52
+ * current block.
53
+ */
54
+ export interface SubaccountLiquidationInfoSDKType {
55
+ perpetuals_liquidated: number[];
56
+ notional_liquidated: Long;
57
+ quantums_insurance_lost: Long;
58
+ }
59
+ /**
60
+ * SubaccountOpenPositionInfo holds information about open positions for a
61
+ * perpetual.
62
+ */
63
+ export interface SubaccountOpenPositionInfo {
64
+ /** The id of the perpetual. */
65
+ perpetualId: number;
66
+ subaccountsWithLongPosition: SubaccountId[];
67
+ subaccountsWithShortPosition: SubaccountId[];
68
+ }
69
+ /**
70
+ * SubaccountOpenPositionInfo holds information about open positions for a
71
+ * perpetual.
72
+ */
73
+ export interface SubaccountOpenPositionInfoSDKType {
74
+ perpetual_id: number;
75
+ subaccounts_with_long_position: SubaccountIdSDKType[];
76
+ subaccounts_with_short_position: SubaccountIdSDKType[];
77
+ }
78
+ export declare const PerpetualLiquidationInfo: {
79
+ encode(message: PerpetualLiquidationInfo, writer?: _m0.Writer): _m0.Writer;
80
+ decode(input: _m0.Reader | Uint8Array, length?: number): PerpetualLiquidationInfo;
81
+ fromPartial(object: DeepPartial<PerpetualLiquidationInfo>): PerpetualLiquidationInfo;
82
+ };
83
+ export declare const SubaccountLiquidationInfo: {
84
+ encode(message: SubaccountLiquidationInfo, writer?: _m0.Writer): _m0.Writer;
85
+ decode(input: _m0.Reader | Uint8Array, length?: number): SubaccountLiquidationInfo;
86
+ fromPartial(object: DeepPartial<SubaccountLiquidationInfo>): SubaccountLiquidationInfo;
87
+ };
88
+ export declare const SubaccountOpenPositionInfo: {
89
+ encode(message: SubaccountOpenPositionInfo, writer?: _m0.Writer): _m0.Writer;
90
+ decode(input: _m0.Reader | Uint8Array, length?: number): SubaccountOpenPositionInfo;
91
+ fromPartial(object: DeepPartial<SubaccountOpenPositionInfo>): SubaccountOpenPositionInfo;
92
+ };