@story-protocol/core-sdk 0.1.0-alpha-rc.1 → 0.1.0-alpha-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/declarations/src/client.d.ts +11 -0
  2. package/dist/declarations/src/client.d.ts.map +1 -1
  3. package/dist/declarations/src/constants/addresses.d.ts +2 -0
  4. package/dist/declarations/src/constants/addresses.d.ts.map +1 -0
  5. package/dist/declarations/src/enums/HookType.d.ts +8 -0
  6. package/dist/declarations/src/enums/HookType.d.ts.map +1 -0
  7. package/dist/declarations/src/index.d.ts +19 -4
  8. package/dist/declarations/src/index.d.ts.map +1 -1
  9. package/dist/declarations/src/resources/hookReadOnly.d.ts.map +1 -1
  10. package/dist/declarations/src/resources/ipAssetReadOnly.d.ts +1 -1
  11. package/dist/declarations/src/resources/ipAssetReadOnly.d.ts.map +1 -1
  12. package/dist/declarations/src/resources/ipOrg.d.ts.map +1 -1
  13. package/dist/declarations/src/resources/ipOrgReadOnly.d.ts.map +1 -1
  14. package/dist/declarations/src/resources/licenseReadOnly.d.ts.map +1 -1
  15. package/dist/declarations/src/resources/moduleReadOnly.d.ts.map +1 -1
  16. package/dist/declarations/src/resources/relationship.d.ts +1 -8
  17. package/dist/declarations/src/resources/relationship.d.ts.map +1 -1
  18. package/dist/declarations/src/resources/relationshipType.d.ts +19 -0
  19. package/dist/declarations/src/resources/relationshipType.d.ts.map +1 -0
  20. package/dist/declarations/src/resources/relationshipTypeReadOnly.d.ts +26 -0
  21. package/dist/declarations/src/resources/relationshipTypeReadOnly.d.ts.map +1 -0
  22. package/dist/declarations/src/resources/transactionReadOnly.d.ts.map +1 -1
  23. package/dist/declarations/src/types/client.d.ts +4 -0
  24. package/dist/declarations/src/types/client.d.ts.map +1 -1
  25. package/dist/declarations/src/types/config.d.ts +1 -5
  26. package/dist/declarations/src/types/config.d.ts.map +1 -1
  27. package/dist/declarations/src/types/resources/ipAsset.d.ts +1 -1
  28. package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
  29. package/dist/declarations/src/types/resources/relationship.d.ts +0 -17
  30. package/dist/declarations/src/types/resources/relationship.d.ts.map +1 -1
  31. package/dist/declarations/src/types/resources/relationshipType.d.ts +44 -0
  32. package/dist/declarations/src/types/resources/relationshipType.d.ts.map +1 -0
  33. package/dist/declarations/src/utils/platform.d.ts.map +1 -1
  34. package/dist/story-protocol-core-sdk.cjs.dev.js +4169 -532
  35. package/dist/story-protocol-core-sdk.cjs.prod.js +4169 -532
  36. package/dist/story-protocol-core-sdk.esm.js +4157 -533
  37. package/package.json +2 -2
  38. package/dist/declarations/src/enums/Environment.d.ts +0 -8
  39. package/dist/declarations/src/enums/Environment.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { isAddress, parseAbi, getAddress, decodeEventLog, zeroAddress, toHex, http, createPublicClient, createWalletClient } from 'viem';
2
+ import { isAddress, parseAbi, getAddress, decodeEventLog, toHex, http, createPublicClient, createWalletClient } from 'viem';
3
3
  import { sepolia } from 'viem/chains';
4
4
  import * as dotenv from 'dotenv';
5
5
  import { formatAbi } from 'abitype';
@@ -81,15 +81,6 @@ function _createClass(Constructor, protoProps, staticProps) {
81
81
  return Constructor;
82
82
  }
83
83
 
84
- /**
85
- * @public
86
- */
87
- var Environment = /*#__PURE__*/function (Environment) {
88
- Environment["TEST"] = "TEST";
89
- Environment["PROD"] = "PROD";
90
- return Environment;
91
- }({});
92
-
93
84
  function _regeneratorRuntime() {
94
85
  _regeneratorRuntime = function () {
95
86
  return e;
@@ -571,20 +562,23 @@ var IPOrgReadOnlyClient = /*#__PURE__*/function () {
571
562
  while (1) switch (_context2.prev = _context2.next) {
572
563
  case 0:
573
564
  _context2.prev = 0;
574
- _context2.next = 3;
565
+ if (!request) {
566
+ request = {};
567
+ }
568
+ _context2.next = 4;
575
569
  return this.httpClient.post("/protocol/iporg", request);
576
- case 3:
570
+ case 4:
577
571
  response = _context2.sent;
578
572
  return _context2.abrupt("return", response.data);
579
- case 7:
580
- _context2.prev = 7;
573
+ case 8:
574
+ _context2.prev = 8;
581
575
  _context2.t0 = _context2["catch"](0);
582
576
  handleError(_context2.t0, "Failed to list IPOrgs.");
583
- case 10:
577
+ case 11:
584
578
  case "end":
585
579
  return _context2.stop();
586
580
  }
587
- }, _callee2, this, [[0, 7]]);
581
+ }, _callee2, this, [[0, 8]]);
588
582
  }));
