@story-protocol/core-sdk 0.0.1-beta-test.1 → 0.0.1-beta-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/README.md +0 -15
  2. package/dist/declarations/src/client.d.ts +22 -38
  3. package/dist/declarations/src/client.d.ts.map +1 -1
  4. package/dist/declarations/src/index.d.ts +11 -12
  5. package/dist/declarations/src/index.d.ts.map +1 -1
  6. package/dist/declarations/src/resources/dispute.d.ts +835 -0
  7. package/dist/declarations/src/resources/dispute.d.ts.map +1 -0
  8. package/dist/declarations/src/resources/ipAsset.d.ts +145 -12
  9. package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
  10. package/dist/declarations/src/resources/license.d.ts +1014 -0
  11. package/dist/declarations/src/resources/license.d.ts.map +1 -0
  12. package/dist/declarations/src/resources/permission.d.ts +1478 -8
  13. package/dist/declarations/src/resources/permission.d.ts.map +1 -1
  14. package/dist/declarations/src/resources/policy.d.ts +1063 -0
  15. package/dist/declarations/src/resources/policy.d.ts.map +1 -0
  16. package/dist/declarations/src/resources/tagging.d.ts +711 -4
  17. package/dist/declarations/src/resources/tagging.d.ts.map +1 -1
  18. package/dist/declarations/src/types/config.d.ts +8 -9
  19. package/dist/declarations/src/types/config.d.ts.map +1 -1
  20. package/dist/declarations/src/types/options.d.ts +0 -6
  21. package/dist/declarations/src/types/options.d.ts.map +1 -1
  22. package/dist/declarations/src/types/resources/dispute.d.ts +50 -0
  23. package/dist/declarations/src/types/resources/dispute.d.ts.map +1 -0
  24. package/dist/declarations/src/types/resources/ipAsset.d.ts +11 -126
  25. package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
  26. package/dist/declarations/src/types/resources/license.d.ts +23 -0
  27. package/dist/declarations/src/types/resources/license.d.ts.map +1 -0
  28. package/dist/declarations/src/types/resources/permission.d.ts +5 -26
  29. package/dist/declarations/src/types/resources/permission.d.ts.map +1 -1
  30. package/dist/declarations/src/types/resources/policy.d.ts +35 -0
  31. package/dist/declarations/src/types/resources/policy.d.ts.map +1 -0
  32. package/dist/declarations/src/types/resources/tagging.d.ts +1 -13
  33. package/dist/declarations/src/types/resources/tagging.d.ts.map +1 -1
  34. package/dist/story-protocol-core-sdk.cjs.dev.js +2492 -1617
  35. package/dist/story-protocol-core-sdk.cjs.prod.js +2492 -1617
  36. package/dist/story-protocol-core-sdk.esm.js +2490 -1612
  37. package/package.json +5 -5
  38. package/dist/declarations/src/enums/ActionType.d.ts +0 -11
  39. package/dist/declarations/src/enums/ActionType.d.ts.map +0 -1
  40. package/dist/declarations/src/enums/ResourceType.d.ts +0 -15
  41. package/dist/declarations/src/enums/ResourceType.d.ts.map +0 -1
  42. package/dist/declarations/src/resources/ipAssetReadOnly.d.ts +0 -26
  43. package/dist/declarations/src/resources/ipAssetReadOnly.d.ts.map +0 -1
  44. package/dist/declarations/src/resources/moduleReadOnly.d.ts +0 -25
  45. package/dist/declarations/src/resources/moduleReadOnly.d.ts.map +0 -1
  46. package/dist/declarations/src/resources/permissionReadOnly.d.ts +0 -25
  47. package/dist/declarations/src/resources/permissionReadOnly.d.ts.map +0 -1
  48. package/dist/declarations/src/resources/taggingReadOnly.d.ts +0 -24
  49. package/dist/declarations/src/resources/taggingReadOnly.d.ts.map +0 -1
  50. package/dist/declarations/src/resources/transaction.d.ts +0 -11
  51. package/dist/declarations/src/resources/transaction.d.ts.map +0 -1
  52. package/dist/declarations/src/resources/transactionReadOnly.d.ts +0 -25
  53. package/dist/declarations/src/resources/transactionReadOnly.d.ts.map +0 -1
  54. package/dist/declarations/src/types/client.d.ts +0 -23
  55. package/dist/declarations/src/types/client.d.ts.map +0 -1
  56. package/dist/declarations/src/types/resources/module.d.ts +0 -43
  57. package/dist/declarations/src/types/resources/module.d.ts.map +0 -1
  58. package/dist/declarations/src/types/resources/transaction.d.ts +0 -52
  59. package/dist/declarations/src/types/resources/transaction.d.ts.map +0 -1
@@ -2,11 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var axios = require('axios');
6
5
  var viem = require('viem');
7
- var chains = require('viem/chains');
6
+ var axios = require('axios');
8
7
  var dotenv = require('dotenv');
9
- var abitype = require('abitype');
8
+ var chains = require('viem/chains');
10
9
 
11
10
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
12
11
 
@@ -108,81 +107,6 @@ function _createClass(Constructor, protoProps, staticProps) {
108
107
  return Constructor;
109
108
  }
110
109
 
111
- function _setPrototypeOf(o, p) {
112
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
113
- o.__proto__ = p;
114
- return o;
115
- };
116
- return _setPrototypeOf(o, p);
117
- }
118
-
119
- function _inherits(subClass, superClass) {
120
- if (typeof superClass !== "function" && superClass !== null) {
121
- throw new TypeError("Super expression must either be null or a function");
122
- }
123
- subClass.prototype = Object.create(superClass && superClass.prototype, {
124
- constructor: {
125
- value: subClass,
126
- writable: true,
127
- configurable: true
128
- }
129
- });
130
- Object.defineProperty(subClass, "prototype", {
131
- writable: false
132
- });
133
- if (superClass) _setPrototypeOf(subClass, superClass);
134
- }
135
-
136
- function _getPrototypeOf(o) {
137
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
138
- return o.__proto__ || Object.getPrototypeOf(o);
139
- };
140
- return _getPrototypeOf(o);
141
- }
142
-
143
- function _isNativeReflectConstruct() {
144
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
145
- if (Reflect.construct.sham) return false;
146
- if (typeof Proxy === "function") return true;
147
- try {
148
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
149
- return true;
150
- } catch (e) {
151
- return false;
152
- }
153
- }
154
-
155
- function _assertThisInitialized(self) {
156
- if (self === void 0) {
157
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
158
- }
159
- return self;
160
- }
161
-
162
- function _possibleConstructorReturn(self, call) {
163
- if (call && (typeof call === "object" || typeof call === "function")) {
164
- return call;
165
- } else if (call !== void 0) {
166
- throw new TypeError("Derived constructors may only return object or undefined");
167
- }
168
- return _assertThisInitialized(self);
169
- }
170
-
171
- function _createSuper(Derived) {
172
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
173
- return function _createSuperInternal() {
174
- var Super = _getPrototypeOf(Derived),
175
- result;
176
- if (hasNativeReflectConstruct) {
177
- var NewTarget = _getPrototypeOf(this).constructor;
178
- result = Reflect.construct(Super, arguments, NewTarget);
179
- } else {
180
- result = Super.apply(this, arguments);
181
- }
182
- return _possibleConstructorReturn(this, result);
183
- };
184
- }
185
-
186
110
  function _regeneratorRuntime() {
187
111
  _regeneratorRuntime = function () {
188
112
  return e;
@@ -523,664 +447,1509 @@ function handleError(error, msg) {
523
447
  throw new Error("".concat(msg, ": Unknown error type"));
524
448
  }
525
449
 
526
- /**
527
- * TransactionClient allows you to view and monitor transactions on Story Protocol.
528
- */
529
- var TransactionReadOnlyClient = /*#__PURE__*/function () {
530
- function TransactionReadOnlyClient(httpClient, rpcClient) {
531
- _classCallCheck(this, TransactionReadOnlyClient);
532
- this.httpClient = httpClient;
533
- this.rpcClient = rpcClient;
534
- }
535
-
536
- /**
537
- * Get transaction data based on the specified transaction id.
538
- *
539
- * @param request - the request object for getting the transaction
540
- * @returns the response object that contains the fetched transaction object
541
- */
542
- _createClass(TransactionReadOnlyClient, [{
543
- key: "get",
544
- value: function () {
545
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
546
- var response;
547
- return _regeneratorRuntime().wrap(function _callee$(_context) {
548
- while (1) switch (_context.prev = _context.next) {
549
- case 0:
550
- _context.prev = 0;
551
- _context.next = 3;
552
- return this.httpClient.get("/protocol/transaction/".concat(request.transactionId));
553
- case 3:
554
- response = _context.sent;
555
- return _context.abrupt("return", response.data);
556
- case 7:
557
- _context.prev = 7;
558
- _context.t0 = _context["catch"](0);
559
- handleError(_context.t0, "Failed to get transaction");
560
- case 10:
561
- case "end":
562
- return _context.stop();
563
- }
564
- }, _callee, this, [[0, 7]]);
565
- }));
566
- function get(_x) {
567
- return _get.apply(this, arguments);
568
- }
569
- return get;
570
- }()
571
- /**
572
- * List Transactions.
573
- *
574
- * @returns the response object that contains a list of transactions
575
- */
576
- }, {
577
- key: "list",
578
- value: function () {
579
- var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
580
- var response;
581
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
582
- while (1) switch (_context2.prev = _context2.next) {
583
- case 0:
584
- _context2.prev = 0;
585
- _context2.next = 3;
586
- return this.httpClient.post("/protocol/transaction", request || {});
587
- case 3:
588
- response = _context2.sent;
589
- return _context2.abrupt("return", response.data);
590
- case 7:
591
- _context2.prev = 7;
592
- _context2.t0 = _context2["catch"](0);
593
- handleError(_context2.t0, "Failed to list transactions");
594
- case 10:
595
- case "end":
596
- return _context2.stop();
597
- }
598
- }, _callee2, this, [[0, 7]]);
599
- }));
600
- function list(_x2) {
601
- return _list.apply(this, arguments);
602
- }
603
- return list;
604
- }()
605
- }]);
606
- return TransactionReadOnlyClient;
607
- }();
608
-
609
- /**
610
- * TransactionClient allows you to view and monitor transactions on Story Protocol.
611
- */
612
- var TransactionClient = /*#__PURE__*/function (_TransactionReadOnlyC) {
613
- _inherits(TransactionClient, _TransactionReadOnlyC);
614
- var _super = _createSuper(TransactionClient);
615
- function TransactionClient(httpClient, rpcClient, wallet) {
616
- var _this;
617
- _classCallCheck(this, TransactionClient);
618
- _this = _super.call(this, httpClient, rpcClient);
619
- _this.wallet = wallet;
620
- return _this;
621
- }
622
- return _createClass(TransactionClient);
623
- }(TransactionReadOnlyClient);
450
+ function _arrayLikeToArray(arr, len) {
451
+ if (len == null || len > arr.length) len = arr.length;
452
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
453
+ return arr2;
454
+ }
624
455
 
625
- /**
626
- * Default timeout value for http clients.
627
- */
628
- var HTTP_TIMEOUT = 5000;
456
+ function _arrayWithoutHoles(arr) {
457
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
458
+ }
629
459
 
630
- var PlatformClient = /*#__PURE__*/function () {
631
- function PlatformClient(httpClient) {
632
- _classCallCheck(this, PlatformClient);
633
- this.httpClient = httpClient;
634
- }
460
+ function _iterableToArray(iter) {
461
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
462
+ }
635
463
 
636
- /**
637
- * Upload a file to Arweave.
638
- *
639
- * @param file - the file binary data to upload
640
- * @param mimeType - the mime type of the file
641
- * @returns the response object that contains the uri of the uploaded file
642
- */
643
- _createClass(PlatformClient, [{
644
- key: "uploadFile",
645
- value: function () {
646
- var _uploadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, mimeType) {
647
- var preSignUrlResp, data, uploadResp, confirmResp;
648
- return _regeneratorRuntime().wrap(function _callee$(_context) {
649
- while (1) switch (_context.prev = _context.next) {
650
- case 0:
651
- _context.prev = 0;
652
- _context.next = 3;
653
- return this.httpClient.post("/platform/file-upload/request");
654
- case 3:
655
- preSignUrlResp = _context.sent;
656
- data = preSignUrlResp.data; // upload the file to s3
657
- _context.next = 7;
658
- return this.httpClient.put(data.url, file, {
659
- timeout: 0,
660
- headers: {
661
- "Content-Type": mimeType
662
- }
663
- });
664
- case 7:
665
- uploadResp = _context.sent;
666
- if (!(uploadResp.status !== 200)) {
667
- _context.next = 10;
668
- break;
669
- }
670
- throw new Error("Failed to upload file to s3. Status: ".concat(uploadResp.status));
671
- case 10:
672
- _context.next = 12;
673
- return this.httpClient.post("/platform/file-upload/confirm", {
674
- key: data.key
675
- });
676
- case 12:
677
- confirmResp = _context.sent;
678
- return _context.abrupt("return", confirmResp.data);
679
- case 16:
680
- _context.prev = 16;
681
- _context.t0 = _context["catch"](0);
682
- return _context.abrupt("return", handleError(_context.t0, "Failed to upload file"));
683
- case 19:
684
- case "end":
685
- return _context.stop();
686
- }
687
- }, _callee, this, [[0, 16]]);
688
- }));
689
- function uploadFile(_x, _x2) {
690
- return _uploadFile.apply(this, arguments);
691
- }
692
- return uploadFile;
693
- }()
694
- }]);
695
- return PlatformClient;
696
- }();
464
+ function _unsupportedIterableToArray(o, minLen) {
465
+ if (!o) return;
466
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
467
+ var n = Object.prototype.toString.call(o).slice(8, -1);
468
+ if (n === "Object" && o.constructor) n = o.constructor.name;
469
+ if (n === "Map" || n === "Set") return Array.from(o);
470
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
471
+ }
697
472
 
698
- /**
699
- * ModuleReadOnlyClient allows you to view and search modules on Story Protocol.
700
- */
701
- var ModuleReadOnlyClient = /*#__PURE__*/function () {
702
- function ModuleReadOnlyClient(httpClient, rpcClient) {
703
- _classCallCheck(this, ModuleReadOnlyClient);
704
- this.httpClient = httpClient;
705
- this.rpcClient = rpcClient;
706
- }
473
+ function _nonIterableSpread() {
474
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
475
+ }
707
476
 
708
- /**
709
- * Get an module based on the module name.
710
- *
711
- * @param request - the request object for getting a module.
712
- * @returns the response object the contains the fetched module.
713
- */
714
- _createClass(ModuleReadOnlyClient, [{
715
- key: "get",
716
- value: function () {
717
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
718
- var response;
719
- return _regeneratorRuntime().wrap(function _callee$(_context) {
720
- while (1) switch (_context.prev = _context.next) {
721
- case 0:
722
- _context.prev = 0;
723
- _context.next = 3;
724
- return this.httpClient.get("/modules/".concat(request.name));
725
- case 3:
726
- response = _context.sent;
727
- return _context.abrupt("return", response.data);
728
- case 7:
729
- _context.prev = 7;
730
- _context.t0 = _context["catch"](0);
731
- handleError(_context.t0, "Failed to get module");
732
- case 10:
733
- case "end":
734
- return _context.stop();
735
- }
736
- }, _callee, this, [[0, 7]]);
737
- }));
738
- function get(_x) {
739
- return _get.apply(this, arguments);
740
- }
741
- return get;
742
- }()
743
- /**
744
- * List modules.
745
- *
746
- * @returns the response object that contains results from listing query.
747
- */
748
- }, {
749
- key: "list",
750
- value: function () {
751
- var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
752
- var response;
753
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
754
- while (1) switch (_context2.prev = _context2.next) {
755
- case 0:
756
- _context2.prev = 0;
757
- _context2.next = 3;
758
- return this.httpClient.post("/modules", request || {});
759
- case 3:
760
- response = _context2.sent;
761
- return _context2.abrupt("return", response.data);
762
- case 7:
763
- _context2.prev = 7;
764
- _context2.t0 = _context2["catch"](0);
765
- handleError(_context2.t0, "Failed to list modules.");
766
- case 10:
767
- case "end":
768
- return _context2.stop();
769
- }
770
- }, _callee2, this, [[0, 7]]);
771
- }));
772
- function list(_x2) {
773
- return _list.apply(this, arguments);
774
- }
775
- return list;
776
- }()
777
- }]);
778
- return ModuleReadOnlyClient;
779
- }();
477
+ function _toConsumableArray(arr) {
478
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
479
+ }
780
480
 
