@0xsequence/api 0.42.9 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0xsequence-api.cjs.dev.js +54 -84
- package/dist/0xsequence-api.cjs.prod.js +54 -84
- package/dist/0xsequence-api.esm.js +54 -80
- package/dist/declarations/src/api.gen.d.ts +33 -1
- package/dist/declarations/src/index.d.ts +3 -3
- package/package.json +2 -4
- package/src/api.gen.ts +87 -6
- package/src/index.ts +4 -6
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
import fetch from 'cross-fetch';
|
|
2
|
-
|
|
3
1
|
function _extends() {
|
|
4
|
-
_extends = Object.assign
|
|
2
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
5
3
|
for (var i = 1; i < arguments.length; i++) {
|
|
6
4
|
var source = arguments[i];
|
|
7
|
-
|
|
8
5
|
for (var key in source) {
|
|
9
6
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
7
|
target[key] = source[key];
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
|
-
|
|
15
11
|
return target;
|
|
16
12
|
};
|
|
17
|
-
|
|
18
13
|
return _extends.apply(this, arguments);
|
|
19
14
|
}
|
|
20
15
|
|
|
21
16
|
/* eslint-disable */
|
|
22
|
-
// sequence-api v0.4.0
|
|
17
|
+
// sequence-api v0.4.0 8e34a4b927a5faab07d6558c21251a5218b82ac4
|
|
23
18
|
// --
|
|
24
|
-
//
|
|
25
|
-
//
|
|
19
|
+
// Code generated by webrpc-gen@v0.7.0 with typescript generator. DO NOT EDIT.
|
|
20
|
+
//
|
|
21
|
+
// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
|
|
22
|
+
|
|
26
23
|
// WebRPC description and code-gen version
|
|
27
|
-
const WebRPCVersion = "v1";
|
|
24
|
+
const WebRPCVersion = "v1";
|
|
25
|
+
|
|
26
|
+
// Schema version of your RIDL schema
|
|
27
|
+
const WebRPCSchemaVersion = "v0.4.0";
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
// Schema hash generated from your RIDL schema
|
|
30
|
+
const WebRPCSchemaHash = "8e34a4b927a5faab07d6558c21251a5218b82ac4";
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
//
|
|
32
33
|
// Types
|
|
33
34
|
//
|
|
34
|
-
|
|
35
35
|
let SmartRampOrderStatus;
|
|
36
|
-
|
|
37
36
|
(function (SmartRampOrderStatus) {
|
|
38
37
|
SmartRampOrderStatus["UNKNOWN"] = "UNKNOWN";
|
|
39
38
|
SmartRampOrderStatus["RUNNING_CHECKS"] = "RUNNING_CHECKS";
|
|
@@ -41,22 +40,17 @@ let SmartRampOrderStatus;
|
|
|
41
40
|
SmartRampOrderStatus["FAILED"] = "FAILED";
|
|
42
41
|
SmartRampOrderStatus["COMPLETE"] = "COMPLETE";
|
|
43
42
|
})(SmartRampOrderStatus || (SmartRampOrderStatus = {}));
|
|
44
|
-
|
|
45
43
|
let SmartRampTxnStatus;
|
|
46
|
-
|
|
47
44
|
(function (SmartRampTxnStatus) {
|
|
48
45
|
SmartRampTxnStatus["UNKNOWN"] = "UNKNOWN";
|
|
49
46
|
SmartRampTxnStatus["SUCCESSFUL"] = "SUCCESSFUL";
|
|
50
47
|
SmartRampTxnStatus["FAILED"] = "FAILED";
|
|
51
48
|
})(SmartRampTxnStatus || (SmartRampTxnStatus = {}));
|
|
52
|
-
|
|
53
49
|
let SortOrder;
|
|
54
|
-
|
|
55
50
|
(function (SortOrder) {
|
|
56
51
|
SortOrder["DESC"] = "DESC";
|
|
57
52
|
SortOrder["ASC"] = "ASC";
|
|
58
53
|
})(SortOrder || (SortOrder = {}));
|
|
59
|
-
|
|
60
54
|
//
|
|
61
55
|
// Client
|
|
62
56
|
//
|
|
@@ -65,7 +59,6 @@ class API {
|
|
|
65
59
|
this.hostname = void 0;
|
|
66
60
|
this.fetch = void 0;
|
|
67
61
|
this.path = '/rpc/API/';
|
|
68
|
-
|
|
69
62
|
this.ping = headers => {
|
|
70
63
|
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => {
|
|
71
64
|
return buildResponse(res).then(_data => {
|
|
@@ -75,7 +68,6 @@ class API {
|
|
|
75
68
|
});
|
|
76
69
|
});
|
|
77
70
|
};
|
|
78
|
-
|
|
79
71
|
this.version = headers => {
|
|
80
72
|
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => {
|
|
81
73
|
return buildResponse(res).then(_data => {
|
|
@@ -85,7 +77,6 @@ class API {
|
|
|
85
77
|
});
|
|
86
78
|
});
|
|
87
79
|
};
|
|
88
|
-
|
|
89
80
|
this.runtimeStatus = headers => {
|
|
90
81
|
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => {
|
|
91
82
|
return buildResponse(res).then(_data => {
|
|
@@ -95,7 +86,6 @@ class API {
|
|
|
95
86
|
});
|
|
96
87
|
});
|
|
97
88
|
};
|
|
98
|
-
|
|
99
89
|
this.getSequenceContext = headers => {
|
|
100
90
|
return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers)).then(res => {
|
|
101
91
|
return buildResponse(res).then(_data => {
|
|
@@ -105,7 +95,6 @@ class API {
|
|
|
105
95
|
});
|
|
106
96
|
});
|
|
107
97
|
};
|
|
108
|
-
|
|
109
98
|
this.getAuthToken = (args, headers) => {
|
|
110
99
|
return this.fetch(this.url('GetAuthToken'), createHTTPRequest(args, headers)).then(res => {
|
|
111
100
|
return buildResponse(res).then(_data => {
|
|
@@ -118,7 +107,6 @@ class API {
|
|
|
118
107
|
});
|
|
119
108
|
});
|
|
120
109
|
};
|
|
121
|
-
|
|
122
110
|
this.sendPasswordlessLink = (args, headers) => {
|
|
123
111
|
return this.fetch(this.url('SendPasswordlessLink'), createHTTPRequest(args, headers)).then(res => {
|
|
124
112
|
return buildResponse(res).then(_data => {
|
|
@@ -128,7 +116,6 @@ class API {
|
|
|
128
116
|
});
|
|
129
117
|
});
|
|
130
118
|
};
|
|
131
|
-
|
|
132
119
|
this.friendList = (args, headers) => {
|
|
133
120
|
return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers)).then(res => {
|
|
134
121
|
return buildResponse(res).then(_data => {
|
|
@@ -139,7 +126,6 @@ class API {
|
|
|
139
126
|
});
|
|
140
127
|
});
|
|
141
128
|
};
|
|
142
|
-
|
|
143
129
|
this.getFriendByAddress = (args, headers) => {
|
|
144
130
|
return this.fetch(this.url('GetFriendByAddress'), createHTTPRequest(args, headers)).then(res => {
|
|
145
131
|
return buildResponse(res).then(_data => {
|
|
@@ -150,7 +136,6 @@ class API {
|
|
|
150
136
|
});
|
|
151
137
|
});
|
|
152
138
|
};
|
|
153
|
-
|
|
154
139
|
this.searchFriends = (args, headers) => {
|
|
155
140
|
return this.fetch(this.url('SearchFriends'), createHTTPRequest(args, headers)).then(res => {
|
|
156
141
|
return buildResponse(res).then(_data => {
|
|
@@ -160,7 +145,6 @@ class API {
|
|
|
160
145
|
});
|
|
161
146
|
});
|
|
162
147
|
};
|
|
163
|
-
|
|
164
148
|
this.addFriend = (args, headers) => {
|
|
165
149
|
return this.fetch(this.url('AddFriend'), createHTTPRequest(args, headers)).then(res => {
|
|
166
150
|
return buildResponse(res).then(_data => {
|
|
@@ -171,7 +155,6 @@ class API {
|
|
|
171
155
|
});
|
|
172
156
|
});
|
|
173
157
|
};
|
|
174
|
-
|
|
175
158
|
this.updateFriendNickname = (args, headers) => {
|
|
176
159
|
return this.fetch(this.url('UpdateFriendNickname'), createHTTPRequest(args, headers)).then(res => {
|
|
177
160
|
return buildResponse(res).then(_data => {
|
|
@@ -182,7 +165,6 @@ class API {
|
|
|
182
165
|
});
|
|
183
166
|
});
|
|
184
167
|
};
|
|
185
|
-
|
|
186
168
|
this.removeFriend = (args, headers) => {
|
|
187
169
|
return this.fetch(this.url('RemoveFriend'), createHTTPRequest(args, headers)).then(res => {
|
|
188
170
|
return buildResponse(res).then(_data => {
|
|
@@ -192,7 +174,6 @@ class API {
|
|
|
192
174
|
});
|
|
193
175
|
});
|
|
194
176
|
};
|
|
195
|
-
|
|
196
177
|
this.contractCall = (args, headers) => {
|
|
197
178
|
return this.fetch(this.url('ContractCall'), createHTTPRequest(args, headers)).then(res => {
|
|
198
179
|
return buildResponse(res).then(_data => {
|
|
@@ -202,7 +183,6 @@ class API {
|
|
|
202
183
|
});
|
|
203
184
|
});
|
|
204
185
|
};
|
|
205
|
-
|
|
206
186
|
this.decodeContractCall = (args, headers) => {
|
|
207
187
|
return this.fetch(this.url('DecodeContractCall'), createHTTPRequest(args, headers)).then(res => {
|
|
208
188
|
return buildResponse(res).then(_data => {
|
|
@@ -212,7 +192,6 @@ class API {
|
|
|
212
192
|
});
|
|
213
193
|
});
|
|
214
194
|
};
|
|
215
|
-
|
|
216
195
|
this.lookupContractCallSelectors = (args, headers) => {
|
|
217
196
|
return this.fetch(this.url('LookupContractCallSelectors'), createHTTPRequest(args, headers)).then(res => {
|
|
218
197
|
return buildResponse(res).then(_data => {
|
|
@@ -222,7 +201,6 @@ class API {
|
|
|
222
201
|
});
|
|
223
202
|
});
|
|
224
203
|
};
|
|
225
|
-
|
|
226
204
|
this.userStorageFetch = (args, headers) => {
|
|
227
205
|
return this.fetch(this.url('UserStorageFetch'), createHTTPRequest(args, headers)).then(res => {
|
|
228
206
|
return buildResponse(res).then(_data => {
|
|
@@ -232,7 +210,6 @@ class API {
|
|
|
232
210
|
});
|
|
233
211
|
});
|
|
234
212
|
};
|
|
235
|
-
|
|
236
213
|
this.userStorageSave = (args, headers) => {
|
|
237
214
|
return this.fetch(this.url('UserStorageSave'), createHTTPRequest(args, headers)).then(res => {
|
|
238
215
|
return buildResponse(res).then(_data => {
|
|
@@ -242,7 +219,6 @@ class API {
|
|
|
242
219
|
});
|
|
243
220
|
});
|
|
244
221
|
};
|
|
245
|
-
|
|
246
222
|
this.userStorageDelete = (args, headers) => {
|
|
247
223
|
return this.fetch(this.url('UserStorageDelete'), createHTTPRequest(args, headers)).then(res => {
|
|
248
224
|
return buildResponse(res).then(_data => {
|
|
@@ -252,7 +228,6 @@ class API {
|
|
|
252
228
|
});
|
|
253
229
|
});
|
|
254
230
|
};
|
|
255
|
-
|
|
256
231
|
this.userStorageFetchAll = (args, headers) => {
|
|
257
232
|
return this.fetch(this.url('UserStorageFetchAll'), createHTTPRequest(args, headers)).then(res => {
|
|
258
233
|
return buildResponse(res).then(_data => {
|
|
@@ -262,7 +237,6 @@ class API {
|
|
|
262
237
|
});
|
|
263
238
|
});
|
|
264
239
|
};
|
|
265
|
-
|
|
266
240
|
this.getMoonpayLink = (args, headers) => {
|
|
267
241
|
return this.fetch(this.url('GetMoonpayLink'), createHTTPRequest(args, headers)).then(res => {
|
|
268
242
|
return buildResponse(res).then(_data => {
|
|
@@ -272,7 +246,15 @@ class API {
|
|
|
272
246
|
});
|
|
273
247
|
});
|
|
274
248
|
};
|
|
275
|
-
|
|
249
|
+
this.getSardineClientToken = headers => {
|
|
250
|
+
return this.fetch(this.url('GetSardineClientToken'), createHTTPRequest({}, headers)).then(res => {
|
|
251
|
+
return buildResponse(res).then(_data => {
|
|
252
|
+
return {
|
|
253
|
+
token: _data.token
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
};
|
|
276
258
|
this.isUsingGoogleMail = (args, headers) => {
|
|
277
259
|
return this.fetch(this.url('IsUsingGoogleMail'), createHTTPRequest(args, headers)).then(res => {
|
|
278
260
|
return buildResponse(res).then(_data => {
|
|
@@ -282,7 +264,6 @@ class API {
|
|
|
282
264
|
});
|
|
283
265
|
});
|
|
284
266
|
};
|
|
285
|
-
|
|
286
267
|
this.isValidSignature = (args, headers) => {
|
|
287
268
|
return this.fetch(this.url('IsValidSignature'), createHTTPRequest(args, headers)).then(res => {
|
|
288
269
|
return buildResponse(res).then(_data => {
|
|
@@ -292,7 +273,6 @@ class API {
|
|
|
292
273
|
});
|
|
293
274
|
});
|
|
294
275
|
};
|
|
295
|
-
|
|
296
276
|
this.isValidMessageSignature = (args, headers) => {
|
|
297
277
|
return this.fetch(this.url('IsValidMessageSignature'), createHTTPRequest(args, headers)).then(res => {
|
|
298
278
|
return buildResponse(res).then(_data => {
|
|
@@ -302,7 +282,6 @@ class API {
|
|
|
302
282
|
});
|
|
303
283
|
});
|
|
304
284
|
};
|
|
305
|
-
|
|
306
285
|
this.isValidTypedDataSignature = (args, headers) => {
|
|
307
286
|
return this.fetch(this.url('IsValidTypedDataSignature'), createHTTPRequest(args, headers)).then(res => {
|
|
308
287
|
return buildResponse(res).then(_data => {
|
|
@@ -312,7 +291,6 @@ class API {
|
|
|
312
291
|
});
|
|
313
292
|
});
|
|
314
293
|
};
|
|
315
|
-
|
|
316
294
|
this.isValidETHAuthProof = (args, headers) => {
|
|
317
295
|
return this.fetch(this.url('IsValidETHAuthProof'), createHTTPRequest(args, headers)).then(res => {
|
|
318
296
|
return buildResponse(res).then(_data => {
|
|
@@ -322,7 +300,6 @@ class API {
|
|
|
322
300
|
});
|
|
323
301
|
});
|
|
324
302
|
};
|
|
325
|
-
|
|
326
303
|
this.getCoinPrices = (args, headers) => {
|
|
327
304
|
return this.fetch(this.url('GetCoinPrices'), createHTTPRequest(args, headers)).then(res => {
|
|
328
305
|
return buildResponse(res).then(_data => {
|
|
@@ -332,7 +309,6 @@ class API {
|
|
|
332
309
|
});
|
|
333
310
|
});
|
|
334
311
|
};
|
|
335
|
-
|
|
336
312
|
this.getCollectiblePrices = (args, headers) => {
|
|
337
313
|
return this.fetch(this.url('GetCollectiblePrices'), createHTTPRequest(args, headers)).then(res => {
|
|
338
314
|
return buildResponse(res).then(_data => {
|
|
@@ -342,7 +318,6 @@ class API {
|
|
|
342
318
|
});
|
|
343
319
|
});
|
|
344
320
|
};
|
|
345
|
-
|
|
346
321
|
this.getExchangeRate = (args, headers) => {
|
|
347
322
|
return this.fetch(this.url('GetExchangeRate'), createHTTPRequest(args, headers)).then(res => {
|
|
348
323
|
return buildResponse(res).then(_data => {
|
|
@@ -352,7 +327,6 @@ class API {
|
|
|
352
327
|
});
|
|
353
328
|
});
|
|
354
329
|
};
|
|
355
|
-
|
|
356
330
|
this.listPayCardsOnFile = headers => {
|
|
357
331
|
return this.fetch(this.url('ListPayCardsOnFile'), createHTTPRequest({}, headers)).then(res => {
|
|
358
332
|
return buildResponse(res).then(_data => {
|
|
@@ -362,7 +336,6 @@ class API {
|
|
|
362
336
|
});
|
|
363
337
|
});
|
|
364
338
|
};
|
|
365
|
-
|
|
366
339
|
this.savePayCard = (args, headers) => {
|
|
367
340
|
return this.fetch(this.url('SavePayCard'), createHTTPRequest(args, headers)).then(res => {
|
|
368
341
|
return buildResponse(res).then(_data => {
|
|
@@ -373,7 +346,6 @@ class API {
|
|
|
373
346
|
});
|
|
374
347
|
});
|
|
375
348
|
};
|
|
376
|
-
|
|
377
349
|
this.updatePayCardCVC = (args, headers) => {
|
|
378
350
|
return this.fetch(this.url('UpdatePayCardCVC'), createHTTPRequest(args, headers)).then(res => {
|
|
379
351
|
return buildResponse(res).then(_data => {
|
|
@@ -383,7 +355,6 @@ class API {
|
|
|
383
355
|
});
|
|
384
356
|
});
|
|
385
357
|
};
|
|
386
|
-
|
|
387
358
|
this.deletePayCard = (args, headers) => {
|
|
388
359
|
return this.fetch(this.url('DeletePayCard'), createHTTPRequest(args, headers)).then(res => {
|
|
389
360
|
return buildResponse(res).then(_data => {
|
|
@@ -393,7 +364,6 @@ class API {
|
|
|
393
364
|
});
|
|
394
365
|
});
|
|
395
366
|
};
|
|
396
|
-
|
|
397
367
|
this.smartRampQuote = (args, headers) => {
|
|
398
368
|
return this.fetch(this.url('SmartRampQuote'), createHTTPRequest(args, headers)).then(res => {
|
|
399
369
|
return buildResponse(res).then(_data => {
|
|
@@ -404,7 +374,6 @@ class API {
|
|
|
404
374
|
});
|
|
405
375
|
});
|
|
406
376
|
};
|
|
407
|
-
|
|
408
377
|
this.smartRampPurchase = (args, headers) => {
|
|
409
378
|
return this.fetch(this.url('SmartRampPurchase'), createHTTPRequest(args, headers)).then(res => {
|
|
410
379
|
return buildResponse(res).then(_data => {
|
|
@@ -415,7 +384,6 @@ class API {
|
|
|
415
384
|
});
|
|
416
385
|
});
|
|
417
386
|
};
|
|
418
|
-
|
|
419
387
|
this.smartRampWaitOrderConfirmation = (args, headers) => {
|
|
420
388
|
return this.fetch(this.url('SmartRampWaitOrderConfirmation'), createHTTPRequest(args, headers)).then(res => {
|
|
421
389
|
return buildResponse(res).then(_data => {
|
|
@@ -426,7 +394,6 @@ class API {
|
|
|
426
394
|
});
|
|
427
395
|
});
|
|
428
396
|
};
|
|
429
|
-
|
|
430
397
|
this.smartRampGetOrder = (args, headers) => {
|
|
431
398
|
return this.fetch(this.url('SmartRampGetOrder'), createHTTPRequest(args, headers)).then(res => {
|
|
432
399
|
return buildResponse(res).then(_data => {
|
|
@@ -436,7 +403,6 @@ class API {
|
|
|
436
403
|
});
|
|
437
404
|
});
|
|
438
405
|
};
|
|
439
|
-
|
|
440
406
|
this.smartRampCheckCardAuthorization = (args, headers) => {
|
|
441
407
|
return this.fetch(this.url('SmartRampCheckCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
|
|
442
408
|
return buildResponse(res).then(_data => {
|
|
@@ -446,7 +412,6 @@ class API {
|
|
|
446
412
|
});
|
|
447
413
|
});
|
|
448
414
|
};
|
|
449
|
-
|
|
450
415
|
this.smartRampOrdersList = (args, headers) => {
|
|
451
416
|
return this.fetch(this.url('SmartRampOrdersList'), createHTTPRequest(args, headers)).then(res => {
|
|
452
417
|
return buildResponse(res).then(_data => {
|
|
@@ -457,7 +422,6 @@ class API {
|
|
|
457
422
|
});
|
|
458
423
|
});
|
|
459
424
|
};
|
|
460
|
-
|
|
461
425
|
this.smartRampGetOrderTxnHash = (args, headers) => {
|
|
462
426
|
return this.fetch(this.url('SmartRampGetOrderTxnHash'), createHTTPRequest(args, headers)).then(res => {
|
|
463
427
|
return buildResponse(res).then(_data => {
|
|
@@ -468,7 +432,6 @@ class API {
|
|
|
468
432
|
});
|
|
469
433
|
});
|
|
470
434
|
};
|
|
471
|
-
|
|
472
435
|
this.smartRampSubmitCardAuthorization = (args, headers) => {
|
|
473
436
|
return this.fetch(this.url('SmartRampSubmitCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
|
|
474
437
|
return buildResponse(res).then(_data => {
|
|
@@ -478,7 +441,33 @@ class API {
|
|
|
478
441
|
});
|
|
479
442
|
});
|
|
480
443
|
};
|
|
481
|
-
|
|
444
|
+
this.adminSmartRampGetOrder = (args, headers) => {
|
|
445
|
+
return this.fetch(this.url('AdminSmartRampGetOrder'), createHTTPRequest(args, headers)).then(res => {
|
|
446
|
+
return buildResponse(res).then(_data => {
|
|
447
|
+
return {
|
|
448
|
+
order: _data.order
|
|
449
|
+
};
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
};
|
|
453
|
+
this.adminSmartRampListCompletedOrders = (args, headers) => {
|
|
454
|
+
return this.fetch(this.url('AdminSmartRampListCompletedOrders'), createHTTPRequest(args, headers)).then(res => {
|
|
455
|
+
return buildResponse(res).then(_data => {
|
|
456
|
+
return {
|
|
457
|
+
orders: _data.orders
|
|
458
|
+
};
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
};
|
|
462
|
+
this.adminSmartRampListPendingOrders = (args, headers) => {
|
|
463
|
+
return this.fetch(this.url('AdminSmartRampListPendingOrders'), createHTTPRequest(args, headers)).then(res => {
|
|
464
|
+
return buildResponse(res).then(_data => {
|
|
465
|
+
return {
|
|
466
|
+
pendingOrders: _data.pendingOrders
|
|
467
|
+
};
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
};
|
|
482
471
|
this.getInviteInfo = headers => {
|
|
483
472
|
return this.fetch(this.url('GetInviteInfo'), createHTTPRequest({}, headers)).then(res => {
|
|
484
473
|
return buildResponse(res).then(_data => {
|
|
@@ -488,7 +477,6 @@ class API {
|
|
|
488
477
|
});
|
|
489
478
|
});
|
|
490
479
|
};
|
|
491
|
-
|
|
492
480
|
this.isValidAccessCode = (args, headers) => {
|
|
493
481
|
return this.fetch(this.url('IsValidAccessCode'), createHTTPRequest(args, headers)).then(res => {
|
|
494
482
|
return buildResponse(res).then(_data => {
|
|
@@ -498,7 +486,6 @@ class API {
|
|
|
498
486
|
});
|
|
499
487
|
});
|
|
500
488
|
};
|
|
501
|
-
|
|
502
489
|
this.internalClaimAccessCode = (args, headers) => {
|
|
503
490
|
return this.fetch(this.url('InternalClaimAccessCode'), createHTTPRequest(args, headers)).then(res => {
|
|
504
491
|
return buildResponse(res).then(_data => {
|
|
@@ -508,7 +495,6 @@ class API {
|
|
|
508
495
|
});
|
|
509
496
|
});
|
|
510
497
|
};
|
|
511
|
-
|
|
512
498
|
this.walletRecover = (args, headers) => {
|
|
513
499
|
return this.fetch(this.url('WalletRecover'), createHTTPRequest(args, headers)).then(res => {
|
|
514
500
|
return buildResponse(res).then(_data => {
|
|
@@ -518,7 +504,6 @@ class API {
|
|
|
518
504
|
});
|
|
519
505
|
});
|
|
520
506
|
};
|
|
521
|
-
|
|
522
507
|
this.blockNumberAtTime = (args, headers) => {
|
|
523
508
|
return this.fetch(this.url('BlockNumberAtTime'), createHTTPRequest(args, headers)).then(res => {
|
|
524
509
|
return buildResponse(res).then(_data => {
|
|
@@ -528,17 +513,13 @@ class API {
|
|
|
528
513
|
});
|
|
529
514
|
});
|
|
530
515
|
};
|
|
531
|
-
|
|
532
516
|
this.hostname = hostname;
|
|
533
|
-
this.fetch = fetch;
|
|
517
|
+
this.fetch = (input, init) => fetch(input, init);
|
|
534
518
|
}
|
|
535
|
-
|
|
536
519
|
url(name) {
|
|
537
520
|
return this.hostname + this.path + name;
|
|
538
521
|
}
|
|
539
|
-
|
|
540
522
|
}
|
|
541
|
-
|
|
542
523
|
const createHTTPRequest = (body = {}, headers = {}) => {
|
|
543
524
|
return {
|
|
544
525
|
method: 'POST',
|
|
@@ -548,11 +529,9 @@ const createHTTPRequest = (body = {}, headers = {}) => {
|
|
|
548
529
|
body: JSON.stringify(body || {})
|
|
549
530
|
};
|
|
550
531
|
};
|
|
551
|
-
|
|
552
532
|
const buildResponse = res => {
|
|
553
533
|
return res.text().then(text => {
|
|
554
534
|
let data;
|
|
555
|
-
|
|
556
535
|
try {
|
|
557
536
|
data = JSON.parse(text);
|
|
558
537
|
} catch (err) {
|
|
@@ -562,7 +541,6 @@ const buildResponse = res => {
|
|
|
562
541
|
status: res.status
|
|
563
542
|
};
|
|
564
543
|
}
|
|
565
|
-
|
|
566
544
|
if (!res.ok) {
|
|
567
545
|
throw data; // webrpc error response
|
|
568
546
|
}
|
|
@@ -573,26 +551,22 @@ const buildResponse = res => {
|
|
|
573
551
|
|
|
574
552
|
class SequenceAPIClient extends API {
|
|
575
553
|
constructor(hostname, jwtAuth) {
|
|
576
|
-
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
554
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, global.fetch);
|
|
577
555
|
this.jwtAuth = jwtAuth;
|
|
578
|
-
|
|
579
556
|
this._fetch = (input, init) => {
|
|
580
557
|
// automatically include jwt auth header to requests
|
|
581
558
|
// if its been set on the api client
|
|
582
559
|
const headers = {};
|
|
583
|
-
|
|
584
560
|
if (this.jwtAuth && this.jwtAuth.length > 0) {
|
|
585
561
|
headers['Authorization'] = `BEARER ${this.jwtAuth}`;
|
|
586
|
-
}
|
|
587
|
-
|
|
562
|
+
}
|
|
588
563
|
|
|
564
|
+
// before the request is made
|
|
589
565
|
init.headers = _extends({}, init.headers, headers);
|
|
590
|
-
return fetch(input, init);
|
|
566
|
+
return global.fetch(input, init);
|
|
591
567
|
};
|
|
592
|
-
|
|
593
568
|
this.fetch = this._fetch;
|
|
594
569
|
}
|
|
595
|
-
|
|
596
570
|
}
|
|
597
571
|
|
|
598
572
|
export { API, SequenceAPIClient, SmartRampOrderStatus, SmartRampTxnStatus, SortOrder, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const WebRPCVersion = "v1";
|
|
2
2
|
export declare const WebRPCSchemaVersion = "v0.4.0";
|
|
3
|
-
export declare const WebRPCSchemaHash = "
|
|
3
|
+
export declare const WebRPCSchemaHash = "8e34a4b927a5faab07d6558c21251a5218b82ac4";
|
|
4
4
|
export declare enum SmartRampOrderStatus {
|
|
5
5
|
UNKNOWN = "UNKNOWN",
|
|
6
6
|
RUNNING_CHECKS = "RUNNING_CHECKS",
|
|
@@ -262,6 +262,7 @@ export interface API {
|
|
|
262
262
|
userStorageDelete(args: UserStorageDeleteArgs, headers?: object): Promise<UserStorageDeleteReturn>;
|
|
263
263
|
userStorageFetchAll(args: UserStorageFetchAllArgs, headers?: object): Promise<UserStorageFetchAllReturn>;
|
|
264
264
|
getMoonpayLink(args: GetMoonpayLinkArgs, headers?: object): Promise<GetMoonpayLinkReturn>;
|
|
265
|
+
getSardineClientToken(headers?: object): Promise<GetSardineClientTokenReturn>;
|
|
265
266
|
isUsingGoogleMail(args: IsUsingGoogleMailArgs, headers?: object): Promise<IsUsingGoogleMailReturn>;
|
|
266
267
|
isValidSignature(args: IsValidSignatureArgs, headers?: object): Promise<IsValidSignatureReturn>;
|
|
267
268
|
isValidMessageSignature(args: IsValidMessageSignatureArgs, headers?: object): Promise<IsValidMessageSignatureReturn>;
|
|
@@ -282,6 +283,9 @@ export interface API {
|
|
|
282
283
|
smartRampOrdersList(args: SmartRampOrdersListArgs, headers?: object): Promise<SmartRampOrdersListReturn>;
|
|
283
284
|
smartRampGetOrderTxnHash(args: SmartRampGetOrderTxnHashArgs, headers?: object): Promise<SmartRampGetOrderTxnHashReturn>;
|
|
284
285
|
smartRampSubmitCardAuthorization(args: SmartRampSubmitCardAuthorizationArgs, headers?: object): Promise<SmartRampSubmitCardAuthorizationReturn>;
|
|
286
|
+
adminSmartRampGetOrder(args: AdminSmartRampGetOrderArgs, headers?: object): Promise<AdminSmartRampGetOrderReturn>;
|
|
287
|
+
adminSmartRampListCompletedOrders(args: AdminSmartRampListCompletedOrdersArgs, headers?: object): Promise<AdminSmartRampListCompletedOrdersReturn>;
|
|
288
|
+
adminSmartRampListPendingOrders(args: AdminSmartRampListPendingOrdersArgs, headers?: object): Promise<AdminSmartRampListPendingOrdersReturn>;
|
|
285
289
|
getInviteInfo(headers?: object): Promise<GetInviteInfoReturn>;
|
|
286
290
|
isValidAccessCode(args: IsValidAccessCodeArgs, headers?: object): Promise<IsValidAccessCodeReturn>;
|
|
287
291
|
internalClaimAccessCode(args: InternalClaimAccessCodeArgs, headers?: object): Promise<InternalClaimAccessCodeReturn>;
|
|
@@ -423,6 +427,11 @@ export interface GetMoonpayLinkArgs {
|
|
|
423
427
|
export interface GetMoonpayLinkReturn {
|
|
424
428
|
signedUrl: string;
|
|
425
429
|
}
|
|
430
|
+
export interface GetSardineClientTokenArgs {
|
|
431
|
+
}
|
|
432
|
+
export interface GetSardineClientTokenReturn {
|
|
433
|
+
token: string;
|
|
434
|
+
}
|
|
426
435
|
export interface IsUsingGoogleMailArgs {
|
|
427
436
|
domain: string;
|
|
428
437
|
}
|
|
@@ -566,6 +575,25 @@ export interface SmartRampSubmitCardAuthorizationArgs {
|
|
|
566
575
|
export interface SmartRampSubmitCardAuthorizationReturn {
|
|
567
576
|
status: boolean;
|
|
568
577
|
}
|
|
578
|
+
export interface AdminSmartRampGetOrderArgs {
|
|
579
|
+
orderId?: string;
|
|
580
|
+
id?: number;
|
|
581
|
+
}
|
|
582
|
+
export interface AdminSmartRampGetOrderReturn {
|
|
583
|
+
order: SmartRampOrder;
|
|
584
|
+
}
|
|
585
|
+
export interface AdminSmartRampListCompletedOrdersArgs {
|
|
586
|
+
accountAddress?: string;
|
|
587
|
+
}
|
|
588
|
+
export interface AdminSmartRampListCompletedOrdersReturn {
|
|
589
|
+
orders: Array<SmartRampOrder>;
|
|
590
|
+
}
|
|
591
|
+
export interface AdminSmartRampListPendingOrdersArgs {
|
|
592
|
+
accountAddress?: string;
|
|
593
|
+
}
|
|
594
|
+
export interface AdminSmartRampListPendingOrdersReturn {
|
|
595
|
+
pendingOrders: Array<SmartRampOrder>;
|
|
596
|
+
}
|
|
569
597
|
export interface GetInviteInfoArgs {
|
|
570
598
|
}
|
|
571
599
|
export interface GetInviteInfoReturn {
|
|
@@ -624,6 +652,7 @@ export declare class API implements API {
|
|
|
624
652
|
userStorageDelete: (args: UserStorageDeleteArgs, headers?: object | undefined) => Promise<UserStorageDeleteReturn>;
|
|
625
653
|
userStorageFetchAll: (args: UserStorageFetchAllArgs, headers?: object | undefined) => Promise<UserStorageFetchAllReturn>;
|
|
626
654
|
getMoonpayLink: (args: GetMoonpayLinkArgs, headers?: object | undefined) => Promise<GetMoonpayLinkReturn>;
|
|
655
|
+
getSardineClientToken: (headers?: object | undefined) => Promise<GetSardineClientTokenReturn>;
|
|
627
656
|
isUsingGoogleMail: (args: IsUsingGoogleMailArgs, headers?: object | undefined) => Promise<IsUsingGoogleMailReturn>;
|
|
628
657
|
isValidSignature: (args: IsValidSignatureArgs, headers?: object | undefined) => Promise<IsValidSignatureReturn>;
|
|
629
658
|
isValidMessageSignature: (args: IsValidMessageSignatureArgs, headers?: object | undefined) => Promise<IsValidMessageSignatureReturn>;
|
|
@@ -644,6 +673,9 @@ export declare class API implements API {
|
|
|
644
673
|
smartRampOrdersList: (args: SmartRampOrdersListArgs, headers?: object | undefined) => Promise<SmartRampOrdersListReturn>;
|
|
645
674
|
smartRampGetOrderTxnHash: (args: SmartRampGetOrderTxnHashArgs, headers?: object | undefined) => Promise<SmartRampGetOrderTxnHashReturn>;
|
|
646
675
|
smartRampSubmitCardAuthorization: (args: SmartRampSubmitCardAuthorizationArgs, headers?: object | undefined) => Promise<SmartRampSubmitCardAuthorizationReturn>;
|
|
676
|
+
adminSmartRampGetOrder: (args: AdminSmartRampGetOrderArgs, headers?: object | undefined) => Promise<AdminSmartRampGetOrderReturn>;
|
|
677
|
+
adminSmartRampListCompletedOrders: (args: AdminSmartRampListCompletedOrdersArgs, headers?: object | undefined) => Promise<AdminSmartRampListCompletedOrdersReturn>;
|
|
678
|
+
adminSmartRampListPendingOrders: (args: AdminSmartRampListPendingOrdersArgs, headers?: object | undefined) => Promise<AdminSmartRampListPendingOrdersReturn>;
|
|
647
679
|
getInviteInfo: (headers?: object | undefined) => Promise<GetInviteInfoReturn>;
|
|
648
680
|
isValidAccessCode: (args: IsValidAccessCodeArgs, headers?: object | undefined) => Promise<IsValidAccessCodeReturn>;
|
|
649
681
|
internalClaimAccessCode: (args: InternalClaimAccessCodeArgs, headers?: object | undefined) => Promise<InternalClaimAccessCodeReturn>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './api.gen';
|
|
2
|
-
import { API as
|
|
3
|
-
export declare class SequenceAPIClient extends
|
|
2
|
+
import { API as ApiRpc } from './api.gen';
|
|
3
|
+
export declare class SequenceAPIClient extends ApiRpc {
|
|
4
4
|
jwtAuth?: string | undefined;
|
|
5
5
|
constructor(hostname: string, jwtAuth?: string | undefined);
|
|
6
|
-
_fetch: (input: RequestInfo, init?: RequestInit
|
|
6
|
+
_fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "api sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/api",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
"test": "echo",
|
|
13
13
|
"typecheck": "tsc --noEmit"
|
|
14
14
|
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"cross-fetch": "^3.1.5"
|
|
17
|
-
},
|
|
15
|
+
"dependencies": {},
|
|
18
16
|
"peerDependencies": {},
|
|
19
17
|
"devDependencies": {},
|
|
20
18
|
"files": [
|