589
583
  function list(_x2) {
590
584
  return _list.apply(this, arguments);
@@ -595,309 +589,1085 @@ var IPOrgReadOnlyClient = /*#__PURE__*/function () {
595
589
  return IPOrgReadOnlyClient;
596
590
  }();
597
591
 
592
+ var storyProtocolJson = [
593
+ {
594
+ inputs: [
595
+ {
596
+ internalType: "contract IIPOrgController",
597
+ name: "ipOrgController_",
598
+ type: "address"
599
+ },
600
+ {
601
+ internalType: "contract ModuleRegistry",
602
+ name: "moduleRegistry_",
603
+ type: "address"
604
+ }
605
+ ],
606
+ stateMutability: "nonpayable",
607
+ type: "constructor"
608
+ },
609
+ {
610
+ inputs: [
611
+ ],
612
+ name: "ZeroAddress",
613
+ type: "error"
614
+ },
615
+ {
616
+ inputs: [
617
+ ],
618
+ name: "IP_ORG_CONTROLLER",
619
+ outputs: [
620
+ {
621
+ internalType: "contract IIPOrgController",
622
+ name: "",
623
+ type: "address"
624
+ }
625
+ ],
626
+ stateMutability: "view",
627
+ type: "function"
628
+ },
629
+ {
630
+ inputs: [
631
+ ],
632
+ name: "MODULE_REGISTRY",
633
+ outputs: [
634
+ {
635
+ internalType: "contract ModuleRegistry",
636
+ name: "",
637
+ type: "address"
638
+ }
639
+ ],
640
+ stateMutability: "view",
641
+ type: "function"
642
+ },
643
+ {
644
+ inputs: [
645
+ {
646
+ internalType: "address",
647
+ name: "ipOrg_",
648
+ type: "address"
649
+ },
650
+ {
651
+ internalType: "uint256",
652
+ name: "licenseId_",
653
+ type: "uint256"
654
+ }
655
+ ],
656
+ name: "activateLicense",
657
+ outputs: [
658
+ ],
659
+ stateMutability: "nonpayable",
660
+ type: "function"
661
+ },
662
+ {
663
+ inputs: [
664
+ {
665
+ internalType: "address",
666
+ name: "ipOrg_",
667
+ type: "address"
668
+ },
669
+ {
670
+ internalType: "string[]",
671
+ name: "ipAssetTypes_",
672
+ type: "string[]"
673
+ }
674
+ ],
675
+ name: "addIPAssetTypes",
676
+ outputs: [
677
+ ],
678
+ stateMutability: "nonpayable",
679
+ type: "function"
680
+ },
681
+ {
682
+ inputs: [
683
+ {
684
+ components: [
685
+ {
686
+ internalType: "string",
687
+ name: "relType",
688
+ type: "string"
689
+ },
690
+ {
691
+ internalType: "address",
692
+ name: "ipOrg",
693
+ type: "address"
694
+ },
695
+ {
696
+ components: [
697
+ {
698
+ internalType: "enum LibRelationship.Relatables",
699
+ name: "src",
700
+ type: "uint8"
701
+ },
702
+ {
703
+ internalType: "enum LibRelationship.Relatables",
704
+ name: "dst",
705
+ type: "uint8"
706
+ }
707
+ ],
708
+ internalType: "struct LibRelationship.RelatedElements",
709
+ name: "allowedElements",
710
+ type: "tuple"
711
+ },
712
+ {
713
+ internalType: "uint8[]",
714
+ name: "allowedSrcs",
715
+ type: "uint8[]"
716
+ },
717
+ {
718
+ internalType: "uint8[]",
719
+ name: "allowedDsts",
720
+ type: "uint8[]"
721
+ }
722
+ ],
723
+ internalType: "struct LibRelationship.AddRelationshipTypeParams",
724
+ name: "params_",
725
+ type: "tuple"
726
+ }
727
+ ],
728
+ name: "addRelationshipType",
729
+ outputs: [
730
+ ],
731
+ stateMutability: "nonpayable",
732
+ type: "function"
733
+ },
734
+ {
735
+ inputs: [
736
+ {
737
+ internalType: "address",
738
+ name: "ipOrg_",
739
+ type: "address"
740
+ },
741
+ {
742
+ internalType: "uint256",
743
+ name: "licenseId_",
744
+ type: "uint256"
745
+ },
746
+ {
747
+ internalType: "uint256",
748
+ name: "ipaId_",
749
+ type: "uint256"
750
+ }
751
+ ],
752
+ name: "bindLnftToIpa",
753
+ outputs: [
754
+ ],
755
+ stateMutability: "nonpayable",
756
+ type: "function"
757
+ },
758
+ {
759
+ inputs: [
760
+ {
761
+ internalType: "address",
762
+ name: "ipOrg_",
763
+ type: "address"
764
+ },
765
+ {
766
+ components: [
767
+ {
768
+ components: [
769
+ {
770
+ internalType: "ShortString[]",
771
+ name: "termIds",
772
+ type: "bytes32[]"
773
+ },
774
+ {
775
+ internalType: "bytes[]",
776
+ name: "termData",
777
+ type: "bytes[]"
778
+ }
779
+ ],
780
+ internalType: "struct Licensing.TermsConfig",
781
+ name: "comTermsConfig",
782
+ type: "tuple"
783
+ },
784
+ {
785
+ components: [
786
+ {
787
+ internalType: "ShortString[]",
788
+ name: "termIds",
789
+ type: "bytes32[]"
790
+ },
791
+ {
792
+ internalType: "bytes[]",
793
+ name: "termData",
794
+ type: "bytes[]"
795
+ }
796
+ ],
797
+ internalType: "struct Licensing.TermsConfig",
798
+ name: "nonComTermsConfig",
799
+ type: "tuple"
800
+ }
801
+ ],
802
+ internalType: "struct Licensing.FrameworkConfig",
803
+ name: "framework_",
804
+ type: "tuple"
805
+ }
806
+ ],
807
+ name: "configureIpOrgLicensing",
808
+ outputs: [
809
+ ],
810
+ stateMutability: "nonpayable",
811
+ type: "function"
812
+ },
813
+ {
814
+ inputs: [
815
+ {
816
+ internalType: "address",
817
+ name: "ipOrg_",
818
+ type: "address"
819
+ },
820
+ {
821
+ components: [
822
+ {
823
+ internalType: "bool",
824
+ name: "isCommercial",
825
+ type: "bool"
826
+ },
827
+ {
828
+ internalType: "uint256",
829
+ name: "parentLicenseId",
830
+ type: "uint256"
831
+ }
832
+ ],
833
+ internalType: "struct Licensing.LicenseCreation",
834
+ name: "params_",
835
+ type: "tuple"
836
+ },
837
+ {
838
+ internalType: "uint256",
839
+ name: "ipaId_",
840
+ type: "uint256"
841
+ },
842
+ {
843
+ internalType: "bytes[]",
844
+ name: "preHooksData_",
845
+ type: "bytes[]"
846
+ },
847
+ {
848
+ internalType: "bytes[]",
849
+ name: "postHooksData_",
850
+ type: "bytes[]"
851
+ }
852
+ ],
853
+ name: "createIpaBoundLicense",
854
+ outputs: [
855
+ {
856
+ internalType: "uint256",
857
+ name: "",
858
+ type: "uint256"
859
+ }
860
+ ],
861
+ stateMutability: "nonpayable",
862
+ type: "function"
863
+ },
864
+ {
865
+ inputs: [
866
+ {
867
+ internalType: "address",
868
+ name: "ipOrg_",
869
+ type: "address"
870
+ },
871
+ {
872
+ components: [
873
+ {
874
+ internalType: "bool",
875
+ name: "isCommercial",
876
+ type: "bool"
877
+ },
878
+ {
879
+ internalType: "uint256",
880
+ name: "parentLicenseId",
881
+ type: "uint256"
882
+ }
883
+ ],
884
+ internalType: "struct Licensing.LicenseCreation",
885
+ name: "params_",
886
+ type: "tuple"
887
+ },
888
+ {
889
+ internalType: "address",
890
+ name: "licensee_",
891
+ type: "address"
892
+ },
893
+ {
894
+ internalType: "bytes[]",
895
+ name: "preHooksData_",
896
+ type: "bytes[]"
897
+ },
898
+ {
899
+ internalType: "bytes[]",
900
+ name: "postHooksData_",
901
+ type: "bytes[]"
902
+ }
903
+ ],
904
+ name: "createLicenseNft",
905
+ outputs: [
906
+ {
907
+ internalType: "uint256",
908
+ name: "",
909
+ type: "uint256"
910
+ }
911
+ ],
912
+ stateMutability: "nonpayable",
913
+ type: "function"
914
+ },
915
+ {
916
+ inputs: [
917
+ {
918
+ internalType: "address",
919
+ name: "ipOrg_",
920
+ type: "address"
921
+ },
922
+ {
923
+ components: [
924
+ {
925
+ internalType: "string",
926
+ name: "relType",
927
+ type: "string"
928
+ },
929
+ {
930
+ internalType: "address",
931
+ name: "srcAddress",
932
+ type: "address"
933
+ },
934
+ {
935
+ internalType: "uint256",
936
+ name: "srcId",
937
+ type: "uint256"
938
+ },
939
+ {
940
+ internalType: "address",
941
+ name: "dstAddress",
942
+ type: "address"
943
+ },
944
+ {
945
+ internalType: "uint256",
946
+ name: "dstId",
947
+ type: "uint256"
948
+ }
949
+ ],
950
+ internalType: "struct LibRelationship.CreateRelationshipParams",
951
+ name: "params_",
952
+ type: "tuple"
953
+ },
954
+ {
955
+ internalType: "bytes[]",
956
+ name: "preHooksData_",
957
+ type: "bytes[]"
958
+ },
959
+ {
960
+ internalType: "bytes[]",
961
+ name: "postHooksData_",
962
+ type: "bytes[]"
963
+ }
964
+ ],
965
+ name: "createRelationship",
966
+ outputs: [
967
+ {
968
+ internalType: "uint256",
969
+ name: "relId",
970
+ type: "uint256"
971
+ }
972
+ ],
973
+ stateMutability: "nonpayable",
974
+ type: "function"
975
+ },
976
+ {
977
+ inputs: [
978
+ {
979
+ internalType: "bytes[]",
980
+ name: "data",
981
+ type: "bytes[]"
982
+ }
983
+ ],
984
+ name: "multicall",
985
+ outputs: [
986
+ {
987
+ internalType: "bytes[]",
988
+ name: "results",
989
+ type: "bytes[]"
990
+ }
991
+ ],
992
+ stateMutability: "nonpayable",
993
+ type: "function"
994
+ },
995
+ {
996
+ inputs: [
997
+ {
998
+ internalType: "address",
999
+ name: "ipOrg_",
1000
+ type: "address"
1001
+ },
1002
+ {
1003
+ components: [
1004
+ {
1005
+ internalType: "address",
1006
+ name: "owner",
1007
+ type: "address"
1008
+ },
1009
+ {
1010
+ internalType: "uint8",
1011
+ name: "ipOrgAssetType",
1012
+ type: "uint8"
1013
+ },
1014
+ {
1015
+ internalType: "string",
1016
+ name: "name",
1017
+ type: "string"
1018
+ },
1019
+ {
1020
+ internalType: "bytes32",
1021
+ name: "hash",
1022
+ type: "bytes32"
1023
+ },
1024
+ {
1025
+ internalType: "string",
1026
+ name: "mediaUrl",
1027
+ type: "string"
1028
+ }
1029
+ ],
1030
+ internalType: "struct Registration.RegisterIPAssetParams",
1031
+ name: "params_",
1032
+ type: "tuple"
1033
+ },
1034
+ {
1035
+ internalType: "bytes[]",
1036
+ name: "preHooksData_",
1037
+ type: "bytes[]"
1038
+ },
1039
+ {
1040
+ internalType: "bytes[]",
1041
+ name: "postHooksData_",
1042
+ type: "bytes[]"
1043
+ }
1044
+ ],
1045
+ name: "registerIPAsset",
1046
+ outputs: [
1047
+ {
1048
+ internalType: "uint256",
1049
+ name: "",
1050
+ type: "uint256"
1051
+ },
1052
+ {
1053
+ internalType: "uint256",
1054
+ name: "",
1055
+ type: "uint256"
1056
+ }
1057
+ ],
1058
+ stateMutability: "nonpayable",
1059
+ type: "function"
1060
+ },
1061
+ {
1062
+ inputs: [
1063
+ {
1064
+ internalType: "address",
1065
+ name: "owner_",
1066
+ type: "address"
1067
+ },
1068
+ {
1069
+ internalType: "string",
1070
+ name: "name_",
1071
+ type: "string"
1072
+ },
1073
+ {
1074
+ internalType: "string",
1075
+ name: "symbol_",
1076
+ type: "string"
1077
+ },
1078
+ {
1079
+ internalType: "string[]",
1080
+ name: "ipAssetTypes_",
1081
+ type: "string[]"
1082
+ }
1083
+ ],
1084
+ name: "registerIpOrg",
1085
+ outputs: [
1086
+ {
1087
+ internalType: "address",
1088
+ name: "ipOrg_",
1089
+ type: "address"
1090
+ }
1091
+ ],
1092
+ stateMutability: "nonpayable",
1093
+ type: "function"
1094
+ },
1095
+ {
1096
+ inputs: [
1097
+ {
1098
+ internalType: "address",
1099
+ name: "ipOrg_",
1100
+ type: "address"
1101
+ },
1102
+ {
1103
+ internalType: "string",
1104
+ name: "relType",
1105
+ type: "string"
1106
+ }
1107
+ ],
1108
+ name: "removeRelationshipType",
1109
+ outputs: [
1110
+ ],
1111
+ stateMutability: "nonpayable",
1112
+ type: "function"
1113
+ },
1114
+ {
1115
+ inputs: [
1116
+ {
1117
+ internalType: "address",
1118
+ name: "ipOrg_",
1119
+ type: "address"
1120
+ },
1121
+ {
1122
+ internalType: "string",
1123
+ name: "baseURI_",
1124
+ type: "string"
1125
+ },
1126
+ {
1127
+ internalType: "string",
1128
+ name: "contractURI_",
1129
+ type: "string"
1130
+ }
1131
+ ],
1132
+ name: "setMetadata",
1133
+ outputs: [
1134
+ ],
1135
+ stateMutability: "nonpayable",
1136
+ type: "function"
1137
+ },
1138
+ {
1139
+ inputs: [
1140
+ {
1141
+ internalType: "address",
1142
+ name: "ipOrg_",
1143
+ type: "address"
1144
+ },
1145
+ {
1146
+ internalType: "address",
1147
+ name: "from_",
1148
+ type: "address"
1149
+ },
1150
+ {
1151
+ internalType: "address",
1152
+ name: "to_",
1153
+ type: "address"
1154
+ },
1155
+ {
1156
+ internalType: "uint256",
1157
+ name: "ipAssetId_",
1158
+ type: "uint256"
1159
+ },
1160
+ {
1161
+ internalType: "bytes[]",
1162
+ name: "preHooksData_",
1163
+ type: "bytes[]"
1164
+ },
1165
+ {
1166
+ internalType: "bytes[]",
1167
+ name: "postHooksData_",
1168
+ type: "bytes[]"
1169
+ }
1170
+ ],
1171
+ name: "transferIPAsset",
1172
+ outputs: [
1173
+ ],
1174
+ stateMutability: "nonpayable",
1175
+ type: "function"
1176
+ }
1177
+ ];
1178
+
598
1179
  if (typeof process !== "undefined") {
599
1180
  dotenv.config();
600
1181
  }
601
- var storyProtocolAbi = [{
602
- inputs: [{
603
- internalType: "address",
604
- name: "owner_",
605
- type: "address"
606
- }, {
607
- internalType: "string",
608
- name: "name_",
609
- type: "string"
610
- }, {
611
- internalType: "string",
612
- name: "symbol_",
613
- type: "string"
614
- }, {
615
- internalType: "string[]",
616
- name: "ipAssetTypes_",
617
- type: "string[]"
618
- }],
619
- name: "registerIpOrg",
620
- outputs: [{
621
- internalType: "address",
622
- name: "ipOrg_",
623
- type: "address"
624
- }],
625
- stateMutability: "nonpayable",
626
- type: "function"
627
- }, {
628
- inputs: [{
629
- internalType: "address",
630
- name: "ipOrg_",
631
- type: "address"
632
- }, {
633
- components: [{
634
- internalType: "bool",
635
- name: "isCommercial",
636
- type: "bool"
637
- }, {
638
- internalType: "uint256",
639
- name: "parentLicenseId",
640
- type: "uint256"
641
- }],
642
- internalType: "struct Licensing.LicenseCreation",
643
- name: "params_",
644
- type: "tuple"
645
- }, {
646
- internalType: "address",
647
- name: "licensee_",
648
- type: "address"
649
- }, {
650
- internalType: "bytes[]",
651
- name: "preHooksData_",
652
- type: "bytes[]"
653
- }, {
654
- internalType: "bytes[]",
655
- name: "postHooksData_",
656
- type: "bytes[]"
657
- }],
658
- name: "createLicenseNft",
659
- outputs: [{
660
- internalType: "uint256",
661
- name: "",
662
- type: "uint256"
663
- }],
664
- stateMutability: "nonpayable",
665
- type: "function"
666
- }, {
667
- inputs: [{
668
- internalType: "address",
669
- name: "ipOrg_",
670
- type: "address"
671
- }, {
672
- components: [{
673
- internalType: "bool",
674
- name: "isCommercial",
675
- type: "bool"
676
- }, {
677
- internalType: "uint256",
678
- name: "parentLicenseId",
679
- type: "uint256"
680
- }],
681
- internalType: "struct Licensing.LicenseCreation",
682
- name: "params_",
683
- type: "tuple"
684
- }, {
685
- internalType: "uint256",
686
- name: "ipaId_",
687
- type: "uint256"
688
- }, {
689
- internalType: "bytes[]",
690
- name: "preHooksData_",
691
- type: "bytes[]"
692
- }, {
693
- internalType: "bytes[]",
694
- name: "postHooksData_",
695
- type: "bytes[]"
696
- }],
697
- name: "createIpaBoundLicense",
698
- outputs: [{
699
- internalType: "uint256",
700
- name: "",
701
- type: "uint256"
702
- }],
703
- stateMutability: "nonpayable",
704
- type: "function"
705
- }, {
706
- inputs: [{
707
- internalType: "address",
708
- name: "ipOrg_",
709
- type: "address"
710
- }, {
711
- components: [{
712
- internalType: "address",
713
- name: "owner",
714
- type: "address"
715
- }, {
716
- internalType: "string",
717
- name: "name",
718
- type: "string"
719
- }, {
720
- internalType: "uint64",
721
- name: "ipAssetType",
722
- type: "uint64"
723
- }, {
724
- internalType: "bytes32",
725
- name: "hash",
726
- type: "bytes32"
727
- }, {
728
- internalType: "string",
729
- name: "mediaUrl",
730
- type: "string"
731
- }],
732
- internalType: "struct Registration.RegisterIPAssetParams",
733
- name: "params_",
734
- type: "tuple"
735
- }, {
736
- internalType: "bytes[]",
737
- name: "preHooksData_",
738
- type: "bytes[]"
739
- }, {
740
- internalType: "bytes[]",
741
- name: "postHooksData_",
742
- type: "bytes[]"
743
- }],
744
- name: "registerIPAsset",
745
- outputs: [{
746
- internalType: "uint256",
747
- name: "",
748
- type: "uint256"
749
- }, {
750
- internalType: "uint256",
751
- name: "",
752
- type: "uint256"
753
- }],
754
- stateMutability: "nonpayable",
755
- type: "function"
756
- }, {
757
- inputs: [{
758
- components: [{
759
- internalType: "string",
760
- name: "relType",
761
- type: "string"
762
- }, {
763
- internalType: "address",
764
- name: "ipOrg",
765
- type: "address"
766
- }, {
767
- components: [{
768
- internalType: "enum LibRelationship.Relatables",
769
- name: "src",
770
- type: "uint8"
771
- }, {
772
- internalType: "enum LibRelationship.Relatables",
773
- name: "dst",
774
- type: "uint8"
775
- }],
776
- internalType: "struct LibRelationship.RelatedElements",
777
- name: "allowedElements",
778
- type: "tuple"
779
- }, {
780
- internalType: "uint8[]",
781
- name: "allowedSrcs",
782
- type: "uint8[]"
783
- }, {
784
- internalType: "uint8[]",
785
- name: "allowedDsts",
786
- type: "uint8[]"
787
- }],
788
- internalType: "struct LibRelationship.AddRelationshipTypeParams",
789
- name: "params_",
790
- type: "tuple"
791
- }],
792
- name: "addRelationshipType",
793
- outputs: [],
794
- stateMutability: "nonpayable",
795
- type: "function"
796
- }, {
797
- inputs: [{
798
- internalType: "address",
799
- name: "ipOrg_",
800
- type: "address"
801
- }, {
802
- components: [{
803
- internalType: "string",
804
- name: "relType",
805
- type: "string"
806
- }, {
807
- internalType: "address",
808
- name: "srcAddress",
809
- type: "address"
810
- }, {
811
- internalType: "uint256",
812
- name: "srcId",
813
- type: "uint256"
814
- }, {
815
- internalType: "uint8",
816
- name: "srcType",
817
- type: "uint8"
818
- }, {
819
- internalType: "address",
820
- name: "dstAddress",
821
- type: "address"
822
- }, {
823
- internalType: "uint256",
824
- name: "dstId",
825
- type: "uint256"
826
- }, {
827
- internalType: "uint8",
828
- name: "dstType",
829
- type: "uint8"
830
- }],
831
- internalType: "struct LibRelationship.CreateRelationshipParams",
832
- name: "params_",
833
- type: "tuple"
834
- }, {
835
- internalType: "bytes[]",
836
- name: "preHooksData_",
837
- type: "bytes[]"
838
- }, {
839
- internalType: "bytes[]",
840
- name: "postHooksData_",
841
- type: "bytes[]"
842
- }],
843
- name: "createRelationship",
844
- outputs: [{
845
- internalType: "uint256",
846
- name: "relId",
847
- type: "uint256"
848
- }],
849
- stateMutability: "nonpayable",
850
- type: "function"
851
- }, {
852
- inputs: [{
853
- internalType: "address",
854
- name: "ipOrg_",
855
- type: "address"
856
- }, {
857
- internalType: "string",
858
- name: "relType",
859
- type: "string"
860
- }],
861
- name: "removeRelationshipType",
862
- outputs: [],
863
- stateMutability: "nonpayable",
864
- type: "function"
865
- }];
1182
+ var storyProtocolAbi = storyProtocolJson;
866
1183
  var storyProtocolReadable = formatAbi(storyProtocolAbi);
867
1184
  var storyProtocolConfig = {
868
1185
  abi: parseAbi(storyProtocolReadable),
869
1186
  address: getAddress(process.env.STORY_PROTOCOL_CONTRACT || process.env.NEXT_PUBLIC_STORY_PROTOCOL_CONTRACT || "")
870
1187
  };
871
1188
 
1189
+ var ipOrgControllerRawAbi = [
1190
+ {
1191
+ inputs: [
1192
+ {
1193
+ internalType: "address",
1194
+ name: "moduleRegistry_",
1195
+ type: "address"
1196
+ }
1197
+ ],
1198
+ stateMutability: "nonpayable",
1199
+ type: "constructor"
1200
+ },
1201
+ {
1202
+ inputs: [
1203
+ ],
1204
+ name: "IPOrgController_IPOrgNonExistent",
1205
+ type: "error"
1206
+ },
1207
+ {
1208
+ inputs: [
1209
+ ],
1210
+ name: "IPOrgController_InvalidIPOrgOwner",
1211
+ type: "error"
1212
+ },
1213
+ {
1214
+ inputs: [
1215
+ ],
1216
+ name: "IPOrgController_InvalidNewIPOrgOwner",
1217
+ type: "error"
1218
+ },
1219
+ {
1220
+ inputs: [
1221
+ ],
1222
+ name: "IPOrgController_OwnerTransferUninitialized",
1223
+ type: "error"
1224
+ },
1225
+ {
1226
+ inputs: [
1227
+ {
1228
+ internalType: "bytes32",
1229
+ name: "role",
1230
+ type: "bytes32"
1231
+ },
1232
+ {
1233
+ internalType: "address",
1234
+ name: "account",
1235
+ type: "address"
1236
+ }
1237
+ ],
1238
+ name: "MissingRole",
1239
+ type: "error"
1240
+ },
1241
+ {
1242
+ inputs: [
1243
+ {
1244
+ internalType: "string",
1245
+ name: "name",
1246
+ type: "string"
1247
+ }
1248
+ ],
1249
+ name: "UnsupportedInterface",
1250
+ type: "error"
1251
+ },
1252
+ {
1253
+ inputs: [
1254
+ ],
1255
+ name: "ZeroAddress",
1256
+ type: "error"
1257
+ },
1258
+ {
1259
+ anonymous: false,
1260
+ inputs: [
1261
+ {
1262
+ indexed: true,
1263
+ internalType: "address",
1264
+ name: "accessControl",
1265
+ type: "address"
1266
+ }
1267
+ ],
1268
+ name: "AccessControlUpdated",
1269
+ type: "event"
1270
+ },
1271
+ {
1272
+ anonymous: false,
1273
+ inputs: [
1274
+ {
1275
+ indexed: false,
1276
+ internalType: "address",
1277
+ name: "previousAdmin",
1278
+ type: "address"
1279
+ },
1280
+ {
1281
+ indexed: false,
1282
+ internalType: "address",
1283
+ name: "newAdmin",
1284
+ type: "address"
1285
+ }
1286
+ ],
1287
+ name: "AdminChanged",
1288
+ type: "event"
1289
+ },
1290
+ {
1291
+ anonymous: false,
1292
+ inputs: [
1293
+ {
1294
+ indexed: true,
1295
+ internalType: "address",
1296
+ name: "beacon",
1297
+ type: "address"
1298
+ }
1299
+ ],
1300
+ name: "BeaconUpgraded",
1301
+ type: "event"
1302
+ },
1303
+ {
1304
+ anonymous: false,
1305
+ inputs: [
1306
+ {
1307
+ indexed: false,
1308
+ internalType: "address",
1309
+ name: "ipOrg",
1310
+ type: "address"
1311
+ },
1312
+ {
1313
+ indexed: false,
1314
+ internalType: "address",
1315
+ name: "pendingOwner",
1316
+ type: "address"
1317
+ }
1318
+ ],
1319
+ name: "IPOrgPendingOwnerSet",
1320
+ type: "event"
1321
+ },
1322
+ {
1323
+ anonymous: false,
1324
+ inputs: [
1325
+ {
1326
+ indexed: false,
1327
+ internalType: "address",
1328
+ name: "owner",
1329
+ type: "address"
1330
+ },
1331
+ {
1332
+ indexed: false,
1333
+ internalType: "address",
1334
+ name: "ipAssetOrg",
1335
+ type: "address"
1336
+ },
1337
+ {
1338
+ indexed: false,
1339
+ internalType: "string",
1340
+ name: "name",
1341
+ type: "string"
1342
+ },
1343
+ {
1344
+ indexed: false,
1345
+ internalType: "string",
1346
+ name: "symbol",
1347
+ type: "string"
1348
+ },
1349
+ {
1350
+ indexed: false,
1351
+ internalType: "string[]",
1352
+ name: "ipAssetTypes",
1353
+ type: "string[]"
1354
+ }
1355
+ ],
1356
+ name: "IPOrgRegistered",
1357
+ type: "event"
1358
+ },
1359
+ {
1360
+ anonymous: false,
1361
+ inputs: [
1362
+ {
1363
+ indexed: false,
1364
+ internalType: "address",
1365
+ name: "ipOrg",
1366
+ type: "address"
1367
+ },
1368
+ {
1369
+ indexed: false,
1370
+ internalType: "address",
1371
+ name: "prevOwner",
1372
+ type: "address"
1373
+ },
1374
+ {
1375
+ indexed: false,
1376
+ internalType: "address",
1377
+ name: "newOwner",
1378
+ type: "address"
1379
+ }
1380
+ ],
1381
+ name: "IPOrgTransferred",
1382
+ type: "event"
1383
+ },
1384
+ {
1385
+ anonymous: false,
1386
+ inputs: [
1387
+ {
1388
+ indexed: false,
1389
+ internalType: "uint8",
1390
+ name: "version",
1391
+ type: "uint8"
1392
+ }
1393
+ ],
1394
+ name: "Initialized",
1395
+ type: "event"
1396
+ },
1397
+ {
1398
+ anonymous: false,
1399
+ inputs: [
1400
+ {
1401
+ indexed: true,
1402
+ internalType: "address",
1403
+ name: "implementation",
1404
+ type: "address"
1405
+ }
1406
+ ],
1407
+ name: "Upgraded",
1408
+ type: "event"
1409
+ },
1410
+ {
1411
+ inputs: [
1412
+ ],
1413
+ name: "IP_ORG_IMPL",
1414
+ outputs: [
1415
+ {
1416
+ internalType: "address",
1417
+ name: "",
1418
+ type: "address"
1419
+ }
1420
+ ],
1421
+ stateMutability: "view",
1422
+ type: "function"
1423
+ },
1424
+ {
1425
+ inputs: [
1426
+ ],
1427
+ name: "MODULE_REGISTRY",
1428
+ outputs: [
1429
+ {
1430
+ internalType: "address",
1431
+ name: "",
1432
+ type: "address"
1433
+ }
1434
+ ],
1435
+ stateMutability: "view",
1436
+ type: "function"
1437
+ },
1438
+ {
1439
+ inputs: [
1440
+ {
1441
+ internalType: "address",
1442
+ name: "ipOrg_",
1443
+ type: "address"
1444
+ }
1445
+ ],
1446
+ name: "acceptOwnerTransfer",
1447
+ outputs: [
1448
+ ],
1449
+ stateMutability: "nonpayable",
1450
+ type: "function"
1451
+ },
1452
+ {
1453
+ inputs: [
1454
+ {
1455
+ internalType: "address",
1456
+ name: "ipOrg_",
1457
+ type: "address"
1458
+ }
1459
+ ],
1460
+ name: "cancelOwnerTransfer",
1461
+ outputs: [
1462
+ ],
1463
+ stateMutability: "nonpayable",
1464
+ type: "function"
1465
+ },
1466
+ {
1467
+ inputs: [
1468
+ ],
1469
+ name: "getAccessControl",
1470
+ outputs: [
1471
+ {
1472
+ internalType: "address",
1473
+ name: "",
1474
+ type: "address"
1475
+ }
1476
+ ],
1477
+ stateMutability: "view",
1478
+ type: "function"
1479
+ },
1480
+ {
1481
+ inputs: [
1482
+ {
1483
+ internalType: "address",
1484
+ name: "accessControl_",
1485
+ type: "address"
1486
+ }
1487
+ ],
1488
+ name: "initialize",
1489
+ outputs: [
1490
+ ],
1491
+ stateMutability: "nonpayable",
1492
+ type: "function"
1493
+ },
1494
+ {
1495
+ inputs: [
1496
+ {
1497
+ internalType: "address",
1498
+ name: "ipOrg_",
1499
+ type: "address"
1500
+ }
1501
+ ],
1502
+ name: "isIpOrg",
1503
+ outputs: [
1504
+ {
1505
+ internalType: "bool",
1506
+ name: "",
1507
+ type: "bool"
1508
+ }
1509
+ ],
1510
+ stateMutability: "view",
1511
+ type: "function"
1512
+ },
1513
+ {
1514
+ inputs: [
1515
+ {
1516
+ internalType: "address",
1517
+ name: "ipOrg_",
1518
+ type: "address"
1519
+ }
1520
+ ],
1521
+ name: "ownerOf",
1522
+ outputs: [
1523
+ {
1524
+ internalType: "address",
1525
+ name: "",
1526
+ type: "address"
1527
+ }
1528
+ ],
1529
+ stateMutability: "view",
1530
+ type: "function"
1531
+ },
1532
+ {
1533
+ inputs: [
1534
+ {
1535
+ internalType: "address",
1536
+ name: "ipOrg_",
1537
+ type: "address"
1538
+ }
1539
+ ],
1540
+ name: "pendingOwnerOf",
1541
+ outputs: [
1542
+ {
1543
+ internalType: "address",
1544
+ name: "pendingOwner",
1545
+ type: "address"
1546
+ }
1547
+ ],
1548
+ stateMutability: "view",
1549
+ type: "function"
1550
+ },
1551
+ {
1552
+ inputs: [
1553
+ ],
1554
+ name: "proxiableUUID",
1555
+ outputs: [
1556
+ {
1557
+ internalType: "bytes32",
1558
+ name: "",
1559
+ type: "bytes32"
1560
+ }
1561
+ ],
1562
+ stateMutability: "view",
1563
+ type: "function"
1564
+ },
1565
+ {
1566
+ inputs: [
1567
+ {
1568
+ internalType: "address",
1569
+ name: "owner_",
1570
+ type: "address"
1571
+ },
1572
+ {
1573
+ internalType: "string",
1574
+ name: "name_",
1575
+ type: "string"
1576
+ },
1577
+ {
1578
+ internalType: "string",
1579
+ name: "symbol_",
1580
+ type: "string"
1581
+ },
1582
+ {
1583
+ internalType: "string[]",
1584
+ name: "ipAssetTypes_",
1585
+ type: "string[]"
1586
+ }
1587
+ ],
1588
+ name: "registerIpOrg",
1589
+ outputs: [
1590
+ {
1591
+ internalType: "address",
1592
+ name: "ipOrg_",
1593
+ type: "address"
1594
+ }
1595
+ ],
1596
+ stateMutability: "nonpayable",
1597
+ type: "function"
1598
+ },
1599
+ {
1600
+ inputs: [
1601
+ {
1602
+ internalType: "address",
1603
+ name: "accessControl_",
1604
+ type: "address"
1605
+ }
1606
+ ],
1607
+ name: "setAccessControl",
1608
+ outputs: [
1609
+ ],
1610
+ stateMutability: "nonpayable",
1611
+ type: "function"
1612
+ },
1613
+ {
1614
+ inputs: [
1615
+ {
1616
+ internalType: "address",
1617
+ name: "ipOrg_",
1618
+ type: "address"
1619
+ },
1620
+ {
1621
+ internalType: "address",
1622
+ name: "newOwner_",
1623
+ type: "address"
1624
+ }
1625
+ ],
1626
+ name: "transferOwner",
1627
+ outputs: [
1628
+ ],
1629
+ stateMutability: "nonpayable",
1630
+ type: "function"
1631
+ },
1632
+ {
1633
+ inputs: [
1634
+ {
1635
+ internalType: "address",
1636
+ name: "newImplementation",
1637
+ type: "address"
1638
+ }
1639
+ ],
1640
+ name: "upgradeTo",
1641
+ outputs: [
1642
+ ],
1643
+ stateMutability: "nonpayable",
1644
+ type: "function"
1645
+ },
1646
+ {
1647
+ inputs: [
1648
+ {
1649
+ internalType: "address",
1650
+ name: "newImplementation",
1651
+ type: "address"
1652
+ },
1653
+ {
1654
+ internalType: "bytes",
1655
+ name: "data",
1656
+ type: "bytes"
1657
+ }
1658
+ ],
1659
+ name: "upgradeToAndCall",
1660
+ outputs: [
1661
+ ],
1662
+ stateMutability: "payable",
1663
+ type: "function"
1664
+ }
1665
+ ];
1666
+
872
1667
  if (typeof process !== "undefined") {
873
1668
  dotenv.config();
874
1669
  }
875
- var ipOrgControllerAbi = [{
876
- anonymous: false,
877
- inputs: [{
878
- indexed: false,
879
- internalType: "address",
880
- name: "owner_",
881
- type: "address"
882
- }, {
883
- indexed: false,
884
- internalType: "address",
885
- name: "ipAssetOrg_",
886
- type: "address"
887
- }, {
888
- indexed: false,
889
- internalType: "string",
890
- name: "name_",
891
- type: "string"
892
- }, {
893
- indexed: false,
894
- internalType: "string",
895
- name: "symbol_",
896
- type: "string"
897
- }],
898
- name: "IPOrgRegistered",
899
- type: "event"
900
- }];
1670
+ var ipOrgControllerAbi = ipOrgControllerRawAbi;
901
1671
  var ipOrgControllerReadable = formatAbi(ipOrgControllerAbi);
902
1672
  var ipOrgControllerConfig = {
903
1673
  abi: parseAbi(ipOrgControllerReadable),
@@ -1067,6 +1837,14 @@ function _waitTxAndFilterLog() {
1067
1837
  }));