781
- var TaggingModuleABI = [{
481
+ var IERC1155ABI = [{
482
+ anonymous: false,
782
483
  inputs: [{
783
- internalType: "string",
784
- name: "tag",
785
- type: "string"
484
+ indexed: true,
485
+ internalType: "address",
486
+ name: "operator",
487
+ type: "address"
786
488
  }, {
489
+ indexed: true,
787
490
  internalType: "address",
788
- name: "ipId",
491
+ name: "from",
789
492
  type: "address"
493
+ }, {
494
+ indexed: true,
495
+ internalType: "address",
496
+ name: "to",
497
+ type: "address"
498
+ }, {
499
+ indexed: false,
500
+ internalType: "uint256[]",
501
+ name: "ids",
502
+ type: "uint256[]"
503
+ }, {
504
+ indexed: false,
505
+ internalType: "uint256[]",
506
+ name: "values",
507
+ type: "uint256[]"
790
508
  }],
791
- name: "removeTag",
792
- outputs: [{
793
- internalType: "bool",
794
- name: "removed",
795
- type: "bool"
796
- }],
797
- stateMutability: "nonpayable",
798
- type: "function"
509
+ name: "TransferBatch",
510
+ type: "event"
799
511
  }, {
512
+ anonymous: false,
800
513
  inputs: [{
801
- internalType: "string",
802
- name: "tag",
803
- type: "string"
804
- }, {
514
+ indexed: true,
805
515
  internalType: "address",
806
- name: "ipId",
516
+ name: "operator",
807
517
  type: "address"
808
- }],
809
- name: "setTag",
810
- outputs: [{
811
- internalType: "bool",
812
- name: "added",
813
- type: "bool"
814
- }],
815
- stateMutability: "nonpayable",
816
- type: "function"
817
- }];
818
-
819
- var TaggingModuleRaw = TaggingModuleABI;
820
- abitype.formatAbi(TaggingModuleRaw);
821
- var TaggingModuleConfig = {
822
- abi: TaggingModuleRaw,
823
- address: viem.getAddress(process.env.TAGGING_MODULE || process.env.NEXT_PUBLIC_TAGGING_MODULE || "")
824
- };
825
-
826
- /**
827
- * TaggingReadOnlyClient allows you to view and search IP Assets on Story Protocol.
828
- */
829
- var TaggingReadOnlyClient = /*#__PURE__*/function () {
830
- function TaggingReadOnlyClient(httpClient, rpcClient) {
831
- _classCallCheck(this, TaggingReadOnlyClient);
832
- this.httpClient = httpClient;
833
- this.rpcClient = rpcClient;
834
- }
835
-
836
- /**
837
- * Get tags.
838
- *
839
- * @returns the response object that contains results from get tag query.
840
- */
841
- _createClass(TaggingReadOnlyClient, [{
842
- key: "get",
843
- value: function () {
844
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
845
- var response;
846
- return _regeneratorRuntime().wrap(function _callee$(_context) {
847
- while (1) switch (_context.prev = _context.next) {
848
- case 0:
849
- _context.prev = 0;
850
- _context.next = 3;
851
- return this.httpClient.get("/tags/".concat(request.id));
852
- case 3:
853
- response = _context.sent;
854
- return _context.abrupt("return", response.data);
855
- case 7:
856
- _context.prev = 7;
857
- _context.t0 = _context["catch"](0);
858
- handleError(_context.t0, "Failed to get tags.");
859
- case 10:
860
- case "end":
861
- return _context.stop();
862
- }
863
- }, _callee, this, [[0, 7]]);
864
- }));
865
- function get(_x) {
866
- return _get.apply(this, arguments);
867
- }
868
- return get;
869
- }()
870
- /**
871
- * List tags.
872
- *
873
- * @returns the response object that contains results from list tags query.
874
- */
875
- }, {
876
- key: "list",
877
- value: function () {
878
- var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
879
- var response;
880
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
881
- while (1) switch (_context2.prev = _context2.next) {
882
- case 0:
883
- _context2.prev = 0;
884
- _context2.next = 3;
885
- return this.httpClient.post("/tags", request || {});
886
- case 3:
887
- response = _context2.sent;
888
- return _context2.abrupt("return", response.data);
889
- case 7:
890
- _context2.prev = 7;
891
- _context2.t0 = _context2["catch"](0);
892
- handleError(_context2.t0, "Failed to list tags.");
893
- case 10:
894
- case "end":
895
- return _context2.stop();
896
- }
897
- }, _callee2, this, [[0, 7]]);
898
- }));
899
- function list(_x2) {
900
- return _list.apply(this, arguments);
901
- }
902
- return list;
903
- }()
904
- }]);
905
- return TaggingReadOnlyClient;
906
- }();
907
-
908
- var TaggingClient = /*#__PURE__*/function (_TaggingReadOnlyClien) {
909
- _inherits(TaggingClient, _TaggingReadOnlyClien);
910
- var _super = _createSuper(TaggingClient);
911
- function TaggingClient(httpClient, rpcClient, wallet) {
912
- var _this;
913
- _classCallCheck(this, TaggingClient);
914
- _this = _super.call(this, httpClient, rpcClient);
915
- _this.wallet = wallet;
916
- return _this;
917
- }
918
- _createClass(TaggingClient, [{
919
- key: "setTag",
920
- value: function () {
921
- var _setTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
922
- var _yield$this$rpcClient, call, txHash;
923
- return _regeneratorRuntime().wrap(function _callee$(_context) {
924
- while (1) switch (_context.prev = _context.next) {
925
- case 0:
926
- _context.prev = 0;
927
- _context.next = 3;
928
- return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, TaggingModuleConfig), {}, {
929
- functionName: "setTag",
930
- args: [request.tag, request.ipId]
931
- }));
932
- case 3:
933
- _yield$this$rpcClient = _context.sent;
934
- call = _yield$this$rpcClient.request;
935
- _context.next = 7;
936
- return this.wallet.writeContract(call);
937
- case 7:
938
- txHash = _context.sent;
939
- return _context.abrupt("return", {
940
- txHash: txHash
941
- });
942
- case 11:
943
- _context.prev = 11;
944
- _context.t0 = _context["catch"](0);
945
- handleError(_context.t0, "Failed to set tag");
946
- case 14:
947
- case "end":
948
- return _context.stop();
949
- }
950
- }, _callee, this, [[0, 11]]);
951
- }));
952
- function setTag(_x) {
953
- return _setTag.apply(this, arguments);
954
- }
955
- return setTag;
956
- }()
957
518
  }, {
958
- key: "removeTag",
959
- value: function () {
960
- var _removeTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
961
- var _yield$this$rpcClient2, call, txHash;
962
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
963
- while (1) switch (_context2.prev = _context2.next) {
964
- case 0:
965
- _context2.prev = 0;
966
- _context2.next = 3;
967
- return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, TaggingModuleConfig), {}, {
968
- functionName: "removeTag",
969
- args: [request.tag, request.ipId]
970
- }));
971
- case 3:
972
- _yield$this$rpcClient2 = _context2.sent;
973
- call = _yield$this$rpcClient2.request;
974
- _context2.next = 7;
975
- return this.wallet.writeContract(call);
976
- case 7:
977
- txHash = _context2.sent;
978
- return _context2.abrupt("return", {
979
- txHash: txHash
980
- });
981
- case 11:
982
- _context2.prev = 11;
983
- _context2.t0 = _context2["catch"](0);
984
- handleError(_context2.t0, "Failed to remove tag");
985
- case 14:
986
- case "end":
987
- return _context2.stop();
988
- }
989
- }, _callee2, this, [[0, 11]]);
990
- }));
991
- function removeTag(_x2) {
992
- return _removeTag.apply(this, arguments);
993
- }
994
- return removeTag;
995
- }()
996
- }]);
997
- return TaggingClient;
998
- }(TaggingReadOnlyClient);
999
-
1000
- /**
1001
- * IPAssetReadOnlyClient allows you to view and search IP Assets on Story Protocol.
1002
- */
1003
- var IPAssetReadOnlyClient = /*#__PURE__*/function () {
1004
- function IPAssetReadOnlyClient(httpClient, rpcClient) {
1005
- _classCallCheck(this, IPAssetReadOnlyClient);
1006
- this.httpClient = httpClient;
1007
- this.rpcClient = rpcClient;
1008
- }
1009
-
1010
- /**
1011
- * Get an IP Asset based on the specified IP asset ID.
1012
- *
1013
- * @param request - the request object for getting an IP Asset.
1014
- * @returns the response object the contains the fetched IP Asset.
1015
- */
1016
- _createClass(IPAssetReadOnlyClient, [{
1017
- key: "get",
1018
- value: function () {
1019
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
1020
- var response;
1021
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1022
- while (1) switch (_context.prev = _context.next) {
1023
- case 0:
1024
- _context.prev = 0;
1025
- if (viem.isAddress(request.ipId)) {
1026
- _context.next = 3;
1027
- break;
1028
- }
1029
- throw new Error("Invalid ip id. Must be an address. But get: ".concat(request.ipId));
1030
- case 3:
1031
- _context.next = 5;
1032
- return this.httpClient.get("/accounts/".concat(request.ipId));
1033
- case 5:
1034
- response = _context.sent;
1035
- return _context.abrupt("return", response.data);
1036
- case 9:
1037
- _context.prev = 9;
1038
- _context.t0 = _context["catch"](0);
1039
- handleError(_context.t0, "Failed to get IP account");
1040
- case 12:
1041
- case "end":
1042
- return _context.stop();
1043
- }
1044
- }, _callee, this, [[0, 9]]);
1045
- }));
1046
- function get(_x) {
1047
- return _get.apply(this, arguments);
1048
- }
1049
- return get;
1050
- }()
1051
- /**
1052
- * List IP accounts.
1053
- *
1054
- * @returns the response object that contains results from listing query.
1055
- */
519
+ indexed: true,
520
+ internalType: "address",
521
+ name: "from",
522
+ type: "address"
1056
523
  }, {
1057
- key: "list",
1058
- value: function () {
1059
- var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
1060
- var response;
1061
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1062
- while (1) switch (_context2.prev = _context2.next) {
1063
- case 0:
1064
- _context2.prev = 0;
1065
- _context2.next = 3;
1066
- return this.httpClient.post("/accounts", request || {});
1067
- case 3:
1068
- response = _context2.sent;
1069
- return _context2.abrupt("return", response.data);
1070
- case 7:
1071
- _context2.prev = 7;
1072
- _context2.t0 = _context2["catch"](0);
1073
- handleError(_context2.t0, "Failed to list IP Asset.");
1074
- case 10:
1075
- case "end":
1076
- return _context2.stop();
1077
- }
1078
- }, _callee2, this, [[0, 7]]);
1079
- }));
1080
- function list(_x2) {
1081
- return _list.apply(this, arguments);
1082
- }
1083
- return list;
1084
- }()
524
+ indexed: true,
525
+ internalType: "address",
526
+ name: "to",
527
+ type: "address"
1085
528
  }, {
1086
- key: "getIpId",
1087
- value: function () {
1088
- var _getIpId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1089
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1090
- while (1) switch (_context3.prev = _context3.next) {
1091
- case 0:
1092
- case "end":
1093
- return _context3.stop();
1094
- }
1095
- }, _callee3);
1096
- }));
1097
- function getIpId() {
1098
- return _getIpId.apply(this, arguments);
1099
- }
1100
- return getIpId;
1101
- }()
1102
- }]);
1103
- return IPAssetReadOnlyClient;
1104
- }();
1105
-
1106
- var IPAccountRegistryABI = [{
1107
- inputs: [{
529
+ indexed: false,
1108
530
  internalType: "uint256",
1109
- name: "chainId_",
531
+ name: "id",
1110
532
  type: "uint256"
1111
533
  }, {
1112
- internalType: "address",
1113
- name: "tokenContract_",
1114
- type: "address"
1115
- }, {
534
+ indexed: false,
1116
535
  internalType: "uint256",
1117
- name: "tokenId_",
536
+ name: "value",
1118
537
  type: "uint256"
1119
538
  }],
1120
- name: "ipAsset",
1121
- outputs: [{
1122
- internalType: "address",
1123
- name: "",
1124
- type: "address"
1125
- }],
1126
- stateMutability: "view",
1127
- type: "function"
1128
- }, {
539
+ name: "TransferSingle",
540
+ type: "event"
541
+ }];
542
+
543
+ var AccessControllerABI = [{
1129
544
  anonymous: false,
1130
545
  inputs: [{
1131
- indexed: true,
546
+ indexed: false,
1132
547
  internalType: "address",
1133
- name: "account",
548
+ name: "ipAccountOwner",
1134
549
  type: "address"
1135
550
  }, {
1136
551
  indexed: true,
1137
552
  internalType: "address",
1138
- name: "implementation",
553
+ name: "ipAccount",
1139
554
  type: "address"
1140
555
  }, {
1141
556
  indexed: true,
1142
- internalType: "uint256",
1143
- name: "chainId",
1144
- type: "uint256"
557
+ internalType: "address",
558
+ name: "signer",
559
+ type: "address"
1145
560
  }, {
1146
- indexed: false,
561
+ indexed: true,
1147
562
  internalType: "address",
1148
- name: "tokenContract",
563
+ name: "to",
1149
564
  type: "address"
1150
565
  }, {
1151
566
  indexed: false,
1152
- internalType: "uint256",
1153
- name: "tokenId",
1154
- type: "uint256"
567
+ internalType: "bytes4",
568
+ name: "func",
569
+ type: "bytes4"
570
+ }, {
571
+ indexed: false,
572
+ internalType: "uint8",
573
+ name: "permission",
574
+ type: "uint8"
1155
575
  }],
1156
- name: "IPAccountRegistered",
576
+ name: "PermissionSet",
1157
577
  type: "event"
1158
- }];
1159
-
1160
- if (typeof process !== "undefined") {
1161
- dotenv__namespace.config();
1162
- }
1163
- var IPAccountRegistryRaw = IPAccountRegistryABI;
1164
- abitype.formatAbi(IPAccountRegistryRaw);
1165
- var IPAccountRegistryConfig = {
1166
- abi: IPAccountRegistryRaw,
1167
- address: viem.getAddress(process.env.IP_ACCOUNT_REGISTRY || process.env.NEXT_PUBLIC_IP_ACCOUNT_REGISTRY || "")
1168
- };
1169
-
1170
- function _arrayLikeToArray(arr, len) {
1171
- if (len == null || len > arr.length) len = arr.length;
1172
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1173
- return arr2;
1174
- }
578
+ }, {
579
+ inputs: [{
580
+ internalType: "address",
581
+ name: "ipAccount",
582
+ type: "address"
583
+ }, {
584
+ internalType: "address",
585
+ name: "signer",
586
+ type: "address"
587
+ }, {
588
+ internalType: "address",
589
+ name: "to",
590
+ type: "address"
591
+ }, {
592
+ internalType: "bytes4",
593
+ name: "func",
594
+ type: "bytes4"
595
+ }, {
596
+ internalType: "uint8",
597
+ name: "permission",
598
+ type: "uint8"
599
+ }],
600
+ name: "setPermission",
601
+ outputs: [],
602
+ stateMutability: "nonpayable",
603
+ type: "function"
604
+ }];
605
+
606
+ var DisputeModuleABI = [{
607
+ anonymous: false,
608
+ inputs: [{
609
+ indexed: false,
610
+ internalType: "uint256",
611
+ name: "disputeId",
612
+ type: "uint256"
613
+ }, {
614
+ indexed: false,
615
+ internalType: "bytes",
616
+ name: "data",
617
+ type: "bytes"
618
+ }],
619
+ name: "DisputeCancelled",
620
+ type: "event"
621
+ }, {
622
+ anonymous: false,
623
+ inputs: [{
624
+ indexed: false,
625
+ internalType: "uint256",
626
+ name: "disputeId",
627
+ type: "uint256"
628
+ }, {
629
+ indexed: false,
630
+ internalType: "address",
631
+ name: "targetIpId",
632
+ type: "address"
633
+ }, {
634
+ indexed: false,
635
+ internalType: "address",
636
+ name: "disputeInitiator",
637
+ type: "address"
638
+ }, {
639
+ indexed: false,
640
+ internalType: "address",
641
+ name: "arbitrationPolicy",
642
+ type: "address"
643
+ }, {
644
+ indexed: false,
645
+ internalType: "bytes32",
646
+ name: "linkToDisputeEvidence",
647
+ type: "bytes32"
648
+ }, {
649
+ indexed: false,
650
+ internalType: "bytes32",
651
+ name: "targetTag",
652
+ type: "bytes32"
653
+ }, {
654
+ indexed: false,
655
+ internalType: "bytes",
656
+ name: "data",
657
+ type: "bytes"
658
+ }],
659
+ name: "DisputeRaised",
660
+ type: "event"
661
+ }, {
662
+ anonymous: false,
663
+ inputs: [{
664
+ indexed: false,
665
+ internalType: "uint256",
666
+ name: "disputeId",
667
+ type: "uint256"
668
+ }],
669
+ name: "DisputeResolved",
670
+ type: "event"
671
+ }, {
672
+ inputs: [{
673
+ internalType: "uint256",
674
+ name: "disputeId",
675
+ type: "uint256"
676
+ }, {
677
+ internalType: "bytes",
678
+ name: "data",
679
+ type: "bytes"
680
+ }],
681
+ name: "cancelDispute",
682
+ outputs: [],
683
+ stateMutability: "nonpayable",
684
+ type: "function"
685
+ }, {
686
+ inputs: [{
687
+ internalType: "address",
688
+ name: "targetIpId",
689
+ type: "address"
690
+ }, {
691
+ internalType: "string",
692
+ name: "linkToDisputeEvidence",
693
+ type: "string"
694
+ }, {
695
+ internalType: "bytes32",
696
+ name: "targetTag",
697
+ type: "bytes32"
698
+ }, {
699
+ internalType: "bytes",
700
+ name: "data",
701
+ type: "bytes"
702
+ }],
703
+ name: "raiseDispute",
704
+ outputs: [{
705
+ internalType: "uint256",
706
+ name: "",
707
+ type: "uint256"
708
+ }],
709
+ stateMutability: "nonpayable",
710
+ type: "function"
711
+ }, {
712
+ inputs: [{
713
+ internalType: "uint256",
714
+ name: "disputeId",
715
+ type: "uint256"
716
+ }],
717
+ name: "resolveDispute",
718
+ outputs: [],
719
+ stateMutability: "nonpayable",
720
+ type: "function"
721
+ }];
722
+
723
+ var IPAccountImplABI = [{
724
+ inputs: [{
725
+ internalType: "address",
726
+ name: "to",
727
+ type: "address"
728
+ }, {
729
+ internalType: "uint256",
730
+ name: "value",
731
+ type: "uint256"
732
+ }, {
733
+ internalType: "bytes",
734
+ name: "data",
735
+ type: "bytes"
736
+ }],
737
+ name: "execute",
738
+ outputs: [{
739
+ internalType: "bytes",
740
+ name: "result",
741
+ type: "bytes"
742
+ }],
743
+ stateMutability: "payable",
744
+ type: "function"
745
+ }, {
746
+ inputs: [{
747
+ internalType: "address",
748
+ name: "to",
749
+ type: "address"
750
+ }, {
751
+ internalType: "uint256",
752
+ name: "value",
753
+ type: "uint256"
754
+ }, {
755
+ internalType: "bytes",
756
+ name: "data",
757
+ type: "bytes"
758
+ }, {
759
+ internalType: "address",
760
+ name: "signer",
761
+ type: "address"
762
+ }, {
763
+ internalType: "uint256",
764
+ name: "deadline",
765
+ type: "uint256"
766
+ }, {
767
+ internalType: "bytes",
768
+ name: "signature",
769
+ type: "bytes"
770
+ }],
771
+ name: "executeWithSig",
772
+ outputs: [{
773
+ internalType: "bytes",
774
+ name: "result",
775
+ type: "bytes"
776
+ }],
777
+ stateMutability: "payable",
778
+ type: "function"
779
+ }];
780
+
781
+ var IPAssetRegistryABI = [{
782
+ anonymous: false,
783
+ inputs: [{
784
+ indexed: false,
785
+ internalType: "address",
786
+ name: "ipId",
787
+ type: "address"
788
+ }, {
789
+ indexed: true,
790
+ internalType: "uint256",
791
+ name: "chainId",
792
+ type: "uint256"
793
+ }, {
794
+ indexed: true,
795
+ internalType: "address",
796
+ name: "tokenContract",
797
+ type: "address"
798
+ }, {
799
+ indexed: true,
800
+ internalType: "uint256",
801
+ name: "tokenId",
802
+ type: "uint256"
803
+ }, {
804
+ indexed: false,
805
+ internalType: "address",
806
+ name: "resolver",
807
+ type: "address"
808
+ }, {
809
+ indexed: false,
810
+ internalType: "address",
811
+ name: "provider",
812
+ type: "address"
813
+ }, {
814
+ indexed: false,
815
+ internalType: "bytes",
816
+ name: "metadata",
817
+ type: "bytes"
818
+ }],
819
+ name: "IPRegistered",
820
+ type: "event"
821
+ }];
822
+
823
+ var LicensingModuleABI = [{
824
+ anonymous: false,
825
+ inputs: [{
826
+ indexed: true,
827
+ internalType: "address",
828
+ name: "caller",
829
+ type: "address"
830
+ }, {
831
+ indexed: true,
832
+ internalType: "address",
833
+ name: "ipId",
834
+ type: "address"
835
+ }, {
836
+ indexed: false,
837
+ internalType: "address[]",
838
+ name: "parentIpIds",
839
+ type: "address[]"
840
+ }],
841
+ name: "IpIdLinkedToParents",
842
+ type: "event"
843
+ }, {
844
+ anonymous: false,
845
+ inputs: [{
846
+ indexed: true,
847
+ internalType: "address",
848
+ name: "caller",
849
+ type: "address"
850
+ }, {
851
+ indexed: true,
852
+ internalType: "address",
853
+ name: "ipId",
854
+ type: "address"
855
+ }, {
856
+ indexed: true,
857
+ internalType: "uint256",
858
+ name: "policyId",
859
+ type: "uint256"
860
+ }, {
861
+ indexed: false,
862
+ internalType: "uint256",
863
+ name: "index",
864
+ type: "uint256"
865
+ }, {
866
+ indexed: false,
867
+ internalType: "bool",
868
+ name: "isInherited",
869
+ type: "bool"
870
+ }],
871
+ name: "PolicyAddedToIpId",
872
+ type: "event"
873
+ }, {
874
+ anonymous: false,
875
+ inputs: [{
876
+ indexed: true,
877
+ internalType: "uint256",
878
+ name: "policyId",
879
+ type: "uint256"
880
+ }, {
881
+ indexed: true,
882
+ internalType: "address",
883
+ name: "policyFrameworkManager",
884
+ type: "address"
885
+ }, {
886
+ indexed: false,
887
+ internalType: "bytes",
888
+ name: "frameworkData",
889
+ type: "bytes"
890
+ }, {
891
+ indexed: false,
892
+ internalType: "address",
893
+ name: "royaltyPolicy",
894
+ type: "address"
895
+ }, {
896
+ indexed: false,
897
+ internalType: "bytes",
898
+ name: "royaltyData",
899
+ type: "bytes"
900
+ }, {
901
+ indexed: false,
902
+ internalType: "uint256",
903
+ name: "mintingFee",
904
+ type: "uint256"
905
+ }, {
906
+ indexed: false,
907
+ internalType: "address",
908
+ name: "mintingFeeToken",
909
+ type: "address"
910
+ }],
911
+ name: "PolicyRegistered",
912
+ type: "event"
913
+ }, {
914
+ inputs: [{
915
+ internalType: "address",
916
+ name: "ipId",
917
+ type: "address"
918
+ }, {
919
+ internalType: "uint256",
920
+ name: "polId",
921
+ type: "uint256"
922
+ }],
923
+ name: "addPolicyToIp",
924
+ outputs: [{
925
+ internalType: "uint256",
926
+ name: "indexOnIpId",
927
+ type: "uint256"
928
+ }],
929
+ stateMutability: "nonpayable",
930
+ type: "function"
931
+ }, {
932
+ inputs: [{
933
+ internalType: "uint256[]",
934
+ name: "licenseIds",
935
+ type: "uint256[]"
936
+ }, {
937
+ internalType: "address",
938
+ name: "childIpId",
939
+ type: "address"
940
+ }, {
941
+ internalType: "bytes",
942
+ name: "royaltyContext",
943
+ type: "bytes"
944
+ }],
945
+ name: "linkIpToParents",
946
+ outputs: [],
947
+ stateMutability: "nonpayable",
948
+ type: "function"
949
+ }, {
950
+ inputs: [{
951
+ internalType: "uint256",
952
+ name: "policyId",
953
+ type: "uint256"
954
+ }, {
955
+ internalType: "address",
956
+ name: "licensorIpId",
957
+ type: "address"
958
+ }, {
959
+ internalType: "uint256",
960
+ name: "amount",
961
+ type: "uint256"
962
+ }, {
963
+ internalType: "address",
964
+ name: "receiver",
965
+ type: "address"
966
+ }, {
967
+ internalType: "bytes",
968
+ name: "royaltyContext",
969
+ type: "bytes"
970
+ }],
971
+ name: "mintLicense",
972
+ outputs: [{
973
+ internalType: "uint256",
974
+ name: "licenseId",
975
+ type: "uint256"
976
+ }],
977
+ stateMutability: "nonpayable",
978
+ type: "function"
979
+ }, {
980
+ inputs: [{
981
+ components: [{
982
+ internalType: "bool",
983
+ name: "isLicenseTransferable",
984
+ type: "bool"
985
+ }, {
986
+ internalType: "address",
987
+ name: "policyFramework",
988
+ type: "address"
989
+ }, {
990
+ internalType: "bytes",
991
+ name: "frameworkData",
992
+ type: "bytes"
993
+ }, {
994
+ internalType: "address",
995
+ name: "royaltyPolicy",
996
+ type: "address"
997
+ }, {
998
+ internalType: "bytes",
999
+ name: "royaltyData",
1000
+ type: "bytes"
1001
+ }, {
1002
+ internalType: "uint256",
1003
+ name: "mintingFee",
1004
+ type: "uint256"
1005
+ }, {
1006
+ internalType: "address",
1007
+ name: "mintingFeeToken",
1008
+ type: "address"
1009
+ }],
1010
+ internalType: "struct Licensing.Policy",
1011
+ name: "pol",
1012
+ type: "tuple"
1013
+ }],
1014
+ name: "registerPolicy",
1015
+ outputs: [{
1016
+ internalType: "uint256",
1017
+ name: "policyId",
1018
+ type: "uint256"
1019
+ }],
1020
+ stateMutability: "nonpayable",
1021
+ type: "function"
1022
+ }];
1023
+
1024
+ var PILPolicyFrameworkManagerABI = [{
1025
+ inputs: [{
1026
+ components: [{
1027
+ internalType: "bool",
1028
+ name: "transferable",
1029
+ type: "bool"
1030
+ }, {
1031
+ internalType: "address",
1032
+ name: "royaltyPolicy",
1033
+ type: "address"
1034
+ }, {
1035
+ internalType: "uint256",
1036
+ name: "mintingFee",
1037
+ type: "uint256"
1038
+ }, {
1039
+ internalType: "address",
1040
+ name: "mintingFeeToken",
1041
+ type: "address"
1042
+ }, {
1043
+ components: [{
1044
+ internalType: "bool",
1045
+ name: "attribution",
1046
+ type: "bool"
1047
+ }, {
1048
+ internalType: "bool",
1049
+ name: "commercialUse",
1050
+ type: "bool"
1051
+ }, {
1052
+ internalType: "bool",
1053
+ name: "commercialAttribution",
1054
+ type: "bool"
1055
+ }, {
1056
+ internalType: "address",
1057
+ name: "commercializerChecker",
1058
+ type: "address"
1059
+ }, {
1060
+ internalType: "bytes",
1061
+ name: "commercializerCheckerData",
1062
+ type: "bytes"
1063
+ }, {
1064
+ internalType: "uint32",
1065
+ name: "commercialRevShare",
1066
+ type: "uint32"
1067
+ }, {
1068
+ internalType: "bool",
1069
+ name: "derivativesAllowed",
1070
+ type: "bool"
1071
+ }, {
1072
+ internalType: "bool",
1073
+ name: "derivativesAttribution",
1074
+ type: "bool"
1075
+ }, {
1076
+ internalType: "bool",
1077
+ name: "derivativesApproval",
1078
+ type: "bool"
1079
+ }, {
1080
+ internalType: "bool",
1081
+ name: "derivativesReciprocal",
1082
+ type: "bool"
1083
+ }, {
1084
+ internalType: "string[]",
1085
+ name: "territories",
1086
+ type: "string[]"
1087
+ }, {
1088
+ internalType: "string[]",
1089
+ name: "distributionChannels",
1090
+ type: "string[]"
1091
+ }, {
1092
+ internalType: "string[]",
1093
+ name: "contentRestrictions",
1094
+ type: "string[]"
1095
+ }],
1096
+ internalType: "struct PILPolicy",
1097
+ name: "policy",
1098
+ type: "tuple"
1099
+ }],
1100
+ internalType: "struct RegisterPILPolicyParams",
1101
+ name: "params",
1102
+ type: "tuple"
1103
+ }],
1104
+ name: "registerPolicy",
1105
+ outputs: [{
1106
+ internalType: "uint256",
1107
+ name: "policyId",
1108
+ type: "uint256"
1109
+ }],
1110
+ stateMutability: "nonpayable",
1111
+ type: "function"
1112
+ }];
1113
+
1114
+ var RegistrationModuleABI = [{
1115
+ inputs: [{
1116
+ internalType: "uint256[]",
1117
+ name: "licenseIds",
1118
+ type: "uint256[]"
1119
+ }, {
1120
+ internalType: "address",
1121
+ name: "tokenContract",
1122
+ type: "address"
1123
+ }, {
1124
+ internalType: "uint256",
1125
+ name: "tokenId",
1126
+ type: "uint256"
1127
+ }, {
1128
+ internalType: "string",
1129
+ name: "ipName",
1130
+ type: "string"
1131
+ }, {
1132
+ internalType: "bytes32",
1133
+ name: "contentHash",
1134
+ type: "bytes32"
1135
+ }, {
1136
+ internalType: "string",
1137
+ name: "externalURL",
1138
+ type: "string"
1139
+ }, {
1140
+ internalType: "bytes",
1141
+ name: "royaltyContext",
1142
+ type: "bytes"
1143
+ }],
1144
+ name: "registerDerivativeIp",
1145
+ outputs: [],
1146
+ stateMutability: "nonpayable",
1147
+ type: "function"
1148
+ }, {
1149
+ inputs: [{
1150
+ internalType: "uint256",
1151
+ name: "policyId",
1152
+ type: "uint256"
1153
+ }, {
1154
+ internalType: "address",
1155
+ name: "tokenContract",
1156
+ type: "address"
1157
+ }, {
1158
+ internalType: "uint256",
1159
+ name: "tokenId",
1160
+ type: "uint256"
1161
+ }, {
1162
+ internalType: "string",
1163
+ name: "ipName",
1164
+ type: "string"
1165
+ }, {
1166
+ internalType: "bytes32",
1167
+ name: "contentHash",
1168
+ type: "bytes32"
1169
+ }, {
1170
+ internalType: "string",
1171
+ name: "externalURL",
1172
+ type: "string"
1173
+ }],
1174
+ name: "registerRootIp",
1175
+ outputs: [{
1176
+ internalType: "address",
1177
+ name: "",
1178
+ type: "address"
1179
+ }],
1180
+ stateMutability: "nonpayable",
1181
+ type: "function"
1182
+ }];
1183
+
1184
+ var TaggingModuleABI = [{
1185
+ inputs: [{
1186
+ internalType: "string",
1187
+ name: "tag",
1188
+ type: "string"
1189
+ }, {
1190
+ internalType: "address",
1191
+ name: "ipId",
1192
+ type: "address"
1193
+ }],
1194
+ name: "removeTag",
1195
+ outputs: [{
1196
+ internalType: "bool",
1197
+ name: "removed",
1198
+ type: "bool"
1199
+ }],
1200
+ stateMutability: "nonpayable",
1201
+ type: "function"
1202
+ }, {
1203
+ inputs: [{
1204
+ internalType: "string",
1205
+ name: "tag",
1206
+ type: "string"
1207
+ }, {
1208
+ internalType: "address",
1209
+ name: "ipId",
1210
+ type: "address"
1211
+ }],
1212
+ name: "setTag",
1213
+ outputs: [{
1214
+ internalType: "bool",
1215
+ name: "added",
1216
+ type: "bool"
1217
+ }],
1218
+ stateMutability: "nonpayable",
1219
+ type: "function"
1220
+ }];
1221
+
1222
+ var ErrorsABI = [{
1223
+ inputs: [{
1224
+ internalType: "address",
1225
+ name: "caller",
1226
+ type: "address"
1227
+ }],
1228
+ name: "AccessControlled__CallerIsNotIpAccount",
1229
+ type: "error"
1230
+ }, {
1231
+ inputs: [{
1232
+ internalType: "address",
1233
+ name: "ipAccount",
1234
+ type: "address"
1235
+ }],
1236
+ name: "AccessControlled__NotIpAccount",
1237
+ type: "error"
1238
+ }, {
1239
+ inputs: [],
1240
+ name: "AccessControlled__ZeroAddress",
1241
+ type: "error"
1242
+ }, {
1243
+ inputs: [],
1244
+ name: "AccessController__CallerIsNotIPAccount",
1245
+ type: "error"
1246
+ }, {
1247
+ inputs: [{
1248
+ internalType: "address",
1249
+ name: "ipAccount",
1250
+ type: "address"
1251
+ }],
1252
+ name: "AccessController__IPAccountIsNotValid",
1253
+ type: "error"
1254
+ }, {
1255
+ inputs: [],
1256
+ name: "AccessController__IPAccountIsZeroAddress",
1257
+ type: "error"
1258
+ }, {
1259
+ inputs: [{
1260
+ internalType: "address",
1261
+ name: "ipAccount",
1262
+ type: "address"
1263
+ }, {
1264
+ internalType: "address",
1265
+ name: "signer",
1266
+ type: "address"
1267
+ }, {
1268
+ internalType: "address",
1269
+ name: "to",
1270
+ type: "address"
1271
+ }, {
1272
+ internalType: "bytes4",
1273
+ name: "func",
1274
+ type: "bytes4"
1275
+ }],
1276
+ name: "AccessController__PermissionDenied",
1277
+ type: "error"
1278
+ }, {
1279
+ inputs: [],
1280
+ name: "AccessController__PermissionIsNotValid",
1281
+ type: "error"
1282
+ }, {
1283
+ inputs: [{
1284
+ internalType: "address",
1285
+ name: "to",
1286
+ type: "address"
1287
+ }],
1288
+ name: "AccessController__RecipientIsNotRegisteredModule",
1289
+ type: "error"
1290
+ }, {
1291
+ inputs: [],
1292
+ name: "AccessController__SignerIsZeroAddress",
1293
+ type: "error"
1294
+ }, {
1295
+ inputs: [],
1296
+ name: "AncestorsVaultLAP__AlreadyClaimed",
1297
+ type: "error"
1298
+ }, {
1299
+ inputs: [],
1300
+ name: "AncestorsVaultLAP__ClaimerNotAnAncestor",
1301
+ type: "error"
1302
+ }, {
1303
+ inputs: [],
1304
+ name: "AncestorsVaultLAP__ERC20BalanceNotZero",
1305
+ type: "error"
1306
+ }, {
1307
+ inputs: [],
1308
+ name: "AncestorsVaultLAP__ETHBalanceNotZero",
1309
+ type: "error"
1310
+ }, {
1311
+ inputs: [],
1312
+ name: "AncestorsVaultLAP__InvalidAncestorsHash",
1313
+ type: "error"
1314
+ }, {
1315
+ inputs: [],
1316
+ name: "AncestorsVaultLAP__InvalidClaimer",
1317
+ type: "error"
1318
+ }, {
1319
+ inputs: [],
1320
+ name: "AncestorsVaultLAP__TransferFailed",
1321
+ type: "error"
1322
+ }, {
1323
+ inputs: [],
1324
+ name: "AncestorsVaultLAP__ZeroRoyaltyPolicyLAP",
1325
+ type: "error"
1326
+ }, {
1327
+ inputs: [],
1328
+ name: "ArbitrationPolicySP__NotDisputeModule",
1329
+ type: "error"
1330
+ }, {
1331
+ inputs: [],
1332
+ name: "ArbitrationPolicySP__ZeroDisputeModule",
1333
+ type: "error"
1334
+ }, {
1335
+ inputs: [],
1336
+ name: "ArbitrationPolicySP__ZeroPaymentToken",
1337
+ type: "error"
1338
+ }, {
1339
+ inputs: [],
1340
+ name: "DisputeModule__NotAbleToResolve",
1341
+ type: "error"
1342
+ }, {
1343
+ inputs: [],
1344
+ name: "DisputeModule__NotDisputeInitiator",
1345
+ type: "error"
1346
+ }, {
1347
+ inputs: [],
1348
+ name: "DisputeModule__NotInDisputeState",
1349
+ type: "error"
1350
+ }, {
1351
+ inputs: [],
1352
+ name: "DisputeModule__NotRegisteredIpId",
1353
+ type: "error"
1354
+ }, {
1355
+ inputs: [],
1356
+ name: "DisputeModule__NotWhitelistedArbitrationPolicy",
1357
+ type: "error"
1358
+ }, {
1359
+ inputs: [],
1360
+ name: "DisputeModule__NotWhitelistedArbitrationRelayer",
1361
+ type: "error"
1362
+ }, {
1363
+ inputs: [],
1364
+ name: "DisputeModule__NotWhitelistedDisputeTag",
1365
+ type: "error"
1366
+ }, {
1367
+ inputs: [],
1368
+ name: "DisputeModule__UnauthorizedAccess",
1369
+ type: "error"
1370
+ }, {
1371
+ inputs: [],
1372
+ name: "DisputeModule__ZeroArbitrationPolicy",
1373
+ type: "error"
1374
+ }, {
1375
+ inputs: [],
1376
+ name: "DisputeModule__ZeroArbitrationRelayer",
1377
+ type: "error"
1378
+ }, {
1379
+ inputs: [],
1380
+ name: "DisputeModule__ZeroDisputeTag",
1381
+ type: "error"
1382
+ }, {
1383
+ inputs: [],
1384
+ name: "DisputeModule__ZeroLinkToDisputeEvidence",
1385
+ type: "error"
1386
+ }, {
1387
+ inputs: [],
1388
+ name: "Governance__InconsistentState",
1389
+ type: "error"
1390
+ }, {
1391
+ inputs: [],
1392
+ name: "Governance__NewStateIsTheSameWithOldState",
1393
+ type: "error"
1394
+ }, {
1395
+ inputs: [],
1396
+ name: "Governance__OnlyProtocolAdmin",
1397
+ type: "error"
1398
+ }, {
1399
+ inputs: [],
1400
+ name: "Governance__ProtocolPaused",
1401
+ type: "error"
1402
+ }, {
1403
+ inputs: [{
1404
+ internalType: "string",
1405
+ name: "interfaceName",
1406
+ type: "string"
1407
+ }],
1408
+ name: "Governance__UnsupportedInterface",
1409
+ type: "error"
1410
+ }, {
1411
+ inputs: [],
1412
+ name: "Governance__ZeroAddress",
1413
+ type: "error"
1414
+ }, {
1415
+ inputs: [],
1416
+ name: "IPAccountRegistry_InvalidIpAccountImpl",
1417
+ type: "error"
1418
+ }, {
1419
+ inputs: [],
1420
+ name: "IPAccount__ExpiredSignature",
1421
+ type: "error"
1422
+ }, {
1423
+ inputs: [],
1424
+ name: "IPAccount__InvalidAccessController",
1425
+ type: "error"
1426
+ }, {
1427
+ inputs: [],
1428
+ name: "IPAccount__InvalidCalldata",
1429
+ type: "error"
1430
+ }, {
1431
+ inputs: [],
1432
+ name: "IPAccount__InvalidSignature",
1433
+ type: "error"
1434
+ }, {
1435
+ inputs: [],
1436
+ name: "IPAccount__InvalidSigner",
1437
+ type: "error"
1438
+ }, {
1439
+ inputs: [],
1440
+ name: "IPAssetRegistry__AlreadyRegistered",
1441
+ type: "error"
1442
+ }, {
1443
+ inputs: [],
1444
+ name: "IPAssetRegistry__IPAccountAlreadyCreated",
1445
+ type: "error"
1446
+ }, {
1447
+ inputs: [],
1448
+ name: "IPAssetRegistry__InvalidAccount",
1449
+ type: "error"
1450
+ }, {
1451
+ inputs: [],
1452
+ name: "IPAssetRegistry__InvalidMetadataProvider",
1453
+ type: "error"
1454
+ }, {
1455
+ inputs: [],
1456
+ name: "IPAssetRegistry__NotYetRegistered",
1457
+ type: "error"
1458
+ }, {
1459
+ inputs: [],
1460
+ name: "IPAssetRegistry__RegistrantUnauthorized",
1461
+ type: "error"
1462
+ }, {
1463
+ inputs: [],
1464
+ name: "IPAssetRegistry__ResolverInvalid",
1465
+ type: "error"
1466
+ }, {
1467
+ inputs: [],
1468
+ name: "IPAssetRegistry__Unauthorized",
1469
+ type: "error"
1470
+ }, {
1471
+ inputs: [],
1472
+ name: "IPResolver_InvalidIP",
1473
+ type: "error"
1474
+ }, {
1475
+ inputs: [],
1476
+ name: "IPResolver_Unauthorized",
1477
+ type: "error"
1478
+ }, {
1479
+ inputs: [],
1480
+ name: "LicenseRegistry__CallerNotLicensingModule",
1481
+ type: "error"
1482
+ }, {
1483
+ inputs: [],
1484
+ name: "LicenseRegistry__NotTransferable",
1485
+ type: "error"
1486
+ }, {
1487
+ inputs: [],
1488
+ name: "LicenseRegistry__RevokedLicense",
1489
+ type: "error"
1490
+ }, {
1491
+ inputs: [],
1492
+ name: "LicenseRegistry__ZeroDisputeModule",
1493
+ type: "error"
1494
+ }, {
1495
+ inputs: [],
1496
+ name: "LicenseRegistry__ZeroLicensingModule",
1497
+ type: "error"
1498
+ }, {
1499
+ inputs: [],
1500
+ name: "LicensingModuleAware__CallerNotLicensingModule",
1501
+ type: "error"
1502
+ }, {
1503
+ inputs: [],
1504
+ name: "LicensingModule__CallerNotLicenseRegistry",
1505
+ type: "error"
1506
+ }, {
1507
+ inputs: [],
1508
+ name: "LicensingModule__CallerNotLicensorAndPolicyNotSet",
1509
+ type: "error"
1510
+ }, {
1511
+ inputs: [],
1512
+ name: "LicensingModule__CommercialTermInNonCommercialPolicy",
1513
+ type: "error"
1514
+ }, {
1515
+ inputs: [],
1516
+ name: "LicensingModule__DerivativeRevShareSumExceedsMaxRNFTSupply",
1517
+ type: "error"
1518
+ }, {
1519
+ inputs: [],
1520
+ name: "LicensingModule__DerivativesCannotAddPolicy",
1521
+ type: "error"
1522
+ }, {
1523
+ inputs: [],
1524
+ name: "LicensingModule__DisputedIpId",
1525
+ type: "error"
1526
+ }, {
1527
+ inputs: [],
1528
+ name: "LicensingModule__EmptyLicenseUrl",
1529
+ type: "error"
1530
+ }, {
1531
+ inputs: [],
1532
+ name: "LicensingModule__EmptyParamName",
1533
+ type: "error"
1534
+ }, {
1535
+ inputs: [],
1536
+ name: "LicensingModule__FrameworkNotFound",
1537
+ type: "error"
1538
+ }, {
1539
+ inputs: [],
1540
+ name: "LicensingModule__IncompatibleLicensorCommercialPolicy",
1541
+ type: "error"
1542
+ }, {
1543
+ inputs: [],
1544
+ name: "LicensingModule__IncompatibleLicensorRoyaltyDerivativeRevShare",
1545
+ type: "error"
1546
+ }, {
1547
+ inputs: [],
1548
+ name: "LicensingModule__IncompatibleRoyaltyPolicyAddress",
1549
+ type: "error"
1550
+ }, {
1551
+ inputs: [],
1552
+ name: "LicensingModule__IncompatibleRoyaltyPolicyDerivativeRevShare",
1553
+ type: "error"
1554
+ }, {
1555
+ inputs: [],
1556
+ name: "LicensingModule__InvalidLicensor",
1557
+ type: "error"
1558
+ }, {
1559
+ inputs: [],
1560
+ name: "LicensingModule__InvalidPolicyFramework",
1561
+ type: "error"
1562
+ }, {
1563
+ inputs: [],
1564
+ name: "LicensingModule__LicensorDoesntHaveThisPolicy",
1565
+ type: "error"
1566
+ }, {
1567
+ inputs: [],
1568
+ name: "LicensingModule__LicensorNotRegistered",
1569
+ type: "error"
1570
+ }, {
1571
+ inputs: [],
1572
+ name: "LicensingModule__LinkParentParamFailed",
1573
+ type: "error"
1574
+ }, {
1575
+ inputs: [],
1576
+ name: "LicensingModule__LinkingRevokedLicense",
1577
+ type: "error"
1578
+ }, {
1579
+ inputs: [],
1580
+ name: "LicensingModule__MintLicenseParamFailed",
1581
+ type: "error"
1582
+ }, {
1583
+ inputs: [],
1584
+ name: "LicensingModule__MintingFeeTokenNotWhitelisted",
1585
+ type: "error"
1586
+ }, {
1587
+ inputs: [],
1588
+ name: "LicensingModule__MismatchBetweenRoyaltyPolicy",
1589
+ type: "error"
1590
+ }, {
1591
+ inputs: [],
1592
+ name: "LicensingModule__NotLicensee",
1593
+ type: "error"
1594
+ }, {
1595
+ inputs: [],
1596
+ name: "LicensingModule__ParamVerifierAlreadySet",
1597
+ type: "error"
1598
+ }, {
1599
+ inputs: [],
1600
+ name: "LicensingModule__ParamVerifierLengthMismatch",
1601
+ type: "error"
1602
+ }, {
1603
+ inputs: [],
1604
+ name: "LicensingModule__ParentIdEqualThanChild",
1605
+ type: "error"
1606
+ }, {
1607
+ inputs: [],
1608
+ name: "LicensingModule__PolicyAlreadySetForIpId",
1609
+ type: "error"
1610
+ }, {
1611
+ inputs: [],
1612
+ name: "LicensingModule__PolicyNotFound",
1613
+ type: "error"
1614
+ }, {
1615
+ inputs: [],
1616
+ name: "LicensingModule__RegisterPolicyFrameworkMismatch",
1617
+ type: "error"
1618
+ }, {
1619
+ inputs: [],
1620
+ name: "LicensingModule__RoyaltyPolicyNotWhitelisted",
1621
+ type: "error"
1622
+ }, {
1623
+ inputs: [],
1624
+ name: "LicensingModule__TransferParamFailed",
1625
+ type: "error"
1626
+ }, {
1627
+ inputs: [],
1628
+ name: "LicensingModule__UnauthorizedAccess",
1629
+ type: "error"
1630
+ }, {
1631
+ inputs: [],
1632
+ name: "LicensingModule__UnregisteredFrameworkAddingPolicy",
1633
+ type: "error"
1634
+ }, {
1635
+ inputs: [],
1636
+ name: "LicensorApprovalChecker__Unauthorized",
1637
+ type: "error"
1638
+ }, {
1639
+ inputs: [],
1640
+ name: "MetadataProvider__HashInvalid",
1641
+ type: "error"
1642
+ }, {
1643
+ inputs: [],
1644
+ name: "MetadataProvider__IPAssetOwnerInvalid",
1645
+ type: "error"
1646
+ }, {
1647
+ inputs: [],
1648
+ name: "MetadataProvider__MetadataNotCompatible",
1649
+ type: "error"
1650
+ }, {
1651
+ inputs: [],
1652
+ name: "MetadataProvider__NameInvalid",
1653
+ type: "error"
1654
+ }, {
1655
+ inputs: [],
1656
+ name: "MetadataProvider__RegistrantInvalid",
1657
+ type: "error"
1658
+ }, {
1659
+ inputs: [],
1660
+ name: "MetadataProvider__RegistrationDateInvalid",
1661
+ type: "error"
1662
+ }, {
1663
+ inputs: [],
1664
+ name: "MetadataProvider__URIInvalid",
1665
+ type: "error"
1666
+ }, {
1667
+ inputs: [],
1668
+ name: "MetadataProvider__Unauthorized",
1669
+ type: "error"
1670
+ }, {
1671
+ inputs: [],
1672
+ name: "MetadataProvider__UpgradeProviderInvalid",
1673
+ type: "error"
1674
+ }, {
1675
+ inputs: [],
1676
+ name: "MetadataProvider__UpgradeUnavailable",
1677
+ type: "error"
1678
+ }, {
1679
+ inputs: [],
1680
+ name: "ModuleRegistry__InterfaceIdZero",
1681
+ type: "error"
1682
+ }, {
1683
+ inputs: [],
1684
+ name: "ModuleRegistry__ModuleAddressNotContract",
1685
+ type: "error"
1686
+ }, {
1687
+ inputs: [],
1688
+ name: "ModuleRegistry__ModuleAddressZeroAddress",
1689
+ type: "error"
1690
+ }, {
1691
+ inputs: [],
1692
+ name: "ModuleRegistry__ModuleAlreadyRegistered",
1693
+ type: "error"
1694
+ }, {
1695
+ inputs: [],
1696
+ name: "ModuleRegistry__ModuleNotRegistered",
1697
+ type: "error"
1698
+ }, {
1699
+ inputs: [],
1700
+ name: "ModuleRegistry__ModuleNotSupportExpectedModuleTypeInterfaceId",
1701
+ type: "error"
1702
+ }, {
1703
+ inputs: [],
1704
+ name: "ModuleRegistry__ModuleTypeAlreadyRegistered",
1705
+ type: "error"
1706
+ }, {
1707
+ inputs: [],
1708
+ name: "ModuleRegistry__ModuleTypeEmptyString",
1709
+ type: "error"
1710
+ }, {
1711
+ inputs: [],
1712
+ name: "ModuleRegistry__ModuleTypeNotRegistered",
1713
+ type: "error"
1714
+ }, {
1715
+ inputs: [],
1716
+ name: "ModuleRegistry__NameAlreadyRegistered",
1717
+ type: "error"
1718
+ }, {
1719
+ inputs: [],
1720
+ name: "ModuleRegistry__NameDoesNotMatch",
1721
+ type: "error"
1722
+ }, {
1723
+ inputs: [],
1724
+ name: "ModuleRegistry__NameEmptyString",
1725
+ type: "error"
1726
+ }, {
1727
+ inputs: [],
1728
+ name: "Module_Unauthorized",
1729
+ type: "error"
1730
+ }, {
1731
+ inputs: [{
1732
+ internalType: "address",
1733
+ name: "commercializer",
1734
+ type: "address"
1735
+ }],
1736
+ name: "PolicyFrameworkManager__CommercializerCheckerDoesNotSupportHook",
1737
+ type: "error"
1738
+ }, {
1739
+ inputs: [],
1740
+ name: "PolicyFrameworkManager__GettingPolicyWrongFramework",
1741
+ type: "error"
1742
+ }, {
1743
+ inputs: [],
1744
+ name: "RegistrationModule__InvalidOwner",
1745
+ type: "error"
1746
+ }, {
1747
+ inputs: [],
1748
+ name: "RoyaltyModule__CanOnlyMintSelectedPolicy",
1749
+ type: "error"
1750
+ }, {
1751
+ inputs: [],
1752
+ name: "RoyaltyModule__IncompatibleRoyaltyPolicy",
1753
+ type: "error"
1754
+ }, {
1755
+ inputs: [],
1756
+ name: "RoyaltyModule__NoParentsOnLinking",
1757
+ type: "error"
1758
+ }, {
1759
+ inputs: [],
1760
+ name: "RoyaltyModule__NoRoyaltyPolicySet",
1761
+ type: "error"
1762
+ }, {
1763
+ inputs: [],
1764
+ name: "RoyaltyModule__NotAllowedCaller",
1765
+ type: "error"
1766
+ }, {
1767
+ inputs: [],
1768
+ name: "RoyaltyModule__NotRegisteredIpId",
1769
+ type: "error"
1770
+ }, {
1771
+ inputs: [],
1772
+ name: "RoyaltyModule__NotWhitelistedRoyaltyPolicy",
1773
+ type: "error"
1774
+ }, {
1775
+ inputs: [],
1776
+ name: "RoyaltyModule__NotWhitelistedRoyaltyToken",
1777
+ type: "error"
1778
+ }, {
1779
+ inputs: [],
1780
+ name: "RoyaltyModule__ZeroLicensingModule",
1781
+ type: "error"
1782
+ }, {
1783
+ inputs: [],
1784
+ name: "RoyaltyModule__ZeroRoyaltyPolicy",
1785
+ type: "error"
1786
+ }, {
1787
+ inputs: [],
1788
+ name: "RoyaltyModule__ZeroRoyaltyToken",
1789
+ type: "error"
1790
+ }, {
1791
+ inputs: [],
1792
+ name: "RoyaltyPolicyLAP__AboveAncestorsLimit",
1793
+ type: "error"
1794
+ }, {
1795
+ inputs: [],
1796
+ name: "RoyaltyPolicyLAP__AboveParentLimit",
1797
+ type: "error"
1798
+ }, {
1799
+ inputs: [],
1800
+ name: "RoyaltyPolicyLAP__AboveRoyaltyStackLimit",
1801
+ type: "error"
1802
+ }, {
1803
+ inputs: [],
1804
+ name: "RoyaltyPolicyLAP__ImplementationAlreadySet",
1805
+ type: "error"
1806
+ }, {
1807
+ inputs: [],
1808
+ name: "RoyaltyPolicyLAP__InvalidAncestors",
1809
+ type: "error"
1810
+ }, {
1811
+ inputs: [],
1812
+ name: "RoyaltyPolicyLAP__InvalidAncestorsHash",
1813
+ type: "error"
1814
+ }, {
1815
+ inputs: [],
1816
+ name: "RoyaltyPolicyLAP__InvalidAncestorsLength",
1817
+ type: "error"
1818
+ }, {
1819
+ inputs: [],
1820
+ name: "RoyaltyPolicyLAP__InvalidAncestorsRoyalty",
1821
+ type: "error"
1822
+ }, {
1823
+ inputs: [],
1824
+ name: "RoyaltyPolicyLAP__InvalidParentRoyaltiesLength",
1825
+ type: "error"
1826
+ }, {
1827
+ inputs: [],
1828
+ name: "RoyaltyPolicyLAP__InvalidRoyaltyAmountLength",
1829
+ type: "error"
1830
+ }, {
1831
+ inputs: [],
1832
+ name: "RoyaltyPolicyLAP__LastPositionNotAbleToMintLicense",
1833
+ type: "error"
1834
+ }, {
1835
+ inputs: [],
1836
+ name: "RoyaltyPolicyLAP__NotFullOwnership",
1837
+ type: "error"
1838
+ }, {
1839
+ inputs: [],
1840
+ name: "RoyaltyPolicyLAP__NotRoyaltyModule",
1841
+ type: "error"
1842
+ }, {
1843
+ inputs: [],
1844
+ name: "RoyaltyPolicyLAP__TransferFailed",
1845
+ type: "error"
1846
+ }, {
1847
+ inputs: [],
1848
+ name: "RoyaltyPolicyLAP__UnlinkableToParents",
1849
+ type: "error"
1850
+ }, {
1851
+ inputs: [],
1852
+ name: "RoyaltyPolicyLAP__ZeroAncestorsVaultImpl",
1853
+ type: "error"
1854
+ }, {
1855
+ inputs: [],
1856
+ name: "RoyaltyPolicyLAP__ZeroLicensingModule",
1857
+ type: "error"
1858
+ }, {
1859
+ inputs: [],
1860
+ name: "RoyaltyPolicyLAP__ZeroLiquidSplitFactory",
1861
+ type: "error"
1862
+ }, {
1863
+ inputs: [],
1864
+ name: "RoyaltyPolicyLAP__ZeroLiquidSplitMain",
1865
+ type: "error"
1866
+ }, {
1867
+ inputs: [],
1868
+ name: "RoyaltyPolicyLAP__ZeroRoyaltyModule",
1869
+ type: "error"
1870
+ }, {
1871
+ inputs: [],
1872
+ name: "TaggingModule__DstIpIdDoesNotHaveDstTag",
1873
+ type: "error"
1874
+ }, {
1875
+ inputs: [],
1876
+ name: "TaggingModule__InvalidRelationTypeName",
1877
+ type: "error"
1878
+ }, {
1879
+ inputs: [],
1880
+ name: "TaggingModule__RelationTypeAlreadyExists",
1881
+ type: "error"
1882
+ }, {
1883
+ inputs: [],
1884
+ name: "TaggingModule__RelationTypeDoesNotExist",
1885
+ type: "error"
1886
+ }, {
1887
+ inputs: [],
1888
+ name: "TaggingModule__SrcIpIdDoesNotHaveSrcTag",
1889
+ type: "error"
1890
+ }];
1175
1891
 
