ccxt 4.3.2 → 4.3.4
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/README.md +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +22 -0
- package/dist/cjs/src/binance.js +320 -21
- package/dist/cjs/src/bingx.js +2 -2
- package/dist/cjs/src/bitget.js +76 -1
- package/dist/cjs/src/coinbase.js +9 -1
- package/dist/cjs/src/hyperliquid.js +87 -13
- package/dist/cjs/src/okx.js +116 -0
- package/dist/cjs/src/phemex.js +5 -0
- package/dist/cjs/src/poloniexfutures.js +12 -2
- package/dist/cjs/src/pro/hyperliquid.js +8 -7
- package/dist/cjs/src/pro/kraken.js +1 -1
- package/dist/cjs/src/pro/wazirx.js +2 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +27 -2
- package/dist/cjs/src/woo.js +110 -6
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +22 -0
- package/js/src/binance.d.ts +3 -0
- package/js/src/binance.js +320 -21
- package/js/src/bingx.js +3 -3
- package/js/src/bitget.d.ts +1 -0
- package/js/src/bitget.js +76 -1
- package/js/src/coinbase.js +9 -1
- package/js/src/coinbasepro.d.ts +1 -1
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +87 -13
- package/js/src/okx.d.ts +2 -0
- package/js/src/okx.js +116 -0
- package/js/src/phemex.js +5 -0
- package/js/src/poloniexfutures.js +12 -2
- package/js/src/pro/hyperliquid.js +8 -7
- package/js/src/pro/kraken.js +1 -1
- package/js/src/pro/wazirx.js +2 -1
- package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.d.ts +2 -2
- package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.d.ts +24 -357
- package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +27 -0
- package/js/src/woo.d.ts +2 -0
- package/js/src/woo.js +110 -6
- package/package.json +1 -1
|
@@ -1,357 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
26
|
-
* following properties:
|
|
27
|
-
* <ul>
|
|
28
|
-
* <li>str - specify initial ASN.1 value(V) by a string</li>
|
|
29
|
-
* <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
|
|
30
|
-
* </ul>
|
|
31
|
-
* NOTE: 'params' can be omitted.
|
|
32
|
-
*/
|
|
33
|
-
function DERAbstractString(params: any[]): void;
|
|
34
|
-
/**
|
|
35
|
-
* base class for ASN.1 DER Generalized/UTCTime class
|
|
36
|
-
* @name KJUR.asn1.DERAbstractTime
|
|
37
|
-
* @class base class for ASN.1 DER Generalized/UTCTime class
|
|
38
|
-
* @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
|
|
39
|
-
* @extends KJUR.asn1.ASN1Object
|
|
40
|
-
* @description
|
|
41
|
-
* @see KJUR.asn1.ASN1Object - superclass
|
|
42
|
-
*/
|
|
43
|
-
function DERAbstractTime(params: any[]): void;
|
|
44
|
-
/**
|
|
45
|
-
* base class for ASN.1 DER structured class
|
|
46
|
-
* @name KJUR.asn1.DERAbstractStructured
|
|
47
|
-
* @class base class for ASN.1 DER structured class
|
|
48
|
-
* @property {Array} asn1Array internal array of ASN1Object
|
|
49
|
-
* @extends KJUR.asn1.ASN1Object
|
|
50
|
-
* @description
|
|
51
|
-
* @see KJUR.asn1.ASN1Object - superclass
|
|
52
|
-
*/
|
|
53
|
-
function DERAbstractStructured(params: any): void;
|
|
54
|
-
/**
|
|
55
|
-
* class for ASN.1 DER Boolean
|
|
56
|
-
* @name KJUR.asn1.DERBoolean
|
|
57
|
-
* @class class for ASN.1 DER Boolean
|
|
58
|
-
* @extends KJUR.asn1.ASN1Object
|
|
59
|
-
* @description
|
|
60
|
-
* @see KJUR.asn1.ASN1Object - superclass
|
|
61
|
-
*/
|
|
62
|
-
function DERBoolean(): void;
|
|
63
|
-
/**
|
|
64
|
-
* class for ASN.1 DER Integer
|
|
65
|
-
* @name KJUR.asn1.DERInteger
|
|
66
|
-
* @class class for ASN.1 DER Integer
|
|
67
|
-
* @extends KJUR.asn1.ASN1Object
|
|
68
|
-
* @description
|
|
69
|
-
* <br/>
|
|
70
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
71
|
-
* following properties:
|
|
72
|
-
* <ul>
|
|
73
|
-
* <li>int - specify initial ASN.1 value(V) by integer value</li>
|
|
74
|
-
* <li>bigint - specify initial ASN.1 value(V) by BigInteger object</li>
|
|
75
|
-
* <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
|
|
76
|
-
* </ul>
|
|
77
|
-
* NOTE: 'params' can be omitted.
|
|
78
|
-
*/
|
|
79
|
-
function DERInteger(params: any): void;
|
|
80
|
-
/**
|
|
81
|
-
* class for ASN.1 DER encoded BitString primitive
|
|
82
|
-
* @name KJUR.asn1.DERBitString
|
|
83
|
-
* @class class for ASN.1 DER encoded BitString primitive
|
|
84
|
-
* @extends KJUR.asn1.ASN1Object
|
|
85
|
-
* @description
|
|
86
|
-
* <br/>
|
|
87
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
88
|
-
* following properties:
|
|
89
|
-
* <ul>
|
|
90
|
-
* <li>bin - specify binary string (ex. '10111')</li>
|
|
91
|
-
* <li>array - specify array of boolean (ex. [true,false,true,true])</li>
|
|
92
|
-
* <li>hex - specify hexadecimal string of ASN.1 value(V) including unused bits</li>
|
|
93
|
-
* <li>obj - specify {@link KJUR.asn1.ASN1Util.newObject}
|
|
94
|
-
* argument for "BitString encapsulates" structure.</li>
|
|
95
|
-
* </ul>
|
|
96
|
-
* NOTE1: 'params' can be omitted.<br/>
|
|
97
|
-
* NOTE2: 'obj' parameter have been supported since
|
|
98
|
-
* asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).<br/>
|
|
99
|
-
* @example
|
|
100
|
-
* // default constructor
|
|
101
|
-
* o = new KJUR.asn1.DERBitString();
|
|
102
|
-
* // initialize with binary string
|
|
103
|
-
* o = new KJUR.asn1.DERBitString({bin: "1011"});
|
|
104
|
-
* // initialize with boolean array
|
|
105
|
-
* o = new KJUR.asn1.DERBitString({array: [true,false,true,true]});
|
|
106
|
-
* // initialize with hexadecimal string (04 is unused bits)
|
|
107
|
-
* o = new KJUR.asn1.DEROctetString({hex: "04bac0"});
|
|
108
|
-
* // initialize with ASN1Util.newObject argument for encapsulated
|
|
109
|
-
* o = new KJUR.asn1.DERBitString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
|
|
110
|
-
* // above generates a ASN.1 data like this:
|
|
111
|
-
* // BIT STRING, encapsulates {
|
|
112
|
-
* // SEQUENCE {
|
|
113
|
-
* // INTEGER 3
|
|
114
|
-
* // PrintableString 'aaa'
|
|
115
|
-
* // }
|
|
116
|
-
* // }
|
|
117
|
-
*/
|
|
118
|
-
function DERBitString(params: any): void;
|
|
119
|
-
/**
|
|
120
|
-
* class for ASN.1 DER OctetString<br/>
|
|
121
|
-
* @name KJUR.asn1.DEROctetString
|
|
122
|
-
* @class class for ASN.1 DER OctetString
|
|
123
|
-
* @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
|
|
124
|
-
* @extends KJUR.asn1.DERAbstractString
|
|
125
|
-
* @description
|
|
126
|
-
* This class provides ASN.1 OctetString simple type.<br/>
|
|
127
|
-
* Supported "params" attributes are:
|
|
128
|
-
* <ul>
|
|
129
|
-
* <li>str - to set a string as a value</li>
|
|
130
|
-
* <li>hex - to set a hexadecimal string as a value</li>
|
|
131
|
-
* <li>obj - to set a encapsulated ASN.1 value by JSON object
|
|
132
|
-
* which is defined in {@link KJUR.asn1.ASN1Util.newObject}</li>
|
|
133
|
-
* </ul>
|
|
134
|
-
* NOTE: A parameter 'obj' have been supported
|
|
135
|
-
* for "OCTET STRING, encapsulates" structure.
|
|
136
|
-
* since asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).
|
|
137
|
-
* @see KJUR.asn1.DERAbstractString - superclass
|
|
138
|
-
* @example
|
|
139
|
-
* // default constructor
|
|
140
|
-
* o = new KJUR.asn1.DEROctetString();
|
|
141
|
-
* // initialize with string
|
|
142
|
-
* o = new KJUR.asn1.DEROctetString({str: "aaa"});
|
|
143
|
-
* // initialize with hexadecimal string
|
|
144
|
-
* o = new KJUR.asn1.DEROctetString({hex: "616161"});
|
|
145
|
-
* // initialize with ASN1Util.newObject argument
|
|
146
|
-
* o = new KJUR.asn1.DEROctetString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
|
|
147
|
-
* // above generates a ASN.1 data like this:
|
|
148
|
-
* // OCTET STRING, encapsulates {
|
|
149
|
-
* // SEQUENCE {
|
|
150
|
-
* // INTEGER 3
|
|
151
|
-
* // PrintableString 'aaa'
|
|
152
|
-
* // }
|
|
153
|
-
* // }
|
|
154
|
-
*/
|
|
155
|
-
function DEROctetString(params: any[]): void;
|
|
156
|
-
/**
|
|
157
|
-
* class for ASN.1 DER Null
|
|
158
|
-
* @name KJUR.asn1.DERNull
|
|
159
|
-
* @class class for ASN.1 DER Null
|
|
160
|
-
* @extends KJUR.asn1.ASN1Object
|
|
161
|
-
* @description
|
|
162
|
-
* @see KJUR.asn1.ASN1Object - superclass
|
|
163
|
-
*/
|
|
164
|
-
function DERNull(): void;
|
|
165
|
-
/**
|
|
166
|
-
* class for ASN.1 DER ObjectIdentifier
|
|
167
|
-
* @name KJUR.asn1.DERObjectIdentifier
|
|
168
|
-
* @class class for ASN.1 DER ObjectIdentifier
|
|
169
|
-
* @param {Array} params associative array of parameters (ex. {'oid': '2.5.4.5'})
|
|
170
|
-
* @extends KJUR.asn1.ASN1Object
|
|
171
|
-
* @description
|
|
172
|
-
* <br/>
|
|
173
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
174
|
-
* following properties:
|
|
175
|
-
* <ul>
|
|
176
|
-
* <li>oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)</li>
|
|
177
|
-
* <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
|
|
178
|
-
* </ul>
|
|
179
|
-
* NOTE: 'params' can be omitted.
|
|
180
|
-
*/
|
|
181
|
-
function DERObjectIdentifier(params: any[]): void;
|
|
182
|
-
/**
|
|
183
|
-
* class for ASN.1 DER Enumerated
|
|
184
|
-
* @name KJUR.asn1.DEREnumerated
|
|
185
|
-
* @class class for ASN.1 DER Enumerated
|
|
186
|
-
* @extends KJUR.asn1.ASN1Object
|
|
187
|
-
* @description
|
|
188
|
-
* <br/>
|
|
189
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
190
|
-
* following properties:
|
|
191
|
-
* <ul>
|
|
192
|
-
* <li>int - specify initial ASN.1 value(V) by integer value</li>
|
|
193
|
-
* <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
|
|
194
|
-
* </ul>
|
|
195
|
-
* NOTE: 'params' can be omitted.
|
|
196
|
-
* @example
|
|
197
|
-
* new KJUR.asn1.DEREnumerated(123);
|
|
198
|
-
* new KJUR.asn1.DEREnumerated({int: 123});
|
|
199
|
-
* new KJUR.asn1.DEREnumerated({hex: '1fad'});
|
|
200
|
-
*/
|
|
201
|
-
function DEREnumerated(params: any): void;
|
|
202
|
-
/**
|
|
203
|
-
* class for ASN.1 DER UTF8String
|
|
204
|
-
* @name KJUR.asn1.DERUTF8String
|
|
205
|
-
* @class class for ASN.1 DER UTF8String
|
|
206
|
-
* @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
|
|
207
|
-
* @extends KJUR.asn1.DERAbstractString
|
|
208
|
-
* @description
|
|
209
|
-
* @see KJUR.asn1.DERAbstractString - superclass
|
|
210
|
-
*/
|
|
211
|
-
function DERUTF8String(params: any[]): void;
|
|
212
|
-
/**
|
|
213
|
-
* class for ASN.1 DER NumericString
|
|
214
|
-
* @name KJUR.asn1.DERNumericString
|
|
215
|
-
* @class class for ASN.1 DER NumericString
|
|
216
|
-
* @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
|
|
217
|
-
* @extends KJUR.asn1.DERAbstractString
|
|
218
|
-
* @description
|
|
219
|
-
* @see KJUR.asn1.DERAbstractString - superclass
|
|
220
|
-
*/
|
|
221
|
-
function DERNumericString(params: any[]): void;
|
|
222
|
-
/**
|
|
223
|
-
* class for ASN.1 DER PrintableString
|
|
224
|
-
* @name KJUR.asn1.DERPrintableString
|
|
225
|
-
* @class class for ASN.1 DER PrintableString
|
|
226
|
-
* @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
|
|
227
|
-
* @extends KJUR.asn1.DERAbstractString
|
|
228
|
-
* @description
|
|
229
|
-
* @see KJUR.asn1.DERAbstractString - superclass
|
|
230
|
-
*/
|
|
231
|
-
function DERPrintableString(params: any[]): void;
|
|
232
|
-
/**
|
|
233
|
-
* class for ASN.1 DER TeletexString
|
|
234
|
-
* @name KJUR.asn1.DERTeletexString
|
|
235
|
-
* @class class for ASN.1 DER TeletexString
|
|
236
|
-
* @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
|
|
237
|
-
* @extends KJUR.asn1.DERAbstractString
|
|
238
|
-
* @description
|
|
239
|
-
* @see KJUR.asn1.DERAbstractString - superclass
|
|
240
|
-
*/
|
|
241
|
-
function DERTeletexString(params: any[]): void;
|
|
242
|
-
/**
|
|
243
|
-
* class for ASN.1 DER IA5String
|
|
244
|
-
* @name KJUR.asn1.DERIA5String
|
|
245
|
-
* @class class for ASN.1 DER IA5String
|
|
246
|
-
* @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
|
|
247
|
-
* @extends KJUR.asn1.DERAbstractString
|
|
248
|
-
* @description
|
|
249
|
-
* @see KJUR.asn1.DERAbstractString - superclass
|
|
250
|
-
*/
|
|
251
|
-
function DERIA5String(params: any[]): void;
|
|
252
|
-
/**
|
|
253
|
-
* class for ASN.1 DER UTCTime
|
|
254
|
-
* @name KJUR.asn1.DERUTCTime
|
|
255
|
-
* @class class for ASN.1 DER UTCTime
|
|
256
|
-
* @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
|
|
257
|
-
* @extends KJUR.asn1.DERAbstractTime
|
|
258
|
-
* @description
|
|
259
|
-
* <br/>
|
|
260
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
261
|
-
* following properties:
|
|
262
|
-
* <ul>
|
|
263
|
-
* <li>str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')</li>
|
|
264
|
-
* <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
|
|
265
|
-
* <li>date - specify Date object.</li>
|
|
266
|
-
* </ul>
|
|
267
|
-
* NOTE: 'params' can be omitted.
|
|
268
|
-
* <h4>EXAMPLES</h4>
|
|
269
|
-
* @example
|
|
270
|
-
* d1 = new KJUR.asn1.DERUTCTime();
|
|
271
|
-
* d1.setString('130430125959Z');
|
|
272
|
-
*
|
|
273
|
-
* d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});
|
|
274
|
-
* d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});
|
|
275
|
-
* d4 = new KJUR.asn1.DERUTCTime('130430125959Z');
|
|
276
|
-
*/
|
|
277
|
-
function DERUTCTime(params: any[]): void;
|
|
278
|
-
/**
|
|
279
|
-
* class for ASN.1 DER GeneralizedTime
|
|
280
|
-
* @name KJUR.asn1.DERGeneralizedTime
|
|
281
|
-
* @class class for ASN.1 DER GeneralizedTime
|
|
282
|
-
* @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})
|
|
283
|
-
* @property {Boolean} withMillis flag to show milliseconds or not
|
|
284
|
-
* @extends KJUR.asn1.DERAbstractTime
|
|
285
|
-
* @description
|
|
286
|
-
* <br/>
|
|
287
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
288
|
-
* following properties:
|
|
289
|
-
* <ul>
|
|
290
|
-
* <li>str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')</li>
|
|
291
|
-
* <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
|
|
292
|
-
* <li>date - specify Date object.</li>
|
|
293
|
-
* <li>millis - specify flag to show milliseconds (from 1.0.6)</li>
|
|
294
|
-
* </ul>
|
|
295
|
-
* NOTE1: 'params' can be omitted.
|
|
296
|
-
* NOTE2: 'withMillis' property is supported from asn1 1.0.6.
|
|
297
|
-
*/
|
|
298
|
-
function DERGeneralizedTime(params: any[]): void;
|
|
299
|
-
/**
|
|
300
|
-
* class for ASN.1 DER Sequence
|
|
301
|
-
* @name KJUR.asn1.DERSequence
|
|
302
|
-
* @class class for ASN.1 DER Sequence
|
|
303
|
-
* @extends KJUR.asn1.DERAbstractStructured
|
|
304
|
-
* @description
|
|
305
|
-
* <br/>
|
|
306
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
307
|
-
* following properties:
|
|
308
|
-
* <ul>
|
|
309
|
-
* <li>array - specify array of ASN1Object to set elements of content</li>
|
|
310
|
-
* </ul>
|
|
311
|
-
* NOTE: 'params' can be omitted.
|
|
312
|
-
*/
|
|
313
|
-
function DERSequence(params: any): void;
|
|
314
|
-
/**
|
|
315
|
-
* class for ASN.1 DER Set
|
|
316
|
-
* @name KJUR.asn1.DERSet
|
|
317
|
-
* @class class for ASN.1 DER Set
|
|
318
|
-
* @extends KJUR.asn1.DERAbstractStructured
|
|
319
|
-
* @description
|
|
320
|
-
* <br/>
|
|
321
|
-
* As for argument 'params' for constructor, you can specify one of
|
|
322
|
-
* following properties:
|
|
323
|
-
* <ul>
|
|
324
|
-
* <li>array - specify array of ASN1Object to set elements of content</li>
|
|
325
|
-
* <li>sortflag - flag for sort (default: true). ASN.1 BER is not sorted in 'SET OF'.</li>
|
|
326
|
-
* </ul>
|
|
327
|
-
* NOTE1: 'params' can be omitted.<br/>
|
|
328
|
-
* NOTE2: sortflag is supported since 1.0.5.
|
|
329
|
-
*/
|
|
330
|
-
function DERSet(params: any): void;
|
|
331
|
-
/**
|
|
332
|
-
* class for ASN.1 DER TaggedObject
|
|
333
|
-
* @name KJUR.asn1.DERTaggedObject
|
|
334
|
-
* @class class for ASN.1 DER TaggedObject
|
|
335
|
-
* @extends KJUR.asn1.ASN1Object
|
|
336
|
-
* @description
|
|
337
|
-
* <br/>
|
|
338
|
-
* Parameter 'tagNoNex' is ASN.1 tag(T) value for this object.
|
|
339
|
-
* For example, if you find '[1]' tag in a ASN.1 dump,
|
|
340
|
-
* 'tagNoHex' will be 'a1'.
|
|
341
|
-
* <br/>
|
|
342
|
-
* As for optional argument 'params' for constructor, you can specify *ANY* of
|
|
343
|
-
* following properties:
|
|
344
|
-
* <ul>
|
|
345
|
-
* <li>explicit - specify true if this is explicit tag otherwise false
|
|
346
|
-
* (default is 'true').</li>
|
|
347
|
-
* <li>tag - specify tag (default is 'a0' which means [0])</li>
|
|
348
|
-
* <li>obj - specify ASN1Object which is tagged</li>
|
|
349
|
-
* </ul>
|
|
350
|
-
* @example
|
|
351
|
-
* d1 = new KJUR.asn1.DERUTF8String({'str':'a'});
|
|
352
|
-
* d2 = new KJUR.asn1.DERTaggedObject({'obj': d1});
|
|
353
|
-
* hex = d2.getEncodedHex();
|
|
354
|
-
*/
|
|
355
|
-
function DERTaggedObject(params: any): void;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @fileOverview
|
|
3
|
+
* @name asn1-1.0.js
|
|
4
|
+
* @author Kenji Urushima kenji.urushima@gmail.com
|
|
5
|
+
* @version asn1 1.0.13 (2017-Jun-02)
|
|
6
|
+
* @since jsrsasign 2.1
|
|
7
|
+
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* kjur's class library name space
|
|
11
|
+
* <p>
|
|
12
|
+
* This name space provides following name spaces:
|
|
13
|
+
* <ul>
|
|
14
|
+
* <li>{@link KJUR.asn1} - ASN.1 primitive hexadecimal encoder</li>
|
|
15
|
+
* <li>{@link KJUR.asn1.x509} - ASN.1 structure for X.509 certificate and CRL</li>
|
|
16
|
+
* <li>{@link KJUR.crypto} - Java Cryptographic Extension(JCE) style MessageDigest/Signature
|
|
17
|
+
* class and utilities</li>
|
|
18
|
+
* </ul>
|
|
19
|
+
* </p>
|
|
20
|
+
* NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
|
|
21
|
+
* @name KJUR
|
|
22
|
+
* @namespace kjur's class library name space
|
|
23
|
+
*/
|
|
24
|
+
export declare var KJUR: any;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
5
|
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
6
|
|
|
7
|
+
// @ts-nocheck
|
|
7
8
|
/* asn1-1.0.13.js (c) 2013-2017 Kenji Urushima | kjur.github.com/jsrsasign/license
|
|
8
9
|
*/
|
|
9
10
|
/*
|
|
@@ -42,6 +43,32 @@ import { YAHOO } from "./yahoo.js";
|
|
|
42
43
|
* @name KJUR
|
|
43
44
|
* @namespace kjur's class library name space
|
|
44
45
|
*/
|
|
46
|
+
// interface kjur_interface {
|
|
47
|
+
// asn1: {
|
|
48
|
+
// ASN1Object: any;
|
|
49
|
+
// ASN1Util: any;
|
|
50
|
+
// DERAbstractString: any;
|
|
51
|
+
// DERAbstractStructured: any;
|
|
52
|
+
// DERAbstractTime: any;
|
|
53
|
+
// DERBitString: any;
|
|
54
|
+
// DERBoolean: any;
|
|
55
|
+
// DEREnumerated: any;
|
|
56
|
+
// DERGeneralizedTime: any;
|
|
57
|
+
// DERIA5String: any;
|
|
58
|
+
// DERInteger: any;
|
|
59
|
+
// DERNull: any;
|
|
60
|
+
// DERNumericString: any;
|
|
61
|
+
// DERObjectIdentifier: any;
|
|
62
|
+
// DEROctetString: any;
|
|
63
|
+
// DERPrintableString: any;
|
|
64
|
+
// DERSequence: any;
|
|
65
|
+
// DERSet: any;
|
|
66
|
+
// DERTaggedObject: any;
|
|
67
|
+
// DERTeletexString: any;
|
|
68
|
+
// DERUTCTime: any;
|
|
69
|
+
// DERUTF8String: any;
|
|
70
|
+
// }
|
|
71
|
+
// };
|
|
45
72
|
export var KJUR = {};
|
|
46
73
|
/**
|
|
47
74
|
* kjur's ASN.1 class library name space
|
package/js/src/woo.d.ts
CHANGED
|
@@ -176,6 +176,8 @@ export default class woo extends Exchange {
|
|
|
176
176
|
parsePosition(position: any, market?: Market): import("./base/types.js").Position;
|
|
177
177
|
fetchConvertQuote(fromCode: string, toCode: string, amount?: Num, params?: {}): Promise<Conversion>;
|
|
178
178
|
createConvertTrade(id: string, fromCode: string, toCode: string, amount?: Num, params?: {}): Promise<Conversion>;
|
|
179
|
+
fetchConvertTrade(id: string, code?: Str, params?: {}): Promise<Conversion>;
|
|
180
|
+
fetchConvertTradeHistory(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Conversion[]>;
|
|
179
181
|
parseConversion(conversion: any, fromCurrency?: Currency, toCurrency?: Currency): Conversion;
|
|
180
182
|
fetchConvertCurrencies(params?: {}): Promise<Currencies>;
|
|
181
183
|
defaultNetworkCodeForCurrency(code: any): any;
|
package/js/src/woo.js
CHANGED
|
@@ -63,6 +63,8 @@ export default class woo extends Exchange {
|
|
|
63
63
|
'fetchClosedOrders': true,
|
|
64
64
|
'fetchConvertCurrencies': true,
|
|
65
65
|
'fetchConvertQuote': true,
|
|
66
|
+
'fetchConvertTrade': true,
|
|
67
|
+
'fetchConvertTradeHistory': true,
|
|
66
68
|
'fetchCurrencies': true,
|
|
67
69
|
'fetchDepositAddress': true,
|
|
68
70
|
'fetchDeposits': true,
|
|
@@ -3064,6 +3066,96 @@ export default class woo extends Exchange {
|
|
|
3064
3066
|
const data = this.safeDict(response, 'data', {});
|
|
3065
3067
|
return this.parseConversion(data);
|
|
3066
3068
|
}
|
|
3069
|
+
async fetchConvertTrade(id, code = undefined, params = {}) {
|
|
3070
|
+
/**
|
|
3071
|
+
* @method
|
|
3072
|
+
* @name woo#fetchConvertTrade
|
|
3073
|
+
* @description fetch the data for a conversion trade
|
|
3074
|
+
* @see https://docs.woo.org/#get-quote-trade
|
|
3075
|
+
* @param {string} id the id of the trade that you want to fetch
|
|
3076
|
+
* @param {string} [code] the unified currency code of the conversion trade
|
|
3077
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3078
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
3079
|
+
*/
|
|
3080
|
+
await this.loadMarkets();
|
|
3081
|
+
const request = {
|
|
3082
|
+
'quoteId': id,
|
|
3083
|
+
};
|
|
3084
|
+
const response = await this.v3PrivateGetConvertTrade(this.extend(request, params));
|
|
3085
|
+
//
|
|
3086
|
+
// {
|
|
3087
|
+
// "success": true,
|
|
3088
|
+
// "data": {
|
|
3089
|
+
// "quoteId": 12,
|
|
3090
|
+
// "buyAsset": "",
|
|
3091
|
+
// "sellAsset": "",
|
|
3092
|
+
// "buyAmount": 12.11,
|
|
3093
|
+
// "sellAmount": 12.11,
|
|
3094
|
+
// "tradeStatus": 12,
|
|
3095
|
+
// "createdTime": ""
|
|
3096
|
+
// }
|
|
3097
|
+
// }
|
|
3098
|
+
//
|
|
3099
|
+
const data = this.safeDict(response, 'data', {});
|
|
3100
|
+
const fromCurrencyId = this.safeString(data, 'sellAsset');
|
|
3101
|
+
const toCurrencyId = this.safeString(data, 'buyAsset');
|
|
3102
|
+
let fromCurrency = undefined;
|
|
3103
|
+
let toCurrency = undefined;
|
|
3104
|
+
if (fromCurrencyId !== undefined) {
|
|
3105
|
+
fromCurrency = this.currency(fromCurrencyId);
|
|
3106
|
+
}
|
|
3107
|
+
if (toCurrencyId !== undefined) {
|
|
3108
|
+
toCurrency = this.currency(toCurrencyId);
|
|
3109
|
+
}
|
|
3110
|
+
return this.parseConversion(data, fromCurrency, toCurrency);
|
|
3111
|
+
}
|
|
3112
|
+
async fetchConvertTradeHistory(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3113
|
+
/**
|
|
3114
|
+
* @method
|
|
3115
|
+
* @name woo#fetchConvertTradeHistory
|
|
3116
|
+
* @description fetch the users history of conversion trades
|
|
3117
|
+
* @see https://docs.woo.org/#get-quote-trades
|
|
3118
|
+
* @param {string} [code] the unified currency code
|
|
3119
|
+
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
3120
|
+
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
3121
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3122
|
+
* @param {int} [params.until] timestamp in ms of the latest conversion to fetch
|
|
3123
|
+
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
3124
|
+
*/
|
|
3125
|
+
await this.loadMarkets();
|
|
3126
|
+
let request = {};
|
|
3127
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
3128
|
+
if (since !== undefined) {
|
|
3129
|
+
request['startTime'] = since;
|
|
3130
|
+
}
|
|
3131
|
+
if (limit !== undefined) {
|
|
3132
|
+
request['size'] = limit;
|
|
3133
|
+
}
|
|
3134
|
+
const response = await this.v3PrivateGetConvertTrades(this.extend(request, params));
|
|
3135
|
+
//
|
|
3136
|
+
// {
|
|
3137
|
+
// "success": true,
|
|
3138
|
+
// "data": {
|
|
3139
|
+
// "count": 12,
|
|
3140
|
+
// "tradeVos":[
|
|
3141
|
+
// {
|
|
3142
|
+
// "quoteId": 12,
|
|
3143
|
+
// "buyAsset": "",
|
|
3144
|
+
// "sellAsset": "",
|
|
3145
|
+
// "buyAmount": 12.11,
|
|
3146
|
+
// "sellAmount": 12.11,
|
|
3147
|
+
// "tradeStatus": 12,
|
|
3148
|
+
// "createdTime": ""
|
|
3149
|
+
// }
|
|
3150
|
+
// ...
|
|
3151
|
+
// ]
|
|
3152
|
+
// }
|
|
3153
|
+
// }
|
|
3154
|
+
//
|
|
3155
|
+
const data = this.safeDict(response, 'data', {});
|
|
3156
|
+
const rows = this.safeList(data, 'tradeVos', []);
|
|
3157
|
+
return this.parseConversions(rows, 'sellAsset', 'buyAsset', since, limit);
|
|
3158
|
+
}
|
|
3067
3159
|
parseConversion(conversion, fromCurrency = undefined, toCurrency = undefined) {
|
|
3068
3160
|
//
|
|
3069
3161
|
// fetchConvertQuote
|
|
@@ -3088,10 +3180,22 @@ export default class woo extends Exchange {
|
|
|
3088
3180
|
// "rftAccepted": 1 // 1 -> success; 2 -> processing; 3 -> fail
|
|
3089
3181
|
// }
|
|
3090
3182
|
//
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3183
|
+
// fetchConvertTrade, fetchConvertTradeHistory
|
|
3184
|
+
//
|
|
3185
|
+
// {
|
|
3186
|
+
// "quoteId": 12,
|
|
3187
|
+
// "buyAsset": "",
|
|
3188
|
+
// "sellAsset": "",
|
|
3189
|
+
// "buyAmount": 12.11,
|
|
3190
|
+
// "sellAmount": 12.11,
|
|
3191
|
+
// "tradeStatus": 12,
|
|
3192
|
+
// "createdTime": ""
|
|
3193
|
+
// }
|
|
3194
|
+
//
|
|
3195
|
+
const timestamp = this.safeInteger2(conversion, 'expireTimestamp', 'createdTime');
|
|
3196
|
+
const fromCurr = this.safeString2(conversion, 'sellToken', 'buyAsset');
|
|
3197
|
+
const fromCode = this.safeCurrencyCode(fromCurr, fromCurrency);
|
|
3198
|
+
const to = this.safeString2(conversion, 'buyToken', 'sellAsset');
|
|
3095
3199
|
const toCode = this.safeCurrencyCode(to, toCurrency);
|
|
3096
3200
|
return {
|
|
3097
3201
|
'info': conversion,
|
|
@@ -3099,9 +3203,9 @@ export default class woo extends Exchange {
|
|
|
3099
3203
|
'datetime': this.iso8601(timestamp),
|
|
3100
3204
|
'id': this.safeString(conversion, 'quoteId'),
|
|
3101
3205
|
'fromCurrency': fromCode,
|
|
3102
|
-
'fromAmount': this.
|
|
3206
|
+
'fromAmount': this.safeNumber2(conversion, 'sellQuantity', 'sellAmount'),
|
|
3103
3207
|
'toCurrency': toCode,
|
|
3104
|
-
'toAmount': this.
|
|
3208
|
+
'toAmount': this.safeNumber2(conversion, 'buyQuantity', 'buyAmount'),
|
|
3105
3209
|
'price': this.safeNumber(conversion, 'buyPrice'),
|
|
3106
3210
|
'fee': undefined,
|
|
3107
3211
|
};
|
package/package.json
CHANGED