1068
1838
  return _waitTxAndFilterLog.apply(this, arguments);
1069
1839
  }
1840
+ var dictToQueryParams = function dictToQueryParams(params) {
1841
+ var queryParamList = [];
1842
+ for (var key in params) {
1843
+ var value = params[key];
1844
+ queryParamList.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value)));
1845
+ }
1846
+ return queryParamList.join("&");
1847
+ };
1070
1848
 
1071
1849
  /**
1072
1850
  * IPOrgClient allows you to create, update, view, search IPOrgs on
@@ -1101,7 +1879,7 @@ var IPOrgClient = /*#__PURE__*/function (_IPOrgReadOnlyClient) {
1101
1879
  _context.next = 3;
1102
1880
  return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, storyProtocolConfig), {}, {
1103
1881
  functionName: "registerIpOrg",
1104
- args: [getAddress(request.owner || zeroAddress), request.name, request.symbol, request.ipAssetTypes],
1882
+ args: [getAddress(request.owner || this.wallet.account.address), request.name, request.symbol, request.ipAssetTypes],
1105
1883
  account: this.wallet.account
1106
1884
  }));
1107
1885
  case 3:
@@ -1123,7 +1901,7 @@ var IPOrgClient = /*#__PURE__*/function (_IPOrgReadOnlyClient) {
1123
1901
  targetLog = _context.sent;
1124
1902
  return _context.abrupt("return", {
1125
1903
  txHash: txHash,
1126
- ipOrgId: targetLog.args.ipAssetOrg_
1904
+ ipOrgId: String(targetLog === null || targetLog === void 0 ? void 0 : targetLog.args["ipAssetOrg"])
1127
1905
  });
1128
1906
  case 15:
1129
1907
  return _context.abrupt("return", {
@@ -1310,20 +2088,23 @@ var IPAssetReadOnlyClient = /*#__PURE__*/function () {
1310
2088
  while (1) switch (_context2.prev = _context2.next) {
1311
2089
  case 0:
1312
2090
  _context2.prev = 0;
1313
- _context2.next = 3;
2091
+ if (!request) {
2092
+ request = {};
2093
+ }
2094
+ _context2.next = 4;
1314
2095
  return this.httpClient.post("/protocol/ipasset", request);
1315
- case 3:
2096
+ case 4:
1316
2097
  response = _context2.sent;
1317
2098
  return _context2.abrupt("return", response.data);
1318
- case 7:
1319
- _context2.prev = 7;
2099
+ case 8:
2100
+ _context2.prev = 8;
1320
2101
  _context2.t0 = _context2["catch"](0);
1321
2102
  handleError(_context2.t0, "Failed to list IP Asset.");
1322
- case 10:
2103
+ case 11:
1323
2104
  case "end":
1324
2105
  return _context2.stop();
1325
2106
  }
1326
- }, _callee2, this, [[0, 7]]);
2107
+ }, _callee2, this, [[0, 8]]);
1327
2108
  }));
