@0xsequence/api 0.0.0-20220513134147 → 0.0.0-20220601185217

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.
@@ -27,7 +27,7 @@ function _extends() {
27
27
  }
28
28
 
29
29
  /* eslint-disable */
30
- // sequence-api v0.4.0 349b76404687929fc391d0fc3329988c3dd90d00
30
+ // sequence-api v0.4.0 451d96d5692d65926fddc63c8a6912af960a3dd1
31
31
  // --
32
32
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
33
33
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -36,10 +36,20 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
36
36
 
37
37
  const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
38
38
 
39
- const WebRPCSchemaHash = "349b76404687929fc391d0fc3329988c3dd90d00"; //
39
+ const WebRPCSchemaHash = "451d96d5692d65926fddc63c8a6912af960a3dd1"; //
40
40
  // Types
41
41
  //
42
42
 
43
+ exports.SmartRampOrderStatus = void 0;
44
+
45
+ (function (SmartRampOrderStatus) {
46
+ SmartRampOrderStatus["UNKNOWN"] = "UNKNOWN";
47
+ SmartRampOrderStatus["RUNNING_CHECKS"] = "RUNNING_CHECKS";
48
+ SmartRampOrderStatus["PROCESSING"] = "PROCESSING";
49
+ SmartRampOrderStatus["FAILED"] = "FAILED";
50
+ SmartRampOrderStatus["COMPLETE"] = "COMPLETE";
51
+ })(exports.SmartRampOrderStatus || (exports.SmartRampOrderStatus = {}));
52
+
43
53
  exports.SortOrder = void 0;
44
54
 
45
55
  (function (SortOrder) {
@@ -273,8 +283,8 @@ class API {
273
283
  });
274
284
  };
275
285
 