1176
- function _unsupportedIterableToArray(o, minLen) {
1177
- if (!o) return;
1178
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1179
- var n = Object.prototype.toString.call(o).slice(8, -1);
1180
- if (n === "Object" && o.constructor) n = o.constructor.name;
1181
- if (n === "Map" || n === "Set") return Array.from(o);
1182
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1183
- }
1892
+ var sepolia = {
1893
+ AccessController: "0x31dd83a3FebB5fAD7F7bc8D4E05B623461B74a02",
1894
+ AncestorsVaultLAP: "0x9Faa4E491a211bFa415d44554120B1b31b6f4e59",
1895
+ ArbitrationPolicySP: "0x75e181d5eb307eCccf8d3b4724109eca14719A75",
1896
+ DisputeModule: "0x11dAA3F573C4d6673BBE7f2D96B4C91073A0d55d",
1897
+ Governance: "0xa18252Aa11Ff1B20b89C10109050CC46A4067b22",
1898
+ IPAccountImpl: "0x7BBaB2BD68fd3990c8dA2c26334a6DF8Acc7E96E",
1899
+ IPAccountRegistry: "0x7184bAdAdf24dc261C7C27BceFF53d7A25a06846",
1900
+ IPAssetRegistry: "0xF59adB67B7CC87436A7CC41040A7dB24AE90aDB8",
1901
+ IPAssetRenderer: "0x986d8E96b30b688FCD84e9A5A757C3d4304B47b6",
1902
+ IPMetadataProvider: "0xfcD468A72F76e89F2Df517274063ef7210a32e2A",
1903
+ IPResolver: "0xF0920314Fb4C375cdEB5b15c4e77277aCf36E3D7",
1904
+ LicenseRegistry: "0x4D6a54B467332dF675cFa689cb294A4cB9122866",
1905
+ LicensingModule: "0x0C72b24067a15994f91D92Fd9bA23eB5ebcF8378",
1906
+ MockERC20: "0xd53C2A80D24F6B3Ff009E48CF88D3b482E8E1457",
1907
+ MockERC721: "0xD3719824a768c139AAa7C5eFc8BDb5D1d13A1564",
1908
+ MockTokenGatedHook: "0x2d3ED4354eD09B0E6aa252938aEF41920aB6FC40",
1909
+ ModuleRegistry: "0x17Ad1cD06d44ae5F5480A675A4D8BD8DAED40410",
1910
+ PILPolicyFrameworkManager: "0x49cF5C5523011F8B4A0489969096Eb68C571C197",
1911
+ RegistrationModule: "0x248c8CbF469ec7CB22Dc9914E569920b93d717a3",
1912
+ RoyaltyModule: "0x512bbF310452cC96E0E9818B0870EcA557b86d4D",
1913
+ RoyaltyPolicyLAP: "0x8404061350BA0CA85c4E733B0be78c5519679003",
1914
+ TaggingModule: "0xED445f1DeE74Cf470Aab47F4b63734653C4C9537"
1915
+ };
1916
+
1917
+ var IPAccountABI = [].concat(_toConsumableArray(IPAccountImplABI), _toConsumableArray(ErrorsABI));
1918
+ var IPAssetRegistryConfig = {
1919
+ abi: IPAssetRegistryABI,
1920
+ address: viem.getAddress(sepolia.IPAssetRegistry)
1921
+ };
1922
+ var AccessControllerConfig = {
1923
+ abi: [].concat(_toConsumableArray(AccessControllerABI), _toConsumableArray(ErrorsABI)),
1924
+ address: viem.getAddress(sepolia.AccessController)
1925
+ };
1926
+ var DisputeModuleConfig = {
1927
+ abi: [].concat(_toConsumableArray(DisputeModuleABI), _toConsumableArray(ErrorsABI)),
1928
+ address: viem.getAddress(sepolia.DisputeModule)
1929
+ };
1930
+ var LicenseRegistryConfig = {
1931
+ abi: IERC1155ABI,
1932
+ address: viem.getAddress(sepolia.LicenseRegistry)
1933
+ };
1934
+ var LicensingModuleConfig = {
1935
+ abi: LicensingModuleABI,
1936
+ //abi: [...LicensingModuleABI, ...ErrorsABI],
1937
+ address: viem.getAddress(sepolia.LicensingModule)
1938
+ };
1939
+ var RegistrationModuleConfig = {
1940
+ abi: RegistrationModuleABI,
1941
+ //abi: [...RegistrationModuleABI, ...ErrorsABI],
1942
+ address: viem.getAddress(sepolia.RegistrationModule)
1943
+ };
1944
+ var TaggingModuleConfig = {
1945
+ abi: [].concat(_toConsumableArray(TaggingModuleABI), _toConsumableArray(ErrorsABI)),
1946
+ address: viem.getAddress(sepolia.TaggingModule)
1947
+ };
1948
+ var PILPolicyFrameworkManagerConfig = {
1949
+ abi: PILPolicyFrameworkManagerABI,
1950
+ //abi: [...PILPolicyFrameworkManagerABI, ...ErrorsABI],
1951
+ address: viem.getAddress(sepolia.PILPolicyFrameworkManager)
1952
+ };
1184
1953
 