1328
2109
  function list(_x2) {
1329
2110
  return _list.apply(this, arguments);
@@ -1334,55 +2115,997 @@ var IPAssetReadOnlyClient = /*#__PURE__*/function () {
1334
2115
  return IPAssetReadOnlyClient;
1335
2116
  }();
1336
2117
 
2118
+ var registrationModuleJson = [
2119
+ {
2120
+ inputs: [
2121
+ {
2122
+ components: [
2123
+ {
2124
+ internalType: "contract IPAssetRegistry",
2125
+ name: "ipaRegistry",
2126
+ type: "address"
2127
+ },
2128
+ {
2129
+ internalType: "contract ModuleRegistry",
2130
+ name: "moduleRegistry",
2131
+ type: "address"
2132
+ },
2133
+ {
2134
+ internalType: "contract LicenseRegistry",
2135
+ name: "licenseRegistry",
2136
+ type: "address"
2137
+ },
2138
+ {
2139
+ internalType: "contract IPOrgController",
2140
+ name: "ipOrgController",
2141
+ type: "address"
2142
+ }
2143
+ ],
2144
+ internalType: "struct BaseModule.ModuleConstruction",
2145
+ name: "params_",
2146
+ type: "tuple"
2147
+ },
2148
+ {
2149
+ internalType: "address",
2150
+ name: "accessControl_",
2151
+ type: "address"
2152
+ }
2153
+ ],
2154
+ stateMutability: "nonpayable",
2155
+ type: "constructor"
2156
+ },
2157
+ {
2158
+ inputs: [
2159
+ {
2160
+ internalType: "uint8",
2161
+ name: "hookType",
2162
+ type: "uint8"
2163
+ }
2164
+ ],
2165
+ name: "BaseModule_HooksParamsLengthMismatch",
2166
+ type: "error"
2167
+ },
2168
+ {
2169
+ inputs: [
2170
+ ],
2171
+ name: "BaseModule_OnlyModuleRegistry",
2172
+ type: "error"
2173
+ },
2174
+ {
2175
+ inputs: [
2176
+ ],
2177
+ name: "BaseModule_ZeroIpaRegistry",
2178
+ type: "error"
2179
+ },
2180
+ {
2181
+ inputs: [
2182
+ ],
2183
+ name: "BaseModule_ZeroLicenseRegistry",
2184
+ type: "error"
2185
+ },
2186
+ {
2187
+ inputs: [
2188
+ ],
2189
+ name: "BaseModule_ZeroModuleRegistry",
2190
+ type: "error"
2191
+ },
2192
+ {
2193
+ inputs: [
2194
+ ],
2195
+ name: "HookRegistry_CallerNotIPOrgOwner",
2196
+ type: "error"
2197
+ },
2198
+ {
2199
+ inputs: [
2200
+ ],
2201
+ name: "HookRegistry_HooksConfigLengthMismatch",
2202
+ type: "error"
2203
+ },
2204
+ {
2205
+ inputs: [
2206
+ {
2207
+ internalType: "uint256",
2208
+ name: "hooksIndex",
2209
+ type: "uint256"
2210
+ }
2211
+ ],
2212
+ name: "HookRegistry_IndexOutOfBounds",
2213
+ type: "error"
2214
+ },
2215
+ {
2216
+ inputs: [
2217
+ ],
2218
+ name: "HookRegistry_MaxHooksExceeded",
2219
+ type: "error"
2220
+ },
2221
+ {
2222
+ inputs: [
2223
+ ],
2224
+ name: "HookRegistry_RegisteringDuplicatedHook",
2225
+ type: "error"
2226
+ },
2227
+ {
2228
+ inputs: [
2229
+ ],
2230
+ name: "HookRegistry_RegisteringZeroAddressHook",
2231
+ type: "error"
2232
+ },
2233
+ {
2234
+ inputs: [
2235
+ {
2236
+ internalType: "bytes32",
2237
+ name: "role",
2238
+ type: "bytes32"
2239
+ },
2240
+ {
2241
+ internalType: "address",
2242
+ name: "account",
2243
+ type: "address"
2244
+ }
2245
+ ],
2246
+ name: "MissingRole",
2247
+ type: "error"
2248
+ },
2249
+ {
2250
+ inputs: [
2251
+ ],
2252
+ name: "RegistrationModule_IPAssetNonExistent",
2253
+ type: "error"
2254
+ },
2255
+ {
2256
+ inputs: [
2257
+ ],
2258
+ name: "RegistrationModule_IPOrgNotConfigured",
2259
+ type: "error"
2260
+ },
2261
+ {
2262
+ inputs: [
2263
+ ],
2264
+ name: "RegistrationModule_InvalidCaller",
2265
+ type: "error"
2266
+ },
2267
+ {
2268
+ inputs: [
2269
+ ],
2270
+ name: "RegistrationModule_InvalidConfigOperation",
2271
+ type: "error"
2272
+ },
2273
+ {
2274
+ inputs: [
2275
+ ],
2276
+ name: "RegistrationModule_InvalidExecutionOperation",
2277
+ type: "error"
2278
+ },
2279
+ {
2280
+ inputs: [
2281
+ ],
2282
+ name: "RegistrationModule_InvalidIPAssetType",
2283
+ type: "error"
2284
+ },
2285
+ {
2286
+ inputs: [
2287
+ ],
2288
+ name: "RegistrationModule_TooManyAssetTypes",
2289
+ type: "error"
2290
+ },
2291
+ {
2292
+ inputs: [
2293
+ ],
2294
+ name: "Unauthorized",
2295
+ type: "error"
2296
+ },
2297
+ {
2298
+ inputs: [
2299
+ {
2300
+ internalType: "string",
2301
+ name: "name",
2302
+ type: "string"
2303
+ }
2304
+ ],
2305
+ name: "UnsupportedInterface",
2306
+ type: "error"
2307
+ },
2308
+ {
2309
+ inputs: [
2310
+ ],
2311
+ name: "ZeroAddress",
2312
+ type: "error"
2313
+ },
2314
+ {
2315
+ anonymous: false,
2316
+ inputs: [
2317
+ {
2318
+ indexed: true,
2319
+ internalType: "address",
2320
+ name: "accessControl",
2321
+ type: "address"
2322
+ }
2323
+ ],
2324
+ name: "AccessControlUpdated",
2325
+ type: "event"
2326
+ },
2327
+ {
2328
+ anonymous: false,
2329
+ inputs: [
2330
+ {
2331
+ indexed: true,
2332
+ internalType: "enum HookRegistry.HookType",
2333
+ name: "hType",
2334
+ type: "uint8"
2335
+ },
2336
+ {
2337
+ indexed: true,
2338
+ internalType: "bytes32",
2339
+ name: "registryKey",
2340
+ type: "bytes32"
2341
+ }
2342
+ ],
2343
+ name: "HooksCleared",
2344
+ type: "event"
2345
+ },
2346
+ {
2347
+ anonymous: false,
2348
+ inputs: [
2349
+ {
2350
+ indexed: true,
2351
+ internalType: "enum HookRegistry.HookType",
2352
+ name: "hType",
2353
+ type: "uint8"
2354
+ },
2355
+ {
2356
+ indexed: true,
2357
+ internalType: "bytes32",
2358
+ name: "registryKey",
2359
+ type: "bytes32"
2360
+ },
2361
+ {
2362
+ indexed: false,
2363
+ internalType: "address[]",
2364
+ name: "hooks",
2365
+ type: "address[]"
2366
+ }
2367
+ ],
2368
+ name: "HooksRegistered",
2369
+ type: "event"
2370
+ },
2371
+ {
2372
+ anonymous: false,
2373
+ inputs: [
2374
+ {
2375
+ indexed: false,
2376
+ internalType: "uint256",
2377
+ name: "ipAssetId_",
2378
+ type: "uint256"
2379
+ },
2380
+ {
2381
+ indexed: true,
2382
+ internalType: "address",
2383
+ name: "ipOrg_",
2384
+ type: "address"
2385
+ },
2386
+ {
2387
+ indexed: false,
2388
+ internalType: "uint256",
2389
+ name: "ipOrgAssetId_",
2390
+ type: "uint256"
2391
+ },
2392
+ {
2393
+ indexed: true,
2394
+ internalType: "address",
2395
+ name: "owner_",
2396
+ type: "address"
2397
+ },
2398
+ {
2399
+ indexed: false,
2400
+ internalType: "string",
2401
+ name: "name_",
2402
+ type: "string"
2403
+ },
2404
+ {
2405
+ indexed: true,
2406
+ internalType: "uint8",
2407
+ name: "ipOrgAssetType_",
2408
+ type: "uint8"
2409
+ },
2410
+ {
2411
+ indexed: false,
2412
+ internalType: "bytes32",
2413
+ name: "hash_",
2414
+ type: "bytes32"
2415
+ },
2416
+ {
2417
+ indexed: false,
2418
+ internalType: "string",
2419
+ name: "mediaUrl_",
2420
+ type: "string"
2421
+ }
2422
+ ],
2423
+ name: "IPAssetRegistered",
2424
+ type: "event"
2425
+ },
2426
+ {
2427
+ anonymous: false,
2428
+ inputs: [
2429
+ {
2430
+ indexed: true,
2431
+ internalType: "uint256",
2432
+ name: "ipAssetId_",
2433
+ type: "uint256"
2434
+ },
2435
+ {
2436
+ indexed: true,
2437
+ internalType: "address",
2438
+ name: "ipOrg_",
2439
+ type: "address"
2440
+ },
2441
+ {
2442
+ indexed: false,
2443
+ internalType: "uint256",
2444
+ name: "ipOrgAssetId_",
2445
+ type: "uint256"
2446
+ },
2447
+ {
2448
+ indexed: false,
2449
+ internalType: "address",
2450
+ name: "prevOwner_",
2451
+ type: "address"
2452
+ },
2453
+ {
2454
+ indexed: false,
2455
+ internalType: "address",
2456
+ name: "newOwner_",
2457
+ type: "address"
2458
+ }
2459
+ ],
2460
+ name: "IPAssetTransferred",
2461
+ type: "event"
2462
+ },
2463
+ {
2464
+ anonymous: false,
2465
+ inputs: [
2466
+ {
2467
+ indexed: true,
2468
+ internalType: "address",
2469
+ name: "ipOrg_",
2470
+ type: "address"
2471
+ },
2472
+ {
2473
+ indexed: false,
2474
+ internalType: "string",
2475
+ name: "baseURI_",
2476
+ type: "string"
2477
+ },
2478
+ {
2479
+ indexed: false,
2480
+ internalType: "string",
2481
+ name: "contractURI_",
2482
+ type: "string"
2483
+ }
2484
+ ],
2485
+ name: "MetadataUpdated",
2486
+ type: "event"
2487
+ },
2488
+ {
2489
+ anonymous: false,
2490
+ inputs: [
2491
+ {
2492
+ indexed: true,
2493
+ internalType: "address",
2494
+ name: "sender",
2495
+ type: "address"
2496
+ }
2497
+ ],
2498
+ name: "RequestCompleted",
2499
+ type: "event"
2500
+ },
2501
+ {
2502
+ anonymous: false,
2503
+ inputs: [
2504
+ {
2505
+ indexed: true,
2506
+ internalType: "address",
2507
+ name: "sender",
2508
+ type: "address"
2509
+ }
2510
+ ],
2511
+ name: "RequestPending",
2512
+ type: "event"
2513
+ },
2514
+ {
2515
+ inputs: [
2516
+ ],
2517
+ name: "INDEX_NOT_FOUND",
2518
+ outputs: [
2519
+ {
2520
+ internalType: "uint256",
2521
+ name: "",
2522
+ type: "uint256"
2523
+ }
2524
+ ],
2525
+ stateMutability: "view",
2526
+ type: "function"
2527
+ },
2528
+ {
2529
+ inputs: [
2530
+ ],
2531
+ name: "IPA_REGISTRY",
2532
+ outputs: [
2533
+ {
2534
+ internalType: "contract IPAssetRegistry",
2535
+ name: "",
2536
+ type: "address"
2537
+ }
2538
+ ],
2539
+ stateMutability: "view",
2540
+ type: "function"
2541
+ },
2542
+ {
2543
+ inputs: [
2544
+ ],
2545
+ name: "IP_ORG_CONTROLLER",
2546
+ outputs: [
2547
+ {
2548
+ internalType: "contract IPOrgController",
2549
+ name: "",
2550
+ type: "address"
2551
+ }
2552
+ ],
2553
+ stateMutability: "view",
2554
+ type: "function"
2555
+ },
2556
+ {
2557
+ inputs: [
2558
+ ],
2559
+ name: "LICENSE_REGISTRY",
2560
+ outputs: [
2561
+ {
2562
+ internalType: "contract LicenseRegistry",
2563
+ name: "",
2564
+ type: "address"
2565
+ }
2566
+ ],
2567
+ stateMutability: "view",
2568
+ type: "function"
2569
+ },
2570
+ {
2571
+ inputs: [
2572
+ ],
2573
+ name: "MAX_HOOKS",
2574
+ outputs: [
2575
+ {
2576
+ internalType: "uint256",
2577
+ name: "",
2578
+ type: "uint256"
2579
+ }
2580
+ ],
2581
+ stateMutability: "view",
2582
+ type: "function"
2583
+ },
2584
+ {
2585
+ inputs: [
2586
+ ],
2587
+ name: "MAX_IP_ORG_ASSET_TYPES",
2588
+ outputs: [
2589
+ {
2590
+ internalType: "uint256",
2591
+ name: "",
2592
+ type: "uint256"
2593
+ }
2594
+ ],
2595
+ stateMutability: "view",
2596
+ type: "function"
2597
+ },
2598
+ {
2599
+ inputs: [
2600
+ ],
2601
+ name: "MODULE_REGISTRY",
2602
+ outputs: [
2603
+ {
2604
+ internalType: "contract ModuleRegistry",
2605
+ name: "",
2606
+ type: "address"
2607
+ }
2608
+ ],
2609
+ stateMutability: "view",
2610
+ type: "function"
2611
+ },
2612
+ {
2613
+ inputs: [
2614
+ {
2615
+ internalType: "enum HookRegistry.HookType",
2616
+ name: "hookType_",
2617
+ type: "uint8"
2618
+ },
2619
+ {
2620
+ internalType: "contract IIPOrg",
2621
+ name: "ipOrg_",
2622
+ type: "address"
2623
+ },
2624
+ {
2625
+ internalType: "bytes32",
2626
+ name: "registryKey_",
2627
+ type: "bytes32"
2628
+ }
2629
+ ],
2630
+ name: "clearHooks",
2631
+ outputs: [
2632
+ ],
2633
+ stateMutability: "nonpayable",
2634
+ type: "function"
2635
+ },
2636
+ {
2637
+ inputs: [
2638
+ {
2639
+ internalType: "contract IIPOrg",
2640
+ name: "ipOrg_",
2641
+ type: "address"
2642
+ },
2643
+ {
2644
+ internalType: "address",
2645
+ name: "caller_",
2646
+ type: "address"
2647
+ },
2648
+ {
2649
+ internalType: "bytes",
2650
+ name: "params_",
2651
+ type: "bytes"
2652
+ }
2653
+ ],
2654
+ name: "configure",
2655
+ outputs: [
2656
+ {
2657
+ internalType: "bytes",
2658
+ name: "",
2659
+ type: "bytes"
2660
+ }
2661
+ ],
2662
+ stateMutability: "nonpayable",
2663
+ type: "function"
2664
+ },
2665
+ {
2666
+ inputs: [
2667
+ {
2668
+ internalType: "address",
2669
+ name: "ipOrg_",
2670
+ type: "address"
2671
+ }
2672
+ ],
2673
+ name: "contractURI",
2674
+ outputs: [
2675
+ {
2676
+ internalType: "string",
2677
+ name: "",
2678
+ type: "string"
2679
+ }
2680
+ ],
2681
+ stateMutability: "view",
2682
+ type: "function"
2683
+ },
2684
+ {
2685
+ inputs: [
2686
+ {
2687
+ internalType: "contract IIPOrg",
2688
+ name: "ipOrg_",
2689
+ type: "address"
2690
+ },
2691
+ {
2692
+ internalType: "address",
2693
+ name: "caller_",
2694
+ type: "address"
2695
+ },
2696
+ {
2697
+ internalType: "bytes",
2698
+ name: "moduleParams_",
2699
+ type: "bytes"
2700
+ },
2701
+ {
2702
+ internalType: "bytes[]",
2703
+ name: "preHookParams_",
2704
+ type: "bytes[]"
2705
+ },
2706
+ {
2707
+ internalType: "bytes[]",
2708
+ name: "postHookParams_",
2709
+ type: "bytes[]"
2710
+ }
2711
+ ],
2712
+ name: "execute",
2713
+ outputs: [
2714
+ {
2715
+ internalType: "bytes",
2716
+ name: "result",
2717
+ type: "bytes"
2718
+ }
2719
+ ],
2720
+ stateMutability: "nonpayable",
2721
+ type: "function"
2722
+ },
2723
+ {
2724
+ inputs: [
2725
+ {
2726
+ internalType: "address",
2727
+ name: "ipOrg_",
2728
+ type: "address"
2729
+ }
2730
+ ],
2731
+ name: "getIpOrgAssetTypes",
2732
+ outputs: [
2733
+ {
2734
+ internalType: "string[]",
2735
+ name: "",
2736
+ type: "string[]"
2737
+ }
2738
+ ],
2739
+ stateMutability: "view",
2740
+ type: "function"
2741
+ },
2742
+ {
2743
+ inputs: [
2744
+ {
2745
+ internalType: "enum HookRegistry.HookType",
2746
+ name: "hookType_",
2747
+ type: "uint8"
2748
+ },
2749
+ {
2750
+ internalType: "bytes32",
2751
+ name: "registryKey_",
2752
+ type: "bytes32"
2753
+ },
2754
+ {
2755
+ internalType: "uint256",
2756
+ name: "index_",
2757
+ type: "uint256"
2758
+ }
2759
+ ],
2760
+ name: "hookAt",
2761
+ outputs: [
2762
+ {
2763
+ internalType: "address",
2764
+ name: "",
2765
+ type: "address"
2766
+ }
2767
+ ],
2768
+ stateMutability: "view",
2769
+ type: "function"
2770
+ },
2771
+ {
2772
+ inputs: [
2773
+ {
2774
+ internalType: "enum HookRegistry.HookType",
2775
+ name: "hookType_",
2776
+ type: "uint8"
2777
+ },
2778
+ {
2779
+ internalType: "bytes32",
2780
+ name: "registryKey_",
2781
+ type: "bytes32"
2782
+ },
2783
+ {
2784
+ internalType: "uint256",
2785
+ name: "index_",
2786
+ type: "uint256"
2787
+ }
2788
+ ],
2789
+ name: "hookConfigAt",
2790
+ outputs: [
2791
+ {
2792
+ internalType: "bytes",
2793
+ name: "",
2794
+ type: "bytes"
2795
+ }
2796
+ ],
2797
+ stateMutability: "view",
2798
+ type: "function"
2799
+ },
2800
+ {
2801
+ inputs: [
2802
+ {
2803
+ internalType: "enum HookRegistry.HookType",
2804
+ name: "hookType_",
2805
+ type: "uint8"
2806
+ },
2807
+ {
2808
+ internalType: "bytes32",
2809
+ name: "registryKey_",
2810
+ type: "bytes32"
2811
+ },
2812
+ {
2813
+ internalType: "address",
2814
+ name: "hook_",
2815
+ type: "address"
2816
+ }
2817
+ ],
2818
+ name: "hookIndex",
2819
+ outputs: [
2820
+ {
2821
+ internalType: "uint256",
2822
+ name: "",
2823
+ type: "uint256"
2824
+ }
2825
+ ],
2826
+ stateMutability: "view",
2827
+ type: "function"
2828
+ },
2829
+ {
2830
+ inputs: [
2831
+ {
2832
+ internalType: "address",
2833
+ name: "",
2834
+ type: "address"
2835
+ },
2836
+ {
2837
+ internalType: "uint256",
2838
+ name: "",
2839
+ type: "uint256"
2840
+ }
2841
+ ],
2842
+ name: "ipAssetId",
2843
+ outputs: [
2844
+ {
2845
+ internalType: "uint256",
2846
+ name: "",
2847
+ type: "uint256"
2848
+ }
2849
+ ],
2850
+ stateMutability: "view",
2851
+ type: "function"
2852
+ },
2853
+ {
2854
+ inputs: [
2855
+ {
2856
+ internalType: "enum HookRegistry.HookType",
2857
+ name: "hookType_",
2858
+ type: "uint8"
2859
+ },
2860
+ {
2861
+ internalType: "bytes32",
2862
+ name: "registryKey_",
2863
+ type: "bytes32"
2864
+ },
2865
+ {
2866
+ internalType: "address",
2867
+ name: "hook_",
2868
+ type: "address"
2869
+ }
2870
+ ],
2871
+ name: "isRegistered",
2872
+ outputs: [
2873
+ {
2874
+ internalType: "bool",
2875
+ name: "",
2876
+ type: "bool"
2877
+ }
2878
+ ],
2879
+ stateMutability: "view",
2880
+ type: "function"
2881
+ },
2882
+ {
2883
+ inputs: [
2884
+ {
2885
+ internalType: "address",
2886
+ name: "ipOrg_",
2887
+ type: "address"
2888
+ },
2889
+ {
2890
+ internalType: "uint8",
2891
+ name: "assetTypeIndex_",
2892
+ type: "uint8"
2893
+ }
2894
+ ],
2895
+ name: "isValidIpOrgAssetType",
2896
+ outputs: [
2897
+ {
2898
+ internalType: "bool",
2899
+ name: "",
2900
+ type: "bool"
2901
+ }
2902
+ ],
2903
+ stateMutability: "view",
2904
+ type: "function"
2905
+ },
2906
+ {
2907
+ inputs: [
2908
+ {
2909
+ internalType: "uint256",
2910
+ name: "ipAssetId_",
2911
+ type: "uint256"
2912
+ }
2913
+ ],
2914
+ name: "ownerOf",
2915
+ outputs: [
2916
+ {
2917
+ internalType: "address",
2918
+ name: "",
2919
+ type: "address"
2920
+ }
2921
+ ],
2922
+ stateMutability: "view",
2923
+ type: "function"
2924
+ },
2925
+ {
2926
+ inputs: [
2927
+ {
2928
+ internalType: "enum HookRegistry.HookType",
2929
+ name: "hType_",
2930
+ type: "uint8"
2931
+ },
2932
+ {
2933
+ internalType: "contract IIPOrg",
2934
+ name: "ipOrg_",
2935
+ type: "address"
2936
+ },
2937
+ {
2938
+ internalType: "address[]",
2939
+ name: "hooks_",
2940
+ type: "address[]"
2941
+ },
2942
+ {
2943
+ internalType: "bytes[]",
2944
+ name: "hooksConfig_",
2945
+ type: "bytes[]"
2946
+ }
2947
+ ],
2948
+ name: "registerHooks",
2949
+ outputs: [
2950
+ ],
2951
+ stateMutability: "nonpayable",
2952
+ type: "function"
2953
+ },
2954
+ {
2955
+ inputs: [
2956
+ {
2957
+ internalType: "enum HookRegistry.HookType",
2958
+ name: "hookType_",
2959
+ type: "uint8"
2960
+ },
2961
+ {
2962
+ internalType: "contract IIPOrg",
2963
+ name: "ipOrg_",
2964
+ type: "address"
2965
+ },
2966
+ {
2967
+ internalType: "bytes32",
2968
+ name: "registryKey_",
2969
+ type: "bytes32"
2970
+ },
2971
+ {
2972
+ internalType: "address[]",
2973
+ name: "hooks_",
2974
+ type: "address[]"
2975
+ },
2976
+ {
2977
+ internalType: "bytes[]",
2978
+ name: "hooksConfig_",
2979
+ type: "bytes[]"
2980
+ }
2981
+ ],
2982
+ name: "registerHooks",
2983
+ outputs: [
2984
+ ],
2985
+ stateMutability: "nonpayable",
2986
+ type: "function"
2987
+ },
2988
+ {
2989
+ inputs: [
2990
+ {
2991
+ internalType: "address",
2992
+ name: "accessControl_",
2993
+ type: "address"
2994
+ }
2995
+ ],
2996
+ name: "setAccessControl",
2997
+ outputs: [
2998
+ ],
2999
+ stateMutability: "nonpayable",
3000
+ type: "function"
3001
+ },
3002
+ {
3003
+ inputs: [
3004
+ {
3005
+ internalType: "address",
3006
+ name: "ipOrg_",
3007
+ type: "address"
3008
+ },
3009
+ {
3010
+ internalType: "uint256",
3011
+ name: "ipOrgAssetId_",
3012
+ type: "uint256"
3013
+ },
3014
+ {
3015
+ internalType: "uint8",
3016
+ name: "ipOrgAssetType_",
3017
+ type: "uint8"
3018
+ }
3019
+ ],
3020
+ name: "tokenURI",
3021
+ outputs: [
3022
+ {
3023
+ internalType: "string",
3024
+ name: "",
3025
+ type: "string"
3026
+ }
3027
+ ],
3028
+ stateMutability: "view",
3029
+ type: "function"
3030
+ },
3031
+ {
3032
+ inputs: [
3033
+ {
3034
+ internalType: "address",
3035
+ name: "",
3036
+ type: "address"
3037
+ },
3038
+ {
3039
+ internalType: "uint256",
3040
+ name: "",
3041
+ type: "uint256"
3042
+ }
3043
+ ],
3044
+ name: "tokenUris",
3045
+ outputs: [
3046
+ {
3047
+ internalType: "string",
3048
+ name: "",
3049
+ type: "string"
3050
+ }
3051
+ ],
3052
+ stateMutability: "view",
3053
+ type: "function"
3054
+ },
3055
+ {
3056
+ inputs: [
3057
+ {
3058
+ internalType: "enum HookRegistry.HookType",
3059
+ name: "hookType_",
3060
+ type: "uint8"
3061
+ },
3062
+ {
3063
+ internalType: "bytes32",
3064
+ name: "registryKey_",
3065
+ type: "bytes32"
3066
+ }
3067
+ ],
3068
+ name: "totalHooks",
3069
+ outputs: [
3070
+ {
3071
+ internalType: "uint256",
3072
+ name: "",
3073
+ type: "uint256"
3074
+ }
3075
+ ],
3076
+ stateMutability: "view",
3077
+ type: "function"
3078
+ },
3079
+ {
3080
+ inputs: [
3081
+ {
3082
+ internalType: "enum HookRegistry.HookType",
3083
+ name: "hookType_",
3084
+ type: "uint8"
3085
+ },
3086
+ {
3087
+ internalType: "bytes32",
3088
+ name: "registryKey_",
3089
+ type: "bytes32"
3090
+ }
3091
+ ],
3092
+ name: "totalHooksConfig",
3093
+ outputs: [
3094
+ {
3095
+ internalType: "uint256",
3096
+ name: "",
3097
+ type: "uint256"
3098
+ }
3099
+ ],
3100
+ stateMutability: "view",
3101
+ type: "function"
3102
+ }
3103
+ ];
3104
+
1337
3105
  if (typeof process !== "undefined") {
1338
3106
  dotenv.config();
1339
3107
  }
1340
- var registrationModuleAbi = [{
1341
- anonymous: false,
1342
- inputs: [{
1343
- indexed: false,
1344
- internalType: "uint256",
1345
- name: "ipAssetId_",
1346
- type: "uint256"
1347
- }, {
1348
- indexed: true,
1349
- internalType: "address",
1350
- name: "ipOrg_",
1351
- type: "address"
1352
- }, {
1353
- indexed: false,
1354
- internalType: "uint256",
1355
- name: "ipOrgAssetId_",
1356
- type: "uint256"
1357
- }, {
1358
- indexed: true,
1359
- internalType: "address",
1360
- name: "owner_",
1361
- type: "address"
1362
- }, {
1363
- indexed: false,
1364
- internalType: "string",
1365
- name: "name_",
1366
- type: "string"
1367
- }, {
1368
- indexed: true,
1369
- internalType: "uint64",
1370
- name: "ipAssetType_",
1371
- type: "uint64"
1372
- }, {
1373
- indexed: false,
1374
- internalType: "bytes32",
1375
- name: "hash_",
1376
- type: "bytes32"
1377
- }, {
1378
- indexed: false,
1379
- internalType: "string",
1380
- name: "mediaUrl_",
1381
- type: "string"
1382
- }],
1383
- name: "IPAssetRegistered",
1384
- type: "event"
1385
- }];
3108
+ var registrationModuleAbi = registrationModuleJson;
1386
3109
  var registrationModuleReadable = formatAbi(registrationModuleAbi);
1387
3110
  var registrationModuleConfig = {
1388
3111
  abi: parseAbi(registrationModuleReadable),
@@ -1422,9 +3145,9 @@ var IPAssetClient = /*#__PURE__*/function (_IPAssetReadOnlyClien) {
1422
3145
  return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, storyProtocolConfig), {}, {
1423
3146
  functionName: "registerIPAsset",
1424
3147
  args: [getAddress(request.ipOrgId), {
1425
- owner: getAddress(request.owner),
3148
+ owner: getAddress(request.owner || this.wallet.account.address),
1426
3149
  name: request.name,
1427
- ipAssetType: parseToBigInt(request.type),
3150
+ ipOrgAssetType: parseToBigInt(request.type),
1428
3151
  hash: toHex(request.contentHash || "", {
1429
3152
  size: 32
1430
3153
  }),
@@ -1451,7 +3174,7 @@ var IPAssetClient = /*#__PURE__*/function (_IPAssetReadOnlyClien) {
1451
3174
  targetLog = _context.sent;
1452
3175
  return _context.abrupt("return", {
1453
3176
  txHash: txHash,
1454
- ipAssetId: targetLog.args.ipAssetId_.toString()
3177
+ ipAssetId: String(targetLog === null || targetLog === void 0 ? void 0 : targetLog.args["ipAssetId_"])
1455
3178
  });
1456
3179
  case 15:
1457
3180
  return _context.abrupt("return", {
@@ -1541,31 +3264,34 @@ var LicenseReadOnlyClient = /*#__PURE__*/function () {
1541
3264
  key: "list",
1542
3265
  value: function () {
1543
3266
  var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
1544
- var response;
3267
+ var _request, _request2, _request3, response;
1545
3268
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1546
3269
  while (1) switch (_context2.prev = _context2.next) {
1547
3270
  case 0:
1548
3271
  _context2.prev = 0;
1549
- _context2.next = 3;
3272
+ if (!request) {
3273
+ request = {};
3274
+ }
3275
+ _context2.next = 4;
1550
3276
  return this.httpClient.post("/protocol/license", request, {
1551
3277
  params: {
1552
- ipOrgId: request === null || request === void 0 ? void 0 : request.ipOrgId,
1553
- ipAssetId: request === null || request === void 0 ? void 0 : request.ipAssetId,
1554
- options: request === null || request === void 0 ? void 0 : request.options
3278
+ ipOrgId: (_request = request) === null || _request === void 0 ? void 0 : _request.ipOrgId,
3279
+ ipAssetId: (_request2 = request) === null || _request2 === void 0 ? void 0 : _request2.ipAssetId,
3280
+ options: (_request3 = request) === null || _request3 === void 0 ? void 0 : _request3.options
1555
3281
  }
1556
3282
  });
1557
- case 3:
3283
+ case 4:
1558
3284
  response = _context2.sent;
1559
3285
  return _context2.abrupt("return", response.data);
1560
- case 7:
1561
- _context2.prev = 7;
3286
+ case 8:
3287
+ _context2.prev = 8;
1562
3288
  _context2.t0 = _context2["catch"](0);
1563
3289
  handleError(_context2.t0, "Failed to get licenses");
1564
- case 10:
3290
+ case 11:
1565
3291
  case "end":
1566
3292
  return _context2.stop();
1567
3293
  }
1568
- }, _callee2, this, [[0, 7]]);
3294
+ }, _callee2, this, [[0, 8]]);
1569
3295
  }));
1570
3296
  function list(_x2) {
1571
3297
  return _list.apply(this, arguments);
@@ -1637,20 +3363,23 @@ var TransactionReadOnlyClient = /*#__PURE__*/function () {
1637
3363
  while (1) switch (_context2.prev = _context2.next) {
1638
3364
  case 0:
1639
3365
  _context2.prev = 0;
1640
- _context2.next = 3;
3366
+ if (!request) {
3367
+ request = {};
3368
+ }
3369
+ _context2.next = 4;
1641
3370
  return this.httpClient.post("/protocol/transaction", request);
1642
- case 3:
3371
+ case 4:
1643
3372
  response = _context2.sent;
1644
3373
  return _context2.abrupt("return", response.data);
1645
- case 7:
1646
- _context2.prev = 7;
3374
+ case 8:
3375
+ _context2.prev = 8;
1647
3376
  _context2.t0 = _context2["catch"](0);
1648
3377
  handleError(_context2.t0, "Failed to get transactions");
1649
- case 10:
3378
+ case 11:
1650
3379
  case "end":
1651
3380
  return _context2.stop();
1652
3381
  }
1653
- }, _callee2, this, [[0, 7]]);
3382
+ }, _callee2, this, [[0, 8]]);
1654
3383
  }));
