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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) 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 +17 -1
  8. package/dist/declarations/src/index.d.ts.map +1 -1
  9. package/dist/declarations/src/resources/relationship.d.ts +1 -8
  10. package/dist/declarations/src/resources/relationship.d.ts.map +1 -1
  11. package/dist/declarations/src/resources/relationshipType.d.ts +19 -0
  12. package/dist/declarations/src/resources/relationshipType.d.ts.map +1 -0
  13. package/dist/declarations/src/resources/relationshipTypeReadOnly.d.ts +26 -0
  14. package/dist/declarations/src/resources/relationshipTypeReadOnly.d.ts.map +1 -0
  15. package/dist/declarations/src/types/client.d.ts +4 -0
  16. package/dist/declarations/src/types/client.d.ts.map +1 -1
  17. package/dist/declarations/src/types/resources/relationship.d.ts +0 -15
  18. package/dist/declarations/src/types/resources/relationship.d.ts.map +1 -1
  19. package/dist/declarations/src/types/resources/relationshipType.d.ts +44 -0
  20. package/dist/declarations/src/types/resources/relationshipType.d.ts.map +1 -0
  21. package/dist/declarations/src/utils/platform.d.ts.map +1 -1
  22. package/dist/story-protocol-core-sdk.cjs.dev.js +4102 -464
  23. package/dist/story-protocol-core-sdk.cjs.prod.js +4102 -464
  24. package/dist/story-protocol-core-sdk.esm.js +4089 -465
  25. package/package.json +1 -1
@@ -589,306 +589,1085 @@ var IPOrgReadOnlyClient = /*#__PURE__*/function () {
589
589
  return IPOrgReadOnlyClient;
590
590
  }();
591
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
+
592
1179
  if (typeof process !== "undefined") {
593
1180
  dotenv.config();
594
1181
  }