1185
1954
  function _createForOfIteratorHelper(o, allowArrayLike) {
1186
1955
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
@@ -1208,546 +1977,737 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
1208
1977
  }
1209
1978
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1210
1979
  }
1211
- var normalCompletion = true,
1212
- didErr = false,
1213
- err;
1214
- return {
1215
- s: function () {
1216
- it = it.call(o);
1217
- },
1218
- n: function () {
1219
- var step = it.next();
1220
- normalCompletion = step.done;
1221
- return step;
1222
- },
1223
- e: function (e) {
1224
- didErr = true;
1225
- err = e;
1226
- },
1227
- f: function () {
1228
- try {
1229
- if (!normalCompletion && it.return != null) it.return();
1230
- } finally {
1231
- if (didErr) throw err;
1980
+ var normalCompletion = true,
1981
+ didErr = false,
1982
+ err;
1983
+ return {
1984
+ s: function () {
1985
+ it = it.call(o);
1986
+ },
1987
+ n: function () {
1988
+ var step = it.next();
1989
+ normalCompletion = step.done;
1990
+ return step;
1991
+ },
1992
+ e: function (e) {
1993
+ didErr = true;
1994
+ err = e;
1995
+ },
1996
+ f: function () {
1997
+ try {
1998
+ if (!normalCompletion && it.return != null) it.return();
1999
+ } finally {
2000
+ if (didErr) throw err;
2001
+ }
2002
+ }
2003
+ };
2004
+ }
2005
+
2006
+ function parseToBigInt(num) {
2007
+ return BigInt(num);
2008
+ }
2009
+ function waitTxAndFilterLog(_x, _x2, _x3) {
2010
+ return _waitTxAndFilterLog.apply(this, arguments);
2011
+ }
2012
+ function _waitTxAndFilterLog() {
2013
+ _waitTxAndFilterLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(client, txHash, params) {
2014
+ var txReceipt, _iterator, _step, log;
2015
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2016
+ while (1) switch (_context.prev = _context.next) {
2017
+ case 0:
2018
+ _context.next = 2;
2019
+ return client.waitForTransactionReceipt({
2020
+ hash: txHash,
2021
+ confirmations: params.confirmations,
2022
+ pollingInterval: params.pollingInterval,
2023
+ timeout: params.timeout
2024
+ });
2025
+ case 2:
2026
+ txReceipt = _context.sent;
2027
+ _iterator = _createForOfIteratorHelper(txReceipt.logs);
2028
+ _context.prev = 4;
2029
+ _iterator.s();
2030
+ case 6:
2031
+ if ((_step = _iterator.n()).done) {
2032
+ _context.next = 17;
2033
+ break;
2034
+ }
2035
+ log = _step.value;
2036
+ _context.prev = 8;
2037
+ return _context.abrupt("return", viem.decodeEventLog({
2038
+ abi: params.abi,
2039
+ eventName: params.eventName,
2040
+ data: log.data,
2041
+ topics: log.topics
2042
+ }));
2043
+ case 12:
2044
+ _context.prev = 12;
2045
+ _context.t0 = _context["catch"](8);
2046
+ return _context.abrupt("continue", 15);
2047
+ case 15:
2048
+ _context.next = 6;
2049
+ break;
2050
+ case 17:
2051
+ _context.next = 22;
2052
+ break;
2053
+ case 19:
2054
+ _context.prev = 19;
2055
+ _context.t1 = _context["catch"](4);
2056
+ _iterator.e(_context.t1);
2057
+ case 22:
2058
+ _context.prev = 22;
2059
+ _iterator.f();
2060
+ return _context.finish(22);
2061
+ case 25:
2062
+ throw new Error("not found event ".concat(params.eventName, " in target transaction"));
2063
+ case 26:
2064
+ case "end":
2065
+ return _context.stop();
2066
+ }
2067
+ }, _callee, null, [[4, 19, 22, 25], [8, 12]]);
2068
+ }));
2069
+ return _waitTxAndFilterLog.apply(this, arguments);
2070
+ }
2071
+ function waitTx(_x4, _x5, _x6) {
2072
+ return _waitTx.apply(this, arguments);
2073
+ }
2074
+ function _waitTx() {
2075
+ _waitTx = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(client, txHash, params) {
2076
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2077
+ while (1) switch (_context2.prev = _context2.next) {
2078
+ case 0:
2079
+ _context2.next = 2;
2080
+ return client.waitForTransactionReceipt(_objectSpread2({
2081
+ hash: txHash
2082
+ }, params));
2083
+ case 2:
2084
+ case "end":
2085
+ return _context2.stop();
2086
+ }
2087
+ }, _callee2);
2088
+ }));
2089
+ return _waitTx.apply(this, arguments);
2090
+ }
2091
+ function chainStringToViemChain(chainId) {
2092
+ switch (chainId) {
2093
+ case "1":
2094
+ case "mainnet":
2095
+ return chains.mainnet;
2096
+ case "11155111":
2097
+ case "sepolia":
2098
+ return chains.sepolia;
2099
+ case "80001":
2100
+ case "mumbai":
2101
+ case "polygonMumbai":
2102
+ return chains.polygonMumbai;
2103
+ default:
2104
+ throw new Error("chainId ".concat(chainId, " not supported"));
2105
+ }
2106
+ }
2107
+
2108
+ var TaggingClient = /*#__PURE__*/function () {
2109
+ function TaggingClient(rpcClient, wallet) {
2110
+ _classCallCheck(this, TaggingClient);
2111
+ _defineProperty(this, "taggingModuleConfig", TaggingModuleConfig);
2112
+ this.rpcClient = rpcClient;
2113
+ this.wallet = wallet;
2114
+ }
2115
+ _createClass(TaggingClient, [{
2116
+ key: "setTag",
2117
+ value: function () {
2118
+ var _setTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2119
+ var _request$txOptions, _yield$this$rpcClient, call, txHash;
2120
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2121
+ while (1) switch (_context.prev = _context.next) {
2122
+ case 0:
2123
+ _context.prev = 0;
2124
+ _context.next = 3;
2125
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.taggingModuleConfig), {}, {
2126
+ functionName: "setTag",
2127
+ args: [request.tag, request.ipId]
2128
+ }));
2129
+ case 3:
2130
+ _yield$this$rpcClient = _context.sent;
2131
+ call = _yield$this$rpcClient.request;
2132
+ _context.next = 7;
2133
+ return this.wallet.writeContract(call);
2134
+ case 7:
2135
+ txHash = _context.sent;
2136
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
2137
+ _context.next = 11;
2138
+ break;
2139
+ }
2140
+ _context.next = 11;
2141
+ return waitTx(this.rpcClient, txHash);
2142
+ case 11:
2143
+ return _context.abrupt("return", {
2144
+ txHash: txHash
2145
+ });
2146
+ case 14:
2147
+ _context.prev = 14;
2148
+ _context.t0 = _context["catch"](0);
2149
+ handleError(_context.t0, "Failed to set tag");
2150
+ case 17:
2151
+ case "end":
2152
+ return _context.stop();
2153
+ }
2154
+ }, _callee, this, [[0, 14]]);
2155
+ }));
2156
+ function setTag(_x) {
2157
+ return _setTag.apply(this, arguments);
2158
+ }
2159
+ return setTag;
2160
+ }()
2161
+ }, {
2162
+ key: "removeTag",
2163
+ value: function () {
2164
+ var _removeTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
2165
+ var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
2166
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2167
+ while (1) switch (_context2.prev = _context2.next) {
2168
+ case 0:
2169
+ _context2.prev = 0;
2170
+ _context2.next = 3;
2171
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.taggingModuleConfig), {}, {
2172
+ functionName: "removeTag",
2173
+ args: [request.tag, request.ipId]
2174
+ }));
2175
+ case 3:
2176
+ _yield$this$rpcClient2 = _context2.sent;
2177
+ call = _yield$this$rpcClient2.request;
2178
+ _context2.next = 7;
2179
+ return this.wallet.writeContract(call);
2180
+ case 7:
2181
+ txHash = _context2.sent;
2182
+ if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
2183
+ _context2.next = 11;
2184
+ break;
2185
+ }
2186
+ _context2.next = 11;
2187
+ return waitTx(this.rpcClient, txHash);
2188
+ case 11:
2189
+ return _context2.abrupt("return", {
2190
+ txHash: txHash
2191
+ });
2192
+ case 14:
2193
+ _context2.prev = 14;
2194
+ _context2.t0 = _context2["catch"](0);
2195
+ handleError(_context2.t0, "Failed to remove tag");
2196
+ case 17:
2197
+ case "end":
2198
+ return _context2.stop();
2199
+ }
2200
+ }, _callee2, this, [[0, 14]]);
2201
+ }));
2202
+ function removeTag(_x2) {
2203
+ return _removeTag.apply(this, arguments);
2204
+ }
2205
+ return removeTag;
2206
+ }()
2207
+ }]);
2208
+ return TaggingClient;
2209
+ }();
2210
+
2211
+ var AddressZero = "0x0000000000000000000000000000000000000000";
2212
+ var HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
2213
+
2214
+ var IPAssetClient = /*#__PURE__*/function () {
2215
+ function IPAssetClient(rpcClient, wallet) {
2216
+ _classCallCheck(this, IPAssetClient);
2217
+ _defineProperty(this, "ipAssetRegistryConfig", IPAssetRegistryConfig);
2218
+ _defineProperty(this, "registrationModuleConfig", RegistrationModuleConfig);
2219
+ this.wallet = wallet;
2220
+ this.rpcClient = rpcClient;
2221
+ }
2222
+
2223
+ /**
2224
+ * Registers a root-level IP into the protocol. Root-level IPs can be thought of as organizational hubs
2225
+ * for encapsulating policies that actual IPs can use to register through. As such, a root-level IP is not an
2226
+ * actual IP, but a container for IP policy management for their child IP assets.
2227
+ * @param request The request object that contains all data needed to register a root IP.
2228
+ * @param request.policyId The policy that identifies the licensing terms of the IP.
2229
+ * @param request.tokenContract The address of the NFT bound to the root-level IP.
2230
+ * @param request.tokenId The token id of the NFT bound to the root-level IP.
2231
+ * @param request.ipName [Optional] The name assigned to the new IP.
2232
+ * @param request.contentHash [Optional] The content hash of the IP being registered.
2233
+ * @param request.uri [Optional] An external URI to link to the IP.
2234
+ * @param request.txOptions [Optional] The transaction options.
2235
+ * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
2236
+ * @emits RootIPRegistered (msg.sender, ipId, policyId)
2237
+ */
2238
+ _createClass(IPAssetClient, [{
2239
+ key: "registerRootIp",
2240
+ value: function () {
2241
+ var _registerRootIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2242
+ var _request$txOptions, _yield$this$rpcClient, call, txHash, targetLog;
2243
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2244
+ while (1) switch (_context.prev = _context.next) {
2245
+ case 0:
2246
+ _context.prev = 0;
2247
+ _context.next = 3;
2248
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.registrationModuleConfig), {}, {
2249
+ functionName: "registerRootIp",
2250
+ args: [parseToBigInt(request.policyId), viem.getAddress(request.tokenContractAddress),
2251
+ // 0x Address
2252
+ parseToBigInt(request.tokenId), request.ipName || "", request.contentHash || HashZero, request.uri || ""],
2253
+ account: this.wallet.account
2254
+ }));
2255
+ case 3:
2256
+ _yield$this$rpcClient = _context.sent;
2257
+ call = _yield$this$rpcClient.request;
2258
+ _context.next = 7;
2259
+ return this.wallet.writeContract(call);
2260
+ case 7:
2261
+ txHash = _context.sent;
2262
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
2263
+ _context.next = 15;
2264
+ break;
2265
+ }
2266
+ _context.next = 11;
2267
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
2268
+ eventName: "IPRegistered"
2269
+ }));
2270
+ case 11:
2271
+ targetLog = _context.sent;
2272
+ return _context.abrupt("return", {
2273
+ txHash: txHash,
2274
+ ipId: targetLog.args.ipId
2275
+ });
2276
+ case 15:
2277
+ return _context.abrupt("return", {
2278
+ txHash: txHash
2279
+ });
2280
+ case 16:
2281
+ _context.next = 21;
2282
+ break;
2283
+ case 18:
2284
+ _context.prev = 18;
2285
+ _context.t0 = _context["catch"](0);
2286
+ handleError(_context.t0, "Failed to register root IP");
2287
+ case 21:
2288
+ case "end":
2289
+ return _context.stop();
2290
+ }
2291
+ }, _callee, this, [[0, 18]]);
2292
+ }));
2293
+ function registerRootIp(_x) {
2294
+ return _registerRootIp.apply(this, arguments);
1232
2295
  }