1655
3384
  function list(_x2) {
1656
3385
  return _list.apply(this, arguments);
@@ -1739,29 +3468,32 @@ var ModuleReadOnlyClient = /*#__PURE__*/function () {
1739
3468
  key: "list",
1740
3469
  value: function () {
1741
3470
  var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
1742
- var response;
3471
+ var _request, response;
1743
3472
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1744
3473
  while (1) switch (_context2.prev = _context2.next) {
1745
3474
  case 0:
1746
3475
  _context2.prev = 0;
1747
- _context2.next = 3;
3476
+ if (!request) {
3477
+ request = {};
3478
+ }
3479
+ _context2.next = 4;
1748
3480
  return this.httpClient.post("/protocol/module", request, {
1749
3481
  params: {
1750
- ipOrgId: request === null || request === void 0 ? void 0 : request.ipOrgId
3482
+ ipOrgId: (_request = request) === null || _request === void 0 ? void 0 : _request.ipOrgId
1751
3483
  }
1752
3484
  });
1753
- case 3:
3485
+ case 4:
1754
3486
  response = _context2.sent;
1755
3487
  return _context2.abrupt("return", response.data);
1756
- case 7:
1757
- _context2.prev = 7;
3488
+ case 8:
3489
+ _context2.prev = 8;
1758
3490
  _context2.t0 = _context2["catch"](0);
1759
3491
  handleError(_context2.t0, "Failed to get modules");
1760
- case 10:
3492
+ case 11:
1761
3493
  case "end":
1762
3494
  return _context2.stop();
1763
3495
  }
1764
- }, _callee2, this, [[0, 7]]);
3496
+ }, _callee2, this, [[0, 8]]);
1765
3497
  }));
1766
3498
  function list(_x2) {
1767
3499
  return _list.apply(this, arguments);
@@ -1845,29 +3577,32 @@ var HookReadOnlyClient = /*#__PURE__*/function () {
1845
3577
  key: "list",
1846
3578
  value: function () {
1847
3579
  var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
1848
- var response;
3580
+ var _request, response;
1849
3581
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1850
3582
  while (1) switch (_context2.prev = _context2.next) {
1851
3583
  case 0:
1852
3584
  _context2.prev = 0;
1853
- _context2.next = 3;
3585
+ if (!request) {
3586
+ request = {};
3587
+ }
3588
+ _context2.next = 4;
1854
3589
  return this.httpClient.post("/protocol/hook", request, {
1855
3590
  params: {
1856
- moduleId: request === null || request === void 0 ? void 0 : request.moduleId
3591
+ moduleId: (_request = request) === null || _request === void 0 ? void 0 : _request.moduleId
1857
3592
  }
1858
3593
  });
1859
- case 3:
3594
+ case 4:
1860
3595
  response = _context2.sent;
1861
3596
  return _context2.abrupt("return", response.data);
1862
- case 7:
1863
- _context2.prev = 7;
3597
+ case 8:
3598
+ _context2.prev = 8;
1864
3599
  _context2.t0 = _context2["catch"](0);
1865
3600
  handleError(_context2.t0, "Failed to get hooks");
1866
- case 10:
3601
+ case 11:
1867
3602
  case "end":
1868
3603
  return _context2.stop();
1869
3604
  }
1870
- }, _callee2, this, [[0, 7]]);
3605
+ }, _callee2, this, [[0, 8]]);
1871
3606
  }));