595
- var storyProtocolAbi = [{
596
- inputs: [{
597
- internalType: "address",
598
- name: "owner_",
599
- type: "address"
600
- }, {
601
- internalType: "string",
602
- name: "name_",
603
- type: "string"
604
- }, {
605
- internalType: "string",
606
- name: "symbol_",
607
- type: "string"
608
- }, {
609
- internalType: "string[]",
610
- name: "ipAssetTypes_",
611
- type: "string[]"
612
- }],
613
- name: "registerIpOrg",
614
- outputs: [{
615
- internalType: "address",
616
- name: "ipOrg_",
617
- type: "address"
618
- }],
619
- stateMutability: "nonpayable",
620
- type: "function"
621
- }, {
622
- inputs: [{
623
- internalType: "address",
624
- name: "ipOrg_",
625
- type: "address"
626
- }, {
627
- components: [{
628
- internalType: "bool",
629
- name: "isCommercial",
630
- type: "bool"
631
- }, {
632
- internalType: "uint256",
633
- name: "parentLicenseId",
634
- type: "uint256"
635
- }],
636
- internalType: "struct Licensing.LicenseCreation",
637
- name: "params_",
638
- type: "tuple"
639
- }, {
640
- internalType: "address",
641
- name: "licensee_",
642
- type: "address"
643
- }, {
644
- internalType: "bytes[]",
645
- name: "preHooksData_",
646
- type: "bytes[]"
647
- }, {
648
- internalType: "bytes[]",
649
- name: "postHooksData_",
650
- type: "bytes[]"
651
- }],
652
- name: "createLicenseNft",
653
- outputs: [{
654
- internalType: "uint256",
655
- name: "",
656
- type: "uint256"
657
- }],
658
- stateMutability: "nonpayable",
659
- type: "function"
660
- }, {
661
- inputs: [{
662
- internalType: "address",
663
- name: "ipOrg_",
664
- type: "address"
665
- }, {
666
- components: [{
667
- internalType: "bool",
668
- name: "isCommercial",
669
- type: "bool"
670
- }, {
671
- internalType: "uint256",
672
- name: "parentLicenseId",
673
- type: "uint256"
674
- }],
675
- internalType: "struct Licensing.LicenseCreation",
676
- name: "params_",
677
- type: "tuple"
678
- }, {
679
- internalType: "uint256",
680
- name: "ipaId_",
681
- type: "uint256"
682
- }, {
683
- internalType: "bytes[]",
684
- name: "preHooksData_",
685
- type: "bytes[]"
686
- }, {
687
- internalType: "bytes[]",
688
- name: "postHooksData_",
689
- type: "bytes[]"
690
- }],
691
- name: "createIpaBoundLicense",
692
- outputs: [{
693
- internalType: "uint256",
694
- name: "",
695
- type: "uint256"
696
- }],
697
- stateMutability: "nonpayable",
698
- type: "function"
699
- }, {
700
- inputs: [{
701
- internalType: "address",
702
- name: "ipOrg_",
703
- type: "address"
704
- }, {
705
- components: [{
706
- internalType: "address",
707
- name: "owner",
708
- type: "address"
709
- }, {
710
- internalType: "uint8",
711
- name: "ipOrgAssetType",
712
- type: "uint8"
713
- }, {
714
- internalType: "string",
715
- name: "name",
716
- type: "string"
717
- }, {
718
- internalType: "bytes32",
719
- name: "hash",
720
- type: "bytes32"
721
- }, {
722
- internalType: "string",
723
- name: "mediaUrl",
724
- type: "string"
725
- }],
726
- internalType: "struct Registration.RegisterIPAssetParams",
727
- name: "params_",
728
- type: "tuple"
729
- }, {
730
- internalType: "bytes[]",
731
- name: "preHooksData_",
732
- type: "bytes[]"
733
- }, {
734
- internalType: "bytes[]",
735
- name: "postHooksData_",
736
- type: "bytes[]"
737
- }],
738
- name: "registerIPAsset",
739
- outputs: [{
740
- internalType: "uint256",
741
- name: "",
742
- type: "uint256"
743
- }, {
744
- internalType: "uint256",
745
- name: "",
746
- type: "uint256"
747
- }],
748
- stateMutability: "nonpayable",
749
- type: "function"
750
- }, {
751
- inputs: [{
752
- components: [{
753
- internalType: "string",
754
- name: "relType",
755
- type: "string"
756
- }, {
757
- internalType: "address",
758
- name: "ipOrg",
759
- type: "address"
760
- }, {
761
- components: [{
762
- internalType: "enum LibRelationship.Relatables",
763
- name: "src",
764
- type: "uint8"
765
- }, {
766
- internalType: "enum LibRelationship.Relatables",
767
- name: "dst",
768
- type: "uint8"
769
- }],
770
- internalType: "struct LibRelationship.RelatedElements",
771
- name: "allowedElements",
772
- type: "tuple"
773
- }, {
774
- internalType: "uint8[]",
775
- name: "allowedSrcs",
776
- type: "uint8[]"
777
- }, {
778
- internalType: "uint8[]",
779
- name: "allowedDsts",
780
- type: "uint8[]"
781
- }],
782
- internalType: "struct LibRelationship.AddRelationshipTypeParams",
783
- name: "params_",
784
- type: "tuple"
785
- }],
786
- name: "addRelationshipType",
787
- outputs: [],
788
- stateMutability: "nonpayable",
789
- type: "function"
790
- }, {
791
- inputs: [{
792
- internalType: "address",
793
- name: "ipOrg_",
794
- type: "address"
795
- }, {
796
- components: [{
797
- internalType: "string",
798
- name: "relType",
799
- type: "string"
800
- }, {
801
- internalType: "address",
802
- name: "srcAddress",
803
- type: "address"
804
- }, {
805
- internalType: "uint256",
806
- name: "srcId",
807
- type: "uint256"
808
- }, {
809
- internalType: "address",
810
- name: "dstAddress",
811
- type: "address"
812
- }, {
813
- internalType: "uint256",
814
- name: "dstId",
815
- type: "uint256"
816
- }],
817
- internalType: "struct LibRelationship.CreateRelationshipParams",
818
- name: "params_",
819
- type: "tuple"
820
- }, {
821
- internalType: "bytes[]",
822
- name: "preHooksData_",
823
- type: "bytes[]"
824
- }, {
825
- internalType: "bytes[]",
826
- name: "postHooksData_",
827
- type: "bytes[]"
828
- }],
829
- name: "createRelationship",
830
- outputs: [{
831
- internalType: "uint256",
832
- name: "relId",
833
- type: "uint256"
834
- }],
835
- stateMutability: "nonpayable",
836
- type: "function"
837
- }, {
838
- inputs: [{
839
- internalType: "address",
840
- name: "ipOrg_",
841
- type: "address"
842
- }, {
843
- internalType: "string",
844
- name: "relType",
845
- type: "string"
846
- }],
847
- name: "removeRelationshipType",
848
- outputs: [],
849
- stateMutability: "nonpayable",
850
- type: "function"
851
- }];
1182
+ var storyProtocolAbi = storyProtocolJson;
852
1183
  var storyProtocolReadable = formatAbi(storyProtocolAbi);
