@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.
@@ -18,7 +18,7 @@ function _extends() {
18
18
  }
19
19
 
20
20
  /* eslint-disable */
21
- // sequence-metadata v0.4.0 594e38ba9f35eba08aac88087660d5f424b6dbda
21
+ // sequence-metadata v0.4.0 16b30ae85e42fc4c25342f7c43e04d7070597f21
22
22
  // --
23
23
  // Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT.
24
24
  //
@@ -31,7 +31,7 @@ const WebRPCVersion = 'v1';
31
31
  const WebRPCSchemaVersion = 'v0.4.0';
32
32
 
33
33
  // Schema hash generated from your RIDL schema
34
- const WebRPCSchemaHash = '594e38ba9f35eba08aac88087660d5f424b6dbda';
34
+ const WebRPCSchemaHash = '16b30ae85e42fc4c25342f7c43e04d7070597f21';
35
35
 
36
36
  //
37
37
  // Types
@@ -312,11 +312,12 @@ class Metadata {
312
312
  });
313
313
  });
314
314
  };
315
- this.addContractsToTokenDirectory = (args, headers, signal) => {
316
- return this.fetch(this.url('AddContractsToTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
315
+ this.searchTokens = (args, headers, signal) => {
316
+ return this.fetch(this.url('SearchTokens'), createHTTPRequest(args, headers, signal)).then(res => {
317
317
  return buildResponse(res).then(_data => {
318
318
  return {
319
- ok: _data.ok
319
+ tokenMetadata: _data.tokenMetadata,
320
+ nextPage: _data.nextPage
320
321
  };
321
322
  });
322
323
  }, error => {
@@ -325,11 +326,12 @@ class Metadata {
325
326
  });
326
327
  });
327
328
  };
328
- this.removeContractsFromTokenDirectory = (args, headers, signal) => {
329
- return this.fetch(this.url('RemoveContractsFromTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
329
+ this.searchContracts = (args, headers, signal) => {
330
+ return this.fetch(this.url('SearchContracts'), createHTTPRequest(args, headers, signal)).then(res => {
330
331
  return buildResponse(res).then(_data => {
331
332
  return {
332
- ok: _data.ok
333
+ contractInfo: _data.contractInfo,
334
+ nextPage: _data.nextPage
333
335
  };
334
336
  });
335
337
  }, error => {
@@ -338,11 +340,11 @@ class Metadata {
338
340
  });
339
341
  });
340
342
  };
341
- this.modifyFeatureIndex = (args, headers, signal) => {
342
- return this.fetch(this.url('ModifyFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
343
+ this.getNiftyswapTokenQuantity = (args, headers, signal) => {
344
+ return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers, signal)).then(res => {
343
345
  return buildResponse(res).then(_data => {
344
346
  return {
345
- ok: _data.ok
347
+ quantity: _data.quantity
346
348
  };
347
349
  });
348
350
  }, error => {
@@ -351,11 +353,11 @@ class Metadata {
351
353
  });
352
354
  });
353
355
  };
354
- this.getFeatureIndex = (args, headers, signal) => {
355
- return this.fetch(this.url('GetFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
356
+ this.getNiftyswapUnitPrices = (args, headers, signal) => {
357
+ return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers, signal)).then(res => {
356
358
  return buildResponse(res).then(_data => {
357
359
  return {
358
- featured: _data.featured
360
+ prices: _data.prices
359
361
  };
360
362
  });
361
363
  }, error => {
@@ -364,12 +366,11 @@ class Metadata {
364
366
  });
365
367
  });
366
368
  };
367
- this.listTokenDirectory = (args, headers, signal) => {
368
- return this.fetch(this.url('ListTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
369
+ this.getNiftyswapUnitPricesWithQuantities = (args, headers, signal) => {
370
+ return this.fetch(this.url('GetNiftyswapUnitPricesWithQuantities'), createHTTPRequest(args, headers, signal)).then(res => {
369
371
  return buildResponse(res).then(_data => {
370
372
  return {
371
- page: _data.page,
372
- contracts: _data.contracts
373
+ prices: _data.prices
373
374
  };
374
375
  });
375
376
  }, error => {
@@ -378,11 +379,11 @@ class Metadata {
378
379
  });
379
380
  });
380
381
  };
381
- this.getNiftyswapTokenQuantity = (args, headers, signal) => {
382
- return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers, signal)).then(res => {
382
+ this.addContractToMintMonitor = (args, headers, signal) => {
383
+ return this.fetch(this.url('AddContractToMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
383
384
  return buildResponse(res).then(_data => {
384
385
  return {
385
- quantity: _data.quantity
386
+ ok: _data.ok
386
387
  };
387
388
  });
388
389
  }, error => {
@@ -391,11 +392,11 @@ class Metadata {
391
392
  });
392
393
  });
393
394
  };
394
- this.getNiftyswapUnitPrices = (args, headers, signal) => {
395
- return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers, signal)).then(res => {
395
+ this.removeContractFromMintMonitor = (args, headers, signal) => {
396
+ return this.fetch(this.url('RemoveContractFromMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
396
397
  return buildResponse(res).then(_data => {
397
398
  return {
398
- prices: _data.prices
399
+ ok: _data.ok
399
400
  };
400
401
  });
401
402
  }, error => {
@@ -404,11 +405,11 @@ class Metadata {
404
405
  });
405
406
  });
406
407
  };
407
- this.getNiftyswapUnitPricesWithQuantities = (args, headers, signal) => {
408
- return this.fetch(this.url('GetNiftyswapUnitPricesWithQuantities'), createHTTPRequest(args, headers, signal)).then(res => {
408
+ this.mintMonitorJobStatus = (args, headers, signal) => {
409
+ return this.fetch(this.url('MintMonitorJobStatus'), createHTTPRequest(args, headers, signal)).then(res => {
409
410
  return buildResponse(res).then(_data => {
410
411
  return {
411
- prices: _data.prices
412
+ task: _data.task
412
413
  };
413
414
  });
414
415
  }, error => {
@@ -417,8 +418,8 @@ class Metadata {
417
418
  });
418
419
  });
419
420
  };
420
- this.addContractToMintMonitor = (args, headers, signal) => {
421
- return this.fetch(this.url('AddContractToMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
421
+ this.mintMonitorTriggerJob = (args, headers, signal) => {
422
+ return this.fetch(this.url('MintMonitorTriggerJob'), createHTTPRequest(args, headers, signal)).then(res => {
422
423
  return buildResponse(res).then(_data => {
423
424
  return {
424
425
  ok: _data.ok
@@ -430,8 +431,21 @@ class Metadata {
430
431
  });
431
432
  });
432
433
  };
433
- this.removeContractFromMintMonitor = (args, headers, signal) => {
434
- return this.fetch(this.url('RemoveContractFromMintMonitor'), createHTTPRequest(args, headers, signal)).then(res => {
434
+ this.syncContractTokens = (args, headers, signal) => {
435
+ return this.fetch(this.url('SyncContractTokens'), createHTTPRequest(args, headers, signal)).then(res => {
436
+ return buildResponse(res).then(_data => {
437
+ return {
438
+ taskID: _data.taskID
439
+ };
440
+ });
441
+ }, error => {
442
+ throw WebrpcRequestFailedError.new({
443
+ cause: `fetch(): ${error.message || ''}`
444
+ });
445
+ });
446
+ };
447
+ this.abortContractSync = (args, headers, signal) => {
448
+ return this.fetch(this.url('AbortContractSync'), createHTTPRequest(args, headers, signal)).then(res => {
435
449
  return buildResponse(res).then(_data => {
436
450
  return {
437
451
  ok: _data.ok
@@ -443,11 +457,12 @@ class Metadata {
443
457
  });
444
458
  });
445
459
  };
446
- this.mintMonitorJobStatus = (args, headers, signal) => {
447
- return this.fetch(this.url('MintMonitorJobStatus'), createHTTPRequest(args, headers, signal)).then(res => {
460
+ this.contractSyncJobStatus = (args, headers, signal) => {
461
+ return this.fetch(this.url('ContractSyncJobStatus'), createHTTPRequest(args, headers, signal)).then(res => {
448
462
  return buildResponse(res).then(_data => {
449
463
  return {
450
- task: _data.task
464
+ refreshTask: _data.refreshTask,
465
+ syncTask: _data.syncTask
451
466
  };
452
467
  });
453
468
  }, error => {
@@ -456,11 +471,39 @@ class Metadata {
456
471
  });
457
472
  });
458
473
  };
459
- this.mintMonitorTriggerJob = (args, headers, signal) => {
460
- return this.fetch(this.url('MintMonitorTriggerJob'), createHTTPRequest(args, headers, signal)).then(res => {
474
+ this.directoryGetNetworks = (args, headers, signal) => {
475
+ return this.fetch(this.url('DirectoryGetNetworks'), createHTTPRequest(args, headers, signal)).then(res => {
461
476
  return buildResponse(res).then(_data => {
462
477
  return {
463
- ok: _data.ok
478
+ networks: _data.networks
479
+ };
480
+ });
481
+ }, error => {
482
+ throw WebrpcRequestFailedError.new({
483
+ cause: `fetch(): ${error.message || ''}`
484
+ });
485
+ });
486
+ };
487
+ this.directoryGetCollections = (args, headers, signal) => {
488
+ return this.fetch(this.url('DirectoryGetCollections'), createHTTPRequest(args, headers, signal)).then(res => {
489
+ return buildResponse(res).then(_data => {
490
+ return {
491
+ collections: _data.collections,
492
+ page: _data.page
493
+ };
494
+ });
495
+ }, error => {
496
+ throw WebrpcRequestFailedError.new({
497
+ cause: `fetch(): ${error.message || ''}`
498
+ });
499
+ });
500
+ };
501
+ this.directorySearchCollections = (args, headers, signal) => {
502
+ return this.fetch(this.url('DirectorySearchCollections'), createHTTPRequest(args, headers, signal)).then(res => {
503
+ return buildResponse(res).then(_data => {
504
+ return {
505
+ collections: _data.collections,
506
+ page: _data.page
464
507
  };
465
508
  });
466
509
  }, error => {
@@ -713,6 +756,84 @@ class Collections {
713
756
  return this.hostname + this.path + name;
714
757
  }
715
758
  }
759
+ class Admin {
760
+ constructor(hostname, fetch) {
761
+ this.hostname = void 0;
762
+ this.fetch = void 0;
763
+ this.path = '/rpc/Admin/';
764
+ this.addContractsToTokenDirectory = (args, headers, signal) => {
765
+ return this.fetch(this.url('AddContractsToTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
766
+ return buildResponse(res).then(_data => {
767
+ return {
768
+ ok: _data.ok
769
+ };
770
+ });
771
+ }, error => {
772
+ throw WebrpcRequestFailedError.new({
773
+ cause: `fetch(): ${error.message || ''}`
774
+ });
775
+ });
776
+ };
777
+ this.removeContractsFromTokenDirectory = (args, headers, signal) => {
778
+ return this.fetch(this.url('RemoveContractsFromTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
779
+ return buildResponse(res).then(_data => {
780
+ return {
781
+ ok: _data.ok
782
+ };
783
+ });
784
+ }, error => {
785
+ throw WebrpcRequestFailedError.new({
786
+ cause: `fetch(): ${error.message || ''}`
787
+ });
788
+ });
789
+ };
790
+ this.modifyFeatureIndex = (args, headers, signal) => {
791
+ return this.fetch(this.url('ModifyFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
792
+ return buildResponse(res).then(_data => {
793
+ return {
794
+ ok: _data.ok
795
+ };
796
+ });
797
+ }, error => {
798
+ throw WebrpcRequestFailedError.new({
799
+ cause: `fetch(): ${error.message || ''}`
800
+ });
801
+ });
802
+ };
803
+ this.getFeatureIndex = (args, headers, signal) => {
804
+ return this.fetch(this.url('GetFeatureIndex'), createHTTPRequest(args, headers, signal)).then(res => {
805
+ return buildResponse(res).then(_data => {
806
+ return {
807
+ featured: _data.featured
808
+ };
809
+ });
810
+ }, error => {
811
+ throw WebrpcRequestFailedError.new({
812
+ cause: `fetch(): ${error.message || ''}`
813
+ });
814
+ });
815
+ };
816
+ this.listTokenDirectory = (args, headers, signal) => {
817
+ return this.fetch(this.url('ListTokenDirectory'), createHTTPRequest(args, headers, signal)).then(res => {
818
+ return buildResponse(res).then(_data => {
819
+ return {
820
+ page: _data.page,
821
+ contracts: _data.contracts
822
+ };
823
+ });
824
+ }, error => {
825
+ throw WebrpcRequestFailedError.new({
826
+ cause: `fetch(): ${error.message || ''}`
827
+ });
828
+ });
829
+ };
830
+ this.hostname = hostname;
831
+ this.fetch = (input, init) => fetch(input, init);
832
+ }
833
+ url(name) {
834
+ return this.hostname + this.path + name;
835
+ }
836
+ }
716
837
  const createHTTPRequest = (body = {}, headers = {}, signal = null) => {
717
838
  return {
718
839
  method: 'POST',
@@ -880,6 +1001,12 @@ class FailError extends WebrpcError {
880
1001
  Object.setPrototypeOf(this, FailError.prototype);
881
1002
  }
882
1003
  }
1004
+ class GeoblockedError extends WebrpcError {
1005
+ constructor(name = 'Geoblocked', code = 1006, message = 'Geoblocked region', status = 0, cause) {
1006
+ super(name, code, message, status, cause);
1007
+ Object.setPrototypeOf(this, GeoblockedError.prototype);
1008
+ }
1009
+ }
883
1010
  class TimeoutError extends WebrpcError {
884
1011
  constructor(name = 'Timeout', code = 2000, message = 'Request timed out', status = 0, cause) {
885
1012
  super(name, code, message, status, cause);
@@ -898,6 +1025,24 @@ class RequiredArgumentError extends WebrpcError {
898
1025
  Object.setPrototypeOf(this, RequiredArgumentError.prototype);
899
1026
  }
900
1027
  }
1028
+ class QueryFailedError extends WebrpcError {
1029
+ constructor(name = 'QueryFailed', code = 2003, message = 'Query failed', status = 0, cause) {
1030
+ super(name, code, message, status, cause);
1031
+ Object.setPrototypeOf(this, QueryFailedError.prototype);
1032
+ }
1033
+ }
1034
+ class ValidationFailedError extends WebrpcError {
1035
+ constructor(name = 'ValidationFailed', code = 2004, message = 'Validation failed', status = 0, cause) {
1036
+ super(name, code, message, status, cause);
1037
+ Object.setPrototypeOf(this, ValidationFailedError.prototype);
1038
+ }
1039
+ }
1040
+ class RateLimitedError extends WebrpcError {
1041
+ constructor(name = 'RateLimited', code = 2005, message = 'Rate limited', status = 0, cause) {
1042
+ super(name, code, message, status, cause);
1043
+ Object.setPrototypeOf(this, RateLimitedError.prototype);
1044
+ }
1045
+ }
901
1046
  class NotFoundError extends WebrpcError {
902
1047
  constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) {
903
1048
  super(name, code, message, status, cause);
@@ -916,6 +1061,12 @@ class ChainNotFoundError extends WebrpcError {
916
1061
  Object.setPrototypeOf(this, ChainNotFoundError.prototype);
917
1062
  }
918
1063
  }
1064
+ class TokenDirectoryDisabledError extends WebrpcError {
1065
+ constructor(name = 'TokenDirectoryDisabled', code = 4001, message = 'Token Directory is disabled', status = 0, cause) {
1066
+ super(name, code, message, status, cause);
1067
+ Object.setPrototypeOf(this, TokenDirectoryDisabledError.prototype);
1068
+ }
1069
+ }
919
1070
  let errors = /*#__PURE__*/function (errors) {
920
1071
  errors["WebrpcEndpoint"] = "WebrpcEndpoint";
921
1072
  errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
@@ -934,12 +1085,17 @@ let errors = /*#__PURE__*/function (errors) {
934
1085
  errors["MethodNotFound"] = "MethodNotFound";
935
1086
  errors["RequestConflict"] = "RequestConflict";
936
1087
  errors["Fail"] = "Fail";
1088
+ errors["Geoblocked"] = "Geoblocked";
937
1089
  errors["Timeout"] = "Timeout";
938
1090
  errors["InvalidArgument"] = "InvalidArgument";
939
1091
  errors["RequiredArgument"] = "RequiredArgument";
1092
+ errors["QueryFailed"] = "QueryFailed";
1093
+ errors["ValidationFailed"] = "ValidationFailed";
1094
+ errors["RateLimited"] = "RateLimited";
940
1095
  errors["NotFound"] = "NotFound";
941
1096
  errors["ProjectNotFound"] = "ProjectNotFound";
942
1097
  errors["ChainNotFound"] = "ChainNotFound";
1098
+ errors["TokenDirectoryDisabled"] = "TokenDirectoryDisabled";
943
1099
  return errors;
944
1100
  }({});
945
1101
  const webrpcErrorByCode = {
@@ -960,12 +1116,17 @@ const webrpcErrorByCode = {
960
1116
  [1003]: MethodNotFoundError,
961
1117
  [1004]: RequestConflictError,
962
1118
  [1005]: FailError,
1119
+ [1006]: GeoblockedError,
963
1120
  [2000]: TimeoutError,
964
1121
  [2001]: InvalidArgumentError,
965
1122
  [2002]: RequiredArgumentError,
1123
+ [2003]: QueryFailedError,
1124
+ [2004]: ValidationFailedError,
1125
+ [2005]: RateLimitedError,
966
1126
  [3000]: NotFoundError,
967
1127
  [3002]: ProjectNotFoundError,
968
- [3003]: ChainNotFoundError
1128
+ [3003]: ChainNotFoundError,
1129
+ [4001]: TokenDirectoryDisabledError
969
1130
  };
970
1131
 
971
1132
  const fetch = typeof global === 'object' ? global.fetch : window.fetch;
@@ -1018,10 +1179,12 @@ class SequenceCollections extends Collections {
1018
1179
  // https://github.com/0xsequence/go-sequence/blob/master/metadata/collections.go#L52
1019
1180
  }
1020
1181
 
1182
+ exports.Admin = Admin;
1021
1183
  exports.ChainNotFoundError = ChainNotFoundError;
1022
1184
  exports.Collections = Collections;
1023
1185
  exports.ContractType = ContractType;
1024
1186
  exports.FailError = FailError;
1187
+ exports.GeoblockedError = GeoblockedError;
1025
1188
  exports.InvalidArgumentError = InvalidArgumentError;
1026
1189
  exports.Metadata = Metadata;
1027
1190
  exports.MethodNotFoundError = MethodNotFoundError;
@@ -1029,6 +1192,8 @@ exports.NotFoundError = NotFoundError;
1029
1192
  exports.PermissionDeniedError = PermissionDeniedError;
1030
1193
  exports.ProjectNotFoundError = ProjectNotFoundError;
1031
1194
  exports.PropertyType = PropertyType;
1195
+ exports.QueryFailedError = QueryFailedError;
1196
+ exports.RateLimitedError = RateLimitedError;
1032
1197
  exports.RequestConflictError = RequestConflictError;
1033
1198
  exports.RequiredArgumentError = RequiredArgumentError;
1034
1199
  exports.SequenceCollections = SequenceCollections;
@@ -1037,7 +1202,9 @@ exports.SessionExpiredError = SessionExpiredError;
1037
1202
  exports.SwapType = SwapType;
1038
1203
  exports.TaskStatus = TaskStatus;
1039
1204
  exports.TimeoutError = TimeoutError;
1205
+ exports.TokenDirectoryDisabledError = TokenDirectoryDisabledError;
1040
1206
  exports.UnauthorizedError = UnauthorizedError;
1207
+ exports.ValidationFailedError = ValidationFailedError;
1041
1208
  exports.WebRPCSchemaHash = WebRPCSchemaHash;
1042
1209
  exports.WebRPCSchemaVersion = WebRPCSchemaVersion;
1043
1210
  exports.WebRPCVersion = WebRPCVersion;