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