276
- this.getTokenPrices = (args, headers) => {
277
- return this.fetch(this.url('GetTokenPrices'), createHTTPRequest(args, headers)).then(res => {
286
+ this.getCoinPrices = (args, headers) => {
287
+ return this.fetch(this.url('GetCoinPrices'), createHTTPRequest(args, headers)).then(res => {
278
288
  return buildResponse(res).then(_data => {
279
289
  return {
280
290
  tokenPrices: _data.tokenPrices
@@ -293,6 +303,100 @@ class API {
293
303
  });
294
304
  };
295
305
 
306
+ this.getExchangeRate = (args, headers) => {
307
+ return this.fetch(this.url('GetExchangeRate'), createHTTPRequest(args, headers)).then(res => {
308
+ return buildResponse(res).then(_data => {
309
+ return {
310
+ exchangeRate: _data.exchangeRate
311
+ };
312
+ });
313
+ });
314
+ };
315
+
316
+ this.listPayCardsOnFile = headers => {
317
+ return this.fetch(this.url('ListPayCardsOnFile'), createHTTPRequest({}, headers)).then(res => {
318
+ return buildResponse(res).then(_data => {
319
+ return {
320
+ payCards: _data.payCards
321
+ };
322
+ });
323
+ });
324
+ };
325
+
326
+ this.savePayCard = (args, headers) => {
327
+ return this.fetch(this.url('SavePayCard'), createHTTPRequest(args, headers)).then(res => {
328
+ return buildResponse(res).then(_data => {
329
+ return {
330
+ ok: _data.ok,
331
+ payCard: _data.payCard
332
+ };
333
+ });
334
+ });
335
+ };
336
+
337
+ this.deletePayCard = (args, headers) => {
338
+ return this.fetch(this.url('DeletePayCard'), createHTTPRequest(args, headers)).then(res => {
339
+ return buildResponse(res).then(_data => {
340
+ return {
341
+ ok: _data.ok
342
+ };
343
+ });
344
+ });
345
+ };
346
+
347
+ this.smartRampQuote = (args, headers) => {
348
+ return this.fetch(this.url('SmartRampQuote'), createHTTPRequest(args, headers)).then(res => {
349
+ return buildResponse(res).then(_data => {
350
+ return {
351
+ status: _data.status,
352
+ quoteDetails: _data.quoteDetails
353
+ };
354
+ });
355
+ });
356
+ };
357
+
358
+ this.smartRampPurchase = (args, headers) => {
359
+ return this.fetch(this.url('SmartRampPurchase'), createHTTPRequest(args, headers)).then(res => {
360
+ return buildResponse(res).then(_data => {
361
+ return {
362
+ processing: _data.processing,
363
+ receipt: _data.receipt
364
+ };
365
+ });
366
+ });
367
+ };
368
+
369
+ this.smartRampWaitOrderConfirmation = (args, headers) => {
370
+ return this.fetch(this.url('SmartRampWaitOrderConfirmation'), createHTTPRequest(args, headers)).then(res => {
371
+ return buildResponse(res).then(_data => {
372
+ return {
373
+ done: _data.done,
374
+ receipt: _data.receipt
375
+ };
376
+ });
377
+ });
378
+ };
379
+
380
+ this.smartRampCheckCardAuthorization = (args, headers) => {
381
+ return this.fetch(this.url('SmartRampCheckCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
382
+ return buildResponse(res).then(_data => {
383
+ return {
384
+ cardAuth: _data.cardAuth
385
+ };
386
+ });
387
+ });
388
+ };
389
+
390
+ this.smartRampSubmitCardAuthorization = (args, headers) => {
391
+ return this.fetch(this.url('SmartRampSubmitCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
392
+ return buildResponse(res).then(_data => {
393
+ return {
394
+ status: _data.status
395
+ };
396
+ });
397
+ });
398
+ };
399
+
296
400
  this.getInviteInfo = headers => {
297
401
  return this.fetch(this.url('GetInviteInfo'), createHTTPRequest({}, headers)).then(res => {
298
402
  return buildResponse(res).then(_data => {
@@ -27,7 +27,7 @@ function _extends() {
27
27
  }
28
28
 
29
29
  /* eslint-disable */
30
- // sequence-api v0.4.0 349b76404687929fc391d0fc3329988c3dd90d00
30
+ // sequence-api v0.4.0 451d96d5692d65926fddc63c8a6912af960a3dd1
31
31
  // --
32
32
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
33
33
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -36,10 +36,20 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
36
36
 
37
37
  const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
38
38
 
39
- const WebRPCSchemaHash = "349b76404687929fc391d0fc3329988c3dd90d00"; //
39
+ const WebRPCSchemaHash = "451d96d5692d65926fddc63c8a6912af960a3dd1"; //
40
40
  // Types
41
41
  //
42
42
 
43
+ exports.SmartRampOrderStatus = void 0;
44
+
45
+ (function (SmartRampOrderStatus) {
46
+ SmartRampOrderStatus["UNKNOWN"] = "UNKNOWN";
47
+ SmartRampOrderStatus["RUNNING_CHECKS"] = "RUNNING_CHECKS";
48
+ SmartRampOrderStatus["PROCESSING"] = "PROCESSING";
49
+ SmartRampOrderStatus["FAILED"] = "FAILED";
50
+ SmartRampOrderStatus["COMPLETE"] = "COMPLETE";
51
+ })(exports.SmartRampOrderStatus || (exports.SmartRampOrderStatus = {}));
52
+
43
53
  exports.SortOrder = void 0;
44
54
 
45
55
  (function (SortOrder) {
@@ -273,8 +283,8 @@ class API {
273
283
  });
274
284
  };
275
285
 
276
- this.getTokenPrices = (args, headers) => {
277
- return this.fetch(this.url('GetTokenPrices'), createHTTPRequest(args, headers)).then(res => {
286
+ this.getCoinPrices = (args, headers) => {
287
+ return this.fetch(this.url('GetCoinPrices'), createHTTPRequest(args, headers)).then(res => {
278
288
  return buildResponse(res).then(_data => {
279
289
  return {
280
290
  tokenPrices: _data.tokenPrices
@@ -293,6 +303,100 @@ class API {
293
303
  });
294
304
  };
295
305
 
306
+ this.getExchangeRate = (args, headers) => {
307
+ return this.fetch(this.url('GetExchangeRate'), createHTTPRequest(args, headers)).then(res => {
308
+ return buildResponse(res).then(_data => {
309
+ return {
310
+ exchangeRate: _data.exchangeRate
311
+ };
312
+ });
313
+ });
314
+ };
315
+
316
+ this.listPayCardsOnFile = headers => {
317
+ return this.fetch(this.url('ListPayCardsOnFile'), createHTTPRequest({}, headers)).then(res => {
318
+ return buildResponse(res).then(_data => {
319
+ return {
320
+ payCards: _data.payCards
321
+ };
322
+ });
323
+ });
324
+ };
325
+
326
+ this.savePayCard = (args, headers) => {
327
+ return this.fetch(this.url('SavePayCard'), createHTTPRequest(args, headers)).then(res => {
328
+ return buildResponse(res).then(_data => {
329
+ return {
330
+ ok: _data.ok,
331
+ payCard: _data.payCard
332
+ };
333
+ });
334
+ });
335
+ };
336
+
337
+ this.deletePayCard = (args, headers) => {
338
+ return this.fetch(this.url('DeletePayCard'), createHTTPRequest(args, headers)).then(res => {
339
+ return buildResponse(res).then(_data => {
340
+ return {
341
+ ok: _data.ok
342
+ };
343
+ });
344
+ });
345
+ };
346
+
347
+ this.smartRampQuote = (args, headers) => {
348
+ return this.fetch(this.url('SmartRampQuote'), createHTTPRequest(args, headers)).then(res => {
349
+ return buildResponse(res).then(_data => {
350
+ return {
351
+ status: _data.status,
352
+ quoteDetails: _data.quoteDetails
353
+ };
354
+ });
355
+ });
356
+ };
357
+
358
+ this.smartRampPurchase = (args, headers) => {
359
+ return this.fetch(this.url('SmartRampPurchase'), createHTTPRequest(args, headers)).then(res => {
360
+ return buildResponse(res).then(_data => {
361
+ return {
362
+ processing: _data.processing,
363
+ receipt: _data.receipt
364
+ };
365
+ });
366
+ });
367
+ };
368
+
369
+ this.smartRampWaitOrderConfirmation = (args, headers) => {
370
+ return this.fetch(this.url('SmartRampWaitOrderConfirmation'), createHTTPRequest(args, headers)).then(res => {
371
+ return buildResponse(res).then(_data => {
372
+ return {
373
+ done: _data.done,
374
+ receipt: _data.receipt
375
+ };
376
+ });
377
+ });
378
+ };
379
+
380
+ this.smartRampCheckCardAuthorization = (args, headers) => {
381
+ return this.fetch(this.url('SmartRampCheckCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
382
+ return buildResponse(res).then(_data => {
383
+ return {
384
+ cardAuth: _data.cardAuth
385
+ };
386
+ });
387
+ });
388
+ };
389
+
390
+ this.smartRampSubmitCardAuthorization = (args, headers) => {
391
+ return this.fetch(this.url('SmartRampSubmitCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
392
+ return buildResponse(res).then(_data => {
393
+ return {
394
+ status: _data.status
395
+ };
396
+ });
397
+ });
398
+ };
399
+
296
400
  this.getInviteInfo = headers => {
297
401
  return this.fetch(this.url('GetInviteInfo'), createHTTPRequest({}, headers)).then(res => {
298
402
  return buildResponse(res).then(_data => {
@@ -19,7 +19,7 @@ function _extends() {
19
19
  }
20
20
 
21
21
  /* eslint-disable */
22
- // sequence-api v0.4.0 349b76404687929fc391d0fc3329988c3dd90d00
22
+ // sequence-api v0.4.0 451d96d5692d65926fddc63c8a6912af960a3dd1
23
23
  // --
24
24
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
25
25
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -28,10 +28,20 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
28
28
 
29
29
  const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
30
30
 
31
- const WebRPCSchemaHash = "349b76404687929fc391d0fc3329988c3dd90d00"; //
31
+ const WebRPCSchemaHash = "451d96d5692d65926fddc63c8a6912af960a3dd1"; //
32
32
  // Types
33
33
  //
34
34
 
35
+ let SmartRampOrderStatus;
36
+
37
+ (function (SmartRampOrderStatus) {
38
+ SmartRampOrderStatus["UNKNOWN"] = "UNKNOWN";
39
+ SmartRampOrderStatus["RUNNING_CHECKS"] = "RUNNING_CHECKS";
40
+ SmartRampOrderStatus["PROCESSING"] = "PROCESSING";
41
+ SmartRampOrderStatus["FAILED"] = "FAILED";
42
+ SmartRampOrderStatus["COMPLETE"] = "COMPLETE";
43
+ })(SmartRampOrderStatus || (SmartRampOrderStatus = {}));
44
+
35
45
  let SortOrder;
36
46
 
37
47
  (function (SortOrder) {
@@ -265,8 +275,8 @@ class API {
265
275
  });
266
276
  };
267
277
 
268
- this.getTokenPrices = (args, headers) => {
269
- return this.fetch(this.url('GetTokenPrices'), createHTTPRequest(args, headers)).then(res => {
278
+ this.getCoinPrices = (args, headers) => {
279
+ return this.fetch(this.url('GetCoinPrices'), createHTTPRequest(args, headers)).then(res => {
270
280
  return buildResponse(res).then(_data => {
271
281
  return {
272
282
  tokenPrices: _data.tokenPrices
@@ -285,6 +295,100 @@ class API {
285
295
  });
286
296
  };
287
297
 
298
+ this.getExchangeRate = (args, headers) => {
299
+ return this.fetch(this.url('GetExchangeRate'), createHTTPRequest(args, headers)).then(res => {
300
+ return buildResponse(res).then(_data => {
301
+ return {
302
+ exchangeRate: _data.exchangeRate
303
+ };
304
+ });
305
+ });
306
+ };
307
+
308
+ this.listPayCardsOnFile = headers => {
309
+ return this.fetch(this.url('ListPayCardsOnFile'), createHTTPRequest({}, headers)).then(res => {
310
+ return buildResponse(res).then(_data => {
311
+ return {
312
+ payCards: _data.payCards
313
+ };
314
+ });
315
+ });
316
+ };
317
+
318
+ this.savePayCard = (args, headers) => {
319
+ return this.fetch(this.url('SavePayCard'), createHTTPRequest(args, headers)).then(res => {
320
+ return buildResponse(res).then(_data => {
321
+ return {
322
+ ok: _data.ok,
323
+ payCard: _data.payCard
324
+ };
325
+ });
326
+ });
327
+ };
328
+
329
+ this.deletePayCard = (args, headers) => {
330
+ return this.fetch(this.url('DeletePayCard'), createHTTPRequest(args, headers)).then(res => {
331
+ return buildResponse(res).then(_data => {
332
+ return {
333
+ ok: _data.ok
334
+ };
335
+ });
336
+ });
337
+ };
338
+
339
+ this.smartRampQuote = (args, headers) => {
340
+ return this.fetch(this.url('SmartRampQuote'), createHTTPRequest(args, headers)).then(res => {
341
+ return buildResponse(res).then(_data => {
342
+ return {
343
+ status: _data.status,
344
+ quoteDetails: _data.quoteDetails
345
+ };
346
+ });
347
+ });
348
+ };
349
+
350
+ this.smartRampPurchase = (args, headers) => {
351
+ return this.fetch(this.url('SmartRampPurchase'), createHTTPRequest(args, headers)).then(res => {
352
+ return buildResponse(res).then(_data => {
353
+ return {
354
+ processing: _data.processing,
355
+ receipt: _data.receipt
356
+ };
357
+ });
358
+ });
359
+ };
360
+
361
+ this.smartRampWaitOrderConfirmation = (args, headers) => {
362
+ return this.fetch(this.url('SmartRampWaitOrderConfirmation'), createHTTPRequest(args, headers)).then(res => {
363
+ return buildResponse(res).then(_data => {
364
+ return {
365
+ done: _data.done,
366
+ receipt: _data.receipt
367
+ };
368
+ });
369
+ });
370
+ };
371
+
372
+ this.smartRampCheckCardAuthorization = (args, headers) => {
373
+ return this.fetch(this.url('SmartRampCheckCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
374
+ return buildResponse(res).then(_data => {
375
+ return {
376
+ cardAuth: _data.cardAuth
377
+ };
378
+ });
379
+ });
380
+ };
381
+
382
+ this.smartRampSubmitCardAuthorization = (args, headers) => {
383
+ return this.fetch(this.url('SmartRampSubmitCardAuthorization'), createHTTPRequest(args, headers)).then(res => {
384
+ return buildResponse(res).then(_data => {
385
+ return {
386
+ status: _data.status
387
+ };
388
+ });
389
+ });
390
+ };
391
+
288
392
  this.getInviteInfo = headers => {
289
393
  return this.fetch(this.url('GetInviteInfo'), createHTTPRequest({}, headers)).then(res => {
290
394
  return buildResponse(res).then(_data => {
@@ -391,4 +495,4 @@ class SequenceAPIClient extends API {
391
495
 
392
496
  }
393
497
 
394
- export { API, SequenceAPIClient, SortOrder, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
498
+ export { API, SequenceAPIClient, SmartRampOrderStatus, SortOrder, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
@@ -1,6 +1,13 @@
1
1
  export declare const WebRPCVersion = "v1";
2
2
  export declare const WebRPCSchemaVersion = "v0.4.0";
3
- export declare const WebRPCSchemaHash = "349b76404687929fc391d0fc3329988c3dd90d00";
3
+ export declare const WebRPCSchemaHash = "451d96d5692d65926fddc63c8a6912af960a3dd1";
4
+ export declare enum SmartRampOrderStatus {
5
+ UNKNOWN = "UNKNOWN",
6
+ RUNNING_CHECKS = "RUNNING_CHECKS",
7
+ PROCESSING = "PROCESSING",
8
+ FAILED = "FAILED",
9
+ COMPLETE = "COMPLETE"
10
+ }
4
11
  export declare enum SortOrder {
5
12
  DESC = "DESC",
6
13
  ASC = "ASC"
@@ -78,9 +85,9 @@ export interface InviteInfo {
78
85
  export interface ContractCall {
79
86
  signature: string;
80
87
  function: string;
81
- args: Array<ContractCallArg>;
88
+ args: Array<TupleComponent>;
82
89
  }
83
- export interface ContractCallArg {
90
+ export interface TupleComponent {
84
91
  name?: string;
85
92
  type: string;
86
93
  value: any;
@@ -99,6 +106,112 @@ export interface UserStorage {
99
106
  key: string;
100
107
  value: any;
101
108
  }
109
+ export interface Token {
110
+ chainId: number;
111
+ contractAddress: string;
112
+ tokenId?: string;
113
+ }
114
+ export interface Price {
115
+ value: number;
116
+ currency: string;
117
+ }
118
+ export interface TokenPrice {
119
+ token: Token;
120
+ price?: Price;
121
+ price24hChange?: Price;
122
+ floorPrice: Price;
123
+ buyPrice: Price;
124
+ sellPrice: Price;
125
+ updatedAt: string;
126
+ }
127
+ export interface ExchangeRate {
128
+ name: string;
129
+ symbol: string;
130
+ value: number;
131
+ vsCurrency: string;
132
+ currencyType: string;
133
+ }
134
+ export interface PayCard {
135
+ id: number;
136
+ userAddress: string;
137
+ cardType: string;
138
+ cardFirstName: string;
139
+ cardLastName: string;
140
+ cardNumberLastFourDigits: string;
141
+ cardNumberToken: string;
142
+ cardCVCToken: string;
143
+ cardExpMonth: number;
144
+ cardExpYear: number;
145
+ contactAddressToken: string;
146
+ contactCityToken: string;
147
+ contactProvinceToken: string;
148
+ contactPostalCodeToken: string;
149
+ contactCountryCode: string;
150
+ contactEmail: string;
151
+ contactPhoneToken: string;
152
+ updatedAt?: string;
153
+ createdAt?: string;
154
+ }
155
+ export interface SmartRampQuoteRequest {
156
+ countryCode: string;
157
+ niftyswapContractAddress: string;
158
+ tokenIds: Array<number>;
159
+ tokensBoughtAmounts: Array<number>;
160
+ maxCurrency: number;
161
+ }
162
+ export interface SmartRampQuoteDetails {
163
+ quoteId: string;
164
+ smartScriptId: string;
165
+ quoteRequest: SmartRampQuoteRequest;
166
+ recipientAddress: string;
167
+ purchaseAmount: number;
168
+ purchaseFees: number;
169
+ purchaseTotal: number;
170
+ sourceCurrency: string;
171
+ destCurrency: string;
172
+ }
173
+ export interface SmartRampPurchaseReceipt {
174
+ orderId: string;
175
+ quoteId: string;
176
+ smartScriptId: string;
177
+ createdAt: string;
178
+ status: SmartRampOrderStatus;
179
+ authCodesRequested: boolean;
180
+ authCodesSubmitted: boolean;
181
+ sourceCurrency: string;
182
+ purchaseAmount: number;
183
+ purchaseFees: number;
184
+ purchaseTotal: number;
185
+ }
186
+ export interface SmartRampOrder {
187
+ id: number;
188
+ userAddress: string;
189
+ contractAddress: string;
190
+ payCardId: number;
191
+ orderId: string;
192
+ quoteId: string;
193
+ status: SmartRampOrderStatus;
194
+ authCodesRequested: boolean;
195
+ authCodesSubmitted: boolean;
196
+ countryCode: string;
197
+ email: string;
198
+ sourceCurrency: string;
199
+ destCurrency: string;
200
+ purchaseAmount: number;
201
+ purchaseFees: number;
202
+ purchaseTotal: number;
203
+ smartScriptParams: {
204
+ [key: string]: any;
205
+ };
206
+ updatedAt?: string;
207
+ createdAt?: string;
208
+ }
209
+ export interface PayCardAuth {
210
+ orderId: string;
211
+ smsNeeded: boolean;
212
+ card2faNeeded: boolean;
213
+ authorization3dsUrl: string;
214
+ }
102
215
  export interface Page {
103
216
  pageSize?: number;
104
217
  page?: number;
@@ -112,17 +225,6 @@ export interface SortBy {
112
225
  column: string;
113
226
  order: SortOrder;
114
227
  }
115
- export interface Token {
116
- chainId: number;
117
- contractAddress: string;
118
- tokenId?: string;
119
- }
120
- export interface TokenPrice {
121
- token: Token;
122
- usd?: number;
123
- usd24hChange?: number;
124
- updatedAt: string;
125
- }
126
228
  export interface API {
127
229
  ping(headers?: object): Promise<PingReturn>;
128
230
  version(headers?: object): Promise<VersionReturn>;
@@ -145,8 +247,17 @@ export interface API {
145
247
  userStorageFetchAll(args: UserStorageFetchAllArgs, headers?: object): Promise<UserStorageFetchAllReturn>;
146
248
  getMoonpayLink(args: GetMoonpayLinkArgs, headers?: object): Promise<GetMoonpayLinkReturn>;
147
249
  isUsingGoogleMail(args: IsUsingGoogleMailArgs, headers?: object): Promise<IsUsingGoogleMailReturn>;
148
- getTokenPrices(args: GetTokenPricesArgs, headers?: object): Promise<GetTokenPricesReturn>;
250
+ getCoinPrices(args: GetCoinPricesArgs, headers?: object): Promise<GetCoinPricesReturn>;
149
251
  getCollectiblePrices(args: GetCollectiblePricesArgs, headers?: object): Promise<GetCollectiblePricesReturn>;
252
+ getExchangeRate(args: GetExchangeRateArgs, headers?: object): Promise<GetExchangeRateReturn>;
253
+ listPayCardsOnFile(headers?: object): Promise<ListPayCardsOnFileReturn>;
254
+ savePayCard(args: SavePayCardArgs, headers?: object): Promise<SavePayCardReturn>;
255
+ deletePayCard(args: DeletePayCardArgs, headers?: object): Promise<DeletePayCardReturn>;
256
+ smartRampQuote(args: SmartRampQuoteArgs, headers?: object): Promise<SmartRampQuoteReturn>;
257
+ smartRampPurchase(args: SmartRampPurchaseArgs, headers?: object): Promise<SmartRampPurchaseReturn>;
258
+ smartRampWaitOrderConfirmation(args: SmartRampWaitOrderConfirmationArgs, headers?: object): Promise<SmartRampWaitOrderConfirmationReturn>;
259
+ smartRampCheckCardAuthorization(args: SmartRampCheckCardAuthorizationArgs, headers?: object): Promise<SmartRampCheckCardAuthorizationReturn>;
260
+ smartRampSubmitCardAuthorization(args: SmartRampSubmitCardAuthorizationArgs, headers?: object): Promise<SmartRampSubmitCardAuthorizationReturn>;
150
261
  getInviteInfo(headers?: object): Promise<GetInviteInfoReturn>;
151
262
  isValidAccessCode(args: IsValidAccessCodeArgs, headers?: object): Promise<IsValidAccessCodeReturn>;
152
263
  internalClaimAccessCode(args: InternalClaimAccessCodeArgs, headers?: object): Promise<InternalClaimAccessCodeReturn>;
@@ -293,10 +404,10 @@ export interface IsUsingGoogleMailArgs {
293
404
  export interface IsUsingGoogleMailReturn {
294
405
  yes: boolean;
295
406
  }
296
- export interface GetTokenPricesArgs {
407
+ export interface GetCoinPricesArgs {
297
408
  tokens: Array<Token>;
298
409
  }
299
- export interface GetTokenPricesReturn {
410
+ export interface GetCoinPricesReturn {
300
411
  tokenPrices: Array<TokenPrice>;
301
412
  }
302
413
  export interface GetCollectiblePricesArgs {
@@ -305,6 +416,66 @@ export interface GetCollectiblePricesArgs {
305
416
  export interface GetCollectiblePricesReturn {
306
417
  tokenPrices: Array<TokenPrice>;
307
418
  }
419
+ export interface GetExchangeRateArgs {
420
+ toCurrency: string;
421
+ }
422
+ export interface GetExchangeRateReturn {
423
+ exchangeRate: ExchangeRate;
424
+ }
425
+ export interface ListPayCardsOnFileArgs {
426
+ }
427
+ export interface ListPayCardsOnFileReturn {
428
+ payCards: Array<PayCard>;
429
+ }
430
+ export interface SavePayCardArgs {
431
+ payCard: PayCard;
432
+ }
433
+ export interface SavePayCardReturn {
434
+ ok: boolean;
435
+ payCard: PayCard;
436
+ }
437
+ export interface DeletePayCardArgs {
438
+ payCardId: number;
439
+ }
440
+ export interface DeletePayCardReturn {
441
+ ok: boolean;
442
+ }
443
+ export interface SmartRampQuoteArgs {
444
+ quoteRequest: SmartRampQuoteRequest;
445
+ }
446
+ export interface SmartRampQuoteReturn {
447
+ status: boolean;
448
+ quoteDetails: SmartRampQuoteDetails;
449
+ }
450
+ export interface SmartRampPurchaseArgs {
451
+ quoteDetails: SmartRampQuoteDetails;
452
+ payCardId: number;
453
+ }
454
+ export interface SmartRampPurchaseReturn {
455
+ processing: boolean;
456
+ receipt: SmartRampPurchaseReceipt;
457
+ }
458
+ export interface SmartRampWaitOrderConfirmationArgs {
459
+ orderId: string;
460
+ }
461
+ export interface SmartRampWaitOrderConfirmationReturn {
462
+ done: boolean;
463
+ receipt: SmartRampPurchaseReceipt;
464
+ }
465
+ export interface SmartRampCheckCardAuthorizationArgs {
466
+ orderId: string;
467
+ }
468
+ export interface SmartRampCheckCardAuthorizationReturn {
469
+ cardAuth: PayCardAuth;
470
+ }
471
+ export interface SmartRampSubmitCardAuthorizationArgs {
472
+ orderId: string;
473
+ sms?: string;
474
+ card2fa?: string;
475
+ }
476
+ export interface SmartRampSubmitCardAuthorizationReturn {
477
+ status: boolean;
478
+ }
308
479
  export interface GetInviteInfoArgs {
309
480
  }
310
481
  export interface GetInviteInfoReturn {
@@ -357,8 +528,17 @@ export declare class API implements API {
357
528
  userStorageFetchAll: (args: UserStorageFetchAllArgs, headers?: object | undefined) => Promise<UserStorageFetchAllReturn>;
358
529
  getMoonpayLink: (args: GetMoonpayLinkArgs, headers?: object | undefined) => Promise<GetMoonpayLinkReturn>;
359
530
  isUsingGoogleMail: (args: IsUsingGoogleMailArgs, headers?: object | undefined) => Promise<IsUsingGoogleMailReturn>;
360
- getTokenPrices: (args: GetTokenPricesArgs, headers?: object | undefined) => Promise<GetTokenPricesReturn>;
531
+ getCoinPrices: (args: GetCoinPricesArgs, headers?: object | undefined) => Promise<GetCoinPricesReturn>;
361
532
  getCollectiblePrices: (args: GetCollectiblePricesArgs, headers?: object | undefined) => Promise<GetCollectiblePricesReturn>;
533
+ getExchangeRate: (args: GetExchangeRateArgs, headers?: object | undefined) => Promise<GetExchangeRateReturn>;
534
+ listPayCardsOnFile: (headers?: object | undefined) => Promise<ListPayCardsOnFileReturn>;
535
+ savePayCard: (args: SavePayCardArgs, headers?: object | undefined) => Promise<SavePayCardReturn>;
536
+ deletePayCard: (args: DeletePayCardArgs, headers?: object | undefined) => Promise<DeletePayCardReturn>;
537
+ smartRampQuote: (args: SmartRampQuoteArgs, headers?: object | undefined) => Promise<SmartRampQuoteReturn>;
538
+ smartRampPurchase: (args: SmartRampPurchaseArgs, headers?: object | undefined) => Promise<SmartRampPurchaseReturn>;
539
+ smartRampWaitOrderConfirmation: (args: SmartRampWaitOrderConfirmationArgs, headers?: object | undefined) => Promise<SmartRampWaitOrderConfirmationReturn>;
540
+ smartRampCheckCardAuthorization: (args: SmartRampCheckCardAuthorizationArgs, headers?: object | undefined) => Promise<SmartRampCheckCardAuthorizationReturn>;
541
+ smartRampSubmitCardAuthorization: (args: SmartRampSubmitCardAuthorizationArgs, headers?: object | undefined) => Promise<SmartRampSubmitCardAuthorizationReturn>;
362
542
  getInviteInfo: (headers?: object | undefined) => Promise<GetInviteInfoReturn>;
363
543
  isValidAccessCode: (args: IsValidAccessCodeArgs, headers?: object | undefined) => Promise<IsValidAccessCodeReturn>;
364
544
  internalClaimAccessCode: (args: InternalClaimAccessCodeArgs, headers?: object | undefined) => Promise<InternalClaimAccessCodeReturn>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/api",
3
- "version": "0.0.0-20220513134147",
3
+ "version": "0.0.0-20220601185217",
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",
package/src/api.gen.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // sequence-api v0.4.0 349b76404687929fc391d0fc3329988c3dd90d00
2
+ // sequence-api v0.4.0 451d96d5692d65926fddc63c8a6912af960a3dd1
3
3
  // --
4
4
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
5
5
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -11,12 +11,20 @@ export const WebRPCVersion = "v1"
11
11
  export const WebRPCSchemaVersion = "v0.4.0"
12
12
 
13
13
  // Schema hash generated from your RIDL schema
14
- export const WebRPCSchemaHash = "349b76404687929fc391d0fc3329988c3dd90d00"
14
+ export const WebRPCSchemaHash = "451d96d5692d65926fddc63c8a6912af960a3dd1"
15
15
 
16
16
 
17
17
  //
18
18
  // Types
19
19
  //
20
+ export enum SmartRampOrderStatus {
21
+ UNKNOWN = 'UNKNOWN',
22
+ RUNNING_CHECKS = 'RUNNING_CHECKS',
23
+ PROCESSING = 'PROCESSING',
24
+ FAILED = 'FAILED',
25
+ COMPLETE = 'COMPLETE'
26
+ }
27
+
20
28
  export enum SortOrder {
21
29
  DESC = 'DESC',
22
30
  ASC = 'ASC'
@@ -110,10 +118,10 @@ export interface InviteInfo {
110
118
  export interface ContractCall {
111
119
  signature: string
112
120
  function: string
113
- args: Array<ContractCallArg>
121
+ args: Array<TupleComponent>
114
122
  }
115
123
 
116
- export interface ContractCallArg {
124
+ export interface TupleComponent {
117
125
  name?: string
118
126
  type: string
119
127
  value: any
@@ -135,6 +143,120 @@ export interface UserStorage {
135
143
  value: any
136
144
  }
137
145
 
146
+ export interface Token {
147
+ chainId: number
148
+ contractAddress: string
149
+ tokenId?: string
150
+ }
151
+
152
+ export interface Price {
153
+ value: number
154
+ currency: string
155
+ }
156
+
157
+ export interface TokenPrice {
158
+ token: Token
159
+ price?: Price
160
+ price24hChange?: Price
161
+ floorPrice: Price
162
+ buyPrice: Price
163
+ sellPrice: Price
164
+ updatedAt: string
165
+ }
166
+
167
+ export interface ExchangeRate {
168
+ name: string
169
+ symbol: string
170
+ value: number
171
+ vsCurrency: string
172
+ currencyType: string
173
+ }
174
+
175
+ export interface PayCard {
176
+ id: number
177
+ userAddress: string
178
+ cardType: string
179
+ cardFirstName: string
180
+ cardLastName: string
181
+ cardNumberLastFourDigits: string
182
+ cardNumberToken: string
183
+ cardCVCToken: string
184
+ cardExpMonth: number
185
+ cardExpYear: number
186
+ contactAddressToken: string
187
+ contactCityToken: string
188
+ contactProvinceToken: string
189
+ contactPostalCodeToken: string
190
+ contactCountryCode: string
191
+ contactEmail: string
192
+ contactPhoneToken: string
193
+ updatedAt?: string
194
+ createdAt?: string
195
+ }
196
+
197
+ export interface SmartRampQuoteRequest {
198
+ countryCode: string
199
+ niftyswapContractAddress: string
200
+ tokenIds: Array<number>
201
+ tokensBoughtAmounts: Array<number>
202
+ maxCurrency: number
203
+ }
204
+
205
+ export interface SmartRampQuoteDetails {
206
+ quoteId: string
207
+ smartScriptId: string
208
+ quoteRequest: SmartRampQuoteRequest
209
+ recipientAddress: string
210
+ purchaseAmount: number
211
+ purchaseFees: number
212
+ purchaseTotal: number
213
+ sourceCurrency: string
214
+ destCurrency: string
215
+ }
216
+
217
+ export interface SmartRampPurchaseReceipt {
218
+ orderId: string
219
+ quoteId: string
220
+ smartScriptId: string
221
+ createdAt: string
222
+ status: SmartRampOrderStatus
223
+ authCodesRequested: boolean
224
+ authCodesSubmitted: boolean
225
+ sourceCurrency: string
226
+ purchaseAmount: number
227
+ purchaseFees: number
228
+ purchaseTotal: number
229
+ }
230
+
231
+ export interface SmartRampOrder {
232
+ id: number
233
+ userAddress: string
234
+ contractAddress: string
235
+ payCardId: number
236
+ orderId: string
237
+ quoteId: string
238
+ status: SmartRampOrderStatus
239
+ authCodesRequested: boolean
240
+ authCodesSubmitted: boolean
241
+ countryCode: string
242
+ email: string
243
+ sourceCurrency: string
244
+ destCurrency: string
245
+ purchaseAmount: number
246
+ purchaseFees: number
247
+ purchaseTotal: number
248
+ smartScriptParams: {[key: string]: any}
249
+ updatedAt?: string
250
+ createdAt?: string
251
+ }
252
+
253
+ export interface PayCardAuth {
254
+ orderId: string
255
+ smsNeeded: boolean
256
+ card2faNeeded: boolean
257
+ authorization3dsUrl: string
258
+ }
259
+
138
260
  export interface Page {
139
261
  pageSize?: number
140
262
  page?: number
@@ -150,19 +272,6 @@ export interface SortBy {
150
272
  order: SortOrder
151
273
  }
152
274
 
153
- export interface Token {
154
- chainId: number
155
- contractAddress: string
156
- tokenId?: string
157
- }
158
-
159
- export interface TokenPrice {
160
- token: Token
161
- usd?: number
162
- usd24hChange?: number
163
- updatedAt: string
164
- }
165
-
166
275
  export interface API {
167
276
  ping(headers?: object): Promise<PingReturn>
168
277
  version(headers?: object): Promise<VersionReturn>
@@ -185,8 +294,17 @@ export interface API {
185
294
  userStorageFetchAll(args: UserStorageFetchAllArgs, headers?: object): Promise<UserStorageFetchAllReturn>
186
295
  getMoonpayLink(args: GetMoonpayLinkArgs, headers?: object): Promise<GetMoonpayLinkReturn>
187
296
  isUsingGoogleMail(args: IsUsingGoogleMailArgs, headers?: object): Promise<IsUsingGoogleMailReturn>
188
- getTokenPrices(args: GetTokenPricesArgs, headers?: object): Promise<GetTokenPricesReturn>
297
+ getCoinPrices(args: GetCoinPricesArgs, headers?: object): Promise<GetCoinPricesReturn>
189
298
  getCollectiblePrices(args: GetCollectiblePricesArgs, headers?: object): Promise<GetCollectiblePricesReturn>
299
+ getExchangeRate(args: GetExchangeRateArgs, headers?: object): Promise<GetExchangeRateReturn>
300
+ listPayCardsOnFile(headers?: object): Promise<ListPayCardsOnFileReturn>
301
+ savePayCard(args: SavePayCardArgs, headers?: object): Promise<SavePayCardReturn>
302
+ deletePayCard(args: DeletePayCardArgs, headers?: object): Promise<DeletePayCardReturn>
303
+ smartRampQuote(args: SmartRampQuoteArgs, headers?: object): Promise<SmartRampQuoteReturn>
304
+ smartRampPurchase(args: SmartRampPurchaseArgs, headers?: object): Promise<SmartRampPurchaseReturn>
305
+ smartRampWaitOrderConfirmation(args: SmartRampWaitOrderConfirmationArgs, headers?: object): Promise<SmartRampWaitOrderConfirmationReturn>
306
+ smartRampCheckCardAuthorization(args: SmartRampCheckCardAuthorizationArgs, headers?: object): Promise<SmartRampCheckCardAuthorizationReturn>
307
+ smartRampSubmitCardAuthorization(args: SmartRampSubmitCardAuthorizationArgs, headers?: object): Promise<SmartRampSubmitCardAuthorizationReturn>
190
308
  getInviteInfo(headers?: object): Promise<GetInviteInfoReturn>
191
309
  isValidAccessCode(args: IsValidAccessCodeArgs, headers?: object): Promise<IsValidAccessCodeReturn>
192
310
  internalClaimAccessCode(args: InternalClaimAccessCodeArgs, headers?: object): Promise<InternalClaimAccessCodeReturn>
@@ -353,11 +471,11 @@ export interface IsUsingGoogleMailArgs {
353
471
  export interface IsUsingGoogleMailReturn {
354
472
  yes: boolean
355
473
  }
356
- export interface GetTokenPricesArgs {
474
+ export interface GetCoinPricesArgs {
357
475
  tokens: Array<Token>
358
476
  }
359
477
 
360
- export interface GetTokenPricesReturn {
478
+ export interface GetCoinPricesReturn {
361
479
  tokenPrices: Array<TokenPrice>
362
480
  }
363
481
  export interface GetCollectiblePricesArgs {
@@ -367,6 +485,75 @@ export interface GetCollectiblePricesArgs {
367
485
  export interface GetCollectiblePricesReturn {
368
486
  tokenPrices: Array<TokenPrice>
369
487
  }
488
+ export interface GetExchangeRateArgs {
489
+ toCurrency: string
490
+ }
491
+
492
+ export interface GetExchangeRateReturn {
493
+ exchangeRate: ExchangeRate
494
+ }
495
+ export interface ListPayCardsOnFileArgs {
496
+ }
497
+
498
+ export interface ListPayCardsOnFileReturn {
499
+ payCards: Array<PayCard>
500
+ }
501
+ export interface SavePayCardArgs {
502
+ payCard: PayCard
503
+ }
504
+
505
+ export interface SavePayCardReturn {
506
+ ok: boolean
507
+ payCard: PayCard
508
+ }
509
+ export interface DeletePayCardArgs {
510
+ payCardId: number
511
+ }
512
+
513
+ export interface DeletePayCardReturn {
514
+ ok: boolean
515
+ }
516
+ export interface SmartRampQuoteArgs {
517
+ quoteRequest: SmartRampQuoteRequest
518
+ }
519
+
520
+ export interface SmartRampQuoteReturn {
521
+ status: boolean
522
+ quoteDetails: SmartRampQuoteDetails
523
+ }
524
+ export interface SmartRampPurchaseArgs {
525
+ quoteDetails: SmartRampQuoteDetails
526
+ payCardId: number
527
+ }
528
+
529
+ export interface SmartRampPurchaseReturn {
530
+ processing: boolean
531
+ receipt: SmartRampPurchaseReceipt
532
+ }
533
+ export interface SmartRampWaitOrderConfirmationArgs {
534
+ orderId: string
535
+ }
536
+
537
+ export interface SmartRampWaitOrderConfirmationReturn {
538
+ done: boolean
539
+ receipt: SmartRampPurchaseReceipt
540
+ }
541
+ export interface SmartRampCheckCardAuthorizationArgs {
542
+ orderId: string
543
+ }
544
+
545
+ export interface SmartRampCheckCardAuthorizationReturn {
546
+ cardAuth: PayCardAuth
547
+ }
548
+ export interface SmartRampSubmitCardAuthorizationArgs {
549
+ orderId: string
550
+ sms?: string
551
+ card2fa?: string
552
+ }
553
+
554
+ export interface SmartRampSubmitCardAuthorizationReturn {
555
+ status: boolean
556
+ }
370
557
  export interface GetInviteInfoArgs {
371
558
  }
372
559
 
@@ -679,9 +866,9 @@ export class API implements API {
679
866
  })
680
867
  }
681
868
 
682
- getTokenPrices = (args: GetTokenPricesArgs, headers?: object): Promise<GetTokenPricesReturn> => {
869
+ getCoinPrices = (args: GetCoinPricesArgs, headers?: object): Promise<GetCoinPricesReturn> => {
683
870
  return this.fetch(
684
- this.url('GetTokenPrices'),
871
+ this.url('GetCoinPrices'),
685
872
  createHTTPRequest(args, headers)).then((res) => {
686
873
  return buildResponse(res).then(_data => {
687
874
  return {
@@ -703,6 +890,119 @@ export class API implements API {
703
890
  })
704
891
  }
705
892
 
893
+ getExchangeRate = (args: GetExchangeRateArgs, headers?: object): Promise<GetExchangeRateReturn> => {
894
+ return this.fetch(
895
+ this.url('GetExchangeRate'),
896
+ createHTTPRequest(args, headers)).then((res) => {
897
+ return buildResponse(res).then(_data => {
898
+ return {
899
+ exchangeRate: <ExchangeRate>(_data.exchangeRate)
900
+ }
901
+ })
902
+ })
903
+ }
904
+
905
+ listPayCardsOnFile = (headers?: object): Promise<ListPayCardsOnFileReturn> => {
906
+ return this.fetch(
907
+ this.url('ListPayCardsOnFile'),
908
+ createHTTPRequest({}, headers)
909
+ ).then((res) => {
910
+ return buildResponse(res).then(_data => {
911
+ return {
912
+ payCards: <Array<PayCard>>(_data.payCards)
913
+ }
914
+ })
915
+ })
916
+ }
917
+
918
+ savePayCard = (args: SavePayCardArgs, headers?: object): Promise<SavePayCardReturn> => {
919
+ return this.fetch(
920
+ this.url('SavePayCard'),
921
+ createHTTPRequest(args, headers)).then((res) => {
922
+ return buildResponse(res).then(_data => {
923
+ return {
924
+ ok: <boolean>(_data.ok),
925
+ payCard: <PayCard>(_data.payCard)
926
+ }
927
+ })
928
+ })
929
+ }
930
+
931
+ deletePayCard = (args: DeletePayCardArgs, headers?: object): Promise<DeletePayCardReturn> => {
932
+ return this.fetch(
933
+ this.url('DeletePayCard'),
934
+ createHTTPRequest(args, headers)).then((res) => {
935
+ return buildResponse(res).then(_data => {
936
+ return {
937
+ ok: <boolean>(_data.ok)
938
+ }
939
+ })
940
+ })
941
+ }
942
+
943
+ smartRampQuote = (args: SmartRampQuoteArgs, headers?: object): Promise<SmartRampQuoteReturn> => {
944
+ return this.fetch(
945
+ this.url('SmartRampQuote'),
946
+ createHTTPRequest(args, headers)).then((res) => {
947
+ return buildResponse(res).then(_data => {
948
+ return {
949
+ status: <boolean>(_data.status),
950
+ quoteDetails: <SmartRampQuoteDetails>(_data.quoteDetails)
951
+ }
952
+ })
953
+ })
954
+ }
955
+
956
+ smartRampPurchase = (args: SmartRampPurchaseArgs, headers?: object): Promise<SmartRampPurchaseReturn> => {
957
+ return this.fetch(
958
+ this.url('SmartRampPurchase'),
959
+ createHTTPRequest(args, headers)).then((res) => {
960
+ return buildResponse(res).then(_data => {
961
+ return {
962
+ processing: <boolean>(_data.processing),
963
+ receipt: <SmartRampPurchaseReceipt>(_data.receipt)
964
+ }
965
+ })
966
+ })
967
+ }
968
+
969
+ smartRampWaitOrderConfirmation = (args: SmartRampWaitOrderConfirmationArgs, headers?: object): Promise<SmartRampWaitOrderConfirmationReturn> => {
970
+ return this.fetch(
971
+ this.url('SmartRampWaitOrderConfirmation'),
972
+ createHTTPRequest(args, headers)).then((res) => {
973
+ return buildResponse(res).then(_data => {
974
+ return {
975
+ done: <boolean>(_data.done),
976
+ receipt: <SmartRampPurchaseReceipt>(_data.receipt)
977
+ }
978
+ })
979
+ })
980
+ }
981
+
982
+ smartRampCheckCardAuthorization = (args: SmartRampCheckCardAuthorizationArgs, headers?: object): Promise<SmartRampCheckCardAuthorizationReturn> => {
983
+ return this.fetch(
984
+ this.url('SmartRampCheckCardAuthorization'),
985
+ createHTTPRequest(args, headers)).then((res) => {
986
+ return buildResponse(res).then(_data => {
987
+ return {
988
+ cardAuth: <PayCardAuth>(_data.cardAuth)
989
+ }
990
+ })
991
+ })
992
+ }
993
+
994
+ smartRampSubmitCardAuthorization = (args: SmartRampSubmitCardAuthorizationArgs, headers?: object): Promise<SmartRampSubmitCardAuthorizationReturn> => {
995
+ return this.fetch(
996
+ this.url('SmartRampSubmitCardAuthorization'),
997
+ createHTTPRequest(args, headers)).then((res) => {
998
+ return buildResponse(res).then(_data => {
999
+ return {
1000
+ status: <boolean>(_data.status)
1001
+ }
1002
+ })
1003
+ })
1004
+ }
1005
+
706
1006
  getInviteInfo = (headers?: object): Promise<GetInviteInfoReturn> => {
707
1007
  return this.fetch(
708
1008
  this.url('GetInviteInfo'),