1872
3607
  function list(_x2) {
1873
3608
  return _list.apply(this, arguments);
@@ -1927,6 +3662,7 @@ var PlatformClient = /*#__PURE__*/function () {
1927
3662
  };
1928
3663
  _context.next = 7;
1929
3664
  return this.httpClient.post("/protocol/v2/files/upload", paylod, {
3665
+ timeout: 0,
1930
3666
  headers: {
1931
3667
  "Content-Type": "application/json"
1932
3668
  }
@@ -1937,7 +3673,7 @@ var PlatformClient = /*#__PURE__*/function () {
1937
3673
  case 11:
1938
3674
  _context.prev = 11;
1939
3675
  _context.t0 = _context["catch"](0);
1940
- return _context.abrupt("return", handleError(_context.t0, "Failed to upload file"));
3676
+ return _context.abrupt("return", handleError(_context.t0, ">>> Failed to upload file"));
1941
3677
  case 14:
1942
3678
  case "end":
1943
3679
  return _context.stop();
@@ -1953,20 +3689,813 @@ var PlatformClient = /*#__PURE__*/function () {
1953
3689
  return PlatformClient;
1954
3690
  }();
1955
3691
 
1956
- var licenseRegistryAbi = [{
1957
- anonymous: false,
1958
- inputs: [{
1959
- indexed: true,
1960
- internalType: "uint256",
1961
- name: "id",
1962
- type: "uint256"
1963
- }],
1964
- name: "LicenseRegistered",
1965
- type: "event"
1966
- }];
1967
- formatAbi(licenseRegistryAbi);
3692
+ var licenseRegistryJson = [
3693
+ {
3694
+ inputs: [
3695
+ {
3696
+ internalType: "address",
3697
+ name: "ipaRegistry_",
3698
+ type: "address"
3699
+ },
3700
+ {
3701
+ internalType: "address",
3702
+ name: "moduleRegistry_",
3703
+ type: "address"
3704
+ }
3705
+ ],
3706
+ stateMutability: "nonpayable",
3707
+ type: "constructor"
3708
+ },
3709
+ {
3710
+ inputs: [
3711
+ ],
3712
+ name: "LicenseRegistry_CallerNotLicensingModule",
3713
+ type: "error"
3714
+ },
3715
+ {
3716
+ inputs: [
3717
+ ],
3718
+ name: "LicenseRegistry_CallerNotRevoker",
3719
+ type: "error"
3720
+ },
3721
+ {
3722
+ inputs: [
3723
+ ],
3724
+ name: "LicenseRegistry_InvalidIpa",
3725
+ type: "error"
3726
+ },
3727
+ {
3728
+ inputs: [
3729
+ ],
3730
+ name: "LicenseRegistry_InvalidLicenseStatus",
3731
+ type: "error"
3732
+ },
3733
+ {
3734
+ inputs: [
3735
+ ],
3736
+ name: "LicenseRegistry_LicenseNotPending",
3737
+ type: "error"
3738
+ },
3739
+ {
3740
+ inputs: [
3741
+ ],
3742
+ name: "LicenseRegistry_NotLicenseNFT",
3743
+ type: "error"
3744
+ },
3745
+ {
3746
+ inputs: [
3747
+ ],
3748
+ name: "LicenseRegistry_UnknownLicenseId",
3749
+ type: "error"
3750
+ },
3751
+ {
3752
+ inputs: [
3753
+ ],
3754
+ name: "LicenseRegistry_ZeroIpaRegistryAddress",
3755
+ type: "error"
3756
+ },
3757
+ {
3758
+ inputs: [
3759
+ ],
3760
+ name: "LicenseRegistry_ZeroModuleRegistryAddress",
3761
+ type: "error"
3762
+ },
3763
+ {
3764
+ anonymous: false,
3765
+ inputs: [
3766
+ {
3767
+ indexed: true,
3768
+ internalType: "address",
3769
+ name: "owner",
3770
+ type: "address"
3771
+ },
3772
+ {
3773
+ indexed: true,
3774
+ internalType: "address",
3775
+ name: "approved",
3776
+ type: "address"
3777
+ },
3778
+ {
3779
+ indexed: true,
3780
+ internalType: "uint256",
3781
+ name: "tokenId",
3782
+ type: "uint256"
3783
+ }
3784
+ ],
3785
+ name: "Approval",
3786
+ type: "event"
3787
+ },
3788
+ {
3789
+ anonymous: false,
3790
+ inputs: [
3791
+ {
3792
+ indexed: true,
3793
+ internalType: "address",
3794
+ name: "owner",
3795
+ type: "address"
3796
+ },
3797
+ {
3798
+ indexed: true,
3799
+ internalType: "address",
3800
+ name: "operator",
3801
+ type: "address"
3802
+ },
3803
+ {
3804
+ indexed: false,
3805
+ internalType: "bool",
3806
+ name: "approved",
3807
+ type: "bool"
3808
+ }
3809
+ ],
3810
+ name: "ApprovalForAll",
3811
+ type: "event"
3812
+ },
3813
+ {
3814
+ anonymous: false,
3815
+ inputs: [
3816
+ {
3817
+ indexed: true,
3818
+ internalType: "uint256",
3819
+ name: "licenseId",
3820
+ type: "uint256"
3821
+ }
3822
+ ],
3823
+ name: "LicenseActivated",
3824
+ type: "event"
3825
+ },
3826
+ {
3827
+ anonymous: false,
3828
+ inputs: [
3829
+ {
3830
+ indexed: true,
3831
+ internalType: "uint256",
3832
+ name: "licenseId",
3833
+ type: "uint256"
3834
+ },
3835
+ {
3836
+ indexed: true,
3837
+ internalType: "uint256",
3838
+ name: "ipAssetId",
3839
+ type: "uint256"
3840
+ }
3841
+ ],
3842
+ name: "LicenseNftBoundedToIpa",
3843
+ type: "event"
3844
+ },
3845
+ {
3846
+ anonymous: false,
3847
+ inputs: [
3848
+ {
3849
+ indexed: true,
3850
+ internalType: "uint256",
3851
+ name: "id",
3852
+ type: "uint256"
3853
+ }
3854
+ ],
3855
+ name: "LicenseRegistered",
3856
+ type: "event"
3857
+ },
3858
+ {
3859
+ anonymous: false,
3860
+ inputs: [
3861
+ {
3862
+ indexed: true,
3863
+ internalType: "uint256",
3864
+ name: "licenseId",
3865
+ type: "uint256"
3866
+ }
3867
+ ],
3868
+ name: "LicenseRevoked",
3869
+ type: "event"
3870
+ },
3871
+ {
3872
+ anonymous: false,
3873
+ inputs: [
3874
+ {
3875
+ indexed: true,
3876
+ internalType: "address",
3877
+ name: "from",
3878
+ type: "address"
3879
+ },
3880
+ {
3881
+ indexed: true,
3882
+ internalType: "address",
3883
+ name: "to",
3884
+ type: "address"
3885
+ },
3886
+ {
3887
+ indexed: true,
3888
+ internalType: "uint256",
3889
+ name: "tokenId",
3890
+ type: "uint256"
3891
+ }
3892
+ ],
3893
+ name: "Transfer",
3894
+ type: "event"
3895
+ },
3896
+ {
3897
+ inputs: [
3898
+ ],
3899
+ name: "IPA_REGISTRY",
3900
+ outputs: [
3901
+ {
3902
+ internalType: "contract IPAssetRegistry",
3903
+ name: "",
3904
+ type: "address"
3905
+ }
3906
+ ],
3907
+ stateMutability: "view",
3908
+ type: "function"
3909
+ },
3910
+ {
3911
+ inputs: [
3912
+ ],
3913
+ name: "MODULE_REGISTRY",
3914
+ outputs: [
3915
+ {
3916
+ internalType: "contract ModuleRegistry",
3917
+ name: "",
3918
+ type: "address"
3919
+ }
3920
+ ],
3921
+ stateMutability: "view",
3922
+ type: "function"
3923
+ },
3924
+ {
3925
+ inputs: [
3926
+ {
3927
+ internalType: "uint256",
3928
+ name: "licenseId_",
3929
+ type: "uint256"
3930
+ }
3931
+ ],
3932
+ name: "activateLicense",
3933
+ outputs: [
3934
+ ],
3935
+ stateMutability: "nonpayable",
3936
+ type: "function"
3937
+ },
3938
+ {
3939
+ inputs: [
3940
+ {
3941
+ components: [
3942
+ {
3943
+ internalType: "bool",
3944
+ name: "isCommercial",
3945
+ type: "bool"
3946
+ },
3947
+ {
3948
+ internalType: "enum Licensing.LicenseStatus",
3949
+ name: "status",
3950
+ type: "uint8"
3951
+ },
3952
+ {
3953
+ internalType: "address",
3954
+ name: "licensor",
3955
+ type: "address"
3956
+ },
3957
+ {
3958
+ internalType: "address",
3959
+ name: "revoker",
3960
+ type: "address"
3961
+ },
3962
+ {
3963
+ internalType: "address",
3964
+ name: "ipOrg",
3965
+ type: "address"
3966
+ },
3967
+ {
3968
+ internalType: "uint256",
3969
+ name: "parentLicenseId",
3970
+ type: "uint256"
3971
+ },
3972
+ {
3973
+ internalType: "ShortString[]",
3974
+ name: "termIds",
3975
+ type: "bytes32[]"
3976
+ },
3977
+ {
3978
+ internalType: "bytes[]",
3979
+ name: "termsData",
3980
+ type: "bytes[]"
3981
+ }
3982
+ ],
3983
+ internalType: "struct Licensing.RegistryAddition",
3984
+ name: "params_",
3985
+ type: "tuple"
3986
+ },
3987
+ {
3988
+ internalType: "uint256",
3989
+ name: "ipaId_",
3990
+ type: "uint256"
3991
+ }
3992
+ ],
3993
+ name: "addBoundToIpaLicense",
3994
+ outputs: [
3995
+ {
3996
+ internalType: "uint256",
3997
+ name: "",
3998
+ type: "uint256"
3999
+ }
4000
+ ],
4001
+ stateMutability: "nonpayable",
4002
+ type: "function"
4003
+ },
4004
+ {
4005
+ inputs: [
4006
+ {
4007
+ components: [
4008
+ {
4009
+ internalType: "bool",
4010
+ name: "isCommercial",
4011
+ type: "bool"
4012
+ },
4013
+ {
4014
+ internalType: "enum Licensing.LicenseStatus",
4015
+ name: "status",
4016
+ type: "uint8"
4017
+ },
4018
+ {
4019
+ internalType: "address",
4020
+ name: "licensor",
4021
+ type: "address"
4022
+ },
4023
+ {
4024
+ internalType: "address",
4025
+ name: "revoker",
4026
+ type: "address"
4027
+ },
4028
+ {
4029
+ internalType: "address",
4030
+ name: "ipOrg",
4031
+ type: "address"
4032
+ },
4033
+ {
4034
+ internalType: "uint256",
4035
+ name: "parentLicenseId",
4036
+ type: "uint256"
4037
+ },
4038
+ {
4039
+ internalType: "ShortString[]",
4040
+ name: "termIds",
4041
+ type: "bytes32[]"
4042
+ },
4043
+ {
4044
+ internalType: "bytes[]",
4045
+ name: "termsData",
4046
+ type: "bytes[]"
4047
+ }
4048
+ ],
4049
+ internalType: "struct Licensing.RegistryAddition",
4050
+ name: "params_",
4051
+ type: "tuple"
4052
+ },
4053
+ {
4054
+ internalType: "address",
4055
+ name: "licensee_",
4056
+ type: "address"
4057
+ }
4058
+ ],
4059
+ name: "addTradeableLicense",
4060
+ outputs: [
4061
+ {
4062
+ internalType: "uint256",
4063
+ name: "",
4064
+ type: "uint256"
4065
+ }
4066
+ ],
4067
+ stateMutability: "nonpayable",
4068
+ type: "function"
4069
+ },
4070
+ {
4071
+ inputs: [
4072
+ {
4073
+ internalType: "address",
4074
+ name: "to",
4075
+ type: "address"
4076
+ },
4077
+ {
4078
+ internalType: "uint256",
4079
+ name: "tokenId",
4080
+ type: "uint256"
4081
+ }
4082
+ ],
4083
+ name: "approve",
4084
+ outputs: [
4085
+ ],
4086
+ stateMutability: "nonpayable",
4087
+ type: "function"
4088
+ },
4089
+ {
4090
+ inputs: [
4091
+ {
4092
+ internalType: "address",
4093
+ name: "owner",
4094
+ type: "address"
4095
+ }
4096
+ ],
4097
+ name: "balanceOf",
4098
+ outputs: [
4099
+ {
4100
+ internalType: "uint256",
4101
+ name: "",
4102
+ type: "uint256"
4103
+ }
4104
+ ],
4105
+ stateMutability: "view",
4106
+ type: "function"
4107
+ },
4108
+ {
4109
+ inputs: [
4110
+ {
4111
+ internalType: "uint256",
4112
+ name: "licenseId_",
4113
+ type: "uint256"
4114
+ },
4115
+ {
4116
+ internalType: "uint256",
4117
+ name: "ipaId_",
4118
+ type: "uint256"
4119
+ }
4120
+ ],
4121
+ name: "bindLnftToIpa",
4122
+ outputs: [
4123
+ ],
4124
+ stateMutability: "nonpayable",
4125
+ type: "function"
4126
+ },
4127
+ {
4128
+ inputs: [
4129
+ {
4130
+ internalType: "uint256",
4131
+ name: "tokenId",
4132
+ type: "uint256"
4133
+ }
4134
+ ],
4135
+ name: "getApproved",
4136
+ outputs: [
4137
+ {
4138
+ internalType: "address",
4139
+ name: "",
4140
+ type: "address"
4141
+ }
4142
+ ],
4143
+ stateMutability: "view",
4144
+ type: "function"
4145
+ },
4146
+ {
4147
+ inputs: [
4148
+ {
4149
+ internalType: "uint256",
4150
+ name: "id_",
4151
+ type: "uint256"
4152
+ }
4153
+ ],
4154
+ name: "getLicense",
4155
+ outputs: [
4156
+ {
4157
+ components: [
4158
+ {
4159
+ internalType: "bool",
4160
+ name: "isCommercial",
4161
+ type: "bool"
4162
+ },
4163
+ {
4164
+ internalType: "enum Licensing.LicenseStatus",
4165
+ name: "status",
4166
+ type: "uint8"
4167
+ },
4168
+ {
4169
+ internalType: "address",
4170
+ name: "licensor",
4171
+ type: "address"
4172
+ },
4173
+ {
4174
+ internalType: "address",
4175
+ name: "revoker",
4176
+ type: "address"
4177
+ },
4178
+ {
4179
+ internalType: "address",
4180
+ name: "ipOrg",
4181
+ type: "address"
4182
+ },
4183
+ {
4184
+ internalType: "enum Licensing.LicenseeType",
4185
+ name: "licenseeType",
4186
+ type: "uint8"
4187
+ },
4188
+ {
4189
+ internalType: "uint256",
4190
+ name: "ipaId",
4191
+ type: "uint256"
4192
+ },
4193
+ {
4194
+ internalType: "uint256",
4195
+ name: "parentLicenseId",
4196
+ type: "uint256"
4197
+ },
4198
+ {
4199
+ internalType: "ShortString[]",
4200
+ name: "termIds",
4201
+ type: "bytes32[]"
4202
+ },
4203
+ {
4204
+ internalType: "bytes[]",
4205
+ name: "termsData",
4206
+ type: "bytes[]"
4207
+ }
4208
+ ],
4209
+ internalType: "struct Licensing.License",
4210
+ name: "",
4211
+ type: "tuple"
4212
+ }
4213
+ ],
4214
+ stateMutability: "view",
4215
+ type: "function"
4216
+ },
4217
+ {
4218
+ inputs: [
4219
+ {
4220
+ internalType: "uint256",
4221
+ name: "id_",
4222
+ type: "uint256"
4223
+ }
4224
+ ],
4225
+ name: "getLicensee",
4226
+ outputs: [
4227
+ {
4228
+ internalType: "address",
4229
+ name: "",
4230
+ type: "address"
4231
+ }
4232
+ ],
4233
+ stateMutability: "view",
4234
+ type: "function"
4235
+ },
4236
+ {
4237
+ inputs: [
4238
+ {
4239
+ internalType: "uint256",
4240
+ name: "id_",
4241
+ type: "uint256"
4242
+ }
4243
+ ],
4244
+ name: "getLicensor",
4245
+ outputs: [
4246
+ {
4247
+ internalType: "address",
4248
+ name: "",
4249
+ type: "address"
4250
+ }
4251
+ ],
4252
+ stateMutability: "view",
4253
+ type: "function"
4254
+ },
4255
+ {
4256
+ inputs: [
4257
+ {
4258
+ internalType: "address",
4259
+ name: "owner",
4260
+ type: "address"
4261
+ },
4262
+ {
4263
+ internalType: "address",
4264
+ name: "operator",
4265
+ type: "address"
4266
+ }
4267
+ ],
4268
+ name: "isApprovedForAll",
4269
+ outputs: [
4270
+ {
4271
+ internalType: "bool",
4272
+ name: "",
4273
+ type: "bool"
4274
+ }
4275
+ ],
4276
+ stateMutability: "view",
4277
+ type: "function"
4278
+ },
4279
+ {
4280
+ inputs: [
4281
+ {
4282
+ internalType: "uint256",
4283
+ name: "licenseId_",
4284
+ type: "uint256"
4285
+ }
4286
+ ],
4287
+ name: "isLicenseActive",
4288
+ outputs: [
4289
+ {
4290
+ internalType: "bool",
4291
+ name: "",
4292
+ type: "bool"
4293
+ }
4294
+ ],
4295
+ stateMutability: "view",
4296
+ type: "function"
4297
+ },
4298
+ {
4299
+ inputs: [
4300
+ ],
4301
+ name: "name",
4302
+ outputs: [
4303
+ {
4304
+ internalType: "string",
4305
+ name: "",
4306
+ type: "string"
4307
+ }
4308
+ ],
4309
+ stateMutability: "view",
4310
+ type: "function"
4311
+ },
4312
+ {
4313
+ inputs: [
4314
+ {
4315
+ internalType: "uint256",
4316
+ name: "tokenId",
4317
+ type: "uint256"
4318
+ }
4319
+ ],
4320
+ name: "ownerOf",
4321
+ outputs: [
4322
+ {
4323
+ internalType: "address",
4324
+ name: "",
4325
+ type: "address"
4326
+ }
4327
+ ],
4328
+ stateMutability: "view",
4329
+ type: "function"
4330
+ },
4331
+ {
4332
+ inputs: [
4333
+ {
4334
+ internalType: "uint256",
4335
+ name: "licenseId_",
4336
+ type: "uint256"
4337
+ }
4338
+ ],
4339
+ name: "revokeLicense",
4340
+ outputs: [
4341
+ ],
4342
+ stateMutability: "nonpayable",
4343
+ type: "function"
4344
+ },
4345
+ {
4346
+ inputs: [
4347
+ {
4348
+ internalType: "address",
4349
+ name: "from",
4350
+ type: "address"
4351
+ },
4352
+ {
4353
+ internalType: "address",
4354
+ name: "to",
4355
+ type: "address"
4356
+ },
4357
+ {
4358
+ internalType: "uint256",
4359
+ name: "tokenId",
4360
+ type: "uint256"
4361
+ }
4362
+ ],
4363
+ name: "safeTransferFrom",
4364
+ outputs: [
4365
+ ],
4366
+ stateMutability: "nonpayable",
4367
+ type: "function"
4368
+ },
4369
+ {
4370
+ inputs: [
4371
+ {
4372
+ internalType: "address",
4373
+ name: "from",
4374
+ type: "address"
4375
+ },
4376
+ {
4377
+ internalType: "address",
4378
+ name: "to",
4379
+ type: "address"
4380
+ },
4381
+ {
4382
+ internalType: "uint256",
4383
+ name: "tokenId",
4384
+ type: "uint256"
4385
+ },
4386
+ {
4387
+ internalType: "bytes",
4388
+ name: "data",
4389
+ type: "bytes"
4390
+ }
4391
+ ],
4392
+ name: "safeTransferFrom",
4393
+ outputs: [
4394
+ ],
4395
+ stateMutability: "nonpayable",
4396
+ type: "function"
4397
+ },
4398
+ {
4399
+ inputs: [
4400
+ {
4401
+ internalType: "address",
4402
+ name: "operator",
4403
+ type: "address"
4404
+ },
4405
+ {
4406
+ internalType: "bool",
4407
+ name: "approved",
4408
+ type: "bool"
4409
+ }
4410
+ ],
4411
+ name: "setApprovalForAll",
4412
+ outputs: [
4413
+ ],
4414
+ stateMutability: "nonpayable",
4415
+ type: "function"
4416
+ },
4417
+ {
4418
+ inputs: [
4419
+ {
4420
+ internalType: "bytes4",
4421
+ name: "interfaceId",
4422
+ type: "bytes4"
4423
+ }
4424
+ ],
4425
+ name: "supportsInterface",
4426
+ outputs: [
4427
+ {
4428
+ internalType: "bool",
4429
+ name: "",
4430
+ type: "bool"
4431
+ }
4432
+ ],
4433
+ stateMutability: "view",
4434
+ type: "function"
4435
+ },
4436
+ {
4437
+ inputs: [
4438
+ ],
4439
+ name: "symbol",
4440
+ outputs: [
4441
+ {
4442
+ internalType: "string",
4443
+ name: "",
4444
+ type: "string"
4445
+ }
4446
+ ],
4447
+ stateMutability: "view",
4448
+ type: "function"
4449
+ },
4450
+ {
4451
+ inputs: [
4452
+ {
4453
+ internalType: "uint256",
4454
+ name: "tokenId",
4455
+ type: "uint256"
4456
+ }
4457
+ ],
4458
+ name: "tokenURI",
4459
+ outputs: [
4460
+ {
4461
+ internalType: "string",
4462
+ name: "",
4463
+ type: "string"
4464
+ }
4465
+ ],
4466
+ stateMutability: "view",
4467
+ type: "function"
4468
+ },
4469
+ {
4470
+ inputs: [
4471
+ {
4472
+ internalType: "address",
4473
+ name: "from",
4474
+ type: "address"
4475
+ },
4476
+ {
4477
+ internalType: "address",
4478
+ name: "to",
4479
+ type: "address"
4480
+ },
4481
+ {
4482
+ internalType: "uint256",
4483
+ name: "tokenId",
4484
+ type: "uint256"
4485
+ }
4486
+ ],
4487
+ name: "transferFrom",
4488
+ outputs: [
4489
+ ],
4490
+ stateMutability: "nonpayable",
4491
+ type: "function"
4492
+ }
4493
+ ];
4494
+
4495
+ var licenseRegistryAbi = licenseRegistryJson;
4496
+ var licenseRegistryReadable = formatAbi(licenseRegistryAbi);
1968
4497
  var licenseRegistryConfig = {
1969
- abi: licenseRegistryAbi,
4498
+ abi: parseAbi(licenseRegistryReadable),
1970
4499
  address: getAddress(process.env.LICENSE_REGISTRY_CONTRACT || process.env.NEXT_PUBLIC_LICENSE_REGISTRY_CONTRACT || "")
1971
4500
  };
1972
4501
 
@@ -1987,7 +4516,7 @@ var LicenseClient = /*#__PURE__*/function (_LicenseReadOnlyClien) {
1987
4516
  key: "create",
1988
4517
  value: function () {
1989
4518
  var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
1990
- var functionName, args, _request$txOptions, _yield$this$rpcClient, call, txHash, _targetLog$args, targetLog;
4519
+ var functionName, args, _request$txOptions, _yield$this$rpcClient, call, txHash, targetLog;
1991
4520
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1992
4521
  while (1) switch (_context.prev = _context.next) {
1993
4522
  case 0:
@@ -2043,7 +4572,7 @@ var LicenseClient = /*#__PURE__*/function (_LicenseReadOnlyClien) {
2043
4572
  targetLog = _context.sent;
2044
4573
  return _context.abrupt("return", {
2045
4574
  txHash: txHash,
2046
- licenseId: targetLog === null || targetLog === void 0 || (_targetLog$args = targetLog.args) === null || _targetLog$args === void 0 ? void 0 : _targetLog$args.id.toString()
4575
+ licenseId: String(targetLog === null || targetLog === void 0 ? void 0 : targetLog.args["id"])
2047
4576
  });
2048
4577
  case 26:
2049
4578
  return _context.abrupt("return", {
@@ -2081,91 +4610,1037 @@ var LicenseClient = /*#__PURE__*/function (_LicenseReadOnlyClien) {
2081
4610
  return LicenseClient;
2082
4611
  }(LicenseReadOnlyClient);
2083
4612
 
2084
- var relationshipModuleAbi = [
2085
- // EVENTS
2086
- {
2087
- anonymous: false,
2088
- inputs: [{
2089
- indexed: true,
2090
- internalType: "uint256",
2091
- name: "relationshipId",
2092
- type: "uint256"
2093
- }, {
2094
- indexed: true,
2095
- internalType: "string",
2096
- name: "relType",
2097
- type: "string"
2098
- }, {
2099
- indexed: false,
2100
- internalType: "address",
2101
- name: "srcAddress",
2102
- type: "address"
2103
- }, {
2104
- indexed: false,
2105
- internalType: "uint256",
2106
- name: "srcId",
2107
- type: "uint256"
2108
- }, {
2109
- indexed: false,
2110
- internalType: "address",
2111
- name: "dstAddress",
2112
- type: "address"
2113
- }, {
2114
- indexed: false,
2115
- internalType: "uint256",
2116
- name: "dstId",
2117
- type: "uint256"
2118
- }],
2119
- name: "RelationshipCreated",
2120
- type: "event"
2121
- }, {
2122
- anonymous: false,
2123
- inputs: [{
2124
- indexed: true,
2125
- internalType: "string",
2126
- name: "relType",
2127
- type: "string"
2128
- }, {
2129
- indexed: true,
2130
- internalType: "address",
2131
- name: "ipOrg",
2132
- type: "address"
2133
- }, {
2134
- indexed: false,
2135
- internalType: "address",
2136
- name: "src",
2137
- type: "address"
2138
- }, {
2139
- indexed: false,
2140
- internalType: "enum LibRelationship.Relatables",
2141
- name: "srcRelatable",
2142
- type: "uint8"
2143
- }, {
2144
- indexed: false,
2145
- internalType: "uint256",
2146
- name: "srcSubtypesMask",
2147
- type: "uint256"
2148
- }, {
2149
- indexed: false,
2150
- internalType: "address",
2151
- name: "dst",
2152
- type: "address"
2153
- }, {
2154
- indexed: false,
2155
- internalType: "enum LibRelationship.Relatables",
2156
- name: "dstRelatable",
2157
- type: "uint8"
2158
- }, {
2159
- indexed: false,
2160
- internalType: "uint256",
2161
- name: "dstSubtypesMask",
2162
- type: "uint256"
2163
- }],
2164
- name: "RelationshipTypeSet",
2165
- type: "event"
2166
- }];
4613
+ var relationshipModuleJson = [
4614
+ {
4615
+ inputs: [
4616
+ {
4617
+ components: [
4618
+ {
4619
+ internalType: "contract IPAssetRegistry",
4620
+ name: "ipaRegistry",
4621
+ type: "address"
4622
+ },
4623
+ {
4624
+ internalType: "contract ModuleRegistry",
4625
+ name: "moduleRegistry",
4626
+ type: "address"
4627
+ },
4628
+ {
4629
+ internalType: "contract LicenseRegistry",
4630
+ name: "licenseRegistry",
4631
+ type: "address"
4632
+ },
4633
+ {
4634
+ internalType: "contract IPOrgController",
4635
+ name: "ipOrgController",
4636
+ type: "address"
4637
+ }
4638
+ ],
4639
+ internalType: "struct BaseModule.ModuleConstruction",
4640
+ name: "params_",
4641
+ type: "tuple"
4642
+ },
4643
+ {
4644
+ internalType: "address",
4645
+ name: "accessControl_",
4646
+ type: "address"
4647
+ }
4648
+ ],
4649
+ stateMutability: "nonpayable",
4650
+ type: "constructor"
4651
+ },
4652
+ {
4653
+ inputs: [
4654
+ {
4655
+ internalType: "uint8",
4656
+ name: "hookType",
4657
+ type: "uint8"
4658
+ }
4659
+ ],
4660
+ name: "BaseModule_HooksParamsLengthMismatch",
4661
+ type: "error"
4662
+ },
4663
+ {
4664
+ inputs: [
4665
+ ],
4666
+ name: "BaseModule_OnlyModuleRegistry",
4667
+ type: "error"
4668
+ },
4669
+ {
4670
+ inputs: [
4671
+ ],
4672
+ name: "BaseModule_ZeroIpaRegistry",
4673
+ type: "error"
4674
+ },
4675
+ {
4676
+ inputs: [
4677
+ ],
4678
+ name: "BaseModule_ZeroLicenseRegistry",
4679
+ type: "error"
4680
+ },
4681
+ {
4682
+ inputs: [
4683
+ ],
4684
+ name: "BaseModule_ZeroModuleRegistry",
4685
+ type: "error"
4686
+ },
4687
+ {
4688
+ inputs: [
4689
+ ],
4690
+ name: "HookRegistry_CallerNotIPOrgOwner",
4691
+ type: "error"
4692
+ },
4693
+ {
4694
+ inputs: [
4695
+ ],
4696
+ name: "HookRegistry_HooksConfigLengthMismatch",
4697
+ type: "error"
4698
+ },
4699
+ {
4700
+ inputs: [
4701
+ {
4702
+ internalType: "uint256",
4703
+ name: "hooksIndex",
4704
+ type: "uint256"
4705
+ }
4706
+ ],
4707
+ name: "HookRegistry_IndexOutOfBounds",
4708
+ type: "error"
4709
+ },
4710
+ {
4711
+ inputs: [
4712
+ ],
4713
+ name: "HookRegistry_MaxHooksExceeded",
4714
+ type: "error"
4715
+ },
4716
+ {
4717
+ inputs: [
4718
+ ],
4719
+ name: "HookRegistry_RegisteringDuplicatedHook",
4720
+ type: "error"
4721
+ },
4722
+ {
4723
+ inputs: [
4724
+ ],
4725
+ name: "HookRegistry_RegisteringZeroAddressHook",
4726
+ type: "error"
4727
+ },
4728
+ {
4729
+ inputs: [
4730
+ ],
4731
+ name: "LibUintArrayMask_EmptyArray",
4732
+ type: "error"
4733
+ },
4734
+ {
4735
+ inputs: [
4736
+ {
4737
+ internalType: "bytes32",
4738
+ name: "role",
4739
+ type: "bytes32"
4740
+ },
4741
+ {
4742
+ internalType: "address",
4743
+ name: "account",
4744
+ type: "address"
4745
+ }
4746
+ ],
4747
+ name: "MissingRole",
4748
+ type: "error"
4749
+ },
4750
+ {
4751
+ inputs: [
4752
+ ],
4753
+ name: "RelationshipModule_CallerNotIpOrgOwner",
4754
+ type: "error"
4755
+ },
4756
+ {
4757
+ inputs: [
4758
+ ],
4759
+ name: "RelationshipModule_InvalidConfigOperation",
4760
+ type: "error"
4761
+ },
4762
+ {
4763
+ inputs: [
4764
+ ],
4765
+ name: "RelationshipModule_InvalidDstAddress",
4766
+ type: "error"
4767
+ },
4768
+ {
4769
+ inputs: [
4770
+ ],
4771
+ name: "RelationshipModule_InvalidDstId",
4772
+ type: "error"
4773
+ },
4774
+ {
4775
+ inputs: [
4776
+ ],
4777
+ name: "RelationshipModule_InvalidRelatable",
4778
+ type: "error"
4779
+ },
4780
+ {
4781
+ inputs: [
4782
+ ],
4783
+ name: "RelationshipModule_InvalidSrcAddress",
4784
+ type: "error"
4785
+ },
4786
+ {
4787
+ inputs: [
4788
+ ],
4789
+ name: "RelationshipModule_InvalidSrcId",
4790
+ type: "error"
4791
+ },
4792
+ {
4793
+ inputs: [
4794
+ ],
4795
+ name: "RelationshipModule_IpOrgRelatableCannotBeProtocolLevel",
4796
+ type: "error"
4797
+ },
4798
+ {
4799
+ inputs: [
4800
+ {
4801
+ internalType: "string",
4802
+ name: "relType",
4803
+ type: "string"
4804
+ }
4805
+ ],
4806
+ name: "RelationshipModule_RelTypeNotSet",
4807
+ type: "error"
4808
+ },
4809
+ {
4810
+ inputs: [
4811
+ ],
4812
+ name: "RelationshipModule_UnsupportedIpOrgIndexType",
4813
+ type: "error"
4814
+ },
4815
+ {
4816
+ inputs: [
4817
+ {
4818
+ internalType: "string",
4819
+ name: "name",
4820
+ type: "string"
4821
+ }
4822
+ ],
4823
+ name: "UnsupportedInterface",
4824
+ type: "error"
4825
+ },
4826
+ {
4827
+ inputs: [
4828
+ ],
4829
+ name: "ZeroAddress",
4830
+ type: "error"
4831
+ },
4832
+ {
4833
+ anonymous: false,
4834
+ inputs: [
4835
+ {
4836
+ indexed: true,
4837
+ internalType: "address",
4838
+ name: "accessControl",
4839
+ type: "address"
4840
+ }
4841
+ ],
4842
+ name: "AccessControlUpdated",
4843
+ type: "event"
4844
+ },
4845
+ {
4846
+ anonymous: false,
4847
+ inputs: [
4848
+ {
4849
+ indexed: true,
4850
+ internalType: "enum HookRegistry.HookType",
4851
+ name: "hType",
4852
+ type: "uint8"
4853
+ },
4854
+ {
4855
+ indexed: true,
4856
+ internalType: "bytes32",
4857
+ name: "registryKey",
4858
+ type: "bytes32"
4859
+ }
4860
+ ],
4861
+ name: "HooksCleared",
4862
+ type: "event"
4863
+ },
4864
+ {
4865
+ anonymous: false,
4866
+ inputs: [
4867
+ {
4868
+ indexed: true,
4869
+ internalType: "enum HookRegistry.HookType",
4870
+ name: "hType",
4871
+ type: "uint8"
4872
+ },
4873
+ {
4874
+ indexed: true,
4875
+ internalType: "bytes32",
4876
+ name: "registryKey",
4877
+ type: "bytes32"
4878
+ },
4879
+ {
4880
+ indexed: false,
4881
+ internalType: "address[]",
4882
+ name: "hooks",
4883
+ type: "address[]"
4884
+ }
4885
+ ],
4886
+ name: "HooksRegistered",
4887
+ type: "event"
4888
+ },
4889
+ {
4890
+ anonymous: false,
4891
+ inputs: [
4892
+ {
4893
+ indexed: true,
4894
+ internalType: "uint256",
4895
+ name: "relationshipId",
4896
+ type: "uint256"
4897
+ },
4898
+ {
4899
+ indexed: true,
4900
+ internalType: "string",
4901
+ name: "relType",
4902
+ type: "string"
4903
+ },
4904
+ {
4905
+ indexed: false,
4906
+ internalType: "address",
4907
+ name: "srcAddress",
4908
+ type: "address"
4909
+ },
4910
+ {
4911
+ indexed: false,
4912
+ internalType: "uint256",
4913
+ name: "srcId",
4914
+ type: "uint256"
4915
+ },
4916
+ {
4917
+ indexed: false,
4918
+ internalType: "address",
4919
+ name: "dstAddress",
4920
+ type: "address"
4921
+ },
4922
+ {
4923
+ indexed: false,
4924
+ internalType: "uint256",
4925
+ name: "dstId",
4926
+ type: "uint256"
4927
+ }
4928
+ ],
4929
+ name: "RelationshipCreated",
4930
+ type: "event"
4931
+ },
4932
+ {
4933
+ anonymous: false,
4934
+ inputs: [
4935
+ {
4936
+ indexed: true,
4937
+ internalType: "string",
4938
+ name: "relType",
4939
+ type: "string"
4940
+ },
4941
+ {
4942
+ indexed: true,
4943
+ internalType: "address",
4944
+ name: "ipOrg",
4945
+ type: "address"
4946
+ },
4947
+ {
4948
+ indexed: false,
4949
+ internalType: "address",
4950
+ name: "src",
4951
+ type: "address"
4952
+ },
4953
+ {
4954
+ indexed: false,
4955
+ internalType: "enum LibRelationship.Relatables",
4956
+ name: "srcRelatable",
4957
+ type: "uint8"
4958
+ },
4959
+ {
4960
+ indexed: false,
4961
+ internalType: "uint256",
4962
+ name: "srcSubtypesMask",
4963
+ type: "uint256"
4964
+ },
4965
+ {
4966
+ indexed: false,
4967
+ internalType: "address",
4968
+ name: "dst",
4969
+ type: "address"
4970
+ },
4971
+ {
4972
+ indexed: false,
4973
+ internalType: "enum LibRelationship.Relatables",
4974
+ name: "dstRelatable",
4975
+ type: "uint8"
4976
+ },
4977
+ {
4978
+ indexed: false,
4979
+ internalType: "uint256",
4980
+ name: "dstSubtypesMask",
4981
+ type: "uint256"
4982
+ }
4983
+ ],
4984
+ name: "RelationshipTypeSet",
4985
+ type: "event"
4986
+ },
4987
+ {
4988
+ anonymous: false,
4989
+ inputs: [
4990
+ {
4991
+ indexed: true,
4992
+ internalType: "string",
4993
+ name: "relType",
4994
+ type: "string"
4995
+ },
4996
+ {
4997
+ indexed: false,
4998
+ internalType: "address",
4999
+ name: "ipOrg",
5000
+ type: "address"
5001
+ }
5002
+ ],
5003
+ name: "RelationshipTypeUnset",
5004
+ type: "event"
5005
+ },
5006
+ {
5007
+ anonymous: false,
5008
+ inputs: [
5009
+ {
5010
+ indexed: true,
5011
+ internalType: "address",
5012
+ name: "sender",
5013
+ type: "address"
5014
+ }
5015
+ ],
5016
+ name: "RequestCompleted",
5017
+ type: "event"
5018
+ },
5019
+ {
5020
+ anonymous: false,
5021
+ inputs: [
5022
+ {
5023
+ indexed: true,
5024
+ internalType: "address",
5025
+ name: "sender",
5026
+ type: "address"
5027
+ }
5028
+ ],
5029
+ name: "RequestPending",
5030
+ type: "event"
5031
+ },
5032
+ {
5033
+ inputs: [
5034
+ ],
5035
+ name: "INDEX_NOT_FOUND",
5036
+ outputs: [
5037
+ {
5038
+ internalType: "uint256",
5039
+ name: "",
5040
+ type: "uint256"
5041
+ }
5042
+ ],
5043
+ stateMutability: "view",
5044
+ type: "function"
5045
+ },
5046
+ {
5047
+ inputs: [
5048
+ ],
5049
+ name: "IPA_REGISTRY",
5050
+ outputs: [
5051
+ {
5052
+ internalType: "contract IPAssetRegistry",
5053
+ name: "",
5054
+ type: "address"
5055
+ }
5056
+ ],
5057
+ stateMutability: "view",
5058
+ type: "function"
5059
+ },
5060
+ {
5061
+ inputs: [
5062
+ ],
5063
+ name: "IP_ORG_CONTROLLER",
5064
+ outputs: [
5065
+ {
5066
+ internalType: "contract IPOrgController",
5067
+ name: "",
5068
+ type: "address"
5069
+ }
5070
+ ],
5071
+ stateMutability: "view",
5072
+ type: "function"
5073
+ },
5074
+ {
5075
+ inputs: [
5076
+ ],
5077
+ name: "LICENSE_REGISTRY",
5078
+ outputs: [
5079
+ {
5080
+ internalType: "contract LicenseRegistry",
5081
+ name: "",
5082
+ type: "address"
5083
+ }
5084
+ ],
5085
+ stateMutability: "view",
5086
+ type: "function"
5087
+ },
5088
+ {
5089
+ inputs: [
5090
+ ],
5091
+ name: "MAX_HOOKS",
5092
+ outputs: [
5093
+ {
5094
+ internalType: "uint256",
5095
+ name: "",
5096
+ type: "uint256"
5097
+ }
5098
+ ],
5099
+ stateMutability: "view",
5100
+ type: "function"
5101
+ },
5102
+ {
5103
+ inputs: [
5104
+ ],
5105
+ name: "MODULE_REGISTRY",
5106
+ outputs: [
5107
+ {
5108
+ internalType: "contract ModuleRegistry",
5109
+ name: "",
5110
+ type: "address"
5111
+ }
5112
+ ],
5113
+ stateMutability: "view",
5114
+ type: "function"
5115
+ },
5116
+ {
5117
+ inputs: [
5118
+ {
5119
+ internalType: "enum HookRegistry.HookType",
5120
+ name: "hookType_",
5121
+ type: "uint8"
5122
+ },
5123
+ {
5124
+ internalType: "contract IIPOrg",
5125
+ name: "ipOrg_",
5126
+ type: "address"
5127
+ },
5128
+ {
5129
+ internalType: "bytes32",
5130
+ name: "registryKey_",
5131
+ type: "bytes32"
5132
+ }
5133
+ ],
5134
+ name: "clearHooks",
5135
+ outputs: [
5136
+ ],
5137
+ stateMutability: "nonpayable",
5138
+ type: "function"
5139
+ },
5140
+ {
5141
+ inputs: [
5142
+ {
5143
+ internalType: "contract IIPOrg",
5144
+ name: "ipOrg_",
5145
+ type: "address"
5146
+ },
5147
+ {
5148
+ internalType: "address",
5149
+ name: "caller_",
5150
+ type: "address"
5151
+ },
5152
+ {
5153
+ internalType: "bytes",
5154
+ name: "params_",
5155
+ type: "bytes"
5156
+ }
5157
+ ],
5158
+ name: "configure",
5159
+ outputs: [
5160
+ {
5161
+ internalType: "bytes",
5162
+ name: "",
5163
+ type: "bytes"
5164
+ }
5165
+ ],
5166
+ stateMutability: "nonpayable",
5167
+ type: "function"
5168
+ },
5169
+ {
5170
+ inputs: [
5171
+ {
5172
+ internalType: "contract IIPOrg",
5173
+ name: "ipOrg_",
5174
+ type: "address"
5175
+ },
5176
+ {
5177
+ internalType: "address",
5178
+ name: "caller_",
5179
+ type: "address"
5180
+ },
5181
+ {
5182
+ internalType: "bytes",
5183
+ name: "moduleParams_",
5184
+ type: "bytes"
5185
+ },
5186
+ {
5187
+ internalType: "bytes[]",
5188
+ name: "preHookParams_",
5189
+ type: "bytes[]"
5190
+ },
5191
+ {
5192
+ internalType: "bytes[]",
5193
+ name: "postHookParams_",
5194
+ type: "bytes[]"
5195
+ }
5196
+ ],
5197
+ name: "execute",
5198
+ outputs: [
5199
+ {
5200
+ internalType: "bytes",
5201
+ name: "result",
5202
+ type: "bytes"
5203
+ }
5204
+ ],
5205
+ stateMutability: "nonpayable",
5206
+ type: "function"
5207
+ },
5208
+ {
5209
+ inputs: [
5210
+ {
5211
+ internalType: "uint256",
5212
+ name: "relationshipId_",
5213
+ type: "uint256"
5214
+ }
5215
+ ],
5216
+ name: "getRelationship",
5217
+ outputs: [
5218
+ {
5219
+ components: [
5220
+ {
5221
+ internalType: "string",
5222
+ name: "relType",
5223
+ type: "string"
5224
+ },
5225
+ {
5226
+ internalType: "address",
5227
+ name: "srcAddress",
5228
+ type: "address"
5229
+ },
5230
+ {
5231
+ internalType: "address",
5232
+ name: "dstAddress",
5233
+ type: "address"
5234
+ },
5235
+ {
5236
+ internalType: "uint256",
5237
+ name: "srcId",
5238
+ type: "uint256"
5239
+ },
5240
+ {
5241
+ internalType: "uint256",
5242
+ name: "dstId",
5243
+ type: "uint256"
5244
+ }
5245
+ ],
5246
+ internalType: "struct LibRelationship.Relationship",
5247
+ name: "",
5248
+ type: "tuple"
5249
+ }
5250
+ ],
5251
+ stateMutability: "view",
5252
+ type: "function"
5253
+ },
5254
+ {
5255
+ inputs: [
5256
+ {
5257
+ components: [
5258
+ {
5259
+ internalType: "string",
5260
+ name: "relType",
5261
+ type: "string"
5262
+ },
5263
+ {
5264
+ internalType: "address",
5265
+ name: "srcAddress",
5266
+ type: "address"
5267
+ },
5268
+ {
5269
+ internalType: "address",
5270
+ name: "dstAddress",
5271
+ type: "address"
5272
+ },
5273
+ {
5274
+ internalType: "uint256",
5275
+ name: "srcId",
5276
+ type: "uint256"
5277
+ },
5278
+ {
5279
+ internalType: "uint256",
5280
+ name: "dstId",
5281
+ type: "uint256"
5282
+ }
5283
+ ],
5284
+ internalType: "struct LibRelationship.Relationship",
5285
+ name: "rel_",
5286
+ type: "tuple"
5287
+ }
5288
+ ],
5289
+ name: "getRelationshipId",
5290
+ outputs: [
5291
+ {
5292
+ internalType: "uint256",
5293
+ name: "",
5294
+ type: "uint256"
5295
+ }
5296
+ ],
5297
+ stateMutability: "view",
5298
+ type: "function"
5299
+ },
5300
+ {
5301
+ inputs: [
5302
+ {
5303
+ internalType: "address",
5304
+ name: "ipOrg_",
5305
+ type: "address"
5306
+ },
5307
+ {
5308
+ internalType: "string",
5309
+ name: "relType_",
5310
+ type: "string"
5311
+ }
5312
+ ],
5313
+ name: "getRelationshipType",
5314
+ outputs: [
5315
+ {
5316
+ components: [
5317
+ {
5318
+ internalType: "address",
5319
+ name: "src",
5320
+ type: "address"
5321
+ },
5322
+ {
5323
+ internalType: "uint256",
5324
+ name: "srcSubtypesMask",
5325
+ type: "uint256"
5326
+ },
5327
+ {
5328
+ internalType: "address",
5329
+ name: "dst",
5330
+ type: "address"
5331
+ },
5332
+ {
5333
+ internalType: "uint256",
5334
+ name: "dstSubtypesMask",
5335
+ type: "uint256"
5336
+ }
5337
+ ],
5338
+ internalType: "struct LibRelationship.RelationshipType",
5339
+ name: "result",
5340
+ type: "tuple"
5341
+ }
5342
+ ],
5343
+ stateMutability: "view",
5344
+ type: "function"
5345
+ },
5346
+ {
5347
+ inputs: [
5348
+ {
5349
+ internalType: "enum HookRegistry.HookType",
5350
+ name: "hookType_",
5351
+ type: "uint8"
5352
+ },
5353
+ {
5354
+ internalType: "bytes32",
5355
+ name: "registryKey_",
5356
+ type: "bytes32"
5357
+ },
5358
+ {
5359
+ internalType: "uint256",
5360
+ name: "index_",
5361
+ type: "uint256"
5362
+ }
5363
+ ],
5364
+ name: "hookAt",
5365
+ outputs: [
5366
+ {
5367
+ internalType: "address",
5368
+ name: "",
5369
+ type: "address"
5370
+ }
5371
+ ],
5372
+ stateMutability: "view",
5373
+ type: "function"
5374
+ },
5375
+ {
5376
+ inputs: [
5377
+ {
5378
+ internalType: "enum HookRegistry.HookType",
5379
+ name: "hookType_",
5380
+ type: "uint8"
5381
+ },
5382
+ {
5383
+ internalType: "bytes32",
5384
+ name: "registryKey_",
5385
+ type: "bytes32"
5386
+ },
5387
+ {
5388
+ internalType: "uint256",
5389
+ name: "index_",
5390
+ type: "uint256"
5391
+ }
5392
+ ],
5393
+ name: "hookConfigAt",
5394
+ outputs: [
5395
+ {
5396
+ internalType: "bytes",
5397
+ name: "",
5398
+ type: "bytes"
5399
+ }
5400
+ ],
5401
+ stateMutability: "view",
5402
+ type: "function"
5403
+ },
5404
+ {
5405
+ inputs: [
5406
+ {
5407
+ internalType: "enum HookRegistry.HookType",
5408
+ name: "hookType_",
5409
+ type: "uint8"
5410
+ },
5411
+ {
5412
+ internalType: "bytes32",
5413
+ name: "registryKey_",
5414
+ type: "bytes32"
5415
+ },
5416
+ {
5417
+ internalType: "address",
5418
+ name: "hook_",
5419
+ type: "address"
5420
+ }
5421
+ ],
5422
+ name: "hookIndex",
5423
+ outputs: [
5424
+ {
5425
+ internalType: "uint256",
5426
+ name: "",
5427
+ type: "uint256"
5428
+ }
5429
+ ],
5430
+ stateMutability: "view",
5431
+ type: "function"
5432
+ },
5433
+ {
5434
+ inputs: [
5435
+ {
5436
+ internalType: "enum HookRegistry.HookType",
5437
+ name: "hookType_",
5438
+ type: "uint8"
5439
+ },
5440
+ {
5441
+ internalType: "bytes32",
5442
+ name: "registryKey_",
5443
+ type: "bytes32"
5444
+ },
5445
+ {
5446
+ internalType: "address",
5447
+ name: "hook_",
5448
+ type: "address"
5449
+ }
5450
+ ],
5451
+ name: "isRegistered",
5452
+ outputs: [
5453
+ {
5454
+ internalType: "bool",
5455
+ name: "",
5456
+ type: "bool"
5457
+ }
5458
+ ],
5459
+ stateMutability: "view",
5460
+ type: "function"
5461
+ },
5462
+ {
5463
+ inputs: [
5464
+ {
5465
+ internalType: "enum HookRegistry.HookType",
5466
+ name: "hType_",
5467
+ type: "uint8"
5468
+ },
5469
+ {
5470
+ internalType: "contract IIPOrg",
5471
+ name: "ipOrg_",
5472
+ type: "address"
5473
+ },
5474
+ {
5475
+ internalType: "string",
5476
+ name: "relType_",
5477
+ type: "string"
5478
+ },
5479
+ {
5480
+ internalType: "address[]",
5481
+ name: "hooks_",
5482
+ type: "address[]"
5483
+ },
5484
+ {
5485
+ internalType: "bytes[]",
5486
+ name: "hooksConfig_",
5487
+ type: "bytes[]"
5488
+ }
5489
+ ],
5490
+ name: "registerHooks",
5491
+ outputs: [
5492
+ ],
5493
+ stateMutability: "nonpayable",
5494
+ type: "function"
5495
+ },
5496
+ {
5497
+ inputs: [
5498
+ {
5499
+ internalType: "enum HookRegistry.HookType",
5500
+ name: "hookType_",
5501
+ type: "uint8"
5502
+ },
5503
+ {
5504
+ internalType: "contract IIPOrg",
5505
+ name: "ipOrg_",
5506
+ type: "address"
5507
+ },
5508
+ {
5509
+ internalType: "bytes32",
5510
+ name: "registryKey_",
5511
+ type: "bytes32"
5512
+ },
5513
+ {
5514
+ internalType: "address[]",
5515
+ name: "hooks_",
5516
+ type: "address[]"
5517
+ },
5518
+ {
5519
+ internalType: "bytes[]",
5520
+ name: "hooksConfig_",
5521
+ type: "bytes[]"
5522
+ }
5523
+ ],
5524
+ name: "registerHooks",
5525
+ outputs: [
5526
+ ],
5527
+ stateMutability: "nonpayable",
5528
+ type: "function"
5529
+ },
5530
+ {
5531
+ inputs: [
5532
+ {
5533
+ components: [
5534
+ {
5535
+ internalType: "string",
5536
+ name: "relType",
5537
+ type: "string"
5538
+ },
5539
+ {
5540
+ internalType: "address",
5541
+ name: "srcAddress",
5542
+ type: "address"
5543
+ },
5544
+ {
5545
+ internalType: "address",
5546
+ name: "dstAddress",
5547
+ type: "address"
5548
+ },
5549
+ {
5550
+ internalType: "uint256",
5551
+ name: "srcId",
5552
+ type: "uint256"
5553
+ },
5554
+ {
5555
+ internalType: "uint256",
5556
+ name: "dstId",
5557
+ type: "uint256"
5558
+ }
5559
+ ],
5560
+ internalType: "struct LibRelationship.Relationship",
5561
+ name: "rel_",
5562
+ type: "tuple"
5563
+ }
5564
+ ],
5565
+ name: "relationshipExists",
5566
+ outputs: [
5567
+ {
5568
+ internalType: "bool",
5569
+ name: "",
5570
+ type: "bool"
5571
+ }
5572
+ ],
5573
+ stateMutability: "view",
5574
+ type: "function"
5575
+ },
5576
+ {
5577
+ inputs: [
5578
+ {
5579
+ internalType: "address",
5580
+ name: "accessControl_",
5581
+ type: "address"
5582
+ }
5583
+ ],
5584
+ name: "setAccessControl",
5585
+ outputs: [
5586
+ ],
5587
+ stateMutability: "nonpayable",
5588
+ type: "function"
5589
+ },
5590
+ {
5591
+ inputs: [
5592
+ {
5593
+ internalType: "enum HookRegistry.HookType",
5594
+ name: "hookType_",
5595
+ type: "uint8"
5596
+ },
5597
+ {
5598
+ internalType: "bytes32",
5599
+ name: "registryKey_",
5600
+ type: "bytes32"
5601
+ }
5602
+ ],
5603
+ name: "totalHooks",
5604
+ outputs: [
5605
+ {
5606
+ internalType: "uint256",
5607
+ name: "",
5608
+ type: "uint256"
5609
+ }
5610
+ ],
5611
+ stateMutability: "view",
5612
+ type: "function"
5613
+ },
5614
+ {
5615
+ inputs: [
5616
+ {
5617
+ internalType: "enum HookRegistry.HookType",
5618
+ name: "hookType_",
5619
+ type: "uint8"
5620
+ },
5621
+ {
5622
+ internalType: "bytes32",
5623
+ name: "registryKey_",
5624
+ type: "bytes32"
5625
+ }
5626
+ ],
5627
+ name: "totalHooksConfig",
5628
+ outputs: [
5629
+ {
5630
+ internalType: "uint256",
5631
+ name: "",
5632
+ type: "uint256"
5633
+ }
5634
+ ],
5635
+ stateMutability: "view",
5636
+ type: "function"
5637
+ }
5638
+ ];
5639
+
5640
+ var relationshipModuleAbi = relationshipModuleJson;
5641
+ var relationshipModuleReadable = formatAbi(relationshipModuleAbi);
2167
5642
  var relationshipModuleConfig = {
2168
- abi: relationshipModuleAbi,
5643
+ abi: parseAbi(relationshipModuleReadable),
2169
5644
  address: getAddress(process.env.RELATIONSHIP_MODULE_CONTRACT || process.env.NEXT_PUBLIC_RELATIONSHIP_MODULE_CONTRACT || "")
2170
5645
  };
2171
5646
 
@@ -2193,7 +5668,7 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2193
5668
  key: "register",
2194
5669
  value: function () {
2195
5670
  var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2196
- var _request$txOptions, _yield$this$rpcClient, call, txHash, _targetLog$args, targetLog;
5671
+ var _request$txOptions, _yield$this$rpcClient, call, txHash, targetLog;
2197
5672
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2198
5673
  while (1) switch (_context.prev = _context.next) {
2199
5674
  case 0:
@@ -2205,11 +5680,8 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2205
5680
  relType: request.relType,
2206
5681
  srcAddress: request.srcContract,
2207
5682
  srcId: request.srcTokenId,
2208
- srcType: request.srcType || 1,
2209
- // This represents the n-th bit on the bit mask
2210
5683
  dstAddress: request.dstContract,
2211
- dstId: request.dstTokenId,
2212
- dstType: request.dstType || 1 // This represents the n-th bit on the bit mask,
5684
+ dstId: request.dstTokenId
2213
5685
  }, [], []],
2214
5686
  account: this.wallet.account
2215
5687
  }));
@@ -2232,7 +5704,7 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2232
5704
  targetLog = _context.sent;
2233
5705
  return _context.abrupt("return", {
2234
5706
  txHash: txHash,
2235
- relationshipId: targetLog === null || targetLog === void 0 || (_targetLog$args = targetLog.args) === null || _targetLog$args === void 0 || (_targetLog$args = _targetLog$args.relationshipId) === null || _targetLog$args === void 0 ? void 0 : _targetLog$args.toString()
5707
+ relationshipId: targetLog === null || targetLog === void 0 ? void 0 : targetLog.args["relationshipId"]
2236
5708
  });
2237
5709
  case 15:
2238
5710
  return _context.abrupt("return", {
@@ -2256,22 +5728,129 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2256
5728
  }
2257
5729
  return register;
2258
5730
  }()
5731
+ }]);
5732
+ return RelationshipClient;
5733
+ }(RelationshipReadOnlyClient);
5734
+
5735
+ /**
5736
+ * Client for managing RelationshipTypes.
5737
+ */
5738
+ var RelationshipTypeReadOnlyClient = /*#__PURE__*/function () {
5739
+ function RelationshipTypeReadOnlyClient(httpClient, rpcClient) {
5740
+ _classCallCheck(this, RelationshipTypeReadOnlyClient);
5741
+ this.httpClient = httpClient;
5742
+ this.rpcClient = rpcClient;
5743
+ }
5744
+
5745
+ /**
5746
+ * Get a RelationshipType by ipOrgId or relType.
5747
+ *
5748
+ * @param ipOrgId - The ID of the IP Org.
5749
+ * @param relType - Relationship Type.
5750
+ * @returns A Promise that resolves to the GetRelationshipTypeResponse.
5751
+ */
5752
+ _createClass(RelationshipTypeReadOnlyClient, [{
5753
+ key: "get",
5754
+ value: function () {
5755
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
5756
+ var params, response;
5757
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
5758
+ while (1) switch (_context.prev = _context.next) {
5759
+ case 0:
5760
+ _context.prev = 0;
5761
+ params = dictToQueryParams(request);
5762
+ _context.next = 4;
5763
+ return this.httpClient.get("/protocol/relationship-type?".concat(params));
5764
+ case 4:
5765
+ response = _context.sent;
5766
+ return _context.abrupt("return", response.data);
5767
+ case 8:
5768
+ _context.prev = 8;
5769
+ _context.t0 = _context["catch"](0);
5770
+ handleError(_context.t0, "Failed to get RelationshipType");
5771
+ case 11:
5772
+ case "end":
5773
+ return _context.stop();
5774
+ }
5775
+ }, _callee, this, [[0, 8]]);
5776
+ }));
5777
+ function get(_x) {
5778
+ return _get.apply(this, arguments);
5779
+ }
5780
+ return get;
5781
+ }()
2259
5782
  /**
2260
- * Register a relationship type on Story Protocol based on the specified input data.
5783
+ * List all RelationshipTypes.
2261
5784
  *
2262
- * @param request - the request object that contains all data needed to register a relationship type
2263
- * @returns the response object that contains results from the register relationship type action
5785
+ * @returns A Promise that resolves to the ListRelationshipTypesResponse.
2264
5786
  */
2265
5787
  }, {
2266
- key: "registerRelationshipType",
5788
+ key: "list",
2267
5789
  value: function () {
2268
- var _registerRelationshipType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
2269
- var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
5790
+ var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
5791
+ var response;
2270
5792
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2271
5793
  while (1) switch (_context2.prev = _context2.next) {
2272
5794
  case 0:
2273
5795
  _context2.prev = 0;
2274
5796
  _context2.next = 3;
5797
+ return this.httpClient.post("/protocol/relationship-type", request, {
5798
+ params: {
5799
+ ipOrgId: request === null || request === void 0 ? void 0 : request.ipOrgId,
5800
+ options: request === null || request === void 0 ? void 0 : request.options
5801
+ }
5802
+ });
5803
+ case 3:
5804
+ response = _context2.sent;
5805
+ return _context2.abrupt("return", response.data);
5806
+ case 7:
5807
+ _context2.prev = 7;
5808
+ _context2.t0 = _context2["catch"](0);
5809
+ handleError(_context2.t0, "Failed to list RelationshipTypes");
5810
+ case 10:
5811
+ case "end":
5812
+ return _context2.stop();
5813
+ }
5814
+ }, _callee2, this, [[0, 7]]);
5815
+ }));
5816
+ function list(_x2) {
5817
+ return _list.apply(this, arguments);
5818
+ }
5819
+ return list;
5820
+ }()
5821
+ }]);
5822
+ return RelationshipTypeReadOnlyClient;
5823
+ }();
5824
+
5825
+ /**
5826
+ * Client for managing relationships.
5827
+ */
5828
+ var RelationshipTypeClient = /*#__PURE__*/function (_RelationshipTypeRead) {
5829
+ _inherits(RelationshipTypeClient, _RelationshipTypeRead);
5830
+ var _super = _createSuper(RelationshipTypeClient);
5831
+ function RelationshipTypeClient(httpClient, rpcClient, wallet) {
5832
+ var _this;
5833
+ _classCallCheck(this, RelationshipTypeClient);
5834
+ _this = _super.call(this, httpClient, rpcClient);
5835
+ _this.wallet = wallet;
5836
+ return _this;
5837
+ }
5838
+ /**
5839
+ * Register a relationship type on Story Protocol based on the specified input data.
5840
+ *
5841
+ * @param request - the request object that contains all data needed to register a relationship type
5842
+ * @returns the response object that contains results from the register relationship type action
5843
+ */
5844
+ _createClass(RelationshipTypeClient, [{
5845
+ key: "register",
5846
+ value: function () {
5847
+ var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
5848
+ var _request$txOptions, _yield$this$rpcClient, call, txHash;
5849
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
5850
+ while (1) switch (_context.prev = _context.next) {
5851
+ case 0:
5852
+ _context.prev = 0;
5853
+ _context.next = 3;
2275
5854
  return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, storyProtocolConfig), {}, {
2276
5855
  functionName: "addRelationshipType",
2277
5856
  args: [{
@@ -2287,50 +5866,50 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2287
5866
  account: this.wallet.account
2288
5867
  }));
2289
5868
  case 3:
2290
- _yield$this$rpcClient2 = _context2.sent;
2291
- call = _yield$this$rpcClient2.request;
2292
- _context2.next = 7;
5869
+ _yield$this$rpcClient = _context.sent;
5870
+ call = _yield$this$rpcClient.request;
5871
+ _context.next = 7;
2293
5872
  return this.wallet.writeContract(call);
2294
5873
  case 7:
2295
- txHash = _context2.sent;
2296
- if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
2297
- _context2.next = 14;
5874
+ txHash = _context.sent;
5875
+ if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
5876
+ _context.next = 14;
2298
5877
  break;
2299
5878
  }
2300
- _context2.next = 11;
5879
+ _context.next = 11;
2301
5880
  return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, relationshipModuleConfig), {}, {
2302
5881
  eventName: "RelationshipTypeSet"
2303
5882
  }));
2304
5883
  case 11:
2305
- return _context2.abrupt("return", {
5884
+ return _context.abrupt("return", {
2306
5885
  txHash: txHash,
2307
5886
  success: true
2308
5887
  });
2309
5888
  case 14:
2310
- return _context2.abrupt("return", {
5889
+ return _context.abrupt("return", {
2311
5890
  txHash: txHash
2312
5891
  });
2313
5892
  case 15:
2314
- _context2.next = 20;
5893
+ _context.next = 20;
2315
5894
  break;
2316
5895
  case 17:
2317
- _context2.prev = 17;
2318
- _context2.t0 = _context2["catch"](0);
2319
- handleError(_context2.t0, "Failed to register relationship");
5896
+ _context.prev = 17;
5897
+ _context.t0 = _context["catch"](0);
5898
+ handleError(_context.t0, "Failed to register relationship");
2320
5899
  case 20:
2321
5900
  case "end":
2322
- return _context2.stop();
5901
+ return _context.stop();
2323
5902
  }
2324
- }, _callee2, this, [[0, 17]]);
5903
+ }, _callee, this, [[0, 17]]);
2325
5904
  }));
