@0xsequence/metadata 1.10.0 → 1.10.1

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.
@@ -14,7 +14,7 @@ function _extends() {
14
14
  }
15
15
 
16
16
  /* eslint-disable */
17
- // sequence-metadata v0.4.0 594e38ba9f35eba08aac88087660d5f424b6dbda
17
+ // sequence-metadata v0.4.0 16b30ae85e42fc4c25342f7c43e04d7070597f21
18
18
  // --
19
19
  // Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT.
20
20
  //
@@ -27,7 +27,7 @@ const WebRPCVersion = 'v1';
27
27
  const WebRPCSchemaVersion = 'v0.4.0';
28
28
 
29
29
  // Schema hash generated from your RIDL schema
30
- const WebRPCSchemaHash = '594e38ba9f35eba08aac88087660d5f424b6dbda';
30
+ const WebRPCSchemaHash = '16b30ae85e42fc4c25342f7c43e04d7070597f21';
31
31
 
32
32
  //
33
33
  // Types
@@ -308,11 +308,12 @@ class Metadata {
308
308
  });
309
309
  });
310
310
  };
311
- this.addContractsToTokenDirectory = (args, headers, signal) => {
312
- return this.fetch(this.url('AddContractsToTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
311
+ this.searchTokens = (args, headers, signal) => {
312
+ return this.fetch(this.url('SearchTokens'), createHTTPRequest(args, headers, signal)).then(res => {
313
313
  return buildResponse(res).then(_data => {
314
314
  return {
315
- ok: _data.ok
315
+ tokenMetadata: _data.tokenMetadata,
316
+ nextPage: _data.nextPage
316
317
  };
317
318
  });
318
319
  }, error => {
@@ -321,11 +322,12 @@ class Metadata {
321
322
  });
322
323
  });
323
324
  };
324
- this.removeContractsFromTokenDirectory = (args, headers, signal) => {
325
- return this.fetch(this.url('RemoveContractsFromTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
325
+ this.searchContracts = (args, headers, signal) => {
326
+ return this.fetch(this.url('SearchContracts'), createHTTPRequest(args, headers, signal)).then(res => {
326
327
  return buildResponse(res).then(_data => {
327
328
  return {
328
- ok: _data.ok
329
+ contractInfo: _data.contractInfo,
330
+ nextPage: _data.nextPage
329
331
  };
330
332
  });
331
333
  }, error => {
@@ -334,11 +336,11 @@ class Metadata {
334
336
  });
335
337
  });
336
338
  };
337
- this.modifyFeatureIndex = (args, headers, signal) => {
338
- return this.fetch(this.url('ModifyFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
339
+ this.getNiftyswapTokenQuantity = (args, headers, signal) => {
340
+ return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers, signal)).then(res => {
339
341
  return buildResponse(res).then(_data => {
340
342
  return {
341
- ok: _data.ok
343
+ quantity: _data.quantity
342
344
  };
343
345
  });
344
346
  }, error => {
@@ -347,11 +349,11 @@ class Metadata {
347
349
  });
348
350
  });
349
351
  };
350
- this.getFeatureIndex = (args, headers, signal) => {
351
- return this.fetch(this.url('GetFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
352
+ this.getNiftyswapUnitPrices = (args, headers, signal) => {
353
+ return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers, signal)).then(res => {
352
354
  return buildResponse(res).then(_data => {
353
355
  return {
354
- featured: _data.featured
356
+ prices: _data.prices
355
357
  };
356
358
  });
357
359
  }, error => {
@@ -360,12 +362,11 @@ class Metadata {
360
362
  });
361
363
  });
362
364
  };
363
- this.listTokenDirectory = (args, headers, signal) => {
364
- return this.fetch(this.url('ListTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
365
+ this.getNiftyswapUnitPricesWithQuantities = (args, headers, signal) => {
366
+ return this.fetch(this.url('GetNiftyswapUnitPricesWithQuantities'), createHTTPRequest(args, headers, signal)).then(res => {
365
367
  return buildResponse(res).then(_data => {
366
368
  return {
367
- page: _data.page,
368
- contracts: _data.contracts
369
+ prices: _data.prices
369
370
  };
370
371
  });
371
372
  }, error => {
@@ -374,11 +375,11 @@ class Metadata {
374
375
  });
375
376
  });
376
377
  };
377
- this.getNiftyswapTokenQuantity = (args, headers, signal) => {
378
- return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers, signal)).then(res => {
378
+ this.addContractToMintMonitor = (args, headers, signal) => {
379
+ return this.fetch(this.url('AddContractToMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
379
380
  return buildResponse(res).then(_data => {
380
381
  return {
381
- quantity: _data.quantity
382
+ ok: _data.ok
382
383
  };
383
384
  });
384
385
  }, error => {
@@ -387,11 +388,11 @@ class Metadata {
387
388
  });
388
389
  });
389
390
  };
390
- this.getNiftyswapUnitPrices = (args, headers, signal) => {
391
- return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers, signal)).then(res => {
391
+ this.removeContractFromMintMonitor = (args, headers, signal) => {
392
+ return this.fetch(this.url('RemoveContractFromMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
392
393
  return buildResponse(res).then(_data => {
393
394
  return {
394
- prices: _data.prices
395
+ ok: _data.ok
395
396
  };
396
397
  });
397
398
  }, error => {
@@ -400,11 +401,11 @@ class Metadata {
400
401
  });
401
402
  });
402
403
  };
403
- this.getNiftyswapUnitPricesWithQuantities = (args, headers, signal) => {
404
- return this.fetch(this.url('GetNiftyswapUnitPricesWithQuantities'), createHTTPRequest(args, headers, signal)).then(res => {
404
+ this.mintMonitorJobStatus = (args, headers, signal) => {
405
+ return this.fetch(this.url('MintMonitorJobStatus'), createHTTPRequest(args, headers, signal)).then(res => {
405
406
  return buildResponse(res).then(_data => {
406
407
  return {
407
- prices: _data.prices
408
+ task: _data.task
408
409
  };
409
410
  });
410
411
  }, error => {
@@ -413,8 +414,8 @@ class Metadata {
413
414
  });
414
415
  });
415
416
  };
416
- this.addContractToMintMonitor = (args, headers, signal) => {
417
- return this.fetch(this.url('AddContractToMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
417
+ this.mintMonitorTriggerJob = (args, headers, signal) => {
418
+ return this.fetch(this.url('MintMonitorTriggerJob'), createHTTPRequest(args, headers, signal)).then(res => {
418
419
  return buildResponse(res).then(_data => {
419
420
  return {
420
421
  ok: _data.ok
@@ -426,8 +427,21 @@ class Metadata {
426
427
  });
427
428
  });
428
429
  };
429
- this.removeContractFromMintMonitor = (args, headers, signal) => {
430
- return this.fetch(this.url('RemoveContractFromMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
430
+ this.syncContractTokens = (args, headers, signal) => {
431
+ return this.fetch(this.url('SyncContractTokens'), createHTTPRequest(args, headers, signal)).then(res => {
432
+ return buildResponse(res).then(_data => {
433
+ return {
434
+ taskID: _data.taskID
435
+ };
436
+ });
437
+ }, error => {
438
+ throw WebrpcRequestFailedError.new({
439
+ cause: `fetch(): ${error.message || ''}`
440
+ });
441
+ });
442
+ };
443
+ this.abortContractSync = (args, headers, signal) => {
444
+ return this.fetch(this.url('AbortContractSync'), createHTTPRequest(args, headers, signal)).then(res => {
431
445
  return buildResponse(res).then(_data => {
432
446
  return {
433
447
  ok: _data.ok
@@ -439,11 +453,12 @@ class Metadata {
439
453
  });
440
454
  });
441
455
  };
442
- this.mintMonitorJobStatus = (args, headers, signal) => {
443
- return this.fetch(this.url('MintMonitorJobStatus'), createHTTPRequest(args, headers, signal)).then(res => {
456
+ this.contractSyncJobStatus = (args, headers, signal) => {
457
+ return this.fetch(this.url('ContractSyncJobStatus'), createHTTPRequest(args, headers, signal)).then(res => {
444
458
  return buildResponse(res).then(_data => {
445
459
  return {
446
- task: _data.task
460
+ refreshTask: _data.refreshTask,
461
+ syncTask: _data.syncTask
447
462
  };
448
463
  });
449
464
  }, error => {
@@ -452,11 +467,39 @@ class Metadata {
452
467
  });
453
468
  });
454
469
  };
455
- this.mintMonitorTriggerJob = (args, headers, signal) => {
456
- return this.fetch(this.url('MintMonitorTriggerJob'), createHTTPRequest(args, headers, signal)).then(res => {
470
+ this.directoryGetNetworks = (args, headers, signal) => {
471
+ return this.fetch(this.url('DirectoryGetNetworks'), createHTTPRequest(args, headers, signal)).then(res => {
457
472
  return buildResponse(res).then(_data => {
458
473
  return {
459
- ok: _data.ok
474
+ networks: _data.networks
475
+ };
476
+ });
477
+ }, error => {
478
+ throw WebrpcRequestFailedError.new({
479
+ cause: `fetch(): ${error.message || ''}`
480
+ });
481
+ });
482
+ };
483
+ this.directoryGetCollections = (args, headers, signal) => {
484
+ return this.fetch(this.url('DirectoryGetCollections'), createHTTPRequest(args, headers, signal)).then(res => {
485
+ return buildResponse(res).then(_data => {
486
+ return {
487
+ collections: _data.collections,
488
+ page: _data.page
489
+ };
490
+ });
491
+ }, error => {
492
+ throw WebrpcRequestFailedError.new({
493
+ cause: `fetch(): ${error.message || ''}`
494
+ });
495
+ });
496
+ };
497
+ this.directorySearchCollections = (args, headers, signal) => {
498
+ return this.fetch(this.url('DirectorySearchCollections'), createHTTPRequest(args, headers, signal)).then(res => {
499
+ return buildResponse(res).then(_data => {
500
+ return {
501
+ collections: _data.collections,
502
+ page: _data.page
460
503
  };
461
504
  });
462
505
  }, error => {
@@ -709,6 +752,84 @@ class Collections {
709
752
  return this.hostname + this.path + name;
710
753
  }
711
754
  }
755
+ class Admin {
756
+ constructor(hostname, fetch) {
757
+ this.hostname = void 0;
758
+ this.fetch = void 0;
759
+ this.path = '/rpc/Admin/';
760
+ this.addContractsToTokenDirectory = (args, headers, signal) => {
761
+ return this.fetch(this.url('AddContractsToTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
762
+ return buildResponse(res).then(_data => {
763
+ return {
764
+ ok: _data.ok
765
+ };
766
+ });
767
+ }, error => {
768
+ throw WebrpcRequestFailedError.new({
769
+ cause: `fetch(): ${error.message || ''}`
770
+ });
771
+ });
772
+ };
773
+ this.removeContractsFromTokenDirectory = (args, headers, signal) => {
774
+ return this.fetch(this.url('RemoveContractsFromTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
775
+ return buildResponse(res).then(_data => {
776
+ return {
777
+ ok: _data.ok
778
+ };
779
+ });
780
+ }, error => {
781
+ throw WebrpcRequestFailedError.new({
782
+ cause: `fetch(): ${error.message || ''}`
783
+ });
784
+ });
785
+ };
786
+ this.modifyFeatureIndex = (args, headers, signal) => {
787
+ return this.fetch(this.url('ModifyFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
788
+ return buildResponse(res).then(_data => {
789
+ return {
790
+ ok: _data.ok
791
+ };
792
+ });
793
+ }, error => {
794
+ throw WebrpcRequestFailedError.new({
795
+ cause: `fetch(): ${error.message || ''}`
796
+ });
797
+ });
798
+ };
799
+ this.getFeatureIndex = (args, headers, signal) => {
800
+ return this.fetch(this.url('GetFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
801
+ return buildResponse(res).then(_data => {
802
+ return {
803
+ featured: _data.featured
804
+ };
805
+ });
806
+ }, error => {
807
+ throw WebrpcRequestFailedError.new({
808
+ cause: `fetch(): ${error.message || ''}`
809
+ });
810
+ });
811
+ };
812
+ this.listTokenDirectory = (args, headers, signal) => {
813
+ return this.fetch(this.url('ListTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
814
+ return buildResponse(res).then(_data => {
815
+ return {
816
+ page: _data.page,
817
+ contracts: _data.contracts
818
+ };
819
+ });
820
+ }, error => {
821
+ throw WebrpcRequestFailedError.new({
822
+ cause: `fetch(): ${error.message || ''}`
823
+ });
824
+ });
825
+ };
826
+ this.hostname = hostname;
827
+ this.fetch = (input, init) => fetch(input, init);
828
+ }
829
+ url(name) {
830
+ return this.hostname + this.path + name;
831
+ }
832
+ }
712
833
  const createHTTPRequest = (body = {}, headers = {}, signal = null) => {
713
834
  return {
714
835
  method: 'POST',
@@ -876,6 +997,12 @@ class FailError extends WebrpcError {
876
997
  Object.setPrototypeOf(this, FailError.prototype);
877
998
  }
878
999
  }
1000
+ class GeoblockedError extends WebrpcError {
1001
+ constructor(name = 'Geoblocked', code = 1006, message = 'Geoblocked region', status = 0, cause) {
1002
+ super(name, code, message, status, cause);
1003
+ Object.setPrototypeOf(this, GeoblockedError.prototype);
1004
+ }
1005
+ }
879
1006
  class TimeoutError extends WebrpcError {
880
1007
  constructor(name = 'Timeout', code = 2000, message = 'Request timed out', status = 0, cause) {
881
1008
  super(name, code, message, status, cause);
@@ -894,6 +1021,24 @@ class RequiredArgumentError extends WebrpcError {
894
1021
  Object.setPrototypeOf(this, RequiredArgumentError.prototype);
895
1022
  }
896
1023
  }
1024
+ class QueryFailedError extends WebrpcError {
1025
+ constructor(name = 'QueryFailed', code = 2003, message = 'Query failed', status = 0, cause) {
1026
+ super(name, code, message, status, cause);
1027
+ Object.setPrototypeOf(this, QueryFailedError.prototype);
1028
+ }
1029
+ }
1030
+ class ValidationFailedError extends WebrpcError {
1031
+ constructor(name = 'ValidationFailed', code = 2004, message = 'Validation failed', status = 0, cause) {
1032
+ super(name, code, message, status, cause);
1033
+ Object.setPrototypeOf(this, ValidationFailedError.prototype);
1034
+ }
1035
+ }
1036
+ class RateLimitedError extends WebrpcError {
1037
+ constructor(name = 'RateLimited', code = 2005, message = 'Rate limited', status = 0, cause) {
1038
+ super(name, code, message, status, cause);
1039
+ Object.setPrototypeOf(this, RateLimitedError.prototype);
1040
+ }
1041
+ }
897
1042
  class NotFoundError extends WebrpcError {
898
1043
  constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) {
899
1044
  super(name, code, message, status, cause);
@@ -912,6 +1057,12 @@ class ChainNotFoundError extends WebrpcError {
912
1057
  Object.setPrototypeOf(this, ChainNotFoundError.prototype);
913
1058
  }
914
1059
  }
1060
+ class TokenDirectoryDisabledError extends WebrpcError {
1061
+ constructor(name = 'TokenDirectoryDisabled', code = 4001, message = 'Token Directory is disabled', status = 0, cause) {
1062
+ super(name, code, message, status, cause);
1063
+ Object.setPrototypeOf(this, TokenDirectoryDisabledError.prototype);
1064
+ }
1065
+ }
915
1066
  let errors = /*#__PURE__*/function (errors) {
916
1067
  errors["WebrpcEndpoint"] = "WebrpcEndpoint";
917
1068
  errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
@@ -930,12 +1081,17 @@ let errors = /*#__PURE__*/function (errors) {
930
1081
  errors["MethodNotFound"] = "MethodNotFound";
931
1082
  errors["RequestConflict"] = "RequestConflict";
932
1083
  errors["Fail"] = "Fail";
1084
+ errors["Geoblocked"] = "Geoblocked";
933
1085
  errors["Timeout"] = "Timeout";
934
1086
  errors["InvalidArgument"] = "InvalidArgument";
935
1087
  errors["RequiredArgument"] = "RequiredArgument";
1088
+ errors["QueryFailed"] = "QueryFailed";
1089
+ errors["ValidationFailed"] = "ValidationFailed";
1090
+ errors["RateLimited"] = "RateLimited";
936
1091
  errors["NotFound"] = "NotFound";
937
1092
  errors["ProjectNotFound"] = "ProjectNotFound";
938
1093
  errors["ChainNotFound"] = "ChainNotFound";
1094
+ errors["TokenDirectoryDisabled"] = "TokenDirectoryDisabled";
939
1095
  return errors;
940
1096
  }({});
941
1097
  const webrpcErrorByCode = {
@@ -956,12 +1112,17 @@ const webrpcErrorByCode = {
956
1112
  [1003]: MethodNotFoundError,
957
1113
  [1004]: RequestConflictError,
958
1114
  [1005]: FailError,
1115
+ [1006]: GeoblockedError,
959
1116
  [2000]: TimeoutError,
960
1117
  [2001]: InvalidArgumentError,
961
1118
  [2002]: RequiredArgumentError,
1119
+ [2003]: QueryFailedError,
1120
+ [2004]: ValidationFailedError,
1121
+ [2005]: RateLimitedError,
962
1122
  [3000]: NotFoundError,
963
1123
  [3002]: ProjectNotFoundError,
964
- [3003]: ChainNotFoundError
1124
+ [3003]: ChainNotFoundError,
1125
+ [4001]: TokenDirectoryDisabledError
965
1126
  };
966
1127
 
967
1128
  const fetch = typeof global === 'object' ? global.fetch : window.fetch;
@@ -1014,4 +1175,4 @@ class SequenceCollections extends Collections {
1014
1175
  // https://github.com/0xsequence/go-sequence/blob/master/metadata/collections.go#L52
1015
1176
  }
1016
1177
 
1017
- export { ChainNotFoundError, Collections, ContractType, FailError, InvalidArgumentError, Metadata, MethodNotFoundError, NotFoundError, PermissionDeniedError, ProjectNotFoundError, PropertyType, RequestConflictError, RequiredArgumentError, SequenceCollections, SequenceMetadata, SessionExpiredError, SwapType, TaskStatus, TimeoutError, UnauthorizedError, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion, WebrpcBadMethodError, WebrpcBadRequestError, WebrpcBadResponseError, WebrpcBadRouteError, WebrpcClientDisconnectedError, WebrpcEndpointError, WebrpcError, WebrpcInternalErrorError, WebrpcRequestFailedError, WebrpcServerPanicError, WebrpcStreamFinishedError, WebrpcStreamLostError, errors };
1178
+ export { Admin, ChainNotFoundError, Collections, ContractType, FailError, GeoblockedError, InvalidArgumentError, Metadata, MethodNotFoundError, NotFoundError, PermissionDeniedError, ProjectNotFoundError, PropertyType, QueryFailedError, RateLimitedError, RequestConflictError, RequiredArgumentError, SequenceCollections, SequenceMetadata, SessionExpiredError, SwapType, TaskStatus, TimeoutError, TokenDirectoryDisabledError, UnauthorizedError, ValidationFailedError, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion, WebrpcBadMethodError, WebrpcBadRequestError, WebrpcBadResponseError, WebrpcBadRouteError, WebrpcClientDisconnectedError, WebrpcEndpointError, WebrpcError, WebrpcInternalErrorError, WebrpcRequestFailedError, WebrpcServerPanicError, WebrpcStreamFinishedError, WebrpcStreamLostError, errors };