ccxt 4.2.60 → 4.2.61

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 (158) hide show
  1. package/README.md +103 -102
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +107943 -100121
  4. package/dist/ccxt.browser.min.js +7 -7
  5. package/dist/cjs/ccxt.js +4 -1
  6. package/dist/cjs/src/abstract/hyperliquid.js +9 -0
  7. package/dist/cjs/src/base/Exchange.js +22 -1
  8. package/dist/cjs/src/base/functions/encode.js +5 -0
  9. package/dist/cjs/src/base/functions.js +1 -0
  10. package/dist/cjs/src/bitfinex2.js +1 -1
  11. package/dist/cjs/src/coinbase.js +108 -103
  12. package/dist/cjs/src/coinex.js +61 -1
  13. package/dist/cjs/src/hyperliquid.js +2035 -0
  14. package/dist/cjs/src/kraken.js +8 -2
  15. package/dist/cjs/src/krakenfutures.js +28 -0
  16. package/dist/cjs/src/kucoinfutures.js +2 -2
  17. package/dist/cjs/src/okx.js +1 -1
  18. package/dist/cjs/src/phemex.js +2 -2
  19. package/dist/cjs/src/pro/bingx.js +1 -0
  20. package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +158 -0
  21. package/dist/cjs/src/static_dependencies/ethers/address/address.js +144 -0
  22. package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +407 -0
  23. package/dist/cjs/src/static_dependencies/ethers/coders/address.js +45 -0
  24. package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +28 -0
  25. package/dist/cjs/src/static_dependencies/ethers/coders/array.js +176 -0
  26. package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +27 -0
  27. package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +52 -0
  28. package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +45 -0
  29. package/dist/cjs/src/static_dependencies/ethers/coders/null.js +30 -0
  30. package/dist/cjs/src/static_dependencies/ethers/coders/number.js +60 -0
  31. package/dist/cjs/src/static_dependencies/ethers/coders/string.js +27 -0
  32. package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +68 -0
  33. package/dist/cjs/src/static_dependencies/ethers/fragments.js +614 -0
  34. package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +492 -0
  35. package/dist/cjs/src/static_dependencies/ethers/index.js +35 -0
  36. package/dist/cjs/src/static_dependencies/ethers/interface.js +44 -0
  37. package/dist/cjs/src/static_dependencies/ethers/typed.js +618 -0
  38. package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +20 -0
  39. package/dist/cjs/src/static_dependencies/ethers/utils/data.js +134 -0
  40. package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +228 -0
  41. package/dist/cjs/src/static_dependencies/ethers/utils/events.js +13 -0
  42. package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +29 -0
  43. package/dist/cjs/src/static_dependencies/ethers/utils/index.js +53 -0
  44. package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +231 -0
  45. package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +47 -0
  46. package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +218 -0
  47. package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +292 -0
  48. package/dist/cjs/src/tokocrypto.js +22 -2
  49. package/dist/cjs/src/wazirx.js +308 -3
  50. package/js/ccxt.d.ts +5 -2
  51. package/js/ccxt.js +4 -2
  52. package/js/src/abstract/coinbase.d.ts +3 -3
  53. package/js/src/abstract/hyperliquid.d.ts +9 -0
  54. package/js/src/abstract/hyperliquid.js +11 -0
  55. package/js/src/base/Exchange.d.ts +4 -0
  56. package/js/src/base/Exchange.js +13 -1
  57. package/js/src/base/functions/encode.d.ts +2 -1
  58. package/js/src/base/functions/encode.js +5 -1
  59. package/js/src/bitfinex2.js +1 -1
  60. package/js/src/coinbase.js +108 -103
  61. package/js/src/coinex.d.ts +3 -1
  62. package/js/src/coinex.js +61 -1
  63. package/js/src/hyperliquid.d.ts +83 -0
  64. package/js/src/hyperliquid.js +2036 -0
  65. package/js/src/kraken.js +8 -2
  66. package/js/src/krakenfutures.d.ts +2 -1
  67. package/js/src/krakenfutures.js +28 -0
  68. package/js/src/kucoinfutures.js +2 -2
  69. package/js/src/okx.js +1 -1
  70. package/js/src/phemex.js +2 -2
  71. package/js/src/pro/bingx.js +1 -0
  72. package/js/src/static_dependencies/ethers/abi-coder.d.ts +50 -0
  73. package/js/src/static_dependencies/ethers/abi-coder.js +148 -0
  74. package/js/src/static_dependencies/ethers/address/address.d.ts +55 -0
  75. package/js/src/static_dependencies/ethers/address/address.js +162 -0
  76. package/js/src/static_dependencies/ethers/address/checks.d.ts +80 -0
  77. package/js/src/static_dependencies/ethers/address/checks.js +119 -0
  78. package/js/src/static_dependencies/ethers/address/contract-address.d.ts +47 -0
  79. package/js/src/static_dependencies/ethers/address/contract-address.js +73 -0
  80. package/js/src/static_dependencies/ethers/address/index.d.ts +48 -0
  81. package/js/src/static_dependencies/ethers/address/index.js +24 -0
  82. package/js/src/static_dependencies/ethers/bytes32.d.ts +14 -0
  83. package/js/src/static_dependencies/ethers/bytes32.js +45 -0
  84. package/js/src/static_dependencies/ethers/coders/abstract-coder.d.ts +120 -0
  85. package/js/src/static_dependencies/ethers/coders/abstract-coder.js +424 -0
  86. package/js/src/static_dependencies/ethers/coders/address.d.ts +12 -0
  87. package/js/src/static_dependencies/ethers/coders/address.js +34 -0
  88. package/js/src/static_dependencies/ethers/coders/anonymous.d.ts +14 -0
  89. package/js/src/static_dependencies/ethers/coders/anonymous.js +27 -0
  90. package/js/src/static_dependencies/ethers/coders/array.d.ts +24 -0
  91. package/js/src/static_dependencies/ethers/coders/array.js +162 -0
  92. package/js/src/static_dependencies/ethers/coders/boolean.d.ts +12 -0
  93. package/js/src/static_dependencies/ethers/coders/boolean.js +26 -0
  94. package/js/src/static_dependencies/ethers/coders/bytes.d.ts +18 -0
  95. package/js/src/static_dependencies/ethers/coders/bytes.js +39 -0
  96. package/js/src/static_dependencies/ethers/coders/fixed-bytes.d.ts +14 -0
  97. package/js/src/static_dependencies/ethers/coders/fixed-bytes.js +32 -0
  98. package/js/src/static_dependencies/ethers/coders/null.d.ts +11 -0
  99. package/js/src/static_dependencies/ethers/coders/null.js +29 -0
  100. package/js/src/static_dependencies/ethers/coders/number.d.ts +15 -0
  101. package/js/src/static_dependencies/ethers/coders/number.js +48 -0
  102. package/js/src/static_dependencies/ethers/coders/string.d.ts +12 -0
  103. package/js/src/static_dependencies/ethers/coders/string.js +26 -0
  104. package/js/src/static_dependencies/ethers/coders/tuple.d.ts +15 -0
  105. package/js/src/static_dependencies/ethers/coders/tuple.js +67 -0
  106. package/js/src/static_dependencies/ethers/fragments.d.ts +458 -0
  107. package/js/src/static_dependencies/ethers/fragments.js +1252 -0
  108. package/js/src/static_dependencies/ethers/hash/index.d.ts +10 -0
  109. package/js/src/static_dependencies/ethers/hash/index.js +15 -0
  110. package/js/src/static_dependencies/ethers/hash/solidity.d.ts +30 -0
  111. package/js/src/static_dependencies/ethers/hash/solidity.js +107 -0
  112. package/js/src/static_dependencies/ethers/hash/typed-data.d.ts +144 -0
  113. package/js/src/static_dependencies/ethers/hash/typed-data.js +490 -0
  114. package/js/src/static_dependencies/ethers/index.d.ts +19 -0
  115. package/js/src/static_dependencies/ethers/index.js +22 -0
  116. package/js/src/static_dependencies/ethers/interface.d.ts +380 -0
  117. package/js/src/static_dependencies/ethers/interface.js +990 -0
  118. package/js/src/static_dependencies/ethers/typed.d.ts +569 -0
  119. package/js/src/static_dependencies/ethers/typed.js +608 -0
  120. package/js/src/static_dependencies/ethers/utils/base58.d.ts +22 -0
  121. package/js/src/static_dependencies/ethers/utils/base58.js +68 -0
  122. package/js/src/static_dependencies/ethers/utils/base64-browser.d.ts +3 -0
  123. package/js/src/static_dependencies/ethers/utils/base64-browser.js +24 -0
  124. package/js/src/static_dependencies/ethers/utils/base64.d.ts +39 -0
  125. package/js/src/static_dependencies/ethers/utils/base64.js +58 -0
  126. package/js/src/static_dependencies/ethers/utils/data.d.ts +92 -0
  127. package/js/src/static_dependencies/ethers/utils/data.js +175 -0
  128. package/js/src/static_dependencies/ethers/utils/errors.d.ts +509 -0
  129. package/js/src/static_dependencies/ethers/utils/errors.js +227 -0
  130. package/js/src/static_dependencies/ethers/utils/events.d.ts +76 -0
  131. package/js/src/static_dependencies/ethers/utils/events.js +52 -0
  132. package/js/src/static_dependencies/ethers/utils/fixednumber.d.ts +251 -0
  133. package/js/src/static_dependencies/ethers/utils/fixednumber.js +529 -0
  134. package/js/src/static_dependencies/ethers/utils/index.d.ts +30 -0
  135. package/js/src/static_dependencies/ethers/utils/index.js +38 -0
  136. package/js/src/static_dependencies/ethers/utils/maths.d.ts +65 -0
  137. package/js/src/static_dependencies/ethers/utils/maths.js +220 -0
  138. package/js/src/static_dependencies/ethers/utils/properties.d.ts +22 -0
  139. package/js/src/static_dependencies/ethers/utils/properties.js +59 -0
  140. package/js/src/static_dependencies/ethers/utils/rlp-decode.d.ts +5 -0
  141. package/js/src/static_dependencies/ethers/utils/rlp-decode.js +84 -0
  142. package/js/src/static_dependencies/ethers/utils/rlp-encode.d.ts +5 -0
  143. package/js/src/static_dependencies/ethers/utils/rlp-encode.js +54 -0
  144. package/js/src/static_dependencies/ethers/utils/rlp.d.ts +16 -0
  145. package/js/src/static_dependencies/ethers/utils/rlp.js +14 -0
  146. package/js/src/static_dependencies/ethers/utils/units.d.ts +23 -0
  147. package/js/src/static_dependencies/ethers/utils/units.js +88 -0
  148. package/js/src/static_dependencies/ethers/utils/utf8.d.ts +95 -0
  149. package/js/src/static_dependencies/ethers/utils/utf8.js +225 -0
  150. package/js/src/static_dependencies/ethers/utils/uuid.d.ts +7 -0
  151. package/js/src/static_dependencies/ethers/utils/uuid.js +35 -0
  152. package/js/src/static_dependencies/messagepack/msgpack.d.ts +2 -0
  153. package/js/src/static_dependencies/messagepack/msgpack.js +572 -0
  154. package/js/src/tokocrypto.js +22 -2
  155. package/js/src/wazirx.d.ts +12 -1
  156. package/js/src/wazirx.js +308 -3
  157. package/package.json +1 -1
  158. package/skip-tests.json +18 -0
