@story-protocol/core-sdk 1.3.3 → 1.4.0-rc.1
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/abi/generated.d.ts +21 -36
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +2 -0
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +17 -1
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +13 -1
- package/dist/declarations/src/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/common.d.ts +13 -5
- package/dist/declarations/src/types/common.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/group.d.ts +8 -2
- package/dist/declarations/src/types/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +12 -0
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +18 -2
- package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/royalty.d.ts +4 -1
- package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/types/utils/pilFlavor.d.ts +75 -0
- package/dist/declarations/src/types/utils/pilFlavor.d.ts.map +1 -0
- package/dist/declarations/src/utils/chain.d.ts +2 -0
- package/dist/declarations/src/utils/chain.d.ts.map +1 -1
- package/dist/declarations/src/utils/pilFlavor.d.ts +54 -0
- package/dist/declarations/src/utils/pilFlavor.d.ts.map +1 -0
- package/dist/story-protocol-core-sdk.cjs.dev.js +1193 -816
- package/dist/story-protocol-core-sdk.cjs.prod.js +1193 -816
- package/dist/story-protocol-core-sdk.esm.js +1195 -819
- package/package.json +4 -3
@@ -39,19 +39,17 @@ function _regeneratorDefine(e, r, n, t) {
|
|
39
39
|
i = 0;
|
40
40
|
}
|
41
41
|
_regeneratorDefine = function (e, r, n, t) {
|
42
|
-
|
42
|
+
function o(r, n) {
|
43
|
+
_regeneratorDefine(e, r, function (e) {
|
44
|
+
return this._invoke(r, n, e);
|
45
|
+
});
|
46
|
+
}
|
47
|
+
r ? i ? i(e, r, {
|
43
48
|
value: n,
|
44
49
|
enumerable: !t,
|
45
50
|
configurable: !t,
|
46
51
|
writable: !t
|
47
|
-
}) : e[r] = n;
|
48
|
-
function o(r, n) {
|
49
|
-
_regeneratorDefine(e, r, function (e) {
|
50
|
-
return this._invoke(r, n, e);
|
51
|
-
});
|
52
|
-
}
|
53
|
-
o("next", 0), o("throw", 1), o("return", 2);
|
54
|
-
}
|
52
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
55
53
|
}, _regeneratorDefine(e, r, n, t);
|
56
54
|
}
|
57
55
|
|
@@ -2650,6 +2648,11 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
2650
2648
|
* @param to address
|
2651
2649
|
* @param tokenId uint256
|
2652
2650
|
*//**
|
2651
|
+
* SpgnftImplHasRoleRequest
|
2652
|
+
*
|
2653
|
+
* @param role bytes32
|
2654
|
+
* @param account address
|
2655
|
+
*//**
|
2653
2656
|
* SpgnftImplTokenUriRequest
|
2654
2657
|
*
|
2655
2658
|
* @param tokenId uint256
|
@@ -2667,49 +2670,44 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
2667
2670
|
*/},{key:"parseTxTransferEvent",value:function parseTxTransferEvent(txReceipt){var targetLogs=[];var _iterator38=_createForOfIteratorHelper(txReceipt.logs),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var log=_step38.value;try{var event=viem.decodeEventLog({abi:spgnftImplAbi,eventName:"Transfer",data:log.data,topics:log.topics});if(event.eventName==="Transfer"){targetLogs.push(event.args);}}catch(e){/* empty */}}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return targetLogs;}}]);}();/**
|
2668
2671
|
* contract SPGNFTImpl readonly method
|
2669
2672
|
*/var SpgnftImplReadOnlyClient=/*#__PURE__*/function(_SpgnftImplEventClien){function SpgnftImplReadOnlyClient(rpcClient,address){_classCallCheck(this,SpgnftImplReadOnlyClient);return _callSuper(this,SpgnftImplReadOnlyClient,[rpcClient,address]);}/**
|
2673
|
+
* method hasRole for contract SPGNFTImpl
|
2674
|
+
*
|
2675
|
+
* @param request SpgnftImplHasRoleRequest
|
2676
|
+
* @return Promise<SpgnftImplHasRoleResponse>
|
2677
|
+
*/_inherits(SpgnftImplReadOnlyClient,_SpgnftImplEventClien);return _createClass(SpgnftImplReadOnlyClient,[{key:"hasRole",value:(function(){var _hasRole=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee187(request){return _regenerator().w(function(_context187){while(1)switch(_context187.n){case 0:_context187.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"hasRole",args:[request.role,request.account]});case 1:return _context187.a(2,_context187.v);}},_callee187,this);}));function hasRole(_x133){return _hasRole.apply(this,arguments);}return hasRole;}()/**
|
2670
2678
|
* method mintFee for contract SPGNFTImpl
|
2671
2679
|
*
|
2672
2680
|
* @param request SpgnftImplMintFeeRequest
|
2673
2681
|
* @return Promise<SpgnftImplMintFeeResponse>
|
2674
|
-
*/
|
2682
|
+
*/)},{key:"mintFee",value:(function(){var _mintFee=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee188(){return _regenerator().w(function(_context188){while(1)switch(_context188.n){case 0:_context188.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"mintFee"});case 1:return _context188.a(2,_context188.v);}},_callee188,this);}));function mintFee(){return _mintFee.apply(this,arguments);}return mintFee;}()/**
|
2675
2683
|
* method mintFeeToken for contract SPGNFTImpl
|
2676
2684
|
*
|
2677
2685
|
* @param request SpgnftImplMintFeeTokenRequest
|
2678
2686
|
* @return Promise<SpgnftImplMintFeeTokenResponse>
|
2679
|
-
*/)},{key:"mintFeeToken",value:(function(){var _mintFeeToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
2687
|
+
*/)},{key:"mintFeeToken",value:(function(){var _mintFeeToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee189(){return _regenerator().w(function(_context189){while(1)switch(_context189.n){case 0:_context189.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"mintFeeToken"});case 1:return _context189.a(2,_context189.v);}},_callee189,this);}));function mintFeeToken(){return _mintFeeToken.apply(this,arguments);}return mintFeeToken;}()/**
|
2680
2688
|
* method publicMinting for contract SPGNFTImpl
|
2681
2689
|
*
|
2682
2690
|
* @param request SpgnftImplPublicMintingRequest
|
2683
2691
|
* @return Promise<SpgnftImplPublicMintingResponse>
|
2684
|
-
*/)},{key:"publicMinting",value:(function(){var _publicMinting=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
2692
|
+
*/)},{key:"publicMinting",value:(function(){var _publicMinting=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee190(){return _regenerator().w(function(_context190){while(1)switch(_context190.n){case 0:_context190.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"publicMinting"});case 1:return _context190.a(2,_context190.v);}},_callee190,this);}));function publicMinting(){return _publicMinting.apply(this,arguments);}return publicMinting;}()/**
|
2685
2693
|
* method tokenURI for contract SPGNFTImpl
|
2686
2694
|
*
|
2687
2695
|
* @param request SpgnftImplTokenUriRequest
|
2688
2696
|
* @return Promise<SpgnftImplTokenUriResponse>
|
2689
|
-
*/)},{key:"tokenUri",value:(function(){var _tokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
2697
|
+
*/)},{key:"tokenUri",value:(function(){var _tokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee191(request){return _regenerator().w(function(_context191){while(1)switch(_context191.n){case 0:_context191.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"tokenURI",args:[request.tokenId]});case 1:return _context191.a(2,_context191.v);}},_callee191,this);}));function tokenUri(_x134){return _tokenUri.apply(this,arguments);}return tokenUri;}())}]);}(SpgnftImplEventClient);/**
|
2690
2698
|
* contract SPGNFTImpl write method
|
2691
2699
|
*/var SpgnftImplClient=/*#__PURE__*/function(_SpgnftImplReadOnlyCl){function SpgnftImplClient(rpcClient,wallet,address){var _this14;_classCallCheck(this,SpgnftImplClient);_this14=_callSuper(this,SpgnftImplClient,[rpcClient,address]);_this14.wallet=wallet;return _this14;}/**
|
2692
2700
|
* method setTokenURI for contract SPGNFTImpl
|
2693
2701
|
*
|
2694
2702
|
* @param request SpgnftImplSetTokenUriRequest
|
2695
2703
|
* @return Promise<WriteContractReturnType>
|
2696
|
-
*/_inherits(SpgnftImplClient,_SpgnftImplReadOnlyCl);return _createClass(SpgnftImplClient,[{key:"setTokenUri",value:(function(){var _setTokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
2704
|
+
*/_inherits(SpgnftImplClient,_SpgnftImplReadOnlyCl);return _createClass(SpgnftImplClient,[{key:"setTokenUri",value:(function(){var _setTokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee192(request){var _yield$this$rpcClient92,call;return _regenerator().w(function(_context192){while(1)switch(_context192.n){case 0:_context192.n=1;return this.rpcClient.simulateContract({abi:spgnftImplAbi,address:this.address,functionName:"setTokenURI",account:this.wallet.account,args:[request.tokenId,request.tokenUri]});case 1:_yield$this$rpcClient92=_context192.v;call=_yield$this$rpcClient92.request;_context192.n=2;return this.wallet.writeContract(call);case 2:return _context192.a(2,_context192.v);}},_callee192,this);}));function setTokenUri(_x135){return _setTokenUri.apply(this,arguments);}return setTokenUri;}()/**
|
2697
2705
|
* method setTokenURI for contract SPGNFTImpl with only encode
|
2698
2706
|
*
|
2699
2707
|
* @param request SpgnftImplSetTokenUriRequest
|
2700
2708
|
* @return EncodedTxData
|
2701
2709
|
*/)},{key:"setTokenUriEncode",value:function setTokenUriEncode(request){return {to:this.address,data:viem.encodeFunctionData({abi:spgnftImplAbi,functionName:"setTokenURI",args:[request.tokenId,request.tokenUri]})};}}]);}(SpgnftImplReadOnlyClient);// Contract TotalLicenseTokenLimitHook =============================================================
|
2702
2710
|
/**
|
2703
|
-
* TotalLicenseTokenLimitHookGetTotalLicenseTokenLimitRequest
|
2704
|
-
*
|
2705
|
-
* @param licensorIpId address
|
2706
|
-
* @param licenseTemplate address
|
2707
|
-
* @param licenseTermsId uint256
|
2708
|
-
*//**
|
2709
|
-
* TotalLicenseTokenLimitHookGetTotalLicenseTokenLimitResponse
|
2710
|
-
*
|
2711
|
-
* @param limit uint256
|
2712
|
-
*//**
|
2713
2711
|
* TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
2714
2712
|
*
|
2715
2713
|
* @param licensorIpId address
|
@@ -2717,25 +2715,18 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
2717
2715
|
* @param licenseTermsId uint256
|
2718
2716
|
* @param limit uint256
|
2719
2717
|
*//**
|
2720
|
-
* contract TotalLicenseTokenLimitHook readonly method
|
2721
|
-
*/var TotalLicenseTokenLimitHookReadOnlyClient=/*#__PURE__*/function(){function TotalLicenseTokenLimitHookReadOnlyClient(rpcClient,address){var _rpcClient$chain25;_classCallCheck(this,TotalLicenseTokenLimitHookReadOnlyClient);this.address=address||getAddress(totalLicenseTokenLimitHookAddress,(_rpcClient$chain25=rpcClient.chain)===null||_rpcClient$chain25===void 0?void 0:_rpcClient$chain25.id);this.rpcClient=rpcClient;}/**
|
2722
|
-
* method getTotalLicenseTokenLimit for contract TotalLicenseTokenLimitHook
|
2723
|
-
*
|
2724
|
-
* @param request TotalLicenseTokenLimitHookGetTotalLicenseTokenLimitRequest
|
2725
|
-
* @return Promise<TotalLicenseTokenLimitHookGetTotalLicenseTokenLimitResponse>
|
2726
|
-
*/return _createClass(TotalLicenseTokenLimitHookReadOnlyClient,[{key:"getTotalLicenseTokenLimit",value:(function(){var _getTotalLicenseTokenLimit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee192(request){var result;return _regenerator().w(function(_context192){while(1)switch(_context192.n){case 0:_context192.n=1;return this.rpcClient.readContract({abi:totalLicenseTokenLimitHookAbi,address:this.address,functionName:"getTotalLicenseTokenLimit",args:[request.licensorIpId,request.licenseTemplate,request.licenseTermsId]});case 1:result=_context192.v;return _context192.a(2,{limit:result});}},_callee192,this);}));function getTotalLicenseTokenLimit(_x135){return _getTotalLicenseTokenLimit.apply(this,arguments);}return getTotalLicenseTokenLimit;}())}]);}();/**
|
2727
2718
|
* contract TotalLicenseTokenLimitHook write method
|
2728
|
-
*/var TotalLicenseTokenLimitHookClient=/*#__PURE__*/function(
|
2719
|
+
*/var TotalLicenseTokenLimitHookClient=/*#__PURE__*/function(){function TotalLicenseTokenLimitHookClient(rpcClient,wallet,address){var _rpcClient$chain25;_classCallCheck(this,TotalLicenseTokenLimitHookClient);this.address=address||getAddress(totalLicenseTokenLimitHookAddress,(_rpcClient$chain25=rpcClient.chain)===null||_rpcClient$chain25===void 0?void 0:_rpcClient$chain25.id);this.rpcClient=rpcClient;this.wallet=wallet;}/**
|
2729
2720
|
* method setTotalLicenseTokenLimit for contract TotalLicenseTokenLimitHook
|
2730
2721
|
*
|
2731
2722
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
2732
2723
|
* @return Promise<WriteContractReturnType>
|
2733
|
-
*/
|
2724
|
+
*/return _createClass(TotalLicenseTokenLimitHookClient,[{key:"setTotalLicenseTokenLimit",value:(function(){var _setTotalLicenseTokenLimit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee193(request){var _yield$this$rpcClient93,call;return _regenerator().w(function(_context193){while(1)switch(_context193.n){case 0:_context193.n=1;return this.rpcClient.simulateContract({abi:totalLicenseTokenLimitHookAbi,address:this.address,functionName:"setTotalLicenseTokenLimit",account:this.wallet.account,args:[request.licensorIpId,request.licenseTemplate,request.licenseTermsId,request.limit]});case 1:_yield$this$rpcClient93=_context193.v;call=_yield$this$rpcClient93.request;_context193.n=2;return this.wallet.writeContract(call);case 2:return _context193.a(2,_context193.v);}},_callee193,this);}));function setTotalLicenseTokenLimit(_x136){return _setTotalLicenseTokenLimit.apply(this,arguments);}return setTotalLicenseTokenLimit;}()/**
|
2734
2725
|
* method setTotalLicenseTokenLimit for contract TotalLicenseTokenLimitHook with only encode
|
2735
2726
|
*
|
2736
2727
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
2737
2728
|
* @return EncodedTxData
|
2738
|
-
*/)},{key:"setTotalLicenseTokenLimitEncode",value:function setTotalLicenseTokenLimitEncode(request){return {to:this.address,data:viem.encodeFunctionData({abi:totalLicenseTokenLimitHookAbi,functionName:"setTotalLicenseTokenLimit",args:[request.licensorIpId,request.licenseTemplate,request.licenseTermsId,request.limit]})};}}]);}(
|
2729
|
+
*/)},{key:"setTotalLicenseTokenLimitEncode",value:function setTotalLicenseTokenLimitEncode(request){return {to:this.address,data:viem.encodeFunctionData({abi:totalLicenseTokenLimitHookAbi,functionName:"setTotalLicenseTokenLimit",args:[request.licensorIpId,request.licenseTemplate,request.licenseTermsId,request.limit]})};}}]);}();// Contract WrappedIP =============================================================
|
2739
2730
|
/**
|
2740
2731
|
* WrappedIpAllowanceRequest
|
2741
2732
|
*
|
@@ -2787,7 +2778,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
2787
2778
|
* @return Promise<WrappedIpBalanceOfResponse>
|
2788
2779
|
*/)},{key:"balanceOf",value:(function(){var _balanceOf3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee195(request){var result;return _regenerator().w(function(_context195){while(1)switch(_context195.n){case 0:_context195.n=1;return this.rpcClient.readContract({abi:wrappedIpAbi,address:this.address,functionName:"balanceOf",args:[request.owner]});case 1:result=_context195.v;return _context195.a(2,{result:result});}},_callee195,this);}));function balanceOf(_x138){return _balanceOf3.apply(this,arguments);}return balanceOf;}())}]);}();/**
|
2789
2780
|
* contract WrappedIP write method
|
2790
|
-
*/var WrappedIpClient=/*#__PURE__*/function(_WrappedIpReadOnlyCli){function WrappedIpClient(rpcClient,wallet,address){var
|
2781
|
+
*/var WrappedIpClient=/*#__PURE__*/function(_WrappedIpReadOnlyCli){function WrappedIpClient(rpcClient,wallet,address){var _this15;_classCallCheck(this,WrappedIpClient);_this15=_callSuper(this,WrappedIpClient,[rpcClient,address]);_this15.wallet=wallet;return _this15;}/**
|
2791
2782
|
* method approve for contract WrappedIP
|
2792
2783
|
*
|
2793
2784
|
* @param request WrappedIpApproveRequest
|
@@ -2899,6 +2890,45 @@ var royaltySharesTotalSupply = 100000000;
|
|
2899
2890
|
var MAX_ROYALTY_TOKEN = 100000000;
|
2900
2891
|
var WIP_TOKEN_ADDRESS = wrappedIpAddress[mainnet.id];
|
2901
2892
|
|
2893
|
+
function _isNativeFunction(t) {
|
2894
|
+
try {
|
2895
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
2896
|
+
} catch (n) {
|
2897
|
+
return "function" == typeof t;
|
2898
|
+
}
|
2899
|
+
}
|
2900
|
+
|
2901
|
+
function _construct(t, e, r) {
|
2902
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
2903
|
+
var o = [null];
|
2904
|
+
o.push.apply(o, e);
|
2905
|
+
var p = new (t.bind.apply(t, o))();
|
2906
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
2907
|
+
}
|
2908
|
+
|
2909
|
+
function _wrapNativeSuper(t) {
|
2910
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
2911
|
+
return _wrapNativeSuper = function (t) {
|
2912
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
2913
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
2914
|
+
if (void 0 !== r) {
|
2915
|
+
if (r.has(t)) return r.get(t);
|
2916
|
+
r.set(t, Wrapper);
|
2917
|
+
}
|
2918
|
+
function Wrapper() {
|
2919
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
2920
|
+
}
|
2921
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
2922
|
+
constructor: {
|
2923
|
+
value: Wrapper,
|
2924
|
+
enumerable: false,
|
2925
|
+
writable: true,
|
2926
|
+
configurable: true
|
2927
|
+
}
|
2928
|
+
}), _setPrototypeOf(Wrapper, t);
|
2929
|
+
}, _wrapNativeSuper(t);
|
2930
|
+
}
|
2931
|
+
|
2902
2932
|
var handleError = function handleError(error, msg) {
|
2903
2933
|
if (error instanceof Error) {
|
2904
2934
|
var newError = new Error("".concat(msg, ": ").concat(error.message));
|
@@ -2907,6 +2937,17 @@ var handleError = function handleError(error, msg) {
|
|
2907
2937
|
}
|
2908
2938
|
throw new Error("".concat(msg, ": Unknown error type"));
|
2909
2939
|
};
|
2940
|
+
var PILFlavorError = /*#__PURE__*/function (_Error) {
|
2941
|
+
function PILFlavorError(message) {
|
2942
|
+
var _this;
|
2943
|
+
_classCallCheck(this, PILFlavorError);
|
2944
|
+
_this = _callSuper(this, PILFlavorError, [message]);
|
2945
|
+
_this.name = "PILFlavorError";
|
2946
|
+
return _this;
|
2947
|
+
}
|
2948
|
+
_inherits(PILFlavorError, _Error);
|
2949
|
+
return _createClass(PILFlavorError);
|
2950
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
2910
2951
|
|
2911
2952
|
function _arrayWithoutHoles(r) {
|
2912
2953
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
@@ -3259,7 +3300,7 @@ var approvalAllSpenders = /*#__PURE__*/function () {
|
|
3259
3300
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
3260
3301
|
var spenders, client, owner, useMultiCall, rpcClient, multicallAddress, approvals, allCalls, _iterator, _step, approval, hash, _t;
|
3261
3302
|
return _regenerator().w(function (_context2) {
|
3262
|
-
while (1) switch (_context2.n) {
|
3303
|
+
while (1) switch (_context2.p = _context2.n) {
|
3263
3304
|
case 0:
|
3264
3305
|
spenders = _ref.spenders, client = _ref.client, owner = _ref.owner, useMultiCall = _ref.useMultiCall, rpcClient = _ref.rpcClient, multicallAddress = _ref.multicallAddress;
|
3265
3306
|
_context2.n = 1;
|
@@ -3845,7 +3886,7 @@ var settleAssertion = /*#__PURE__*/function () {
|
|
3845
3886
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(privateKey, disputeId, transport) {
|
3846
3887
|
var baseConfig, rpcClient, walletClient, arbitrationPolicyUmaClient, oov3Contract, assertionId, txHash, _t;
|
3847
3888
|
return _regenerator().w(function (_context4) {
|
3848
|
-
while (1) switch (_context4.n) {
|
3889
|
+
while (1) switch (_context4.p = _context4.n) {
|
3849
3890
|
case 0:
|
3850
3891
|
_context4.p = 0;
|
3851
3892
|
baseConfig = {
|
@@ -3918,7 +3959,7 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3918
3959
|
var _this = this;
|
3919
3960
|
var _request$txOptions, liveness, _yield$Promise$all, _yield$Promise$all2, minLiveness, maxLiveness, _yield$Promise$all3, _yield$Promise$all4, minimumBond, maximumBond, bonds, tag, data, _yield$this$disputeMo, isWhiteList, req, encodedTxData, contractCall, _yield$contractCallWi, txHash, receipt, targetLogs, _t;
|
3920
3961
|
return _regenerator().w(function (_context) {
|
3921
|
-
while (1) switch (_context.n) {
|
3962
|
+
while (1) switch (_context.p = _context.n) {
|
3922
3963
|
case 0:
|
3923
3964
|
_context.p = 0;
|
3924
3965
|
liveness = BigInt(request.liveness);
|
@@ -3944,7 +3985,7 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
3944
3985
|
_yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 2);
|
3945
3986
|
minimumBond = _yield$Promise$all4[0];
|
3946
3987
|
maximumBond = _yield$Promise$all4[1];
|
3947
|
-
bonds = BigInt(request.bond
|
3988
|
+
bonds = BigInt(request.bond === undefined ? minimumBond : request.bond);
|
3948
3989
|
if (!(bonds > maximumBond || bonds < minimumBond)) {
|
3949
3990
|
_context.n = 4;
|
3950
3991
|
break;
|
@@ -4062,7 +4103,7 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
4062
4103
|
var _cancelDispute = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(request) {
|
4063
4104
|
var _request$txOptions2, _req, txHash, _t2;
|
4064
4105
|
return _regenerator().w(function (_context2) {
|
4065
|
-
while (1) switch (_context2.n) {
|
4106
|
+
while (1) switch (_context2.p = _context2.n) {
|
4066
4107
|
case 0:
|
4067
4108
|
_context2.p = 0;
|
4068
4109
|
_req = {
|
@@ -4118,7 +4159,7 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
4118
4159
|
var _resolveDispute = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
4119
4160
|
var _request$data, _request$txOptions3, _req2, txHash, _t3;
|
4120
4161
|
return _regenerator().w(function (_context3) {
|
4121
|
-
while (1) switch (_context3.n) {
|
4162
|
+
while (1) switch (_context3.p = _context3.n) {
|
4122
4163
|
case 0:
|
4123
4164
|
_context3.p = 0;
|
4124
4165
|
_req2 = {
|
@@ -4176,7 +4217,7 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
4176
4217
|
var _this2 = this;
|
4177
4218
|
var _request$options, objects, txHashes, calls, txHash, _iterator, _step, object, _txHash, _t4, _t5;
|
4178
4219
|
return _regenerator().w(function (_context4) {
|
4179
|
-
while (1) switch (_context4.n) {
|
4220
|
+
while (1) switch (_context4.p = _context4.n) {
|
4180
4221
|
case 0:
|
4181
4222
|
_context4.p = 0;
|
4182
4223
|
objects = request.infringementTags.map(function (arg) {
|
@@ -4278,7 +4319,7 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
4278
4319
|
var _this3 = this;
|
4279
4320
|
var ipAccount, bond, counterEvidenceHash, encodedData, _yield$this$wrappedIp, allowance, _txHash2, contractCall, _yield$contractCallWi2, txHash, receipt, _t6;
|
4280
4321
|
return _regenerator().w(function (_context5) {
|
4281
|
-
while (1) switch (_context5.n) {
|
4322
|
+
while (1) switch (_context5.p = _context5.n) {
|
4282
4323
|
case 0:
|
4283
4324
|
_context5.p = 0;
|
4284
4325
|
ipAccount = new IpAccountImplClient(this.rpcClient, this.wallet, validateAddress(request.ipId));
|
@@ -4431,9 +4472,11 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
4431
4472
|
* It is used to determine the type of revenue share to be used in the revenue share calculation and throw error when the revenue share is not valid.
|
4432
4473
|
*/
|
4433
4474
|
var RevShareType = /*#__PURE__*/function (RevShareType) {
|
4434
|
-
RevShareType["COMMERCIAL_REVENUE_SHARE"] = "
|
4435
|
-
RevShareType["MAX_REVENUE_SHARE"] = "
|
4436
|
-
RevShareType["MAX_ALLOWED_REWARD_SHARE"] = "
|
4475
|
+
RevShareType["COMMERCIAL_REVENUE_SHARE"] = "commercialRevShare";
|
4476
|
+
RevShareType["MAX_REVENUE_SHARE"] = "maxRevenueShare";
|
4477
|
+
RevShareType["MAX_ALLOWED_REWARD_SHARE"] = "maxAllowedRewardShare";
|
4478
|
+
RevShareType["EXPECT_MINIMUM_GROUP_REWARD_SHARE"] = "expectMinimumGroupRewardShare";
|
4479
|
+
RevShareType["MAX_ALLOWED_REWARD_SHARE_PERCENTAGE"] = "maxAllowedRewardSharePercentage";
|
4437
4480
|
return RevShareType;
|
4438
4481
|
}({});
|
4439
4482
|
|
@@ -4497,207 +4540,39 @@ var getIpMetadataForWorkflow = function getIpMetadataForWorkflow(ipMetadata) {
|
|
4497
4540
|
};
|
4498
4541
|
};
|
4499
4542
|
|
4500
|
-
/**
|
4501
|
-
* This structure defines the terms for a Programmable IP License (PIL).
|
4502
|
-
* These terms can be attached to IP Assets.
|
4503
|
-
*
|
4504
|
-
* For more information, see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-terms | PIL}.
|
4505
|
-
**/
|
4543
|
+
/** The amount of revenue token claimable. */
|
4506
4544
|
|
4507
|
-
|
4508
|
-
|
4509
|
-
|
4510
|
-
|
4511
|
-
|
4512
|
-
|
4545
|
+
/**
|
4546
|
+
* Native royalty policy created by the Story team
|
4547
|
+
* - LAP: {@link https://docs.story.foundation/concepts/royalty-module/liquid-absolute-percentage | Liquid Absolute Percentage}
|
4548
|
+
* - LRP: {@link https://docs.story.foundation/concepts/royalty-module/liquid-relative-percentage | Liquid Relative Percentage}
|
4549
|
+
*/
|
4550
|
+
var NativeRoyaltyPolicy = /*#__PURE__*/function (NativeRoyaltyPolicy) {
|
4551
|
+
NativeRoyaltyPolicy[NativeRoyaltyPolicy["LAP"] = 0] = "LAP";
|
4552
|
+
NativeRoyaltyPolicy[NativeRoyaltyPolicy["LRP"] = 1] = "LRP";
|
4553
|
+
return NativeRoyaltyPolicy;
|
4513
4554
|
}({});
|
4514
4555
|
|
4515
|
-
|
4516
|
-
|
4517
|
-
|
4518
|
-
|
4519
|
-
|
4520
|
-
|
4521
|
-
|
4522
|
-
|
4523
|
-
|
4524
|
-
|
4525
|
-
|
4526
|
-
|
4527
|
-
|
4528
|
-
|
4529
|
-
|
4530
|
-
|
4531
|
-
|
4532
|
-
|
4533
|
-
uri: ""
|
4534
|
-
};
|
4535
|
-
if (type === PIL_TYPE.NON_COMMERCIAL_REMIX) {
|
4536
|
-
licenseTerms.commercializerCheckerData = "0x";
|
4537
|
-
licenseTerms.uri = "https://github.com/piplabs/pil-document/blob/998c13e6ee1d04eb817aefd1fe16dfe8be3cd7a2/off-chain-terms/NCSR.json";
|
4538
|
-
return licenseTerms;
|
4539
|
-
} else if (type === PIL_TYPE.COMMERCIAL_USE) {
|
4540
|
-
if (!term || term.defaultMintingFee === undefined || term.currency === undefined) {
|
4541
|
-
throw new Error("DefaultMintingFee, currency are required for commercial use PIL.");
|
4542
|
-
}
|
4543
|
-
licenseTerms.royaltyPolicy = validateAddress(term.royaltyPolicyAddress);
|
4544
|
-
licenseTerms.defaultMintingFee = BigInt(term.defaultMintingFee);
|
4545
|
-
licenseTerms.commercialUse = true;
|
4546
|
-
licenseTerms.commercialAttribution = true;
|
4547
|
-
licenseTerms.derivativesReciprocal = false;
|
4548
|
-
licenseTerms.currency = validateAddress(term.currency);
|
4549
|
-
licenseTerms.uri = "https://github.com/piplabs/pil-document/blob/9a1f803fcf8101a8a78f1dcc929e6014e144ab56/off-chain-terms/CommercialUse.json";
|
4550
|
-
licenseTerms.derivativesAllowed = false;
|
4551
|
-
licenseTerms.derivativesAttribution = false;
|
4552
|
-
return licenseTerms;
|
4553
|
-
} else if (type === PIL_TYPE.CREATIVE_COMMONS_ATTRIBUTION) {
|
4554
|
-
if (!term || !term.royaltyPolicyAddress || !term.currency) {
|
4555
|
-
throw new Error("royaltyPolicyAddress and currency are required for creative commons attribution PIL.");
|
4556
|
-
}
|
4557
|
-
licenseTerms.royaltyPolicy = validateAddress(term.royaltyPolicyAddress);
|
4558
|
-
licenseTerms.currency = validateAddress(term.currency);
|
4559
|
-
licenseTerms.commercialUse = true;
|
4560
|
-
licenseTerms.commercialAttribution = true;
|
4561
|
-
licenseTerms.uri = "https://github.com/piplabs/pil-document/blob/998c13e6ee1d04eb817aefd1fe16dfe8be3cd7a2/off-chain-terms/CC-BY.json";
|
4562
|
-
return licenseTerms;
|
4563
|
-
} else {
|
4564
|
-
if (!term || term.defaultMintingFee === undefined || term.currency === undefined || term.commercialRevShare === undefined) {
|
4565
|
-
throw new Error("DefaultMintingFee, currency and commercialRevShare are required for commercial remix PIL.");
|
4566
|
-
}
|
4567
|
-
licenseTerms.royaltyPolicy = validateAddress(term.royaltyPolicyAddress);
|
4568
|
-
licenseTerms.defaultMintingFee = BigInt(term.defaultMintingFee);
|
4569
|
-
licenseTerms.commercialUse = true;
|
4570
|
-
licenseTerms.commercialAttribution = true;
|
4571
|
-
licenseTerms.uri = "https://github.com/piplabs/pil-document/blob/ad67bb632a310d2557f8abcccd428e4c9c798db1/off-chain-terms/CommercialRemix.json";
|
4572
|
-
licenseTerms.commercialRevShare = getRevenueShare(term.commercialRevShare);
|
4573
|
-
licenseTerms.derivativesReciprocal = true;
|
4574
|
-
licenseTerms.currency = validateAddress(term.currency);
|
4575
|
-
return licenseTerms;
|
4576
|
-
}
|
4577
|
-
};
|
4578
|
-
var validateLicenseTerms = /*#__PURE__*/function () {
|
4579
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params, rpcClient) {
|
4580
|
-
var royaltyPolicy, currency, royaltyModuleReadOnlyClient, isWhitelistedArbitrationPolicy, isWhitelistedRoyaltyToken, object;
|
4581
|
-
return _regenerator().w(function (_context) {
|
4582
|
-
while (1) switch (_context.n) {
|
4583
|
-
case 0:
|
4584
|
-
royaltyPolicy = params.royaltyPolicy, currency = params.currency;
|
4585
|
-
royaltyModuleReadOnlyClient = new RoyaltyModuleReadOnlyClient(rpcClient);
|
4586
|
-
if (!(validateAddress(royaltyPolicy) !== viem.zeroAddress)) {
|
4587
|
-
_context.n = 2;
|
4588
|
-
break;
|
4589
|
-
}
|
4590
|
-
_context.n = 1;
|
4591
|
-
return royaltyModuleReadOnlyClient.isWhitelistedRoyaltyPolicy({
|
4592
|
-
royaltyPolicy: royaltyPolicy
|
4593
|
-
});
|
4594
|
-
case 1:
|
4595
|
-
isWhitelistedArbitrationPolicy = _context.v;
|
4596
|
-
if (isWhitelistedArbitrationPolicy) {
|
4597
|
-
_context.n = 2;
|
4598
|
-
break;
|
4599
|
-
}
|
4600
|
-
throw new Error("The royalty policy is not whitelisted.");
|
4601
|
-
case 2:
|
4602
|
-
if (!(validateAddress(currency) !== viem.zeroAddress)) {
|
4603
|
-
_context.n = 4;
|
4604
|
-
break;
|
4605
|
-
}
|
4606
|
-
_context.n = 3;
|
4607
|
-
return royaltyModuleReadOnlyClient.isWhitelistedRoyaltyToken({
|
4608
|
-
token: currency
|
4609
|
-
});
|
4610
|
-
case 3:
|
4611
|
-
isWhitelistedRoyaltyToken = _context.v;
|
4612
|
-
if (isWhitelistedRoyaltyToken) {
|
4613
|
-
_context.n = 4;
|
4614
|
-
break;
|
4615
|
-
}
|
4616
|
-
throw new Error("The currency token is not whitelisted.");
|
4617
|
-
case 4:
|
4618
|
-
if (!(royaltyPolicy !== viem.zeroAddress && currency === viem.zeroAddress)) {
|
4619
|
-
_context.n = 5;
|
4620
|
-
break;
|
4621
|
-
}
|
4622
|
-
throw new Error("Royalty policy requires currency token.");
|
4623
|
-
case 5:
|
4624
|
-
object = _objectSpread2(_objectSpread2({}, params), {}, {
|
4625
|
-
defaultMintingFee: BigInt(params.defaultMintingFee),
|
4626
|
-
expiration: BigInt(params.expiration),
|
4627
|
-
commercialRevCeiling: BigInt(params.commercialRevCeiling),
|
4628
|
-
derivativeRevCeiling: BigInt(params.derivativeRevCeiling)
|
4629
|
-
});
|
4630
|
-
if (!(object.defaultMintingFee < 0)) {
|
4631
|
-
_context.n = 6;
|
4632
|
-
break;
|
4633
|
-
}
|
4634
|
-
throw new Error("DefaultMintingFee should be greater than or equal to 0.");
|
4635
|
-
case 6:
|
4636
|
-
if (!(object.defaultMintingFee > 0 && object.royaltyPolicy === viem.zeroAddress)) {
|
4637
|
-
_context.n = 7;
|
4638
|
-
break;
|
4639
|
-
}
|
4640
|
-
throw new Error("Royalty policy is required when defaultMintingFee is greater than 0.");
|
4641
|
-
case 7:
|
4642
|
-
verifyCommercialUse(object);
|
4643
|
-
verifyDerivatives(object);
|
4644
|
-
if (!(object.commercialRevShare < 0 || object.commercialRevShare > 100)) {
|
4645
|
-
_context.n = 8;
|
4646
|
-
break;
|
4647
|
-
}
|
4648
|
-
throw new Error("CommercialRevShare should be between 0 and 100.");
|
4649
|
-
case 8:
|
4650
|
-
object.commercialRevShare = object.commercialRevShare / 100 * 100000000;
|
4651
|
-
case 9:
|
4652
|
-
return _context.a(2, object);
|
4653
|
-
}
|
4654
|
-
}, _callee);
|
4655
|
-
}));
|
4656
|
-
return function validateLicenseTerms(_x, _x2) {
|
4657
|
-
return _ref.apply(this, arguments);
|
4658
|
-
};
|
4659
|
-
}();
|
4660
|
-
var verifyCommercialUse = function verifyCommercialUse(terms) {
|
4661
|
-
if (!terms.commercialUse) {
|
4662
|
-
if (terms.commercialAttribution) {
|
4663
|
-
throw new Error("Cannot add commercial attribution when commercial use is disabled.");
|
4664
|
-
}
|
4665
|
-
if (terms.commercializerChecker !== viem.zeroAddress) {
|
4666
|
-
throw new Error("Cannot add commercializerChecker when commercial use is disabled.");
|
4667
|
-
}
|
4668
|
-
if (terms.commercialRevShare > 0) {
|
4669
|
-
throw new Error("Cannot add commercial revenue share when commercial use is disabled.");
|
4670
|
-
}
|
4671
|
-
if (terms.commercialRevCeiling > 0) {
|
4672
|
-
throw new Error("Cannot add commercial revenue ceiling when commercial use is disabled.");
|
4673
|
-
}
|
4674
|
-
if (terms.derivativeRevCeiling > 0) {
|
4675
|
-
throw new Error("Cannot add derivative revenue ceiling share when commercial use is disabled.");
|
4676
|
-
}
|
4677
|
-
if (terms.royaltyPolicy !== viem.zeroAddress) {
|
4678
|
-
throw new Error("Cannot add commercial royalty policy when commercial use is disabled.");
|
4679
|
-
}
|
4680
|
-
} else {
|
4681
|
-
if (terms.royaltyPolicy === viem.zeroAddress) {
|
4682
|
-
throw new Error("Royalty policy is required when commercial use is enabled.");
|
4683
|
-
}
|
4684
|
-
}
|
4685
|
-
};
|
4686
|
-
var verifyDerivatives = function verifyDerivatives(terms) {
|
4687
|
-
if (!terms.derivativesAllowed) {
|
4688
|
-
if (terms.derivativesAttribution) {
|
4689
|
-
throw new Error("Cannot add derivative attribution when derivative use is disabled.");
|
4690
|
-
}
|
4691
|
-
if (terms.derivativesApproval) {
|
4692
|
-
throw new Error("Cannot add derivative approval when derivative use is disabled.");
|
4693
|
-
}
|
4694
|
-
if (terms.derivativesReciprocal) {
|
4695
|
-
throw new Error("Cannot add derivative reciprocal when derivative use is disabled.");
|
4696
|
-
}
|
4697
|
-
if (terms.derivativeRevCeiling > 0) {
|
4698
|
-
throw new Error("Cannot add derivative revenue ceiling when derivative use is disabled.");
|
4699
|
-
}
|
4556
|
+
/**
|
4557
|
+
* Allow custom royalty policy address or use a native royalty policy enum.
|
4558
|
+
* For custom royalty policy, @see {@link https://docs.story.foundation/concepts/royalty-module/external-royalty-policies | External Royalty Policies}
|
4559
|
+
*/
|
4560
|
+
|
4561
|
+
var royaltyPolicyInputToAddress = function royaltyPolicyInputToAddress(input, chainId) {
|
4562
|
+
var transferredChainId = chain[chainId || "aeneid"];
|
4563
|
+
var address;
|
4564
|
+
switch (input) {
|
4565
|
+
case undefined:
|
4566
|
+
case NativeRoyaltyPolicy.LAP:
|
4567
|
+
address = royaltyPolicyLapAddress[transferredChainId];
|
4568
|
+
break;
|
4569
|
+
case NativeRoyaltyPolicy.LRP:
|
4570
|
+
address = royaltyPolicyLrpAddress[transferredChainId];
|
4571
|
+
break;
|
4572
|
+
default:
|
4573
|
+
address = validateAddress(input);
|
4700
4574
|
}
|
4575
|
+
return address;
|
4701
4576
|
};
|
4702
4577
|
var getRevenueShare = function getRevenueShare(revShare) {
|
4703
4578
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RevShareType.COMMERCIAL_REVENUE_SHARE;
|
@@ -4708,7 +4583,7 @@ var getRevenueShare = function getRevenueShare(revShare) {
|
|
4708
4583
|
if (revShareNumber < 0 || revShareNumber > 100) {
|
4709
4584
|
throw new Error("".concat(type, " must be between 0 and 100."));
|
4710
4585
|
}
|
4711
|
-
return revShareNumber
|
4586
|
+
return revShareNumber * Math.pow(10, 6);
|
4712
4587
|
};
|
4713
4588
|
|
4714
4589
|
/**
|
@@ -4873,6 +4748,8 @@ var validateLicenseConfig = function validateLicenseConfig(licensingConfig) {
|
|
4873
4748
|
}
|
4874
4749
|
if (licenseConfig.expectMinimumGroupRewardShare < 0 || licenseConfig.expectMinimumGroupRewardShare > 100) {
|
4875
4750
|
throw new Error("The expectMinimumGroupRewardShare must be greater than 0 and less than 100.");
|
4751
|
+
} else {
|
4752
|
+
licenseConfig.expectMinimumGroupRewardShare = getRevenueShare(licenseConfig.expectMinimumGroupRewardShare, RevShareType.EXPECT_MINIMUM_GROUP_REWARD_SHARE);
|
4876
4753
|
}
|
4877
4754
|
if (licenseConfig.mintingFee < 0) {
|
4878
4755
|
throw new Error("The mintingFee must be greater than 0.");
|
@@ -4908,7 +4785,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
4908
4785
|
var _registerGroup = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request) {
|
4909
4786
|
var _request$txOptions, object, txHash, txReceipt, groupId, _t;
|
4910
4787
|
return _regenerator().w(function (_context) {
|
4911
|
-
while (1) switch (_context.n) {
|
4788
|
+
while (1) switch (_context.p = _context.n) {
|
4912
4789
|
case 0:
|
4913
4790
|
_context.p = 0;
|
4914
4791
|
object = {
|
@@ -4965,7 +4842,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
4965
4842
|
var _mintAndRegisterIpAndAttachLicenseAndAddToGroup = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(request) {
|
4966
4843
|
var _request$txOptions2, groupId, recipient, spgNftContract, deadline, isRegistered, ipAccount, _yield$ipAccount$stat, state, blockTimestamp, calculatedDeadline, _yield$getPermissionS, sigAddToGroupSignature, object, txHash, receipt, log, _t2;
|
4967
4844
|
return _regenerator().w(function (_context2) {
|
4968
|
-
while (1) switch (_context2.n) {
|
4845
|
+
while (1) switch (_context2.p = _context2.n) {
|
4969
4846
|
case 0:
|
4970
4847
|
_context2.p = 0;
|
4971
4848
|
groupId = request.groupId, recipient = request.recipient, spgNftContract = request.spgNftContract, deadline = request.deadline;
|
@@ -5075,7 +4952,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5075
4952
|
var _registerIpAndAttachLicenseAndAddToGroup = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
5076
4953
|
var _request$txOptions3, ipIdAddress, isRegistered, ipAccount, _yield$ipAccount$stat2, state, blockTimestamp, calculatedDeadline, _yield$getPermissionS2, sigAddToGroupSignature, _yield$getPermissionS3, sigMetadataAndAttachSignature, object, txHash, receipt, log, _t3;
|
5077
4954
|
return _regenerator().w(function (_context3) {
|
5078
|
-
while (1) switch (_context3.n) {
|
4955
|
+
while (1) switch (_context3.p = _context3.n) {
|
5079
4956
|
case 0:
|
5080
4957
|
_context3.p = 0;
|
5081
4958
|
_context3.n = 1;
|
@@ -5224,7 +5101,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5224
5101
|
var _registerGroupAndAttachLicense = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(request) {
|
5225
5102
|
var _request$txOptions4, object, txHash, txReceipt, groupId, _t4;
|
5226
5103
|
return _regenerator().w(function (_context4) {
|
5227
|
-
while (1) switch (_context4.n) {
|
5104
|
+
while (1) switch (_context4.p = _context4.n) {
|
5228
5105
|
case 0:
|
5229
5106
|
_context4.p = 0;
|
5230
5107
|
object = {
|
@@ -5277,7 +5154,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5277
5154
|
var _registerGroupAndAttachLicenseAndAddIps = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(request) {
|
5278
5155
|
var _request$txOptions5, object, i, isRegistered, _i, isAttachedLicenseTerms, txHash, txReceipt, groupId, _t5;
|
5279
5156
|
return _regenerator().w(function (_context5) {
|
5280
|
-
while (1) switch (_context5.n) {
|
5157
|
+
while (1) switch (_context5.p = _context5.n) {
|
5281
5158
|
case 0:
|
5282
5159
|
_context5.p = 0;
|
5283
5160
|
object = {
|
@@ -5380,7 +5257,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5380
5257
|
var _this = this;
|
5381
5258
|
var groupIpId, currencyTokens, memberIpIds, txOptions, collectAndClaimParams, isGroupRegistered, txHash, _yield$waitForTxRecei, receipt, collectedRoyalties, royaltiesDistributed, _t6;
|
5382
5259
|
return _regenerator().w(function (_context7) {
|
5383
|
-
while (1) switch (_context7.n) {
|
5260
|
+
while (1) switch (_context7.p = _context7.n) {
|
5384
5261
|
case 0:
|
5385
5262
|
groupIpId = _ref.groupIpId, currencyTokens = _ref.currencyTokens, memberIpIds = _ref.memberIpIds, txOptions = _ref.txOptions;
|
5386
5263
|
_context7.p = 1;
|
@@ -5520,14 +5397,14 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5520
5397
|
var _addIpsToGroup = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(_ref5) {
|
5521
5398
|
var groupIpId, ipIds, maxAllowedRewardSharePercentage, txOptions, addIpParam, txHash, _t7;
|
5522
5399
|
return _regenerator().w(function (_context8) {
|
5523
|
-
while (1) switch (_context8.n) {
|
5400
|
+
while (1) switch (_context8.p = _context8.n) {
|
5524
5401
|
case 0:
|
5525
5402
|
groupIpId = _ref5.groupIpId, ipIds = _ref5.ipIds, maxAllowedRewardSharePercentage = _ref5.maxAllowedRewardSharePercentage, txOptions = _ref5.txOptions;
|
5526
5403
|
_context8.p = 1;
|
5527
5404
|
addIpParam = {
|
5528
5405
|
groupIpId: validateAddress(groupIpId),
|
5529
5406
|
ipIds: validateAddresses(ipIds),
|
5530
|
-
maxAllowedRewardShare: BigInt(getRevenueShare(maxAllowedRewardSharePercentage
|
5407
|
+
maxAllowedRewardShare: BigInt(getRevenueShare(maxAllowedRewardSharePercentage === undefined ? 100 : maxAllowedRewardSharePercentage, RevShareType.MAX_ALLOWED_REWARD_SHARE_PERCENTAGE))
|
5531
5408
|
};
|
5532
5409
|
_context8.n = 2;
|
5533
5410
|
return this.groupingModuleClient.addIp(addIpParam);
|
@@ -5563,7 +5440,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5563
5440
|
var _getClaimableReward = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref6) {
|
5564
5441
|
var groupIpId, currencyToken, memberIpIds, claimableReward, _t8;
|
5565
5442
|
return _regenerator().w(function (_context9) {
|
5566
|
-
while (1) switch (_context9.n) {
|
5443
|
+
while (1) switch (_context9.p = _context9.n) {
|
5567
5444
|
case 0:
|
5568
5445
|
groupIpId = _ref6.groupIpId, currencyToken = _ref6.currencyToken, memberIpIds = _ref6.memberIpIds;
|
5569
5446
|
_context9.p = 1;
|
@@ -5599,7 +5476,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5599
5476
|
var _removeIpsFromGroup = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(_ref7) {
|
5600
5477
|
var groupIpId, ipIds, txOptions, removeIpParam, txHash, _t9;
|
5601
5478
|
return _regenerator().w(function (_context0) {
|
5602
|
-
while (1) switch (_context0.n) {
|
5479
|
+
while (1) switch (_context0.p = _context0.n) {
|
5603
5480
|
case 0:
|
5604
5481
|
groupIpId = _ref7.groupIpId, ipIds = _ref7.ipIds, txOptions = _ref7.txOptions;
|
5605
5482
|
_context0.p = 1;
|
@@ -5643,7 +5520,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5643
5520
|
var _claimReward = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(_ref8) {
|
5644
5521
|
var groupIpId, currencyToken, memberIpIds, txOptions, claimRewardParam, txHash, _yield$waitForTxRecei2, receipt, claimedReward, _t0;
|
5645
5522
|
return _regenerator().w(function (_context1) {
|
5646
|
-
while (1) switch (_context1.n) {
|
5523
|
+
while (1) switch (_context1.p = _context1.n) {
|
5647
5524
|
case 0:
|
5648
5525
|
groupIpId = _ref8.groupIpId, currencyToken = _ref8.currencyToken, memberIpIds = _ref8.memberIpIds, txOptions = _ref8.txOptions;
|
5649
5526
|
_context1.p = 1;
|
@@ -5702,7 +5579,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
5702
5579
|
var _collectRoyalties = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(_ref9) {
|
5703
5580
|
var groupIpId, currencyToken, txOptions, collectRoyaltiesParam, txHash, _yield$waitForTxRecei3, receipt, collectedRoyalties, _t1;
|
5704
5581
|
return _regenerator().w(function (_context10) {
|
5705
|
-
while (1) switch (_context10.n) {
|
5582
|
+
while (1) switch (_context10.p = _context10.n) {
|
5706
5583
|
case 0:
|
5707
5584
|
groupIpId = _ref9.groupIpId, currencyToken = _ref9.currencyToken, txOptions = _ref9.txOptions;
|
5708
5585
|
_context10.p = 1;
|
@@ -5787,7 +5664,7 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
5787
5664
|
var _execute = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request) {
|
5788
5665
|
var _request$txOptions, ipAccountClient, req, txHash, _t;
|
5789
5666
|
return _regenerator().w(function (_context) {
|
5790
|
-
while (1) switch (_context.n) {
|
5667
|
+
while (1) switch (_context.p = _context.n) {
|
5791
5668
|
case 0:
|
5792
5669
|
_context.p = 0;
|
5793
5670
|
ipAccountClient = new IpAccountImplClient(this.rpcClient, this.wallet, validateAddress(request.ipId));
|
@@ -5847,7 +5724,7 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
5847
5724
|
var _executeWithSig = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(request) {
|
5848
5725
|
var _request$txOptions2, ipAccountClient, req, txHash, _t2;
|
5849
5726
|
return _regenerator().w(function (_context2) {
|
5850
|
-
while (1) switch (_context2.n) {
|
5727
|
+
while (1) switch (_context2.p = _context2.n) {
|
5851
5728
|
case 0:
|
5852
5729
|
_context2.p = 0;
|
5853
5730
|
ipAccountClient = new IpAccountImplClient(this.rpcClient, this.wallet, validateAddress(request.ipId));
|
@@ -5906,7 +5783,7 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
5906
5783
|
var _getIpAccountNonce = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(ipId) {
|
5907
5784
|
var ipAccount, _yield$ipAccount$stat, state, _t3;
|
5908
5785
|
return _regenerator().w(function (_context3) {
|
5909
|
-
while (1) switch (_context3.n) {
|
5786
|
+
while (1) switch (_context3.p = _context3.n) {
|
5910
5787
|
case 0:
|
5911
5788
|
_context3.p = 0;
|
5912
5789
|
ipAccount = new IpAccountImplClient(this.rpcClient, this.wallet, validateAddress(ipId));
|
@@ -5938,7 +5815,7 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
5938
5815
|
var _getToken = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(ipId) {
|
5939
5816
|
var ipAccount, _yield$ipAccount$toke, _yield$ipAccount$toke2, chainId, tokenContract, tokenId, _t4;
|
5940
5817
|
return _regenerator().w(function (_context4) {
|
5941
|
-
while (1) switch (_context4.n) {
|
5818
|
+
while (1) switch (_context4.p = _context4.n) {
|
5942
5819
|
case 0:
|
5943
5820
|
_context4.p = 0;
|
5944
5821
|
ipAccount = new IpAccountImplClient(this.rpcClient, this.wallet, validateAddress(ipId));
|
@@ -5977,7 +5854,7 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
5977
5854
|
var _setIpMetadata = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref) {
|
5978
5855
|
var ipId, metadataURI, metadataHash, txOptions, data, _yield$this$execute, txHash, _t5;
|
5979
5856
|
return _regenerator().w(function (_context5) {
|
5980
|
-
while (1) switch (_context5.n) {
|
5857
|
+
while (1) switch (_context5.p = _context5.n) {
|
5981
5858
|
case 0:
|
5982
5859
|
ipId = _ref.ipId, metadataURI = _ref.metadataURI, metadataHash = _ref.metadataHash, txOptions = _ref.txOptions;
|
5983
5860
|
_context5.p = 1;
|
@@ -6023,7 +5900,7 @@ var IPAccountClient = /*#__PURE__*/function () {
|
|
6023
5900
|
var _this = this;
|
6024
5901
|
var ipId, tokens, txOptions, ipAccount, calls, txHash, _t6;
|
6025
5902
|
return _regenerator().w(function (_context6) {
|
6026
|
-
while (1) switch (_context6.n) {
|
5903
|
+
while (1) switch (_context6.p = _context6.n) {
|
6027
5904
|
case 0:
|
6028
5905
|
ipId = _ref2.ipId, tokens = _ref2.tokens, txOptions = _ref2.txOptions;
|
6029
5906
|
_context6.p = 1;
|
@@ -6414,6 +6291,235 @@ var generateOperationSignature = /*#__PURE__*/function () {
|
|
6414
6291
|
};
|
6415
6292
|
}();
|
6416
6293
|
|
6294
|
+
var _PILFlavor;
|
6295
|
+
var PIL_URIS = {
|
6296
|
+
NCSR: "https://github.com/piplabs/pil-document/blob/998c13e6ee1d04eb817aefd1fe16dfe8be3cd7a2/off-chain-terms/NCSR.json",
|
6297
|
+
COMMERCIAL_USE: "https://github.com/piplabs/pil-document/blob/9a1f803fcf8101a8a78f1dcc929e6014e144ab56/off-chain-terms/CommercialUse.json",
|
6298
|
+
COMMERCIAL_REMIX: "https://github.com/piplabs/pil-document/blob/ad67bb632a310d2557f8abcccd428e4c9c798db1/off-chain-terms/CommercialRemix.json",
|
6299
|
+
CC_BY: "https://github.com/piplabs/pil-document/blob/998c13e6ee1d04eb817aefd1fe16dfe8be3cd7a2/off-chain-terms/CC-BY.json"
|
6300
|
+
};
|
6301
|
+
var COMMON_DEFAULTS = {
|
6302
|
+
transferable: true,
|
6303
|
+
royaltyPolicy: viem.zeroAddress,
|
6304
|
+
defaultMintingFee: 0n,
|
6305
|
+
expiration: 0n,
|
6306
|
+
commercializerChecker: viem.zeroAddress,
|
6307
|
+
commercializerCheckerData: viem.zeroAddress,
|
6308
|
+
commercialRevShare: 0,
|
6309
|
+
commercialRevCeiling: 0n,
|
6310
|
+
derivativeRevCeiling: 0n,
|
6311
|
+
currency: viem.zeroAddress
|
6312
|
+
};
|
6313
|
+
|
6314
|
+
/**
|
6315
|
+
* Pre-configured Programmable IP License (PIL) flavors for ease of use.
|
6316
|
+
*
|
6317
|
+
* The PIL is highly configurable, but these pre-configured license terms (flavors)
|
6318
|
+
* are the most popular options that cover common use cases.
|
6319
|
+
*
|
6320
|
+
* @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors | PIL Flavors Documentation}
|
6321
|
+
*
|
6322
|
+
* @example
|
6323
|
+
* ```typescript
|
6324
|
+
* // Create a commercial use license
|
6325
|
+
* const commercialLicense = PILFlavor.commercialUse({
|
6326
|
+
* defaultMintingFee: 1000000000000000000n, // 1 IP minting fee
|
6327
|
+
* currencyToken: "0x1234...", // currency token
|
6328
|
+
* royaltyPolicy: "LAP" // royalty policy
|
6329
|
+
* });
|
6330
|
+
*
|
6331
|
+
* // Create a non-commercial social remixing license
|
6332
|
+
* const remixLicense = PILFlavor.nonCommercialSocialRemixing();
|
6333
|
+
* ```
|
6334
|
+
*/
|
6335
|
+
var PILFlavor = /*#__PURE__*/_createClass(function PILFlavor() {
|
6336
|
+
_classCallCheck(this, PILFlavor);
|
6337
|
+
});
|
6338
|
+
_PILFlavor = PILFlavor;
|
6339
|
+
_defineProperty(PILFlavor, "_nonComSocialRemixingPIL", _objectSpread2(_objectSpread2({}, COMMON_DEFAULTS), {}, {
|
6340
|
+
commercialUse: false,
|
6341
|
+
commercialAttribution: false,
|
6342
|
+
derivativesAllowed: true,
|
6343
|
+
derivativesAttribution: true,
|
6344
|
+
derivativesApproval: false,
|
6345
|
+
derivativesReciprocal: true,
|
6346
|
+
uri: PIL_URIS.NCSR
|
6347
|
+
}));
|
6348
|
+
_defineProperty(PILFlavor, "_commercialUse", _objectSpread2(_objectSpread2({}, COMMON_DEFAULTS), {}, {
|
6349
|
+
commercialUse: true,
|
6350
|
+
commercialAttribution: true,
|
6351
|
+
derivativesAllowed: false,
|
6352
|
+
derivativesAttribution: false,
|
6353
|
+
derivativesApproval: false,
|
6354
|
+
derivativesReciprocal: false,
|
6355
|
+
uri: PIL_URIS.COMMERCIAL_USE
|
6356
|
+
}));
|
6357
|
+
_defineProperty(PILFlavor, "_commercialRemix", _objectSpread2(_objectSpread2({}, COMMON_DEFAULTS), {}, {
|
6358
|
+
commercialUse: true,
|
6359
|
+
commercialAttribution: true,
|
6360
|
+
derivativesAllowed: true,
|
6361
|
+
derivativesAttribution: true,
|
6362
|
+
derivativesApproval: false,
|
6363
|
+
derivativesReciprocal: true,
|
6364
|
+
uri: PIL_URIS.COMMERCIAL_REMIX
|
6365
|
+
}));
|
6366
|
+
_defineProperty(PILFlavor, "_creativeCommonsAttribution", _objectSpread2(_objectSpread2({}, COMMON_DEFAULTS), {}, {
|
6367
|
+
commercialUse: true,
|
6368
|
+
commercialAttribution: true,
|
6369
|
+
derivativesAllowed: true,
|
6370
|
+
derivativesAttribution: true,
|
6371
|
+
derivativesApproval: false,
|
6372
|
+
derivativesReciprocal: true,
|
6373
|
+
uri: PIL_URIS.CC_BY
|
6374
|
+
}));
|
6375
|
+
/**
|
6376
|
+
* Gets the values to create a Non-Commercial Social Remixing license terms flavor.
|
6377
|
+
* @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#non-commercial-social-remixing | Non Commercial Social Remixing}
|
6378
|
+
*/
|
6379
|
+
_defineProperty(PILFlavor, "nonCommercialSocialRemixing", function (request) {
|
6380
|
+
return _PILFlavor.validateLicenseTerms(_objectSpread2(_objectSpread2({}, _PILFlavor._nonComSocialRemixingPIL), request === null || request === void 0 ? void 0 : request.override), request === null || request === void 0 ? void 0 : request.chainId);
|
6381
|
+
});
|
6382
|
+
/**
|
6383
|
+
* Gets the values to create a Commercial Use license terms flavor.
|
6384
|
+
* @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#commercial-use | Commercial Use}
|
6385
|
+
*/
|
6386
|
+
_defineProperty(PILFlavor, "commercialUse", function (_ref) {
|
6387
|
+
var defaultMintingFee = _ref.defaultMintingFee,
|
6388
|
+
currency = _ref.currency,
|
6389
|
+
royaltyPolicy = _ref.royaltyPolicy,
|
6390
|
+
chainId = _ref.chainId,
|
6391
|
+
override = _ref.override;
|
6392
|
+
return _PILFlavor.validateLicenseTerms(_objectSpread2(_objectSpread2({}, _PILFlavor._commercialUse), {}, {
|
6393
|
+
defaultMintingFee: defaultMintingFee,
|
6394
|
+
currency: currency,
|
6395
|
+
royaltyPolicy: royaltyPolicy
|
6396
|
+
}, override), chainId);
|
6397
|
+
});
|
6398
|
+
/**
|
6399
|
+
* Gets the values to create a Commercial Remixing license terms flavor.
|
6400
|
+
* @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#commercial-remix | Commercial Remix}
|
6401
|
+
*/
|
6402
|
+
_defineProperty(PILFlavor, "commercialRemix", function (_ref2) {
|
6403
|
+
var defaultMintingFee = _ref2.defaultMintingFee,
|
6404
|
+
royaltyPolicy = _ref2.royaltyPolicy,
|
6405
|
+
currency = _ref2.currency,
|
6406
|
+
commercialRevShare = _ref2.commercialRevShare,
|
6407
|
+
chainId = _ref2.chainId,
|
6408
|
+
override = _ref2.override;
|
6409
|
+
return _PILFlavor.validateLicenseTerms(_objectSpread2(_objectSpread2({}, _PILFlavor._commercialRemix), {}, {
|
6410
|
+
commercialRevShare: commercialRevShare,
|
6411
|
+
defaultMintingFee: defaultMintingFee,
|
6412
|
+
currency: currency,
|
6413
|
+
royaltyPolicy: royaltyPolicy
|
6414
|
+
}, override), chainId);
|
6415
|
+
});
|
6416
|
+
/**
|
6417
|
+
* Gets the values to create a Creative Commons Attribution (CC-BY) license terms flavor.
|
6418
|
+
* @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#creative-commons-attribution | Creative Commons Attribution}
|
6419
|
+
*/
|
6420
|
+
_defineProperty(PILFlavor, "creativeCommonsAttribution", function (_ref3) {
|
6421
|
+
var royaltyPolicy = _ref3.royaltyPolicy,
|
6422
|
+
currency = _ref3.currency,
|
6423
|
+
chainId = _ref3.chainId,
|
6424
|
+
override = _ref3.override;
|
6425
|
+
return _PILFlavor.validateLicenseTerms(_objectSpread2(_objectSpread2({}, _PILFlavor._creativeCommonsAttribution), {}, {
|
6426
|
+
currency: currency,
|
6427
|
+
royaltyPolicy: royaltyPolicy
|
6428
|
+
}, override), chainId);
|
6429
|
+
});
|
6430
|
+
_defineProperty(PILFlavor, "validateLicenseTerms", function (params, chainId) {
|
6431
|
+
var normalized = _objectSpread2(_objectSpread2({}, params), {}, {
|
6432
|
+
defaultMintingFee: BigInt(params.defaultMintingFee),
|
6433
|
+
expiration: BigInt(params.expiration),
|
6434
|
+
commercialRevCeiling: BigInt(params.commercialRevCeiling),
|
6435
|
+
derivativeRevCeiling: BigInt(params.derivativeRevCeiling),
|
6436
|
+
royaltyPolicy: royaltyPolicyInputToAddress(params.royaltyPolicy, chainId)
|
6437
|
+
});
|
6438
|
+
var royaltyPolicy = normalized.royaltyPolicy,
|
6439
|
+
currency = normalized.currency;
|
6440
|
+
|
6441
|
+
// Validate royalty policy and currency relationship
|
6442
|
+
if (royaltyPolicy !== viem.zeroAddress && currency === viem.zeroAddress) {
|
6443
|
+
throw new PILFlavorError("Royalty policy requires currency token.");
|
6444
|
+
}
|
6445
|
+
|
6446
|
+
// Validate defaultMintingFee
|
6447
|
+
if (normalized.defaultMintingFee < 0n) {
|
6448
|
+
throw new PILFlavorError("DefaultMintingFee should be greater than or equal to 0.");
|
6449
|
+
}
|
6450
|
+
if (normalized.defaultMintingFee > 0n && normalized.royaltyPolicy === viem.zeroAddress) {
|
6451
|
+
throw new PILFlavorError("Royalty policy is required when defaultMintingFee is greater than 0.");
|
6452
|
+
}
|
6453
|
+
|
6454
|
+
// Validate commercial use and derivatives
|
6455
|
+
_PILFlavor.verifyCommercialUse(normalized);
|
6456
|
+
_PILFlavor.verifyDerivatives(normalized);
|
6457
|
+
|
6458
|
+
// Validate and normalize commercialRevShare
|
6459
|
+
normalized.commercialRevShare = getRevenueShare(normalized.commercialRevShare);
|
6460
|
+
return normalized;
|
6461
|
+
});
|
6462
|
+
_defineProperty(PILFlavor, "verifyCommercialUse", function (terms) {
|
6463
|
+
if (!terms.commercialUse) {
|
6464
|
+
var commercialFields = [{
|
6465
|
+
field: "commercialAttribution",
|
6466
|
+
value: terms.commercialAttribution
|
6467
|
+
}, {
|
6468
|
+
field: "commercializerChecker",
|
6469
|
+
value: terms.commercializerChecker !== viem.zeroAddress
|
6470
|
+
}, {
|
6471
|
+
field: "commercialRevShare",
|
6472
|
+
value: terms.commercialRevShare > 0
|
6473
|
+
}, {
|
6474
|
+
field: "commercialRevCeiling",
|
6475
|
+
value: terms.commercialRevCeiling > 0n
|
6476
|
+
}, {
|
6477
|
+
field: "derivativeRevCeiling",
|
6478
|
+
value: terms.derivativeRevCeiling > 0n
|
6479
|
+
}, {
|
6480
|
+
field: "royaltyPolicy",
|
6481
|
+
value: terms.royaltyPolicy !== viem.zeroAddress
|
6482
|
+
}];
|
6483
|
+
for (var _i = 0, _commercialFields = commercialFields; _i < _commercialFields.length; _i++) {
|
6484
|
+
var _commercialFields$_i = _commercialFields[_i],
|
6485
|
+
field = _commercialFields$_i.field,
|
6486
|
+
value = _commercialFields$_i.value;
|
6487
|
+
if (value) {
|
6488
|
+
throw new PILFlavorError("Cannot add ".concat(field, " when commercial use is disabled."));
|
6489
|
+
}
|
6490
|
+
}
|
6491
|
+
} else {
|
6492
|
+
if (terms.royaltyPolicy === viem.zeroAddress) {
|
6493
|
+
throw new PILFlavorError("Royalty policy is required when commercial use is enabled.");
|
6494
|
+
}
|
6495
|
+
}
|
6496
|
+
});
|
6497
|
+
_defineProperty(PILFlavor, "verifyDerivatives", function (terms) {
|
6498
|
+
if (!terms.derivativesAllowed) {
|
6499
|
+
var derivativeFields = [{
|
6500
|
+
field: "derivativesAttribution",
|
6501
|
+
value: terms.derivativesAttribution
|
6502
|
+
}, {
|
6503
|
+
field: "derivativesApproval",
|
6504
|
+
value: terms.derivativesApproval
|
6505
|
+
}, {
|
6506
|
+
field: "derivativesReciprocal",
|
6507
|
+
value: terms.derivativesReciprocal
|
6508
|
+
}, {
|
6509
|
+
field: "derivativeRevCeiling",
|
6510
|
+
value: terms.derivativeRevCeiling > 0n
|
6511
|
+
}];
|
6512
|
+
for (var _i2 = 0, _derivativeFields = derivativeFields; _i2 < _derivativeFields.length; _i2++) {
|
6513
|
+
var _derivativeFields$_i = _derivativeFields[_i2],
|
6514
|
+
field = _derivativeFields$_i.field,
|
6515
|
+
value = _derivativeFields$_i.value;
|
6516
|
+
if (value) {
|
6517
|
+
throw new PILFlavorError("Cannot add ".concat(field, " when derivative use is disabled."));
|
6518
|
+
}
|
6519
|
+
}
|
6520
|
+
}
|
6521
|
+
});
|
6522
|
+
|
6417
6523
|
function _regeneratorValues(e) {
|
6418
6524
|
if (null != e) {
|
6419
6525
|
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
@@ -6462,7 +6568,7 @@ var getPublicMinting = /*#__PURE__*/function () {
|
|
6462
6568
|
}();
|
6463
6569
|
var validateLicenseTermsData = /*#__PURE__*/function () {
|
6464
6570
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(licenseTermsData, rpcClient, chainId) {
|
6465
|
-
var licenseTerms, processedLicenseTermsData, maxLicenseTokens, i, licenseTerm, licensingConfig, maxLicenseTokensValue;
|
6571
|
+
var licenseTerms, processedLicenseTermsData, maxLicenseTokens, i, licenseTerm, royaltyModuleReadOnlyClient, isWhitelistedArbitrationPolicy, isWhitelistedRoyaltyToken, licensingConfig, maxLicenseTokensValue;
|
6466
6572
|
return _regenerator().w(function (_context2) {
|
6467
6573
|
while (1) switch (_context2.n) {
|
6468
6574
|
case 0:
|
@@ -6472,44 +6578,74 @@ var validateLicenseTermsData = /*#__PURE__*/function () {
|
|
6472
6578
|
i = 0;
|
6473
6579
|
case 1:
|
6474
6580
|
if (!(i < licenseTermsData.length)) {
|
6475
|
-
_context2.n =
|
6581
|
+
_context2.n = 10;
|
6582
|
+
break;
|
6583
|
+
}
|
6584
|
+
licenseTerm = PILFlavor.validateLicenseTerms(licenseTermsData[i].terms, chainId);
|
6585
|
+
royaltyModuleReadOnlyClient = new RoyaltyModuleReadOnlyClient(rpcClient);
|
6586
|
+
if (!(validateAddress(licenseTerm.royaltyPolicy) !== viem.zeroAddress)) {
|
6587
|
+
_context2.n = 3;
|
6476
6588
|
break;
|
6477
6589
|
}
|
6478
6590
|
_context2.n = 2;
|
6479
|
-
return
|
6591
|
+
return royaltyModuleReadOnlyClient.isWhitelistedRoyaltyPolicy({
|
6592
|
+
royaltyPolicy: licenseTerm.royaltyPolicy
|
6593
|
+
});
|
6480
6594
|
case 2:
|
6481
|
-
|
6595
|
+
isWhitelistedArbitrationPolicy = _context2.v;
|
6596
|
+
if (isWhitelistedArbitrationPolicy) {
|
6597
|
+
_context2.n = 3;
|
6598
|
+
break;
|
6599
|
+
}
|
6600
|
+
throw new Error("The royalty policy ".concat(licenseTerm.royaltyPolicy, " is not whitelisted."));
|
6601
|
+
case 3:
|
6602
|
+
if (!(validateAddress(licenseTerm.currency) !== viem.zeroAddress)) {
|
6603
|
+
_context2.n = 5;
|
6604
|
+
break;
|
6605
|
+
}
|
6606
|
+
_context2.n = 4;
|
6607
|
+
return royaltyModuleReadOnlyClient.isWhitelistedRoyaltyToken({
|
6608
|
+
token: licenseTerm.currency
|
6609
|
+
});
|
6610
|
+
case 4:
|
6611
|
+
isWhitelistedRoyaltyToken = _context2.v;
|
6612
|
+
if (isWhitelistedRoyaltyToken) {
|
6613
|
+
_context2.n = 5;
|
6614
|
+
break;
|
6615
|
+
}
|
6616
|
+
throw new Error("The currency token ".concat(licenseTerm.currency, " is not whitelisted."));
|
6617
|
+
case 5:
|
6482
6618
|
licensingConfig = validateLicenseConfig(licenseTermsData[i].licensingConfig);
|
6483
6619
|
if (!(licensingConfig.mintingFee > 0 && licenseTerm.royaltyPolicy === viem.zeroAddress)) {
|
6484
|
-
_context2.n =
|
6620
|
+
_context2.n = 6;
|
6485
6621
|
break;
|
6486
6622
|
}
|
6487
6623
|
throw new Error("A royalty policy must be provided when the minting fee is greater than 0.");
|
6488
|
-
case
|
6624
|
+
case 6:
|
6489
6625
|
maxLicenseTokensValue = licenseTermsData[i].maxLicenseTokens;
|
6490
6626
|
if (!(maxLicenseTokensValue !== undefined)) {
|
6491
|
-
_context2.n =
|
6627
|
+
_context2.n = 8;
|
6492
6628
|
break;
|
6493
6629
|
}
|
6494
6630
|
if (!(maxLicenseTokensValue < 0)) {
|
6495
|
-
_context2.n =
|
6631
|
+
_context2.n = 7;
|
6496
6632
|
break;
|
6497
6633
|
}
|
6498
6634
|
throw new Error("The max license tokens must be greater than or equal to 0.");
|
6499
|
-
case
|
6635
|
+
case 7:
|
6500
6636
|
licensingConfig.licensingHook = totalLicenseTokenLimitHookAddress[chainId];
|
6501
6637
|
maxLicenseTokens[i] = BigInt(maxLicenseTokensValue);
|
6502
|
-
case
|
6638
|
+
case 8:
|
6503
6639
|
licenseTerms.push(licenseTerm);
|
6504
6640
|
processedLicenseTermsData.push({
|
6505
6641
|
terms: licenseTerm,
|
6506
6642
|
licensingConfig: licensingConfig
|
6507
6643
|
});
|
6508
|
-
case
|
6644
|
+
case 9:
|
6509
6645
|
i++;
|
6510
6646
|
_context2.n = 1;
|
6511
6647
|
break;
|
6512
|
-
case
|
6648
|
+
case 10:
|
6513
6649
|
return _context2.a(2, {
|
6514
6650
|
licenseTerms: licenseTerms,
|
6515
6651
|
licenseTermsData: processedLicenseTermsData,
|
@@ -6565,8 +6701,8 @@ var validateDerivativeData = /*#__PURE__*/function () {
|
|
6565
6701
|
licenseTemplate: validateAddress(derivativeDataInput.licenseTemplate || licenseTemplateAddress),
|
6566
6702
|
royaltyContext: viem.zeroAddress,
|
6567
6703
|
maxMintingFee: BigInt(derivativeDataInput.maxMintingFee || 0),
|
6568
|
-
maxRts: Number(derivativeDataInput.maxRts
|
6569
|
-
maxRevenueShare: getRevenueShare(derivativeDataInput.maxRevenueShare
|
6704
|
+
maxRts: Number(derivativeDataInput.maxRts === undefined ? MAX_ROYALTY_TOKEN : derivativeDataInput.maxRts),
|
6705
|
+
maxRevenueShare: getRevenueShare(derivativeDataInput.maxRevenueShare === undefined ? 100 : derivativeDataInput.maxRevenueShare, RevShareType.MAX_REVENUE_SHARE)
|
6570
6706
|
};
|
6571
6707
|
if (!(derivativeData.parentIpIds.length === 0)) {
|
6572
6708
|
_context3.n = 1;
|
@@ -6724,17 +6860,41 @@ var mergeSpenders = function mergeSpenders(previousSpenders, newSpenders) {
|
|
6724
6860
|
return acc;
|
6725
6861
|
}, _toConsumableArray(previousSpenders));
|
6726
6862
|
};
|
6727
|
-
|
6728
|
-
|
6729
|
-
|
6730
|
-
|
6731
|
-
|
6732
|
-
|
6733
|
-
|
6734
|
-
|
6735
|
-
|
6736
|
-
|
6737
|
-
|
6863
|
+
var hasMinterRole = /*#__PURE__*/function () {
|
6864
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(spgNftContract, rpcClient, walletAddress) {
|
6865
|
+
var spgNftContractImpl, minterRole;
|
6866
|
+
return _regenerator().w(function (_context6) {
|
6867
|
+
while (1) switch (_context6.n) {
|
6868
|
+
case 0:
|
6869
|
+
spgNftContractImpl = new SpgnftImplReadOnlyClient(rpcClient, spgNftContract);
|
6870
|
+
minterRole = viem.toHex(1, {
|
6871
|
+
size: 32
|
6872
|
+
});
|
6873
|
+
_context6.n = 1;
|
6874
|
+
return spgNftContractImpl.hasRole({
|
6875
|
+
role: minterRole,
|
6876
|
+
account: walletAddress
|
6877
|
+
});
|
6878
|
+
case 1:
|
6879
|
+
return _context6.a(2, _context6.v);
|
6880
|
+
}
|
6881
|
+
}, _callee6);
|
6882
|
+
}));
|
6883
|
+
return function hasMinterRole(_x0, _x1, _x10) {
|
6884
|
+
return _ref8.apply(this, arguments);
|
6885
|
+
};
|
6886
|
+
}();
|
6887
|
+
|
6888
|
+
/**
|
6889
|
+
* Aggregates the registration requests for the given workflow responses.
|
6890
|
+
*
|
6891
|
+
* This function combines multiple workflow responses into a consolidated request structure,
|
6892
|
+
* aggregating:
|
6893
|
+
* - Token spenders and their allowances
|
6894
|
+
* - Total fees required for all operations
|
6895
|
+
* - Encoded transaction data
|
6896
|
+
* - Contract calls to be executed
|
6897
|
+
*
|
6738
6898
|
* @remarks
|
6739
6899
|
* The function handles two execution modes:
|
6740
6900
|
* 1. If `disableMulticallWhenPossible` is true or a workflow response supports multicall3
|
@@ -6819,7 +6979,7 @@ var handleMulticall = /*#__PURE__*/function () {
|
|
6819
6979
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
6820
6980
|
var txHashes, _iterator2, _step2, call, txHash, _t;
|
6821
6981
|
return _regenerator().w(function (_context) {
|
6822
|
-
while (1) switch (_context.n) {
|
6982
|
+
while (1) switch (_context.p = _context.n) {
|
6823
6983
|
case 0:
|
6824
6984
|
txHashes = [];
|
6825
6985
|
_iterator2 = _createForOfIteratorHelper(contractCall);
|
@@ -7748,7 +7908,7 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
7748
7908
|
var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref19) {
|
7749
7909
|
var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId, results, _iterator, _step, _loop, _t;
|
7750
7910
|
return _regenerator().w(function (_context0) {
|
7751
|
-
while (1) switch (_context0.n) {
|
7911
|
+
while (1) switch (_context0.p = _context0.n) {
|
7752
7912
|
case 0:
|
7753
7913
|
royaltyDistributionRequests = _ref19.royaltyDistributionRequests, ipRegisteredLog = _ref19.ipRegisteredLog, ipRoyaltyVault = _ref19.ipRoyaltyVault, rpcClient = _ref19.rpcClient, wallet = _ref19.wallet, chainId = _ref19.chainId;
|
7754
7914
|
if (!(royaltyDistributionRequests.length === 0)) {
|
@@ -7880,7 +8040,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
7880
8040
|
var _register = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request) {
|
7881
8041
|
var _request$txOptions, tokenId, ipIdAddress, isRegistered, object, calculatedDeadline, signature, txHash, txReceipt, log, _t;
|
7882
8042
|
return _regenerator().w(function (_context) {
|
7883
|
-
while (1) switch (_context.n) {
|
8043
|
+
while (1) switch (_context.p = _context.n) {
|
7884
8044
|
case 0:
|
7885
8045
|
_context.p = 0;
|
7886
8046
|
tokenId = BigInt(request.tokenId);
|
@@ -8023,7 +8183,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8023
8183
|
var _this = this;
|
8024
8184
|
var contracts, spgContracts, encodedTxData, _iterator, _step, arg, result, spgTxHash, txHash, results, processTransaction, _t2, _t3, _t4;
|
8025
8185
|
return _regenerator().w(function (_context3) {
|
8026
|
-
while (1) switch (_context3.n) {
|
8186
|
+
while (1) switch (_context3.p = _context3.n) {
|
8027
8187
|
case 0:
|
8028
8188
|
_context3.p = 0;
|
8029
8189
|
contracts = [];
|
@@ -8170,7 +8330,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8170
8330
|
var _this2 = this;
|
8171
8331
|
var _request$txOptions2, isChildIpIdRegistered, derivativeData, object, encodedTxData, _request$options, contractCall, _t5;
|
8172
8332
|
return _regenerator().w(function (_context4) {
|
8173
|
-
while (1) switch (_context4.n) {
|
8333
|
+
while (1) switch (_context4.p = _context4.n) {
|
8174
8334
|
case 0:
|
8175
8335
|
_context4.p = 0;
|
8176
8336
|
_context4.n = 1;
|
@@ -8245,7 +8405,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8245
8405
|
var _batchRegisterDerivative = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(request) {
|
8246
8406
|
var contracts, licenseModuleAddress, _iterator2, _step2, arg, calculatedDeadline, ipAccount, data, _yield$ipAccount$stat, state, signature, txHash, _t6, _t7, _t8;
|
8247
8407
|
return _regenerator().w(function (_context5) {
|
8248
|
-
while (1) switch (_context5.n) {
|
8408
|
+
while (1) switch (_context5.p = _context5.n) {
|
8249
8409
|
case 0:
|
8250
8410
|
_context5.p = 0;
|
8251
8411
|
contracts = [];
|
@@ -8284,7 +8444,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8284
8444
|
functionName: "registerDerivative",
|
8285
8445
|
args: [arg.childIpId, arg.parentIpIds, arg.licenseTermsIds.map(function (id) {
|
8286
8446
|
return BigInt(id);
|
8287
|
-
}), arg.licenseTemplate || this.licenseTemplateClient.address, viem.zeroAddress, BigInt(arg.maxMintingFee || 0), Number(arg.maxRts
|
8447
|
+
}), arg.licenseTemplate || this.licenseTemplateClient.address, viem.zeroAddress, BigInt(arg.maxMintingFee || 0), Number(arg.maxRts === undefined ? MAX_ROYALTY_TOKEN : arg.maxRts), getRevenueShare(arg.maxRevenueShare === undefined ? 100 : arg.maxRevenueShare, RevShareType.MAX_REVENUE_SHARE)]
|
8288
8448
|
});
|
8289
8449
|
_context5.n = 8;
|
8290
8450
|
return ipAccount.state();
|
@@ -8365,7 +8525,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8365
8525
|
var _registerDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(request) {
|
8366
8526
|
var _request$txOptions3, req, isChildIpIdRegistered, txHash, _t9;
|
8367
8527
|
return _regenerator().w(function (_context6) {
|
8368
|
-
while (1) switch (_context6.n) {
|
8528
|
+
while (1) switch (_context6.p = _context6.n) {
|
8369
8529
|
case 0:
|
8370
8530
|
_context6.p = 0;
|
8371
8531
|
req = {
|
@@ -8447,7 +8607,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8447
8607
|
var _this3 = this;
|
8448
8608
|
var _request$txOptions4, _request$options2, _yield$validateLicens, licenseTerms, _yield$transformRegis, transformRequest, encodedTxData, contractCall, rsp, computedLicenseTermsIds, maxLicenseTokensTxHashes, _t0;
|
8449
8609
|
return _regenerator().w(function (_context7) {
|
8450
|
-
while (1) switch (_context7.n) {
|
8610
|
+
while (1) switch (_context7.p = _context7.n) {
|
8451
8611
|
case 0:
|
8452
8612
|
_context7.p = 0;
|
8453
8613
|
_context7.n = 1;
|
@@ -8530,7 +8690,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8530
8690
|
var _batchMintAndRegisterIpAssetWithPilTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(request) {
|
8531
8691
|
var calldata, _iterator3, _step3, arg, result, txHash, txReceipt, results, j, licenseTerms, licenseTermsData, i, licenseTerm, licenseTermsIds, maxLicenseTokensTxHashes, _t1, _t10;
|
8532
8692
|
return _regenerator().w(function (_context8) {
|
8533
|
-
while (1) switch (_context8.n) {
|
8693
|
+
while (1) switch (_context8.p = _context8.n) {
|
8534
8694
|
case 0:
|
8535
8695
|
_context8.p = 0;
|
8536
8696
|
calldata = [];
|
@@ -8590,58 +8750,46 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8590
8750
|
j = 0;
|
8591
8751
|
case 11:
|
8592
8752
|
if (!(j < request.args.length)) {
|
8593
|
-
_context8.n =
|
8753
|
+
_context8.n = 15;
|
8594
8754
|
break;
|
8595
8755
|
}
|
8596
8756
|
licenseTerms = [];
|
8597
8757
|
licenseTermsData = request.args[j].licenseTermsData;
|
8598
|
-
i = 0;
|
8599
|
-
|
8600
|
-
|
8601
|
-
_context8.n = 15;
|
8602
|
-
break;
|
8758
|
+
for (i = 0; i < licenseTermsData.length; i++) {
|
8759
|
+
licenseTerm = PILFlavor.validateLicenseTerms(licenseTermsData[i].terms, this.chainId);
|
8760
|
+
licenseTerms.push(licenseTerm);
|
8603
8761
|
}
|
8604
|
-
_context8.n = 13;
|
8605
|
-
return validateLicenseTerms(licenseTermsData[i].terms, this.rpcClient);
|
8606
|
-
case 13:
|
8607
|
-
licenseTerm = _context8.v;
|
8608
|
-
licenseTerms.push(licenseTerm);
|
8609
|
-
case 14:
|
8610
|
-
i++;
|
8611
8762
|
_context8.n = 12;
|
8612
|
-
break;
|
8613
|
-
case 15:
|
8614
|
-
_context8.n = 16;
|
8615
8763
|
return this.getLicenseTermsId(licenseTerms);
|
8616
|
-
case
|
8764
|
+
case 12:
|
8617
8765
|
licenseTermsIds = _context8.v;
|
8618
8766
|
results[j].licenseTermsIds = licenseTermsIds;
|
8619
|
-
_context8.n =
|
8767
|
+
_context8.n = 13;
|
8620
8768
|
return this.setMaxLicenseTokens({
|
8621
8769
|
maxLicenseTokensData: licenseTermsData,
|
8622
8770
|
licensorIpId: results[j].ipId,
|
8623
8771
|
licenseTermsIds: licenseTermsIds
|
8624
8772
|
});
|
8625
|
-
case
|
8773
|
+
case 13:
|
8626
8774
|
maxLicenseTokensTxHashes = _context8.v;
|
8627
8775
|
if (maxLicenseTokensTxHashes.length > 0) {
|
8628
8776
|
results[j].maxLicenseTokensTxHashes = maxLicenseTokensTxHashes;
|
8629
8777
|
}
|
8630
|
-
case
|
8778
|
+
case 14:
|
8631
8779
|
j++;
|
8632
8780
|
_context8.n = 11;
|
8633
8781
|
break;
|
8634
|
-
case
|
8782
|
+
case 15:
|
8635
8783
|
return _context8.a(2, {
|
8636
8784
|
txHash: txHash,
|
8637
8785
|
results: results
|
8638
8786
|
});
|
8639
|
-
case
|
8640
|
-
_context8.p =
|
8787
|
+
case 16:
|
8788
|
+
_context8.p = 16;
|
8641
8789
|
_t10 = _context8.v;
|
8642
8790
|
return _context8.a(2, handleError(_t10, "Failed to batch mint and register IP and attach PIL terms"));
|
8643
8791
|
}
|
8644
|
-
}, _callee8, this, [[1, 6, 7, 8], [0,
|
8792
|
+
}, _callee8, this, [[1, 6, 7, 8], [0, 16]]);
|
8645
8793
|
}));
|
8646
8794
|
function batchMintAndRegisterIpAssetWithPilTerms(_x9) {
|
8647
8795
|
return _batchMintAndRegisterIpAssetWithPilTerms.apply(this, arguments);
|
@@ -8660,7 +8808,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8660
8808
|
var _registerIpAndAttachPilTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(request) {
|
8661
8809
|
var _request$txOptions5, ipIdAddress, isRegistered, _yield$validateLicens2, licenseTerms, _yield$transformRegis2, _transformRequest, txHash, txReceipt, log, licenseTermsIds, maxLicenseTokensTxHashes, _t11;
|
8662
8810
|
return _regenerator().w(function (_context9) {
|
8663
|
-
while (1) switch (_context9.n) {
|
8811
|
+
while (1) switch (_context9.p = _context9.n) {
|
8664
8812
|
case 0:
|
8665
8813
|
_context9.p = 0;
|
8666
8814
|
request.tokenId = BigInt(request.tokenId);
|
@@ -8766,7 +8914,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8766
8914
|
var _this4 = this;
|
8767
8915
|
var _request$txOptions6, _request$options3, tokenId, ipIdAddress, isRegistered, _yield$transformRegis3, _transformRequest2, encodedTxData, contractCall, _t12;
|
8768
8916
|
return _regenerator().w(function (_context0) {
|
8769
|
-
while (1) switch (_context0.n) {
|
8917
|
+
while (1) switch (_context0.p = _context0.n) {
|
8770
8918
|
case 0:
|
8771
8919
|
_context0.p = 0;
|
8772
8920
|
tokenId = BigInt(request.tokenId);
|
@@ -8848,7 +8996,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8848
8996
|
var _this5 = this;
|
8849
8997
|
var _request$txOptions7, _request$options4, spgNftContract, _yield$transformRegis4, _transformRequest3, encodedTxData, contractCall, _t13;
|
8850
8998
|
return _regenerator().w(function (_context1) {
|
8851
|
-
while (1) switch (_context1.n) {
|
8999
|
+
while (1) switch (_context1.p = _context1.n) {
|
8852
9000
|
case 0:
|
8853
9001
|
_context1.p = 0;
|
8854
9002
|
spgNftContract = validateAddress(request.spgNftContract);
|
@@ -8908,7 +9056,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8908
9056
|
var _batchMintAndRegisterIpAndMakeDerivative = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(request) {
|
8909
9057
|
var calldata, _iterator4, _step4, arg, result, txHash, txReceipt, _t14, _t15, _t16;
|
8910
9058
|
return _regenerator().w(function (_context10) {
|
8911
|
-
while (1) switch (_context10.n) {
|
9059
|
+
while (1) switch (_context10.p = _context10.n) {
|
8912
9060
|
case 0:
|
8913
9061
|
_context10.p = 0;
|
8914
9062
|
calldata = [];
|
@@ -8993,7 +9141,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
8993
9141
|
var _this6 = this;
|
8994
9142
|
var _request$txOptions8, _request$options5, _object, encodedTxData, contractCall, _t17;
|
8995
9143
|
return _regenerator().w(function (_context11) {
|
8996
|
-
while (1) switch (_context11.n) {
|
9144
|
+
while (1) switch (_context11.p = _context11.n) {
|
8997
9145
|
case 0:
|
8998
9146
|
_context11.p = 0;
|
8999
9147
|
_object = {
|
@@ -9037,6 +9185,241 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9037
9185
|
}
|
9038
9186
|
return mintAndRegisterIp;
|
9039
9187
|
}()
|
9188
|
+
/**
|
9189
|
+
* Batch mints NFTs from SPGNFT collections and registers them as IP assets.
|
9190
|
+
*
|
9191
|
+
* Optimizes transaction processing by grouping requests and automatically selecting the most efficient multicall strategy:
|
9192
|
+
* - Uses `multicall3` for public minting contracts.
|
9193
|
+
* - Uses `SPG's multicall` for private minting contracts.
|
9194
|
+
*
|
9195
|
+
* @remark
|
9196
|
+
* For private minting, verifies the `caller` has the `minter role` and avoids `multicall3` batching to ensure correct `msg.sender`.
|
9197
|
+
*
|
9198
|
+
* Automatically manages minting fees, including wrapping IP tokens into WIP tokens if balances are insufficient, and checks or sets allowances for all spenders as needed.
|
9199
|
+
* The `multicall` and token handling behavior can be configured via `wipOptions`.
|
9200
|
+
*
|
9201
|
+
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
9202
|
+
*/
|
9203
|
+
)
|
9204
|
+
}, {
|
9205
|
+
key: "batchMintAndRegisterIp",
|
9206
|
+
value: (function () {
|
9207
|
+
var _batchMintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(request) {
|
9208
|
+
var _this7 = this;
|
9209
|
+
var publicMintEncodedTxs, publicMintSpenders, privateMintEncodedTxs, privateMintSpenders, publicMintFeesTotal, privateMintFeesTotal, _iterator5, _step5, req, registrationRequest, isPublicMinting, nftMintFee, encodeTx, isMinterRole, handlePublicMintTransactions, handlePrivateMintTransactions, transactionResponses, publicMintResponse, privateMintResponse, _t18, _t19, _t20, _t21;
|
9210
|
+
return _regenerator().w(function (_context14) {
|
9211
|
+
while (1) switch (_context14.p = _context14.n) {
|
9212
|
+
case 0:
|
9213
|
+
_context14.p = 0;
|
9214
|
+
publicMintEncodedTxs = [];
|
9215
|
+
publicMintSpenders = [];
|
9216
|
+
privateMintEncodedTxs = [];
|
9217
|
+
privateMintSpenders = [];
|
9218
|
+
publicMintFeesTotal = 0n;
|
9219
|
+
privateMintFeesTotal = 0n;
|
9220
|
+
_iterator5 = _createForOfIteratorHelper(request.requests);
|
9221
|
+
_context14.p = 1;
|
9222
|
+
_iterator5.s();
|
9223
|
+
case 2:
|
9224
|
+
if ((_step5 = _iterator5.n()).done) {
|
9225
|
+
_context14.n = 9;
|
9226
|
+
break;
|
9227
|
+
}
|
9228
|
+
req = _step5.value;
|
9229
|
+
registrationRequest = {
|
9230
|
+
spgNftContract: validateAddress(req.spgNftContract),
|
9231
|
+
recipient: validateAddress(req.recipient || this.walletAddress),
|
9232
|
+
ipMetadata: getIpMetadataForWorkflow(req.ipMetadata),
|
9233
|
+
allowDuplicates: req.allowDuplicates || true
|
9234
|
+
};
|
9235
|
+
_context14.n = 3;
|
9236
|
+
return getPublicMinting(req.spgNftContract, this.rpcClient);
|
9237
|
+
case 3:
|
9238
|
+
isPublicMinting = _context14.v;
|
9239
|
+
_context14.n = 4;
|
9240
|
+
return calculateSPGWipMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, registrationRequest.spgNftContract));
|
9241
|
+
case 4:
|
9242
|
+
nftMintFee = _context14.v;
|
9243
|
+
encodeTx = {
|
9244
|
+
to: this.registrationWorkflowsClient.address,
|
9245
|
+
data: viem.encodeFunctionData({
|
9246
|
+
abi: registrationWorkflowsAbi,
|
9247
|
+
functionName: "mintAndRegisterIp",
|
9248
|
+
args: [registrationRequest.spgNftContract, registrationRequest.recipient, registrationRequest.ipMetadata, registrationRequest.allowDuplicates]
|
9249
|
+
})
|
9250
|
+
};
|
9251
|
+
if (!isPublicMinting) {
|
9252
|
+
_context14.n = 5;
|
9253
|
+
break;
|
9254
|
+
}
|
9255
|
+
publicMintFeesTotal += nftMintFee;
|
9256
|
+
publicMintSpenders = mergeSpenders(publicMintSpenders, [{
|
9257
|
+
address: registrationRequest.spgNftContract,
|
9258
|
+
amount: nftMintFee
|
9259
|
+
}]);
|
9260
|
+
publicMintEncodedTxs.push(encodeTx);
|
9261
|
+
_context14.n = 8;
|
9262
|
+
break;
|
9263
|
+
case 5:
|
9264
|
+
_context14.n = 6;
|
9265
|
+
return hasMinterRole(registrationRequest.spgNftContract, this.rpcClient, this.walletAddress);
|
9266
|
+
case 6:
|
9267
|
+
isMinterRole = _context14.v;
|
9268
|
+
if (isMinterRole) {
|
9269
|
+
_context14.n = 7;
|
9270
|
+
break;
|
9271
|
+
}
|
9272
|
+
throw new Error("Caller ".concat(this.walletAddress, " does not have the minter role for ").concat(registrationRequest.spgNftContract));
|
9273
|
+
case 7:
|
9274
|
+
privateMintFeesTotal += nftMintFee;
|
9275
|
+
privateMintSpenders = mergeSpenders(privateMintSpenders, [{
|
9276
|
+
address: registrationRequest.spgNftContract,
|
9277
|
+
amount: nftMintFee
|
9278
|
+
}]);
|
9279
|
+
privateMintEncodedTxs.push(encodeTx);
|
9280
|
+
case 8:
|
9281
|
+
_context14.n = 2;
|
9282
|
+
break;
|
9283
|
+
case 9:
|
9284
|
+
_context14.n = 11;
|
9285
|
+
break;
|
9286
|
+
case 10:
|
9287
|
+
_context14.p = 10;
|
9288
|
+
_t18 = _context14.v;
|
9289
|
+
_iterator5.e(_t18);
|
9290
|
+
case 11:
|
9291
|
+
_context14.p = 11;
|
9292
|
+
_iterator5.f();
|
9293
|
+
return _context14.f(11);
|
9294
|
+
case 12:
|
9295
|
+
handlePublicMintTransactions = /*#__PURE__*/function () {
|
9296
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
|
9297
|
+
return _regenerator().w(function (_context12) {
|
9298
|
+
while (1) switch (_context12.n) {
|
9299
|
+
case 0:
|
9300
|
+
_context12.n = 1;
|
9301
|
+
return contractCallWithFees({
|
9302
|
+
totalFees: publicMintFeesTotal,
|
9303
|
+
options: {
|
9304
|
+
wipOptions: request.wipOptions
|
9305
|
+
},
|
9306
|
+
multicall3Address: _this7.multicall3Client.address,
|
9307
|
+
rpcClient: _this7.rpcClient,
|
9308
|
+
tokenSpenders: publicMintSpenders,
|
9309
|
+
contractCall: function contractCall() {
|
9310
|
+
return _this7.registrationWorkflowsClient.multicall({
|
9311
|
+
data: publicMintEncodedTxs.map(function (tx) {
|
9312
|
+
return tx.data;
|
9313
|
+
})
|
9314
|
+
});
|
9315
|
+
},
|
9316
|
+
sender: _this7.walletAddress,
|
9317
|
+
wallet: _this7.wallet,
|
9318
|
+
txOptions: request.txOptions,
|
9319
|
+
encodedTxs: publicMintEncodedTxs
|
9320
|
+
});
|
9321
|
+
case 1:
|
9322
|
+
return _context12.a(2, _context12.v);
|
9323
|
+
}
|
9324
|
+
}, _callee12);
|
9325
|
+
}));
|
9326
|
+
return function handlePublicMintTransactions() {
|
9327
|
+
return _ref2.apply(this, arguments);
|
9328
|
+
};
|
9329
|
+
}();
|
9330
|
+
handlePrivateMintTransactions = /*#__PURE__*/function () {
|
9331
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
|
9332
|
+
return _regenerator().w(function (_context13) {
|
9333
|
+
while (1) switch (_context13.n) {
|
9334
|
+
case 0:
|
9335
|
+
_context13.n = 1;
|
9336
|
+
return contractCallWithFees({
|
9337
|
+
totalFees: privateMintFeesTotal,
|
9338
|
+
options: {
|
9339
|
+
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
9340
|
+
useMulticallWhenPossible: false
|
9341
|
+
})
|
9342
|
+
},
|
9343
|
+
multicall3Address: _this7.multicall3Client.address,
|
9344
|
+
rpcClient: _this7.rpcClient,
|
9345
|
+
tokenSpenders: privateMintSpenders,
|
9346
|
+
contractCall: function contractCall() {
|
9347
|
+
return _this7.registrationWorkflowsClient.multicall({
|
9348
|
+
data: privateMintEncodedTxs.map(function (tx) {
|
9349
|
+
return tx.data;
|
9350
|
+
})
|
9351
|
+
});
|
9352
|
+
},
|
9353
|
+
sender: _this7.walletAddress,
|
9354
|
+
wallet: _this7.wallet,
|
9355
|
+
txOptions: request.txOptions,
|
9356
|
+
encodedTxs: privateMintEncodedTxs
|
9357
|
+
});
|
9358
|
+
case 1:
|
9359
|
+
return _context13.a(2, _context13.v);
|
9360
|
+
}
|
9361
|
+
}, _callee13);
|
9362
|
+
}));
|
9363
|
+
return function handlePrivateMintTransactions() {
|
9364
|
+
return _ref3.apply(this, arguments);
|
9365
|
+
};
|
9366
|
+
}();
|
9367
|
+
transactionResponses = [];
|
9368
|
+
if (!(privateMintEncodedTxs.length === 0)) {
|
9369
|
+
_context14.n = 14;
|
9370
|
+
break;
|
9371
|
+
}
|
9372
|
+
_context14.n = 13;
|
9373
|
+
return handlePublicMintTransactions();
|
9374
|
+
case 13:
|
9375
|
+
_t19 = _context14.v;
|
9376
|
+
transactionResponses = [_t19];
|
9377
|
+
_context14.n = 19;
|
9378
|
+
break;
|
9379
|
+
case 14:
|
9380
|
+
if (!(publicMintEncodedTxs.length === 0)) {
|
9381
|
+
_context14.n = 16;
|
9382
|
+
break;
|
9383
|
+
}
|
9384
|
+
_context14.n = 15;
|
9385
|
+
return handlePrivateMintTransactions();
|
9386
|
+
case 15:
|
9387
|
+
_t20 = _context14.v;
|
9388
|
+
transactionResponses = [_t20];
|
9389
|
+
_context14.n = 19;
|
9390
|
+
break;
|
9391
|
+
case 16:
|
9392
|
+
_context14.n = 17;
|
9393
|
+
return handlePublicMintTransactions();
|
9394
|
+
case 17:
|
9395
|
+
publicMintResponse = _context14.v;
|
9396
|
+
_context14.n = 18;
|
9397
|
+
return handlePrivateMintTransactions();
|
9398
|
+
case 18:
|
9399
|
+
privateMintResponse = _context14.v;
|
9400
|
+
transactionResponses = [publicMintResponse, privateMintResponse];
|
9401
|
+
case 19:
|
9402
|
+
return _context14.a(2, {
|
9403
|
+
registrationResults: transactionResponses.map(function (r) {
|
9404
|
+
return {
|
9405
|
+
txHash: r.txHash,
|
9406
|
+
receipt: r.receipt,
|
9407
|
+
ipIdsAndTokenIds: _this7.getIpIdAndTokenIdsFromEvent(r.receipt, "spgNftContract")
|
9408
|
+
};
|
9409
|
+
})
|
9410
|
+
});
|
9411
|
+
case 20:
|
9412
|
+
_context14.p = 20;
|
9413
|
+
_t21 = _context14.v;
|
9414
|
+
return _context14.a(2, handleError(_t21, "Failed to batch mint and register IP"));
|
9415
|
+
}
|
9416
|
+
}, _callee14, this, [[1, 10, 11, 12], [0, 20]]);
|
9417
|
+
}));
|
9418
|
+
function batchMintAndRegisterIp(_x13) {
|
9419
|
+
return _batchMintAndRegisterIp.apply(this, arguments);
|
9420
|
+
}
|
9421
|
+
return batchMintAndRegisterIp;
|
9422
|
+
}()
|
9040
9423
|
/**
|
9041
9424
|
* Register Programmable IP License Terms (if unregistered) and attach it to IP.
|
9042
9425
|
*
|
@@ -9046,40 +9429,40 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9046
9429
|
}, {
|
9047
9430
|
key: "registerPilTermsAndAttach",
|
9048
9431
|
value: (function () {
|
9049
|
-
var _registerPilTermsAndAttach = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9050
|
-
var _request$txOptions9, ipId, isRegistered, _yield$validateLicens3, licenseTerms, licenseTermsData, calculatedDeadline, ipAccount, _yield$ipAccount$stat2, state, signature, _object2, txHash, licenseTermsIds, maxLicenseTokensTxHashes,
|
9051
|
-
return _regenerator().w(function (
|
9052
|
-
while (1) switch (
|
9432
|
+
var _registerPilTermsAndAttach = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(request) {
|
9433
|
+
var _request$txOptions9, ipId, isRegistered, _yield$validateLicens3, licenseTerms, licenseTermsData, calculatedDeadline, ipAccount, _yield$ipAccount$stat2, state, signature, _object2, txHash, licenseTermsIds, maxLicenseTokensTxHashes, _t22;
|
9434
|
+
return _regenerator().w(function (_context15) {
|
9435
|
+
while (1) switch (_context15.p = _context15.n) {
|
9053
9436
|
case 0:
|
9054
|
-
|
9437
|
+
_context15.p = 0;
|
9055
9438
|
ipId = request.ipId;
|
9056
|
-
|
9439
|
+
_context15.n = 1;
|
9057
9440
|
return this.isRegistered(ipId);
|
9058
9441
|
case 1:
|
9059
|
-
isRegistered =
|
9442
|
+
isRegistered = _context15.v;
|
9060
9443
|
if (isRegistered) {
|
9061
|
-
|
9444
|
+
_context15.n = 2;
|
9062
9445
|
break;
|
9063
9446
|
}
|
9064
9447
|
throw new Error("The IP with id ".concat(ipId, " is not registered."));
|
9065
9448
|
case 2:
|
9066
|
-
|
9449
|
+
_context15.n = 3;
|
9067
9450
|
return validateLicenseTermsData(request.licenseTermsData, this.rpcClient, this.chainId);
|
9068
9451
|
case 3:
|
9069
|
-
_yield$validateLicens3 =
|
9452
|
+
_yield$validateLicens3 = _context15.v;
|
9070
9453
|
licenseTerms = _yield$validateLicens3.licenseTerms;
|
9071
9454
|
licenseTermsData = _yield$validateLicens3.licenseTermsData;
|
9072
|
-
|
9455
|
+
_context15.n = 4;
|
9073
9456
|
return getCalculatedDeadline(this.rpcClient, request.deadline);
|
9074
9457
|
case 4:
|
9075
|
-
calculatedDeadline =
|
9458
|
+
calculatedDeadline = _context15.v;
|
9076
9459
|
ipAccount = new IpAccountImplClient(this.rpcClient, this.wallet, ipId);
|
9077
|
-
|
9460
|
+
_context15.n = 5;
|
9078
9461
|
return ipAccount.state();
|
9079
9462
|
case 5:
|
9080
|
-
_yield$ipAccount$stat2 =
|
9463
|
+
_yield$ipAccount$stat2 = _context15.v;
|
9081
9464
|
state = _yield$ipAccount$stat2.result;
|
9082
|
-
|
9465
|
+
_context15.n = 6;
|
9083
9466
|
return generateOperationSignature({
|
9084
9467
|
ipIdAddress: ipId,
|
9085
9468
|
methodType: SignatureMethodType.REGISTER_PIL_TERMS_AND_ATTACH,
|
@@ -9089,7 +9472,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9089
9472
|
chainId: this.chainId
|
9090
9473
|
});
|
9091
9474
|
case 6:
|
9092
|
-
signature =
|
9475
|
+
signature = _context15.v;
|
9093
9476
|
_object2 = {
|
9094
9477
|
ipId: ipId,
|
9095
9478
|
licenseTermsData: licenseTermsData,
|
@@ -9100,53 +9483,53 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9100
9483
|
}
|
9101
9484
|
};
|
9102
9485
|
if (!((_request$txOptions9 = request.txOptions) !== null && _request$txOptions9 !== void 0 && _request$txOptions9.encodedTxDataOnly)) {
|
9103
|
-
|
9486
|
+
_context15.n = 7;
|
9104
9487
|
break;
|
9105
9488
|
}
|
9106
|
-
return
|
9489
|
+
return _context15.a(2, {
|
9107
9490
|
encodedTxData: this.licenseAttachmentWorkflowsClient.registerPilTermsAndAttachEncode(_object2)
|
9108
9491
|
});
|
9109
9492
|
case 7:
|
9110
|
-
|
9493
|
+
_context15.n = 8;
|
9111
9494
|
return this.licenseAttachmentWorkflowsClient.registerPilTermsAndAttach(_object2);
|
9112
9495
|
case 8:
|
9113
|
-
txHash =
|
9114
|
-
|
9496
|
+
txHash = _context15.v;
|
9497
|
+
_context15.n = 9;
|
9115
9498
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
9116
9499
|
hash: txHash
|
9117
9500
|
}));
|
9118
9501
|
case 9:
|
9119
|
-
|
9502
|
+
_context15.n = 10;
|
9120
9503
|
return this.getLicenseTermsId(licenseTerms);
|
9121
9504
|
case 10:
|
9122
|
-
licenseTermsIds =
|
9123
|
-
|
9505
|
+
licenseTermsIds = _context15.v;
|
9506
|
+
_context15.n = 11;
|
9124
9507
|
return this.setMaxLicenseTokens({
|
9125
9508
|
maxLicenseTokensData: request.licenseTermsData,
|
9126
9509
|
licensorIpId: ipId,
|
9127
9510
|
licenseTermsIds: licenseTermsIds
|
9128
9511
|
});
|
9129
9512
|
case 11:
|
9130
|
-
maxLicenseTokensTxHashes =
|
9131
|
-
return
|
9513
|
+
maxLicenseTokensTxHashes = _context15.v;
|
9514
|
+
return _context15.a(2, _objectSpread2({
|
9132
9515
|
txHash: txHash,
|
9133
9516
|
licenseTermsIds: licenseTermsIds
|
9134
9517
|
}, maxLicenseTokensTxHashes.length > 0 && {
|
9135
9518
|
maxLicenseTokensTxHashes: maxLicenseTokensTxHashes
|
9136
9519
|
}));
|
9137
9520
|
case 12:
|
9138
|
-
|
9521
|
+
_context15.n = 14;
|
9139
9522
|
break;
|
9140
9523
|
case 13:
|
9141
|
-
|
9142
|
-
|
9143
|
-
return
|
9524
|
+
_context15.p = 13;
|
9525
|
+
_t22 = _context15.v;
|
9526
|
+
return _context15.a(2, handleError(_t22, "Failed to register PIL terms and attach"));
|
9144
9527
|
case 14:
|
9145
|
-
return
|
9528
|
+
return _context15.a(2);
|
9146
9529
|
}
|
9147
|
-
},
|
9530
|
+
}, _callee15, this, [[0, 13]]);
|
9148
9531
|
}));
|
9149
|
-
function registerPilTermsAndAttach(
|
9532
|
+
function registerPilTermsAndAttach(_x14) {
|
9150
9533
|
return _registerPilTermsAndAttach.apply(this, arguments);
|
9151
9534
|
}
|
9152
9535
|
return registerPilTermsAndAttach;
|
@@ -9161,17 +9544,17 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9161
9544
|
}, {
|
9162
9545
|
key: "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens",
|
9163
9546
|
value: (function () {
|
9164
|
-
var _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9165
|
-
var
|
9166
|
-
var _request$txOptions0, _request$options6, licenseTokenIds, _object3, encodedTxData, contractCall,
|
9167
|
-
return _regenerator().w(function (
|
9168
|
-
while (1) switch (
|
9547
|
+
var _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(request) {
|
9548
|
+
var _this8 = this;
|
9549
|
+
var _request$txOptions0, _request$options6, licenseTokenIds, _object3, encodedTxData, contractCall, _t23;
|
9550
|
+
return _regenerator().w(function (_context17) {
|
9551
|
+
while (1) switch (_context17.p = _context17.n) {
|
9169
9552
|
case 0:
|
9170
|
-
|
9171
|
-
|
9553
|
+
_context17.p = 0;
|
9554
|
+
_context17.n = 1;
|
9172
9555
|
return this.validateLicenseTokenIds(request.licenseTokenIds);
|
9173
9556
|
case 1:
|
9174
|
-
licenseTokenIds =
|
9557
|
+
licenseTokenIds = _context17.v;
|
9175
9558
|
_object3 = {
|
9176
9559
|
spgNftContract: validateAddress(request.spgNftContract),
|
9177
9560
|
recipient: validateAddress(request.recipient || this.walletAddress),
|
@@ -9184,27 +9567,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9184
9567
|
validateMaxRts(_object3.maxRts);
|
9185
9568
|
encodedTxData = this.derivativeWorkflowsClient.mintAndRegisterIpAndMakeDerivativeWithLicenseTokensEncode(_object3);
|
9186
9569
|
if (!((_request$txOptions0 = request.txOptions) !== null && _request$txOptions0 !== void 0 && _request$txOptions0.encodedTxDataOnly)) {
|
9187
|
-
|
9570
|
+
_context17.n = 2;
|
9188
9571
|
break;
|
9189
9572
|
}
|
9190
|
-
return
|
9573
|
+
return _context17.a(2, {
|
9191
9574
|
encodedTxData: encodedTxData
|
9192
9575
|
});
|
9193
9576
|
case 2:
|
9194
9577
|
contractCall = /*#__PURE__*/function () {
|
9195
|
-
var
|
9196
|
-
return _regenerator().w(function (
|
9197
|
-
while (1) switch (
|
9578
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
|
9579
|
+
return _regenerator().w(function (_context16) {
|
9580
|
+
while (1) switch (_context16.n) {
|
9198
9581
|
case 0:
|
9199
|
-
return
|
9582
|
+
return _context16.a(2, _this8.derivativeWorkflowsClient.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_object3));
|
9200
9583
|
}
|
9201
|
-
},
|
9584
|
+
}, _callee16);
|
9202
9585
|
}));
|
9203
9586
|
return function contractCall() {
|
9204
|
-
return
|
9587
|
+
return _ref4.apply(this, arguments);
|
9205
9588
|
};
|
9206
9589
|
}();
|
9207
|
-
return
|
9590
|
+
return _context17.a(2, this.handleRegistrationWithFees({
|
9208
9591
|
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options6 = request.options) === null || _request$options6 === void 0 ? void 0 : _request$options6.wipOptions), {}, {
|
9209
9592
|
// need to disable multicall to avoid needing to transfer the license
|
9210
9593
|
// token to the multicall contract.
|
@@ -9218,13 +9601,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9218
9601
|
txOptions: request.txOptions
|
9219
9602
|
}));
|
9220
9603
|
case 3:
|
9221
|
-
|
9222
|
-
|
9223
|
-
return
|
9604
|
+
_context17.p = 3;
|
9605
|
+
_t23 = _context17.v;
|
9606
|
+
return _context17.a(2, handleError(_t23, "Failed to mint and register IP and make derivative with license tokens"));
|
9224
9607
|
}
|
9225
|
-
},
|
9608
|
+
}, _callee17, this, [[0, 3]]);
|
9226
9609
|
}));
|
9227
|
-
function mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(
|
9610
|
+
function mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_x15) {
|
9228
9611
|
return _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
9229
9612
|
}
|
9230
9613
|
return mintAndRegisterIpAndMakeDerivativeWithLicenseTokens;
|
@@ -9238,14 +9621,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9238
9621
|
}, {
|
9239
9622
|
key: "registerIpAndMakeDerivativeWithLicenseTokens",
|
9240
9623
|
value: (function () {
|
9241
|
-
var _registerIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9242
|
-
var _request$txOptions1, tokenId, ipIdAddress, isRegistered, licenseTokenIds, calculatedDeadline, signature, _object4, txHash, receipt, log,
|
9243
|
-
return _regenerator().w(function (
|
9244
|
-
while (1) switch (
|
9624
|
+
var _registerIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18(request) {
|
9625
|
+
var _request$txOptions1, tokenId, ipIdAddress, isRegistered, licenseTokenIds, calculatedDeadline, signature, _object4, txHash, receipt, log, _t24;
|
9626
|
+
return _regenerator().w(function (_context18) {
|
9627
|
+
while (1) switch (_context18.p = _context18.n) {
|
9245
9628
|
case 0:
|
9246
|
-
|
9629
|
+
_context18.p = 0;
|
9247
9630
|
tokenId = BigInt(request.tokenId);
|
9248
|
-
|
9631
|
+
_context18.n = 1;
|
9249
9632
|
return getIpIdAddress({
|
9250
9633
|
nftContract: request.nftContract,
|
9251
9634
|
tokenId: tokenId,
|
@@ -9254,26 +9637,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9254
9637
|
chainId: this.chainId
|
9255
9638
|
});
|
9256
9639
|
case 1:
|
9257
|
-
ipIdAddress =
|
9258
|
-
|
9640
|
+
ipIdAddress = _context18.v;
|
9641
|
+
_context18.n = 2;
|
9259
9642
|
return this.isRegistered(ipIdAddress);
|
9260
9643
|
case 2:
|
9261
|
-
isRegistered =
|
9644
|
+
isRegistered = _context18.v;
|
9262
9645
|
if (!isRegistered) {
|
9263
|
-
|
9646
|
+
_context18.n = 3;
|
9264
9647
|
break;
|
9265
9648
|
}
|
9266
9649
|
throw new Error("The NFT with id ".concat(tokenId, " is already registered as IP."));
|
9267
9650
|
case 3:
|
9268
|
-
|
9651
|
+
_context18.n = 4;
|
9269
9652
|
return this.validateLicenseTokenIds(request.licenseTokenIds);
|
9270
9653
|
case 4:
|
9271
|
-
licenseTokenIds =
|
9272
|
-
|
9654
|
+
licenseTokenIds = _context18.v;
|
9655
|
+
_context18.n = 5;
|
9273
9656
|
return getCalculatedDeadline(this.rpcClient, request.deadline);
|
9274
9657
|
case 5:
|
9275
|
-
calculatedDeadline =
|
9276
|
-
|
9658
|
+
calculatedDeadline = _context18.v;
|
9659
|
+
_context18.n = 6;
|
9277
9660
|
return generateOperationSignature({
|
9278
9661
|
ipIdAddress: ipIdAddress,
|
9279
9662
|
methodType: SignatureMethodType.REGISTER_IP_AND_MAKE_DERIVATIVE_WITH_LICENSE_TOKENS,
|
@@ -9282,7 +9665,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9282
9665
|
chainId: this.chainId
|
9283
9666
|
});
|
9284
9667
|
case 6:
|
9285
|
-
signature =
|
9668
|
+
signature = _context18.v;
|
9286
9669
|
_object4 = _objectSpread2(_objectSpread2({}, request), {}, {
|
9287
9670
|
tokenId: tokenId,
|
9288
9671
|
licenseTokenIds: licenseTokenIds,
|
@@ -9297,40 +9680,40 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9297
9680
|
});
|
9298
9681
|
validateMaxRts(_object4.maxRts);
|
9299
9682
|
if (!((_request$txOptions1 = request.txOptions) !== null && _request$txOptions1 !== void 0 && _request$txOptions1.encodedTxDataOnly)) {
|
9300
|
-
|
9683
|
+
_context18.n = 7;
|
9301
9684
|
break;
|
9302
9685
|
}
|
9303
|
-
return
|
9686
|
+
return _context18.a(2, {
|
9304
9687
|
encodedTxData: this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokensEncode(_object4)
|
9305
9688
|
});
|
9306
9689
|
case 7:
|
9307
|
-
|
9690
|
+
_context18.n = 8;
|
9308
9691
|
return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object4);
|
9309
9692
|
case 8:
|
9310
|
-
txHash =
|
9311
|
-
|
9693
|
+
txHash = _context18.v;
|
9694
|
+
_context18.n = 9;
|
9312
9695
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
9313
9696
|
hash: txHash
|
9314
9697
|
}));
|
9315
9698
|
case 9:
|
9316
|
-
receipt =
|
9699
|
+
receipt = _context18.v;
|
9317
9700
|
log = this.getIpIdAndTokenIdsFromEvent(receipt)[0];
|
9318
|
-
return
|
9701
|
+
return _context18.a(2, _objectSpread2({
|
9319
9702
|
txHash: txHash
|
9320
9703
|
}, log));
|
9321
9704
|
case 10:
|
9322
|
-
|
9705
|
+
_context18.n = 12;
|
9323
9706
|
break;
|
9324
9707
|
case 11:
|
9325
|
-
|
9326
|
-
|
9327
|
-
return
|
9708
|
+
_context18.p = 11;
|
9709
|
+
_t24 = _context18.v;
|
9710
|
+
return _context18.a(2, handleError(_t24, "Failed to register IP and make derivative with license tokens"));
|
9328
9711
|
case 12:
|
9329
|
-
return
|
9712
|
+
return _context18.a(2);
|
9330
9713
|
}
|
9331
|
-
},
|
9714
|
+
}, _callee18, this, [[0, 11]]);
|
9332
9715
|
}));
|
9333
|
-
function registerIpAndMakeDerivativeWithLicenseTokens(
|
9716
|
+
function registerIpAndMakeDerivativeWithLicenseTokens(_x16) {
|
9334
9717
|
return _registerIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
9335
9718
|
}
|
9336
9719
|
return registerIpAndMakeDerivativeWithLicenseTokens;
|
@@ -9346,23 +9729,23 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9346
9729
|
}, {
|
9347
9730
|
key: "registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens",
|
9348
9731
|
value: (function () {
|
9349
|
-
var _registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9350
|
-
var _getRoyaltyShares, royaltyShares, totalAmount, _yield$validateLicens4, licenseTerms, calculatedDeadline, ipIdAddress, isRegistered, _yield$transformRegis5, _transformRequest4, registerIpAndAttachPilTermsAndDeployRoyaltyVaultTxHash, txReceipt, ipId, licenseTermsIds, ipRoyaltyVault, distributeRoyaltyTokensTxHash, maxLicenseTokensTxHashes,
|
9351
|
-
return _regenerator().w(function (
|
9352
|
-
while (1) switch (
|
9732
|
+
var _registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(request) {
|
9733
|
+
var _getRoyaltyShares, royaltyShares, totalAmount, _yield$validateLicens4, licenseTerms, calculatedDeadline, ipIdAddress, isRegistered, _yield$transformRegis5, _transformRequest4, registerIpAndAttachPilTermsAndDeployRoyaltyVaultTxHash, txReceipt, ipId, licenseTermsIds, ipRoyaltyVault, distributeRoyaltyTokensTxHash, maxLicenseTokensTxHashes, _t25;
|
9734
|
+
return _regenerator().w(function (_context19) {
|
9735
|
+
while (1) switch (_context19.p = _context19.n) {
|
9353
9736
|
case 0:
|
9354
|
-
|
9737
|
+
_context19.p = 0;
|
9355
9738
|
_getRoyaltyShares = getRoyaltyShares(request.royaltyShares), royaltyShares = _getRoyaltyShares.royaltyShares, totalAmount = _getRoyaltyShares.totalAmount;
|
9356
|
-
|
9739
|
+
_context19.n = 1;
|
9357
9740
|
return validateLicenseTermsData(request.licenseTermsData, this.rpcClient, this.chainId);
|
9358
9741
|
case 1:
|
9359
|
-
_yield$validateLicens4 =
|
9742
|
+
_yield$validateLicens4 = _context19.v;
|
9360
9743
|
licenseTerms = _yield$validateLicens4.licenseTerms;
|
9361
|
-
|
9744
|
+
_context19.n = 2;
|
9362
9745
|
return getCalculatedDeadline(this.rpcClient, request.deadline);
|
9363
9746
|
case 2:
|
9364
|
-
calculatedDeadline =
|
9365
|
-
|
9747
|
+
calculatedDeadline = _context19.v;
|
9748
|
+
_context19.n = 3;
|
9366
9749
|
return getIpIdAddress({
|
9367
9750
|
nftContract: validateAddress(request.nftContract),
|
9368
9751
|
tokenId: BigInt(request.tokenId),
|
@@ -9371,18 +9754,18 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9371
9754
|
chainId: this.chainId
|
9372
9755
|
});
|
9373
9756
|
case 3:
|
9374
|
-
ipIdAddress =
|
9375
|
-
|
9757
|
+
ipIdAddress = _context19.v;
|
9758
|
+
_context19.n = 4;
|
9376
9759
|
return this.isRegistered(ipIdAddress);
|
9377
9760
|
case 4:
|
9378
|
-
isRegistered =
|
9761
|
+
isRegistered = _context19.v;
|
9379
9762
|
if (!isRegistered) {
|
9380
|
-
|
9763
|
+
_context19.n = 5;
|
9381
9764
|
break;
|
9382
9765
|
}
|
9383
9766
|
throw new Error("The NFT with id ".concat(request.tokenId, " is already registered as IP."));
|
9384
9767
|
case 5:
|
9385
|
-
|
9768
|
+
_context19.n = 6;
|
9386
9769
|
return transformRegistrationRequest({
|
9387
9770
|
request: request,
|
9388
9771
|
rpcClient: this.rpcClient,
|
@@ -9390,25 +9773,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9390
9773
|
chainId: this.chainId
|
9391
9774
|
});
|
9392
9775
|
case 6:
|
9393
|
-
_yield$transformRegis5 =
|
9776
|
+
_yield$transformRegis5 = _context19.v;
|
9394
9777
|
_transformRequest4 = _yield$transformRegis5.transformRequest;
|
9395
|
-
|
9778
|
+
_context19.n = 7;
|
9396
9779
|
return this.royaltyTokenDistributionWorkflowsClient.registerIpAndAttachPilTermsAndDeployRoyaltyVault(_transformRequest4);
|
9397
9780
|
case 7:
|
9398
|
-
registerIpAndAttachPilTermsAndDeployRoyaltyVaultTxHash =
|
9399
|
-
|
9781
|
+
registerIpAndAttachPilTermsAndDeployRoyaltyVaultTxHash = _context19.v;
|
9782
|
+
_context19.n = 8;
|
9400
9783
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
9401
9784
|
hash: registerIpAndAttachPilTermsAndDeployRoyaltyVaultTxHash
|
9402
9785
|
}));
|
9403
9786
|
case 8:
|
9404
|
-
txReceipt =
|
9787
|
+
txReceipt = _context19.v;
|
9405
9788
|
ipId = this.getIpIdAndTokenIdsFromEvent(txReceipt)[0].ipId;
|
9406
|
-
|
9789
|
+
_context19.n = 9;
|
9407
9790
|
return this.getLicenseTermsId(licenseTerms);
|
9408
9791
|
case 9:
|
9409
|
-
licenseTermsIds =
|
9792
|
+
licenseTermsIds = _context19.v;
|
9410
9793
|
ipRoyaltyVault = this.royaltyModuleEventClient.parseTxIpRoyaltyVaultDeployedEvent(txReceipt)[0].ipRoyaltyVault;
|
9411
|
-
|
9794
|
+
_context19.n = 10;
|
9412
9795
|
return this.distributeRoyaltyTokens({
|
9413
9796
|
ipId: ipId,
|
9414
9797
|
deadline: calculatedDeadline,
|
@@ -9418,21 +9801,21 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9418
9801
|
txOptions: request.txOptions
|
9419
9802
|
});
|
9420
9803
|
case 10:
|
9421
|
-
distributeRoyaltyTokensTxHash =
|
9422
|
-
|
9804
|
+
distributeRoyaltyTokensTxHash = _context19.v;
|
9805
|
+
_context19.n = 11;
|
9423
9806
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
9424
9807
|
hash: distributeRoyaltyTokensTxHash
|
9425
9808
|
}));
|
9426
9809
|
case 11:
|
9427
|
-
|
9810
|
+
_context19.n = 12;
|
9428
9811
|
return this.setMaxLicenseTokens({
|
9429
9812
|
maxLicenseTokensData: request.licenseTermsData,
|
9430
9813
|
licensorIpId: ipId,
|
9431
9814
|
licenseTermsIds: licenseTermsIds
|
9432
9815
|
});
|
9433
9816
|
case 12:
|
9434
|
-
maxLicenseTokensTxHashes =
|
9435
|
-
return
|
9817
|
+
maxLicenseTokensTxHashes = _context19.v;
|
9818
|
+
return _context19.a(2, _objectSpread2({
|
9436
9819
|
registerIpAndAttachPilTermsAndDeployRoyaltyVaultTxHash: registerIpAndAttachPilTermsAndDeployRoyaltyVaultTxHash,
|
9437
9820
|
distributeRoyaltyTokensTxHash: distributeRoyaltyTokensTxHash,
|
9438
9821
|
ipId: ipId,
|
@@ -9442,13 +9825,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9442
9825
|
maxLicenseTokensTxHashes: maxLicenseTokensTxHashes
|
9443
9826
|
}));
|
9444
9827
|
case 13:
|
9445
|
-
|
9446
|
-
|
9447
|
-
return
|
9828
|
+
_context19.p = 13;
|
9829
|
+
_t25 = _context19.v;
|
9830
|
+
return _context19.a(2, handleError(_t25, "Failed to register IP and attach license terms and distribute royalty tokens"));
|
9448
9831
|
}
|
9449
|
-
},
|
9832
|
+
}, _callee19, this, [[0, 13]]);
|
9450
9833
|
}));
|
9451
|
-
function registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens(
|
9834
|
+
function registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens(_x17) {
|
9452
9835
|
return _registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens.apply(this, arguments);
|
9453
9836
|
}
|
9454
9837
|
return registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens;
|
@@ -9463,14 +9846,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9463
9846
|
}, {
|
9464
9847
|
key: "registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens",
|
9465
9848
|
value: (function () {
|
9466
|
-
var _registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9467
|
-
var
|
9468
|
-
var _request$options7, ipIdAddress, _yield$transformRegis6, _transformRequest5, _getRoyaltyShares2, royaltyShares, totalAmount, isRegistered, encodedTxData, contractCall, _yield$this$handleReg, txHash, ipId, tokenId, receipt, ipRoyaltyVault, distributeRoyaltyTokensTxHash,
|
9469
|
-
return _regenerator().w(function (
|
9470
|
-
while (1) switch (
|
9849
|
+
var _registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(request) {
|
9850
|
+
var _this9 = this;
|
9851
|
+
var _request$options7, ipIdAddress, _yield$transformRegis6, _transformRequest5, _getRoyaltyShares2, royaltyShares, totalAmount, isRegistered, encodedTxData, contractCall, _yield$this$handleReg, txHash, ipId, tokenId, receipt, ipRoyaltyVault, distributeRoyaltyTokensTxHash, _t26;
|
9852
|
+
return _regenerator().w(function (_context20) {
|
9853
|
+
while (1) switch (_context20.p = _context20.n) {
|
9471
9854
|
case 0:
|
9472
|
-
|
9473
|
-
|
9855
|
+
_context20.p = 0;
|
9856
|
+
_context20.n = 1;
|
9474
9857
|
return getIpIdAddress({
|
9475
9858
|
nftContract: validateAddress(request.nftContract),
|
9476
9859
|
tokenId: BigInt(request.tokenId),
|
@@ -9479,8 +9862,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9479
9862
|
chainId: this.chainId
|
9480
9863
|
});
|
9481
9864
|
case 1:
|
9482
|
-
ipIdAddress =
|
9483
|
-
|
9865
|
+
ipIdAddress = _context20.v;
|
9866
|
+
_context20.n = 2;
|
9484
9867
|
return transformRegistrationRequest({
|
9485
9868
|
request: request,
|
9486
9869
|
rpcClient: this.rpcClient,
|
@@ -9488,24 +9871,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9488
9871
|
chainId: this.chainId
|
9489
9872
|
});
|
9490
9873
|
case 2:
|
9491
|
-
_yield$transformRegis6 =
|
9874
|
+
_yield$transformRegis6 = _context20.v;
|
9492
9875
|
_transformRequest5 = _yield$transformRegis6.transformRequest;
|
9493
9876
|
_getRoyaltyShares2 = getRoyaltyShares(request.royaltyShares), royaltyShares = _getRoyaltyShares2.royaltyShares, totalAmount = _getRoyaltyShares2.totalAmount;
|
9494
|
-
|
9877
|
+
_context20.n = 3;
|
9495
9878
|
return this.isRegistered(ipIdAddress);
|
9496
9879
|
case 3:
|
9497
|
-
isRegistered =
|
9880
|
+
isRegistered = _context20.v;
|
9498
9881
|
if (!isRegistered) {
|
9499
|
-
|
9882
|
+
_context20.n = 4;
|
9500
9883
|
break;
|
9501
9884
|
}
|
9502
9885
|
throw new Error("The NFT with id ".concat(request.tokenId, " is already registered as IP."));
|
9503
9886
|
case 4:
|
9504
9887
|
encodedTxData = this.royaltyTokenDistributionWorkflowsClient.registerIpAndMakeDerivativeAndDeployRoyaltyVaultEncode(_transformRequest5);
|
9505
9888
|
contractCall = function contractCall() {
|
9506
|
-
return
|
9889
|
+
return _this9.royaltyTokenDistributionWorkflowsClient.registerIpAndMakeDerivativeAndDeployRoyaltyVault(_transformRequest5);
|
9507
9890
|
};
|
9508
|
-
|
9891
|
+
_context20.n = 5;
|
9509
9892
|
return this.handleRegistrationWithFees({
|
9510
9893
|
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options7 = request.options) === null || _request$options7 === void 0 ? void 0 : _request$options7.wipOptions), {}, {
|
9511
9894
|
useMulticallWhenPossible: false
|
@@ -9518,13 +9901,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9518
9901
|
txOptions: _objectSpread2({}, request.txOptions)
|
9519
9902
|
});
|
9520
9903
|
case 5:
|
9521
|
-
_yield$this$handleReg =
|
9904
|
+
_yield$this$handleReg = _context20.v;
|
9522
9905
|
txHash = _yield$this$handleReg.txHash;
|
9523
9906
|
ipId = _yield$this$handleReg.ipId;
|
9524
9907
|
tokenId = _yield$this$handleReg.tokenId;
|
9525
9908
|
receipt = _yield$this$handleReg.receipt;
|
9526
9909
|
if (!(tokenId === undefined || !ipId || !receipt)) {
|
9527
|
-
|
9910
|
+
_context20.n = 6;
|
9528
9911
|
break;
|
9529
9912
|
}
|
9530
9913
|
throw new Error("Failed to register derivative ip and deploy royalty vault.");
|
@@ -9532,7 +9915,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9532
9915
|
ipRoyaltyVault = this.royaltyModuleEventClient.parseTxIpRoyaltyVaultDeployedEvent(receipt).filter(function (item) {
|
9533
9916
|
return item.ipId === ipId;
|
9534
9917
|
})[0].ipRoyaltyVault;
|
9535
|
-
|
9918
|
+
_context20.n = 7;
|
9536
9919
|
return this.distributeRoyaltyTokens({
|
9537
9920
|
ipId: ipId,
|
9538
9921
|
deadline: request.deadline,
|
@@ -9542,13 +9925,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9542
9925
|
txOptions: request.txOptions
|
9543
9926
|
});
|
9544
9927
|
case 7:
|
9545
|
-
distributeRoyaltyTokensTxHash =
|
9546
|
-
|
9928
|
+
distributeRoyaltyTokensTxHash = _context20.v;
|
9929
|
+
_context20.n = 8;
|
9547
9930
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
9548
9931
|
hash: distributeRoyaltyTokensTxHash
|
9549
9932
|
}));
|
9550
9933
|
case 8:
|
9551
|
-
return
|
9934
|
+
return _context20.a(2, {
|
9552
9935
|
registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokensTxHash: txHash,
|
9553
9936
|
distributeRoyaltyTokensTxHash: distributeRoyaltyTokensTxHash,
|
9554
9937
|
ipId: ipId,
|
@@ -9556,13 +9939,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9556
9939
|
ipRoyaltyVault: ipRoyaltyVault
|
9557
9940
|
});
|
9558
9941
|
case 9:
|
9559
|
-
|
9560
|
-
|
9561
|
-
return
|
9942
|
+
_context20.p = 9;
|
9943
|
+
_t26 = _context20.v;
|
9944
|
+
return _context20.a(2, handleError(_t26, "Failed to register derivative IP and attach license terms and distribute royalty tokens"));
|
9562
9945
|
}
|
9563
|
-
},
|
9946
|
+
}, _callee20, this, [[0, 9]]);
|
9564
9947
|
}));
|
9565
|
-
function registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens(
|
9948
|
+
function registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens(_x18) {
|
9566
9949
|
return _registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens.apply(this, arguments);
|
9567
9950
|
}
|
9568
9951
|
return registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens;
|
@@ -9576,19 +9959,19 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9576
9959
|
}, {
|
9577
9960
|
key: "mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens",
|
9578
9961
|
value: (function () {
|
9579
|
-
var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9580
|
-
var
|
9581
|
-
var _request$options8, _yield$validateLicens5, licenseTerms, _yield$transformRegis7, _transformRequest6, encodedTxData, contractCall, _yield$this$handleReg2, txHash, ipId, tokenId, receipt, licenseTermsIds, ipRoyaltyVault, maxLicenseTokensTxHashes,
|
9582
|
-
return _regenerator().w(function (
|
9583
|
-
while (1) switch (
|
9962
|
+
var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(request) {
|
9963
|
+
var _this0 = this;
|
9964
|
+
var _request$options8, _yield$validateLicens5, licenseTerms, _yield$transformRegis7, _transformRequest6, encodedTxData, contractCall, _yield$this$handleReg2, txHash, ipId, tokenId, receipt, licenseTermsIds, ipRoyaltyVault, maxLicenseTokensTxHashes, _t27;
|
9965
|
+
return _regenerator().w(function (_context21) {
|
9966
|
+
while (1) switch (_context21.p = _context21.n) {
|
9584
9967
|
case 0:
|
9585
|
-
|
9586
|
-
|
9968
|
+
_context21.p = 0;
|
9969
|
+
_context21.n = 1;
|
9587
9970
|
return validateLicenseTermsData(request.licenseTermsData, this.rpcClient, this.chainId);
|
9588
9971
|
case 1:
|
9589
|
-
_yield$validateLicens5 =
|
9972
|
+
_yield$validateLicens5 = _context21.v;
|
9590
9973
|
licenseTerms = _yield$validateLicens5.licenseTerms;
|
9591
|
-
|
9974
|
+
_context21.n = 2;
|
9592
9975
|
return transformRegistrationRequest({
|
9593
9976
|
request: request,
|
9594
9977
|
rpcClient: this.rpcClient,
|
@@ -9596,13 +9979,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9596
9979
|
chainId: this.chainId
|
9597
9980
|
});
|
9598
9981
|
case 2:
|
9599
|
-
_yield$transformRegis7 =
|
9982
|
+
_yield$transformRegis7 = _context21.v;
|
9600
9983
|
_transformRequest6 = _yield$transformRegis7.transformRequest;
|
9601
9984
|
encodedTxData = this.royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensEncode(_transformRequest6);
|
9602
9985
|
contractCall = function contractCall() {
|
9603
|
-
return
|
9986
|
+
return _this0.royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(_transformRequest6);
|
9604
9987
|
};
|
9605
|
-
|
9988
|
+
_context21.n = 3;
|
9606
9989
|
return this.handleRegistrationWithFees({
|
9607
9990
|
wipOptions: (_request$options8 = request.options) === null || _request$options8 === void 0 ? void 0 : _request$options8.wipOptions,
|
9608
9991
|
sender: this.walletAddress,
|
@@ -9613,33 +9996,33 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9613
9996
|
txOptions: request.txOptions
|
9614
9997
|
});
|
9615
9998
|
case 3:
|
9616
|
-
_yield$this$handleReg2 =
|
9999
|
+
_yield$this$handleReg2 = _context21.v;
|
9617
10000
|
txHash = _yield$this$handleReg2.txHash;
|
9618
10001
|
ipId = _yield$this$handleReg2.ipId;
|
9619
10002
|
tokenId = _yield$this$handleReg2.tokenId;
|
9620
10003
|
receipt = _yield$this$handleReg2.receipt;
|
9621
10004
|
if (receipt) {
|
9622
|
-
|
10005
|
+
_context21.n = 4;
|
9623
10006
|
break;
|
9624
10007
|
}
|
9625
|
-
return
|
10008
|
+
return _context21.a(2, {
|
9626
10009
|
txHash: txHash
|
9627
10010
|
});
|
9628
10011
|
case 4:
|
9629
|
-
|
10012
|
+
_context21.n = 5;
|
9630
10013
|
return this.getLicenseTermsId(licenseTerms);
|
9631
10014
|
case 5:
|
9632
|
-
licenseTermsIds =
|
10015
|
+
licenseTermsIds = _context21.v;
|
9633
10016
|
ipRoyaltyVault = this.royaltyModuleEventClient.parseTxIpRoyaltyVaultDeployedEvent(receipt)[0].ipRoyaltyVault;
|
9634
|
-
|
10017
|
+
_context21.n = 6;
|
9635
10018
|
return this.setMaxLicenseTokens({
|
9636
10019
|
maxLicenseTokensData: request.licenseTermsData,
|
9637
10020
|
licensorIpId: ipId,
|
9638
10021
|
licenseTermsIds: licenseTermsIds
|
9639
10022
|
});
|
9640
10023
|
case 6:
|
9641
|
-
maxLicenseTokensTxHashes =
|
9642
|
-
return
|
10024
|
+
maxLicenseTokensTxHashes = _context21.v;
|
10025
|
+
return _context21.a(2, _objectSpread2({
|
9643
10026
|
txHash: txHash,
|
9644
10027
|
ipId: ipId,
|
9645
10028
|
licenseTermsIds: licenseTermsIds,
|
@@ -9649,13 +10032,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9649
10032
|
maxLicenseTokensTxHashes: maxLicenseTokensTxHashes
|
9650
10033
|
}));
|
9651
10034
|
case 7:
|
9652
|
-
|
9653
|
-
|
9654
|
-
return
|
10035
|
+
_context21.p = 7;
|
10036
|
+
_t27 = _context21.v;
|
10037
|
+
return _context21.a(2, handleError(_t27, "Failed to mint and register IP and attach PIL terms and distribute royalty tokens"));
|
9655
10038
|
}
|
9656
|
-
},
|
10039
|
+
}, _callee21, this, [[0, 7]]);
|
9657
10040
|
}));
|
9658
|
-
function mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(
|
10041
|
+
function mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(_x19) {
|
9659
10042
|
return _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens.apply(this, arguments);
|
9660
10043
|
}
|
9661
10044
|
return mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens;
|
@@ -9669,14 +10052,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9669
10052
|
}, {
|
9670
10053
|
key: "mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",
|
9671
10054
|
value: (function () {
|
9672
|
-
var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9673
|
-
var
|
9674
|
-
var _request$options9, _yield$transformRegis8, _transformRequest7, encodedTxData, contractCall,
|
9675
|
-
return _regenerator().w(function (
|
9676
|
-
while (1) switch (
|
10055
|
+
var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22(request) {
|
10056
|
+
var _this1 = this;
|
10057
|
+
var _request$options9, _yield$transformRegis8, _transformRequest7, encodedTxData, contractCall, _t28;
|
10058
|
+
return _regenerator().w(function (_context22) {
|
10059
|
+
while (1) switch (_context22.p = _context22.n) {
|
9677
10060
|
case 0:
|
9678
|
-
|
9679
|
-
|
10061
|
+
_context22.p = 0;
|
10062
|
+
_context22.n = 1;
|
9680
10063
|
return transformRegistrationRequest({
|
9681
10064
|
request: request,
|
9682
10065
|
rpcClient: this.rpcClient,
|
@@ -9684,13 +10067,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9684
10067
|
chainId: this.chainId
|
9685
10068
|
});
|
9686
10069
|
case 1:
|
9687
|
-
_yield$transformRegis8 =
|
10070
|
+
_yield$transformRegis8 = _context22.v;
|
9688
10071
|
_transformRequest7 = _yield$transformRegis8.transformRequest;
|
9689
10072
|
encodedTxData = this.royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensEncode(_transformRequest7);
|
9690
10073
|
contractCall = function contractCall() {
|
9691
|
-
return
|
10074
|
+
return _this1.royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens(_transformRequest7);
|
9692
10075
|
};
|
9693
|
-
|
10076
|
+
_context22.n = 2;
|
9694
10077
|
return this.handleRegistrationWithFees({
|
9695
10078
|
spgNftContract: _transformRequest7.spgNftContract,
|
9696
10079
|
wipOptions: (_request$options9 = request.options) === null || _request$options9 === void 0 ? void 0 : _request$options9.wipOptions,
|
@@ -9702,15 +10085,15 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9702
10085
|
txOptions: request.txOptions
|
9703
10086
|
});
|
9704
10087
|
case 2:
|
9705
|
-
return
|
10088
|
+
return _context22.a(2, _context22.v);
|
9706
10089
|
case 3:
|
9707
|
-
|
9708
|
-
|
9709
|
-
return
|
10090
|
+
_context22.p = 3;
|
10091
|
+
_t28 = _context22.v;
|
10092
|
+
return _context22.a(2, handleError(_t28, "Failed to mint and register IP and make derivative and distribute royalty tokens"));
|
9710
10093
|
}
|
9711
|
-
},
|
10094
|
+
}, _callee22, this, [[0, 3]]);
|
9712
10095
|
}));
|
9713
|
-
function mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens(
|
10096
|
+
function mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens(_x20) {
|
9714
10097
|
return _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens.apply(this, arguments);
|
9715
10098
|
}
|
9716
10099
|
return mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens;
|
@@ -9718,12 +10101,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9718
10101
|
}, {
|
9719
10102
|
key: "distributeRoyaltyTokens",
|
9720
10103
|
value: function () {
|
9721
|
-
var _distributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
10104
|
+
var _distributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(request) {
|
9722
10105
|
var _yield$transferDistri, transformRequest, txHash;
|
9723
|
-
return _regenerator().w(function (
|
9724
|
-
while (1) switch (
|
10106
|
+
return _regenerator().w(function (_context23) {
|
10107
|
+
while (1) switch (_context23.n) {
|
9725
10108
|
case 0:
|
9726
|
-
|
10109
|
+
_context23.n = 1;
|
9727
10110
|
return transferDistributeRoyaltyTokensRequest({
|
9728
10111
|
request: request,
|
9729
10112
|
rpcClient: this.rpcClient,
|
@@ -9731,22 +10114,22 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9731
10114
|
chainId: this.chainId
|
9732
10115
|
});
|
9733
10116
|
case 1:
|
9734
|
-
_yield$transferDistri =
|
10117
|
+
_yield$transferDistri = _context23.v;
|
9735
10118
|
transformRequest = _yield$transferDistri.transformRequest;
|
9736
|
-
|
10119
|
+
_context23.n = 2;
|
9737
10120
|
return this.royaltyTokenDistributionWorkflowsClient.distributeRoyaltyTokens(transformRequest);
|
9738
10121
|
case 2:
|
9739
|
-
txHash =
|
9740
|
-
|
10122
|
+
txHash = _context23.v;
|
10123
|
+
_context23.n = 3;
|
9741
10124
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
9742
10125
|
hash: txHash
|
9743
10126
|
}));
|
9744
10127
|
case 3:
|
9745
|
-
return
|
10128
|
+
return _context23.a(2, txHash);
|
9746
10129
|
}
|
9747
|
-
},
|
10130
|
+
}, _callee23, this);
|
9748
10131
|
}));
|
9749
|
-
function distributeRoyaltyTokens(
|
10132
|
+
function distributeRoyaltyTokens(_x21) {
|
9750
10133
|
return _distributeRoyaltyTokens.apply(this, arguments);
|
9751
10134
|
}
|
9752
10135
|
return distributeRoyaltyTokens;
|
@@ -9754,20 +10137,20 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9754
10137
|
}, {
|
9755
10138
|
key: "isRegistered",
|
9756
10139
|
value: function () {
|
9757
|
-
var _isRegistered = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9758
|
-
return _regenerator().w(function (
|
9759
|
-
while (1) switch (
|
10140
|
+
var _isRegistered = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(ipId) {
|
10141
|
+
return _regenerator().w(function (_context24) {
|
10142
|
+
while (1) switch (_context24.n) {
|
9760
10143
|
case 0:
|
9761
|
-
|
10144
|
+
_context24.n = 1;
|
9762
10145
|
return this.ipAssetRegistryClient.isRegistered({
|
9763
10146
|
id: validateAddress(ipId)
|
9764
10147
|
});
|
9765
10148
|
case 1:
|
9766
|
-
return
|
10149
|
+
return _context24.a(2, _context24.v);
|
9767
10150
|
}
|
9768
|
-
},
|
10151
|
+
}, _callee24, this);
|
9769
10152
|
}));
|
9770
|
-
function isRegistered(
|
10153
|
+
function isRegistered(_x22) {
|
9771
10154
|
return _isRegistered.apply(this, arguments);
|
9772
10155
|
}
|
9773
10156
|
return isRegistered;
|
@@ -9811,24 +10194,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9811
10194
|
}, {
|
9812
10195
|
key: "batchRegisterIpAssetsWithOptimizedWorkflows",
|
9813
10196
|
value: (function () {
|
9814
|
-
var _batchRegisterIpAssetsWithOptimizedWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9815
|
-
var _request$options0, _request$options10, transferWorkflowRequests,
|
9816
|
-
return _regenerator().w(function (
|
9817
|
-
while (1) switch (
|
10197
|
+
var _batchRegisterIpAssetsWithOptimizedWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25(request) {
|
10198
|
+
var _request$options0, _request$options10, transferWorkflowRequests, _iterator6, _step6, req, res, royaltyDistributionRequests, _yield$handleMultical, txResponses, aggregateRegistrationRequest, responses, royaltyTokensDistributionRequests, _iterator7, _step7, _step7$value, txHash, receipt, iPRegisteredLog, ipRoyaltyVaultEvent, response, distributeRoyaltyTokensTxHashes, _request$options1, _yield$handleMultical2, txResponse, registrationResults, _t29, _t30, _t31;
|
10199
|
+
return _regenerator().w(function (_context25) {
|
10200
|
+
while (1) switch (_context25.p = _context25.n) {
|
9818
10201
|
case 0:
|
9819
|
-
|
10202
|
+
_context25.p = 0;
|
9820
10203
|
// Transform requests into workflow format
|
9821
10204
|
transferWorkflowRequests = [];
|
9822
|
-
|
9823
|
-
|
9824
|
-
|
10205
|
+
_iterator6 = _createForOfIteratorHelper(request.requests);
|
10206
|
+
_context25.p = 1;
|
10207
|
+
_iterator6.s();
|
9825
10208
|
case 2:
|
9826
|
-
if ((
|
9827
|
-
|
10209
|
+
if ((_step6 = _iterator6.n()).done) {
|
10210
|
+
_context25.n = 5;
|
9828
10211
|
break;
|
9829
10212
|
}
|
9830
|
-
req =
|
9831
|
-
|
10213
|
+
req = _step6.value;
|
10214
|
+
_context25.n = 3;
|
9832
10215
|
return transformRegistrationRequest({
|
9833
10216
|
request: req,
|
9834
10217
|
rpcClient: this.rpcClient,
|
@@ -9836,22 +10219,22 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9836
10219
|
chainId: this.chainId
|
9837
10220
|
});
|
9838
10221
|
case 3:
|
9839
|
-
res =
|
10222
|
+
res = _context25.v;
|
9840
10223
|
transferWorkflowRequests.push(res);
|
9841
10224
|
case 4:
|
9842
|
-
|
10225
|
+
_context25.n = 2;
|
9843
10226
|
break;
|
9844
10227
|
case 5:
|
9845
|
-
|
10228
|
+
_context25.n = 7;
|
9846
10229
|
break;
|
9847
10230
|
case 6:
|
9848
|
-
|
9849
|
-
|
9850
|
-
|
10231
|
+
_context25.p = 6;
|
10232
|
+
_t29 = _context25.v;
|
10233
|
+
_iterator6.e(_t29);
|
9851
10234
|
case 7:
|
9852
|
-
|
9853
|
-
|
9854
|
-
return
|
10235
|
+
_context25.p = 7;
|
10236
|
+
_iterator6.f();
|
10237
|
+
return _context25.f(7);
|
9855
10238
|
case 8:
|
9856
10239
|
/**
|
9857
10240
|
* Extract royalty distribution requests from workflow responses that contain royalty shares
|
@@ -9869,7 +10252,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9869
10252
|
deadline: res.extraData.deadline
|
9870
10253
|
};
|
9871
10254
|
}); // Process initial registration transactions
|
9872
|
-
|
10255
|
+
_context25.n = 9;
|
9873
10256
|
return handleMulticall({
|
9874
10257
|
transferWorkflowRequests: transferWorkflowRequests,
|
9875
10258
|
multicall3Address: this.multicall3Client.address,
|
@@ -9880,23 +10263,23 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9880
10263
|
chainId: this.chainId
|
9881
10264
|
});
|
9882
10265
|
case 9:
|
9883
|
-
_yield$handleMultical =
|
10266
|
+
_yield$handleMultical = _context25.v;
|
9884
10267
|
txResponses = _yield$handleMultical.response;
|
9885
10268
|
aggregateRegistrationRequest = _yield$handleMultical.aggregateRegistrationRequest;
|
9886
10269
|
responses = [];
|
9887
10270
|
royaltyTokensDistributionRequests = []; // Process each transaction response
|
9888
|
-
|
9889
|
-
|
9890
|
-
|
10271
|
+
_iterator7 = _createForOfIteratorHelper(txResponses);
|
10272
|
+
_context25.p = 10;
|
10273
|
+
_iterator7.s();
|
9891
10274
|
case 11:
|
9892
|
-
if ((
|
9893
|
-
|
10275
|
+
if ((_step7 = _iterator7.n()).done) {
|
10276
|
+
_context25.n = 14;
|
9894
10277
|
break;
|
9895
10278
|
}
|
9896
|
-
|
10279
|
+
_step7$value = _step7.value, txHash = _step7$value.txHash, receipt = _step7$value.receipt;
|
9897
10280
|
iPRegisteredLog = this.ipAssetRegistryClient.parseTxIpRegisteredEvent(receipt);
|
9898
10281
|
ipRoyaltyVaultEvent = this.royaltyModuleEventClient.parseTxIpRoyaltyVaultDeployedEvent(receipt); // Prepare royalty distribution if needed
|
9899
|
-
|
10282
|
+
_context25.n = 12;
|
9900
10283
|
return prepareRoyaltyTokensDistributionRequests({
|
9901
10284
|
royaltyDistributionRequests: royaltyDistributionRequests,
|
9902
10285
|
ipRegisteredLog: iPRegisteredLog,
|
@@ -9906,7 +10289,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9906
10289
|
chainId: this.chainId
|
9907
10290
|
});
|
9908
10291
|
case 12:
|
9909
|
-
response =
|
10292
|
+
response = _context25.v;
|
9910
10293
|
royaltyTokensDistributionRequests.push.apply(royaltyTokensDistributionRequests, _toConsumableArray(response));
|
9911
10294
|
responses.push({
|
9912
10295
|
txHash: txHash,
|
@@ -9919,25 +10302,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9919
10302
|
})
|
9920
10303
|
});
|
9921
10304
|
case 13:
|
9922
|
-
|
10305
|
+
_context25.n = 11;
|
9923
10306
|
break;
|
9924
10307
|
case 14:
|
9925
|
-
|
10308
|
+
_context25.n = 16;
|
9926
10309
|
break;
|
9927
10310
|
case 15:
|
9928
|
-
|
9929
|
-
|
9930
|
-
|
10311
|
+
_context25.p = 15;
|
10312
|
+
_t30 = _context25.v;
|
10313
|
+
_iterator7.e(_t30);
|
9931
10314
|
case 16:
|
9932
|
-
|
9933
|
-
|
9934
|
-
return
|
10315
|
+
_context25.p = 16;
|
10316
|
+
_iterator7.f();
|
10317
|
+
return _context25.f(16);
|
9935
10318
|
case 17:
|
9936
10319
|
if (!(royaltyTokensDistributionRequests.length > 0)) {
|
9937
|
-
|
10320
|
+
_context25.n = 19;
|
9938
10321
|
break;
|
9939
10322
|
}
|
9940
|
-
|
10323
|
+
_context25.n = 18;
|
9941
10324
|
return handleMulticall({
|
9942
10325
|
transferWorkflowRequests: royaltyTokensDistributionRequests,
|
9943
10326
|
multicall3Address: this.multicall3Client.address,
|
@@ -9948,29 +10331,29 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9948
10331
|
chainId: this.chainId
|
9949
10332
|
});
|
9950
10333
|
case 18:
|
9951
|
-
_yield$handleMultical2 =
|
10334
|
+
_yield$handleMultical2 = _context25.v;
|
9952
10335
|
txResponse = _yield$handleMultical2.response;
|
9953
10336
|
distributeRoyaltyTokensTxHashes = txResponse.map(function (tx) {
|
9954
10337
|
return tx.txHash;
|
9955
10338
|
});
|
9956
10339
|
case 19:
|
9957
|
-
|
10340
|
+
_context25.n = 20;
|
9958
10341
|
return this.processResponses(responses, aggregateRegistrationRequest, ((_request$options10 = request.options) === null || _request$options10 === void 0 || (_request$options10 = _request$options10.wipOptions) === null || _request$options10 === void 0 ? void 0 : _request$options10.useMulticallWhenPossible) !== false);
|
9959
10342
|
case 20:
|
9960
|
-
registrationResults =
|
9961
|
-
return
|
10343
|
+
registrationResults = _context25.v;
|
10344
|
+
return _context25.a(2, _objectSpread2({
|
9962
10345
|
registrationResults: registrationResults
|
9963
10346
|
}, distributeRoyaltyTokensTxHashes && {
|
9964
10347
|
distributeRoyaltyTokensTxHashes: distributeRoyaltyTokensTxHashes
|
9965
10348
|
}));
|
9966
10349
|
case 21:
|
9967
|
-
|
9968
|
-
|
9969
|
-
return
|
10350
|
+
_context25.p = 21;
|
10351
|
+
_t31 = _context25.v;
|
10352
|
+
return _context25.a(2, handleError(_t31, "Failed to batch register IP assets with optimized workflows"));
|
9970
10353
|
}
|
9971
|
-
},
|
10354
|
+
}, _callee25, this, [[10, 15, 16, 17], [1, 6, 7, 8], [0, 21]]);
|
9972
10355
|
}));
|
9973
|
-
function batchRegisterIpAssetsWithOptimizedWorkflows(
|
10356
|
+
function batchRegisterIpAssetsWithOptimizedWorkflows(_x23) {
|
9974
10357
|
return _batchRegisterIpAssetsWithOptimizedWorkflows.apply(this, arguments);
|
9975
10358
|
}
|
9976
10359
|
return batchRegisterIpAssetsWithOptimizedWorkflows;
|
@@ -9978,48 +10361,48 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
9978
10361
|
}, {
|
9979
10362
|
key: "getLicenseTermsId",
|
9980
10363
|
value: function () {
|
9981
|
-
var _getLicenseTermsId = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
9982
|
-
var licenseTermsIds,
|
9983
|
-
return _regenerator().w(function (
|
9984
|
-
while (1) switch (
|
10364
|
+
var _getLicenseTermsId = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26(licenseTerms) {
|
10365
|
+
var licenseTermsIds, _iterator8, _step8, licenseTerm, licenseRes, _t32;
|
10366
|
+
return _regenerator().w(function (_context26) {
|
10367
|
+
while (1) switch (_context26.p = _context26.n) {
|
9985
10368
|
case 0:
|
9986
10369
|
licenseTermsIds = [];
|
9987
|
-
|
9988
|
-
|
9989
|
-
|
10370
|
+
_iterator8 = _createForOfIteratorHelper(licenseTerms);
|
10371
|
+
_context26.p = 1;
|
10372
|
+
_iterator8.s();
|
9990
10373
|
case 2:
|
9991
|
-
if ((
|
9992
|
-
|
10374
|
+
if ((_step8 = _iterator8.n()).done) {
|
10375
|
+
_context26.n = 5;
|
9993
10376
|
break;
|
9994
10377
|
}
|
9995
|
-
licenseTerm =
|
9996
|
-
|
10378
|
+
licenseTerm = _step8.value;
|
10379
|
+
_context26.n = 3;
|
9997
10380
|
return this.licenseTemplateClient.getLicenseTermsId({
|
9998
10381
|
terms: licenseTerm
|
9999
10382
|
});
|
10000
10383
|
case 3:
|
10001
|
-
licenseRes =
|
10384
|
+
licenseRes = _context26.v;
|
10002
10385
|
licenseTermsIds.push(licenseRes.selectedLicenseTermsId);
|
10003
10386
|
case 4:
|
10004
|
-
|
10387
|
+
_context26.n = 2;
|
10005
10388
|
break;
|
10006
10389
|
case 5:
|
10007
|
-
|
10390
|
+
_context26.n = 7;
|
10008
10391
|
break;
|
10009
10392
|
case 6:
|
10010
|
-
|
10011
|
-
|
10012
|
-
|
10393
|
+
_context26.p = 6;
|
10394
|
+
_t32 = _context26.v;
|
10395
|
+
_iterator8.e(_t32);
|
10013
10396
|
case 7:
|
10014
|
-
|
10015
|
-
|
10016
|
-
return
|
10397
|
+
_context26.p = 7;
|
10398
|
+
_iterator8.f();
|
10399
|
+
return _context26.f(7);
|
10017
10400
|
case 8:
|
10018
|
-
return
|
10401
|
+
return _context26.a(2, licenseTermsIds);
|
10019
10402
|
}
|
10020
|
-
},
|
10403
|
+
}, _callee26, this, [[1, 6, 7, 8]]);
|
10021
10404
|
}));
|
10022
|
-
function getLicenseTermsId(
|
10405
|
+
function getLicenseTermsId(_x24) {
|
10023
10406
|
return _getLicenseTermsId.apply(this, arguments);
|
10024
10407
|
}
|
10025
10408
|
return getLicenseTermsId;
|
@@ -10027,13 +10410,13 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10027
10410
|
}, {
|
10028
10411
|
key: "validateLicenseTokenIds",
|
10029
10412
|
value: function () {
|
10030
|
-
var _validateLicenseTokenIds = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
10031
|
-
var newLicenseTokenIds,
|
10032
|
-
return _regenerator().w(function (
|
10033
|
-
while (1) switch (
|
10413
|
+
var _validateLicenseTokenIds = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27(licenseTokenIds) {
|
10414
|
+
var newLicenseTokenIds, _iterator9, _step9, licenseTokenId, tokenOwnerAddress, _t33;
|
10415
|
+
return _regenerator().w(function (_context27) {
|
10416
|
+
while (1) switch (_context27.p = _context27.n) {
|
10034
10417
|
case 0:
|
10035
10418
|
if (!(licenseTokenIds.length === 0)) {
|
10036
|
-
|
10419
|
+
_context27.n = 1;
|
10037
10420
|
break;
|
10038
10421
|
}
|
10039
10422
|
throw new Error("License token IDs must be provided.");
|
@@ -10041,46 +10424,46 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10041
10424
|
newLicenseTokenIds = licenseTokenIds.map(function (id) {
|
10042
10425
|
return BigInt(id);
|
10043
10426
|
});
|
10044
|
-
|
10045
|
-
|
10046
|
-
|
10427
|
+
_iterator9 = _createForOfIteratorHelper(newLicenseTokenIds);
|
10428
|
+
_context27.p = 2;
|
10429
|
+
_iterator9.s();
|
10047
10430
|
case 3:
|
10048
|
-
if ((
|
10049
|
-
|
10431
|
+
if ((_step9 = _iterator9.n()).done) {
|
10432
|
+
_context27.n = 6;
|
10050
10433
|
break;
|
10051
10434
|
}
|
10052
|
-
licenseTokenId =
|
10053
|
-
|
10435
|
+
licenseTokenId = _step9.value;
|
10436
|
+
_context27.n = 4;
|
10054
10437
|
return this.licenseTokenReadOnlyClient.ownerOf({
|
10055
10438
|
tokenId: licenseTokenId
|
10056
10439
|
});
|
10057
10440
|
case 4:
|
10058
|
-
tokenOwnerAddress =
|
10441
|
+
tokenOwnerAddress = _context27.v;
|
10059
10442
|
if (tokenOwnerAddress) {
|
10060
|
-
|
10443
|
+
_context27.n = 5;
|
10061
10444
|
break;
|
10062
10445
|
}
|
10063
10446
|
throw new Error("License token id ".concat(licenseTokenId, " must be owned by the caller."));
|
10064
10447
|
case 5:
|
10065
|
-
|
10448
|
+
_context27.n = 3;
|
10066
10449
|
break;
|
10067
10450
|
case 6:
|
10068
|
-
|
10451
|
+
_context27.n = 8;
|
10069
10452
|
break;
|
10070
10453
|
case 7:
|
10071
|
-
|
10072
|
-
|
10073
|
-
|
10454
|
+
_context27.p = 7;
|
10455
|
+
_t33 = _context27.v;
|
10456
|
+
_iterator9.e(_t33);
|
10074
10457
|
case 8:
|
10075
|
-
|
10076
|
-
|
10077
|
-
return
|
10458
|
+
_context27.p = 8;
|
10459
|
+
_iterator9.f();
|
10460
|
+
return _context27.f(8);
|
10078
10461
|
case 9:
|
10079
|
-
return
|
10462
|
+
return _context27.a(2, newLicenseTokenIds);
|
10080
10463
|
}
|
10081
|
-
},
|
10464
|
+
}, _callee27, this, [[2, 7, 8, 9]]);
|
10082
10465
|
}));
|
10083
|
-
function validateLicenseTokenIds(
|
10466
|
+
function validateLicenseTokenIds(_x25) {
|
10084
10467
|
return _validateLicenseTokenIds.apply(this, arguments);
|
10085
10468
|
}
|
10086
10469
|
return validateLicenseTokenIds;
|
@@ -10103,28 +10486,28 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10103
10486
|
}, {
|
10104
10487
|
key: "handleRegistrationWithFees",
|
10105
10488
|
value: function () {
|
10106
|
-
var _handleRegistrationWithFees = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
10489
|
+
var _handleRegistrationWithFees = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28(_ref5) {
|
10107
10490
|
var _wipOptions$useMultic, _this$getIpIdAndToken, _event$ipId, _event$tokenId;
|
10108
10491
|
var sender, derivData, spgNftContract, spgSpenderAddress, txOptions, wipOptions, encodedTxs, contractCall, totalFees, wipSpenders, useMulticallWhenPossible, nftMintFee, publicMinting, totalDerivativeMintingFee, _yield$contractCallWi, txHash, receipt, event;
|
10109
|
-
return _regenerator().w(function (
|
10110
|
-
while (1) switch (
|
10492
|
+
return _regenerator().w(function (_context28) {
|
10493
|
+
while (1) switch (_context28.n) {
|
10111
10494
|
case 0:
|
10112
|
-
sender =
|
10495
|
+
sender = _ref5.sender, derivData = _ref5.derivData, spgNftContract = _ref5.spgNftContract, spgSpenderAddress = _ref5.spgSpenderAddress, txOptions = _ref5.txOptions, wipOptions = _ref5.wipOptions, encodedTxs = _ref5.encodedTxs, contractCall = _ref5.contractCall;
|
10113
10496
|
totalFees = 0n;
|
10114
10497
|
wipSpenders = [];
|
10115
10498
|
useMulticallWhenPossible = (_wipOptions$useMultic = wipOptions === null || wipOptions === void 0 ? void 0 : wipOptions.useMulticallWhenPossible) !== null && _wipOptions$useMultic !== void 0 ? _wipOptions$useMultic : true; // get spg minting fee
|
10116
10499
|
if (!spgNftContract) {
|
10117
|
-
|
10500
|
+
_context28.n = 3;
|
10118
10501
|
break;
|
10119
10502
|
}
|
10120
|
-
|
10503
|
+
_context28.n = 1;
|
10121
10504
|
return calculateSPGWipMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, spgNftContract));
|
10122
10505
|
case 1:
|
10123
|
-
nftMintFee =
|
10124
|
-
|
10506
|
+
nftMintFee = _context28.v;
|
10507
|
+
_context28.n = 2;
|
10125
10508
|
return getPublicMinting(spgNftContract, this.rpcClient);
|
10126
10509
|
case 2:
|
10127
|
-
publicMinting =
|
10510
|
+
publicMinting = _context28.v;
|
10128
10511
|
/**
|
10129
10512
|
* If the SPG NFT contract's public minting is disabled, we need to check if the caller has the `minter role`.
|
10130
10513
|
* When public minting is disabled, we can't use multicall because we need to perform additional role checks
|
@@ -10143,10 +10526,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10143
10526
|
});
|
10144
10527
|
case 3:
|
10145
10528
|
if (!derivData) {
|
10146
|
-
|
10529
|
+
_context28.n = 5;
|
10147
10530
|
break;
|
10148
10531
|
}
|
10149
|
-
|
10532
|
+
_context28.n = 4;
|
10150
10533
|
return calculateDerivativeMintingFee({
|
10151
10534
|
derivData: derivData,
|
10152
10535
|
rpcClient: this.rpcClient,
|
@@ -10155,7 +10538,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10155
10538
|
sender: sender
|
10156
10539
|
});
|
10157
10540
|
case 4:
|
10158
|
-
totalDerivativeMintingFee =
|
10541
|
+
totalDerivativeMintingFee = _context28.v;
|
10159
10542
|
totalFees += totalDerivativeMintingFee;
|
10160
10543
|
if (totalDerivativeMintingFee > 0) {
|
10161
10544
|
wipSpenders.push({
|
@@ -10165,12 +10548,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10165
10548
|
}
|
10166
10549
|
case 5:
|
10167
10550
|
if (!(totalFees < 0)) {
|
10168
|
-
|
10551
|
+
_context28.n = 6;
|
10169
10552
|
break;
|
10170
10553
|
}
|
10171
10554
|
throw new Error("Total fees for registering derivative should never be negative: ".concat(totalFees));
|
10172
10555
|
case 6:
|
10173
|
-
|
10556
|
+
_context28.n = 7;
|
10174
10557
|
return contractCallWithFees({
|
10175
10558
|
totalFees: totalFees,
|
10176
10559
|
options: {
|
@@ -10188,11 +10571,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10188
10571
|
encodedTxs: encodedTxs
|
10189
10572
|
});
|
10190
10573
|
case 7:
|
10191
|
-
_yield$contractCallWi =
|
10574
|
+
_yield$contractCallWi = _context28.v;
|
10192
10575
|
txHash = _yield$contractCallWi.txHash;
|
10193
10576
|
receipt = _yield$contractCallWi.receipt;
|
10194
10577
|
event = (_this$getIpIdAndToken = this.getIpIdAndTokenIdsFromEvent(receipt)) === null || _this$getIpIdAndToken === void 0 ? void 0 : _this$getIpIdAndToken[0];
|
10195
|
-
return
|
10578
|
+
return _context28.a(2, _objectSpread2({
|
10196
10579
|
txHash: txHash,
|
10197
10580
|
receipt: receipt
|
10198
10581
|
}, event && {
|
@@ -10200,9 +10583,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10200
10583
|
tokenId: (_event$tokenId = event.tokenId) !== null && _event$tokenId !== void 0 ? _event$tokenId : undefined
|
10201
10584
|
}));
|
10202
10585
|
}
|
10203
|
-
},
|
10586
|
+
}, _callee28, this);
|
10204
10587
|
}));
|
10205
|
-
function handleRegistrationWithFees(
|
10588
|
+
function handleRegistrationWithFees(_x26) {
|
10206
10589
|
return _handleRegistrationWithFees.apply(this, arguments);
|
10207
10590
|
}
|
10208
10591
|
return handleRegistrationWithFees;
|
@@ -10210,27 +10593,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10210
10593
|
}, {
|
10211
10594
|
key: "setMaxLicenseTokens",
|
10212
10595
|
value: function () {
|
10213
|
-
var _setMaxLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
10596
|
+
var _setMaxLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29(_ref6) {
|
10214
10597
|
var maxLicenseTokensData, licensorIpId, licenseTermsIds, licenseTermsMaxLimitTxHashes, i, maxLicenseTokens, txHash;
|
10215
|
-
return _regenerator().w(function (
|
10216
|
-
while (1) switch (
|
10598
|
+
return _regenerator().w(function (_context29) {
|
10599
|
+
while (1) switch (_context29.n) {
|
10217
10600
|
case 0:
|
10218
|
-
maxLicenseTokensData =
|
10601
|
+
maxLicenseTokensData = _ref6.maxLicenseTokensData, licensorIpId = _ref6.licensorIpId, licenseTermsIds = _ref6.licenseTermsIds;
|
10219
10602
|
licenseTermsMaxLimitTxHashes = [];
|
10220
10603
|
i = 0;
|
10221
10604
|
case 1:
|
10222
10605
|
if (!(i < maxLicenseTokensData.length)) {
|
10223
|
-
|
10606
|
+
_context29.n = 5;
|
10224
10607
|
break;
|
10225
10608
|
}
|
10226
10609
|
maxLicenseTokens = maxLicenseTokensData[i].maxLicenseTokens;
|
10227
10610
|
if (!(maxLicenseTokens === undefined || maxLicenseTokens < 0n)) {
|
10228
|
-
|
10611
|
+
_context29.n = 2;
|
10229
10612
|
break;
|
10230
10613
|
}
|
10231
|
-
return
|
10614
|
+
return _context29.a(3, 4);
|
10232
10615
|
case 2:
|
10233
|
-
|
10616
|
+
_context29.n = 3;
|
10234
10617
|
return this.totalLicenseTokenLimitHookClient.setTotalLicenseTokenLimit({
|
10235
10618
|
licensorIpId: licensorIpId,
|
10236
10619
|
// The contract now directly writes the `licenseTemplate` address internally,
|
@@ -10240,20 +10623,20 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10240
10623
|
limit: BigInt(maxLicenseTokens)
|
10241
10624
|
});
|
10242
10625
|
case 3:
|
10243
|
-
txHash =
|
10626
|
+
txHash = _context29.v;
|
10244
10627
|
if (txHash) {
|
10245
10628
|
licenseTermsMaxLimitTxHashes.push(txHash);
|
10246
10629
|
}
|
10247
10630
|
case 4:
|
10248
10631
|
i++;
|
10249
|
-
|
10632
|
+
_context29.n = 1;
|
10250
10633
|
break;
|
10251
10634
|
case 5:
|
10252
|
-
return
|
10635
|
+
return _context29.a(2, licenseTermsMaxLimitTxHashes);
|
10253
10636
|
}
|
10254
|
-
},
|
10637
|
+
}, _callee29, this);
|
10255
10638
|
}));
|
10256
|
-
function setMaxLicenseTokens(
|
10639
|
+
function setMaxLicenseTokens(_x27) {
|
10257
10640
|
return _setMaxLicenseTokens.apply(this, arguments);
|
10258
10641
|
}
|
10259
10642
|
return setMaxLicenseTokens;
|
@@ -10264,69 +10647,69 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10264
10647
|
}, {
|
10265
10648
|
key: "processResponses",
|
10266
10649
|
value: (function () {
|
10267
|
-
var _processResponses = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
10268
|
-
var
|
10269
|
-
return _regenerator().w(function (
|
10270
|
-
while (1) switch (
|
10650
|
+
var _processResponses = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30(responses, aggregateRegistrationRequest, useMulticall) {
|
10651
|
+
var _iterator0, _step0, _step0$value, responseIndex, response, _iterator1, _step1, _Object$values$respon, _step1$value, assetIndex, ipAsset, extraData, result, _extraData, i, _response, extraDataItem, _ipAsset, _t34, _t35;
|
10652
|
+
return _regenerator().w(function (_context30) {
|
10653
|
+
while (1) switch (_context30.p = _context30.n) {
|
10271
10654
|
case 0:
|
10272
10655
|
if (!useMulticall) {
|
10273
|
-
|
10656
|
+
_context30.n = 15;
|
10274
10657
|
break;
|
10275
10658
|
}
|
10276
|
-
|
10277
|
-
|
10278
|
-
|
10659
|
+
_iterator0 = _createForOfIteratorHelper(responses.entries());
|
10660
|
+
_context30.p = 1;
|
10661
|
+
_iterator0.s();
|
10279
10662
|
case 2:
|
10280
|
-
if ((
|
10281
|
-
|
10663
|
+
if ((_step0 = _iterator0.n()).done) {
|
10664
|
+
_context30.n = 11;
|
10282
10665
|
break;
|
10283
10666
|
}
|
10284
|
-
|
10285
|
-
|
10286
|
-
|
10287
|
-
|
10667
|
+
_step0$value = _slicedToArray(_step0.value, 2), responseIndex = _step0$value[0], response = _step0$value[1];
|
10668
|
+
_iterator1 = _createForOfIteratorHelper(response.ipAssetsWithLicenseTerms.entries());
|
10669
|
+
_context30.p = 3;
|
10670
|
+
_iterator1.s();
|
10288
10671
|
case 4:
|
10289
|
-
if ((
|
10290
|
-
|
10672
|
+
if ((_step1 = _iterator1.n()).done) {
|
10673
|
+
_context30.n = 7;
|
10291
10674
|
break;
|
10292
10675
|
}
|
10293
|
-
|
10676
|
+
_step1$value = _slicedToArray(_step1.value, 2), assetIndex = _step1$value[0], ipAsset = _step1$value[1];
|
10294
10677
|
extraData = (_Object$values$respon = Object.values(aggregateRegistrationRequest)[responseIndex]) === null || _Object$values$respon === void 0 || (_Object$values$respon = _Object$values$respon.extraData) === null || _Object$values$respon === void 0 ? void 0 : _Object$values$respon[assetIndex];
|
10295
|
-
|
10678
|
+
_context30.n = 5;
|
10296
10679
|
return this.processIpAssetLicenseTerms(ipAsset, extraData);
|
10297
10680
|
case 5:
|
10298
|
-
result =
|
10681
|
+
result = _context30.v;
|
10299
10682
|
responses[responseIndex].ipAssetsWithLicenseTerms[assetIndex] = result;
|
10300
10683
|
case 6:
|
10301
|
-
|
10684
|
+
_context30.n = 4;
|
10302
10685
|
break;
|
10303
10686
|
case 7:
|
10304
|
-
|
10687
|
+
_context30.n = 9;
|
10305
10688
|
break;
|
10306
10689
|
case 8:
|
10307
|
-
|
10308
|
-
|
10309
|
-
|
10690
|
+
_context30.p = 8;
|
10691
|
+
_t34 = _context30.v;
|
10692
|
+
_iterator1.e(_t34);
|
10310
10693
|
case 9:
|
10311
|
-
|
10312
|
-
|
10313
|
-
return
|
10694
|
+
_context30.p = 9;
|
10695
|
+
_iterator1.f();
|
10696
|
+
return _context30.f(9);
|
10314
10697
|
case 10:
|
10315
|
-
|
10698
|
+
_context30.n = 2;
|
10316
10699
|
break;
|
10317
10700
|
case 11:
|
10318
|
-
|
10701
|
+
_context30.n = 13;
|
10319
10702
|
break;
|
10320
10703
|
case 12:
|
10321
|
-
|
10322
|
-
|
10323
|
-
|
10704
|
+
_context30.p = 12;
|
10705
|
+
_t35 = _context30.v;
|
10706
|
+
_iterator0.e(_t35);
|
10324
10707
|
case 13:
|
10325
|
-
|
10326
|
-
|
10327
|
-
return
|
10708
|
+
_context30.p = 13;
|
10709
|
+
_iterator0.f();
|
10710
|
+
return _context30.f(13);
|
10328
10711
|
case 14:
|
10329
|
-
|
10712
|
+
_context30.n = 19;
|
10330
10713
|
break;
|
10331
10714
|
case 15:
|
10332
10715
|
_extraData = [];
|
@@ -10337,26 +10720,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10337
10720
|
i = 0;
|
10338
10721
|
case 16:
|
10339
10722
|
if (!(i < responses.length)) {
|
10340
|
-
|
10723
|
+
_context30.n = 19;
|
10341
10724
|
break;
|
10342
10725
|
}
|
10343
10726
|
_response = responses[i];
|
10344
10727
|
extraDataItem = _extraData[i];
|
10345
|
-
|
10728
|
+
_context30.n = 17;
|
10346
10729
|
return this.processIpAssetLicenseTerms(_response.ipAssetsWithLicenseTerms[0], extraDataItem);
|
10347
10730
|
case 17:
|
10348
|
-
_ipAsset =
|
10731
|
+
_ipAsset = _context30.v;
|
10349
10732
|
responses[i].ipAssetsWithLicenseTerms[0] = _ipAsset;
|
10350
10733
|
case 18:
|
10351
10734
|
i++;
|
10352
|
-
|
10735
|
+
_context30.n = 16;
|
10353
10736
|
break;
|
10354
10737
|
case 19:
|
10355
|
-
return
|
10738
|
+
return _context30.a(2, responses);
|
10356
10739
|
}
|
10357
|
-
},
|
10740
|
+
}, _callee30, this, [[3, 8, 9, 10], [1, 12, 13, 14]]);
|
10358
10741
|
}));
|
10359
|
-
function processResponses(
|
10742
|
+
function processResponses(_x28, _x29, _x30) {
|
10360
10743
|
return _processResponses.apply(this, arguments);
|
10361
10744
|
}
|
10362
10745
|
return processResponses;
|
@@ -10364,31 +10747,31 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10364
10747
|
}, {
|
10365
10748
|
key: "processIpAssetLicenseTerms",
|
10366
10749
|
value: function () {
|
10367
|
-
var _processIpAssetLicenseTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
10750
|
+
var _processIpAssetLicenseTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(ipAsset, extraData) {
|
10368
10751
|
var _extraData$licenseTer;
|
10369
10752
|
var licenseTermsIds, maxLicenseTokens, maxLicenseTokensData, maxLicenseTokensTxHashes;
|
10370
|
-
return _regenerator().w(function (
|
10371
|
-
while (1) switch (
|
10753
|
+
return _regenerator().w(function (_context31) {
|
10754
|
+
while (1) switch (_context31.n) {
|
10372
10755
|
case 0:
|
10373
10756
|
if (extraData !== null && extraData !== void 0 && (_extraData$licenseTer = extraData.licenseTermsData) !== null && _extraData$licenseTer !== void 0 && _extraData$licenseTer.length) {
|
10374
|
-
|
10757
|
+
_context31.n = 1;
|
10375
10758
|
break;
|
10376
10759
|
}
|
10377
|
-
return
|
10760
|
+
return _context31.a(2, ipAsset);
|
10378
10761
|
case 1:
|
10379
|
-
|
10762
|
+
_context31.n = 2;
|
10380
10763
|
return this.getLicenseTermsId(extraData.licenseTermsData.map(function (item) {
|
10381
10764
|
return item.terms;
|
10382
10765
|
}));
|
10383
10766
|
case 2:
|
10384
|
-
licenseTermsIds =
|
10767
|
+
licenseTermsIds = _context31.v;
|
10385
10768
|
ipAsset.licenseTermsIds = licenseTermsIds;
|
10386
10769
|
maxLicenseTokens = extraData.maxLicenseTokens;
|
10387
10770
|
if (maxLicenseTokens !== null && maxLicenseTokens !== void 0 && maxLicenseTokens.length) {
|
10388
|
-
|
10771
|
+
_context31.n = 3;
|
10389
10772
|
break;
|
10390
10773
|
}
|
10391
|
-
return
|
10774
|
+
return _context31.a(2, ipAsset);
|
10392
10775
|
case 3:
|
10393
10776
|
maxLicenseTokensData = maxLicenseTokens.filter(function (maxLicenseToken) {
|
10394
10777
|
return maxLicenseToken !== undefined;
|
@@ -10397,22 +10780,22 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
10397
10780
|
maxLicenseTokens: maxLicenseToken
|
10398
10781
|
};
|
10399
10782
|
});
|
10400
|
-
|
10783
|
+
_context31.n = 4;
|
10401
10784
|
return this.setMaxLicenseTokens({
|
10402
10785
|
maxLicenseTokensData: maxLicenseTokensData,
|
10403
10786
|
licensorIpId: ipAsset.ipId,
|
10404
10787
|
licenseTermsIds: licenseTermsIds
|
10405
10788
|
});
|
10406
10789
|
case 4:
|
10407
|
-
maxLicenseTokensTxHashes =
|
10790
|
+
maxLicenseTokensTxHashes = _context31.v;
|
10408
10791
|
if (maxLicenseTokensTxHashes !== null && maxLicenseTokensTxHashes !== void 0 && maxLicenseTokensTxHashes.length) {
|
10409
10792
|
ipAsset.maxLicenseTokensTxHashes = maxLicenseTokensTxHashes;
|
10410
10793
|
}
|
10411
|
-
return
|
10794
|
+
return _context31.a(2, ipAsset);
|
10412
10795
|
}
|
10413
|
-
},
|
10796
|
+
}, _callee31, this);
|
10414
10797
|
}));
|
10415
|
-
function processIpAssetLicenseTerms(
|
10798
|
+
function processIpAssetLicenseTerms(_x31, _x32) {
|
10416
10799
|
return _processIpAssetLicenseTerms.apply(this, arguments);
|
10417
10800
|
}
|
10418
10801
|
return processIpAssetLicenseTerms;
|
@@ -10447,37 +10830,22 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10447
10830
|
key: "registerPILTerms",
|
10448
10831
|
value: (function () {
|
10449
10832
|
var _registerPILTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request) {
|
10450
|
-
var object,
|
10833
|
+
var object, _t;
|
10451
10834
|
return _regenerator().w(function (_context) {
|
10452
|
-
while (1) switch (_context.n) {
|
10835
|
+
while (1) switch (_context.p = _context.n) {
|
10453
10836
|
case 0:
|
10454
10837
|
_context.p = 0;
|
10838
|
+
object = PILFlavor.validateLicenseTerms(request, this.chainId);
|
10455
10839
|
_context.n = 1;
|
10456
|
-
return validateLicenseTerms(request, this.rpcClient);
|
10457
|
-
case 1:
|
10458
|
-
object = _context.v;
|
10459
|
-
_context.n = 2;
|
10460
|
-
return this.getLicenseTermsId(object);
|
10461
|
-
case 2:
|
10462
|
-
licenseTermsId = _context.v;
|
10463
|
-
if (!(licenseTermsId !== 0n)) {
|
10464
|
-
_context.n = 3;
|
10465
|
-
break;
|
10466
|
-
}
|
10467
|
-
return _context.a(2, {
|
10468
|
-
licenseTermsId: licenseTermsId
|
10469
|
-
});
|
10470
|
-
case 3:
|
10471
|
-
_context.n = 4;
|
10472
10840
|
return this.registerPILTermsHelper(object, request.txOptions);
|
10473
|
-
case
|
10841
|
+
case 1:
|
10474
10842
|
return _context.a(2, _context.v);
|
10475
|
-
case
|
10476
|
-
_context.p =
|
10843
|
+
case 2:
|
10844
|
+
_context.p = 2;
|
10477
10845
|
_t = _context.v;
|
10478
10846
|
return _context.a(2, handleError(_t, "Failed to register license terms"));
|
10479
10847
|
}
|
10480
|
-
}, _callee, this, [[0,
|
10848
|
+
}, _callee, this, [[0, 2]]);
|
10481
10849
|
}));
|
10482
10850
|
function registerPILTerms(_x) {
|
10483
10851
|
return _registerPILTerms.apply(this, arguments);
|
@@ -10485,6 +10853,9 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10485
10853
|
return registerPILTerms;
|
10486
10854
|
}()
|
10487
10855
|
/**
|
10856
|
+
* @deprecated Use {@link PILFlavor.nonCommercialSocialRemixing} with {@link LicenseClient.registerPILTerms} instead.
|
10857
|
+
* The method will be removed in the `v1.4.0`.
|
10858
|
+
*
|
10488
10859
|
* Convenient function to register a PIL non commercial social remix license to the registry
|
10489
10860
|
*
|
10490
10861
|
* For more details, see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#flavor-%231%3A-non-commercial-social-remixing | Non Commercial Social Remixing}.
|
@@ -10498,10 +10869,10 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10498
10869
|
var _registerNonComSocialRemixingPIL = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(request) {
|
10499
10870
|
var licenseTerms, _t2;
|
10500
10871
|
return _regenerator().w(function (_context2) {
|
10501
|
-
while (1) switch (_context2.n) {
|
10872
|
+
while (1) switch (_context2.p = _context2.n) {
|
10502
10873
|
case 0:
|
10503
10874
|
_context2.p = 0;
|
10504
|
-
licenseTerms =
|
10875
|
+
licenseTerms = PILFlavor.nonCommercialSocialRemixing();
|
10505
10876
|
_context2.n = 1;
|
10506
10877
|
return this.registerPILTermsHelper(licenseTerms, request === null || request === void 0 ? void 0 : request.txOptions);
|
10507
10878
|
case 1:
|
@@ -10519,6 +10890,9 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10519
10890
|
return registerNonComSocialRemixingPIL;
|
10520
10891
|
}()
|
10521
10892
|
/**
|
10893
|
+
* @deprecated Use {@link PILFlavor.commercialUse} with {@link LicenseClient.registerPILTerms} instead.
|
10894
|
+
* The method will be removed in the `v1.4.0`.
|
10895
|
+
*
|
10522
10896
|
* Convenient function to register a PIL commercial use license to the registry.
|
10523
10897
|
*
|
10524
10898
|
* For more details, see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#flavor-%232%3A-commercial-use | Commercial Use}.
|
@@ -10532,13 +10906,13 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10532
10906
|
var _registerCommercialUsePIL = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
10533
10907
|
var licenseTerms, _t3;
|
10534
10908
|
return _regenerator().w(function (_context3) {
|
10535
|
-
while (1) switch (_context3.n) {
|
10909
|
+
while (1) switch (_context3.p = _context3.n) {
|
10536
10910
|
case 0:
|
10537
10911
|
_context3.p = 0;
|
10538
|
-
licenseTerms =
|
10539
|
-
defaultMintingFee: request.defaultMintingFee,
|
10912
|
+
licenseTerms = PILFlavor.commercialUse({
|
10913
|
+
defaultMintingFee: Number(request.defaultMintingFee),
|
10540
10914
|
currency: request.currency,
|
10541
|
-
|
10915
|
+
royaltyPolicy: request.royaltyPolicyAddress
|
10542
10916
|
});
|
10543
10917
|
_context3.n = 1;
|
10544
10918
|
return this.registerPILTermsHelper(licenseTerms, request.txOptions);
|
@@ -10557,6 +10931,9 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10557
10931
|
return registerCommercialUsePIL;
|
10558
10932
|
}()
|
10559
10933
|
/**
|
10934
|
+
* @deprecated Use {@link PILFlavor.commercialRemix} with {@link LicenseClient.registerPILTerms} instead.
|
10935
|
+
* The method will be removed in the v1.4.0.
|
10936
|
+
*
|
10560
10937
|
* Convenient function to register a PIL commercial Remix license to the registry.
|
10561
10938
|
*
|
10562
10939
|
* For more details, see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#flavor-%233%3A-commercial-remix | Commercial Remix }.
|
@@ -10567,28 +10944,29 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10567
10944
|
}, {
|
10568
10945
|
key: "registerCommercialRemixPIL",
|
10569
10946
|
value: (function () {
|
10570
|
-
var _registerCommercialRemixPIL = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(
|
10571
|
-
var licenseTerms, _t4;
|
10947
|
+
var _registerCommercialRemixPIL = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref) {
|
10948
|
+
var defaultMintingFee, currency, royaltyPolicyAddress, commercialRevShare, txOptions, licenseTerms, _t4;
|
10572
10949
|
return _regenerator().w(function (_context4) {
|
10573
|
-
while (1) switch (_context4.n) {
|
10950
|
+
while (1) switch (_context4.p = _context4.n) {
|
10574
10951
|
case 0:
|
10575
|
-
|
10576
|
-
|
10577
|
-
|
10578
|
-
|
10579
|
-
|
10580
|
-
|
10952
|
+
defaultMintingFee = _ref.defaultMintingFee, currency = _ref.currency, royaltyPolicyAddress = _ref.royaltyPolicyAddress, commercialRevShare = _ref.commercialRevShare, txOptions = _ref.txOptions;
|
10953
|
+
_context4.p = 1;
|
10954
|
+
licenseTerms = PILFlavor.commercialRemix({
|
10955
|
+
defaultMintingFee: Number(defaultMintingFee),
|
10956
|
+
currency: currency,
|
10957
|
+
royaltyPolicy: royaltyPolicyAddress,
|
10958
|
+
commercialRevShare: commercialRevShare
|
10581
10959
|
});
|
10582
|
-
_context4.n =
|
10583
|
-
return this.registerPILTermsHelper(licenseTerms,
|
10584
|
-
case 1:
|
10585
|
-
return _context4.a(2, _context4.v);
|
10960
|
+
_context4.n = 2;
|
10961
|
+
return this.registerPILTermsHelper(licenseTerms, txOptions);
|
10586
10962
|
case 2:
|
10587
|
-
_context4.
|
10963
|
+
return _context4.a(2, _context4.v);
|
10964
|
+
case 3:
|
10965
|
+
_context4.p = 3;
|
10588
10966
|
_t4 = _context4.v;
|
10589
10967
|
return _context4.a(2, handleError(_t4, "Failed to register commercial remix PIL"));
|
10590
10968
|
}
|
10591
|
-
}, _callee4, this, [[
|
10969
|
+
}, _callee4, this, [[1, 3]]);
|
10592
10970
|
}));
|
10593
10971
|
function registerCommercialRemixPIL(_x4) {
|
10594
10972
|
return _registerCommercialRemixPIL.apply(this, arguments);
|
@@ -10596,6 +10974,9 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10596
10974
|
return registerCommercialRemixPIL;
|
10597
10975
|
}()
|
10598
10976
|
/**
|
10977
|
+
* @deprecated Use {@link PILFlavor.creativeCommonsAttribution} with {@link LicenseClient.registerPILTerms} instead.
|
10978
|
+
* The method will be removed in the `v1.4.0`.
|
10979
|
+
*
|
10599
10980
|
* Convenient function to register a PIL creative commons attribution license to the registry.
|
10600
10981
|
* Creates a Creative Commons Attribution (CC-BY) license terms flavor.
|
10601
10982
|
*
|
@@ -10607,17 +10988,17 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10607
10988
|
}, {
|
10608
10989
|
key: "registerCreativeCommonsAttributionPIL",
|
10609
10990
|
value: (function () {
|
10610
|
-
var _registerCreativeCommonsAttributionPIL = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(
|
10991
|
+
var _registerCreativeCommonsAttributionPIL = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref2) {
|
10611
10992
|
var currency, royaltyPolicyAddress, txOptions, _t5;
|
10612
10993
|
return _regenerator().w(function (_context5) {
|
10613
|
-
while (1) switch (_context5.n) {
|
10994
|
+
while (1) switch (_context5.p = _context5.n) {
|
10614
10995
|
case 0:
|
10615
|
-
currency =
|
10996
|
+
currency = _ref2.currency, royaltyPolicyAddress = _ref2.royaltyPolicyAddress, txOptions = _ref2.txOptions;
|
10616
10997
|
_context5.p = 1;
|
10617
10998
|
_context5.n = 2;
|
10618
|
-
return this.registerPILTermsHelper(
|
10999
|
+
return this.registerPILTermsHelper(PILFlavor.creativeCommonsAttribution({
|
10619
11000
|
currency: currency,
|
10620
|
-
|
11001
|
+
royaltyPolicy: royaltyPolicyAddress
|
10621
11002
|
}), txOptions);
|
10622
11003
|
case 2:
|
10623
11004
|
return _context5.a(2, _context5.v);
|
@@ -10643,7 +11024,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10643
11024
|
var _attachLicenseTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(request) {
|
10644
11025
|
var _request$txOptions, isRegistered, isExisted, isAttachedLicenseTerms, req, txHash, _t6;
|
10645
11026
|
return _regenerator().w(function (_context6) {
|
10646
|
-
while (1) switch (_context6.n) {
|
11027
|
+
while (1) switch (_context6.p = _context6.n) {
|
10647
11028
|
case 0:
|
10648
11029
|
_context6.p = 0;
|
10649
11030
|
request.licenseTermsId = BigInt(request.licenseTermsId);
|
@@ -10753,7 +11134,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10753
11134
|
var _this = this;
|
10754
11135
|
var _request$txOptions2, _request$options, receiver, req, isLicenseIpIdRegistered, isExisted, ipAccount, ipOwner, isAttachedLicenseTerms, encodedTxData, licenseMintingFee, wipSpenders, _yield$contractCallWi, txHash, receipt, targetLogs, startLicenseTokenId, licenseTokenIds, i, _t7;
|
10755
11136
|
return _regenerator().w(function (_context7) {
|
10756
|
-
while (1) switch (_context7.n) {
|
11137
|
+
while (1) switch (_context7.p = _context7.n) {
|
10757
11138
|
case 0:
|
10758
11139
|
_context7.p = 0;
|
10759
11140
|
receiver = validateAddress(request.receiver || this.walletAddress);
|
@@ -10761,7 +11142,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10761
11142
|
licensorIpId: validateAddress(request.licensorIpId),
|
10762
11143
|
licenseTemplate: validateAddress(request.licenseTemplate || this.licenseTemplateClient.address),
|
10763
11144
|
licenseTermsId: BigInt(request.licenseTermsId),
|
10764
|
-
amount: BigInt(request.amount
|
11145
|
+
amount: BigInt(request.amount === undefined ? 1 : request.amount),
|
10765
11146
|
receiver: receiver,
|
10766
11147
|
royaltyContext: viem.zeroAddress,
|
10767
11148
|
maxMintingFee: BigInt(request.maxMintingFee),
|
@@ -10899,7 +11280,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10899
11280
|
var _getLicenseTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(selectedLicenseTermsId) {
|
10900
11281
|
var _t8;
|
10901
11282
|
return _regenerator().w(function (_context8) {
|
10902
|
-
while (1) switch (_context8.n) {
|
11283
|
+
while (1) switch (_context8.p = _context8.n) {
|
10903
11284
|
case 0:
|
10904
11285
|
_context8.p = 0;
|
10905
11286
|
_context8.n = 1;
|
@@ -10930,7 +11311,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10930
11311
|
var _predictMintingLicenseFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(request) {
|
10931
11312
|
var isLicenseIpIdRegistered, licenseTermsId, isExisted, object, _t9;
|
10932
11313
|
return _regenerator().w(function (_context9) {
|
10933
|
-
while (1) switch (_context9.n) {
|
11314
|
+
while (1) switch (_context9.p = _context9.n) {
|
10934
11315
|
case 0:
|
10935
11316
|
_context9.p = 0;
|
10936
11317
|
_context9.n = 1;
|
@@ -10996,7 +11377,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
10996
11377
|
var _setLicensingConfig = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(request) {
|
10997
11378
|
var _request$txOptions3, req, isLicenseIpIdRegistered, isExisted, isRegistered, txHash, _t0;
|
10998
11379
|
return _regenerator().w(function (_context0) {
|
10999
|
-
while (1) switch (_context0.n) {
|
11380
|
+
while (1) switch (_context0.p = _context0.n) {
|
11000
11381
|
case 0:
|
11001
11382
|
_context0.p = 0;
|
11002
11383
|
req = {
|
@@ -11108,12 +11489,12 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
11108
11489
|
}, {
|
11109
11490
|
key: "setMaxLicenseTokens",
|
11110
11491
|
value: (function () {
|
11111
|
-
var _setMaxLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(
|
11492
|
+
var _setMaxLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(_ref3) {
|
11112
11493
|
var ipId, licenseTermsId, maxLicenseTokens, licenseTemplate, txOptions, newLicenseTermsId, newLicenseTemplate, licensingConfig, txHash, _t1;
|
11113
11494
|
return _regenerator().w(function (_context1) {
|
11114
|
-
while (1) switch (_context1.n) {
|
11495
|
+
while (1) switch (_context1.p = _context1.n) {
|
11115
11496
|
case 0:
|
11116
|
-
ipId =
|
11497
|
+
ipId = _ref3.ipId, licenseTermsId = _ref3.licenseTermsId, maxLicenseTokens = _ref3.maxLicenseTokens, licenseTemplate = _ref3.licenseTemplate, txOptions = _ref3.txOptions;
|
11117
11498
|
_context1.p = 1;
|
11118
11499
|
if (!(maxLicenseTokens < 0)) {
|
11119
11500
|
_context1.n = 2;
|
@@ -11141,7 +11522,8 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
11141
11522
|
licenseTermsId: newLicenseTermsId,
|
11142
11523
|
licenseTemplate: newLicenseTemplate,
|
11143
11524
|
licensingConfig: _objectSpread2(_objectSpread2({}, licensingConfig), {}, {
|
11144
|
-
licensingHook: this.totalLicenseTokenLimitHookClient.address
|
11525
|
+
licensingHook: this.totalLicenseTokenLimitHookClient.address,
|
11526
|
+
expectMinimumGroupRewardShare: licensingConfig.expectMinimumGroupRewardShare / 1000000
|
11145
11527
|
})
|
11146
11528
|
});
|
11147
11529
|
case 4:
|
@@ -11177,7 +11559,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
11177
11559
|
var _getLicensingConfig = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(request) {
|
11178
11560
|
var licensingConfigParam, _t10;
|
11179
11561
|
return _regenerator().w(function (_context10) {
|
11180
|
-
while (1) switch (_context10.n) {
|
11562
|
+
while (1) switch (_context10.p = _context10.n) {
|
11181
11563
|
case 0:
|
11182
11564
|
_context10.p = 0;
|
11183
11565
|
licensingConfigParam = {
|
@@ -11307,7 +11689,7 @@ var NftClient = /*#__PURE__*/function () {
|
|
11307
11689
|
var _createNFTCollection = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request) {
|
11308
11690
|
var _request$baseURI, _request$maxSupply, _request$mintFee, _request$mintFeeToken, _request$txOptions, object, txHash, txReceipt, targetLogs, _t;
|
11309
11691
|
return _regenerator().w(function (_context) {
|
11310
|
-
while (1) switch (_context.n) {
|
11692
|
+
while (1) switch (_context.p = _context.n) {
|
11311
11693
|
case 0:
|
11312
11694
|
_context.p = 0;
|
11313
11695
|
if (!(request.mintFee !== undefined && (request.mintFee < 0n || request.mintFeeToken === viem.zeroAddress || !viem.isAddress(request.mintFeeToken || "")))) {
|
@@ -11428,7 +11810,7 @@ var NftClient = /*#__PURE__*/function () {
|
|
11428
11810
|
var _setTokenURI = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref) {
|
11429
11811
|
var tokenId, tokenURI, spgNftContract, txOptions, spgNftClient, txHash, _t2;
|
11430
11812
|
return _regenerator().w(function (_context4) {
|
11431
|
-
while (1) switch (_context4.n) {
|
11813
|
+
while (1) switch (_context4.p = _context4.n) {
|
11432
11814
|
case 0:
|
11433
11815
|
tokenId = _ref.tokenId, tokenURI = _ref.tokenURI, spgNftContract = _ref.spgNftContract, txOptions = _ref.txOptions;
|
11434
11816
|
_context4.p = 1;
|
@@ -11514,7 +11896,7 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
11514
11896
|
var _setPermission = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request) {
|
11515
11897
|
var _request$txOptions, req, txHash, _t;
|
11516
11898
|
return _regenerator().w(function (_context) {
|
11517
|
-
while (1) switch (_context.n) {
|
11899
|
+
while (1) switch (_context.p = _context.n) {
|
11518
11900
|
case 0:
|
11519
11901
|
_context.p = 0;
|
11520
11902
|
_context.n = 1;
|
@@ -11577,7 +11959,7 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
11577
11959
|
var _createSetPermissionSignature = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(request) {
|
11578
11960
|
var _request$txOptions2, ipId, signer, to, txOptions, func, permission, deadline, ipAccountClient, data, _yield$ipAccountClien, state, blockTimestamp, calculatedDeadline, _yield$getPermissionS, signature, req, txHash, _t2;
|
11579
11961
|
return _regenerator().w(function (_context2) {
|
11580
|
-
while (1) switch (_context2.n) {
|
11962
|
+
while (1) switch (_context2.p = _context2.n) {
|
11581
11963
|
case 0:
|
11582
11964
|
_context2.p = 0;
|
11583
11965
|
ipId = request.ipId, signer = request.signer, to = request.to, txOptions = request.txOptions, func = request.func, permission = request.permission, deadline = request.deadline;
|
@@ -11676,7 +12058,7 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
11676
12058
|
var _setAllPermissions = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
11677
12059
|
var _request$txOptions3, req, txHash, _t3;
|
11678
12060
|
return _regenerator().w(function (_context3) {
|
11679
|
-
while (1) switch (_context3.n) {
|
12061
|
+
while (1) switch (_context3.p = _context3.n) {
|
11680
12062
|
case 0:
|
11681
12063
|
_context3.p = 0;
|
11682
12064
|
_context3.n = 1;
|
@@ -11737,7 +12119,7 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
11737
12119
|
var _setBatchPermissions = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(request) {
|
11738
12120
|
var _request$txOptions4, permissions, txOptions, _iterator, _step, permission, req, txHash, _t4, _t5;
|
11739
12121
|
return _regenerator().w(function (_context4) {
|
11740
|
-
while (1) switch (_context4.n) {
|
12122
|
+
while (1) switch (_context4.p = _context4.n) {
|
11741
12123
|
case 0:
|
11742
12124
|
_context4.p = 0;
|
11743
12125
|
permissions = request.permissions, txOptions = request.txOptions;
|
@@ -11828,7 +12210,7 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
11828
12210
|
var _createBatchPermissionSignature = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(request) {
|
11829
12211
|
var _request$txOptions5, permissions, deadline, ipId, txOptions, _iterator2, _step2, permission, ipAccountClient, data, _yield$ipAccountClien2, state, blockTimestamp, calculatedDeadline, _yield$getPermissionS2, signature, req, txHash, _t6, _t7;
|
11830
12212
|
return _regenerator().w(function (_context5) {
|
11831
|
-
while (1) switch (_context5.n) {
|
12213
|
+
while (1) switch (_context5.p = _context5.n) {
|
11832
12214
|
case 0:
|
11833
12215
|
_context5.p = 0;
|
11834
12216
|
permissions = request.permissions, deadline = request.deadline, ipId = request.ipId, txOptions = request.txOptions;
|
@@ -11972,32 +12354,6 @@ var PermissionClient = /*#__PURE__*/function () {
|
|
11972
12354
|
}]);
|
11973
12355
|
}();
|
11974
12356
|
|
11975
|
-
/** The amount of revenue token claimable. */
|
11976
|
-
|
11977
|
-
/**
|
11978
|
-
* Native royalty policy created by the Story team
|
11979
|
-
*/
|
11980
|
-
var NativeRoyaltyPolicy = /*#__PURE__*/function (NativeRoyaltyPolicy) {
|
11981
|
-
NativeRoyaltyPolicy[NativeRoyaltyPolicy["LAP"] = 0] = "LAP";
|
11982
|
-
NativeRoyaltyPolicy[NativeRoyaltyPolicy["LRP"] = 1] = "LRP";
|
11983
|
-
return NativeRoyaltyPolicy;
|
11984
|
-
}({});
|
11985
|
-
|
11986
|
-
/**
|
11987
|
-
* Allow custom royalty policy address or use a native royalty policy enum
|
11988
|
-
*/
|
11989
|
-
|
11990
|
-
var royaltyPolicyInputToAddress = function royaltyPolicyInputToAddress(input, chainId) {
|
11991
|
-
switch (input) {
|
11992
|
-
case NativeRoyaltyPolicy.LAP:
|
11993
|
-
return royaltyPolicyLapAddress[chain[chainId]];
|
11994
|
-
case NativeRoyaltyPolicy.LRP:
|
11995
|
-
return royaltyPolicyLrpAddress[chain[chainId]];
|
11996
|
-
default:
|
11997
|
-
return validateAddress(input);
|
11998
|
-
}
|
11999
|
-
};
|
12000
|
-
|
12001
12357
|
var RoyaltyClient = /*#__PURE__*/function () {
|
12002
12358
|
function RoyaltyClient(rpcClient, wallet, chainId) {
|
12003
12359
|
_classCallCheck(this, RoyaltyClient);
|
@@ -12030,7 +12386,7 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
12030
12386
|
var _claimAllRevenue = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(req) {
|
12031
12387
|
var _req$claimOptions, _req$claimOptions2, ancestorIpId, claimer, childIpIds, royaltyPolicies, currencyTokens, txHashes, txHash, receipt, _yield$this$getClaime, ownsClaimer, isClaimerIp, ipAccount, claimedTokens, autoTransfer, autoUnwrapIp, hashes, _hashes, _t;
|
12032
12388
|
return _regenerator().w(function (_context) {
|
12033
|
-
while (1) switch (_context.n) {
|
12389
|
+
while (1) switch (_context.p = _context.n) {
|
12034
12390
|
case 0:
|
12035
12391
|
_context.p = 0;
|
12036
12392
|
ancestorIpId = validateAddress(req.ancestorIpId);
|
@@ -12129,7 +12485,7 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
12129
12485
|
var _this = this;
|
12130
12486
|
var _request$options, _request$claimOptions, _request$claimOptions2, txHashes, receipts, claimedTokens, useMulticallWhenPossible, _iterator, _step, ancestorIp, result, encodedTxs, txHash, receipt, claimedTokenLogs, aggregatedClaimedTokens, claimers, autoTransfer, autoUnwrapIp, wipClaimableAmounts, _iterator2, _step2, _loop, hash, _t2, _t3, _t4;
|
12131
12487
|
return _regenerator().w(function (_context3) {
|
12132
|
-
while (1) switch (_context3.n) {
|
12488
|
+
while (1) switch (_context3.p = _context3.n) {
|
12133
12489
|
case 0:
|
12134
12490
|
_context3.p = 0;
|
12135
12491
|
txHashes = [];
|
@@ -12353,7 +12709,7 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
12353
12709
|
var _this2 = this;
|
12354
12710
|
var _request$txOptions, receiverIpId, payerIpId, token, amount, _request$options2, _request$options3, erc20Options, wipOptions, txOptions, sender, payAmount, isReceiverRegistered, isPayerRegistered, req, encodedTxData, contractCall, tokenSpenders, _t5;
|
12355
12711
|
return _regenerator().w(function (_context4) {
|
12356
|
-
while (1) switch (_context4.n) {
|
12712
|
+
while (1) switch (_context4.p = _context4.n) {
|
12357
12713
|
case 0:
|
12358
12714
|
_context4.p = 0;
|
12359
12715
|
receiverIpId = request.receiverIpId, payerIpId = request.payerIpId, token = request.token, amount = request.amount, _request$options2 = request.options, _request$options3 = _request$options2 === void 0 ? {} : _request$options2, erc20Options = _request$options3.erc20Options, wipOptions = _request$options3.wipOptions, txOptions = request.txOptions;
|
@@ -12457,7 +12813,7 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
12457
12813
|
var _claimableRevenue = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(request) {
|
12458
12814
|
var proxyAddress, ipRoyaltyVault, _t6;
|
12459
12815
|
return _regenerator().w(function (_context5) {
|
12460
|
-
while (1) switch (_context5.n) {
|
12816
|
+
while (1) switch (_context5.p = _context5.n) {
|
12461
12817
|
case 0:
|
12462
12818
|
_context5.p = 0;
|
12463
12819
|
_context5.n = 1;
|
@@ -12726,7 +13082,7 @@ var WipClient = /*#__PURE__*/function () {
|
|
12726
13082
|
var _deposit = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
12727
13083
|
var amount, txOptions, _yield$this$rpcClient, call, txHash, _t;
|
12728
13084
|
return _regenerator().w(function (_context) {
|
12729
|
-
while (1) switch (_context.n) {
|
13085
|
+
while (1) switch (_context.p = _context.n) {
|
12730
13086
|
case 0:
|
12731
13087
|
amount = _ref.amount, txOptions = _ref.txOptions;
|
12732
13088
|
_context.p = 1;
|
@@ -12778,7 +13134,7 @@ var WipClient = /*#__PURE__*/function () {
|
|
12778
13134
|
var _withdraw = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref2) {
|
12779
13135
|
var amount, txOptions, targetAmt, txHash, _t2;
|
12780
13136
|
return _regenerator().w(function (_context2) {
|
12781
|
-
while (1) switch (_context2.n) {
|
13137
|
+
while (1) switch (_context2.p = _context2.n) {
|
12782
13138
|
case 0:
|
12783
13139
|
amount = _ref2.amount, txOptions = _ref2.txOptions;
|
12784
13140
|
_context2.p = 1;
|
@@ -12822,7 +13178,7 @@ var WipClient = /*#__PURE__*/function () {
|
|
12822
13178
|
var _approve = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(req) {
|
12823
13179
|
var amount, spender, txHash, _t3;
|
12824
13180
|
return _regenerator().w(function (_context3) {
|
12825
|
-
while (1) switch (_context3.n) {
|
13181
|
+
while (1) switch (_context3.p = _context3.n) {
|
12826
13182
|
case 0:
|
12827
13183
|
_context3.p = 0;
|
12828
13184
|
amount = BigInt(req.amount);
|
@@ -12895,7 +13251,7 @@ var WipClient = /*#__PURE__*/function () {
|
|
12895
13251
|
var _transfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(request) {
|
12896
13252
|
var amount, txHash, _t4;
|
12897
13253
|
return _regenerator().w(function (_context5) {
|
12898
|
-
while (1) switch (_context5.n) {
|
13254
|
+
while (1) switch (_context5.p = _context5.n) {
|
12899
13255
|
case 0:
|
12900
13256
|
_context5.p = 0;
|
12901
13257
|
amount = BigInt(request.amount);
|
@@ -12939,7 +13295,7 @@ var WipClient = /*#__PURE__*/function () {
|
|
12939
13295
|
var _transferFrom = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(request) {
|
12940
13296
|
var amount, txHash, _t5;
|
12941
13297
|
return _regenerator().w(function (_context6) {
|
12942
|
-
while (1) switch (_context6.n) {
|
13298
|
+
while (1) switch (_context6.p = _context6.n) {
|
12943
13299
|
case 0:
|
12944
13300
|
_context6.p = 0;
|
12945
13301
|
amount = BigInt(request.amount);
|
@@ -13331,6 +13687,26 @@ var AIRelationship = /*#__PURE__*/function (AIRelationship) {
|
|
13331
13687
|
return AIRelationship;
|
13332
13688
|
}({});
|
13333
13689
|
|
13690
|
+
/**
|
13691
|
+
* This structure defines the terms for a Programmable IP License (PIL).
|
13692
|
+
* These terms can be attached to IP Assets.
|
13693
|
+
*
|
13694
|
+
* For more information, see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-terms | PIL}.
|
13695
|
+
**/
|
13696
|
+
|
13697
|
+
/**
|
13698
|
+
* @deprecated Use `PILFlavor.nonCommercialSocialRemixing`, `PILFlavor.commercialUse`, `PILFlavor.commercialRemix`, or `PILFlavor.creativeCommonsAttribution` instead.
|
13699
|
+
*
|
13700
|
+
* The type of PIL.
|
13701
|
+
*/
|
13702
|
+
var PIL_TYPE = /*#__PURE__*/function (PIL_TYPE) {
|
13703
|
+
PIL_TYPE[PIL_TYPE["NON_COMMERCIAL_REMIX"] = 0] = "NON_COMMERCIAL_REMIX";
|
13704
|
+
PIL_TYPE[PIL_TYPE["COMMERCIAL_USE"] = 1] = "COMMERCIAL_USE";
|
13705
|
+
PIL_TYPE[PIL_TYPE["COMMERCIAL_REMIX"] = 2] = "COMMERCIAL_REMIX";
|
13706
|
+
PIL_TYPE[PIL_TYPE["CREATIVE_COMMONS_ATTRIBUTION"] = 3] = "CREATIVE_COMMONS_ATTRIBUTION";
|
13707
|
+
return PIL_TYPE;
|
13708
|
+
}({});
|
13709
|
+
|
13334
13710
|
/**
|
13335
13711
|
* Tags refer to the “labels” that can be applied to IP Assets in the protocol when raising a dispute.
|
13336
13712
|
* Tags must be whitelisted by protocol governance to be used in a dispute.
|
@@ -13369,6 +13745,7 @@ exports.IPAssetClient = IPAssetClient;
|
|
13369
13745
|
exports.LicenseClient = LicenseClient;
|
13370
13746
|
exports.NativeRoyaltyPolicy = NativeRoyaltyPolicy;
|
13371
13747
|
exports.NftClient = NftClient;
|
13748
|
+
exports.PILFlavor = PILFlavor;
|
13372
13749
|
exports.PIL_TYPE = PIL_TYPE;
|
13373
13750
|
exports.PermissionClient = PermissionClient;
|
13374
13751
|
exports.RevShareType = RevShareType;
|