853
1184
  var storyProtocolConfig = {
854
1185
  abi: parseAbi(storyProtocolReadable),
855
1186
  address: getAddress(process.env.STORY_PROTOCOL_CONTRACT || process.env.NEXT_PUBLIC_STORY_PROTOCOL_CONTRACT || "")
856
1187
  };
857
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
+
858
1667
  if (typeof process !== "undefined") {
859
1668
  dotenv.config();
860
1669
  }
861
- var ipOrgControllerAbi = [{
862
- anonymous: false,
863
- inputs: [{
864
- indexed: false,
865
- internalType: "address",
866
- name: "owner",
867
- type: "address"
868
- }, {
869
- indexed: false,
870
- internalType: "address",
871
- name: "ipAssetOrg",
872
- type: "address"
873
- }, {
874
- indexed: false,
875
- internalType: "string",
876
- name: "name",
877
- type: "string"
878
- }, {
879
- indexed: false,
880
- internalType: "string",
881
- name: "symbol",
882
- type: "string"
883
- }, {
884
- indexed: false,
885
- internalType: "string[]",
886
- name: "ipAssetTypes",
887
- type: "string[]"
888
- }],
889
- name: "IPOrgRegistered",
890
- type: "event"
891
- }];
1670
+ var ipOrgControllerAbi = ipOrgControllerRawAbi;
892
1671
  var ipOrgControllerReadable = formatAbi(ipOrgControllerAbi);
893
1672
  var ipOrgControllerConfig = {
894
1673
  abi: parseAbi(ipOrgControllerReadable),
@@ -1058,6 +1837,14 @@ function _waitTxAndFilterLog() {
1058
1837
  }));
1059
1838
  return _waitTxAndFilterLog.apply(this, arguments);
1060
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
+ };
1061
1848
 