1233
- }
1234
- };
1235
- }
2296
+ return registerRootIp;
2297
+ }()
2298
+ /**
2299
+ * Registers derivative IPs into the protocol. Derivative IPs are IP assets that inherit policies from
2300
+ * parent IPs by burning acquired license NFTs.
2301
+ * @param request The request object that contains all data needed to register a root IP.
2302
+ * @param request.licenseIds The policy that identifies the licensing terms of the IP.
2303
+ * @param request.tokenContract The address of the NFT bound to the derivative IP.
2304
+ * @param request.tokenId The token id of the NFT bound to the derivative IP.
2305
+ * @param request.ipName [Optional] The name assigned to the new IP.
2306
+ * @param request.contentHash [Optional] The content hash of the IP being registered.
2307
+ * @param request.uri [Optional] An external URI to link to the IP.
2308
+ * @param request.minRoyalty [Optional] The minimum royalty percentage that the IP owner will receive.
2309
+ * @param request.txOptions [Optional] The transaction options.
2310
+ * @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
2311
+ * @emits RootIPRegistered (msg.sender, ipId, policyId)
2312
+ */
2313
+ }, {
2314
+ key: "registerDerivativeIp",
2315
+ value: function () {
2316
+ var _registerDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
2317
+ var _request$txOptions2, licenseIds, _yield$this$rpcClient2, call, txHash, targetLog;
2318
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2319
+ while (1) switch (_context2.prev = _context2.next) {
2320
+ case 0:
2321
+ _context2.prev = 0;
2322
+ licenseIds = [];
2323
+ request.licenseIds.forEach(function (licenseId) {
2324
+ licenseIds.push(parseToBigInt(licenseId));
2325
+ });
2326
+ _context2.next = 5;
2327
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.registrationModuleConfig), {}, {
2328
+ functionName: "registerDerivativeIp",
2329
+ args: [licenseIds, viem.getAddress(request.tokenContractAddress),
2330
+ // 0x Address
2331
+ parseToBigInt(request.tokenId), request.ipName || "", request.contentHash || HashZero, request.uri || "", "0x"],
2332
+ account: this.wallet.account
2333
+ }));
2334
+ case 5:
2335
+ _yield$this$rpcClient2 = _context2.sent;
2336
+ call = _yield$this$rpcClient2.request;
2337
+ _context2.next = 9;
2338
+ return this.wallet.writeContract(call);
2339
+ case 9:
2340
+ txHash = _context2.sent;
2341
+ if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
2342
+ _context2.next = 17;
2343
+ break;
2344
+ }
2345
+ _context2.next = 13;
2346
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
2347
+ eventName: "IPRegistered"
2348
+ }));
2349
+ case 13:
2350
+ targetLog = _context2.sent;
2351
+ return _context2.abrupt("return", {
2352
+ txHash: txHash,
2353
+ ipId: targetLog.args.ipId
2354
+ });
2355
+ case 17:
2356
+ return _context2.abrupt("return", {
2357
+ txHash: txHash
2358
+ });
2359
+ case 18:
2360
+ _context2.next = 23;
2361
+ break;
2362
+ case 20:
2363
+ _context2.prev = 20;
2364
+ _context2.t0 = _context2["catch"](0);
2365
+ handleError(_context2.t0, "Failed to register derivative IP");
2366
+ case 23:
2367
+ case "end":
2368
+ return _context2.stop();
2369
+ }
2370
+ }, _callee2, this, [[0, 20]]);
2371
+ }));
2372
+ function registerDerivativeIp(_x2) {
2373
+ return _registerDerivativeIp.apply(this, arguments);
2374
+ }
2375
+ return registerDerivativeIp;
2376
+ }()
2377
+ }]);
2378
+ return IPAssetClient;
2379
+ }();
1236
2380
 
1237
- function parseToBigInt(num) {
1238
- return BigInt(num);
1239
- }
1240
- function waitTxAndFilterLog(_x, _x2, _x3) {
1241
- return _waitTxAndFilterLog.apply(this, arguments);
1242
- }
1243
- function _waitTxAndFilterLog() {
1244
- _waitTxAndFilterLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(client, txHash, params) {
1245
- var txReceipt, _iterator, _step, log;
1246
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1247
- while (1) switch (_context.prev = _context.next) {
1248
- case 0:
1249
- _context.next = 2;
1250
- return client.waitForTransactionReceipt({
1251
- hash: txHash,
1252
- confirmations: params.confirmations,
1253
- pollingInterval: params.pollingInterval,
1254
- timeout: params.timeout
1255
- });
1256
- case 2:
1257
- txReceipt = _context.sent;
1258
- _iterator = _createForOfIteratorHelper(txReceipt.logs);
1259
- _context.prev = 4;
1260
- _iterator.s();
1261
- case 6:
1262
- if ((_step = _iterator.n()).done) {
1263
- _context.next = 17;
1264
- break;
2381
+ var PermissionClient = /*#__PURE__*/function () {
2382
+ function PermissionClient(rpcClient, wallet) {
2383
+ _classCallCheck(this, PermissionClient);
2384
+ _defineProperty(this, "ipAccountABI", IPAccountABI);
2385
+ _defineProperty(this, "accessControllerConfig", AccessControllerConfig);
2386
+ this.rpcClient = rpcClient;
2387
+ this.wallet = wallet;
2388
+ }
2389
+
2390
+ /**
2391
+ * Sets the permission for a specific function call
2392
+ * Each policy is represented as a mapping from an IP account address to a signer address to a recipient
2393
+ * address to a function selector to a permission level. The permission level can be 0 (ABSTAIN), 1 (ALLOW), or
2394
+ * 2 (DENY).
2395
+ * By default, all policies are set to 0 (ABSTAIN), which means that the permission is not set.
2396
+ * The owner of ipAccount by default has all permission.
2397
+ * address(0) => wildcard
2398
+ * bytes4(0) => wildcard
2399
+ * Specific permission overrides wildcard permission.
2400
+ * @param request The request object containing necessary data to set permissions.
2401
+ * @param request.ipAsset The address of the IP account that grants the permission for `signer`
2402
+ * @param request.signer The address that can call `to` on behalf of the `ipAccount`
2403
+ * @param request.to The address that can be called by the `signer` (currently only modules can be `to`)
2404
+ * @param request.func The function selector string of `to` that can be called by the `signer` on behalf of the `ipAccount`
2405
+ * @param request.permission The new permission level
2406
+ * @returns A Promise that resolves to an object containing the transaction hash
2407
+ * @emits PermissionSet (ipAccountOwner, ipAccount, signer, to, func, permission)
2408
+ */
2409
+ _createClass(PermissionClient, [{
2410
+ key: "setPermission",
2411
+ value: function () {
2412
+ var _setPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2413
+ var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash;
2414
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2415
+ while (1) switch (_context.prev = _context.next) {
2416
+ case 0:
2417
+ _context.prev = 0;
2418
+ IPAccountConfig = {
2419
+ abi: this.ipAccountABI,
2420
+ address: viem.getAddress(request.ipId)
2421
+ };
2422
+ _context.next = 4;
2423
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
2424
+ functionName: "execute",
2425
+ args: [this.accessControllerConfig.address, parseToBigInt(0), viem.encodeFunctionData({
2426
+ abi: this.accessControllerConfig.abi,
2427
+ functionName: "setPermission",
2428
+ args: [viem.getAddress(request.ipId),
2429
+ // 0x Address
2430
+ viem.getAddress(request.signer),
2431
+ // 0x Address
2432
+ viem.getAddress(request.to),
2433
+ // 0x Address
2434
+ request.func,
2435
+ // bytes4
2436
+ request.permission // uint8
2437
+ ]
2438
+ })],
2439
+
2440
+ account: this.wallet.account
2441
+ }));
2442
+ case 4:
2443
+ _yield$this$rpcClient = _context.sent;
2444
+ call = _yield$this$rpcClient.request;
2445
+ _context.next = 8;
2446
+ return this.wallet.writeContract(call);
2447
+ case 8:
2448
+ txHash = _context.sent;
2449
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
2450
+ _context.next = 15;
2451
+ break;
2452
+ }
2453
+ _context.next = 12;
2454
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.accessControllerConfig), {}, {
2455
+ eventName: "PermissionSet"
2456
+ }));
2457
+ case 12:
2458
+ return _context.abrupt("return", {
2459
+ txHash: txHash,
2460
+ success: true
2461
+ });
2462
+ case 15:
2463
+ return _context.abrupt("return", {
2464
+ txHash: txHash
2465
+ });
2466
+ case 16:
2467
+ _context.next = 21;
2468
+ break;
2469
+ case 18:
2470
+ _context.prev = 18;
2471
+ _context.t0 = _context["catch"](0);
2472
+ handleError(_context.t0, "Failed to set permissions");
2473
+ case 21:
2474
+ case "end":
2475
+ return _context.stop();
1265
2476
  }
1266
- log = _step.value;
1267
- _context.prev = 8;
1268
- return _context.abrupt("return", viem.decodeEventLog({
1269
- abi: params.abi,
1270
- eventName: params.eventName,
1271
- data: log.data,
1272
- topics: log.topics
1273
- }));
1274
- case 12:
1275
- _context.prev = 12;
1276
- _context.t0 = _context["catch"](8);
1277
- return _context.abrupt("continue", 15);
1278
- case 15:
1279
- _context.next = 6;
1280
- break;
1281
- case 17:
1282
- _context.next = 22;
1283
- break;
1284
- case 19:
1285
- _context.prev = 19;
1286
- _context.t1 = _context["catch"](4);
1287
- _iterator.e(_context.t1);
1288
- case 22:
1289
- _context.prev = 22;
1290
- _iterator.f();
1291
- return _context.finish(22);
1292
- case 25:
1293
- throw new Error("not found event ".concat(params.eventName, " in target transaction"));
1294
- case 26:
1295
- case "end":
1296
- return _context.stop();
2477
+ }, _callee, this, [[0, 18]]);
2478
+ }));
2479
+ function setPermission(_x) {
2480
+ return _setPermission.apply(this, arguments);
1297
2481
  }
1298
- }, _callee, null, [[4, 19, 22, 25], [8, 12]]);
1299
- }));
1300
- return _waitTxAndFilterLog.apply(this, arguments);
1301
- }
1302
-
1303
- function _arrayWithoutHoles(arr) {
1304
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
1305
- }
1306
-
1307
- function _iterableToArray(iter) {
1308
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1309
- }
1310
-
1311
- function _nonIterableSpread() {
1312
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1313
- }
2482
+ return setPermission;
2483
+ }()
2484
+ }]);
2485
+ return PermissionClient;
2486
+ }();
1314
2487
 
