@story-protocol/core-sdk 0.0.1-beta-rc.11 → 0.0.1-beta-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/declarations/src/client.d.ts +9 -9
- package/dist/declarations/src/client.d.ts.map +1 -1
- package/dist/declarations/src/clients/storyAPI.d.ts +0 -2
- package/dist/declarations/src/clients/storyAPI.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +3 -4
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/resources/dispute.d.ts +419 -78
- package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAccount.d.ts +400 -76
- package/dist/declarations/src/resources/ipAccount.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +26 -756
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +3411 -650
- package/dist/declarations/src/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/resources/permission.d.ts +1000 -313
- package/dist/declarations/src/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/resources/royalty.d.ts +3103 -0
- package/dist/declarations/src/resources/{policy.d.ts.map → royalty.d.ts.map} +1 -1
- package/dist/declarations/src/types/config.d.ts +6 -2
- package/dist/declarations/src/types/config.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +5 -21
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +54 -18
- package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/royalty.d.ts +41 -0
- package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
- package/dist/story-protocol-core-sdk.cjs.dev.js +1580 -1371
- package/dist/story-protocol-core-sdk.cjs.prod.js +1580 -1371
- package/dist/story-protocol-core-sdk.esm.js +1583 -1373
- package/package.json +5 -5
- package/dist/declarations/src/resources/policy.d.ts +0 -2436
- package/dist/declarations/src/types/resources/policy.d.ts +0 -83
- package/dist/declarations/src/types/resources/policy.d.ts.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { defineChain, decodeEventLog, getAddress, encodeFunctionData, zeroAddress, stringToHex, createPublicClient, createWalletClient } from 'viem';
|
2
2
|
import * as dotenv from 'dotenv';
|
3
|
-
import {
|
3
|
+
import { sepolia as sepolia$1 } from 'viem/chains';
|
4
4
|
import axios from 'axios';
|
5
5
|
|
6
6
|
function toPrimitive(t, r) {
|
@@ -413,31 +413,12 @@ function _asyncToGenerator(fn) {
|
|
413
413
|
};
|
414
414
|
}
|
415
415
|
|
416
|
-
function handleError(error, msg) {
|
417
|
-
if (error instanceof Error) {
|
418
|
-
throw new Error("".concat(msg, ": ").concat(error.message));
|
419
|
-
}
|
420
|
-
throw new Error("".concat(msg, ": Unknown error type"));
|
421
|
-
}
|
422
|
-
|
423
|
-
var AddressZero = "0x0000000000000000000000000000000000000000";
|
424
|
-
var HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
425
|
-
var SepoliaChainId = "11155111";
|
426
|
-
|
427
416
|
function _arrayLikeToArray(arr, len) {
|
428
417
|
if (len == null || len > arr.length) len = arr.length;
|
429
418
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
430
419
|
return arr2;
|
431
420
|
}
|
432
421
|
|
433
|
-
function _arrayWithoutHoles(arr) {
|
434
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
435
|
-
}
|
436
|
-
|
437
|
-
function _iterableToArray(iter) {
|
438
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
439
|
-
}
|
440
|
-
|
441
422
|
function _unsupportedIterableToArray(o, minLen) {
|
442
423
|
if (!o) return;
|
443
424
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
@@ -447,6 +428,215 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
447
428
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
448
429
|
}
|
449
430
|
|
431
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
432
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
433
|
+
if (!it) {
|
434
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
435
|
+
if (it) o = it;
|
436
|
+
var i = 0;
|
437
|
+
var F = function () {};
|
438
|
+
return {
|
439
|
+
s: F,
|
440
|
+
n: function () {
|
441
|
+
if (i >= o.length) return {
|
442
|
+
done: true
|
443
|
+
};
|
444
|
+
return {
|
445
|
+
done: false,
|
446
|
+
value: o[i++]
|
447
|
+
};
|
448
|
+
},
|
449
|
+
e: function (e) {
|
450
|
+
throw e;
|
451
|
+
},
|
452
|
+
f: F
|
453
|
+
};
|
454
|
+
}
|
455
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
456
|
+
}
|
457
|
+
var normalCompletion = true,
|
458
|
+
didErr = false,
|
459
|
+
err;
|
460
|
+
return {
|
461
|
+
s: function () {
|
462
|
+
it = it.call(o);
|
463
|
+
},
|
464
|
+
n: function () {
|
465
|
+
var step = it.next();
|
466
|
+
normalCompletion = step.done;
|
467
|
+
return step;
|
468
|
+
},
|
469
|
+
e: function (e) {
|
470
|
+
didErr = true;
|
471
|
+
err = e;
|
472
|
+
},
|
473
|
+
f: function () {
|
474
|
+
try {
|
475
|
+
if (!normalCompletion && it.return != null) it.return();
|
476
|
+
} finally {
|
477
|
+
if (didErr) throw err;
|
478
|
+
}
|
479
|
+
}
|
480
|
+
};
|
481
|
+
}
|
482
|
+
|
483
|
+
function parseToBigInt(num) {
|
484
|
+
return BigInt(num);
|
485
|
+
}
|
486
|
+
function waitTxAndFilterLog(_x, _x2, _x3) {
|
487
|
+
return _waitTxAndFilterLog.apply(this, arguments);
|
488
|
+
}
|
489
|
+
function _waitTxAndFilterLog() {
|
490
|
+
_waitTxAndFilterLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(client, txHash, params) {
|
491
|
+
var txReceipt, targetLogs, _iterator, _step, log, currentLog;
|
492
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
493
|
+
while (1) switch (_context.prev = _context.next) {
|
494
|
+
case 0:
|
495
|
+
_context.next = 2;
|
496
|
+
return client.waitForTransactionReceipt({
|
497
|
+
hash: txHash,
|
498
|
+
confirmations: params.confirmations,
|
499
|
+
pollingInterval: params.pollingInterval,
|
500
|
+
timeout: params.timeout
|
501
|
+
});
|
502
|
+
case 2:
|
503
|
+
txReceipt = _context.sent;
|
504
|
+
targetLogs = [];
|
505
|
+
_iterator = _createForOfIteratorHelper(txReceipt.logs);
|
506
|
+
_context.prev = 5;
|
507
|
+
_iterator.s();
|
508
|
+
case 7:
|
509
|
+
if ((_step = _iterator.n()).done) {
|
510
|
+
_context.next = 21;
|
511
|
+
break;
|
512
|
+
}
|
513
|
+
log = _step.value;
|
514
|
+
_context.prev = 9;
|
515
|
+
if (!(params.from && log.address !== params.from.toLowerCase())) {
|
516
|
+
_context.next = 12;
|
517
|
+
break;
|
518
|
+
}
|
519
|
+
return _context.abrupt("continue", 19);
|
520
|
+
case 12:
|
521
|
+
currentLog = decodeEventLog({
|
522
|
+
abi: params.abi,
|
523
|
+
eventName: params.eventName,
|
524
|
+
data: log.data,
|
525
|
+
topics: log.topics
|
526
|
+
});
|
527
|
+
targetLogs.push(currentLog);
|
528
|
+
_context.next = 19;
|
529
|
+
break;
|
530
|
+
case 16:
|
531
|
+
_context.prev = 16;
|
532
|
+
_context.t0 = _context["catch"](9);
|
533
|
+
return _context.abrupt("continue", 19);
|
534
|
+
case 19:
|
535
|
+
_context.next = 7;
|
536
|
+
break;
|
537
|
+
case 21:
|
538
|
+
_context.next = 26;
|
539
|
+
break;
|
540
|
+
case 23:
|
541
|
+
_context.prev = 23;
|
542
|
+
_context.t1 = _context["catch"](5);
|
543
|
+
_iterator.e(_context.t1);
|
544
|
+
case 26:
|
545
|
+
_context.prev = 26;
|
546
|
+
_iterator.f();
|
547
|
+
return _context.finish(26);
|
548
|
+
case 29:
|
549
|
+
if (!(targetLogs.length === 0)) {
|
550
|
+
_context.next = 31;
|
551
|
+
break;
|
552
|
+
}
|
553
|
+
throw new Error("not found event ".concat(params.eventName, " in target transaction"));
|
554
|
+
case 31:
|
555
|
+
return _context.abrupt("return", targetLogs);
|
556
|
+
case 32:
|
557
|
+
case "end":
|
558
|
+
return _context.stop();
|
559
|
+
}
|
560
|
+
}, _callee, null, [[5, 23, 26, 29], [9, 16]]);
|
561
|
+
}));
|
562
|
+
return _waitTxAndFilterLog.apply(this, arguments);
|
563
|
+
}
|
564
|
+
function waitTx(_x4, _x5, _x6) {
|
565
|
+
return _waitTx.apply(this, arguments);
|
566
|
+
}
|
567
|
+
function _waitTx() {
|
568
|
+
_waitTx = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(client, txHash, params) {
|
569
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
570
|
+
while (1) switch (_context2.prev = _context2.next) {
|
571
|
+
case 0:
|
572
|
+
_context2.next = 2;
|
573
|
+
return client.waitForTransactionReceipt(_objectSpread2({
|
574
|
+
hash: txHash
|
575
|
+
}, params));
|
576
|
+
case 2:
|
577
|
+
case "end":
|
578
|
+
return _context2.stop();
|
579
|
+
}
|
580
|
+
}, _callee2);
|
581
|
+
}));
|
582
|
+
return _waitTx.apply(this, arguments);
|
583
|
+
}
|
584
|
+
function chainStringToViemChain(chainId) {
|
585
|
+
switch (chainId) {
|
586
|
+
case "11155111":
|
587
|
+
case "sepolia":
|
588
|
+
return sepolia$1;
|
589
|
+
case "1513":
|
590
|
+
case "storyTestnet":
|
591
|
+
return storyTestnet$1;
|
592
|
+
default:
|
593
|
+
throw new Error("chainId ".concat(chainId, " not supported"));
|
594
|
+
}
|
595
|
+
}
|
596
|
+
var storyTestnet$1 = defineChain({
|
597
|
+
id: 1513,
|
598
|
+
name: "story-network",
|
599
|
+
nativeCurrency: {
|
600
|
+
name: "Ether",
|
601
|
+
symbol: "SEP",
|
602
|
+
decimals: 18
|
603
|
+
},
|
604
|
+
rpcUrls: {
|
605
|
+
"default": {
|
606
|
+
http: ["https://story-network.rpc.caldera.xyz/http"],
|
607
|
+
webSocket: ["wss://story-network.rpc.caldera.xyz/ws"]
|
608
|
+
}
|
609
|
+
},
|
610
|
+
blockExplorers: {
|
611
|
+
"default": {
|
612
|
+
name: "Explorer",
|
613
|
+
url: "https://story-network.explorer.caldera.xyz"
|
614
|
+
}
|
615
|
+
},
|
616
|
+
//TODO: wait for Ze confirm with config information
|
617
|
+
contracts: {
|
618
|
+
multicall3: {
|
619
|
+
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
620
|
+
blockCreated: 5882
|
621
|
+
}
|
622
|
+
},
|
623
|
+
testnet: true
|
624
|
+
});
|
625
|
+
var chain = {
|
626
|
+
sepolia: "11155111",
|
627
|
+
storyTestnet: "1513",
|
628
|
+
11155111: "11155111",
|
629
|
+
1513: "1513"
|
630
|
+
};
|
631
|
+
|
632
|
+
function _arrayWithoutHoles(arr) {
|
633
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
634
|
+
}
|
635
|
+
|
636
|
+
function _iterableToArray(iter) {
|
637
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
638
|
+
}
|
639
|
+
|
450
640
|
function _nonIterableSpread() {
|
451
641
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
452
642
|
}
|
@@ -779,19 +969,19 @@ var IPAssetRegistryABI = [{
|
|
779
969
|
type: "uint256"
|
780
970
|
}, {
|
781
971
|
indexed: false,
|
782
|
-
internalType: "
|
783
|
-
name: "
|
784
|
-
type: "
|
972
|
+
internalType: "string",
|
973
|
+
name: "name",
|
974
|
+
type: "string"
|
785
975
|
}, {
|
786
976
|
indexed: false,
|
787
|
-
internalType: "
|
788
|
-
name: "
|
789
|
-
type: "
|
977
|
+
internalType: "string",
|
978
|
+
name: "uri",
|
979
|
+
type: "string"
|
790
980
|
}, {
|
791
981
|
indexed: false,
|
792
|
-
internalType: "
|
793
|
-
name: "
|
794
|
-
type: "
|
982
|
+
internalType: "uint256",
|
983
|
+
name: "registrationDate",
|
984
|
+
type: "uint256"
|
795
985
|
}],
|
796
986
|
name: "IPRegistered",
|
797
987
|
type: "event"
|
@@ -831,6 +1021,24 @@ var IPAssetRegistryABI = [{
|
|
831
1021
|
}],
|
832
1022
|
stateMutability: "view",
|
833
1023
|
type: "function"
|
1024
|
+
}, {
|
1025
|
+
inputs: [{
|
1026
|
+
internalType: "address",
|
1027
|
+
name: "tokenContract",
|
1028
|
+
type: "address"
|
1029
|
+
}, {
|
1030
|
+
internalType: "uint256",
|
1031
|
+
name: "tokenId",
|
1032
|
+
type: "uint256"
|
1033
|
+
}],
|
1034
|
+
name: "register",
|
1035
|
+
outputs: [{
|
1036
|
+
internalType: "address",
|
1037
|
+
name: "id",
|
1038
|
+
type: "address"
|
1039
|
+
}],
|
1040
|
+
stateMutability: "nonpayable",
|
1041
|
+
type: "function"
|
834
1042
|
}];
|
835
1043
|
|
836
1044
|
var LicensingModuleABI = [{
|
@@ -847,11 +1055,16 @@ var LicensingModuleABI = [{
|
|
847
1055
|
type: "address"
|
848
1056
|
}, {
|
849
1057
|
indexed: false,
|
850
|
-
internalType: "address
|
851
|
-
name: "
|
852
|
-
type: "address
|
1058
|
+
internalType: "address",
|
1059
|
+
name: "licenseTemplate",
|
1060
|
+
type: "address"
|
1061
|
+
}, {
|
1062
|
+
indexed: false,
|
1063
|
+
internalType: "uint256",
|
1064
|
+
name: "licenseTermsId",
|
1065
|
+
type: "uint256"
|
853
1066
|
}],
|
854
|
-
name: "
|
1067
|
+
name: "LicenseTermsAttached",
|
855
1068
|
type: "event"
|
856
1069
|
}, {
|
857
1070
|
anonymous: false,
|
@@ -863,154 +1076,67 @@ var LicensingModuleABI = [{
|
|
863
1076
|
}, {
|
864
1077
|
indexed: true,
|
865
1078
|
internalType: "address",
|
866
|
-
name: "
|
1079
|
+
name: "licensorIpId",
|
1080
|
+
type: "address"
|
1081
|
+
}, {
|
1082
|
+
indexed: false,
|
1083
|
+
internalType: "address",
|
1084
|
+
name: "licenseTemplate",
|
867
1085
|
type: "address"
|
868
1086
|
}, {
|
869
1087
|
indexed: true,
|
870
1088
|
internalType: "uint256",
|
871
|
-
name: "
|
1089
|
+
name: "licenseTermsId",
|
872
1090
|
type: "uint256"
|
873
1091
|
}, {
|
874
1092
|
indexed: false,
|
875
1093
|
internalType: "uint256",
|
876
|
-
name: "
|
1094
|
+
name: "amount",
|
877
1095
|
type: "uint256"
|
878
1096
|
}, {
|
879
1097
|
indexed: false,
|
880
|
-
internalType: "
|
881
|
-
name: "
|
882
|
-
type: "
|
1098
|
+
internalType: "address",
|
1099
|
+
name: "receiver",
|
1100
|
+
type: "address"
|
1101
|
+
}, {
|
1102
|
+
indexed: false,
|
1103
|
+
internalType: "uint256",
|
1104
|
+
name: "startLicenseTokenId",
|
1105
|
+
type: "uint256"
|
883
1106
|
}],
|
884
|
-
name: "
|
1107
|
+
name: "LicenseTokensMinted",
|
885
1108
|
type: "event"
|
886
1109
|
}, {
|
887
|
-
anonymous: false,
|
888
1110
|
inputs: [{
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
type: "uint256"
|
1111
|
+
internalType: "address",
|
1112
|
+
name: "ipId",
|
1113
|
+
type: "address"
|
893
1114
|
}, {
|
894
|
-
indexed: true,
|
895
1115
|
internalType: "address",
|
896
|
-
name: "
|
897
|
-
type: "address"
|
898
|
-
}, {
|
899
|
-
indexed: false,
|
900
|
-
internalType: "bytes",
|
901
|
-
name: "frameworkData",
|
902
|
-
type: "bytes"
|
903
|
-
}, {
|
904
|
-
indexed: false,
|
905
|
-
internalType: "address",
|
906
|
-
name: "royaltyPolicy",
|
907
|
-
type: "address"
|
908
|
-
}, {
|
909
|
-
indexed: false,
|
910
|
-
internalType: "bytes",
|
911
|
-
name: "royaltyData",
|
912
|
-
type: "bytes"
|
913
|
-
}, {
|
914
|
-
indexed: false,
|
915
|
-
internalType: "uint256",
|
916
|
-
name: "mintingFee",
|
917
|
-
type: "uint256"
|
918
|
-
}, {
|
919
|
-
indexed: false,
|
920
|
-
internalType: "address",
|
921
|
-
name: "mintingFeeToken",
|
922
|
-
type: "address"
|
923
|
-
}],
|
924
|
-
name: "PolicyRegistered",
|
925
|
-
type: "event"
|
926
|
-
}, {
|
927
|
-
inputs: [{
|
928
|
-
internalType: "address",
|
929
|
-
name: "ipId",
|
1116
|
+
name: "licenseTemplate",
|
930
1117
|
type: "address"
|
931
1118
|
}, {
|
932
1119
|
internalType: "uint256",
|
933
|
-
name: "
|
934
|
-
type: "uint256"
|
935
|
-
}],
|
936
|
-
name: "addPolicyToIp",
|
937
|
-
outputs: [{
|
938
|
-
internalType: "uint256",
|
939
|
-
name: "indexOnIpId",
|
1120
|
+
name: "licenseTermsId",
|
940
1121
|
type: "uint256"
|
941
1122
|
}],
|
1123
|
+
name: "attachLicenseTerms",
|
1124
|
+
outputs: [],
|
942
1125
|
stateMutability: "nonpayable",
|
943
1126
|
type: "function"
|
944
1127
|
}, {
|
945
1128
|
inputs: [{
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
type: "bool"
|
950
|
-
}, {
|
951
|
-
internalType: "address",
|
952
|
-
name: "policyFramework",
|
953
|
-
type: "address"
|
954
|
-
}, {
|
955
|
-
internalType: "bytes",
|
956
|
-
name: "frameworkData",
|
957
|
-
type: "bytes"
|
958
|
-
}, {
|
959
|
-
internalType: "address",
|
960
|
-
name: "royaltyPolicy",
|
961
|
-
type: "address"
|
962
|
-
}, {
|
963
|
-
internalType: "bytes",
|
964
|
-
name: "royaltyData",
|
965
|
-
type: "bytes"
|
966
|
-
}, {
|
967
|
-
internalType: "uint256",
|
968
|
-
name: "mintingFee",
|
969
|
-
type: "uint256"
|
970
|
-
}, {
|
971
|
-
internalType: "address",
|
972
|
-
name: "mintingFeeToken",
|
973
|
-
type: "address"
|
974
|
-
}],
|
975
|
-
internalType: "struct Licensing.Policy",
|
976
|
-
name: "pol",
|
977
|
-
type: "tuple"
|
978
|
-
}],
|
979
|
-
name: "getPolicyId",
|
980
|
-
outputs: [{
|
981
|
-
internalType: "uint256",
|
982
|
-
name: "policyId",
|
983
|
-
type: "uint256"
|
984
|
-
}],
|
985
|
-
stateMutability: "view",
|
986
|
-
type: "function"
|
987
|
-
}, {
|
988
|
-
inputs: [{
|
989
|
-
internalType: "uint256[]",
|
990
|
-
name: "licenseIds",
|
991
|
-
type: "uint256[]"
|
1129
|
+
internalType: "address",
|
1130
|
+
name: "licensorIpId",
|
1131
|
+
type: "address"
|
992
1132
|
}, {
|
993
1133
|
internalType: "address",
|
994
|
-
name: "
|
1134
|
+
name: "licenseTemplate",
|
995
1135
|
type: "address"
|
996
1136
|
}, {
|
997
|
-
internalType: "bytes",
|
998
|
-
name: "royaltyContext",
|
999
|
-
type: "bytes"
|
1000
|
-
}],
|
1001
|
-
name: "linkIpToParents",
|
1002
|
-
outputs: [],
|
1003
|
-
stateMutability: "nonpayable",
|
1004
|
-
type: "function"
|
1005
|
-
}, {
|
1006
|
-
inputs: [{
|
1007
1137
|
internalType: "uint256",
|
1008
|
-
name: "
|
1138
|
+
name: "licenseTermsId",
|
1009
1139
|
type: "uint256"
|
1010
|
-
}, {
|
1011
|
-
internalType: "address",
|
1012
|
-
name: "licensorIpId",
|
1013
|
-
type: "address"
|
1014
1140
|
}, {
|
1015
1141
|
internalType: "uint256",
|
1016
1142
|
name: "amount",
|
@@ -1024,60 +1150,116 @@ var LicensingModuleABI = [{
|
|
1024
1150
|
name: "royaltyContext",
|
1025
1151
|
type: "bytes"
|
1026
1152
|
}],
|
1027
|
-
name: "
|
1153
|
+
name: "mintLicenseTokens",
|
1028
1154
|
outputs: [{
|
1029
1155
|
internalType: "uint256",
|
1030
|
-
name: "
|
1156
|
+
name: "startLicenseTokenId",
|
1031
1157
|
type: "uint256"
|
1032
1158
|
}],
|
1033
1159
|
stateMutability: "nonpayable",
|
1034
1160
|
type: "function"
|
1161
|
+
}];
|
1162
|
+
|
1163
|
+
var PILicenseTemplateABI = [{
|
1164
|
+
anonymous: false,
|
1165
|
+
inputs: [{
|
1166
|
+
indexed: true,
|
1167
|
+
internalType: "uint256",
|
1168
|
+
name: "licenseTermsId",
|
1169
|
+
type: "uint256"
|
1170
|
+
}, {
|
1171
|
+
indexed: true,
|
1172
|
+
internalType: "address",
|
1173
|
+
name: "licenseTemplate",
|
1174
|
+
type: "address"
|
1175
|
+
}, {
|
1176
|
+
indexed: false,
|
1177
|
+
internalType: "bytes",
|
1178
|
+
name: "licenseTerms",
|
1179
|
+
type: "bytes"
|
1180
|
+
}],
|
1181
|
+
name: "LicenseTermsRegistered",
|
1182
|
+
type: "event"
|
1035
1183
|
}, {
|
1036
1184
|
inputs: [{
|
1037
1185
|
components: [{
|
1038
1186
|
internalType: "bool",
|
1039
|
-
name: "
|
1187
|
+
name: "transferable",
|
1040
1188
|
type: "bool"
|
1041
1189
|
}, {
|
1042
1190
|
internalType: "address",
|
1043
|
-
name: "
|
1191
|
+
name: "royaltyPolicy",
|
1044
1192
|
type: "address"
|
1045
1193
|
}, {
|
1046
|
-
internalType: "
|
1047
|
-
name: "
|
1048
|
-
type: "
|
1194
|
+
internalType: "uint256",
|
1195
|
+
name: "mintingFee",
|
1196
|
+
type: "uint256"
|
1197
|
+
}, {
|
1198
|
+
internalType: "uint256",
|
1199
|
+
name: "expiration",
|
1200
|
+
type: "uint256"
|
1201
|
+
}, {
|
1202
|
+
internalType: "bool",
|
1203
|
+
name: "commercialUse",
|
1204
|
+
type: "bool"
|
1205
|
+
}, {
|
1206
|
+
internalType: "bool",
|
1207
|
+
name: "commercialAttribution",
|
1208
|
+
type: "bool"
|
1049
1209
|
}, {
|
1050
1210
|
internalType: "address",
|
1051
|
-
name: "
|
1211
|
+
name: "commercializerChecker",
|
1052
1212
|
type: "address"
|
1053
1213
|
}, {
|
1054
1214
|
internalType: "bytes",
|
1055
|
-
name: "
|
1215
|
+
name: "commercializerCheckerData",
|
1056
1216
|
type: "bytes"
|
1217
|
+
}, {
|
1218
|
+
internalType: "uint32",
|
1219
|
+
name: "commercialRevShare",
|
1220
|
+
type: "uint32"
|
1057
1221
|
}, {
|
1058
1222
|
internalType: "uint256",
|
1059
|
-
name: "
|
1223
|
+
name: "commercialRevCelling",
|
1224
|
+
type: "uint256"
|
1225
|
+
}, {
|
1226
|
+
internalType: "bool",
|
1227
|
+
name: "derivativesAllowed",
|
1228
|
+
type: "bool"
|
1229
|
+
}, {
|
1230
|
+
internalType: "bool",
|
1231
|
+
name: "derivativesAttribution",
|
1232
|
+
type: "bool"
|
1233
|
+
}, {
|
1234
|
+
internalType: "bool",
|
1235
|
+
name: "derivativesApproval",
|
1236
|
+
type: "bool"
|
1237
|
+
}, {
|
1238
|
+
internalType: "bool",
|
1239
|
+
name: "derivativesReciprocal",
|
1240
|
+
type: "bool"
|
1241
|
+
}, {
|
1242
|
+
internalType: "uint256",
|
1243
|
+
name: "derivativeRevCelling",
|
1060
1244
|
type: "uint256"
|
1061
1245
|
}, {
|
1062
1246
|
internalType: "address",
|
1063
|
-
name: "
|
1247
|
+
name: "currency",
|
1064
1248
|
type: "address"
|
1065
1249
|
}],
|
1066
|
-
internalType: "struct
|
1067
|
-
name: "
|
1250
|
+
internalType: "struct PILTerms",
|
1251
|
+
name: "terms",
|
1068
1252
|
type: "tuple"
|
1069
1253
|
}],
|
1070
|
-
name: "
|
1254
|
+
name: "getLicenseTermsId",
|
1071
1255
|
outputs: [{
|
1072
1256
|
internalType: "uint256",
|
1073
|
-
name: "
|
1257
|
+
name: "selectedLicenseTermsId",
|
1074
1258
|
type: "uint256"
|
1075
1259
|
}],
|
1076
|
-
stateMutability: "
|
1260
|
+
stateMutability: "view",
|
1077
1261
|
type: "function"
|
1078
|
-
}
|
1079
|
-
|
1080
|
-
var PILPolicyFrameworkManagerABI = [{
|
1262
|
+
}, {
|
1081
1263
|
inputs: [{
|
1082
1264
|
components: [{
|
1083
1265
|
internalType: "bool",
|
@@ -1091,148 +1273,219 @@ var PILPolicyFrameworkManagerABI = [{
|
|
1091
1273
|
internalType: "uint256",
|
1092
1274
|
name: "mintingFee",
|
1093
1275
|
type: "uint256"
|
1276
|
+
}, {
|
1277
|
+
internalType: "uint256",
|
1278
|
+
name: "expiration",
|
1279
|
+
type: "uint256"
|
1280
|
+
}, {
|
1281
|
+
internalType: "bool",
|
1282
|
+
name: "commercialUse",
|
1283
|
+
type: "bool"
|
1284
|
+
}, {
|
1285
|
+
internalType: "bool",
|
1286
|
+
name: "commercialAttribution",
|
1287
|
+
type: "bool"
|
1094
1288
|
}, {
|
1095
1289
|
internalType: "address",
|
1096
|
-
name: "
|
1290
|
+
name: "commercializerChecker",
|
1097
1291
|
type: "address"
|
1098
1292
|
}, {
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
type: "bool"
|
1135
|
-
}, {
|
1136
|
-
internalType: "bool",
|
1137
|
-
name: "derivativesReciprocal",
|
1138
|
-
type: "bool"
|
1139
|
-
}, {
|
1140
|
-
internalType: "string[]",
|
1141
|
-
name: "territories",
|
1142
|
-
type: "string[]"
|
1143
|
-
}, {
|
1144
|
-
internalType: "string[]",
|
1145
|
-
name: "distributionChannels",
|
1146
|
-
type: "string[]"
|
1147
|
-
}, {
|
1148
|
-
internalType: "string[]",
|
1149
|
-
name: "contentRestrictions",
|
1150
|
-
type: "string[]"
|
1151
|
-
}],
|
1152
|
-
internalType: "struct PILPolicy",
|
1153
|
-
name: "policy",
|
1154
|
-
type: "tuple"
|
1293
|
+
internalType: "bytes",
|
1294
|
+
name: "commercializerCheckerData",
|
1295
|
+
type: "bytes"
|
1296
|
+
}, {
|
1297
|
+
internalType: "uint32",
|
1298
|
+
name: "commercialRevShare",
|
1299
|
+
type: "uint32"
|
1300
|
+
}, {
|
1301
|
+
internalType: "uint256",
|
1302
|
+
name: "commercialRevCelling",
|
1303
|
+
type: "uint256"
|
1304
|
+
}, {
|
1305
|
+
internalType: "bool",
|
1306
|
+
name: "derivativesAllowed",
|
1307
|
+
type: "bool"
|
1308
|
+
}, {
|
1309
|
+
internalType: "bool",
|
1310
|
+
name: "derivativesAttribution",
|
1311
|
+
type: "bool"
|
1312
|
+
}, {
|
1313
|
+
internalType: "bool",
|
1314
|
+
name: "derivativesApproval",
|
1315
|
+
type: "bool"
|
1316
|
+
}, {
|
1317
|
+
internalType: "bool",
|
1318
|
+
name: "derivativesReciprocal",
|
1319
|
+
type: "bool"
|
1320
|
+
}, {
|
1321
|
+
internalType: "uint256",
|
1322
|
+
name: "derivativeRevCelling",
|
1323
|
+
type: "uint256"
|
1324
|
+
}, {
|
1325
|
+
internalType: "address",
|
1326
|
+
name: "currency",
|
1327
|
+
type: "address"
|
1155
1328
|
}],
|
1156
|
-
internalType: "struct
|
1157
|
-
name: "
|
1329
|
+
internalType: "struct PILTerms",
|
1330
|
+
name: "terms",
|
1158
1331
|
type: "tuple"
|
1159
1332
|
}],
|
1160
|
-
name: "
|
1333
|
+
name: "registerLicenseTerms",
|
1161
1334
|
outputs: [{
|
1162
1335
|
internalType: "uint256",
|
1163
|
-
name: "
|
1336
|
+
name: "selectedLicenseTermsId",
|
1164
1337
|
type: "uint256"
|
1165
1338
|
}],
|
1166
1339
|
stateMutability: "nonpayable",
|
1167
1340
|
type: "function"
|
1168
1341
|
}];
|
1169
1342
|
|
1170
|
-
var
|
1343
|
+
var IRoyaltyPolicyLAPABI = [{
|
1171
1344
|
inputs: [{
|
1172
|
-
internalType: "
|
1173
|
-
name: "
|
1174
|
-
type: "
|
1345
|
+
internalType: "address",
|
1346
|
+
name: "ipId",
|
1347
|
+
type: "address"
|
1348
|
+
}],
|
1349
|
+
name: "getRoyaltyData",
|
1350
|
+
outputs: [{
|
1351
|
+
internalType: "bool",
|
1352
|
+
name: "",
|
1353
|
+
type: "bool"
|
1175
1354
|
}, {
|
1176
1355
|
internalType: "address",
|
1177
|
-
name: "
|
1356
|
+
name: "",
|
1178
1357
|
type: "address"
|
1179
1358
|
}, {
|
1180
|
-
internalType: "
|
1181
|
-
name: "
|
1182
|
-
type: "
|
1359
|
+
internalType: "uint32",
|
1360
|
+
name: "",
|
1361
|
+
type: "uint32"
|
1183
1362
|
}, {
|
1184
|
-
internalType: "
|
1185
|
-
name: "
|
1186
|
-
type: "
|
1363
|
+
internalType: "address[]",
|
1364
|
+
name: "",
|
1365
|
+
type: "address[]"
|
1187
1366
|
}, {
|
1188
|
-
internalType: "
|
1189
|
-
name: "
|
1190
|
-
type: "
|
1367
|
+
internalType: "uint32[]",
|
1368
|
+
name: "",
|
1369
|
+
type: "uint32[]"
|
1370
|
+
}],
|
1371
|
+
stateMutability: "view",
|
1372
|
+
type: "function"
|
1373
|
+
}, {
|
1374
|
+
inputs: [{
|
1375
|
+
internalType: "address",
|
1376
|
+
name: "caller",
|
1377
|
+
type: "address"
|
1191
1378
|
}, {
|
1192
|
-
internalType: "
|
1193
|
-
name: "
|
1194
|
-
type: "
|
1379
|
+
internalType: "address",
|
1380
|
+
name: "ipId",
|
1381
|
+
type: "address"
|
1195
1382
|
}, {
|
1196
|
-
internalType: "
|
1197
|
-
name: "
|
1198
|
-
type: "
|
1383
|
+
internalType: "address",
|
1384
|
+
name: "token",
|
1385
|
+
type: "address"
|
1386
|
+
}, {
|
1387
|
+
internalType: "uint256",
|
1388
|
+
name: "amount",
|
1389
|
+
type: "uint256"
|
1199
1390
|
}],
|
1200
|
-
name: "
|
1391
|
+
name: "onRoyaltyPayment",
|
1392
|
+
outputs: [],
|
1393
|
+
stateMutability: "nonpayable",
|
1394
|
+
type: "function"
|
1395
|
+
}];
|
1396
|
+
|
1397
|
+
var IpRoyaltyVaultABI = [{
|
1398
|
+
inputs: [{
|
1399
|
+
internalType: "uint256[]",
|
1400
|
+
name: "snapshotIds",
|
1401
|
+
type: "uint256[]"
|
1402
|
+
}, {
|
1403
|
+
internalType: "address",
|
1404
|
+
name: "token",
|
1405
|
+
type: "address"
|
1406
|
+
}],
|
1407
|
+
name: "claimRevenueBySnapshotBatch",
|
1201
1408
|
outputs: [],
|
1202
1409
|
stateMutability: "nonpayable",
|
1203
1410
|
type: "function"
|
1204
1411
|
}, {
|
1205
1412
|
inputs: [{
|
1206
1413
|
internalType: "uint256",
|
1207
|
-
name: "
|
1414
|
+
name: "snapshotId",
|
1208
1415
|
type: "uint256"
|
1209
1416
|
}, {
|
1417
|
+
internalType: "address[]",
|
1418
|
+
name: "tokens",
|
1419
|
+
type: "address[]"
|
1420
|
+
}],
|
1421
|
+
name: "claimRevenueByTokenBatch",
|
1422
|
+
outputs: [],
|
1423
|
+
stateMutability: "nonpayable",
|
1424
|
+
type: "function"
|
1425
|
+
}, {
|
1426
|
+
inputs: [{
|
1210
1427
|
internalType: "address",
|
1211
|
-
name: "
|
1428
|
+
name: "account",
|
1212
1429
|
type: "address"
|
1213
1430
|
}, {
|
1214
1431
|
internalType: "uint256",
|
1215
|
-
name: "
|
1432
|
+
name: "snapshotId",
|
1216
1433
|
type: "uint256"
|
1217
1434
|
}, {
|
1218
|
-
internalType: "
|
1219
|
-
name: "
|
1220
|
-
type: "
|
1221
|
-
}, {
|
1222
|
-
internalType: "bytes32",
|
1223
|
-
name: "contentHash",
|
1224
|
-
type: "bytes32"
|
1225
|
-
}, {
|
1226
|
-
internalType: "string",
|
1227
|
-
name: "externalURL",
|
1228
|
-
type: "string"
|
1435
|
+
internalType: "address",
|
1436
|
+
name: "token",
|
1437
|
+
type: "address"
|
1229
1438
|
}],
|
1230
|
-
name: "
|
1439
|
+
name: "claimableRevenue",
|
1440
|
+
outputs: [{
|
1441
|
+
internalType: "uint256",
|
1442
|
+
name: "",
|
1443
|
+
type: "uint256"
|
1444
|
+
}],
|
1445
|
+
stateMutability: "view",
|
1446
|
+
type: "function"
|
1447
|
+
}, {
|
1448
|
+
inputs: [{
|
1449
|
+
internalType: "address",
|
1450
|
+
name: "ancestorIpId",
|
1451
|
+
type: "address"
|
1452
|
+
}],
|
1453
|
+
name: "collectRoyaltyTokens",
|
1454
|
+
outputs: [],
|
1455
|
+
stateMutability: "nonpayable",
|
1456
|
+
type: "function"
|
1457
|
+
}, {
|
1458
|
+
inputs: [],
|
1459
|
+
name: "ipId",
|
1231
1460
|
outputs: [{
|
1232
1461
|
internalType: "address",
|
1233
1462
|
name: "",
|
1234
1463
|
type: "address"
|
1235
1464
|
}],
|
1465
|
+
stateMutability: "view",
|
1466
|
+
type: "function"
|
1467
|
+
}];
|
1468
|
+
|
1469
|
+
var IRoyaltyModuleABI = [{
|
1470
|
+
inputs: [{
|
1471
|
+
internalType: "address",
|
1472
|
+
name: "receiverIpId",
|
1473
|
+
type: "address"
|
1474
|
+
}, {
|
1475
|
+
internalType: "address",
|
1476
|
+
name: "payerIpId",
|
1477
|
+
type: "address"
|
1478
|
+
}, {
|
1479
|
+
internalType: "address",
|
1480
|
+
name: "token",
|
1481
|
+
type: "address"
|
1482
|
+
}, {
|
1483
|
+
internalType: "uint256",
|
1484
|
+
name: "amount",
|
1485
|
+
type: "uint256"
|
1486
|
+
}],
|
1487
|
+
name: "payRoyaltyOnBehalf",
|
1488
|
+
outputs: [],
|
1236
1489
|
stateMutability: "nonpayable",
|
1237
1490
|
type: "function"
|
1238
1491
|
}];
|
@@ -1257,6 +1510,18 @@ var ErrorsABI = [{
|
|
1257
1510
|
inputs: [],
|
1258
1511
|
name: "AccessControlled__ZeroAddress",
|
1259
1512
|
type: "error"
|
1513
|
+
}, {
|
1514
|
+
inputs: [{
|
1515
|
+
internalType: "address",
|
1516
|
+
name: "signer",
|
1517
|
+
type: "address"
|
1518
|
+
}, {
|
1519
|
+
internalType: "address",
|
1520
|
+
name: "to",
|
1521
|
+
type: "address"
|
1522
|
+
}],
|
1523
|
+
name: "AccessController__BothCallerAndRecipientAreNotRegisteredModule",
|
1524
|
+
type: "error"
|
1260
1525
|
}, {
|
1261
1526
|
inputs: [],
|
1262
1527
|
name: "AccessController__CallerIsNotIPAccount",
|
@@ -1297,241 +1562,485 @@ var ErrorsABI = [{
|
|
1297
1562
|
inputs: [],
|
1298
1563
|
name: "AccessController__PermissionIsNotValid",
|
1299
1564
|
type: "error"
|
1565
|
+
}, {
|
1566
|
+
inputs: [],
|
1567
|
+
name: "AccessController__SignerIsZeroAddress",
|
1568
|
+
type: "error"
|
1569
|
+
}, {
|
1570
|
+
inputs: [],
|
1571
|
+
name: "ArbitrationPolicySP__NotDisputeModule",
|
1572
|
+
type: "error"
|
1573
|
+
}, {
|
1574
|
+
inputs: [],
|
1575
|
+
name: "ArbitrationPolicySP__ZeroDisputeModule",
|
1576
|
+
type: "error"
|
1577
|
+
}, {
|
1578
|
+
inputs: [],
|
1579
|
+
name: "ArbitrationPolicySP__ZeroPaymentToken",
|
1580
|
+
type: "error"
|
1581
|
+
}, {
|
1582
|
+
inputs: [],
|
1583
|
+
name: "BasePolicyFrameworkManager__CallerNotLicensingModule",
|
1584
|
+
type: "error"
|
1585
|
+
}, {
|
1586
|
+
inputs: [],
|
1587
|
+
name: "CoreMetadataModule__MetadataAlreadyFrozen",
|
1588
|
+
type: "error"
|
1589
|
+
}, {
|
1590
|
+
inputs: [],
|
1591
|
+
name: "DisputeModule__NotAbleToResolve",
|
1592
|
+
type: "error"
|
1593
|
+
}, {
|
1594
|
+
inputs: [],
|
1595
|
+
name: "DisputeModule__NotDisputeInitiator",
|
1596
|
+
type: "error"
|
1597
|
+
}, {
|
1598
|
+
inputs: [],
|
1599
|
+
name: "DisputeModule__NotInDisputeState",
|
1600
|
+
type: "error"
|
1601
|
+
}, {
|
1602
|
+
inputs: [],
|
1603
|
+
name: "DisputeModule__NotRegisteredIpId",
|
1604
|
+
type: "error"
|
1605
|
+
}, {
|
1606
|
+
inputs: [],
|
1607
|
+
name: "DisputeModule__NotWhitelistedArbitrationPolicy",
|
1608
|
+
type: "error"
|
1609
|
+
}, {
|
1610
|
+
inputs: [],
|
1611
|
+
name: "DisputeModule__NotWhitelistedArbitrationRelayer",
|
1612
|
+
type: "error"
|
1613
|
+
}, {
|
1614
|
+
inputs: [],
|
1615
|
+
name: "DisputeModule__NotWhitelistedDisputeTag",
|
1616
|
+
type: "error"
|
1617
|
+
}, {
|
1618
|
+
inputs: [],
|
1619
|
+
name: "DisputeModule__ZeroArbitrationPolicy",
|
1620
|
+
type: "error"
|
1621
|
+
}, {
|
1622
|
+
inputs: [],
|
1623
|
+
name: "DisputeModule__ZeroArbitrationRelayer",
|
1624
|
+
type: "error"
|
1625
|
+
}, {
|
1626
|
+
inputs: [],
|
1627
|
+
name: "DisputeModule__ZeroDisputeTag",
|
1628
|
+
type: "error"
|
1629
|
+
}, {
|
1630
|
+
inputs: [],
|
1631
|
+
name: "DisputeModule__ZeroLinkToDisputeEvidence",
|
1632
|
+
type: "error"
|
1633
|
+
}, {
|
1634
|
+
inputs: [],
|
1635
|
+
name: "Governance__InconsistentState",
|
1636
|
+
type: "error"
|
1637
|
+
}, {
|
1638
|
+
inputs: [],
|
1639
|
+
name: "Governance__NewStateIsTheSameWithOldState",
|
1640
|
+
type: "error"
|
1641
|
+
}, {
|
1642
|
+
inputs: [],
|
1643
|
+
name: "Governance__OnlyProtocolAdmin",
|
1644
|
+
type: "error"
|
1645
|
+
}, {
|
1646
|
+
inputs: [],
|
1647
|
+
name: "Governance__ProtocolPaused",
|
1648
|
+
type: "error"
|
1300
1649
|
}, {
|
1301
1650
|
inputs: [{
|
1302
|
-
internalType: "
|
1303
|
-
name: "
|
1304
|
-
type: "
|
1651
|
+
internalType: "string",
|
1652
|
+
name: "interfaceName",
|
1653
|
+
type: "string"
|
1305
1654
|
}],
|
1306
|
-
name: "
|
1655
|
+
name: "Governance__UnsupportedInterface",
|
1307
1656
|
type: "error"
|
1308
1657
|
}, {
|
1309
1658
|
inputs: [],
|
1310
|
-
name: "
|
1659
|
+
name: "Governance__ZeroAddress",
|
1311
1660
|
type: "error"
|
1312
1661
|
}, {
|
1313
1662
|
inputs: [],
|
1314
|
-
name: "
|
1663
|
+
name: "IPAccountRegistry_InvalidIpAccountImpl",
|
1315
1664
|
type: "error"
|
1316
1665
|
}, {
|
1317
1666
|
inputs: [],
|
1318
|
-
name: "
|
1667
|
+
name: "IPAccount__ExpiredSignature",
|
1319
1668
|
type: "error"
|
1320
1669
|
}, {
|
1321
1670
|
inputs: [],
|
1322
|
-
name: "
|
1671
|
+
name: "IPAccount__InvalidAccessController",
|
1323
1672
|
type: "error"
|
1324
1673
|
}, {
|
1325
1674
|
inputs: [],
|
1326
|
-
name: "
|
1675
|
+
name: "IPAccount__InvalidCalldata",
|
1327
1676
|
type: "error"
|
1328
1677
|
}, {
|
1329
1678
|
inputs: [],
|
1330
|
-
name: "
|
1679
|
+
name: "IPAccount__InvalidSignature",
|
1331
1680
|
type: "error"
|
1332
1681
|
}, {
|
1333
1682
|
inputs: [],
|
1334
|
-
name: "
|
1683
|
+
name: "IPAccount__InvalidSigner",
|
1335
1684
|
type: "error"
|
1336
1685
|
}, {
|
1337
1686
|
inputs: [],
|
1338
|
-
name: "
|
1687
|
+
name: "IPAssetRegistry__AlreadyRegistered",
|
1339
1688
|
type: "error"
|
1340
1689
|
}, {
|
1341
1690
|
inputs: [],
|
1342
|
-
name: "
|
1691
|
+
name: "IPAssetRegistry__IPAccountAlreadyCreated",
|
1343
1692
|
type: "error"
|
1344
1693
|
}, {
|
1345
1694
|
inputs: [],
|
1346
|
-
name: "
|
1695
|
+
name: "IPAssetRegistry__InvalidAccount",
|
1696
|
+
type: "error"
|
1697
|
+
}, {
|
1698
|
+
inputs: [],
|
1699
|
+
name: "IPAssetRegistry__InvalidMetadataProvider",
|
1700
|
+
type: "error"
|
1701
|
+
}, {
|
1702
|
+
inputs: [{
|
1703
|
+
internalType: "address",
|
1704
|
+
name: "contractAddress",
|
1705
|
+
type: "address"
|
1706
|
+
}, {
|
1707
|
+
internalType: "uint256",
|
1708
|
+
name: "tokenId",
|
1709
|
+
type: "uint256"
|
1710
|
+
}],
|
1711
|
+
name: "IPAssetRegistry__InvalidToken",
|
1712
|
+
type: "error"
|
1713
|
+
}, {
|
1714
|
+
inputs: [],
|
1715
|
+
name: "IPAssetRegistry__NotYetRegistered",
|
1716
|
+
type: "error"
|
1717
|
+
}, {
|
1718
|
+
inputs: [],
|
1719
|
+
name: "IPAssetRegistry__RegistrantUnauthorized",
|
1720
|
+
type: "error"
|
1721
|
+
}, {
|
1722
|
+
inputs: [],
|
1723
|
+
name: "IPAssetRegistry__ResolverInvalid",
|
1724
|
+
type: "error"
|
1725
|
+
}, {
|
1726
|
+
inputs: [],
|
1727
|
+
name: "IPAssetRegistry__Unauthorized",
|
1347
1728
|
type: "error"
|
1348
1729
|
}, {
|
1349
|
-
inputs: [
|
1350
|
-
|
1730
|
+
inputs: [{
|
1731
|
+
internalType: "address",
|
1732
|
+
name: "contractAddress",
|
1733
|
+
type: "address"
|
1734
|
+
}],
|
1735
|
+
name: "IPAssetRegistry__UnsupportedIERC721",
|
1351
1736
|
type: "error"
|
1352
1737
|
}, {
|
1353
|
-
inputs: [
|
1354
|
-
|
1738
|
+
inputs: [{
|
1739
|
+
internalType: "address",
|
1740
|
+
name: "contractAddress",
|
1741
|
+
type: "address"
|
1742
|
+
}],
|
1743
|
+
name: "IPAssetRegistry__UnsupportedIERC721Metadata",
|
1355
1744
|
type: "error"
|
1356
1745
|
}, {
|
1357
1746
|
inputs: [],
|
1358
|
-
name: "
|
1747
|
+
name: "IPResolver_InvalidIP",
|
1359
1748
|
type: "error"
|
1360
1749
|
}, {
|
1361
1750
|
inputs: [],
|
1362
|
-
name: "
|
1751
|
+
name: "IPResolver_Unauthorized",
|
1363
1752
|
type: "error"
|
1364
1753
|
}, {
|
1365
1754
|
inputs: [],
|
1366
|
-
name: "
|
1755
|
+
name: "IpRoyaltyVault__AlreadyClaimed",
|
1367
1756
|
type: "error"
|
1368
1757
|
}, {
|
1369
1758
|
inputs: [],
|
1370
|
-
name: "
|
1759
|
+
name: "IpRoyaltyVault__ClaimerNotAnAncestor",
|
1371
1760
|
type: "error"
|
1372
1761
|
}, {
|
1373
1762
|
inputs: [],
|
1374
|
-
name: "
|
1763
|
+
name: "IpRoyaltyVault__IpTagged",
|
1375
1764
|
type: "error"
|
1376
1765
|
}, {
|
1377
1766
|
inputs: [],
|
1378
|
-
name: "
|
1767
|
+
name: "IpRoyaltyVault__NotRoyaltyPolicyLAP",
|
1379
1768
|
type: "error"
|
1380
1769
|
}, {
|
1381
1770
|
inputs: [],
|
1382
|
-
name: "
|
1771
|
+
name: "IpRoyaltyVault__SnapshotIntervalTooShort",
|
1383
1772
|
type: "error"
|
1384
1773
|
}, {
|
1385
1774
|
inputs: [],
|
1386
|
-
name: "
|
1775
|
+
name: "IpRoyaltyVault__ZeroDisputeModule",
|
1387
1776
|
type: "error"
|
1388
1777
|
}, {
|
1389
1778
|
inputs: [],
|
1390
|
-
name: "
|
1779
|
+
name: "IpRoyaltyVault__ZeroIpId",
|
1391
1780
|
type: "error"
|
1392
1781
|
}, {
|
1393
1782
|
inputs: [],
|
1394
|
-
name: "
|
1783
|
+
name: "IpRoyaltyVault__ZeroRoyaltyPolicyLAP",
|
1395
1784
|
type: "error"
|
1396
1785
|
}, {
|
1397
1786
|
inputs: [],
|
1398
|
-
name: "
|
1787
|
+
name: "LicenseRegistry__CallerNotLicensingModule",
|
1399
1788
|
type: "error"
|
1400
1789
|
}, {
|
1401
|
-
inputs: [
|
1402
|
-
|
1790
|
+
inputs: [{
|
1791
|
+
internalType: "address",
|
1792
|
+
name: "childIpId",
|
1793
|
+
type: "address"
|
1794
|
+
}],
|
1795
|
+
name: "LicenseRegistry__DerivativeAlreadyRegistered",
|
1403
1796
|
type: "error"
|
1404
1797
|
}, {
|
1405
|
-
inputs: [
|
1406
|
-
|
1798
|
+
inputs: [{
|
1799
|
+
internalType: "address",
|
1800
|
+
name: "childIpId",
|
1801
|
+
type: "address"
|
1802
|
+
}],
|
1803
|
+
name: "LicenseRegistry__DerivativeIpAlreadyHasLicense",
|
1407
1804
|
type: "error"
|
1408
1805
|
}, {
|
1409
|
-
inputs: [
|
1410
|
-
|
1806
|
+
inputs: [{
|
1807
|
+
internalType: "address",
|
1808
|
+
name: "ipId",
|
1809
|
+
type: "address"
|
1810
|
+
}],
|
1811
|
+
name: "LicenseRegistry__DerivativeIsParent",
|
1411
1812
|
type: "error"
|
1412
1813
|
}, {
|
1413
|
-
inputs: [
|
1414
|
-
|
1814
|
+
inputs: [{
|
1815
|
+
internalType: "address",
|
1816
|
+
name: "ipId",
|
1817
|
+
type: "address"
|
1818
|
+
}, {
|
1819
|
+
internalType: "uint256",
|
1820
|
+
name: "index",
|
1821
|
+
type: "uint256"
|
1822
|
+
}, {
|
1823
|
+
internalType: "uint256",
|
1824
|
+
name: "length",
|
1825
|
+
type: "uint256"
|
1826
|
+
}],
|
1827
|
+
name: "LicenseRegistry__IndexOutOfBounds",
|
1415
1828
|
type: "error"
|
1416
1829
|
}, {
|
1417
|
-
inputs: [
|
1418
|
-
|
1830
|
+
inputs: [{
|
1831
|
+
internalType: "address",
|
1832
|
+
name: "ipId",
|
1833
|
+
type: "address"
|
1834
|
+
}],
|
1835
|
+
name: "LicenseRegistry__IpExpired",
|
1419
1836
|
type: "error"
|
1420
1837
|
}, {
|
1421
1838
|
inputs: [{
|
1422
|
-
internalType: "
|
1423
|
-
name: "
|
1424
|
-
type: "
|
1839
|
+
internalType: "address",
|
1840
|
+
name: "licenseTemplate",
|
1841
|
+
type: "address"
|
1842
|
+
}, {
|
1843
|
+
internalType: "uint256",
|
1844
|
+
name: "licenseTermsId",
|
1845
|
+
type: "uint256"
|
1425
1846
|
}],
|
1426
|
-
name: "
|
1847
|
+
name: "LicenseRegistry__LicenseTermsNotExists",
|
1427
1848
|
type: "error"
|
1428
1849
|
}, {
|
1429
1850
|
inputs: [],
|
1430
|
-
name: "
|
1851
|
+
name: "LicenseRegistry__NoParentIp",
|
1431
1852
|
type: "error"
|
1432
1853
|
}, {
|
1433
|
-
inputs: [
|
1434
|
-
|
1854
|
+
inputs: [{
|
1855
|
+
internalType: "address",
|
1856
|
+
name: "licenseTemplate",
|
1857
|
+
type: "address"
|
1858
|
+
}],
|
1859
|
+
name: "LicenseRegistry__NotLicenseTemplate",
|
1435
1860
|
type: "error"
|
1436
1861
|
}, {
|
1437
1862
|
inputs: [],
|
1438
|
-
name: "
|
1863
|
+
name: "LicenseRegistry__NotTransferable",
|
1439
1864
|
type: "error"
|
1440
1865
|
}, {
|
1441
|
-
inputs: [
|
1442
|
-
|
1866
|
+
inputs: [{
|
1867
|
+
internalType: "address",
|
1868
|
+
name: "ipId",
|
1869
|
+
type: "address"
|
1870
|
+
}],
|
1871
|
+
name: "LicenseRegistry__ParentIpExpired",
|
1443
1872
|
type: "error"
|
1444
1873
|
}, {
|
1445
|
-
inputs: [
|
1446
|
-
|
1874
|
+
inputs: [{
|
1875
|
+
internalType: "address",
|
1876
|
+
name: "ipId",
|
1877
|
+
type: "address"
|
1878
|
+
}, {
|
1879
|
+
internalType: "uint256",
|
1880
|
+
name: "licenseTermsId",
|
1881
|
+
type: "uint256"
|
1882
|
+
}],
|
1883
|
+
name: "LicenseRegistry__ParentIpHasNoLicenseTerms",
|
1447
1884
|
type: "error"
|
1448
1885
|
}, {
|
1449
|
-
inputs: [
|
1450
|
-
|
1886
|
+
inputs: [{
|
1887
|
+
internalType: "address",
|
1888
|
+
name: "ipId",
|
1889
|
+
type: "address"
|
1890
|
+
}],
|
1891
|
+
name: "LicenseRegistry__ParentIpTagged",
|
1451
1892
|
type: "error"
|
1452
1893
|
}, {
|
1453
|
-
inputs: [
|
1454
|
-
|
1894
|
+
inputs: [{
|
1895
|
+
internalType: "address",
|
1896
|
+
name: "ipId",
|
1897
|
+
type: "address"
|
1898
|
+
}, {
|
1899
|
+
internalType: "address",
|
1900
|
+
name: "licenseTemplate",
|
1901
|
+
type: "address"
|
1902
|
+
}],
|
1903
|
+
name: "LicenseRegistry__ParentIpUnmachedLicenseTemplate",
|
1455
1904
|
type: "error"
|
1456
1905
|
}, {
|
1457
|
-
inputs: [
|
1458
|
-
|
1906
|
+
inputs: [{
|
1907
|
+
internalType: "address",
|
1908
|
+
name: "licenseTemplate",
|
1909
|
+
type: "address"
|
1910
|
+
}],
|
1911
|
+
name: "LicenseRegistry__UnregisteredLicenseTemplate",
|
1459
1912
|
type: "error"
|
1460
1913
|
}, {
|
1461
1914
|
inputs: [],
|
1462
|
-
name: "
|
1915
|
+
name: "LicenseRegistry__ZeroDisputeModule",
|
1463
1916
|
type: "error"
|
1464
1917
|
}, {
|
1465
1918
|
inputs: [],
|
1466
|
-
name: "
|
1919
|
+
name: "LicenseRegistry__ZeroLicensingModule",
|
1467
1920
|
type: "error"
|
1468
1921
|
}, {
|
1469
|
-
inputs: [
|
1470
|
-
|
1922
|
+
inputs: [{
|
1923
|
+
internalType: "address",
|
1924
|
+
name: "licenseTemplate",
|
1925
|
+
type: "address"
|
1926
|
+
}, {
|
1927
|
+
internalType: "address",
|
1928
|
+
name: "anotherLicenseTemplate",
|
1929
|
+
type: "address"
|
1930
|
+
}],
|
1931
|
+
name: "LicenseToken__AllLicenseTokensMustFromSameLicenseTemplate",
|
1471
1932
|
type: "error"
|
1472
1933
|
}, {
|
1473
1934
|
inputs: [],
|
1474
|
-
name: "
|
1935
|
+
name: "LicenseToken__CallerNotLicensingModule",
|
1475
1936
|
type: "error"
|
1476
1937
|
}, {
|
1477
|
-
inputs: [
|
1478
|
-
|
1938
|
+
inputs: [{
|
1939
|
+
internalType: "uint256",
|
1940
|
+
name: "tokenId",
|
1941
|
+
type: "uint256"
|
1942
|
+
}, {
|
1943
|
+
internalType: "uint256",
|
1944
|
+
name: "expiredAt",
|
1945
|
+
type: "uint256"
|
1946
|
+
}, {
|
1947
|
+
internalType: "uint256",
|
1948
|
+
name: "currentTimestamp",
|
1949
|
+
type: "uint256"
|
1950
|
+
}],
|
1951
|
+
name: "LicenseToken__LicenseTokenExpired",
|
1479
1952
|
type: "error"
|
1480
1953
|
}, {
|
1481
|
-
inputs: [
|
1482
|
-
|
1954
|
+
inputs: [{
|
1955
|
+
internalType: "uint256",
|
1956
|
+
name: "tokenId",
|
1957
|
+
type: "uint256"
|
1958
|
+
}, {
|
1959
|
+
internalType: "address",
|
1960
|
+
name: "iPowner",
|
1961
|
+
type: "address"
|
1962
|
+
}, {
|
1963
|
+
internalType: "address",
|
1964
|
+
name: "tokenOwner",
|
1965
|
+
type: "address"
|
1966
|
+
}],
|
1967
|
+
name: "LicenseToken__NotLicenseTokenOwner",
|
1483
1968
|
type: "error"
|
1484
1969
|
}, {
|
1485
1970
|
inputs: [],
|
1486
|
-
name: "
|
1971
|
+
name: "LicenseToken__NotTransferable",
|
1487
1972
|
type: "error"
|
1488
1973
|
}, {
|
1489
|
-
inputs: [
|
1490
|
-
|
1974
|
+
inputs: [{
|
1975
|
+
internalType: "uint256",
|
1976
|
+
name: "tokenId",
|
1977
|
+
type: "uint256"
|
1978
|
+
}],
|
1979
|
+
name: "LicenseToken__RevokedLicense",
|
1491
1980
|
type: "error"
|
1492
1981
|
}, {
|
1493
1982
|
inputs: [],
|
1494
|
-
name: "
|
1983
|
+
name: "LicenseToken__ZeroDisputeModule",
|
1495
1984
|
type: "error"
|
1496
1985
|
}, {
|
1497
1986
|
inputs: [],
|
1498
|
-
name: "
|
1987
|
+
name: "LicenseToken__ZeroLicensingModule",
|
1499
1988
|
type: "error"
|
1500
1989
|
}, {
|
1501
1990
|
inputs: [],
|
1502
|
-
name: "
|
1991
|
+
name: "LicensingModule__CallerNotLicenseRegistry",
|
1503
1992
|
type: "error"
|
1504
1993
|
}, {
|
1505
|
-
inputs: [
|
1506
|
-
|
1994
|
+
inputs: [{
|
1995
|
+
internalType: "address",
|
1996
|
+
name: "caller",
|
1997
|
+
type: "address"
|
1998
|
+
}, {
|
1999
|
+
internalType: "address",
|
2000
|
+
name: "licensorIpId",
|
2001
|
+
type: "address"
|
2002
|
+
}, {
|
2003
|
+
internalType: "address",
|
2004
|
+
name: "licenseTemplate",
|
2005
|
+
type: "address"
|
2006
|
+
}, {
|
2007
|
+
internalType: "uint256",
|
2008
|
+
name: "licenseTermsId",
|
2009
|
+
type: "uint256"
|
2010
|
+
}],
|
2011
|
+
name: "LicensingModule__CallerNotLicensorAndIpHasNotAttachedLicenseTerms",
|
1507
2012
|
type: "error"
|
1508
2013
|
}, {
|
1509
2014
|
inputs: [],
|
1510
|
-
name: "
|
2015
|
+
name: "LicensingModule__CallerNotLicensorAndPolicyNotSet",
|
1511
2016
|
type: "error"
|
1512
2017
|
}, {
|
1513
2018
|
inputs: [],
|
1514
|
-
name: "
|
2019
|
+
name: "LicensingModule__CommercialTermInNonCommercialPolicy",
|
1515
2020
|
type: "error"
|
1516
2021
|
}, {
|
1517
|
-
inputs: [
|
1518
|
-
|
2022
|
+
inputs: [{
|
2023
|
+
internalType: "address",
|
2024
|
+
name: "ipId",
|
2025
|
+
type: "address"
|
2026
|
+
}],
|
2027
|
+
name: "LicensingModule__DerivativeAlreadyHasLicenseTerms",
|
1519
2028
|
type: "error"
|
1520
2029
|
}, {
|
1521
2030
|
inputs: [],
|
1522
|
-
name: "
|
2031
|
+
name: "LicensingModule__DerivativeAlreadyRegistered",
|
1523
2032
|
type: "error"
|
1524
2033
|
}, {
|
1525
2034
|
inputs: [],
|
1526
|
-
name: "
|
2035
|
+
name: "LicensingModule__DerivativeIsParent",
|
1527
2036
|
type: "error"
|
1528
2037
|
}, {
|
1529
2038
|
inputs: [],
|
1530
|
-
name: "
|
2039
|
+
name: "LicensingModule__DerivativeRevShareSumExceedsMaxRNFTSupply",
|
1531
2040
|
type: "error"
|
1532
2041
|
}, {
|
1533
2042
|
inputs: [],
|
1534
|
-
name: "
|
2043
|
+
name: "LicensingModule__DerivativesCannotAddLicenseTerms",
|
1535
2044
|
type: "error"
|
1536
2045
|
}, {
|
1537
2046
|
inputs: [],
|
@@ -1555,11 +2064,19 @@ var ErrorsABI = [{
|
|
1555
2064
|
type: "error"
|
1556
2065
|
}, {
|
1557
2066
|
inputs: [],
|
1558
|
-
name: "
|
2067
|
+
name: "LicensingModule__IncompatibleLicensorRoyaltyDerivativeRevShare",
|
1559
2068
|
type: "error"
|
1560
2069
|
}, {
|
1561
|
-
inputs: [
|
1562
|
-
|
2070
|
+
inputs: [{
|
2071
|
+
internalType: "address",
|
2072
|
+
name: "royaltyPolicy",
|
2073
|
+
type: "address"
|
2074
|
+
}, {
|
2075
|
+
internalType: "address",
|
2076
|
+
name: "anotherRoyaltyPolicy",
|
2077
|
+
type: "address"
|
2078
|
+
}],
|
2079
|
+
name: "LicensingModule__IncompatibleRoyaltyPolicy",
|
1563
2080
|
type: "error"
|
1564
2081
|
}, {
|
1565
2082
|
inputs: [],
|
@@ -1577,6 +2094,54 @@ var ErrorsABI = [{
|
|
1577
2094
|
inputs: [],
|
1578
2095
|
name: "LicensingModule__InvalidPolicyFramework",
|
1579
2096
|
type: "error"
|
2097
|
+
}, {
|
2098
|
+
inputs: [],
|
2099
|
+
name: "LicensingModule__IpAlreadyLinked",
|
2100
|
+
type: "error"
|
2101
|
+
}, {
|
2102
|
+
inputs: [{
|
2103
|
+
internalType: "address",
|
2104
|
+
name: "childIpId",
|
2105
|
+
type: "address"
|
2106
|
+
}],
|
2107
|
+
name: "LicensingModule__LicenseNotCompatibleForDerivative",
|
2108
|
+
type: "error"
|
2109
|
+
}, {
|
2110
|
+
inputs: [{
|
2111
|
+
internalType: "uint256",
|
2112
|
+
name: "ipLength",
|
2113
|
+
type: "uint256"
|
2114
|
+
}, {
|
2115
|
+
internalType: "uint256",
|
2116
|
+
name: "licenseTermsLength",
|
2117
|
+
type: "uint256"
|
2118
|
+
}],
|
2119
|
+
name: "LicensingModule__LicenseTermsLengthMismatch",
|
2120
|
+
type: "error"
|
2121
|
+
}, {
|
2122
|
+
inputs: [{
|
2123
|
+
internalType: "address",
|
2124
|
+
name: "licenseTemplate",
|
2125
|
+
type: "address"
|
2126
|
+
}, {
|
2127
|
+
internalType: "uint256",
|
2128
|
+
name: "licenseTermsId",
|
2129
|
+
type: "uint256"
|
2130
|
+
}],
|
2131
|
+
name: "LicensingModule__LicenseTermsNotFound",
|
2132
|
+
type: "error"
|
2133
|
+
}, {
|
2134
|
+
inputs: [{
|
2135
|
+
internalType: "address",
|
2136
|
+
name: "childIpId",
|
2137
|
+
type: "address"
|
2138
|
+
}, {
|
2139
|
+
internalType: "uint256[]",
|
2140
|
+
name: "licenseTokenIds",
|
2141
|
+
type: "uint256[]"
|
2142
|
+
}],
|
2143
|
+
name: "LicensingModule__LicenseTokenNotCompatibleForDerivative",
|
2144
|
+
type: "error"
|
1580
2145
|
}, {
|
1581
2146
|
inputs: [],
|
1582
2147
|
name: "LicensingModule__LicensorDoesntHaveThisPolicy",
|
@@ -1593,6 +2158,10 @@ var ErrorsABI = [{
|
|
1593
2158
|
inputs: [],
|
1594
2159
|
name: "LicensingModule__LinkingRevokedLicense",
|
1595
2160
|
type: "error"
|
2161
|
+
}, {
|
2162
|
+
inputs: [],
|
2163
|
+
name: "LicensingModule__MintAmountZero",
|
2164
|
+
type: "error"
|
1596
2165
|
}, {
|
1597
2166
|
inputs: [],
|
1598
2167
|
name: "LicensingModule__MintLicenseParamFailed",
|
@@ -1605,6 +2174,14 @@ var ErrorsABI = [{
|
|
1605
2174
|
inputs: [],
|
1606
2175
|
name: "LicensingModule__MismatchBetweenRoyaltyPolicy",
|
1607
2176
|
type: "error"
|
2177
|
+
}, {
|
2178
|
+
inputs: [],
|
2179
|
+
name: "LicensingModule__NoLicenseToken",
|
2180
|
+
type: "error"
|
2181
|
+
}, {
|
2182
|
+
inputs: [],
|
2183
|
+
name: "LicensingModule__NoParentIp",
|
2184
|
+
type: "error"
|
1608
2185
|
}, {
|
1609
2186
|
inputs: [],
|
1610
2187
|
name: "LicensingModule__NotLicensee",
|
@@ -1621,6 +2198,14 @@ var ErrorsABI = [{
|
|
1621
2198
|
inputs: [],
|
1622
2199
|
name: "LicensingModule__ParentIdEqualThanChild",
|
1623
2200
|
type: "error"
|
2201
|
+
}, {
|
2202
|
+
inputs: [{
|
2203
|
+
internalType: "address",
|
2204
|
+
name: "ipId",
|
2205
|
+
type: "address"
|
2206
|
+
}],
|
2207
|
+
name: "LicensingModule__ParentIpHasNoLicenseTerms",
|
2208
|
+
type: "error"
|
1624
2209
|
}, {
|
1625
2210
|
inputs: [],
|
1626
2211
|
name: "LicensingModule__PolicyAlreadySetForIpId",
|
@@ -1629,6 +2214,18 @@ var ErrorsABI = [{
|
|
1629
2214
|
inputs: [],
|
1630
2215
|
name: "LicensingModule__PolicyNotFound",
|
1631
2216
|
type: "error"
|
2217
|
+
}, {
|
2218
|
+
inputs: [{
|
2219
|
+
internalType: "address",
|
2220
|
+
name: "receiver",
|
2221
|
+
type: "address"
|
2222
|
+
}],
|
2223
|
+
name: "LicensingModule__ReceiverCheckFailed",
|
2224
|
+
type: "error"
|
2225
|
+
}, {
|
2226
|
+
inputs: [],
|
2227
|
+
name: "LicensingModule__ReceiverZeroAddress",
|
2228
|
+
type: "error"
|
1632
2229
|
}, {
|
1633
2230
|
inputs: [],
|
1634
2231
|
name: "LicensingModule__RegisterPolicyFrameworkMismatch",
|
@@ -1759,15 +2356,15 @@ var ErrorsABI = [{
|
|
1759
2356
|
type: "error"
|
1760
2357
|
}, {
|
1761
2358
|
inputs: [],
|
1762
|
-
name: "
|
2359
|
+
name: "RoyaltyModule__CanOnlyMintSelectedPolicy",
|
1763
2360
|
type: "error"
|
1764
2361
|
}, {
|
1765
2362
|
inputs: [],
|
1766
|
-
name: "
|
2363
|
+
name: "RoyaltyModule__IncompatibleRoyaltyPolicy",
|
1767
2364
|
type: "error"
|
1768
2365
|
}, {
|
1769
2366
|
inputs: [],
|
1770
|
-
name: "
|
2367
|
+
name: "RoyaltyModule__IpIsTagged",
|
1771
2368
|
type: "error"
|
1772
2369
|
}, {
|
1773
2370
|
inputs: [],
|
@@ -1783,15 +2380,15 @@ var ErrorsABI = [{
|
|
1783
2380
|
type: "error"
|
1784
2381
|
}, {
|
1785
2382
|
inputs: [],
|
1786
|
-
name: "
|
2383
|
+
name: "RoyaltyModule__NotWhitelistedRoyaltyPolicy",
|
1787
2384
|
type: "error"
|
1788
2385
|
}, {
|
1789
2386
|
inputs: [],
|
1790
|
-
name: "
|
2387
|
+
name: "RoyaltyModule__NotWhitelistedRoyaltyToken",
|
1791
2388
|
type: "error"
|
1792
2389
|
}, {
|
1793
2390
|
inputs: [],
|
1794
|
-
name: "
|
2391
|
+
name: "RoyaltyModule__ZeroDisputeModule",
|
1795
2392
|
type: "error"
|
1796
2393
|
}, {
|
1797
2394
|
inputs: [],
|
@@ -1821,30 +2418,10 @@ var ErrorsABI = [{
|
|
1821
2418
|
inputs: [],
|
1822
2419
|
name: "RoyaltyPolicyLAP__ImplementationAlreadySet",
|
1823
2420
|
type: "error"
|
1824
|
-
}, {
|
1825
|
-
inputs: [],
|
1826
|
-
name: "RoyaltyPolicyLAP__InvalidAncestors",
|
1827
|
-
type: "error"
|
1828
|
-
}, {
|
1829
|
-
inputs: [],
|
1830
|
-
name: "RoyaltyPolicyLAP__InvalidAncestorsHash",
|
1831
|
-
type: "error"
|
1832
|
-
}, {
|
1833
|
-
inputs: [],
|
1834
|
-
name: "RoyaltyPolicyLAP__InvalidAncestorsLength",
|
1835
|
-
type: "error"
|
1836
|
-
}, {
|
1837
|
-
inputs: [],
|
1838
|
-
name: "RoyaltyPolicyLAP__InvalidAncestorsRoyalty",
|
1839
|
-
type: "error"
|
1840
2421
|
}, {
|
1841
2422
|
inputs: [],
|
1842
2423
|
name: "RoyaltyPolicyLAP__InvalidParentRoyaltiesLength",
|
1843
2424
|
type: "error"
|
1844
|
-
}, {
|
1845
|
-
inputs: [],
|
1846
|
-
name: "RoyaltyPolicyLAP__InvalidRoyaltyAmountLength",
|
1847
|
-
type: "error"
|
1848
2425
|
}, {
|
1849
2426
|
inputs: [],
|
1850
2427
|
name: "RoyaltyPolicyLAP__LastPositionNotAbleToMintLicense",
|
@@ -1859,15 +2436,15 @@ var ErrorsABI = [{
|
|
1859
2436
|
type: "error"
|
1860
2437
|
}, {
|
1861
2438
|
inputs: [],
|
1862
|
-
name: "
|
2439
|
+
name: "RoyaltyPolicyLAP__UnlinkableToParents",
|
1863
2440
|
type: "error"
|
1864
2441
|
}, {
|
1865
2442
|
inputs: [],
|
1866
|
-
name: "
|
2443
|
+
name: "RoyaltyPolicyLAP__ZeroAncestorsVaultImpl",
|
1867
2444
|
type: "error"
|
1868
2445
|
}, {
|
1869
2446
|
inputs: [],
|
1870
|
-
name: "
|
2447
|
+
name: "RoyaltyPolicyLAP__ZeroIpRoyaltyVaultBeacon",
|
1871
2448
|
type: "error"
|
1872
2449
|
}, {
|
1873
2450
|
inputs: [],
|
@@ -1905,544 +2482,238 @@ var sepolia = {
|
|
1905
2482
|
MockERC721: "0x16d50f333B264b153B7BF1DD9fe65A2707B3281b",
|
1906
2483
|
MockTokenGatedHook: "0x28C32a4B5B3E186d7f658C051d3Bb4a95243209a",
|
1907
2484
|
ModuleRegistry: "0x5Aac3177F496F503Ac724A0D0A697f6ba9dA2C27",
|
1908
|
-
|
2485
|
+
PILicenseTemplate: "0xeAABf2b80B7e069EE449B5629590A1cc0F9bC9C2",
|
1909
2486
|
RegistrationModule: "0x613128e88b568768764824f898C8135efED97fA6",
|
1910
2487
|
RoyaltyModule: "0xA6bEf9CC650A16939566c1da5d5088f3F028a865",
|
1911
2488
|
RoyaltyPolicyLAP: "0x16eF58e959522727588921A92e9084d36E5d3855",
|
1912
2489
|
TokenWithdrawalModule: "0x66738a5722e9Cd91B694bA39146CFEcE95457F04"
|
1913
2490
|
};
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
2491
|
+
var storyTestnet = {
|
2492
|
+
AccessController: "0x7e253Df9b0fC872746877Fa362b2cAf32712d770",
|
2493
|
+
ArbitrationPolicySP: "0xA25bc70932282b35407e0DC08cc9C91f6b00CEf0",
|
2494
|
+
CoreMetadataModule: "0x8A8FBAaEB6A0B7736ebde31c6F49CccD808232bA",
|
2495
|
+
CoreMetadataViewModule: "0x8A8FBAaEB6A0B7736ebde31c6F49CccD808232bA",
|
2496
|
+
DisputeModule: "0x6d54456Ae5DCbDC0C9E2713cC8E650fE4f445c7C",
|
2497
|
+
Governance: "0x63F4A670A8b518ef5eb291559BdAbea4b31c1AC4",
|
2498
|
+
IPAccountImpl: "0x38cAfD16502B1d61c6399A18d6Fa1Ea8CEca3678",
|
2499
|
+
IPAccountRegistry: "0x8448d0F77D7e67e0814f83D988aB3344D46bb1E4",
|
2500
|
+
IPAssetRegistry: "0x862de97662a1231FFc14038eC1BE93aB129D2169",
|
2501
|
+
IpRoyaltyVaultBeacon: "0xE92Cdf428f07D92248b6b15ce59a9d5597428F21",
|
2502
|
+
IpRoyaltyVaultImpl: "0x8Be22cc2D13ADF496a417D9C616dA4a253c68Af8",
|
2503
|
+
LicenseRegistry: "0x0c3D467537FAd845a78728CEdc3D9447338c5422",
|
2504
|
+
LicenseToken: "0xD40b7bCA204f96a346021e31c9ad54FF495226e7",
|
2505
|
+
LicensingModule: "0xEeDDE5529122b621105798860F235c28FD3aBA40",
|
2506
|
+
MockERC20: "0xA36F2A4A02f5C215d1b3630f71A4Ff55B5492AAE",
|
2507
|
+
MockERC721: "0x83DD606d14CcEb629dE9Bf8Aad7aE63767dB476f",
|
2508
|
+
MockTokenGatedHook: "0x80519d82FBE474AB9E863A066AC32E3eeAFc8F11",
|
2509
|
+
ModuleRegistry: "0xf2965E3B6251905Dd1E8671077760D07b0408cf2",
|
2510
|
+
PILicenseTemplate: "0xd0Be223ae9719bBD93447ecf5289319CCf8cA227",
|
2511
|
+
RoyaltyModule: "0x551AD8CD7893003cE00500aC2aCF1E327763D9f6",
|
2512
|
+
RoyaltyPolicyLAP: "0x2EcdB5bD12a037dCb9De0Ab7957f35FEeF758eA6",
|
2513
|
+
TokenWithdrawalModule: "0xC573E5c36B8FA5108b78f7357947972D030699d5"
|
1919
2514
|
};
|
1920
|
-
var
|
1921
|
-
|
1922
|
-
|
2515
|
+
var contractAddress = {
|
2516
|
+
sepolia: sepolia,
|
2517
|
+
11155111: sepolia,
|
2518
|
+
storyTestnet: storyTestnet,
|
2519
|
+
1513: storyTestnet
|
1923
2520
|
};
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
2521
|
+
|
2522
|
+
var IPAccountABI = [].concat(_toConsumableArray(IPAccountImplABI), _toConsumableArray(ErrorsABI));
|
2523
|
+
var getIPAssetRegistryConfig = function getIPAssetRegistryConfig(chain) {
|
2524
|
+
return {
|
2525
|
+
abi: IPAssetRegistryABI,
|
2526
|
+
address: getAddress(contractAddress[chain].IPAssetRegistry)
|
2527
|
+
};
|
1927
2528
|
};
|
1928
|
-
var
|
1929
|
-
|
1930
|
-
|
2529
|
+
var getAccessControllerConfig = function getAccessControllerConfig(chain) {
|
2530
|
+
return {
|
2531
|
+
abi: [].concat(_toConsumableArray(AccessControllerABI), _toConsumableArray(ErrorsABI)),
|
2532
|
+
address: getAddress(contractAddress[chain].AccessController)
|
2533
|
+
};
|
1931
2534
|
};
|
1932
|
-
var
|
1933
|
-
|
1934
|
-
|
2535
|
+
var getDisputeModuleConfig = function getDisputeModuleConfig(chain) {
|
2536
|
+
return {
|
2537
|
+
abi: [].concat(_toConsumableArray(DisputeModuleABI), _toConsumableArray(ErrorsABI)),
|
2538
|
+
address: getAddress(contractAddress[chain].DisputeModule)
|
2539
|
+
};
|
1935
2540
|
};
|
1936
|
-
var
|
1937
|
-
|
1938
|
-
|
2541
|
+
var getLicenseRegistryConfig = function getLicenseRegistryConfig(chain) {
|
2542
|
+
return {
|
2543
|
+
abi: IERC1155ABI,
|
2544
|
+
address: getAddress(contractAddress[chain].LicenseRegistry)
|
2545
|
+
};
|
1939
2546
|
};
|
1940
|
-
var
|
1941
|
-
|
1942
|
-
|
2547
|
+
var getLicensingModuleConfig = function getLicensingModuleConfig(chain) {
|
2548
|
+
return {
|
2549
|
+
abi: [].concat(_toConsumableArray(LicensingModuleABI), _toConsumableArray(ErrorsABI)),
|
2550
|
+
address: getAddress(contractAddress[chain].LicensingModule)
|
2551
|
+
};
|
1943
2552
|
};
|
1944
|
-
var
|
1945
|
-
|
2553
|
+
var getRoyaltyPolicyLAPConfig = function getRoyaltyPolicyLAPConfig(chain) {
|
2554
|
+
return {
|
2555
|
+
abi: [].concat(_toConsumableArray(IRoyaltyPolicyLAPABI), _toConsumableArray(ErrorsABI)),
|
2556
|
+
address: getAddress(contractAddress[chain].RoyaltyPolicyLAP)
|
2557
|
+
};
|
1946
2558
|
};
|
1947
|
-
|
1948
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
1949
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
1950
|
-
if (!it) {
|
1951
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
1952
|
-
if (it) o = it;
|
1953
|
-
var i = 0;
|
1954
|
-
var F = function () {};
|
1955
|
-
return {
|
1956
|
-
s: F,
|
1957
|
-
n: function () {
|
1958
|
-
if (i >= o.length) return {
|
1959
|
-
done: true
|
1960
|
-
};
|
1961
|
-
return {
|
1962
|
-
done: false,
|
1963
|
-
value: o[i++]
|
1964
|
-
};
|
1965
|
-
},
|
1966
|
-
e: function (e) {
|
1967
|
-
throw e;
|
1968
|
-
},
|
1969
|
-
f: F
|
1970
|
-
};
|
1971
|
-
}
|
1972
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1973
|
-
}
|
1974
|
-
var normalCompletion = true,
|
1975
|
-
didErr = false,
|
1976
|
-
err;
|
2559
|
+
var getRoyaltyVaultImplConfig = function getRoyaltyVaultImplConfig(chain) {
|
1977
2560
|
return {
|
1978
|
-
|
1979
|
-
|
1980
|
-
},
|
1981
|
-
n: function () {
|
1982
|
-
var step = it.next();
|
1983
|
-
normalCompletion = step.done;
|
1984
|
-
return step;
|
1985
|
-
},
|
1986
|
-
e: function (e) {
|
1987
|
-
didErr = true;
|
1988
|
-
err = e;
|
1989
|
-
},
|
1990
|
-
f: function () {
|
1991
|
-
try {
|
1992
|
-
if (!normalCompletion && it.return != null) it.return();
|
1993
|
-
} finally {
|
1994
|
-
if (didErr) throw err;
|
1995
|
-
}
|
1996
|
-
}
|
2561
|
+
abi: [].concat(_toConsumableArray(IpRoyaltyVaultABI), _toConsumableArray(ErrorsABI)),
|
2562
|
+
address: getAddress(contractAddress[chain].IpRoyaltyVaultImpl)
|
1997
2563
|
};
|
1998
|
-
}
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
confirmations: params.confirmations,
|
2016
|
-
pollingInterval: params.pollingInterval,
|
2017
|
-
timeout: params.timeout
|
2018
|
-
});
|
2019
|
-
case 2:
|
2020
|
-
txReceipt = _context.sent;
|
2021
|
-
targetLogs = [];
|
2022
|
-
_iterator = _createForOfIteratorHelper(txReceipt.logs);
|
2023
|
-
_context.prev = 5;
|
2024
|
-
_iterator.s();
|
2025
|
-
case 7:
|
2026
|
-
if ((_step = _iterator.n()).done) {
|
2027
|
-
_context.next = 21;
|
2028
|
-
break;
|
2029
|
-
}
|
2030
|
-
log = _step.value;
|
2031
|
-
_context.prev = 9;
|
2032
|
-
if (!(params.from && log.address !== params.from.toLowerCase())) {
|
2033
|
-
_context.next = 12;
|
2034
|
-
break;
|
2035
|
-
}
|
2036
|
-
return _context.abrupt("continue", 19);
|
2037
|
-
case 12:
|
2038
|
-
currentLog = decodeEventLog({
|
2039
|
-
abi: params.abi,
|
2040
|
-
eventName: params.eventName,
|
2041
|
-
data: log.data,
|
2042
|
-
topics: log.topics
|
2043
|
-
});
|
2044
|
-
targetLogs.push(currentLog);
|
2045
|
-
_context.next = 19;
|
2046
|
-
break;
|
2047
|
-
case 16:
|
2048
|
-
_context.prev = 16;
|
2049
|
-
_context.t0 = _context["catch"](9);
|
2050
|
-
return _context.abrupt("continue", 19);
|
2051
|
-
case 19:
|
2052
|
-
_context.next = 7;
|
2053
|
-
break;
|
2054
|
-
case 21:
|
2055
|
-
_context.next = 26;
|
2056
|
-
break;
|
2057
|
-
case 23:
|
2058
|
-
_context.prev = 23;
|
2059
|
-
_context.t1 = _context["catch"](5);
|
2060
|
-
_iterator.e(_context.t1);
|
2061
|
-
case 26:
|
2062
|
-
_context.prev = 26;
|
2063
|
-
_iterator.f();
|
2064
|
-
return _context.finish(26);
|
2065
|
-
case 29:
|
2066
|
-
if (!(targetLogs.length === 0)) {
|
2067
|
-
_context.next = 31;
|
2068
|
-
break;
|
2069
|
-
}
|
2070
|
-
throw new Error("not found event ".concat(params.eventName, " in target transaction"));
|
2071
|
-
case 31:
|
2072
|
-
return _context.abrupt("return", targetLogs);
|
2073
|
-
case 32:
|
2074
|
-
case "end":
|
2075
|
-
return _context.stop();
|
2076
|
-
}
|
2077
|
-
}, _callee, null, [[5, 23, 26, 29], [9, 16]]);
|
2078
|
-
}));
|
2079
|
-
return _waitTxAndFilterLog.apply(this, arguments);
|
2080
|
-
}
|
2081
|
-
function waitTx(_x4, _x5, _x6) {
|
2082
|
-
return _waitTx.apply(this, arguments);
|
2083
|
-
}
|
2084
|
-
function _waitTx() {
|
2085
|
-
_waitTx = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(client, txHash, params) {
|
2086
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
2087
|
-
while (1) switch (_context2.prev = _context2.next) {
|
2088
|
-
case 0:
|
2089
|
-
_context2.next = 2;
|
2090
|
-
return client.waitForTransactionReceipt(_objectSpread2({
|
2091
|
-
hash: txHash
|
2092
|
-
}, params));
|
2093
|
-
case 2:
|
2094
|
-
case "end":
|
2095
|
-
return _context2.stop();
|
2096
|
-
}
|
2097
|
-
}, _callee2);
|
2098
|
-
}));
|
2099
|
-
return _waitTx.apply(this, arguments);
|
2100
|
-
}
|
2101
|
-
function typedDataToBytes(typedData) {
|
2102
|
-
return encodeAbiParameters(parseAbiParameters(typedData["interface"]), typedData.data);
|
2103
|
-
}
|
2104
|
-
function chainStringToViemChain(chainId) {
|
2105
|
-
switch (chainId) {
|
2106
|
-
case "1":
|
2107
|
-
case "mainnet":
|
2108
|
-
return mainnet;
|
2109
|
-
case "11155111":
|
2110
|
-
case "sepolia":
|
2111
|
-
return sepolia$1;
|
2112
|
-
case "80001":
|
2113
|
-
case "mumbai":
|
2114
|
-
case "polygonMumbai":
|
2115
|
-
return polygonMumbai;
|
2116
|
-
default:
|
2117
|
-
throw new Error("chainId ".concat(chainId, " not supported"));
|
2118
|
-
}
|
2119
|
-
}
|
2120
|
-
|
2121
|
-
function computeRoyaltyContext(_x, _x2) {
|
2122
|
-
return _computeRoyaltyContext.apply(this, arguments);
|
2123
|
-
}
|
2124
|
-
function _computeRoyaltyContext() {
|
2125
|
-
_computeRoyaltyContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(licenseIds, storyClient) {
|
2126
|
-
var royaltyContext, i, licenseData, royaltyPolicy, policy, targetRoyaltyAmount;
|
2127
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
2128
|
-
while (1) switch (_context.prev = _context.next) {
|
2129
|
-
case 0:
|
2130
|
-
royaltyContext = {
|
2131
|
-
targetAncestors: [],
|
2132
|
-
targetRoyaltyAmount: [],
|
2133
|
-
parentAncestors1: [],
|
2134
|
-
parentAncestors2: [],
|
2135
|
-
parentAncestorsRoyalties1: [],
|
2136
|
-
parentAncestorsRoyalties2: []
|
2137
|
-
};
|
2138
|
-
i = 0;
|
2139
|
-
case 2:
|
2140
|
-
if (!(i < licenseIds.length)) {
|
2141
|
-
_context.next = 16;
|
2142
|
-
break;
|
2143
|
-
}
|
2144
|
-
_context.next = 5;
|
2145
|
-
return storyClient.getLicense(licenseIds[i]);
|
2146
|
-
case 5:
|
2147
|
-
licenseData = _context.sent;
|
2148
|
-
_context.next = 8;
|
2149
|
-
return storyClient.getRoyaltyPolicy(licenseData.licensorIpId);
|
2150
|
-
case 8:
|
2151
|
-
royaltyPolicy = _context.sent;
|
2152
|
-
_context.next = 11;
|
2153
|
-
return storyClient.getPolicy(licenseData.policyId);
|
2154
|
-
case 11:
|
2155
|
-
policy = _context.sent;
|
2156
|
-
if (royaltyPolicy) {
|
2157
|
-
targetRoyaltyAmount = royaltyPolicy.targetRoyaltyAmount.map(function (e) {
|
2158
|
-
return parseInt(e);
|
2159
|
-
});
|
2160
|
-
if (i === 0) {
|
2161
|
-
royaltyContext.parentAncestors1 = royaltyPolicy.targetAncestors;
|
2162
|
-
royaltyContext.parentAncestorsRoyalties1 = targetRoyaltyAmount;
|
2163
|
-
} else {
|
2164
|
-
royaltyContext.parentAncestors2 = royaltyPolicy.targetAncestors;
|
2165
|
-
royaltyContext.parentAncestorsRoyalties2 = targetRoyaltyAmount;
|
2166
|
-
}
|
2167
|
-
updateRoyaltyContext(royaltyContext, [licenseData.licensorIpId], [parseInt(policy.pil.commercialRevShare)]);
|
2168
|
-
updateRoyaltyContext(royaltyContext, royaltyPolicy.targetAncestors, targetRoyaltyAmount);
|
2169
|
-
}
|
2170
|
-
case 13:
|
2171
|
-
i++;
|
2172
|
-
_context.next = 2;
|
2173
|
-
break;
|
2174
|
-
case 16:
|
2175
|
-
return _context.abrupt("return", royaltyContext);
|
2176
|
-
case 17:
|
2177
|
-
case "end":
|
2178
|
-
return _context.stop();
|
2179
|
-
}
|
2180
|
-
}, _callee);
|
2181
|
-
}));
|
2182
|
-
return _computeRoyaltyContext.apply(this, arguments);
|
2183
|
-
}
|
2184
|
-
function encodeRoyaltyContext(royaltyContext) {
|
2185
|
-
return typedDataToBytes({
|
2186
|
-
"interface": "(address[], uint32[], address[], address[], uint32[], uint32[])",
|
2187
|
-
data: [[royaltyContext.targetAncestors, royaltyContext.targetRoyaltyAmount, royaltyContext.parentAncestors1, royaltyContext.parentAncestors2, royaltyContext.parentAncestorsRoyalties1, royaltyContext.parentAncestorsRoyalties2]]
|
2188
|
-
});
|
2189
|
-
}
|
2190
|
-
function updateRoyaltyContext(royaltyContext, targetAncestors, targetRoyaltyAccounts) {
|
2191
|
-
for (var i = 0; i < targetAncestors.length; i++) {
|
2192
|
-
var index = royaltyContext.targetAncestors.indexOf(targetAncestors[i]);
|
2193
|
-
if (index === -1) {
|
2194
|
-
royaltyContext.targetAncestors.push(targetAncestors[i]);
|
2195
|
-
royaltyContext.targetRoyaltyAmount.push(targetRoyaltyAccounts[i]);
|
2196
|
-
} else {
|
2197
|
-
royaltyContext.targetRoyaltyAmount[index] += targetRoyaltyAccounts[i];
|
2198
|
-
}
|
2564
|
+
};
|
2565
|
+
var getRoyaltyModuleConfig = function getRoyaltyModuleConfig(chain) {
|
2566
|
+
return {
|
2567
|
+
abi: [].concat(_toConsumableArray(IRoyaltyModuleABI), _toConsumableArray(ErrorsABI)),
|
2568
|
+
address: getAddress(contractAddress[chain].RoyaltyModule)
|
2569
|
+
};
|
2570
|
+
};
|
2571
|
+
var getLicenseTemplateConfig = function getLicenseTemplateConfig(chain) {
|
2572
|
+
return {
|
2573
|
+
abi: [].concat(_toConsumableArray(PILicenseTemplateABI), _toConsumableArray(ErrorsABI)),
|
2574
|
+
address: getAddress(contractAddress[chain].PILicenseTemplate)
|
2575
|
+
};
|
2576
|
+
};
|
2577
|
+
|
2578
|
+
function handleError(error, msg) {
|
2579
|
+
if (error instanceof Error) {
|
2580
|
+
throw new Error("".concat(msg, ": ").concat(error.message));
|
2199
2581
|
}
|
2582
|
+
throw new Error("".concat(msg, ": Unknown error type"));
|
2200
2583
|
}
|
2201
2584
|
|
2202
2585
|
var IPAssetClient = /*#__PURE__*/function () {
|
2203
|
-
function IPAssetClient(rpcClient, wallet,
|
2586
|
+
function IPAssetClient(rpcClient, wallet, chainId) {
|
2204
2587
|
_classCallCheck(this, IPAssetClient);
|
2205
|
-
_defineProperty(this, "ipAssetRegistryConfig", IPAssetRegistryConfig);
|
2206
|
-
_defineProperty(this, "registrationModuleConfig", RegistrationModuleConfig);
|
2207
2588
|
this.wallet = wallet;
|
2208
2589
|
this.rpcClient = rpcClient;
|
2209
|
-
this.
|
2590
|
+
this.chainId = chainId;
|
2591
|
+
this.ipAssetRegistryConfig = getIPAssetRegistryConfig(chainId);
|
2210
2592
|
}
|
2211
|
-
|
2212
|
-
/**
|
2213
|
-
* Registers a root-level IP into the protocol. Root-level IPs can be thought of as organizational hubs
|
2214
|
-
* for encapsulating policies that actual IPs can use to register through. As such, a root-level IP is not an
|
2215
|
-
* actual IP, but a container for IP policy management for their child IP assets.
|
2216
|
-
* @param request The request object that contains all data needed to register a root IP.
|
2217
|
-
* @param request.policyId The policy that identifies the licensing terms of the IP.
|
2218
|
-
* @param request.tokenContract The address of the NFT bound to the root-level IP.
|
2219
|
-
* @param request.tokenId The token id of the NFT bound to the root-level IP.
|
2220
|
-
* @param request.ipName [Optional] The name assigned to the new IP.
|
2221
|
-
* @param request.contentHash [Optional] The content hash of the IP being registered.
|
2222
|
-
* @param request.uri [Optional] An external URI to link to the IP.
|
2223
|
-
* @param request.txOptions [Optional] The transaction options.
|
2224
|
-
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2225
|
-
* @emits RootIPRegistered (msg.sender, ipId, policyId)
|
2226
|
-
*/
|
2227
2593
|
return _createClass(IPAssetClient, [{
|
2228
|
-
key: "
|
2229
|
-
value:
|
2230
|
-
var
|
2231
|
-
var
|
2594
|
+
key: "isNFTRegistered",
|
2595
|
+
value: function () {
|
2596
|
+
var _isNFTRegistered = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(tokenAddress, tokenId) {
|
2597
|
+
var ipId, isRegistered;
|
2232
2598
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
2233
2599
|
while (1) switch (_context.prev = _context.next) {
|
2234
2600
|
case 0:
|
2235
|
-
_context.
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
ipId = _context.sent;
|
2240
|
-
if (!(ipId !== "0x")) {
|
2241
|
-
_context.next = 6;
|
2242
|
-
break;
|
2243
|
-
}
|
2244
|
-
return _context.abrupt("return", {
|
2245
|
-
ipId: ipId
|
2246
|
-
});
|
2247
|
-
case 6:
|
2248
|
-
_context.next = 8;
|
2249
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.registrationModuleConfig), {}, {
|
2250
|
-
functionName: "registerRootIp",
|
2251
|
-
args: [parseToBigInt(request.policyId || "0"), getAddress(request.tokenContractAddress),
|
2252
|
-
// 0x Address
|
2253
|
-
parseToBigInt(request.tokenId), request.ipName || "", request.contentHash || HashZero, request.uri || ""],
|
2254
|
-
account: this.wallet.account
|
2601
|
+
_context.next = 2;
|
2602
|
+
return this.rpcClient.readContract(_objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
|
2603
|
+
functionName: "ipId",
|
2604
|
+
args: [parseToBigInt(chain[this.chainId]), tokenAddress, tokenId]
|
2255
2605
|
}));
|
2256
|
-
case
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
txHash = _context.sent;
|
2263
|
-
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
2264
|
-
_context.next = 20;
|
2265
|
-
break;
|
2266
|
-
}
|
2267
|
-
_context.next = 16;
|
2268
|
-
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
|
2269
|
-
eventName: "IPRegistered"
|
2606
|
+
case 2:
|
2607
|
+
ipId = _context.sent;
|
2608
|
+
_context.next = 5;
|
2609
|
+
return this.rpcClient.readContract(_objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
|
2610
|
+
functionName: "isRegistered",
|
2611
|
+
args: [ipId]
|
2270
2612
|
}));
|
2271
|
-
case
|
2272
|
-
|
2273
|
-
return _context.abrupt("return",
|
2274
|
-
|
2275
|
-
ipId: targetLogs[0].args.ipId
|
2276
|
-
});
|
2277
|
-
case 20:
|
2278
|
-
return _context.abrupt("return", {
|
2279
|
-
txHash: txHash
|
2280
|
-
});
|
2281
|
-
case 21:
|
2282
|
-
_context.next = 26;
|
2283
|
-
break;
|
2284
|
-
case 23:
|
2285
|
-
_context.prev = 23;
|
2286
|
-
_context.t0 = _context["catch"](0);
|
2287
|
-
handleError(_context.t0, "Failed to register root IP");
|
2288
|
-
case 26:
|
2613
|
+
case 5:
|
2614
|
+
isRegistered = _context.sent;
|
2615
|
+
return _context.abrupt("return", isRegistered ? ipId : "0x");
|
2616
|
+
case 7:
|
2289
2617
|
case "end":
|
2290
2618
|
return _context.stop();
|
2291
2619
|
}
|
2292
|
-
}, _callee, this
|
2620
|
+
}, _callee, this);
|
2293
2621
|
}));
|
2294
|
-
function
|
2295
|
-
return
|
2622
|
+
function isNFTRegistered(_x, _x2) {
|
2623
|
+
return _isNFTRegistered.apply(this, arguments);
|
2296
2624
|
}
|
2297
|
-
return
|
2625
|
+
return isNFTRegistered;
|
2298
2626
|
}()
|
2299
2627
|
/**
|
2300
|
-
*
|
2301
|
-
*
|
2302
|
-
*
|
2303
|
-
*
|
2304
|
-
*
|
2305
|
-
* @param request.tokenId The token id of the NFT bound to the derivative IP.
|
2306
|
-
* @param request.ipName [Optional] The name assigned to the new IP.
|
2307
|
-
* @param request.contentHash [Optional] The content hash of the IP being registered.
|
2308
|
-
* @param request.uri [Optional] An external URI to link to the IP.
|
2309
|
-
* @param request.txOptions [Optional] The transaction options.
|
2628
|
+
* Registers an NFT as IP, creating a corresponding IP record.
|
2629
|
+
* @param request The request object that contains all data needed to register IP.
|
2630
|
+
* @param request.tokenContract The address of the NFT.
|
2631
|
+
* @param request.tokenId The token identifier of the NFT.
|
2632
|
+
* @param request.txOptions [Optional] The transaction options.
|
2310
2633
|
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
|
2311
|
-
* @emits
|
2634
|
+
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, resolverAddr, metadataProviderAddress, metadata)
|
2312
2635
|
*/
|
2313
|
-
)
|
2314
2636
|
}, {
|
2315
|
-
key: "
|
2637
|
+
key: "register",
|
2316
2638
|
value: (function () {
|
2317
|
-
var
|
2318
|
-
var _request$
|
2639
|
+
var _register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2640
|
+
var tokenId, _request$txOptions, ipId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2319
2641
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
2320
2642
|
while (1) switch (_context2.prev = _context2.next) {
|
2321
2643
|
case 0:
|
2322
|
-
|
2323
|
-
_context2.
|
2324
|
-
|
2325
|
-
|
2644
|
+
tokenId = parseToBigInt(request.tokenId);
|
2645
|
+
_context2.prev = 1;
|
2646
|
+
_context2.next = 4;
|
2647
|
+
return this.isNFTRegistered(request.tokenContract, tokenId);
|
2648
|
+
case 4:
|
2326
2649
|
ipId = _context2.sent;
|
2327
2650
|
if (!(ipId !== "0x")) {
|
2328
|
-
_context2.next =
|
2651
|
+
_context2.next = 7;
|
2329
2652
|
break;
|
2330
2653
|
}
|
2331
2654
|
return _context2.abrupt("return", {
|
2332
2655
|
ipId: ipId
|
2333
2656
|
});
|
2334
|
-
case
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
_context2.next = 10;
|
2340
|
-
return computeRoyaltyContext(request.licenseIds, this.storyClient);
|
2341
|
-
case 10:
|
2342
|
-
royaltyContext = _context2.sent;
|
2343
|
-
_context2.next = 13;
|
2344
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.registrationModuleConfig), {}, {
|
2345
|
-
functionName: "registerDerivativeIp",
|
2346
|
-
args: [licenseIds, getAddress(request.tokenContractAddress),
|
2347
|
-
// 0x Address
|
2348
|
-
parseToBigInt(request.tokenId), request.ipName || "", request.contentHash || HashZero, request.uri || "", encodeRoyaltyContext(royaltyContext)],
|
2657
|
+
case 7:
|
2658
|
+
_context2.next = 9;
|
2659
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
|
2660
|
+
functionName: "register",
|
2661
|
+
args: [getAddress(request.tokenContract), tokenId],
|
2349
2662
|
account: this.wallet.account
|
2350
2663
|
}));
|
2351
|
-
case
|
2352
|
-
_yield$this$
|
2353
|
-
call = _yield$this$
|
2354
|
-
_context2.next =
|
2664
|
+
case 9:
|
2665
|
+
_yield$this$rpcClient = _context2.sent;
|
2666
|
+
call = _yield$this$rpcClient.request;
|
2667
|
+
_context2.next = 13;
|
2355
2668
|
return this.wallet.writeContract(call);
|
2356
|
-
case
|
2669
|
+
case 13:
|
2357
2670
|
txHash = _context2.sent;
|
2358
|
-
if (!((_request$
|
2359
|
-
_context2.next =
|
2671
|
+
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
2672
|
+
_context2.next = 21;
|
2360
2673
|
break;
|
2361
2674
|
}
|
2362
|
-
_context2.next =
|
2675
|
+
_context2.next = 17;
|
2363
2676
|
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
|
2364
2677
|
eventName: "IPRegistered"
|
2365
2678
|
}));
|
2366
|
-
case
|
2679
|
+
case 17:
|
2367
2680
|
targetLogs = _context2.sent;
|
2368
2681
|
return _context2.abrupt("return", {
|
2369
2682
|
txHash: txHash,
|
2370
2683
|
ipId: targetLogs[0].args.ipId
|
2371
2684
|
});
|
2372
|
-
case
|
2685
|
+
case 21:
|
2373
2686
|
return _context2.abrupt("return", {
|
2374
2687
|
txHash: txHash
|
2375
2688
|
});
|
2376
|
-
case
|
2377
|
-
_context2.next =
|
2689
|
+
case 22:
|
2690
|
+
_context2.next = 27;
|
2378
2691
|
break;
|
2379
|
-
case
|
2380
|
-
_context2.prev =
|
2381
|
-
_context2.t0 = _context2["catch"](
|
2382
|
-
handleError(_context2.t0, "Failed to register
|
2383
|
-
case
|
2692
|
+
case 24:
|
2693
|
+
_context2.prev = 24;
|
2694
|
+
_context2.t0 = _context2["catch"](1);
|
2695
|
+
handleError(_context2.t0, "Failed to register IP");
|
2696
|
+
case 27:
|
2384
2697
|
case "end":
|
2385
2698
|
return _context2.stop();
|
2386
2699
|
}
|
2387
|
-
}, _callee2, this, [[
|
2388
|
-
}));
|
2389
|
-
function registerDerivativeIp(_x2) {
|
2390
|
-
return _registerDerivativeIp.apply(this, arguments);
|
2391
|
-
}
|
2392
|
-
return registerDerivativeIp;
|
2393
|
-
}()
|
2394
|
-
/**
|
2395
|
-
* Checks if an NFT is already registered in the protocol.
|
2396
|
-
* @param chainId The chain ID of the NFT.
|
2397
|
-
* @param tokenAddress The address of the NFT.
|
2398
|
-
* @param tokenId The token ID of the NFT.
|
2399
|
-
* @returns A Promise that resolves to the IP ID if the NFT is already registered, otherwise it resolves to 0x.
|
2400
|
-
*/
|
2401
|
-
)
|
2402
|
-
}, {
|
2403
|
-
key: "isNFTRegistered",
|
2404
|
-
value: (function () {
|
2405
|
-
var _isNFTRegistered = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(chainId, tokenAddress, tokenId) {
|
2406
|
-
var ipId, isRegistered;
|
2407
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
2408
|
-
while (1) switch (_context3.prev = _context3.next) {
|
2409
|
-
case 0:
|
2410
|
-
_context3.next = 2;
|
2411
|
-
return this.rpcClient.readContract(_objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
|
2412
|
-
functionName: "ipId",
|
2413
|
-
args: [parseToBigInt(chainId), tokenAddress, parseToBigInt(tokenId)]
|
2414
|
-
}));
|
2415
|
-
case 2:
|
2416
|
-
ipId = _context3.sent;
|
2417
|
-
_context3.next = 5;
|
2418
|
-
return this.rpcClient.readContract(_objectSpread2(_objectSpread2({}, this.ipAssetRegistryConfig), {}, {
|
2419
|
-
functionName: "isRegistered",
|
2420
|
-
args: [ipId]
|
2421
|
-
}));
|
2422
|
-
case 5:
|
2423
|
-
isRegistered = _context3.sent;
|
2424
|
-
return _context3.abrupt("return", isRegistered ? ipId : "0x");
|
2425
|
-
case 7:
|
2426
|
-
case "end":
|
2427
|
-
return _context3.stop();
|
2428
|
-
}
|
2429
|
-
}, _callee3, this);
|
2700
|
+
}, _callee2, this, [[1, 24]]);
|
2430
2701
|
}));
|
2431
|
-
function
|
2432
|
-
return
|
2702
|
+
function register(_x3) {
|
2703
|
+
return _register.apply(this, arguments);
|
2433
2704
|
}
|
2434
|
-
return
|
2705
|
+
return register;
|
2435
2706
|
}())
|
2436
2707
|
}]);
|
2437
2708
|
}();
|
2438
2709
|
|
2439
2710
|
var PermissionClient = /*#__PURE__*/function () {
|
2440
|
-
function PermissionClient(rpcClient, wallet) {
|
2711
|
+
function PermissionClient(rpcClient, wallet, chainId) {
|
2441
2712
|
_classCallCheck(this, PermissionClient);
|
2442
2713
|
_defineProperty(this, "ipAccountABI", IPAccountABI);
|
2443
|
-
_defineProperty(this, "accessControllerConfig", AccessControllerConfig);
|
2444
2714
|
this.rpcClient = rpcClient;
|
2445
2715
|
this.wallet = wallet;
|
2716
|
+
this.accessControllerConfig = getAccessControllerConfig(chainId);
|
2446
2717
|
}
|
2447
2718
|
|
2448
2719
|
/**
|
@@ -2542,417 +2813,116 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
2542
2813
|
}();
|
2543
2814
|
|
2544
2815
|
var LicenseClient = /*#__PURE__*/function () {
|
2545
|
-
function LicenseClient(rpcClient, wallet, storyClient) {
|
2816
|
+
function LicenseClient(rpcClient, wallet, storyClient, chainId) {
|
2546
2817
|
_classCallCheck(this, LicenseClient);
|
2547
2818
|
_defineProperty(this, "ipAccountABI", IPAccountABI);
|
2548
|
-
_defineProperty(this, "licenseRegistryConfig", LicenseRegistryConfig);
|
2549
|
-
_defineProperty(this, "licensingModuleConfig", LicensingModuleConfig);
|
2550
2819
|
this.wallet = wallet;
|
2551
2820
|
this.rpcClient = rpcClient;
|
2552
2821
|
this.storyClient = storyClient;
|
2822
|
+
this.licenseRegistryConfig = getLicenseRegistryConfig(chainId);
|
2823
|
+
this.licensingModuleConfig = getLicensingModuleConfig(chainId);
|
2824
|
+
this.licenseTemplateConfig = getLicenseTemplateConfig(chainId);
|
2825
|
+
this.royaltyPolicyLAPConfig = getRoyaltyPolicyLAPConfig(chainId);
|
2553
2826
|
}
|
2554
|
-
|
2555
|
-
/**
|
2556
|
-
* Mints license NFTs representing a policy granted by a set of ipIds (licensors). This NFT needs to be
|
2557
|
-
* burned in order to link a derivative IP with its parents. If this is the first combination of policy and
|
2558
|
-
* licensors, a new licenseId will be created. If not, the license is fungible and an id will be reused.
|
2559
|
-
* @dev Only callable by the licensing module.
|
2560
|
-
* @param request The request object containing necessary data to mint a license.
|
2561
|
-
* @param request.policyId The ID of the policy to be minted
|
2562
|
-
* @param request.licensorIpId_ The ID of the IP granting the license (ie. licensor)
|
2563
|
-
* @param request.mintAmount Number of licenses to mint. License NFT is fungible for same policy and same licensors
|
2564
|
-
* @param request.receiver Receiver address of the minted license NFT(s).
|
2565
|
-
* @returns licenseId The ID of the minted license NFT(s).
|
2566
|
-
*/
|
2567
2827
|
return _createClass(LicenseClient, [{
|
2568
|
-
key: "
|
2569
|
-
value: (function () {
|
2570
|
-
var _mintLicense = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2571
|
-
var _request$txOptions, royaltyContext, royaltyPolicy, _royaltyContext$targe, _royaltyContext$targe2, targetRoyaltyAmount, _yield$this$rpcClient, call, txHash, targetLogs;
|
2572
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
2573
|
-
while (1) switch (_context.prev = _context.next) {
|
2574
|
-
case 0:
|
2575
|
-
_context.prev = 0;
|
2576
|
-
royaltyContext = {
|
2577
|
-
targetAncestors: [],
|
2578
|
-
targetRoyaltyAmount: [],
|
2579
|
-
parentAncestors1: [],
|
2580
|
-
parentAncestors2: [],
|
2581
|
-
parentAncestorsRoyalties1: [],
|
2582
|
-
parentAncestorsRoyalties2: []
|
2583
|
-
};
|
2584
|
-
_context.next = 4;
|
2585
|
-
return this.storyClient.getRoyaltyPolicy(request.licensorIpId);
|
2586
|
-
case 4:
|
2587
|
-
royaltyPolicy = _context.sent;
|
2588
|
-
if (royaltyPolicy) {
|
2589
|
-
(_royaltyContext$targe = royaltyContext.targetAncestors).push.apply(_royaltyContext$targe, _toConsumableArray(royaltyPolicy.targetAncestors));
|
2590
|
-
targetRoyaltyAmount = royaltyPolicy.targetRoyaltyAmount.map(function (e) {
|
2591
|
-
return parseInt(e);
|
2592
|
-
});
|
2593
|
-
(_royaltyContext$targe2 = royaltyContext.targetRoyaltyAmount).push.apply(_royaltyContext$targe2, _toConsumableArray(targetRoyaltyAmount));
|
2594
|
-
}
|
2595
|
-
_context.next = 8;
|
2596
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.licensingModuleConfig), {}, {
|
2597
|
-
functionName: "mintLicense",
|
2598
|
-
args: [parseToBigInt(request.policyId), request.licensorIpId, parseToBigInt(request.mintAmount), getAddress(request.receiverAddress), encodeRoyaltyContext(royaltyContext)],
|
2599
|
-
account: this.wallet.account
|
2600
|
-
}));
|
2601
|
-
case 8:
|
2602
|
-
_yield$this$rpcClient = _context.sent;
|
2603
|
-
call = _yield$this$rpcClient.request;
|
2604
|
-
_context.next = 12;
|
2605
|
-
return this.wallet.writeContract(call);
|
2606
|
-
case 12:
|
2607
|
-
txHash = _context.sent;
|
2608
|
-
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
2609
|
-
_context.next = 20;
|
2610
|
-
break;
|
2611
|
-
}
|
2612
|
-
_context.next = 16;
|
2613
|
-
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licenseRegistryConfig), {}, {
|
2614
|
-
eventName: "TransferSingle",
|
2615
|
-
from: this.licenseRegistryConfig.address
|
2616
|
-
}));
|
2617
|
-
case 16:
|
2618
|
-
targetLogs = _context.sent;
|
2619
|
-
return _context.abrupt("return", {
|
2620
|
-
txHash: txHash,
|
2621
|
-
licenseId: targetLogs[0].args.id.toString()
|
2622
|
-
});
|
2623
|
-
case 20:
|
2624
|
-
return _context.abrupt("return", {
|
2625
|
-
txHash: txHash
|
2626
|
-
});
|
2627
|
-
case 21:
|
2628
|
-
_context.next = 26;
|
2629
|
-
break;
|
2630
|
-
case 23:
|
2631
|
-
_context.prev = 23;
|
2632
|
-
_context.t0 = _context["catch"](0);
|
2633
|
-
handleError(_context.t0, "Failed to mint license");
|
2634
|
-
case 26:
|
2635
|
-
case "end":
|
2636
|
-
return _context.stop();
|
2637
|
-
}
|
2638
|
-
}, _callee, this, [[0, 23]]);
|
2639
|
-
}));
|
2640
|
-
function mintLicense(_x) {
|
2641
|
-
return _mintLicense.apply(this, arguments);
|
2642
|
-
}
|
2643
|
-
return mintLicense;
|
2644
|
-
}())
|
2645
|
-
}, {
|
2646
|
-
key: "linkIpToParent",
|
2828
|
+
key: "getLicenseTermsId",
|
2647
2829
|
value: function () {
|
2648
|
-
var
|
2649
|
-
var
|
2650
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
2651
|
-
while (1) switch (_context2.prev = _context2.next) {
|
2652
|
-
case 0:
|
2653
|
-
_context2.prev = 0;
|
2654
|
-
IPAccountConfig = {
|
2655
|
-
abi: this.ipAccountABI,
|
2656
|
-
address: getAddress(request.childIpId)
|
2657
|
-
};
|
2658
|
-
licenseIds = [];
|
2659
|
-
request.licenseIds.forEach(function (licenseId) {
|
2660
|
-
licenseIds.push(parseToBigInt(licenseId));
|
2661
|
-
});
|
2662
|
-
_context2.next = 6;
|
2663
|
-
return computeRoyaltyContext(request.licenseIds, this.storyClient);
|
2664
|
-
case 6:
|
2665
|
-
royaltyContext = _context2.sent;
|
2666
|
-
_context2.next = 9;
|
2667
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
|
2668
|
-
functionName: "execute",
|
2669
|
-
args: [this.licensingModuleConfig.address, parseToBigInt(0), encodeFunctionData({
|
2670
|
-
abi: this.licensingModuleConfig.abi,
|
2671
|
-
functionName: "linkIpToParents",
|
2672
|
-
args: [licenseIds, getAddress(request.childIpId), encodeRoyaltyContext(royaltyContext)]
|
2673
|
-
})],
|
2674
|
-
account: this.wallet.account
|
2675
|
-
}));
|
2676
|
-
case 9:
|
2677
|
-
_yield$this$rpcClient2 = _context2.sent;
|
2678
|
-
call = _yield$this$rpcClient2.request;
|
2679
|
-
_context2.next = 13;
|
2680
|
-
return this.wallet.writeContract(call);
|
2681
|
-
case 13:
|
2682
|
-
txHash = _context2.sent;
|
2683
|
-
if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
|
2684
|
-
_context2.next = 20;
|
2685
|
-
break;
|
2686
|
-
}
|
2687
|
-
_context2.next = 17;
|
2688
|
-
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, LicenseRegistryConfig), {}, {
|
2689
|
-
eventName: "TransferBatch"
|
2690
|
-
}));
|
2691
|
-
case 17:
|
2692
|
-
return _context2.abrupt("return", {
|
2693
|
-
txHash: txHash,
|
2694
|
-
success: true
|
2695
|
-
});
|
2696
|
-
case 20:
|
2697
|
-
return _context2.abrupt("return", {
|
2698
|
-
txHash: txHash
|
2699
|
-
});
|
2700
|
-
case 21:
|
2701
|
-
_context2.next = 26;
|
2702
|
-
break;
|
2703
|
-
case 23:
|
2704
|
-
_context2.prev = 23;
|
2705
|
-
_context2.t0 = _context2["catch"](0);
|
2706
|
-
handleError(_context2.t0, "Failed to link IP to parents");
|
2707
|
-
case 26:
|
2708
|
-
case "end":
|
2709
|
-
return _context2.stop();
|
2710
|
-
}
|
2711
|
-
}, _callee2, this, [[0, 23]]);
|
2712
|
-
}));
|
2713
|
-
function linkIpToParent(_x2) {
|
2714
|
-
return _linkIpToParent.apply(this, arguments);
|
2715
|
-
}
|
2716
|
-
return linkIpToParent;
|
2717
|
-
}()
|
2718
|
-
}]);
|
2719
|
-
}();
|
2720
|
-
|
2721
|
-
var PolicyClient = /*#__PURE__*/function () {
|
2722
|
-
function PolicyClient(rpcClient, wallet) {
|
2723
|
-
_classCallCheck(this, PolicyClient);
|
2724
|
-
_defineProperty(this, "ipAccountABI", IPAccountABI);
|
2725
|
-
_defineProperty(this, "licensingModuleConfig", LicensingModuleConfig);
|
2726
|
-
_defineProperty(this, "pilPolicyFrameworkManagerConfig", PILPolicyFrameworkManagerConfig);
|
2727
|
-
_defineProperty(this, "royaltyPolicyLAPConfig", RoyaltyPolicyLAPConfig);
|
2728
|
-
this.wallet = wallet;
|
2729
|
-
this.rpcClient = rpcClient;
|
2730
|
-
}
|
2731
|
-
|
2732
|
-
/**
|
2733
|
-
* Registers a PIL policy to the registry
|
2734
|
-
* Internally, this function must generate a Licensing.Policy struct and call registerPolicy.
|
2735
|
-
* @param request - the licensing parameters for the Programmable IP License v1 (PIL) standard.
|
2736
|
-
* @param request.transferable Whether or not the license is transferable
|
2737
|
-
* @param request.attribution Whether or not attribution is required when reproducing the work
|
2738
|
-
* @param request.commercialUse Whether or not the work can be used commercially
|
2739
|
-
* @param request.commercialAttribution Whether or not attribution is required when reproducing the work commercially
|
2740
|
-
* @param request.commercializerChecker commericializers that are allowed to commercially exploit the work. If zero address, then no restrictions is enforced.
|
2741
|
-
* @param request.commercialRevShare Percentage of revenue that must be shared with the licensor
|
2742
|
-
* @param request.derivativesAllowed Whether or not the licensee can create derivatives of his work
|
2743
|
-
* @param request.derivativesAttribution Whether or not attribution is required for derivatives of the work
|
2744
|
-
* @param request.derivativesApproval Whether or not the licensor must approve derivatives of the work before they can be linked to the licensor IP ID
|
2745
|
-
* @param request.derivativesReciprocal Whether or not the licensee must license derivatives of the work under the same terms.
|
2746
|
-
* @param request.territories List of territories where the license is valid. If empty, global.
|
2747
|
-
* @param request.distributionChannels List of distribution channels where the license is valid. Empty if no restrictions.
|
2748
|
-
* @param request.royaltyPolicy Address of a royalty policy contract (e.g. RoyaltyPolicyLS) that will handle royalty payments
|
2749
|
-
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2750
|
-
*/
|
2751
|
-
return _createClass(PolicyClient, [{
|
2752
|
-
key: "registerPILPolicy",
|
2753
|
-
value: (function () {
|
2754
|
-
var _registerPILPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2755
|
-
var _request$txOptions, frameworkData, policyId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2830
|
+
var _getLicenseTermsId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
2831
|
+
var selectedLicenseTermsId;
|
2756
2832
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
2757
2833
|
while (1) switch (_context.prev = _context.next) {
|
2758
2834
|
case 0:
|
2759
|
-
_context.
|
2760
|
-
|
2761
|
-
|
2762
|
-
|
2763
|
-
commercialUse: request.commercialUse || false,
|
2764
|
-
commercialAttribution: request.commercialAttribution || false,
|
2765
|
-
commercializerChecker: request.commercializerChecker || zeroAddress,
|
2766
|
-
commercializerCheckerData: request.commercializerCheckerData || "0x",
|
2767
|
-
commercialRevShare: request.commercialRevShare || 0,
|
2768
|
-
derivativesAllowed: request.derivativesAllowed || false,
|
2769
|
-
derivativesAttribution: request.derivativesAttribution || false,
|
2770
|
-
derivativesApproval: request.derivativesApproval || false,
|
2771
|
-
derivativesReciprocal: request.derivativesReciprocal || false,
|
2772
|
-
territories: request.territories || [],
|
2773
|
-
distributionChannels: request.distributionChannels || [],
|
2774
|
-
contentRestrictions: request.contentRestrictions || []
|
2775
|
-
};
|
2776
|
-
_context.next = 4;
|
2777
|
-
return this.getPolicyId(request.transferable, this.encodeFrameworkData(frameworkData), typedDataToBytes({
|
2778
|
-
"interface": "uint32",
|
2779
|
-
data: [request.commercialRevShare || 0]
|
2780
|
-
}), request.mintingFee || "0", request.mintingFeeToken || zeroAddress, request.royaltyPolicy || zeroAddress);
|
2781
|
-
case 4:
|
2782
|
-
policyId = _context.sent;
|
2783
|
-
if (!(policyId !== 0)) {
|
2784
|
-
_context.next = 7;
|
2785
|
-
break;
|
2786
|
-
}
|
2787
|
-
return _context.abrupt("return", {
|
2788
|
-
policyId: policyId.toString()
|
2789
|
-
});
|
2790
|
-
case 7:
|
2791
|
-
_context.next = 9;
|
2792
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.pilPolicyFrameworkManagerConfig), {}, {
|
2793
|
-
functionName: "registerPolicy",
|
2794
|
-
args: [{
|
2795
|
-
transferable: request.transferable,
|
2796
|
-
royaltyPolicy: request.royaltyPolicy || zeroAddress,
|
2797
|
-
mintingFee: parseToBigInt(request.mintingFee || "0"),
|
2798
|
-
mintingFeeToken: request.mintingFeeToken || zeroAddress,
|
2799
|
-
policy: {
|
2800
|
-
attribution: request.attribution || false,
|
2801
|
-
commercialUse: request.commercialUse || false,
|
2802
|
-
commercialAttribution: request.commercialAttribution || false,
|
2803
|
-
commercialRevShare: request.commercialRevShare || 0,
|
2804
|
-
derivativesAllowed: request.derivativesAllowed || false,
|
2805
|
-
derivativesAttribution: request.derivativesAttribution || false,
|
2806
|
-
derivativesApproval: request.derivativesApproval || false,
|
2807
|
-
derivativesReciprocal: request.derivativesReciprocal || false,
|
2808
|
-
commercializerChecker: request.commercializerChecker || zeroAddress,
|
2809
|
-
commercializerCheckerData: request.commercializerCheckerData || "0x",
|
2810
|
-
territories: request.territories || [],
|
2811
|
-
distributionChannels: request.distributionChannels || [],
|
2812
|
-
contentRestrictions: request.contentRestrictions || []
|
2813
|
-
}
|
2814
|
-
}],
|
2815
|
-
account: this.wallet.account
|
2816
|
-
}));
|
2817
|
-
case 9:
|
2818
|
-
_yield$this$rpcClient = _context.sent;
|
2819
|
-
call = _yield$this$rpcClient.request;
|
2820
|
-
_context.next = 13;
|
2821
|
-
return this.wallet.writeContract(call);
|
2822
|
-
case 13:
|
2823
|
-
txHash = _context.sent;
|
2824
|
-
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
2825
|
-
_context.next = 21;
|
2826
|
-
break;
|
2827
|
-
}
|
2828
|
-
_context.next = 17;
|
2829
|
-
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licensingModuleConfig), {}, {
|
2830
|
-
eventName: "PolicyRegistered"
|
2835
|
+
_context.next = 2;
|
2836
|
+
return this.rpcClient.readContract(_objectSpread2(_objectSpread2({}, this.licenseTemplateConfig), {}, {
|
2837
|
+
functionName: "getLicenseTermsId",
|
2838
|
+
args: [request]
|
2831
2839
|
}));
|
2832
|
-
case
|
2833
|
-
|
2834
|
-
return _context.abrupt("return",
|
2835
|
-
|
2836
|
-
policyId: targetLogs[0].args.policyId.toString()
|
2837
|
-
});
|
2838
|
-
case 21:
|
2839
|
-
return _context.abrupt("return", {
|
2840
|
-
txHash: txHash
|
2841
|
-
});
|
2842
|
-
case 22:
|
2843
|
-
_context.next = 27;
|
2844
|
-
break;
|
2845
|
-
case 24:
|
2846
|
-
_context.prev = 24;
|
2847
|
-
_context.t0 = _context["catch"](0);
|
2848
|
-
handleError(_context.t0, "Failed to register policy");
|
2849
|
-
case 27:
|
2840
|
+
case 2:
|
2841
|
+
selectedLicenseTermsId = _context.sent;
|
2842
|
+
return _context.abrupt("return", Number(selectedLicenseTermsId));
|
2843
|
+
case 4:
|
2850
2844
|
case "end":
|
2851
2845
|
return _context.stop();
|
2852
2846
|
}
|
2853
|
-
}, _callee, this
|
2847
|
+
}, _callee, this);
|
2854
2848
|
}));
|
2855
|
-
function
|
2856
|
-
return
|
2849
|
+
function getLicenseTermsId(_x) {
|
2850
|
+
return _getLicenseTermsId.apply(this, arguments);
|
2857
2851
|
}
|
2858
|
-
return
|
2852
|
+
return getLicenseTermsId;
|
2859
2853
|
}()
|
2860
2854
|
/**
|
2861
|
-
* Convenient function to register a PIL social remix
|
2862
|
-
*
|
2863
|
-
*
|
2864
|
-
*
|
2865
|
-
*
|
2866
|
-
* @param request.contentRestrictions List of content restrictions where the license is valid. Empty if no restrictions.
|
2867
|
-
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2855
|
+
* Convenient function to register a PIL non commercial social remix license to the registry
|
2856
|
+
* @param request The request object that contains all data needed to register a PIL non commercial social remix license.
|
2857
|
+
* @param request.txOptions [Optional] The transaction options.
|
2858
|
+
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
|
2859
|
+
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
2868
2860
|
*/
|
2869
|
-
)
|
2870
2861
|
}, {
|
2871
|
-
key: "
|
2862
|
+
key: "registerNonComSocialRemixingPIL",
|
2872
2863
|
value: (function () {
|
2873
|
-
var
|
2874
|
-
var _request$
|
2864
|
+
var _registerNonComSocialRemixingPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request) {
|
2865
|
+
var _request$txOptions, licenseTerms, licenseTermsId, _yield$this$rpcClient, call, txHash, targetLogs;
|
2875
2866
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
2876
2867
|
while (1) switch (_context2.prev = _context2.next) {
|
2877
2868
|
case 0:
|
2878
2869
|
_context2.prev = 0;
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2870
|
+
licenseTerms = {
|
2871
|
+
transferable: true,
|
2872
|
+
royaltyPolicy: zeroAddress,
|
2873
|
+
mintingFee: BigInt(0),
|
2874
|
+
expiration: BigInt(0),
|
2882
2875
|
commercialUse: false,
|
2883
2876
|
commercialAttribution: false,
|
2884
2877
|
commercializerChecker: zeroAddress,
|
2885
|
-
commercializerCheckerData:
|
2878
|
+
commercializerCheckerData: zeroAddress,
|
2886
2879
|
commercialRevShare: 0,
|
2880
|
+
commercialRevCelling: BigInt(0),
|
2887
2881
|
derivativesAllowed: true,
|
2888
2882
|
derivativesAttribution: true,
|
2889
2883
|
derivativesApproval: false,
|
2890
2884
|
derivativesReciprocal: true,
|
2891
|
-
|
2892
|
-
|
2893
|
-
contentRestrictions: request.contentRestrictions || []
|
2885
|
+
derivativeRevCelling: BigInt(0),
|
2886
|
+
currency: zeroAddress
|
2894
2887
|
};
|
2895
2888
|
_context2.next = 4;
|
2896
|
-
return this.
|
2897
|
-
"interface": "uint32",
|
2898
|
-
data: [0]
|
2899
|
-
}), "0", zeroAddress, zeroAddress);
|
2889
|
+
return this.getLicenseTermsId(licenseTerms);
|
2900
2890
|
case 4:
|
2901
|
-
|
2902
|
-
if (!(
|
2891
|
+
licenseTermsId = _context2.sent;
|
2892
|
+
if (!(licenseTermsId !== 0)) {
|
2903
2893
|
_context2.next = 7;
|
2904
2894
|
break;
|
2905
2895
|
}
|
2906
2896
|
return _context2.abrupt("return", {
|
2907
|
-
|
2897
|
+
licenseId: licenseTermsId.toString()
|
2908
2898
|
});
|
2909
2899
|
case 7:
|
2910
2900
|
_context2.next = 9;
|
2911
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.
|
2912
|
-
functionName: "
|
2913
|
-
args: [
|
2914
|
-
transferable: true,
|
2915
|
-
royaltyPolicy: zeroAddress,
|
2916
|
-
mintingFee: parseToBigInt(0),
|
2917
|
-
mintingFeeToken: zeroAddress,
|
2918
|
-
policy: {
|
2919
|
-
attribution: true,
|
2920
|
-
commercialUse: false,
|
2921
|
-
commercialAttribution: false,
|
2922
|
-
commercialRevShare: 0,
|
2923
|
-
derivativesAllowed: true,
|
2924
|
-
derivativesAttribution: true,
|
2925
|
-
derivativesApproval: false,
|
2926
|
-
derivativesReciprocal: true,
|
2927
|
-
commercializerChecker: zeroAddress,
|
2928
|
-
commercializerCheckerData: "0x",
|
2929
|
-
territories: request.territories || [],
|
2930
|
-
distributionChannels: request.distributionChannels || [],
|
2931
|
-
contentRestrictions: request.contentRestrictions || []
|
2932
|
-
}
|
2933
|
-
}],
|
2901
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.licenseTemplateConfig), {}, {
|
2902
|
+
functionName: "registerLicenseTerms",
|
2903
|
+
args: [licenseTerms],
|
2934
2904
|
account: this.wallet.account
|
2935
2905
|
}));
|
2936
2906
|
case 9:
|
2937
|
-
_yield$this$
|
2938
|
-
call = _yield$this$
|
2907
|
+
_yield$this$rpcClient = _context2.sent;
|
2908
|
+
call = _yield$this$rpcClient.request;
|
2939
2909
|
_context2.next = 13;
|
2940
2910
|
return this.wallet.writeContract(call);
|
2941
2911
|
case 13:
|
2942
2912
|
txHash = _context2.sent;
|
2943
|
-
if (!((_request$
|
2913
|
+
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
2944
2914
|
_context2.next = 21;
|
2945
2915
|
break;
|
2946
2916
|
}
|
2947
2917
|
_context2.next = 17;
|
2948
|
-
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.
|
2949
|
-
eventName: "
|
2918
|
+
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licenseTemplateConfig), {}, {
|
2919
|
+
eventName: "LicenseTermsRegistered"
|
2950
2920
|
}));
|
2951
2921
|
case 17:
|
2952
|
-
|
2922
|
+
targetLogs = _context2.sent;
|
2953
2923
|
return _context2.abrupt("return", {
|
2954
2924
|
txHash: txHash,
|
2955
|
-
|
2925
|
+
licenseId: targetLogs[0].args.licenseTermsId.toString()
|
2956
2926
|
});
|
2957
2927
|
case 21:
|
2958
2928
|
return _context2.abrupt("return", {
|
@@ -2964,117 +2934,95 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
2964
2934
|
case 24:
|
2965
2935
|
_context2.prev = 24;
|
2966
2936
|
_context2.t0 = _context2["catch"](0);
|
2967
|
-
handleError(_context2.t0, "Failed to register social
|
2937
|
+
handleError(_context2.t0, "Failed to register non commercial social remixing PIL");
|
2968
2938
|
case 27:
|
2969
2939
|
case "end":
|
2970
2940
|
return _context2.stop();
|
2971
2941
|
}
|
2972
2942
|
}, _callee2, this, [[0, 24]]);
|
2973
2943
|
}));
|
2974
|
-
function
|
2975
|
-
return
|
2944
|
+
function registerNonComSocialRemixingPIL(_x2) {
|
2945
|
+
return _registerNonComSocialRemixingPIL.apply(this, arguments);
|
2976
2946
|
}
|
2977
|
-
return
|
2947
|
+
return registerNonComSocialRemixingPIL;
|
2978
2948
|
}()
|
2979
2949
|
/**
|
2980
|
-
* Convenient function to register a PIL
|
2981
|
-
*
|
2982
|
-
*
|
2983
|
-
*
|
2984
|
-
*
|
2985
|
-
*
|
2986
|
-
*
|
2987
|
-
*
|
2988
|
-
*
|
2989
|
-
* @returns the transaction hash and the policy ID if the txOptions.waitForTransaction is set to true
|
2950
|
+
* Convenient function to register a PIL commercial use license to the registry.
|
2951
|
+
* @param request The request object that contains all data needed to register a PIL commercial use license.
|
2952
|
+
* @param request.mintingFee The fee to be paid when minting a license.
|
2953
|
+
* @param request.currency The ERC20 token to be used to pay the minting fee.
|
2954
|
+
* the token must be registered in story protocol.
|
2955
|
+
* @param request.royaltyPolicy The address of the royalty policy contract which required to StoryProtocol in advance.
|
2956
|
+
* @param request.txOptions [Optional] The transaction options.
|
2957
|
+
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
|
2958
|
+
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
2990
2959
|
*/
|
2991
2960
|
)
|
2992
2961
|
}, {
|
2993
|
-
key: "
|
2962
|
+
key: "registerCommercialUsePIL",
|
2994
2963
|
value: (function () {
|
2995
|
-
var
|
2996
|
-
var _request$
|
2964
|
+
var _registerCommercialUsePIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
2965
|
+
var _request$txOptions2, licenseTerms, licenseTermsId, _yield$this$rpcClient2, call, txHash, targetLogs;
|
2997
2966
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
2998
2967
|
while (1) switch (_context3.prev = _context3.next) {
|
2999
2968
|
case 0:
|
3000
2969
|
_context3.prev = 0;
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
2970
|
+
licenseTerms = {
|
2971
|
+
transferable: true,
|
2972
|
+
royaltyPolicy: this.royaltyPolicyLAPConfig.address,
|
2973
|
+
mintingFee: BigInt(request.mintingFee),
|
2974
|
+
expiration: BigInt(0),
|
3004
2975
|
commercialUse: true,
|
3005
2976
|
commercialAttribution: true,
|
3006
2977
|
commercializerChecker: zeroAddress,
|
3007
|
-
commercializerCheckerData:
|
3008
|
-
commercialRevShare:
|
2978
|
+
commercializerCheckerData: zeroAddress,
|
2979
|
+
commercialRevShare: 0,
|
2980
|
+
commercialRevCelling: BigInt(0),
|
3009
2981
|
derivativesAllowed: true,
|
3010
2982
|
derivativesAttribution: true,
|
3011
2983
|
derivativesApproval: false,
|
3012
|
-
derivativesReciprocal:
|
3013
|
-
|
3014
|
-
|
3015
|
-
contentRestrictions: request.contentRestrictions || []
|
2984
|
+
derivativesReciprocal: false,
|
2985
|
+
derivativeRevCelling: BigInt(0),
|
2986
|
+
currency: request.currency
|
3016
2987
|
};
|
3017
2988
|
_context3.next = 4;
|
3018
|
-
return this.
|
3019
|
-
"interface": "uint32",
|
3020
|
-
data: [request.commercialRevShare]
|
3021
|
-
}), request.mintingFee || "0", request.mintingFeeToken || zeroAddress, this.royaltyPolicyLAPConfig.address);
|
2989
|
+
return this.getLicenseTermsId(licenseTerms);
|
3022
2990
|
case 4:
|
3023
|
-
|
3024
|
-
if (!(
|
2991
|
+
licenseTermsId = _context3.sent;
|
2992
|
+
if (!(licenseTermsId !== 0)) {
|
3025
2993
|
_context3.next = 7;
|
3026
2994
|
break;
|
3027
2995
|
}
|
3028
2996
|
return _context3.abrupt("return", {
|
3029
|
-
|
2997
|
+
licenseId: licenseTermsId.toString()
|
3030
2998
|
});
|
3031
2999
|
case 7:
|
3032
3000
|
_context3.next = 9;
|
3033
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.
|
3034
|
-
functionName: "
|
3035
|
-
args: [
|
3036
|
-
transferable: true,
|
3037
|
-
royaltyPolicy: this.royaltyPolicyLAPConfig.address,
|
3038
|
-
mintingFee: parseToBigInt(request.mintingFee || "0"),
|
3039
|
-
mintingFeeToken: request.mintingFeeToken || zeroAddress,
|
3040
|
-
policy: {
|
3041
|
-
attribution: true,
|
3042
|
-
commercialUse: true,
|
3043
|
-
commercialAttribution: true,
|
3044
|
-
commercialRevShare: request.commercialRevShare,
|
3045
|
-
derivativesAllowed: true,
|
3046
|
-
derivativesAttribution: true,
|
3047
|
-
derivativesApproval: false,
|
3048
|
-
derivativesReciprocal: true,
|
3049
|
-
commercializerChecker: zeroAddress,
|
3050
|
-
commercializerCheckerData: "0x",
|
3051
|
-
territories: request.territories || [],
|
3052
|
-
distributionChannels: request.distributionChannels || [],
|
3053
|
-
contentRestrictions: request.contentRestrictions || []
|
3054
|
-
}
|
3055
|
-
}],
|
3001
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.licenseTemplateConfig), {}, {
|
3002
|
+
functionName: "registerLicenseTerms",
|
3003
|
+
args: [licenseTerms],
|
3056
3004
|
account: this.wallet.account
|
3057
3005
|
}));
|
3058
3006
|
case 9:
|
3059
|
-
_yield$this$
|
3060
|
-
call = _yield$this$
|
3007
|
+
_yield$this$rpcClient2 = _context3.sent;
|
3008
|
+
call = _yield$this$rpcClient2.request;
|
3061
3009
|
_context3.next = 13;
|
3062
3010
|
return this.wallet.writeContract(call);
|
3063
3011
|
case 13:
|
3064
3012
|
txHash = _context3.sent;
|
3065
|
-
if (!((_request$
|
3013
|
+
if (!((_request$txOptions2 = request.txOptions) !== null && _request$txOptions2 !== void 0 && _request$txOptions2.waitForTransaction)) {
|
3066
3014
|
_context3.next = 21;
|
3067
3015
|
break;
|
3068
3016
|
}
|
3069
3017
|
_context3.next = 17;
|
3070
|
-
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.
|
3071
|
-
eventName: "
|
3018
|
+
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licenseTemplateConfig), {}, {
|
3019
|
+
eventName: "LicenseTermsRegistered"
|
3072
3020
|
}));
|
3073
3021
|
case 17:
|
3074
3022
|
targetLogs = _context3.sent;
|
3075
3023
|
return _context3.abrupt("return", {
|
3076
3024
|
txHash: txHash,
|
3077
|
-
|
3025
|
+
licenseId: targetLogs[0].args.licenseTermsId.toString()
|
3078
3026
|
});
|
3079
3027
|
case 21:
|
3080
3028
|
return _context3.abrupt("return", {
|
@@ -3086,144 +3034,266 @@ var PolicyClient = /*#__PURE__*/function () {
|
|
3086
3034
|
case 24:
|
3087
3035
|
_context3.prev = 24;
|
3088
3036
|
_context3.t0 = _context3["catch"](0);
|
3089
|
-
handleError(_context3.t0, "Failed to register commercial use
|
3037
|
+
handleError(_context3.t0, "Failed to register commercial use PIL");
|
3090
3038
|
case 27:
|
3091
3039
|
case "end":
|
3092
3040
|
return _context3.stop();
|
3093
3041
|
}
|
3094
3042
|
}, _callee3, this, [[0, 24]]);
|
3095
3043
|
}));
|
3096
|
-
function
|
3097
|
-
return
|
3044
|
+
function registerCommercialUsePIL(_x3) {
|
3045
|
+
return _registerCommercialUsePIL.apply(this, arguments);
|
3098
3046
|
}
|
3099
|
-
return
|
3100
|
-
}()
|
3047
|
+
return registerCommercialUsePIL;
|
3048
|
+
}()
|
3049
|
+
/**
|
3050
|
+
* Convenient function to register a PIL commercial Remix license to the registry.
|
3051
|
+
* @param request The request object that contains all data needed to register license.
|
3052
|
+
* @param request.mintingFee The fee to be paid when minting a license.
|
3053
|
+
* @param request.commercialRevShare Percentage of revenue that must be shared with the licensor.
|
3054
|
+
* @param request.currency The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
|
3055
|
+
* @param request.royaltyPolicy The address of the royalty policy contract which required to StoryProtocol in advance.
|
3056
|
+
* @param request.txOptions [Optional] The transaction options.
|
3057
|
+
* @returns A Promise that resolves to an object containing the optional transaction hash and optional license ID.
|
3058
|
+
* @emits LicenseTermsRegistered (licenseTermsId, licenseTemplate, licenseTerms);
|
3059
|
+
*/
|
3060
|
+
)
|
3101
3061
|
}, {
|
3102
|
-
key: "
|
3103
|
-
value: function () {
|
3104
|
-
var
|
3105
|
-
var
|
3062
|
+
key: "registerCommercialRemixPIL",
|
3063
|
+
value: (function () {
|
3064
|
+
var _registerCommercialRemixPIL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request) {
|
3065
|
+
var _request$txOptions3, licenseTerms, licenseTermsId, _yield$this$rpcClient3, call, txHash, targetLogs;
|
3106
3066
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
3107
3067
|
while (1) switch (_context4.prev = _context4.next) {
|
3108
3068
|
case 0:
|
3109
|
-
_context4.
|
3110
|
-
|
3111
|
-
|
3112
|
-
|
3113
|
-
|
3114
|
-
|
3115
|
-
|
3116
|
-
|
3117
|
-
|
3118
|
-
|
3119
|
-
|
3120
|
-
|
3121
|
-
|
3122
|
-
|
3123
|
-
|
3124
|
-
|
3069
|
+
_context4.prev = 0;
|
3070
|
+
licenseTerms = {
|
3071
|
+
transferable: true,
|
3072
|
+
royaltyPolicy: this.royaltyPolicyLAPConfig.address,
|
3073
|
+
mintingFee: BigInt(request.mintingFee),
|
3074
|
+
expiration: BigInt(0),
|
3075
|
+
commercialUse: true,
|
3076
|
+
commercialAttribution: true,
|
3077
|
+
commercializerChecker: zeroAddress,
|
3078
|
+
commercializerCheckerData: zeroAddress,
|
3079
|
+
commercialRevShare: request.commercialRevShare,
|
3080
|
+
commercialRevCelling: BigInt(0),
|
3081
|
+
derivativesAllowed: true,
|
3082
|
+
derivativesAttribution: true,
|
3083
|
+
derivativesApproval: false,
|
3084
|
+
derivativesReciprocal: true,
|
3085
|
+
derivativeRevCelling: BigInt(0),
|
3086
|
+
currency: request.currency
|
3087
|
+
};
|
3088
|
+
_context4.next = 4;
|
3089
|
+
return this.getLicenseTermsId(licenseTerms);
|
3125
3090
|
case 4:
|
3091
|
+
licenseTermsId = _context4.sent;
|
3092
|
+
if (!(licenseTermsId !== 0)) {
|
3093
|
+
_context4.next = 7;
|
3094
|
+
break;
|
3095
|
+
}
|
3096
|
+
return _context4.abrupt("return", {
|
3097
|
+
licenseId: licenseTermsId.toString()
|
3098
|
+
});
|
3099
|
+
case 7:
|
3100
|
+
_context4.next = 9;
|
3101
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.licenseTemplateConfig), {}, {
|
3102
|
+
functionName: "registerLicenseTerms",
|
3103
|
+
args: [licenseTerms],
|
3104
|
+
account: this.wallet.account
|
3105
|
+
}));
|
3106
|
+
case 9:
|
3107
|
+
_yield$this$rpcClient3 = _context4.sent;
|
3108
|
+
call = _yield$this$rpcClient3.request;
|
3109
|
+
_context4.next = 13;
|
3110
|
+
return this.wallet.writeContract(call);
|
3111
|
+
case 13:
|
3112
|
+
txHash = _context4.sent;
|
3113
|
+
if (!((_request$txOptions3 = request.txOptions) !== null && _request$txOptions3 !== void 0 && _request$txOptions3.waitForTransaction)) {
|
3114
|
+
_context4.next = 21;
|
3115
|
+
break;
|
3116
|
+
}
|
3117
|
+
_context4.next = 17;
|
3118
|
+
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licenseTemplateConfig), {}, {
|
3119
|
+
eventName: "LicenseTermsRegistered"
|
3120
|
+
}));
|
3121
|
+
case 17:
|
3122
|
+
targetLogs = _context4.sent;
|
3123
|
+
return _context4.abrupt("return", {
|
3124
|
+
txHash: txHash,
|
3125
|
+
licenseId: targetLogs[0].args.licenseTermsId.toString()
|
3126
|
+
});
|
3127
|
+
case 21:
|
3128
|
+
return _context4.abrupt("return", {
|
3129
|
+
txHash: txHash
|
3130
|
+
});
|
3131
|
+
case 22:
|
3132
|
+
_context4.next = 27;
|
3133
|
+
break;
|
3134
|
+
case 24:
|
3135
|
+
_context4.prev = 24;
|
3136
|
+
_context4.t0 = _context4["catch"](0);
|
3137
|
+
handleError(_context4.t0, "Failed to register commercial remix PIL");
|
3138
|
+
case 27:
|
3126
3139
|
case "end":
|
3127
3140
|
return _context4.stop();
|
3128
3141
|
}
|
3129
|
-
}, _callee4, this);
|
3142
|
+
}, _callee4, this, [[0, 24]]);
|
3130
3143
|
}));
|
3131
|
-
function
|
3132
|
-
return
|
3144
|
+
function registerCommercialRemixPIL(_x4) {
|
3145
|
+
return _registerCommercialRemixPIL.apply(this, arguments);
|
3133
3146
|
}
|
3134
|
-
return
|
3147
|
+
return registerCommercialRemixPIL;
|
3135
3148
|
}()
|
3136
|
-
}, {
|
3137
|
-
key: "encodeFrameworkData",
|
3138
|
-
value: function encodeFrameworkData(data) {
|
3139
|
-
return typedDataToBytes({
|
3140
|
-
"interface": "(bool, bool, bool, address, bytes, uint32, bool, bool, bool, bool, string[], string[], string[])",
|
3141
|
-
data: [[data.attribution, data.commercialUse, data.commercialAttribution, data.commercializerChecker, data.commercializerCheckerData, data.commercialRevShare, data.derivativesAllowed, data.derivativesAttribution, data.derivativesApproval, data.derivativesReciprocal, data.territories, data.distributionChannels, data.contentRestrictions]]
|
3142
|
-
});
|
3143
|
-
}
|
3144
|
-
|
3145
3149
|
/**
|
3146
|
-
*
|
3147
|
-
* @param request The request object
|
3148
|
-
|
3149
|
-
|
3150
|
-
|
3150
|
+
* Attaches license terms to an IP, and the function must be called by the IP owner or an authorized operator.
|
3151
|
+
* @param request The request object that contains all data needed to attach license terms.
|
3152
|
+
@param request.ipId The IP ID.
|
3153
|
+
@param request.tokenAddress The address of the NFT.
|
3154
|
+
@param request.licenseTemplate The address of the license template.
|
3155
|
+
@param request.licenseTermsId The ID of the license terms.
|
3156
|
+
* @param request.txOptions [Optional] The transaction options.
|
3157
|
+
* @returns A Promise that resolves to an object containing the transaction hash.
|
3151
3158
|
*/
|
3159
|
+
)
|
3152
3160
|
}, {
|
3153
|
-
key: "
|
3161
|
+
key: "attachLicenseTerms",
|
3154
3162
|
value: (function () {
|
3155
|
-
var
|
3156
|
-
var _request$txOptions4
|
3163
|
+
var _attachLicenseTerms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(request) {
|
3164
|
+
var _request$txOptions4;
|
3165
|
+
var _yield$this$rpcClient4, call, txHash;
|
3157
3166
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
3158
3167
|
while (1) switch (_context5.prev = _context5.next) {
|
3159
3168
|
case 0:
|
3160
|
-
_context5.
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
};
|
3165
|
-
_context5.next = 4;
|
3166
|
-
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, IPAccountConfig), {}, {
|
3167
|
-
functionName: "execute",
|
3168
|
-
args: [this.licensingModuleConfig.address, parseToBigInt(0), encodeFunctionData({
|
3169
|
-
abi: this.licensingModuleConfig.abi,
|
3170
|
-
functionName: "addPolicyToIp",
|
3171
|
-
args: [getAddress(request.ipId), parseToBigInt(request.policyId)]
|
3172
|
-
})],
|
3169
|
+
_context5.next = 2;
|
3170
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.licensingModuleConfig), {}, {
|
3171
|
+
functionName: "attachLicenseTerms",
|
3172
|
+
args: [request.ipId, request.licenseTemplate || this.licenseTemplateConfig.address, BigInt(request.licenseTermsId)],
|
3173
3173
|
account: this.wallet.account
|
3174
3174
|
}));
|
3175
|
-
case
|
3175
|
+
case 2:
|
3176
3176
|
_yield$this$rpcClient4 = _context5.sent;
|
3177
3177
|
call = _yield$this$rpcClient4.request;
|
3178
|
-
_context5.next =
|
3178
|
+
_context5.next = 6;
|
3179
3179
|
return this.wallet.writeContract(call);
|
3180
|
-
case
|
3180
|
+
case 6:
|
3181
3181
|
txHash = _context5.sent;
|
3182
3182
|
if (!((_request$txOptions4 = request.txOptions) !== null && _request$txOptions4 !== void 0 && _request$txOptions4.waitForTransaction)) {
|
3183
|
-
_context5.next =
|
3183
|
+
_context5.next = 13;
|
3184
|
+
break;
|
3185
|
+
}
|
3186
|
+
_context5.next = 10;
|
3187
|
+
return waitTx(this.rpcClient, txHash);
|
3188
|
+
case 10:
|
3189
|
+
return _context5.abrupt("return", {
|
3190
|
+
txHash: txHash
|
3191
|
+
});
|
3192
|
+
case 13:
|
3193
|
+
return _context5.abrupt("return", {
|
3194
|
+
txHash: txHash
|
3195
|
+
});
|
3196
|
+
case 14:
|
3197
|
+
case "end":
|
3198
|
+
return _context5.stop();
|
3199
|
+
}
|
3200
|
+
}, _callee5, this);
|
3201
|
+
}));
|
3202
|
+
function attachLicenseTerms(_x5) {
|
3203
|
+
return _attachLicenseTerms.apply(this, arguments);
|
3204
|
+
}
|
3205
|
+
return attachLicenseTerms;
|
3206
|
+
}()
|
3207
|
+
/**
|
3208
|
+
* Mints license tokens for the license terms attached to an IP.
|
3209
|
+
* The license tokens are minted to the receiver.
|
3210
|
+
* The license terms must be attached to the IP before calling this function.
|
3211
|
+
* But it can mint license token of default license terms without attaching the default license terms,
|
3212
|
+
* since it is attached to all IPs by default.
|
3213
|
+
* IP owners can mint license tokens for their IPs for arbitrary license terms
|
3214
|
+
* without attaching the license terms to IP.
|
3215
|
+
* It might require the caller pay the minting fee, depending on the license terms or configured by the iP owner.
|
3216
|
+
* The minting fee is paid in the minting fee token specified in the license terms or configured by the IP owner.
|
3217
|
+
* IP owners can configure the minting fee of their IPs or
|
3218
|
+
* configure the minting fee module to determine the minting fee.
|
3219
|
+
* @param request The request object that contains all data needed to mint license tokens.
|
3220
|
+
* @param request.licensorIpId The licensor IP ID.
|
3221
|
+
* @param request.licenseTemplate The address of the license template.
|
3222
|
+
* @param request.licenseTermsId The ID of the license terms within the license template.
|
3223
|
+
* @param request.amount The amount of license tokens to mint.
|
3224
|
+
* @param request.receiver The address of the receiver.
|
3225
|
+
* @param request.txOptions [Optional] The transaction options.
|
3226
|
+
* @returns A Promise that resolves to an object containing the transaction hash and optional license token ID if waitForTxn is set to true.
|
3227
|
+
* @emits LicenseTokensMinted (msg.sender, licensorIpId, licenseTemplate, licenseTermsId, amount, receiver, startLicenseTokenId);
|
3228
|
+
*/
|
3229
|
+
)
|
3230
|
+
}, {
|
3231
|
+
key: "mintLicenseTokens",
|
3232
|
+
value: (function () {
|
3233
|
+
var _mintLicenseTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) {
|
3234
|
+
var _request$txOptions5, _yield$this$rpcClient5, call, txHash, targetLogs;
|
3235
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
3236
|
+
while (1) switch (_context6.prev = _context6.next) {
|
3237
|
+
case 0:
|
3238
|
+
_context6.prev = 0;
|
3239
|
+
_context6.next = 3;
|
3240
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.licensingModuleConfig), {}, {
|
3241
|
+
functionName: "mintLicenseTokens",
|
3242
|
+
args: [request.licensorIpId, request.licenseTemplate || this.licenseTemplateConfig.address, BigInt(request.licenseTermsId), BigInt(request.amount || 1), request.receiver || this.wallet.account.address, zeroAddress],
|
3243
|
+
account: this.wallet.account
|
3244
|
+
}));
|
3245
|
+
case 3:
|
3246
|
+
_yield$this$rpcClient5 = _context6.sent;
|
3247
|
+
call = _yield$this$rpcClient5.request;
|
3248
|
+
_context6.next = 7;
|
3249
|
+
return this.wallet.writeContract(call);
|
3250
|
+
case 7:
|
3251
|
+
txHash = _context6.sent;
|
3252
|
+
if (!((_request$txOptions5 = request.txOptions) !== null && _request$txOptions5 !== void 0 && _request$txOptions5.waitForTransaction)) {
|
3253
|
+
_context6.next = 15;
|
3184
3254
|
break;
|
3185
3255
|
}
|
3186
|
-
|
3256
|
+
_context6.next = 11;
|
3187
3257
|
return waitTxAndFilterLog(this.rpcClient, txHash, _objectSpread2(_objectSpread2({}, this.licensingModuleConfig), {}, {
|
3188
|
-
eventName: "
|
3258
|
+
eventName: "LicenseTokensMinted"
|
3189
3259
|
}));
|
3190
|
-
case
|
3191
|
-
targetLogs =
|
3192
|
-
return
|
3260
|
+
case 11:
|
3261
|
+
targetLogs = _context6.sent;
|
3262
|
+
return _context6.abrupt("return", {
|
3193
3263
|
txHash: txHash,
|
3194
|
-
|
3264
|
+
licenseTokenId: targetLogs[0].args.startLicenseTokenId.toString()
|
3195
3265
|
});
|
3196
|
-
case
|
3197
|
-
return
|
3266
|
+
case 15:
|
3267
|
+
return _context6.abrupt("return", {
|
3198
3268
|
txHash: txHash
|
3199
3269
|
});
|
3200
|
-
case
|
3201
|
-
|
3270
|
+
case 16:
|
3271
|
+
_context6.next = 21;
|
3202
3272
|
break;
|
3203
|
-
case
|
3204
|
-
|
3205
|
-
|
3206
|
-
handleError(
|
3207
|
-
case
|
3273
|
+
case 18:
|
3274
|
+
_context6.prev = 18;
|
3275
|
+
_context6.t0 = _context6["catch"](0);
|
3276
|
+
handleError(_context6.t0, "Failed to mint license tokens");
|
3277
|
+
case 21:
|
3208
3278
|
case "end":
|
3209
|
-
return
|
3279
|
+
return _context6.stop();
|
3210
3280
|
}
|
3211
|
-
},
|
3281
|
+
}, _callee6, this, [[0, 18]]);
|
3212
3282
|
}));
|
3213
|
-
function
|
3214
|
-
return
|
3283
|
+
function mintLicenseTokens(_x6) {
|
3284
|
+
return _mintLicenseTokens.apply(this, arguments);
|
3215
3285
|
}
|
3216
|
-
return
|
3286
|
+
return mintLicenseTokens;
|
3217
3287
|
}())
|
3218
3288
|
}]);
|
3219
3289
|
}();
|
3220
3290
|
|
3221
3291
|
var DisputeClient = /*#__PURE__*/function () {
|
3222
|
-
function DisputeClient(rpcClient, wallet) {
|
3292
|
+
function DisputeClient(rpcClient, wallet, chainId) {
|
3223
3293
|
_classCallCheck(this, DisputeClient);
|
3224
|
-
_defineProperty(this, "disputeModuleConfig", DisputeModuleConfig);
|
3225
3294
|
this.rpcClient = rpcClient;
|
3226
3295
|
this.wallet = wallet;
|
3296
|
+
this.disputeModuleConfig = getDisputeModuleConfig(chainId);
|
3227
3297
|
}
|
3228
3298
|
|
3229
3299
|
/**
|
@@ -3609,30 +3679,166 @@ var StoryAPIClient = /*#__PURE__*/function () {
|
|
3609
3679
|
}
|
3610
3680
|
return getLicense;
|
3611
3681
|
}()
|
3682
|
+
}]);
|
3683
|
+
}();
|
3684
|
+
|
3685
|
+
var RoyaltyClient = /*#__PURE__*/function () {
|
3686
|
+
function RoyaltyClient(rpcClient, wallet, chainId) {
|
3687
|
+
_classCallCheck(this, RoyaltyClient);
|
3688
|
+
this.rpcClient = rpcClient;
|
3689
|
+
this.wallet = wallet;
|
3690
|
+
this.royaltyVaultImplConfig = getRoyaltyVaultImplConfig(chainId);
|
3691
|
+
this.royaltyPolicyLAPConfig = getRoyaltyPolicyLAPConfig(chainId);
|
3692
|
+
this.royaltyModuleConfig = getRoyaltyModuleConfig(chainId);
|
3693
|
+
}
|
3694
|
+
/**
|
3695
|
+
* Allows ancestors to claim the royalty tokens and any accrued revenue tokens
|
3696
|
+
* @param request - the licensing parameters for the Programmable IP License v1 (PIL) standard.
|
3697
|
+
* @param request.ancestorIpId The ip id of the ancestor to whom the royalty tokens belong to.
|
3698
|
+
* @param request.txOptions [Optional] The transaction options.
|
3699
|
+
* @returns Tx hash for the transaction.
|
3700
|
+
* @emits RoyaltyTokensCollected (ancestorIpId, ancestorsRoyalty)
|
3701
|
+
*/
|
3702
|
+
return _createClass(RoyaltyClient, [{
|
3703
|
+
key: "collectRoyaltyTokens",
|
3704
|
+
value: (function () {
|
3705
|
+
var _collectRoyaltyTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
3706
|
+
var proxyAddress, _yield$this$rpcClient, call, txHash;
|
3707
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
3708
|
+
while (1) switch (_context.prev = _context.next) {
|
3709
|
+
case 0:
|
3710
|
+
_context.prev = 0;
|
3711
|
+
_context.next = 3;
|
3712
|
+
return this.getProxyAddress(request.derivativeId);
|
3713
|
+
case 3:
|
3714
|
+
proxyAddress = _context.sent;
|
3715
|
+
if (proxyAddress) {
|
3716
|
+
_context.next = 6;
|
3717
|
+
break;
|
3718
|
+
}
|
3719
|
+
throw new Error("Proxy address not found");
|
3720
|
+
case 6:
|
3721
|
+
_context.next = 8;
|
3722
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.royaltyVaultImplConfig), {}, {
|
3723
|
+
address: proxyAddress,
|
3724
|
+
functionName: "collectRoyaltyTokens",
|
3725
|
+
args: [request.ancestorIpId],
|
3726
|
+
account: this.wallet.account
|
3727
|
+
}));
|
3728
|
+
case 8:
|
3729
|
+
_yield$this$rpcClient = _context.sent;
|
3730
|
+
call = _yield$this$rpcClient.request;
|
3731
|
+
_context.next = 12;
|
3732
|
+
return this.wallet.writeContract(call);
|
3733
|
+
case 12:
|
3734
|
+
txHash = _context.sent;
|
3735
|
+
return _context.abrupt("return", {
|
3736
|
+
txHash: txHash
|
3737
|
+
});
|
3738
|
+
case 16:
|
3739
|
+
_context.prev = 16;
|
3740
|
+
_context.t0 = _context["catch"](0);
|
3741
|
+
handleError(_context.t0, "Failed to collect royalty tokens");
|
3742
|
+
case 19:
|
3743
|
+
case "end":
|
3744
|
+
return _context.stop();
|
3745
|
+
}
|
3746
|
+
}, _callee, this, [[0, 16]]);
|
3747
|
+
}));
|
3748
|
+
function collectRoyaltyTokens(_x) {
|
3749
|
+
return _collectRoyaltyTokens.apply(this, arguments);
|
3750
|
+
}
|
3751
|
+
return collectRoyaltyTokens;
|
3752
|
+
}())
|
3612
3753
|
}, {
|
3613
|
-
key: "
|
3754
|
+
key: "getProxyAddress",
|
3614
3755
|
value: function () {
|
3615
|
-
var
|
3616
|
-
var
|
3756
|
+
var _getProxyAddress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(derivativeID) {
|
3757
|
+
var data;
|
3758
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
3759
|
+
while (1) switch (_context2.prev = _context2.next) {
|
3760
|
+
case 0:
|
3761
|
+
_context2.next = 2;
|
3762
|
+
return this.rpcClient.readContract(_objectSpread2(_objectSpread2({}, this.royaltyPolicyLAPConfig), {}, {
|
3763
|
+
functionName: "getRoyaltyData",
|
3764
|
+
args: [derivativeID]
|
3765
|
+
}));
|
3766
|
+
case 2:
|
3767
|
+
data = _context2.sent;
|
3768
|
+
if (!(Array.isArray(data) && data[1])) {
|
3769
|
+
_context2.next = 5;
|
3770
|
+
break;
|
3771
|
+
}
|
3772
|
+
return _context2.abrupt("return", data[1]);
|
3773
|
+
case 5:
|
3774
|
+
case "end":
|
3775
|
+
return _context2.stop();
|
3776
|
+
}
|
3777
|
+
}, _callee2, this);
|
3778
|
+
}));
|
3779
|
+
function getProxyAddress(_x2) {
|
3780
|
+
return _getProxyAddress.apply(this, arguments);
|
3781
|
+
}
|
3782
|
+
return getProxyAddress;
|
3783
|
+
}()
|
3784
|
+
/**
|
3785
|
+
* Allows the function caller to pay royalties to the receiver IP asset on behalf of the payer IP asset.
|
3786
|
+
* @param request - The request object that contains all data needed to pay royalty on behalf.
|
3787
|
+
* @param request.receiverIpId The ipId that receives the royalties.
|
3788
|
+
* @param request.payerIpId The ID of the IP asset that pays the royalties.
|
3789
|
+
* @param request.token The token to use to pay the royalties.
|
3790
|
+
* @param request.amount The amount to pay.
|
3791
|
+
* @param request.txOptions [Optional] The transaction options.
|
3792
|
+
* @returns A Promise that resolves to an object containing the transaction hash.
|
3793
|
+
* @emits RoyaltyPaid (receiverIpId, payerIpId, msg.sender, token, amount)
|
3794
|
+
*/
|
3795
|
+
}, {
|
3796
|
+
key: "payRoyaltyOnBehalf",
|
3797
|
+
value: (function () {
|
3798
|
+
var _payRoyaltyOnBehalf = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request) {
|
3799
|
+
var _request$txOptions, _yield$this$rpcClient2, call, txHash;
|
3617
3800
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
3618
3801
|
while (1) switch (_context3.prev = _context3.next) {
|
3619
3802
|
case 0:
|
3620
|
-
_context3.
|
3621
|
-
|
3622
|
-
|
3623
|
-
|
3624
|
-
|
3625
|
-
|
3803
|
+
_context3.prev = 0;
|
3804
|
+
_context3.next = 3;
|
3805
|
+
return this.rpcClient.simulateContract(_objectSpread2(_objectSpread2({}, this.royaltyModuleConfig), {}, {
|
3806
|
+
functionName: "payRoyaltyOnBehalf",
|
3807
|
+
args: [request.receiverIpId, request.payerIpId, request.token, request.amount],
|
3808
|
+
account: this.wallet.account
|
3809
|
+
}));
|
3810
|
+
case 3:
|
3811
|
+
_yield$this$rpcClient2 = _context3.sent;
|
3812
|
+
call = _yield$this$rpcClient2.request;
|
3813
|
+
_context3.next = 7;
|
3814
|
+
return this.wallet.writeContract(call);
|
3815
|
+
case 7:
|
3816
|
+
txHash = _context3.sent;
|
3817
|
+
if (!((_request$txOptions = request.txOptions) !== null && _request$txOptions !== void 0 && _request$txOptions.waitForTransaction)) {
|
3818
|
+
_context3.next = 11;
|
3819
|
+
break;
|
3820
|
+
}
|
3821
|
+
_context3.next = 11;
|
3822
|
+
return waitTx(this.rpcClient, txHash);
|
3823
|
+
case 11:
|
3824
|
+
return _context3.abrupt("return", {
|
3825
|
+
txHash: txHash
|
3826
|
+
});
|
3827
|
+
case 14:
|
3828
|
+
_context3.prev = 14;
|
3829
|
+
_context3.t0 = _context3["catch"](0);
|
3830
|
+
handleError(_context3.t0, "Failed to pay royalty on behalf");
|
3831
|
+
case 17:
|
3626
3832
|
case "end":
|
3627
3833
|
return _context3.stop();
|
3628
3834
|
}
|
3629
|
-
}, _callee3, this);
|
3835
|
+
}, _callee3, this, [[0, 14]]);
|
3630
3836
|
}));
|
3631
|
-
function
|
3632
|
-
return
|
3837
|
+
function payRoyaltyOnBehalf(_x3) {
|
3838
|
+
return _payRoyaltyOnBehalf.apply(this, arguments);
|
3633
3839
|
}
|
3634
|
-
return
|
3635
|
-
}()
|
3840
|
+
return payRoyaltyOnBehalf;
|
3841
|
+
}())
|
3636
3842
|
}]);
|
3637
3843
|
}();
|
3638
3844
|
|
@@ -3651,15 +3857,17 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3651
3857
|
_defineProperty(this, "_ipAsset", null);
|
3652
3858
|
_defineProperty(this, "_permission", null);
|
3653
3859
|
_defineProperty(this, "_license", null);
|
3654
|
-
_defineProperty(this, "_policy", null);
|
3655
3860
|
_defineProperty(this, "_dispute", null);
|
3656
3861
|
_defineProperty(this, "_ipAccount", null);
|
3657
|
-
this
|
3862
|
+
_defineProperty(this, "_royalty", null);
|
3863
|
+
this.config = _objectSpread2(_objectSpread2({}, config), {}, {
|
3864
|
+
chainId: config.chainId || "sepolia"
|
3865
|
+
});
|
3658
3866
|
if (!this.config.transport) {
|
3659
3867
|
throw new Error("transport is null, please pass in a valid RPC Provider URL as the transport.");
|
3660
3868
|
}
|
3661
3869
|
var clientConfig = {
|
3662
|
-
chain: chainStringToViemChain(this.config.chainId
|
3870
|
+
chain: chainStringToViemChain(this.config.chainId),
|
3663
3871
|
transport: this.config.transport
|
3664
3872
|
};
|
3665
3873
|
this.rpcClient = createPublicClient(clientConfig);
|
@@ -3668,7 +3876,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3668
3876
|
if (!account) {
|
3669
3877
|
throw new Error("account is null");
|
3670
3878
|
}
|
3671
|
-
this.wallet = createWalletClient(_objectSpread2(_objectSpread2({}, clientConfig), {}, {
|
3879
|
+
this.wallet = config.wallet || createWalletClient(_objectSpread2(_objectSpread2({}, clientConfig), {}, {
|
3672
3880
|
account: account
|
3673
3881
|
}));
|
3674
3882
|
}
|
@@ -3689,7 +3897,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3689
3897
|
*/
|
3690
3898
|
function get() {
|
3691
3899
|
if (this._ipAsset === null) {
|
3692
|
-
this._ipAsset = new IPAssetClient(this.rpcClient, this.wallet, this.
|
3900
|
+
this._ipAsset = new IPAssetClient(this.rpcClient, this.wallet, this.config.chainId);
|
3693
3901
|
}
|
3694
3902
|
return this._ipAsset;
|
3695
3903
|
}
|
@@ -3704,7 +3912,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3704
3912
|
key: "permission",
|
3705
3913
|
get: function get() {
|
3706
3914
|
if (this._permission === null) {
|
3707
|
-
this._permission = new PermissionClient(this.rpcClient, this.wallet);
|
3915
|
+
this._permission = new PermissionClient(this.rpcClient, this.wallet, this.config.chainId);
|
3708
3916
|
}
|
3709
3917
|
return this._permission;
|
3710
3918
|
}
|
@@ -3719,26 +3927,11 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3719
3927
|
key: "license",
|
3720
3928
|
get: function get() {
|
3721
3929
|
if (this._license === null) {
|
3722
|
-
this._license = new LicenseClient(this.rpcClient, this.wallet, this.storyClient);
|
3930
|
+
this._license = new LicenseClient(this.rpcClient, this.wallet, this.storyClient, this.config.chainId);
|
3723
3931
|
}
|
3724
3932
|
return this._license;
|
3725
3933
|
}
|
3726
3934
|
|
3727
|
-
/**
|
3728
|
-
* Getter for the policy client. The client is lazily created when
|
3729
|
-
* this method is called.
|
3730
|
-
*
|
3731
|
-
* @returns the PolicyClient instance
|
3732
|
-
*/
|
3733
|
-
}, {
|
3734
|
-
key: "policy",
|
3735
|
-
get: function get() {
|
3736
|
-
if (this._policy === null) {
|
3737
|
-
this._policy = new PolicyClient(this.rpcClient, this.wallet);
|
3738
|
-
}
|
3739
|
-
return this._policy;
|
3740
|
-
}
|
3741
|
-
|
3742
3935
|
/**
|
3743
3936
|
* Getter for the dispute client. The client is lazily created when
|
3744
3937
|
* this method is called.
|
@@ -3749,7 +3942,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3749
3942
|
key: "dispute",
|
3750
3943
|
get: function get() {
|
3751
3944
|
if (this._dispute === null) {
|
3752
|
-
this._dispute = new DisputeClient(this.rpcClient, this.wallet);
|
3945
|
+
this._dispute = new DisputeClient(this.rpcClient, this.wallet, this.config.chainId);
|
3753
3946
|
}
|
3754
3947
|
return this._dispute;
|
3755
3948
|
}
|
@@ -3768,6 +3961,20 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3768
3961
|
}
|
3769
3962
|
return this._ipAccount;
|
3770
3963
|
}
|
3964
|
+
/**
|
3965
|
+
* Getter for the royalty client. The client is lazily created when
|
3966
|
+
* this method is called.
|
3967
|
+
*
|
3968
|
+
* @returns the RoyaltyClient instance
|
3969
|
+
*/
|
3970
|
+
}, {
|
3971
|
+
key: "royalty",
|
3972
|
+
get: function get() {
|
3973
|
+
if (this._royalty === null) {
|
3974
|
+
this._royalty = new RoyaltyClient(this.rpcClient, this.wallet, this.config.chainId);
|
3975
|
+
}
|
3976
|
+
return this._royalty;
|
3977
|
+
}
|
3771
3978
|
}], [{
|
3772
3979
|
key: "newClient",
|
3773
3980
|
value: function newClient(config) {
|
@@ -3776,4 +3983,7 @@ var StoryClient = /*#__PURE__*/function () {
|
|
3776
3983
|
}]);
|
3777
3984
|
}();
|
3778
3985
|
|
3779
|
-
|
3986
|
+
var AddressZero = "0x0000000000000000000000000000000000000000";
|
3987
|
+
var HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
3988
|
+
|
3989
|
+
export { AddressZero, DisputeClient, HashZero, IPAssetClient, LicenseClient, PermissionClient, StoryClient };
|