1062
1849
  /**
1063
1850
  * IPOrgClient allows you to create, update, view, search IPOrgs on
@@ -1114,7 +1901,7 @@ var IPOrgClient = /*#__PURE__*/function (_IPOrgReadOnlyClient) {
1114
1901
  targetLog = _context.sent;
1115
1902
  return _context.abrupt("return", {
1116
1903
  txHash: txHash,
1117
- ipOrgId: targetLog.args.ipAssetOrg
1904
+ ipOrgId: String(targetLog === null || targetLog === void 0 ? void 0 : targetLog.args["ipAssetOrg"])
1118
1905
  });
1119
1906
  case 15:
1120
1907
  return _context.abrupt("return", {
@@ -1328,55 +2115,997 @@ var IPAssetReadOnlyClient = /*#__PURE__*/function () {
1328
2115
  return IPAssetReadOnlyClient;
1329
2116
  }();
1330
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
+
1331
3105
  if (typeof process !== "undefined") {
1332
3106
  dotenv.config();
1333
3107
  }
1334
- var registrationModuleAbi = [{
1335
- anonymous: false,
1336
- inputs: [{
1337
- indexed: false,
1338
- internalType: "uint256",
1339
- name: "ipAssetId_",
1340
- type: "uint256"
1341
- }, {
1342
- indexed: true,
1343
- internalType: "address",
1344
- name: "ipOrg_",
1345
- type: "address"
1346
- }, {
1347
- indexed: false,
1348
- internalType: "uint256",
1349
- name: "ipOrgAssetId_",
1350
- type: "uint256"
1351
- }, {
1352
- indexed: true,
1353
- internalType: "address",
1354
- name: "owner_",
1355
- type: "address"
1356
- }, {
1357
- indexed: false,
1358
- internalType: "string",
1359
- name: "name_",
1360
- type: "string"
1361
- }, {
1362
- indexed: true,
1363
- internalType: "uint8",
1364
- name: "ipOrgAssetType_",
1365
- type: "uint8"
1366
- }, {
1367
- indexed: false,
1368
- internalType: "bytes32",
1369
- name: "hash_",
1370
- type: "bytes32"
1371
- }, {
1372
- indexed: false,
1373
- internalType: "string",
1374
- name: "mediaUrl_",
1375
- type: "string"
1376
- }],
1377
- name: "IPAssetRegistered",
1378
- type: "event"
1379
- }];
3108
+ var registrationModuleAbi = registrationModuleJson;
1380
3109
  var registrationModuleReadable = formatAbi(registrationModuleAbi);
1381
3110
  var registrationModuleConfig = {
1382
3111
  abi: parseAbi(registrationModuleReadable),
@@ -1445,7 +3174,7 @@ var IPAssetClient = /*#__PURE__*/function (_IPAssetReadOnlyClien) {
1445
3174
  targetLog = _context.sent;
1446
3175
  return _context.abrupt("return", {
1447
3176
  txHash: txHash,
1448
- ipAssetId: targetLog.args.ipAssetId_.toString()
3177
+ ipAssetId: String(targetLog === null || targetLog === void 0 ? void 0 : targetLog.args["ipAssetId_"])
1449
3178
  });
1450
3179
  case 15:
1451
3180
  return _context.abrupt("return", {
@@ -1933,6 +3662,7 @@ var PlatformClient = /*#__PURE__*/function () {
1933
3662
  };
1934
3663
  _context.next = 7;
1935
3664
  return this.httpClient.post("/protocol/v2/files/upload", paylod, {
3665
+ timeout: 0,
1936
3666
  headers: {
1937
3667
  "Content-Type": "application/json"
1938
3668
  }
@@ -1943,7 +3673,7 @@ var PlatformClient = /*#__PURE__*/function () {
1943
3673
  case 11:
1944
3674
  _context.prev = 11;
1945
3675
  _context.t0 = _context["catch"](0);
1946
- return _context.abrupt("return", handleError(_context.t0, "Failed to upload file"));
3676
+ return _context.abrupt("return", handleError(_context.t0, ">>> Failed to upload file"));
1947
3677
  case 14:
1948
3678
  case "end":
1949
3679
  return _context.stop();
@@ -1959,20 +3689,813 @@ var PlatformClient = /*#__PURE__*/function () {
1959
3689
  return PlatformClient;
1960
3690
  }();
1961
3691
 
1962
- var licenseRegistryAbi = [{
1963
- anonymous: false,
1964
- inputs: [{
1965
- indexed: true,
1966
- internalType: "uint256",
1967
- name: "id",
1968
- type: "uint256"
1969
- }],
1970
- name: "LicenseRegistered",
1971
- type: "event"
1972
- }];
1973
- 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);
1974
4497
  var licenseRegistryConfig = {
1975
- abi: licenseRegistryAbi,
4498
+ abi: parseAbi(licenseRegistryReadable),
1976
4499
  address: getAddress(process.env.LICENSE_REGISTRY_CONTRACT || process.env.NEXT_PUBLIC_LICENSE_REGISTRY_CONTRACT || "")
1977
4500
  };
1978
4501
 
@@ -1993,7 +4516,7 @@ var LicenseClient = /*#__PURE__*/function (_LicenseReadOnlyClien) {
1993
4516
  key: "create",
1994
4517
  value: function () {
1995
4518
  var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
1996
- 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;
1997
4520
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1998
4521
  while (1) switch (_context.prev = _context.next) {
1999
4522
  case 0:
@@ -2049,7 +4572,7 @@ var LicenseClient = /*#__PURE__*/function (_LicenseReadOnlyClien) {
2049
4572
  targetLog = _context.sent;
2050
4573
  return _context.abrupt("return", {
2051
4574
  txHash: txHash,
2052
- 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"])
2053
4576
  });
2054
4577
  case 26:
2055
4578
  return _context.abrupt("return", {
@@ -2087,91 +4610,1037 @@ var LicenseClient = /*#__PURE__*/function (_LicenseReadOnlyClien) {
2087
4610
  return LicenseClient;
2088
4611
  }(LicenseReadOnlyClient);
2089
4612
 
2090
- var relationshipModuleAbi = [
2091
- // EVENTS
2092
- {
2093
- anonymous: false,
2094
- inputs: [{
2095
- indexed: true,
2096
- internalType: "uint256",
2097
- name: "relationshipId",
2098
- type: "uint256"
2099
- }, {
2100
- indexed: true,
2101
- internalType: "string",
2102
- name: "relType",
2103
- type: "string"
2104
- }, {
2105
- indexed: false,
2106
- internalType: "address",
2107
- name: "srcAddress",
2108
- type: "address"
2109
- }, {
2110
- indexed: false,
2111
- internalType: "uint256",
2112
- name: "srcId",
2113
- type: "uint256"
2114
- }, {
2115
- indexed: false,
2116
- internalType: "address",
2117
- name: "dstAddress",
2118
- type: "address"
2119
- }, {
2120
- indexed: false,
2121
- internalType: "uint256",
2122
- name: "dstId",
2123
- type: "uint256"
2124
- }],
2125
- name: "RelationshipCreated",
2126
- type: "event"
2127
- }, {
2128
- anonymous: false,
2129
- inputs: [{
2130
- indexed: true,
2131
- internalType: "string",
2132
- name: "relType",
2133
- type: "string"
2134
- }, {
2135
- indexed: true,
2136
- internalType: "address",
2137
- name: "ipOrg",
2138
- type: "address"
2139
- }, {
2140
- indexed: false,
2141
- internalType: "address",
2142
- name: "src",
2143
- type: "address"
2144
- }, {
2145
- indexed: false,
2146
- internalType: "enum LibRelationship.Relatables",
2147
- name: "srcRelatable",
2148
- type: "uint8"
2149
- }, {
2150
- indexed: false,
2151
- internalType: "uint256",
2152
- name: "srcSubtypesMask",
2153
- type: "uint256"
2154
- }, {
2155
- indexed: false,
2156
- internalType: "address",
2157
- name: "dst",
2158
- type: "address"
2159
- }, {
2160
- indexed: false,
2161
- internalType: "enum LibRelationship.Relatables",
2162
- name: "dstRelatable",
2163
- type: "uint8"
2164
- }, {
2165
- indexed: false,
2166
- internalType: "uint256",
2167
- name: "dstSubtypesMask",
2168
- type: "uint256"
2169
- }],
2170
- name: "RelationshipTypeSet",
2171
- type: "event"
2172
- }];
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);
2173
5642
  var relationshipModuleConfig = {
2174
- abi: relationshipModuleAbi,
5643
+ abi: parseAbi(relationshipModuleReadable),
2175
5644
  address: getAddress(process.env.RELATIONSHIP_MODULE_CONTRACT || process.env.NEXT_PUBLIC_RELATIONSHIP_MODULE_CONTRACT || "")
2176
5645
  };
2177
5646
 
@@ -2199,7 +5668,7 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2199
5668
  key: "register",
2200
5669
  value: function () {
2201
5670
  var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
2202
- var _request$txOptions, _yield$this$rpcClient, call, txHash, _targetLog$args, targetLog;
5671
+ var _request$txOptions, _yield$this$rpcClient, call, txHash, targetLog;
2203
5672
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2204
5673
  while (1) switch (_context.prev = _context.next) {
2205
5674
  case 0:
@@ -2235,7 +5704,7 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2235
5704
  targetLog = _context.sent;
2236
5705
  return _context.abrupt("return", {
2237
5706
  txHash: txHash,
2238
- 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"]
2239
5708
  });
2240
5709
  case 15:
2241
5710
  return _context.abrupt("return", {
@@ -2259,22 +5728,129 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2259
5728
  }
2260
5729
  return register;
2261
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
+ }()
2262
5782
  /**
2263
- * Register a relationship type on Story Protocol based on the specified input data.
5783
+ * List all RelationshipTypes.
2264
5784
  *
2265
- * @param request - the request object that contains all data needed to register a relationship type
2266
- * @returns the response object that contains results from the register relationship type action
5785
+ * @returns A Promise that resolves to the ListRelationshipTypesResponse.
2267
5786
  */
2268
5787
  }, {
2269
- key: "registerRelationshipType",
5788
+ key: "list",
2270
5789
  value: function () {
2271
- var _registerRelationshipType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
2272
- var _request$txOptions2, _yield$this$rpcClient2, call, txHash;
5790
+ var _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
5791
+ var response;
2273
5792
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2274
5793
  while (1) switch (_context2.prev = _context2.next) {
2275
5794
  case 0:
2276
5795
  _context2.prev = 0;
2277
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;
2278
5854
  return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, storyProtocolConfig), {}, {
2279
5855
  functionName: "addRelationshipType",
2280
5856
  args: [{
@@ -2290,50 +5866,50 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
2290
5866
  account: this.wallet.account
2291
5867
  }));
2292
5868
  case 3:
2293
- _yield$this$rpcClient2 = _context2.sent;
2294
- call = _yield$this$rpcClient2.request;
2295
- _context2.next = 7;
5869
+ _yield$this$rpcClient = _context.sent;
5870
+ call = _yield$this$rpcClient.request;
5871
+ _context.next = 7;
2296
5872
  return this.wallet.writeContract(call);
2297
5873
  case 7:
2298
- txHash = _context2.sent;
2299
- if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
2300
- _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;
2301
5877
  break;
2302
5878
  }
2303
- _context2.next = 11;
5879
+ _context.next = 11;
2304
5880
  return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, relationshipModuleConfig), {}, {
2305
5881
  eventName: "RelationshipTypeSet"
2306
5882
  }));
2307
5883
  case 11:
2308
- return _context2.abrupt("return", {
5884
+ return _context.abrupt("return", {
2309
5885
  txHash: txHash,
2310
5886
  success: true
2311
5887
  });
2312
5888
  case 14:
2313
- return _context2.abrupt("return", {
5889
+ return _context.abrupt("return", {
2314
5890
  txHash: txHash
2315
5891
  });
2316
5892
  case 15:
2317
- _context2.next = 20;
5893
+ _context.next = 20;
2318
5894
  break;
2319
5895
  case 17:
2320
- _context2.prev = 17;
2321
- _context2.t0 = _context2["catch"](0);
2322
- 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");
2323
5899
  case 20:
2324
5900
  case "end":
2325
- return _context2.stop();
5901
+ return _context.stop();
2326
5902
  }
2327
- }, _callee2, this, [[0, 17]]);
5903
+ }, _callee, this, [[0, 17]]);
2328
5904
  }));
2329
- function registerRelationshipType(_x2) {
2330
- return _registerRelationshipType.apply(this, arguments);
5905
+ function register(_x) {
5906
+ return _register.apply(this, arguments);
2331
5907
  }
2332
- return registerRelationshipType;
5908
+ return register;
2333
5909
  }()
2334
5910
  }]);
2335
- return RelationshipClient;
2336
- }(RelationshipReadOnlyClient);
5911
+ return RelationshipTypeClient;
5912
+ }(RelationshipTypeReadOnlyClient);
2337
5913
 
2338
5914
  if (typeof process !== "undefined") {
2339
5915
  dotenv.config();
@@ -2355,6 +5931,7 @@ var StoryClient = /*#__PURE__*/function () {
2355
5931
  _defineProperty(this, "_transaction", null);
2356
5932
  _defineProperty(this, "_ipAsset", null);
2357
5933
  _defineProperty(this, "_relationship", null);
5934
+ _defineProperty(this, "_relationshipType", null);
2358
5935
  _defineProperty(this, "_module", null);
2359
5936
  _defineProperty(this, "_hook", null);
2360
5937
  _defineProperty(this, "_platform", null);
@@ -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 { 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 };