1315
- function _toConsumableArray(arr) {
1316
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1317
- }
2488
+ var LicenseClient = /*#__PURE__*/function () {
2489
+ function LicenseClient(rpcClient, wallet) {
2490
+ _classCallCheck(this, LicenseClient);
2491
+ _defineProperty(this, "ipAccountABI", IPAccountABI);
2492
+ _defineProperty(this, "licenseRegistryConfig", LicenseRegistryConfig);
2493
+ _defineProperty(this, "licensingModuleConfig", LicensingModuleConfig);
2494
+ this.wallet = wallet;
2495
+ this.rpcClient = rpcClient;
2496
+ }
1318
2497
 
1319
- var RegistrationModuleABI = [{
1320
- inputs: [{
1321
- internalType: "uint256",
1322
- name: "licenseId",
1323
- type: "uint256"
1324
- }, {
1325
- internalType: "address",
1326
- name: "tokenContract",
1327
- type: "address"
1328
- }, {
1329
- internalType: "uint256",
1330
- name: "tokenId",
1331
- type: "uint256"
1332
- }, {
1333
- internalType: "string",
1334
- name: "ipName",
1335
- type: "string"
1336
- }, {
1337
- internalType: "string",
1338
- name: "ipDescription",
1339
- type: "string"
1340
- }, {
1341
- internalType: "bytes32",
1342
- name: "contentHash",
1343
- type: "bytes32"
1344
- }],
1345
- name: "registerDerivativeIp",
1346
- outputs: [],
1347
- stateMutability: "nonpayable",
1348
- type: "function"
1349
- }, {
1350
- inputs: [{
1351
- internalType: "uint256",
1352
- name: "policyId",
1353
- type: "uint256"
1354
- }, {
1355
- internalType: "address",
1356
- name: "tokenContract",
1357
- type: "address"
2498
+ /**
2499
+ * Mints license NFTs representing a policy granted by a set of ipIds (licensors). This NFT needs to be
2500
+ * burned in order to link a derivative IP with its parents. If this is the first combination of policy and
2501
+ * licensors, a new licenseId will be created. If not, the license is fungible and an id will be reused.
2502
+ * @dev Only callable by the licensing module.
2503
+ * @param request The request object containing necessary data to mint a license.
2504
+ * @param request.policyId The ID of the policy to be minted
2505
+ * @param request.licensorIpId_ The ID of the IP granting the license (ie. licensor)
2506
+ * @param request.mintAmount Number of licenses to mint. License NFT is fungible for same policy and same licensors
2507
+ * @param request.receiver Receiver address of the minted license NFT(s).
2508
+ * @return licenseId The ID of the minted license NFT(s).
2509
+ */
2510
+ _createClass(LicenseClient, [{
2511
+ key: "mintLicense",
2512
+ value: function () {
2513
+ var _mintLicense = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2514
+ var _request$txOptions, IPAccountConfig, _yield$this$rpcClient, call, txHash, targetLog;
2515
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2516
+ while (1) switch (_context.prev = _context.next) {
2517
+ case 0:
2518
+ _context.prev = 0;
2519
+ IPAccountConfig = {
2520
+ abi: this.ipAccountABI,
2521
+ address: viem.getAddress(request.licensorIpId)
2522
+ };
2523
+ _context.next = 4;
2524
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
2525
+ functionName: "execute",
2526
+ args: [this.licensingModuleConfig.address, parseToBigInt(0), viem.encodeFunctionData({
2527
+ abi: this.licensingModuleConfig.abi,
2528
+ functionName: "mintLicense",
2529
+ args: [parseToBigInt(request.policyId), request.licensorIpId, parseToBigInt(request.mintAmount), viem.getAddress(request.receiverAddress), "0x"]
2530
+ })],
2531
+ account: this.wallet.account
2532
+ }));
2533
+ case 4:
2534
+ _yield$this$rpcClient = _context.sent;
2535
+ call = _yield$this$rpcClient.request;
2536
+ _context.next = 8;
2537
+ return this.wallet.writeContract(call);
2538
+ case 8:
2539
+ txHash = _context.sent;
2540
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
2541
+ _context.next = 16;
2542
+ break;
2543
+ }
2544
+ _context.next = 12;
2545
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licenseRegistryConfig), {}, {
2546
+ eventName: "TransferSingle"
2547
+ }));
2548
+ case 12:
2549
+ targetLog = _context.sent;
2550
+ return _context.abrupt("return", {
2551
+ txHash: txHash,
2552
+ licenseId: targetLog.args.id.toString()
2553
+ });
2554
+ case 16:
2555
+ return _context.abrupt("return", {
2556
+ txHash: txHash
2557
+ });
2558
+ case 17:
2559
+ _context.next = 22;
2560
+ break;
2561
+ case 19:
2562
+ _context.prev = 19;
2563
+ _context.t0 = _context["catch"](0);
2564
+ handleError(_context.t0, "Failed to mint license");
2565
+ case 22:
2566
+ case "end":
2567
+ return _context.stop();
2568
+ }
2569
+ }, _callee, this, [[0, 19]]);
2570
+ }));
2571
+ function mintLicense(_x) {
2572
+ return _mintLicense.apply(this, arguments);
2573
+ }
2574
+ return mintLicense;
2575
+ }()
1358
2576
  }, {
1359
- internalType: "uint256",
1360
- name: "tokenId",
1361
- type: "uint256"
1362
- }],
1363
- name: "registerRootIp",
1364
- outputs: [{
1365
- internalType: "address",
1366
- name: "",
1367
- type: "address"
1368
- }],
1369
- stateMutability: "nonpayable",
1370
- type: "function"
1371
- }];
1372
-
1373
- var errorsJson = [
1374
- {
1375
- inputs: [
1376
- ],
1377
- name: "AccessController__CallerIsNotIPAccount",
1378
- type: "error"
1379
- },
1380
- {
1381
- inputs: [
1382
- ],
1383
- name: "AccessController__IPAccountIsNotValid",
1384
- type: "error"
1385
- },
1386
- {
1387
- inputs: [
1388
- ],
1389
- name: "AccessController__IPAccountIsZeroAddress",
1390
- type: "error"
1391
- },
1392
- {
1393
- inputs: [
1394
- ],
1395
- name: "AccessController__PermissionIsNotValid",
1396
- type: "error"
1397
- },
1398
- {
1399
- inputs: [
1400
- ],
1401
- name: "AccessController__SignerIsZeroAddress",
1402
- type: "error"
1403
- },
1404
- {
1405
- inputs: [
1406
- ],
1407
- name: "ArbitrationPolicySP__NotDisputeModule",
1408
- type: "error"
1409
- },
1410
- {
1411
- inputs: [
1412
- ],
1413
- name: "ArbitrationPolicySP__ZeroDisputeModule",
1414
- type: "error"
1415
- },
1416
- {
1417
- inputs: [
1418
- ],
1419
- name: "ArbitrationPolicySP__ZeroPaymentToken",
1420
- type: "error"
1421
- },
1422
- {
1423
- inputs: [
1424
- ],
1425
- name: "DisputeModule__NotDisputeInitiator",
1426
- type: "error"
1427
- },
1428
- {
1429
- inputs: [
1430
- ],
1431
- name: "DisputeModule__NotWhitelistedArbitrationPolicy",
1432
- type: "error"
1433
- },
1434
- {
1435
- inputs: [
1436
- ],
1437
- name: "DisputeModule__NotWhitelistedArbitrationRelayer",
1438
- type: "error"
1439
- },
1440
- {
1441
- inputs: [
1442
- ],
1443
- name: "DisputeModule__NotWhitelistedDisputeTag",
1444
- type: "error"
1445
- },
1446
- {
1447
- inputs: [
1448
- ],
1449
- name: "DisputeModule__ZeroArbitrationPolicy",
1450
- type: "error"
1451
- },
1452
- {
1453
- inputs: [
1454
- ],
1455
- name: "DisputeModule__ZeroArbitrationRelayer",
1456
- type: "error"
1457
- },
1458
- {
1459
- inputs: [
1460
- ],
1461
- name: "DisputeModule__ZeroDisputeTag",
1462
- type: "error"
1463
- },
1464
- {
1465
- inputs: [
1466
- ],
1467
- name: "DisputeModule__ZeroLinkToDisputeSummary",
1468
- type: "error"
1469
- },
1470
- {
1471
- inputs: [
1472
- ],
1473
- name: "IPRecordRegistry_AlreadyRegistered",
1474
- type: "error"
1475
- },
1476
- {
1477
- inputs: [
1478
- ],
1479
- name: "IPRecordRegistry_IPAccountAlreadyCreated",
1480
- type: "error"
1481
- },
1482
- {
1483
- inputs: [
1484
- ],
1485
- name: "IPRecordRegistry_NotYetRegistered",
1486
- type: "error"
1487
- },
1488
- {
1489
- inputs: [
1490
- ],
1491
- name: "IPRecordRegistry_ResolverInvalid",
1492
- type: "error"
1493
- },
1494
- {
1495
- inputs: [
1496
- ],
1497
- name: "IPRecordRegistry_Unauthorized",
1498
- type: "error"
1499
- },
1500
- {
1501
- inputs: [
1502
- ],
1503
- name: "IPResolver_InvalidIP",
1504
- type: "error"
1505
- },
1506
- {
1507
- inputs: [
1508
- ],
1509
- name: "IPResolver_Unauthorized",
1510
- type: "error"
1511
- },
1512
- {
1513
- inputs: [
1514
- ],
1515
- name: "LicenseRegistry__EmptyLicenseUrl",
1516
- type: "error"
1517
- },
1518
- {
1519
- inputs: [
1520
- ],
1521
- name: "LicenseRegistry__FrameworkNotFound",
1522
- type: "error"
1523
- },
1524
- {
1525
- inputs: [
1526
- ],
1527
- name: "LicenseRegistry__InvalidParamVerifierType",
1528
- type: "error"
1529
- },
1530
- {
1531
- inputs: [
1532
- ],
1533
- name: "LicenseRegistry__LicensorDoesntHaveThisPolicy",
1534
- type: "error"
1535
- },
1536
- {
1537
- inputs: [
1538
- ],
1539
- name: "LicenseRegistry__LinkParentParamFailed",
1540
- type: "error"
1541
- },
1542
- {
1543
- inputs: [
1544
- ],
1545
- name: "LicenseRegistry__MintParamFailed",
1546
- type: "error"
1547
- },
1548
- {
1549
- inputs: [
1550
- ],
1551
- name: "LicenseRegistry__NotLicensee",
1552
- type: "error"
1553
- },
1554
- {
1555
- inputs: [
1556
- ],
1557
- name: "LicenseRegistry__ParamVerifierLengthMismatch",
1558
- type: "error"
1559
- },
1560
- {
1561
- inputs: [
1562
- ],
1563
- name: "LicenseRegistry__ParentIdEqualThanChild",
1564
- type: "error"
1565
- },
1566
- {
1567
- inputs: [
1568
- ],
1569
- name: "LicenseRegistry__PolicyAlreadySetForIpId",
1570
- type: "error"
1571
- },
1572
- {
1573
- inputs: [
1574
- ],
1575
- name: "LicenseRegistry__PolicyNotFound",
1576
- type: "error"
1577
- },
1578
- {
1579
- inputs: [
1580
- ],
1581
- name: "ModuleRegistry__ModuleAddressNotContract",
1582
- type: "error"
1583
- },
1584
- {
1585
- inputs: [
1586
- ],
1587
- name: "ModuleRegistry__ModuleAddressZeroAddress",
1588
- type: "error"
1589
- },
1590
- {
1591
- inputs: [
1592
- ],
1593
- name: "ModuleRegistry__ModuleAlreadyRegistered",
1594
- type: "error"
1595
- },
1596
- {
1597
- inputs: [
1598
- ],
1599
- name: "ModuleRegistry__ModuleNotRegistered",
1600
- type: "error"
1601
- },
1602
- {
1603
- inputs: [
1604
- ],
1605
- name: "ModuleRegistry__NameAlreadyRegistered",
1606
- type: "error"
1607
- },
1608
- {
1609
- inputs: [
1610
- ],
1611
- name: "ModuleRegistry__NameDoesNotMatch",
1612
- type: "error"
1613
- },
1614
- {
1615
- inputs: [
1616
- ],
1617
- name: "ModuleRegistry__NameEmptyString",
1618
- type: "error"
1619
- },
1620
- {
1621
- inputs: [
1622
- ],
1623
- name: "Module_Unauthorized",
1624
- type: "error"
1625
- },
1626
- {
1627
- inputs: [
1628
- ],
1629
- name: "RegistrationModule__InvalidOwner",
1630
- type: "error"
1631
- },
1632
- {
1633
- inputs: [
1634
- ],
1635
- name: "RoyaltyModule__AlreadySetRoyaltyPolicy",
1636
- type: "error"
1637
- },
1638
- {
1639
- inputs: [
1640
- ],
1641
- name: "RoyaltyModule__NotWhitelistedRoyaltyPolicy",
1642
- type: "error"
1643
- },
1644
- {
1645
- inputs: [
1646
- ],
1647
- name: "RoyaltyModule__ZeroRoyaltyPolicy",
1648
- type: "error"
1649
- },
1650
- {
1651
- inputs: [
1652
- ],
1653
- name: "RoyaltyPolicyLS__NotRoyaltyModule",
1654
- type: "error"
1655
- },
1656
- {
1657
- inputs: [
1658
- ],
1659
- name: "RoyaltyPolicyLS__TransferFailed",
1660
- type: "error"
1661
- },
1662
- {
1663
- inputs: [
1664
- ],
1665
- name: "RoyaltyPolicyLS__ZeroLiquidSplitFactory",
1666
- type: "error"
1667
- },
1668
- {
1669
- inputs: [
1670
- ],
1671
- name: "RoyaltyPolicyLS__ZeroLiquidSplitMain",
1672
- type: "error"
1673
- },
1674
- {
1675
- inputs: [
1676
- ],
1677
- name: "RoyaltyPolicyLS__ZeroRoyaltyModule",
1678
- type: "error"
1679
- },
1680
- {
1681
- inputs: [
1682
- ],
1683
- name: "TaggingModule__DstIpIdDoesNotHaveDstTag",
1684
- type: "error"
1685
- },
1686
- {
1687
- inputs: [
1688
- ],
1689
- name: "TaggingModule__InvalidRelationTypeName",
1690
- type: "error"
1691
- },
1692
- {
1693
- inputs: [
1694
- ],
1695
- name: "TaggingModule__RelationTypeAlreadyExists",
1696
- type: "error"
1697
- },
1698
- {
1699
- inputs: [
1700
- ],
1701
- name: "TaggingModule__RelationTypeDoesNotExist",
1702
- type: "error"
1703
- },
1704
- {
1705
- inputs: [
1706
- ],
1707
- name: "TaggingModule__SrcIpIdDoesNotHaveSrcTag",
1708
- type: "error"
1709
- }
1710
- ];
1711
-
1712
- var ErrorsAbi$2 = errorsJson;
1713
- var storyProtocolMerged = [].concat(_toConsumableArray(RegistrationModuleABI), _toConsumableArray(ErrorsAbi$2));
1714
- var RegistrationModuleConfig = {
1715
- abi: storyProtocolMerged,
1716
- address: viem.getAddress(process.env.REGISTRATION_MODULE || process.env.NEXT_PUBLIC_REGISTRATION_MODULE || "")
1717
- };
2577
+ key: "linkIpToParent",
2578
+ value: function () {
2579
+ var _linkIpToParent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
2580
+ var _request$txOptions2, IPAccountConfig, licenseIds, _yield$this$rpcClient2, call, txHash;
2581
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2582
+ while (1) switch (_context2.prev = _context2.next) {
2583
+ case 0:
2584
+ _context2.prev = 0;
2585
+ IPAccountConfig = {
2586
+ abi: this.ipAccountABI,
2587
+ address: viem.getAddress(request.childIpId)
2588
+ };
2589
+ licenseIds = [];
2590
+ request.licenseIds.forEach(function (licenseId) {
2591
+ licenseIds.push(parseToBigInt(licenseId));
2592
+ });
2593
+ _context2.next = 6;
2594
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
2595
+ functionName: "execute",
2596
+ args: [this.licensingModuleConfig.address, parseToBigInt(0), viem.encodeFunctionData({
2597
+ abi: this.licensingModuleConfig.abi,
2598
+ functionName: "linkIpToParents",
2599
+ args: [licenseIds, viem.getAddress(request.childIpId), "0x"]
2600
+ })],
2601
+ account: this.wallet.account
2602
+ }));
2603
+ case 6:
2604
+ _yield$this$rpcClient2 = _context2.sent;
2605
+ call = _yield$this$rpcClient2.request;
2606
+ _context2.next = 10;
2607
+ return this.wallet.writeContract(call);
2608
+ case 10:
2609
+ txHash = _context2.sent;
2610
+ if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
2611
+ _context2.next = 17;
2612
+ break;
2613
+ }
2614
+ _context2.next = 14;
2615
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, LicenseRegistryConfig), {}, {
2616
+ eventName: "TransferBatch"
2617
+ }));
2618
+ case 14:
2619
+ return _context2.abrupt("return", {
2620
+ txHash: txHash,
2621
+ success: true
2622
+ });
2623
+ case 17:
2624
+ return _context2.abrupt("return", {
2625
+ txHash: txHash
2626
+ });
2627
+ case 18:
2628
+ _context2.next = 23;
2629
+ break;
2630
+ case 20:
2631
+ _context2.prev = 20;
2632
+ _context2.t0 = _context2["catch"](0);
2633
+ handleError(_context2.t0, "Failed to mint license");
2634
+ case 23:
2635
+ case "end":
2636
+ return _context2.stop();
2637
+ }
2638
+ }, _callee2, this, [[0, 20]]);
2639
+ }));
2640
+ function linkIpToParent(_x2) {
2641
+ return _linkIpToParent.apply(this, arguments);
2642
+ }
2643
+ return linkIpToParent;
2644
+ }()
2645
+ }]);
2646
+ return LicenseClient;
2647
+ }();
1718
2648
 