2326
- function registerRelationshipType(_x2) {
2327
- return _registerRelationshipType.apply(this, arguments);
5905
+ function register(_x) {
5906
+ return _register.apply(this, arguments);
2328
5907
  }
2329
- return registerRelationshipType;
5908
+ return register;
2330
5909
  }()
2331
5910
  }]);
2332
- return RelationshipClient;
2333
- }(RelationshipReadOnlyClient);
5911
+ return RelationshipTypeClient;
5912
+ }(RelationshipTypeReadOnlyClient);
2334
5913
 
2335
5914
  if (typeof process !== "undefined") {
2336
5915
  dotenv.config();
@@ -2352,17 +5931,15 @@ var StoryClient = /*#__PURE__*/function () {
2352
5931
  _defineProperty(this, "_transaction", null);
2353
5932
  _defineProperty(this, "_ipAsset", null);
2354
5933
  _defineProperty(this, "_relationship", null);
5934
+ _defineProperty(this, "_relationshipType", null);
2355
5935
  _defineProperty(this, "_module", null);
2356
5936
  _defineProperty(this, "_hook", null);
2357
5937
  _defineProperty(this, "_platform", null);
2358
- if (config.environment !== Environment.TEST) {
2359
- throw new Error("Invalid Environment: Only TEST environment is supported");
2360
- }
2361
5938
  this.config = config;
2362
5939
  this.isReadOnly = isReadOnly;
2363
5940
  var clientConfig = {
2364
5941
  chain: this.config.chain || sepolia,
2365
- transport: this.config.transport || http("https://sepolia.gateway.tenderly.co")
5942
+ transport: this.config.transport || http(process.env.RPC_PROVIDER_URL)
2366
5943
  };
2367
5944
  this.rpcClient = createPublicClient(clientConfig);
2368
5945
  if (!isReadOnly) {
@@ -2406,6 +5983,15 @@ var StoryClient = /*#__PURE__*/function () {
2406
5983
  this._relationship = new RelationshipClient(this.httpClient, this.rpcClient, this.wallet);
2407
5984
  }
2408
5985
  }
5986
+ }, {
5987
+ key: "initRelationshipType",
5988
+ value: function initRelationshipType() {
5989
+ if (this.isReadOnly) {
5990
+ this._relationshipType = new RelationshipTypeReadOnlyClient(this.httpClient, this.rpcClient);
5991
+ } else {
5992
+ this._relationshipType = new RelationshipTypeClient(this.httpClient, this.rpcClient, this.wallet);
5993
+ }
5994
+ }
2409
5995
  }, {
2410
5996
  key: "initIpAsset",
2411
5997
  value: function initIpAsset() {
@@ -2487,6 +6073,21 @@ var StoryClient = /*#__PURE__*/function () {
2487
6073
  return this._relationship;
2488
6074
  }
2489
6075
 
6076
+ /**
6077
+ * Getter for the relationship type client. The client is lazily created when
6078
+ * this method is called.
6079
+ *
6080
+ * @returns the RelationshipTypeClient instance
6081
+ */
6082
+ }, {
6083
+ key: "relationshipType",
6084
+ get: function get() {
6085
+ if (this._relationshipType === null) {
6086
+ this.initRelationshipType();
6087
+ }
6088
+ return this._relationshipType;
6089
+ }
6090
+
2490
6091
  /**
2491
6092
  * Getter for the IP Asset client. The client is lazily created when
2492
6093
  * this method is called.
@@ -2617,4 +6218,27 @@ var ResourceType = /*#__PURE__*/function (ResourceType) {
2617
6218
  return ResourceType;
2618
6219
  }({});
2619
6220
 
2620
- export { Environment, IPAssetType, ResourceType, StoryClient };
6221
+ /**
6222
+ * @public
6223
+ */
6224
+ var HookType = /*#__PURE__*/function (HookType) {
6225
+ HookType[HookType["PRE_ACTION"] = 0] = "PRE_ACTION";
6226
+ HookType[HookType["POST_ACTION"] = 1] = "POST_ACTION";
6227
+ return HookType;
6228
+ }({});
6229
+
6230
+ /**
6231
+ * @public
6232
+ */
6233
+ var ActionType = /*#__PURE__*/function (ActionType) {
6234
+ ActionType[ActionType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
6235
+ ActionType[ActionType["REGISTER"] = 1] = "REGISTER";
6236
+ ActionType[ActionType["UNREGISTER"] = 2] = "UNREGISTER";
6237
+ ActionType[ActionType["CONFIGURE"] = 3] = "CONFIGURE";
6238
+ ActionType[ActionType["CREATE"] = 4] = "CREATE";
6239
+ return ActionType;
6240
+ }({});
6241
+
6242
+ var AddressZero = "0x0000000000000000000000000000000000000000";
6243
+
6244
+ export { ActionType, AddressZero, HookReadOnlyClient, HookType, IPAssetClient, IPAssetReadOnlyClient, IPAssetType, IPOrgClient, IPOrgReadOnlyClient, LicenseClient, LicenseReadOnlyClient, ModuleReadOnlyClient, PlatformClient, RelationshipClient, ResourceType, StoryClient, TransactionClient };