@@ -0,0 +1,608 @@
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
+ /**
8
+ * A Typed object allows a value to have its type explicitly
9
+ * specified.
10
+ *
11
+ * For example, in Solidity, the value ``45`` could represent a
12
+ * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent
13
+ * a ``bytes2`` or ``bytes``.
14
+ *
15
+ * Since JavaScript has no meaningful way to explicitly inform any
16
+ * APIs which what the type is, this allows transparent interoperation
17
+ * with Soldity.
18
+ *
19
+ * @_subsection: api/abi:Typed Values
20
+ */
21
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
22
+ if (kind === "m") throw new TypeError("Private method is not writable");
23
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
24
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
25
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
26
+ };
27
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
28
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
29
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
30
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
31
+ };
32
+ var _Typed_options;
33
+ import { defineProperties } from "./utils/index.js";
34
+ const _gaurd = {};
35
+ function n(value, width) {
36
+ let signed = false;
37
+ if (width < 0) {
38
+ signed = true;
39
+ width *= -1;
40
+ }
41
+ // @TODO: Check range is valid for value
42
+ return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width });
43
+ }
44
+ function b(value, size) {
45
+ // @TODO: Check range is valid for value
46
+ return new Typed(_gaurd, `bytes${(size) ? size : ""}`, value, { size });
47
+ }
48
+ const _typedSymbol = Symbol.for("_ethers_typed");
49
+ /**
50
+ * The **Typed** class to wrap values providing explicit type information.
51
+ */
52
+ export class Typed {
53
+ /**
54
+ * @_ignore:
55
+ */
56
+ constructor(gaurd, type, value, options) {
57
+ _Typed_options.set(this, void 0);
58
+ if (options == null) {
59
+ options = null;
60
+ }
61
+ // assertPrivate(_gaurd, gaurd, "Typed");
62
+ defineProperties(this, { _typedSymbol, type, value });
63
+ __classPrivateFieldSet(this, _Typed_options, options, "f");
64
+ // Check the value is valid
65
+ this.format();
66
+ }
67
+ /**
68
+ * Format the type as a Human-Readable type.
69
+ */
70
+ format() {
71
+ if (this.type === "array") {
72
+ throw new Error("");
73
+ }
74
+ else if (this.type === "dynamicArray") {
75
+ throw new Error("");
76
+ }
77
+ else if (this.type === "tuple") {
78
+ return `tuple(${this.value.map((v) => v.format()).join(",")})`;
79
+ }
80
+ return this.type;
81
+ }
82
+ /**
83
+ * The default value returned by this type.
84
+ */
85
+ defaultValue() {
86
+ return 0;
87
+ }
88
+ /**
89
+ * The minimum value for numeric types.
90
+ */
91
+ minValue() {
92
+ return 0;
93
+ }
94
+ /**
95
+ * The maximum value for numeric types.
96
+ */
97
+ maxValue() {
98
+ return 0;
99
+ }
100
+ /**
101
+ * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].
102
+ */
103
+ isBigInt() {
104
+ return !!(this.type.match(/^u?int[0-9]+$/));
105
+ }
106
+ /**
107
+ * Returns ``true`` and provides a type guard is this is a [[TypedData]].
108
+ */
109
+ isData() {
110
+ return this.type.startsWith("bytes");
111
+ }
112
+ /**
113
+ * Returns ``true`` and provides a type guard is this is a [[TypedString]].
114
+ */
115
+ isString() {
116
+ return (this.type === "string");
117
+ }
118
+ /**
119
+ * Returns the tuple name, if this is a tuple. Throws otherwise.
120
+ */
121
+ get tupleName() {
122
+ if (this.type !== "tuple") {
123
+ throw TypeError("not a tuple");
124
+ }
125
+ return __classPrivateFieldGet(this, _Typed_options, "f");
126
+ }
127
+ // Returns the length of this type as an array
128
+ // - `null` indicates the length is unforced, it could be dynamic
129
+ // - `-1` indicates the length is dynamic
130
+ // - any other value indicates it is a static array and is its length
131
+ /**
132
+ * Returns the length of the array type or ``-1`` if it is dynamic.
133
+ *
134
+ * Throws if the type is not an array.
135
+ */
136
+ get arrayLength() {
137
+ if (this.type !== "array") {
138
+ throw TypeError("not an array");
139
+ }
140
+ if (__classPrivateFieldGet(this, _Typed_options, "f") === true) {
141
+ return -1;
142
+ }
143
+ if (__classPrivateFieldGet(this, _Typed_options, "f") === false) {
144
+ return (this.value).length;
145
+ }
146
+ return null;
147
+ }
148
+ /**
149
+ * Returns a new **Typed** of %%type%% with the %%value%%.
150
+ */
151
+ static from(type, value) {
152
+ return new Typed(_gaurd, type, value);
153
+ }
154
+ /**
155
+ * Return a new ``uint8`` type for %%v%%.
156
+ */
157
+ static uint8(v) { return n(v, 8); }
158
+ /**
159
+ * Return a new ``uint16`` type for %%v%%.
160
+ */
161
+ static uint16(v) { return n(v, 16); }
162
+ /**
163
+ * Return a new ``uint24`` type for %%v%%.
164
+ */
165
+ static uint24(v) { return n(v, 24); }
166
+ /**
167
+ * Return a new ``uint32`` type for %%v%%.
168
+ */
169
+ static uint32(v) { return n(v, 32); }
170
+ /**
171
+ * Return a new ``uint40`` type for %%v%%.
172
+ */
173
+ static uint40(v) { return n(v, 40); }
174
+ /**
175
+ * Return a new ``uint48`` type for %%v%%.
176
+ */
177
+ static uint48(v) { return n(v, 48); }
178
+ /**
179
+ * Return a new ``uint56`` type for %%v%%.
180
+ */
181
+ static uint56(v) { return n(v, 56); }
182
+ /**
183
+ * Return a new ``uint64`` type for %%v%%.
184
+ */
185
+ static uint64(v) { return n(v, 64); }
186
+ /**
187
+ * Return a new ``uint72`` type for %%v%%.
188
+ */
189
+ static uint72(v) { return n(v, 72); }
190
+ /**
191
+ * Return a new ``uint80`` type for %%v%%.
192
+ */
193
+ static uint80(v) { return n(v, 80); }
194
+ /**
195
+ * Return a new ``uint88`` type for %%v%%.
196
+ */
197
+ static uint88(v) { return n(v, 88); }
198
+ /**
199
+ * Return a new ``uint96`` type for %%v%%.
200
+ */
201
+ static uint96(v) { return n(v, 96); }
202
+ /**
203
+ * Return a new ``uint104`` type for %%v%%.
204
+ */
205
+ static uint104(v) { return n(v, 104); }
206
+ /**
207
+ * Return a new ``uint112`` type for %%v%%.
208
+ */
209
+ static uint112(v) { return n(v, 112); }
210
+ /**
211
+ * Return a new ``uint120`` type for %%v%%.
212
+ */
213
+ static uint120(v) { return n(v, 120); }
214
+ /**
215
+ * Return a new ``uint128`` type for %%v%%.
216
+ */
217
+ static uint128(v) { return n(v, 128); }
218
+ /**
219
+ * Return a new ``uint136`` type for %%v%%.
220
+ */
221
+ static uint136(v) { return n(v, 136); }
222
+ /**
223
+ * Return a new ``uint144`` type for %%v%%.
224
+ */
225
+ static uint144(v) { return n(v, 144); }
226
+ /**
227
+ * Return a new ``uint152`` type for %%v%%.
228
+ */
229
+ static uint152(v) { return n(v, 152); }
230
+ /**
231
+ * Return a new ``uint160`` type for %%v%%.
232
+ */
233
+ static uint160(v) { return n(v, 160); }
234
+ /**
235
+ * Return a new ``uint168`` type for %%v%%.
236
+ */
237
+ static uint168(v) { return n(v, 168); }
238
+ /**
239
+ * Return a new ``uint176`` type for %%v%%.
240
+ */
241
+ static uint176(v) { return n(v, 176); }
242
+ /**
243
+ * Return a new ``uint184`` type for %%v%%.
244
+ */
245
+ static uint184(v) { return n(v, 184); }
246
+ /**
247
+ * Return a new ``uint192`` type for %%v%%.
248
+ */
249
+ static uint192(v) { return n(v, 192); }
250
+ /**
251
+ * Return a new ``uint200`` type for %%v%%.
252
+ */
253
+ static uint200(v) { return n(v, 200); }
254
+ /**
255
+ * Return a new ``uint208`` type for %%v%%.
256
+ */
257
+ static uint208(v) { return n(v, 208); }
258
+ /**
259
+ * Return a new ``uint216`` type for %%v%%.
260
+ */
261
+ static uint216(v) { return n(v, 216); }
262
+ /**
263
+ * Return a new ``uint224`` type for %%v%%.
264
+ */
265
+ static uint224(v) { return n(v, 224); }
266
+ /**
267
+ * Return a new ``uint232`` type for %%v%%.
268
+ */
269
+ static uint232(v) { return n(v, 232); }
270
+ /**
271
+ * Return a new ``uint240`` type for %%v%%.
272
+ */
273
+ static uint240(v) { return n(v, 240); }
274
+ /**
275
+ * Return a new ``uint248`` type for %%v%%.
276
+ */
277
+ static uint248(v) { return n(v, 248); }
278
+ /**
279
+ * Return a new ``uint256`` type for %%v%%.
280
+ */
281
+ static uint256(v) { return n(v, 256); }
282
+ /**
283
+ * Return a new ``uint256`` type for %%v%%.
284
+ */
285
+ static uint(v) { return n(v, 256); }
286
+ /**
287
+ * Return a new ``int8`` type for %%v%%.
288
+ */
289
+ static int8(v) { return n(v, -8); }
290
+ /**
291
+ * Return a new ``int16`` type for %%v%%.
292
+ */
293
+ static int16(v) { return n(v, -16); }
294
+ /**
295
+ * Return a new ``int24`` type for %%v%%.
296
+ */
297
+ static int24(v) { return n(v, -24); }
298
+ /**
299
+ * Return a new ``int32`` type for %%v%%.
300
+ */
301
+ static int32(v) { return n(v, -32); }
302
+ /**
303
+ * Return a new ``int40`` type for %%v%%.
304
+ */
305
+ static int40(v) { return n(v, -40); }
306
+ /**
307
+ * Return a new ``int48`` type for %%v%%.
308
+ */
309
+ static int48(v) { return n(v, -48); }
310
+ /**
311
+ * Return a new ``int56`` type for %%v%%.
312
+ */
313
+ static int56(v) { return n(v, -56); }
314
+ /**
315
+ * Return a new ``int64`` type for %%v%%.
316
+ */
317
+ static int64(v) { return n(v, -64); }
318
+ /**
319
+ * Return a new ``int72`` type for %%v%%.
320
+ */
321
+ static int72(v) { return n(v, -72); }
322
+ /**
323
+ * Return a new ``int80`` type for %%v%%.
324
+ */
325
+ static int80(v) { return n(v, -80); }
326
+ /**
327
+ * Return a new ``int88`` type for %%v%%.
328
+ */
329
+ static int88(v) { return n(v, -88); }
330
+ /**
331
+ * Return a new ``int96`` type for %%v%%.
332
+ */
333
+ static int96(v) { return n(v, -96); }
334
+ /**
335
+ * Return a new ``int104`` type for %%v%%.
336
+ */
337
+ static int104(v) { return n(v, -104); }
338
+ /**
339
+ * Return a new ``int112`` type for %%v%%.
340
+ */
341
+ static int112(v) { return n(v, -112); }
342
+ /**
343
+ * Return a new ``int120`` type for %%v%%.
344
+ */
345
+ static int120(v) { return n(v, -120); }
346
+ /**
347
+ * Return a new ``int128`` type for %%v%%.
348
+ */
349
+ static int128(v) { return n(v, -128); }
350
+ /**
351
+ * Return a new ``int136`` type for %%v%%.
352
+ */
353
+ static int136(v) { return n(v, -136); }
354
+ /**
355
+ * Return a new ``int144`` type for %%v%%.
356
+ */
357
+ static int144(v) { return n(v, -144); }
358
+ /**
359
+ * Return a new ``int52`` type for %%v%%.
360
+ */
361
+ static int152(v) { return n(v, -152); }
362
+ /**
363
+ * Return a new ``int160`` type for %%v%%.
364
+ */
365
+ static int160(v) { return n(v, -160); }
366
+ /**
367
+ * Return a new ``int168`` type for %%v%%.
368
+ */
369
+ static int168(v) { return n(v, -168); }
370
+ /**
371
+ * Return a new ``int176`` type for %%v%%.
372
+ */
373
+ static int176(v) { return n(v, -176); }
374
+ /**
375
+ * Return a new ``int184`` type for %%v%%.
376
+ */
377
+ static int184(v) { return n(v, -184); }
378
+ /**
379
+ * Return a new ``int92`` type for %%v%%.
380
+ */
381
+ static int192(v) { return n(v, -192); }
382
+ /**
383
+ * Return a new ``int200`` type for %%v%%.
384
+ */
385
+ static int200(v) { return n(v, -200); }
386
+ /**
387
+ * Return a new ``int208`` type for %%v%%.
388
+ */
389
+ static int208(v) { return n(v, -208); }
390
+ /**
391
+ * Return a new ``int216`` type for %%v%%.
392
+ */
393
+ static int216(v) { return n(v, -216); }
394
+ /**
395
+ * Return a new ``int224`` type for %%v%%.
396
+ */
397
+ static int224(v) { return n(v, -224); }
398
+ /**
399
+ * Return a new ``int232`` type for %%v%%.
400
+ */
401
+ static int232(v) { return n(v, -232); }
402
+ /**
403
+ * Return a new ``int240`` type for %%v%%.
404
+ */
405
+ static int240(v) { return n(v, -240); }
406
+ /**
407
+ * Return a new ``int248`` type for %%v%%.
408
+ */
409
+ static int248(v) { return n(v, -248); }
410
+ /**
411
+ * Return a new ``int256`` type for %%v%%.
412
+ */
413
+ static int256(v) { return n(v, -256); }
414
+ /**
415
+ * Return a new ``int256`` type for %%v%%.
416
+ */
417
+ static int(v) { return n(v, -256); }
418
+ /**
419
+ * Return a new ``bytes1`` type for %%v%%.
420
+ */
421
+ static bytes1(v) { return b(v, 1); }
422
+ /**
423
+ * Return a new ``bytes2`` type for %%v%%.
424
+ */
425
+ static bytes2(v) { return b(v, 2); }
426
+ /**
427
+ * Return a new ``bytes3`` type for %%v%%.
428
+ */
429
+ static bytes3(v) { return b(v, 3); }
430
+ /**
431
+ * Return a new ``bytes4`` type for %%v%%.
432
+ */
433
+ static bytes4(v) { return b(v, 4); }
434
+ /**
435
+ * Return a new ``bytes5`` type for %%v%%.
436
+ */
437
+ static bytes5(v) { return b(v, 5); }
438
+ /**
439
+ * Return a new ``bytes6`` type for %%v%%.
440
+ */
441
+ static bytes6(v) { return b(v, 6); }
442
+ /**
443
+ * Return a new ``bytes7`` type for %%v%%.
444
+ */
445
+ static bytes7(v) { return b(v, 7); }
446
+ /**
447
+ * Return a new ``bytes8`` type for %%v%%.
448
+ */
449
+ static bytes8(v) { return b(v, 8); }
450
+ /**
451
+ * Return a new ``bytes9`` type for %%v%%.
452
+ */
453
+ static bytes9(v) { return b(v, 9); }
454
+ /**
455
+ * Return a new ``bytes10`` type for %%v%%.
456
+ */
457
+ static bytes10(v) { return b(v, 10); }
458
+ /**
459
+ * Return a new ``bytes11`` type for %%v%%.
460
+ */
461
+ static bytes11(v) { return b(v, 11); }
462
+ /**
463
+ * Return a new ``bytes12`` type for %%v%%.
464
+ */
465
+ static bytes12(v) { return b(v, 12); }
466
+ /**
467
+ * Return a new ``bytes13`` type for %%v%%.
468
+ */
469
+ static bytes13(v) { return b(v, 13); }
470
+ /**
471
+ * Return a new ``bytes14`` type for %%v%%.
472
+ */
473
+ static bytes14(v) { return b(v, 14); }
474
+ /**
475
+ * Return a new ``bytes15`` type for %%v%%.
476
+ */
477
+ static bytes15(v) { return b(v, 15); }
478
+ /**
479
+ * Return a new ``bytes16`` type for %%v%%.
480
+ */
481
+ static bytes16(v) { return b(v, 16); }
482
+ /**
483
+ * Return a new ``bytes17`` type for %%v%%.
484
+ */
485
+ static bytes17(v) { return b(v, 17); }
486
+ /**
487
+ * Return a new ``bytes18`` type for %%v%%.
488
+ */
489
+ static bytes18(v) { return b(v, 18); }
490
+ /**
491
+ * Return a new ``bytes19`` type for %%v%%.
492
+ */
493
+ static bytes19(v) { return b(v, 19); }
494
+ /**
495
+ * Return a new ``bytes20`` type for %%v%%.
496
+ */
497
+ static bytes20(v) { return b(v, 20); }
498
+ /**
499
+ * Return a new ``bytes21`` type for %%v%%.
500
+ */
501
+ static bytes21(v) { return b(v, 21); }
502
+ /**
503
+ * Return a new ``bytes22`` type for %%v%%.
504
+ */
505
+ static bytes22(v) { return b(v, 22); }
506
+ /**
507
+ * Return a new ``bytes23`` type for %%v%%.
508
+ */
509
+ static bytes23(v) { return b(v, 23); }
510
+ /**
511
+ * Return a new ``bytes24`` type for %%v%%.
512
+ */
513
+ static bytes24(v) { return b(v, 24); }
514
+ /**
515
+ * Return a new ``bytes25`` type for %%v%%.
516
+ */
517
+ static bytes25(v) { return b(v, 25); }
518
+ /**
519
+ * Return a new ``bytes26`` type for %%v%%.
520
+ */
521
+ static bytes26(v) { return b(v, 26); }
522
+ /**
523
+ * Return a new ``bytes27`` type for %%v%%.
524
+ */
525
+ static bytes27(v) { return b(v, 27); }
526
+ /**
527
+ * Return a new ``bytes28`` type for %%v%%.
528
+ */
529
+ static bytes28(v) { return b(v, 28); }
530
+ /**
531
+ * Return a new ``bytes29`` type for %%v%%.
532
+ */
533
+ static bytes29(v) { return b(v, 29); }
534
+ /**
535
+ * Return a new ``bytes30`` type for %%v%%.
536
+ */
537
+ static bytes30(v) { return b(v, 30); }
538
+ /**
539
+ * Return a new ``bytes31`` type for %%v%%.
540
+ */
541
+ static bytes31(v) { return b(v, 31); }
542
+ /**
543
+ * Return a new ``bytes32`` type for %%v%%.
544
+ */
545
+ static bytes32(v) { return b(v, 32); }
546
+ /**
547
+ * Return a new ``address`` type for %%v%%.
548
+ */
549
+ static address(v) { return new Typed(_gaurd, "address", v); }
550
+ /**
551
+ * Return a new ``bool`` type for %%v%%.
552
+ */
553
+ static bool(v) { return new Typed(_gaurd, "bool", !!v); }
554
+ /**
555
+ * Return a new ``bytes`` type for %%v%%.
556
+ */
557
+ static bytes(v) { return new Typed(_gaurd, "bytes", v); }
558
+ /**
559
+ * Return a new ``string`` type for %%v%%.
560
+ */
561
+ static string(v) { return new Typed(_gaurd, "string", v); }
562
+ /**
563
+ * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.
564
+ */
565
+ static array(v, dynamic) {
566
+ throw new Error("not implemented yet");
567
+ return new Typed(_gaurd, "array", v, dynamic);
568
+ }
569
+ /**
570
+ * Return a new ``tuple`` type for %%v%%, with the optional %%name%%.
571
+ */
572
+ static tuple(v, name) {
573
+ throw new Error("not implemented yet");
574
+ return new Typed(_gaurd, "tuple", v, name);
575
+ }
576
+ /**
577
+ * Return a new ``uint8`` type for %%v%%.
578
+ */
579
+ static overrides(v) {
580
+ return new Typed(_gaurd, "overrides", Object.assign({}, v));
581
+ }
582
+ /**
583
+ * Returns true only if %%value%% is a [[Typed]] instance.
584
+ */
585
+ static isTyped(value) {
586
+ return (value
587
+ && typeof (value) === "object"
588
+ && "_typedSymbol" in value
589
+ && value._typedSymbol === _typedSymbol);
590
+ }
591
+ /**
592
+ * If the value is a [[Typed]] instance, validates the underlying value
593
+ * and returns it, otherwise returns value directly.
594
+ *
595
+ * This is useful for functions that with to accept either a [[Typed]]
596
+ * object or values.
597
+ */
598
+ static dereference(value, type) {
599
+ if (Typed.isTyped(value)) {
600
+ if (value.type !== type) {
601
+ throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);
602
+ }
603
+ return value.value;
604
+ }
605
+ return value;
606
+ }
607
+ }
608
+ _Typed_options = new WeakMap();
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The [Base58 Encoding](link-base58) scheme allows a **numeric** value
3
+ * to be encoded as a compact string using a radix of 58 using only
4
+ * alpha-numeric characters. Confusingly similar characters are omitted
5
+ * (i.e. ``"l0O"``).
6
+ *
7
+ * Note that Base58 encodes a **numeric** value, not arbitrary bytes,
8
+ * since any zero-bytes on the left would get removed. To mitigate this
9
+ * issue most schemes that use Base58 choose specific high-order values
10
+ * to ensure non-zero prefixes.
11
+ *
12
+ * @_subsection: api/utils:Base58 Encoding [about-base58]
13
+ */
14
+ import type { BytesLike } from "./index.js";
15
+ /**
16
+ * Encode %%value%% as a Base58-encoded string.
17
+ */
18
+ export declare function encodeBase58(_value: BytesLike): string;
19
+ /**
20
+ * Decode the Base58-encoded %%value%%.
21
+ */
22
+ export declare function decodeBase58(value: string): bigint;
@@ -0,0 +1,68 @@
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
+ /**
8
+ * The [Base58 Encoding](link-base58) scheme allows a **numeric** value
9
+ * to be encoded as a compact string using a radix of 58 using only
10
+ * alpha-numeric characters. Confusingly similar characters are omitted
11
+ * (i.e. ``"l0O"``).
12
+ *
13
+ * Note that Base58 encodes a **numeric** value, not arbitrary bytes,
14
+ * since any zero-bytes on the left would get removed. To mitigate this
15
+ * issue most schemes that use Base58 choose specific high-order values
16
+ * to ensure non-zero prefixes.
17
+ *
18
+ * @_subsection: api/utils:Base58 Encoding [about-base58]
19
+ */
20
+ import { getBytes } from "./data.js";
21
+ import { assertArgument } from "./errors.js";
22
+ import { toBigInt } from "./maths.js";
23
+ const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
24
+ let Lookup = null;
25
+ function getAlpha(letter) {
26
+ if (Lookup == null) {
27
+ Lookup = {};
28
+ for (let i = 0; i < Alphabet.length; i++) {
29
+ Lookup[Alphabet[i]] = BigInt(i);
30
+ }
31
+ }
32
+ const result = Lookup[letter];
33
+ assertArgument(result != null, `invalid base58 value`, "letter", letter);
34
+ return result;
35
+ }
36
+ const BN_0 = BigInt(0);
37
+ const BN_58 = BigInt(58);
38
+ /**
39
+ * Encode %%value%% as a Base58-encoded string.
40
+ */
41
+ export function encodeBase58(_value) {
42
+ const bytes = getBytes(_value);
43
+ let value = toBigInt(bytes);
44
+ let result = "";
45
+ while (value) {
46
+ result = Alphabet[Number(value % BN_58)] + result;
47
+ value /= BN_58;
48
+ }
49
+ // Account for leading padding zeros
50
+ for (let i = 0; i < bytes.length; i++) {
51
+ if (bytes[i]) {
52
+ break;
53
+ }
54
+ result = Alphabet[0] + result;
55
+ }
56
+ return result;
57
+ }
58
+ /**
59
+ * Decode the Base58-encoded %%value%%.
60
+ */
61
+ export function decodeBase58(value) {
62
+ let result = BN_0;
63
+ for (let i = 0; i < value.length; i++) {
64
+ result *= BN_58;
65
+ result += getAlpha(value[i]);
66
+ }
67
+ return result;
68
+ }
@@ -0,0 +1,3 @@
1
+ import type { BytesLike } from "./data.js";
2
+ export declare function decodeBase64(textData: string): Uint8Array;
3
+ export declare function encodeBase64(_data: BytesLike): string;