1719
- var IPAssetClient = /*#__PURE__*/function (_IPAssetReadOnlyClien) {
1720
- _inherits(IPAssetClient, _IPAssetReadOnlyClien);
1721
- var _super = _createSuper(IPAssetClient);
1722
- function IPAssetClient(httpClient, rpcClient, wallet) {
1723
- var _this;
1724
- _classCallCheck(this, IPAssetClient);
1725
- _this = _super.call(this, httpClient, rpcClient);
1726
- _this.wallet = wallet;
1727
- return _this;
2649
+ var PolicyClient = /*#__PURE__*/function () {
2650
+ function PolicyClient(rpcClient, wallet) {
2651
+ _classCallCheck(this, PolicyClient);
2652
+ _defineProperty(this, "ipAccountABI", IPAccountABI);
2653
+ _defineProperty(this, "licensingModuleConfig", LicensingModuleConfig);
2654
+ _defineProperty(this, "pilPolicyFrameworkManagerConfig", PILPolicyFrameworkManagerConfig);
2655
+ this.wallet = wallet;
2656
+ this.rpcClient = rpcClient;
1728
2657
  }
1729
2658
 
1730
2659
  /**
1731
- * Register a root IP on Story Protocol based on the specified input asset data.
1732
- *
1733
- * @param request - the request object that contains all data needed to register a root IP.
1734
- * @returns the response object that contains results from the IP creation.
2660
+ * Registers a PIL policy to the registry
2661
+ * Internally, this function must generate a Licensing.Policy struct and call registerPolicy.
2662
+ * @param request - the licensing parameters for the Programmable IP License v1 (PIL) standard.
2663
+ * @param request.transferable Whether or not the license is transferable
2664
+ * @param request.attribution Whether or not attribution is required when reproducing the work
2665
+ * @param request.commercialUse Whether or not the work can be used commercially
2666
+ * @param request.commercialAttribution Whether or not attribution is required when reproducing the work commercially
2667
+ * @param request.commercializerChecker commericializers that are allowed to commercially exploit the work. If zero address, then no restrictions is enforced.
2668
+ * @param request.commercialRevShare Percentage of revenue that must be shared with the licensor
2669
+ * @param request.derivativesAllowed Whether or not the licensee can create derivatives of his work
2670
+ * @param request.derivativesAttribution Whether or not attribution is required for derivatives of the work
2671
+ * @param request.derivativesApproval Whether or not the licensor must approve derivatives of the work before they can be linked to the licensor IP ID
2672
+ * @param request.derivativesReciprocal Whether or not the licensee must license derivatives of the work under the same terms.
2673
+ * @param request.territories List of territories where the license is valid. If empty, global.
2674
+ * @param request.distributionChannels List of distribution channels where the license is valid. Empty if no restrictions.
2675
+ * @param request.royaltyPolicy Address of a royalty policy contract (e.g. RoyaltyPolicyLS) that will handle royalty payments
2676
+ * @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
1735
2677
  */
1736
- _createClass(IPAssetClient, [{
1737
- key: "registerRootIp",
2678
+ _createClass(PolicyClient, [{
2679
+ key: "registerPILPolicy",
1738
2680
  value: function () {
1739
- var _registerRootIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2681
+ var _registerPILPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
1740
2682
  var _request$txOptions, _yield$this$rpcClient, call, txHash, targetLog;
1741
2683
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1742
2684
  while (1) switch (_context.prev = _context.next) {
1743
2685
  case 0:
1744
2686
  _context.prev = 0;
1745
2687
  _context.next = 3;
1746
- return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, RegistrationModuleConfig), {}, {
1747
- functionName: "registerRootIp",
1748
- args: [parseToBigInt(request.policyId), viem.getAddress(request.tokenContractAddress),
1749
- // 0x Address
1750
- parseToBigInt(request.tokenId)],
2688
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.pilPolicyFrameworkManagerConfig), {}, {
2689
+ functionName: "registerPolicy",
2690
+ args: [{
2691
+ transferable: request.transferable,
2692
+ royaltyPolicy: request.royaltyPolicy || viem.zeroAddress,
2693
+ mintingFee: parseToBigInt(request.mintingFee || 0),
2694
+ mintingFeeToken: request.mintingFeeToken || viem.zeroAddress,
2695
+ policy: {
2696
+ attribution: request.attribution || false,
2697
+ commercialUse: request.commercialUse || false,
2698
+ commercialAttribution: request.commercialAttribution || false,
2699
+ commercialRevShare: request.commercialRevShare || 0,
2700
+ derivativesAllowed: request.derivativesAllowed || false,
2701
+ derivativesAttribution: request.commercialAttribution || false,
2702
+ derivativesApproval: request.derivativesApproval || false,
2703
+ derivativesReciprocal: request.derivativesReciprocal || false,
2704
+ commercializerChecker: request.commercializerChecker || viem.zeroAddress,
2705
+ commercializerCheckerData: request.commercializerCheckerData || "0x",
2706
+ territories: request.territories || [],
2707
+ distributionChannels: request.distributionChannels || [],
2708
+ contentRestrictions: request.contentRestrictions || []
2709
+ }
2710
+ }],
1751
2711
  account: this.wallet.account
1752
2712
  }));
1753
2713
  case 3:
@@ -1762,14 +2722,14 @@ var IPAssetClient = /*#__PURE__*/function (_IPAssetReadOnlyClien) {
1762
2722
  break;
1763
2723
  }
1764
2724
  _context.next = 11;
1765
- return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, IPAccountRegistryConfig), {}, {
1766
- eventName: "IPAccountRegistered"
2725
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licensingModuleConfig), {}, {
2726
+ eventName: "PolicyRegistered"
1767
2727
  }));
1768
2728
  case 11:
1769
2729
  targetLog = _context.sent;
1770
2730
  return _context.abrupt("return", {
1771
2731
  txHash: txHash,
1772
- ipAccountId: targetLog === null || targetLog === void 0 ? void 0 : targetLog.args.account.toString()
2732
+ policyId: targetLog === null || targetLog === void 0 ? void 0 : targetLog.args.policyId.toString()
1773
2733
  });
1774
2734
  case 15:
1775
2735
  return _context.abrupt("return", {
@@ -1781,398 +2741,359 @@ var IPAssetClient = /*#__PURE__*/function (_IPAssetReadOnlyClien) {
1781
2741
  case 18:
1782
2742
  _context.prev = 18;
1783
2743
  _context.t0 = _context["catch"](0);
1784
- handleError(_context.t0, "Failed to register root IP");
2744
+ handleError(_context.t0, "Failed to register policy");
1785
2745
  case 21:
1786
2746
  case "end":
1787
2747
  return _context.stop();
1788
2748
  }
1789
2749
  }, _callee, this, [[0, 18]]);
1790
2750
  }));
1791
- function registerRootIp(_x) {
1792
- return _registerRootIp.apply(this, arguments);
2751
+ function registerPILPolicy(_x) {
2752
+ return _registerPILPolicy.apply(this, arguments);
1793
2753
  }
1794
- return registerRootIp;
2754
+ return registerPILPolicy;
1795
2755
  }()
1796
2756
  /**
1797
- * Register a derivative IP on Story Protocol based on the specified input asset data.
1798
- *
1799
- * @param request - the request object that contains all data needed to register a derivative IP.
1800
- * @returns the response object that contains results from the IP creation.
2757
+ * Adds a policy to the set of policies of an IP
2758
+ * @param request The request object containing details to add a policy to an IP
2759
+ * @param request.ipId The id of the IP
2760
+ * @param request.polId The id of the policy
2761
+ * @return the transaction hash and the index of the policy in the IP's policy set if the txOptions.waitForTransaction is set to true
1801
2762
  */
1802
2763
  }, {
1803
- key: "registerDerivativeIp",
2764
+ key: "addPolicyToIp",
1804
2765
  value: function () {
1805
- var _registerDerivativeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
1806
- var _request$txOptions2, _yield$this$rpcClient2, call, txHash, targetLog;
2766
+ var _addPolicyToIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
2767
+ var _request$txOptions2, IPAccountConfig, _yield$this$rpcClient2, call, txHash, targetLog;
1807
2768
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1808
2769
  while (1) switch (_context2.prev = _context2.next) {
1809
2770
  case 0:
1810
2771
  _context2.prev = 0;
1811
- _context2.next = 3;
1812
- return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, RegistrationModuleConfig), {}, {
1813
- functionName: "registerDerivativeIp",
1814
- args: [parseToBigInt(request.licenseId), viem.getAddress(request.tokenContractAddress),
1815
- // 0x Address
1816
- parseToBigInt(request.tokenId), request.ipName, request.ipDescription, viem.getAddress(request.hash) // Byte32
1817
- ]
2772
+ IPAccountConfig = {
2773
+ abi: this.ipAccountABI,
2774
+ address: viem.getAddress(request.ipId)
2775
+ };
2776
+ _context2.next = 4;
2777
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
2778
+ functionName: "execute",
2779
+ args: [this.licensingModuleConfig.address, parseToBigInt(0), viem.encodeFunctionData({
2780
+ abi: this.licensingModuleConfig.abi,
2781
+ functionName: "addPolicyToIp",
2782
+ args: [viem.getAddress(request.ipId), parseToBigInt(request.policyId)]
2783
+ })],
2784
+ account: this.wallet.account
1818
2785
  }));
1819
- case 3:
2786
+ case 4:
1820
2787
  _yield$this$rpcClient2 = _context2.sent;
1821
2788
  call = _yield$this$rpcClient2.request;
1822
- _context2.next = 7;
2789
+ _context2.next = 8;
1823
2790
  return this.wallet.writeContract(call);
1824
- case 7:
2791
+ case 8:
1825
2792
  txHash = _context2.sent;
1826
2793
  if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
1827
- _context2.next = 15;
2794
+ _context2.next = 16;
1828
2795
  break;
1829
2796
  }
1830
- _context2.next = 11;
1831
- return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, IPAccountRegistryConfig), {}, {
1832
- eventName: "IPAccountRegistered"
2797
+ _context2.next = 12;
2798
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licensingModuleConfig), {}, {
2799
+ eventName: "PolicyAddedToIpId"
1833
2800
  }));
1834
- case 11:
2801
+ case 12:
1835
2802
  targetLog = _context2.sent;
1836
2803
  return _context2.abrupt("return", {
1837
2804
  txHash: txHash,
1838
- ipAccountId: targetLog === null || targetLog === void 0 ? void 0 : targetLog.args.account.toString()
2805
+ index: targetLog.args.index.toString()
1839
2806
  });
1840
- case 15:
2807
+ case 16:
1841
2808
  return _context2.abrupt("return", {
1842
2809
  txHash: txHash
1843
2810
  });
1844
- case 16:
1845
- _context2.next = 21;
2811
+ case 17:
2812
+ _context2.next = 22;
1846
2813
  break;
1847
- case 18:
1848
- _context2.prev = 18;
2814
+ case 19:
2815
+ _context2.prev = 19;
1849
2816
  _context2.t0 = _context2["catch"](0);
1850
- handleError(_context2.t0, "Failed to register derivative IP");
1851
- case 21:
2817
+ handleError(_context2.t0, "Failed to add policy to IP");
2818
+ case 22:
1852
2819
  case "end":
1853
2820
  return _context2.stop();
1854
2821
  }
1855
- }, _callee2, this, [[0, 18]]);
2822
+ }, _callee2, this, [[0, 19]]);
1856
2823
  }));
1857
- function registerDerivativeIp(_x2) {
1858
- return _registerDerivativeIp.apply(this, arguments);
2824
+ function addPolicyToIp(_x2) {
2825
+ return _addPolicyToIp.apply(this, arguments);
1859
2826
  }
1860
- return registerDerivativeIp;
1861
- }() // TODO: move to License resource
1862
- // public async createPolicy(request: addPolicyRequest): Promise<addPolicyResponse> {
1863
- // try {
1864
- // const { request: call } = await this.rpcClient.simulateContract({
1865
- // ...LicenseRegistryConfig,
1866
- // functionName: "addPolicy",
1867
- // args: [
1868
- // {
1869
- // frameworkId: parseToBigInt(request.frameworkId),
1870
- // mintingParamValues: request.mintingParamValues.map((add) => getAddress(add)),
1871
- // activationParamValues: request.activationParamValues.map((add) => getAddress(add)),
1872
- // needsActivation: request.needsActivation,
1873
- // linkParentParamValues: request.linkParentParamValues.map((add) => getAddress(add)),
1874
- // },
1875
- // ], // TODO: add args
1876
- // });
1877
- // const txHash = await this.wallet.writeContract(call);
1878
- // // TODO: need an emitted event
1879
- // // if (request.txOptions?.waitForTransaction) {
1880
- // // const targetLog = await waitTxAndFilterLog(this.rpcClient, txHash, {
1881
- // // ...IPAccountRegistryConfig,
1882
- // // eventName: "IPAccountRegistered",
1883
- // // });
1884
- // // return { txHash: txHash, policyId: targetLog?.args.account.toString() };
1885
- // // } else {
1886
- // return { txHash: txHash };
1887
- // // }
1888
- // } catch (error) {
1889
- // handleError(error, "Failed to register derivative IP");
1890
- // }
1891
- // }
1892
- // TODO: move to License resource
1893
- // public async addPolicyToIp(request: addPolicyToIpRequest): Promise<addPolicyToIpResponse> {
1894
- // TODO: use getIpAccount to get the ipId
1895
- // }
2827
+ return addPolicyToIp;
2828
+ }()
1896
2829
  }]);
1897
- return IPAssetClient;
1898
- }(IPAssetReadOnlyClient);
1899
-
1900
- // import { isIntegerString } from "../utils/utils";
2830
+ return PolicyClient;
2831
+ }();
1901
2832
 
1902
- /**
1903
- * IPAssetReadOnlyClient allows you to view and search IP Assets on Story Protocol.
1904
- */
1905
- var PermissionReadOnlyClient = /*#__PURE__*/function () {
1906
- function PermissionReadOnlyClient(httpClient, rpcClient) {
1907
- _classCallCheck(this, PermissionReadOnlyClient);
1908
- this.httpClient = httpClient;
2833
+ var DisputeClient = /*#__PURE__*/function () {
2834
+ function DisputeClient(rpcClient, wallet) {
2835
+ _classCallCheck(this, DisputeClient);
2836
+ _defineProperty(this, "disputeModuleConfig", DisputeModuleConfig);
1909
2837
  this.rpcClient = rpcClient;
2838
+ this.wallet = wallet;
1910
2839
  }
1911
2840
 
1912
2841
  /**
1913
- * Get permission based on based on the specified IP id.
1914
- *
1915
- * @param request - the request object for getting an IP Asset.
1916
- * @returns the response object the contains the fetched IP Asset.
2842
+ * Raises a dispute on a given ipId
2843
+ * @param request - The request object containing necessary data to raise a dispute.
2844
+ * @param request.targetIpId - The IP ID that is the target of the dispute.
2845
+ * @param request.arbitrationPolicy - The address of the arbitration policy.
2846
+ * @param request.linkToDisputeEvidence - The link to the dispute evidence.
2847
+ * @param request.targetTag - The target tag of the dispute.
2848
+ * @param request.calldata - Optional calldata to initialize the policy.
2849
+ * @param request.txOptions - Optional transaction options.
2850
+ * @returns A Promise that resolves to a RaiseDisputeResponse containing the transaction hash.
2851
+ * @throws `NotRegisteredIpId` if targetIpId is not registered in the IPA Registry.
2852
+ * @throws `NotWhitelistedDisputeTag` if targetTag is not whitelisted.
2853
+ * @throws `ZeroLinkToDisputeEvidence` if linkToDisputeEvidence is empty
2854
+ * @calls raiseDispute(address _targetIpId, string memory _linkToDisputeEvidence, bytes32 _targetTag, bytes calldata _data) external nonReentrant returns (uint256) {
2855
+ * @emits DisputeRaised (disputeId_, targetIpId, msg.sender, arbitrationPolicy, linkToDisputeEvidence, targetTag, calldata);
1917
2856
  */
1918
- _createClass(PermissionReadOnlyClient, [{
1919
- key: "get",
2857
+ _createClass(DisputeClient, [{
2858
+ key: "raiseDispute",
1920
2859
  value: function () {
1921
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
1922
- var response;
2860
+ var _raiseDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2861
+ var _request$txOptions, _yield$this$rpcClient, call, txHash, logs;
1923
2862
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1924
2863
  while (1) switch (_context.prev = _context.next) {
1925
2864
  case 0:
1926
2865
  _context.prev = 0;
1927
2866
  _context.next = 3;
1928
- return this.httpClient.get("/permissions/".concat(request.permissionId));
2867
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.disputeModuleConfig), {}, {
2868
+ functionName: "raiseDispute",
2869
+ args: [request.targetIpId, request.linkToDisputeEvidence, viem.stringToHex(request.targetTag, {
2870
+ size: 32
2871
+ }), request.calldata || "0x"]
2872
+ }));
2873
+ case 3:
2874
+ _yield$this$rpcClient = _context.sent;
2875
+ call = _yield$this$rpcClient.request;
2876
+ _context.next = 7;
2877
+ return this.wallet.writeContract(call);
2878
+ case 7:
2879
+ txHash = _context.sent;
2880
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
2881
+ _context.next = 13;
2882
+ break;
2883
+ }
2884
+ _context.next = 11;
2885
+ return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.disputeModuleConfig), {}, {
2886
+ eventName: "DisputeRaised"
2887
+ }));
2888
+ case 11:
2889
+ logs = _context.sent;
2890
+ return _context.abrupt("return", {
2891
+ txHash: txHash,
2892
+ disputeId: BigInt(logs.args.disputeId).toString()
2893
+ });
2894
+ case 13:
2895
+ return _context.abrupt("return", {
2896
+ txHash: txHash
2897
+ });
2898
+ case 16:
2899
+ _context.prev = 16;
2900
+ _context.t0 = _context["catch"](0);
2901
+ handleError(_context.t0, "Failed to raise dispute");
2902
+ case 19:
2903
+ case "end":
2904
+ return _context.stop();
2905
+ }
2906
+ }, _callee, this, [[0, 16]]);
2907
+ }));
2908
+ function raiseDispute(_x) {
2909
+ return _raiseDispute.apply(this, arguments);
2910
+ }
2911
+ return raiseDispute;
2912
+ }()
2913
+ /**
2914
+ * Cancels an ongoing dispute
2915
+ * @param request The request object containing details to cancel the dispute.
2916
+ * @param request.disputeId The ID of the dispute to be cancelled.
2917
+ * @param request.calldata Optional additional data used in the cancellation process.
2918
+ * @returns A Promise that resolves to a CancelDisputeResponse containing the transaction hash.
2919
+ * @throws NotInDisputeState, if the currentTag of the Dispute is not being disputed
2920
+ * @throws NotDisputeInitiator, if the transaction executor is not the one that initiated the dispute
2921
+ * @throws error if the Dispute's ArbitrationPolicy contract is not valid
2922
+ * @calls cancelDispute(uint256 _disputeId, bytes calldata _data) external nonReentrant {
2923
+ * @emits DisputeCancelled (_disputeId, _data);
2924
+ */
2925
+ }, {
2926
+ key: "cancelDispute",
2927
+ value: function () {
2928
+ var _cancelDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
2929
+ var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
2930
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2931
+ while (1) switch (_context2.prev = _context2.next) {
2932
+ case 0:
2933
+ _context2.prev = 0;
2934
+ _context2.next = 3;
2935
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.disputeModuleConfig), {}, {
2936
+ functionName: "cancelDispute",
2937
+ args: [BigInt(request.disputeId), request.calldata ? request.calldata : "0x"]
2938
+ }));
1929
2939
  case 3:
1930
- response = _context.sent;
1931
- return _context.abrupt("return", response.data);
2940
+ _yield$this$rpcClient2 = _context2.sent;
2941
+ call = _yield$this$rpcClient2.request;
2942
+ _context2.next = 7;
2943
+ return this.wallet.writeContract(call);
1932
2944
  case 7:
1933
- _context.prev = 7;
1934
- _context.t0 = _context["catch"](0);
1935
- handleError(_context.t0, "Failed to get IP account");
1936
- case 10:
2945
+ txHash = _context2.sent;
2946
+ if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
2947
+ _context2.next = 11;
2948
+ break;
2949
+ }
2950
+ _context2.next = 11;
2951
+ return waitTx(this.rpcClient, txHash);
2952
+ case 11:
2953
+ return _context2.abrupt("return", {
2954
+ txHash: txHash
2955
+ });
2956
+ case 14:
2957
+ _context2.prev = 14;
2958
+ _context2.t0 = _context2["catch"](0);
2959
+ handleError(_context2.t0, "Failed to cancel dispute");
2960
+ case 17:
1937
2961
  case "end":
1938
- return _context.stop();
2962
+ return _context2.stop();
1939
2963
  }
1940
- }, _callee, this, [[0, 7]]);
2964
+ }, _callee2, this, [[0, 14]]);
1941
2965
  }));
1942
- function get(_x) {
1943
- return _get.apply(this, arguments);
2966
+ function cancelDispute(_x2) {
2967
+ return _cancelDispute.apply(this, arguments);
1944
2968
  }
1945
- return get;
2969
+ return cancelDispute;
1946
2970
  }()
1947
2971
  /**
1948
- * List IP accounts.
1949
- *
1950
- * @returns the response object that contains results from listing query.
2972
+ * Resolves a dispute after it has been judged
2973
+ * @param request The request object containing details to resolve the dispute.
2974
+ * @param request.disputeId The ID of the dispute to be resolved.
2975
+ * @returns A Promise that resolves to a ResolveDisputeResponse.
2976
+ * @throws NotAbleToResolve, if currentTag is still in dispute (i.e still needs a judgement to be set)
2977
+ * @throws NotDisputeInitiator, if the transaction executor is not the one that initiated the dispute
2978
+ * @emits DisputeResolved (_disputeId)
1951
2979
  */
1952
2980
  }, {
1953
- key: "list",
2981
+ key: "resolveDispute",
1954
2982
  value: function () {
1955
- var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
1956
- var response;
1957
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1958
- while (1) switch (_context2.prev = _context2.next) {
2983
+ var _resolveDispute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
2984
+ var _request$txOptions3, _yield$this$rpcClient3, call, txHash;
2985
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2986
+ while (1) switch (_context3.prev = _context3.next) {
1959
2987
  case 0:
1960
- _context2.prev = 0;
1961
- _context2.next = 3;
1962
- return this.httpClient.post("/permissions", request || {});
2988
+ _context3.prev = 0;
2989
+ _context3.next = 3;
2990
+ return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.disputeModuleConfig), {}, {
2991
+ functionName: "resolveDispute",
2992
+ args: [BigInt(request.disputeId)]
2993
+ }));
1963
2994
  case 3:
1964
- response = _context2.sent;
1965
- return _context2.abrupt("return", response.data);
2995
+ _yield$this$rpcClient3 = _context3.sent;
2996
+ call = _yield$this$rpcClient3.request;
2997
+ _context3.next = 7;
2998
+ return this.wallet.writeContract(call);
1966
2999
  case 7:
1967
- _context2.prev = 7;
1968
- _context2.t0 = _context2["catch"](0);
1969
- handleError(_context2.t0, "Failed to list IP Asset.");
1970
- case 10:
3000
+ txHash = _context3.sent;
3001
+ if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
3002
+ _context3.next = 11;
3003
+ break;
3004
+ }
3005
+ _context3.next = 11;
3006
+ return waitTx(this.rpcClient, txHash);
3007
+ case 11:
3008
+ return _context3.abrupt("return", {
3009
+ txHash: txHash
3010
+ });
3011
+ case 14:
3012
+ _context3.prev = 14;
3013
+ _context3.t0 = _context3["catch"](0);
3014
+ handleError(_context3.t0, "Failed to cancel dispute");
3015
+ case 17:
1971
3016
  case "end":
1972
- return _context2.stop();
3017
+ return _context3.stop();
1973
3018
  }
1974
- }, _callee2, this, [[0, 7]]);
3019
+ }, _callee3, this, [[0, 14]]);
1975
3020
  }));
1976
- function list(_x2) {
1977
- return _list.apply(this, arguments);
3021
+ function resolveDispute(_x3) {
3022
+ return _resolveDispute.apply(this, arguments);
1978
3023
  }
1979
- return list;
3024
+ return resolveDispute;
1980
3025
  }()
1981
3026
  }]);
1982
- return PermissionReadOnlyClient;
3027
+ return DisputeClient;
1983
3028
  }();
1984
3029
 
1985
- var IPAccountImplABI = [{
1986
- inputs: [{
1987
- internalType: "address",
1988
- name: "to_",
1989
- type: "address"
1990
- }, {
1991
- internalType: "uint256",
1992
- name: "value_",
1993
- type: "uint256"
1994
- }, {
1995
- internalType: "bytes",
1996
- name: "data_",
1997
- type: "bytes"
1998
- }],
1999
- name: "execute",
2000
- outputs: [{
2001
- internalType: "bytes",
2002
- name: "result",
2003
- type: "bytes"
2004
- }],
2005
- stateMutability: "payable",
2006
- type: "function"
2007
- }, {
2008
- inputs: [{
2009
- internalType: "address",
2010
- name: "signer_",
2011
- type: "address"
2012
- }, {
2013
- internalType: "bytes",
2014
- name: "data_",
2015
- type: "bytes"
2016
- }],
2017
- name: "isValidSigner",
2018
- outputs: [{
2019
- internalType: "bytes4",
2020
- name: "",
2021
- type: "bytes4"
2022
- }],
2023
- stateMutability: "view",
2024
- type: "function"
2025
- }];
2026
-
2027
- var ErrorsAbi$1 = errorsJson;
2028
- var IPAccountImplMerged = [].concat(_toConsumableArray(IPAccountImplABI), _toConsumableArray(ErrorsAbi$1));
2029
-
2030
- var AccessControllerABI = [{
2031
- inputs: [{
2032
- internalType: "address",
2033
- name: "ipAccount_",
2034
- type: "address"
2035
- }, {
2036
- internalType: "address",
2037
- name: "signer_",
2038
- type: "address"
2039
- }, {
2040
- internalType: "address",
2041
- name: "to_",
2042
- type: "address"
2043
- }, {
2044
- internalType: "bytes4",
2045
- name: "func_",
2046
- type: "bytes4"
2047
- }, {
2048
- internalType: "uint8",
2049
- name: "permission_",
2050
- type: "uint8"
2051
- }],
2052
- name: "setPermission",
2053
- outputs: [],
2054
- stateMutability: "nonpayable",
2055
- type: "function"
2056
- }, {
2057
- anonymous: false,
2058
- inputs: [{
2059
- indexed: true,
2060
- internalType: "address",
2061
- name: "ipAccount",
2062
- type: "address"
2063
- }, {
2064
- indexed: true,
2065
- internalType: "address",
2066
- name: "signer",
2067
- type: "address"
2068
- }, {
2069
- indexed: true,
2070
- internalType: "address",
2071
- name: "to",
2072
- type: "address"
2073
- }, {
2074
- indexed: false,
2075
- internalType: "bytes4",
2076
- name: "func",
2077
- type: "bytes4"
2078
- }, {
2079
- indexed: false,
2080
- internalType: "uint8",
2081
- name: "permission",
2082
- type: "uint8"
2083
- }],
2084
- name: "PermissionSet",
2085
- type: "event"
2086
- }];
2087
-
2088
- var ErrorsAbi = errorsJson;
2089
- var AccessControllerABImerged = [].concat(_toConsumableArray(AccessControllerABI), _toConsumableArray(ErrorsAbi));
2090
- ({
2091
- abi: AccessControllerABImerged,
2092
- address: viem.getAddress(process.env.ACCESS_CONTROLLER || process.env.NEXT_PUBLIC_ACCESS_CONTROLLER || "")
2093
- });
2094
-
2095
- // import { HashZero } from "../constants/common";
2096
-
2097
- var PermissionClient = /*#__PURE__*/function (_PermissionReadOnlyCl) {
2098
- _inherits(PermissionClient, _PermissionReadOnlyCl);
2099
- var _super = _createSuper(PermissionClient);
2100
- function PermissionClient(httpClient, rpcClient, wallet) {
2101
- var _this;
2102
- _classCallCheck(this, PermissionClient);
2103
- _this = _super.call(this, httpClient, rpcClient);
2104
- _this.wallet = wallet;
2105
- return _this;
3030
+ var PlatformClient = /*#__PURE__*/function () {
3031
+ function PlatformClient(httpClient) {
3032
+ _classCallCheck(this, PlatformClient);
3033
+ this.httpClient = httpClient;
2106
3034
  }
2107
3035
 
2108
3036
  /**
2109
- * Set Permission based on the specified input
3037
+ * Upload a file to Arweave.
2110
3038
  *
2111
- * @param request - the request object that contains all data needed to set permission.
2112
- * @returns the response object that contains results from the set permission.
3039
+ * @param file - the file binary data to upload
3040
+ * @param mimeType - the mime type of the file
3041
+ * @returns the response object that contains the uri of the uploaded file
2113
3042
  */
2114
- _createClass(PermissionClient, [{
2115
- key: "setPermission",
3043
+ _createClass(PlatformClient, [{
3044
+ key: "uploadFile",
2116
3045
  value: function () {
2117
- var _setPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2118
- var IPAccountConfig, accessController, _yield$this$rpcClient, call, txHash;
3046
+ var _uploadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, mimeType) {
3047
+ var preSignUrlResp, data, uploadResp, confirmResp;
2119
3048
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2120
3049
  while (1) switch (_context.prev = _context.next) {
2121
3050
  case 0:
2122
3051
  _context.prev = 0;
2123
- IPAccountConfig = {
2124
- abi: IPAccountImplMerged,
2125
- address: viem.getAddress(request.ipAsset)
2126
- };
2127
- accessController = viem.getAddress(process.env.ACCESS_CONTROLLER || process.env.NEXT_PUBLIC_ACCESS_CONTROLLER || ""); //to
2128
- _context.next = 5;
2129
- return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
2130
- functionName: "execute",
2131
- args: [accessController, 0, viem.encodeFunctionData({
2132
- abi: AccessControllerABImerged,
2133
- functionName: "setPermission",
2134
- args: [viem.getAddress(request.ipAsset),
2135
- // 0x Address
2136
- viem.getAddress(request.signer),
2137
- // 0x Address
2138
- viem.getAddress(request.to),
2139
- // 0x Address
2140
- request.func,
2141
- // bytes4
2142
- request.permission // uint8
2143
- ]
2144
- })],
2145
-
2146
- account: this.wallet.account
2147
- }));
2148
- case 5:
2149
- _yield$this$rpcClient = _context.sent;
2150
- call = _yield$this$rpcClient.request;
2151
- _context.next = 9;
2152
- return this.wallet.writeContract(call);
2153
- case 9:
2154
- txHash = _context.sent;
2155
- return _context.abrupt("return", {
2156
- txHash: txHash
3052
+ _context.next = 3;
3053
+ return this.httpClient.post("/platform/file-upload/request");
3054
+ case 3:
3055
+ preSignUrlResp = _context.sent;
3056
+ data = preSignUrlResp.data; // upload the file to s3
3057
+ _context.next = 7;
3058
+ return this.httpClient.put(data.url, file, {
3059
+ timeout: 0,
3060
+ headers: {
3061
+ "Content-Type": mimeType
3062
+ }
2157
3063
  });
2158
- case 13:
2159
- _context.prev = 13;
2160
- _context.t0 = _context["catch"](0);
2161
- handleError(_context.t0, "Failed to set permissions");
3064
+ case 7:
3065
+ uploadResp = _context.sent;
3066
+ if (!(uploadResp.status !== 200)) {
3067
+ _context.next = 10;
3068
+ break;
3069
+ }
3070
+ throw new Error("Failed to upload file to s3. Status: ".concat(uploadResp.status));
3071
+ case 10:
3072
+ _context.next = 12;
3073
+ return this.httpClient.post("/platform/file-upload/confirm", {
3074
+ key: data.key
3075
+ });
3076
+ case 12:
3077
+ confirmResp = _context.sent;
3078
+ return _context.abrupt("return", confirmResp.data);
2162
3079
  case 16:
3080
+ _context.prev = 16;
3081
+ _context.t0 = _context["catch"](0);
3082
+ return _context.abrupt("return", handleError(_context.t0, "Failed to upload file"));
3083
+ case 19:
2163
3084
  case "end":
2164
3085
  return _context.stop();
2165
3086
  }
2166
- }, _callee, this, [[0, 13]]);
3087
+ }, _callee, this, [[0, 16]]);
2167
3088
  }));
2168
- function setPermission(_x) {
2169
- return _setPermission.apply(this, arguments);
3089
+ function uploadFile(_x, _x2) {
3090
+ return _uploadFile.apply(this, arguments);
2170
3091
  }
2171
- return setPermission;
3092
+ return uploadFile;
2172
3093
  }()
2173
3094
  }]);
2174
- return PermissionClient;
2175
- }(PermissionReadOnlyClient);
3095
+ return PlatformClient;
3096
+ }();
2176
3097
 
2177
3098
  if (typeof process !== "undefined") {
2178
3099
  dotenv__namespace.config();
@@ -2183,53 +3104,51 @@ if (typeof process !== "undefined") {
2183
3104
  var StoryClient = /*#__PURE__*/function () {
2184
3105
  /**
2185
3106
  * @param config - the configuration for the SDK client
2186
- * @param isReadOnly
2187
3107
  */
2188
3108
  function StoryClient(config) {
2189
- var isReadOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2190
3109
  _classCallCheck(this, StoryClient);
2191
- _defineProperty(this, "isReadOnly", false);
2192
3110
  _defineProperty(this, "_ipAccount", null);
2193
3111
  _defineProperty(this, "_permission", null);
2194
- _defineProperty(this, "_transaction", null);
3112
+ _defineProperty(this, "_license", null);
3113
+ _defineProperty(this, "_policy", null);
2195
3114
  _defineProperty(this, "_platform", null);
2196
- _defineProperty(this, "_module", null);
2197
3115
  _defineProperty(this, "_tagging", null);
3116
+ _defineProperty(this, "_dispute", null);
2198
3117
  this.config = config;
2199
- this.isReadOnly = isReadOnly;
2200
- var clientConfig = {
2201
- chain: this.config.chain || chains.sepolia,
2202
- transport: this.config.transport || viem.http(process.env.RPC_PROVIDER_URL)
2203
- };
2204
- this.rpcClient = viem.createPublicClient(clientConfig);
2205
- if (!isReadOnly) {
2206
- var account = this.config.account;
2207
- if (!account) {
2208
- throw new Error("account is null");
2209
- }
2210
- this.wallet = viem.createWalletClient(_objectSpread2(_objectSpread2({}, clientConfig), {}, {
2211
- account: account
2212
- }));
3118
+ if (!this.config.transport) {
3119
+ throw new Error("transport is null, please pass in a valid RPC Provider URL as the transport.");
2213
3120
  }
2214
3121
  this.httpClient = axios__default["default"].create({
2215
- baseURL: process.env.API_BASE_URL || process.env.NEXT_PUBLIC_API_BASE_URL,
2216
- timeout: HTTP_TIMEOUT,
3122
+ baseURL: "https://stag.api.storyprotocol.net",
3123
+ timeout: 5000,
2217
3124
  headers: {
2218
3125
  version: "v0-alpha"
2219
3126
  }
2220
3127
  });
3128
+ var clientConfig = {
3129
+ chain: chainStringToViemChain(this.config.chainId || "sepolia"),
3130
+ transport: this.config.transport
3131
+ };
3132
+ this.rpcClient = viem.createPublicClient(clientConfig);
3133
+ var account = this.config.account;
3134
+ if (!account) {
3135
+ throw new Error("account is null");
3136
+ }
3137
+ this.wallet = viem.createWalletClient(_objectSpread2(_objectSpread2({}, clientConfig), {}, {
3138
+ account: account
3139
+ }));
2221
3140
  }
2222
3141
 
2223
3142
  /**
2224
- * Factory method for creating a read only SDK client.
3143
+ * Factory method for creating a SDK client with a signer.
2225
3144
  *
2226
- * @param config - the configuration for a read only SDK client
3145
+ * @param config - the configuration for a new SDK client
2227
3146
  */
2228
3147
  _createClass(StoryClient, [{
2229
3148
  key: "ipAsset",
2230
3149
  get: function get() {
2231
3150
  if (this._ipAccount === null) {
2232
- this._ipAccount = this.isReadOnly ? new IPAssetReadOnlyClient(this.httpClient, this.rpcClient) : new IPAssetClient(this.httpClient, this.rpcClient, this.wallet);
3151
+ this._ipAccount = new IPAssetClient(this.rpcClient, this.wallet);
2233
3152
  }
2234
3153
  return this._ipAccount;
2235
3154
  }
@@ -2237,131 +3156,87 @@ var StoryClient = /*#__PURE__*/function () {
2237
3156
  key: "permission",
2238
3157
  get: function get() {
2239
3158
  if (this._permission === null) {
2240
- this._permission = this.isReadOnly ? new PermissionReadOnlyClient(this.httpClient, this.rpcClient) : new PermissionClient(this.httpClient, this.rpcClient, this.wallet);
3159
+ this._permission = new PermissionClient(this.rpcClient, this.wallet);
2241
3160
  }
2242
3161
  return this._permission;
2243
3162
  }
2244
-
2245
- /**
2246
- * Getter for the transaction client. The client is lazily created when
2247
- * this method is called.
2248
- *
2249
- * @returns the TransactionReadOnlyClient or TransactionClient instance
2250
- */
2251
3163
  }, {
2252
- key: "transaction",
3164
+ key: "license",
3165
+ get: function get() {
3166
+ if (this._license === null) {
3167
+ this._license = new LicenseClient(this.rpcClient, this.wallet);
3168
+ }
3169
+ return this._license;
3170
+ }
3171
+ }, {
3172
+ key: "policy",
2253
3173
  get: function get() {
2254
- if (this._transaction === null) {
2255
- this._transaction = this.isReadOnly ? new TransactionReadOnlyClient(this.httpClient, this.rpcClient) : new TransactionClient(this.httpClient, this.rpcClient, this.wallet);
3174
+ if (this._policy === null) {
3175
+ this._policy = new PolicyClient(this.rpcClient, this.wallet);
2256
3176
  }
2257
- return this._transaction;
3177
+ return this._policy;
2258
3178
  }
2259
3179
 
2260
3180
  /**
2261
3181
  * Getter for the tagging client. The client is lazily created when
2262
3182
  * this method is called.
2263
3183
  *
2264
- * @returns the TaggingReadOnlyClient or TaggingClient instance
3184
+ * @returns the TaggingClient instance
2265
3185
  */
2266
3186
  }, {
2267
3187
  key: "tagging",
2268
3188
  get: function get() {
2269
3189
  if (this._tagging === null) {
2270
- this._tagging = this.isReadOnly ? new TaggingReadOnlyClient(this.httpClient, this.rpcClient) : new TaggingClient(this.httpClient, this.rpcClient, this.wallet);
3190
+ this._tagging = new TaggingClient(this.rpcClient, this.wallet);
2271
3191
  }
2272
3192
  return this._tagging;
2273
3193
  }
2274
3194
 
2275
3195
  /**
2276
- * Getter for the platform client. The client is lazily created when
3196
+ * Getter for the dispute client. The client is lazily created when
2277
3197
  * this method is called.
2278
3198
  *
2279
- * @returns the PlatformClient instance
3199
+ * @returns the DisputeClient instance
2280
3200
  */
2281
3201
  }, {
2282
- key: "platform",
3202
+ key: "dispute",
2283
3203
  get: function get() {
2284
- if (this._platform === null) {
2285
- this._platform = new PlatformClient(this.httpClient);
3204
+ if (this._dispute === null) {
3205
+ this._dispute = new DisputeClient(this.rpcClient, this.wallet);
2286
3206
  }
2287
- return this._platform;
3207
+ return this._dispute;
2288
3208
  }
2289
3209
 
2290
3210
  /**
2291
- * Getter for the module client. The client is lazily created when
3211
+ * Getter for the platform client. The client is lazily created when
2292
3212
  * this method is called.
2293
3213
  *
2294
- * @returns the Module instance
3214
+ * @returns the PlatformClient instance
2295
3215
  */
2296
3216
  }, {
2297
- key: "module",
3217
+ key: "platform",
2298
3218
  get: function get() {
2299
- if (this._module === null) {
2300
- this._module = new ModuleReadOnlyClient(this.httpClient, this.rpcClient);
3219
+ if (this._platform === null) {
3220
+ this._platform = new PlatformClient(this.httpClient);
2301
3221
  }
2302
- return this._module;
3222
+ return this._platform;
2303
3223
  }
2304
3224
  }], [{
2305
- key: "newReadOnlyClient",
2306
- value: function newReadOnlyClient(config) {
2307
- return new StoryClient(config, true);
2308
- }
2309
-
2310
- /**
2311
- * Factory method for creating a SDK client with a signer.
2312
- *
2313
- * @param config - the configuration for a new read/write SDK client
2314
- */
2315
- }, {
2316
3225
  key: "newClient",
2317
3226
  value: function newClient(config) {
2318
- return new StoryClient(config, false);
3227
+ return new StoryClient(config);
2319
3228
  }
2320
3229
  }]);
2321
3230
  return StoryClient;
2322
3231
  }();
2323
3232
 
2324
- /**
2325
- * @public
2326
- */
2327
- var ResourceType = /*#__PURE__*/function (ResourceType) {
2328
- ResourceType["Unspecified"] = "Unspecified";
2329
- ResourceType["IPOrg"] = "IPOrg";
2330
- ResourceType["IPAsset"] = "IPAsset";
2331
- ResourceType["License"] = "License";
2332
- ResourceType["Relationship"] = "Relationship";
2333
- ResourceType["RelationshipType"] = "RelationshipType";
2334
- ResourceType["Module"] = "Module";
2335
- ResourceType["Hook"] = "Hook";
2336
- ResourceType["Dispute"] = "Dispute";
2337
- return ResourceType;
2338
- }({});
2339
-
2340
- /**
2341
- * @public
2342
- */
2343
- var ActionType = /*#__PURE__*/function (ActionType) {
2344
- ActionType["Unspecified"] = "Unspecified";
2345
- ActionType["Register"] = "Register";
2346
- ActionType["Unregister"] = "Unregister";
2347
- ActionType["Configure"] = "Configure";
2348
- ActionType["Create"] = "Create";
2349
- return ActionType;
2350
- }({});
2351
-
2352
- var AddressZero = "0x0000000000000000000000000000000000000000";
2353
- var HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
2354
-
2355
- exports.ActionType = ActionType;
2356
3233
  exports.AddressZero = AddressZero;
3234
+ exports.DisputeClient = DisputeClient;
2357
3235
  exports.HashZero = HashZero;
2358
3236
  exports.IPAssetClient = IPAssetClient;
2359
- exports.IPAssetReadOnlyClient = IPAssetReadOnlyClient;
2360
- exports.ModuleReadOnlyClient = ModuleReadOnlyClient;
3237
+ exports.LicenseClient = LicenseClient;
2361
3238
  exports.PermissionClient = PermissionClient;
2362
- exports.PermissionReadOnlyClient = PermissionReadOnlyClient;
2363
3239
  exports.PlatformClient = PlatformClient;
2364
- exports.ResourceType = ResourceType;
3240
+ exports.PolicyClient = PolicyClient;
2365
3241
  exports.StoryClient = StoryClient;
2366
- exports.TaggingReadOnlyClient = TaggingReadOnlyClient;
2367
- exports.TransactionClient = TransactionClient;
3242
+ exports.TaggingClient = TaggingClient;