@story-protocol/core-sdk 1.4.0 → 1.4.2
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 +31 -0
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +258 -6
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/group.d.ts +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +52 -25
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +6 -6
- package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/utils/{wip.d.ts → token.d.ts} +16 -10
- package/dist/declarations/src/types/utils/token.d.ts.map +1 -0
- package/dist/story-protocol-core-sdk.cjs.dev.js +1047 -472
- package/dist/story-protocol-core-sdk.cjs.prod.js +1047 -472
- package/dist/story-protocol-core-sdk.esm.js +1047 -472
- package/package.json +1 -1
- package/dist/declarations/src/types/utils/wip.d.ts.map +0 -1
|
@@ -1748,13 +1748,30 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1748
1748
|
*
|
|
1749
1749
|
* @param tokenId uint256
|
|
1750
1750
|
*//**
|
|
1751
|
+
* LicenseTokenApproveRequest
|
|
1752
|
+
*
|
|
1753
|
+
* @param to address
|
|
1754
|
+
* @param tokenId uint256
|
|
1755
|
+
*//**
|
|
1751
1756
|
* contract LicenseToken readonly method
|
|
1752
1757
|
*/var LicenseTokenReadOnlyClient=/*#__PURE__*/function(){function LicenseTokenReadOnlyClient(rpcClient,address){var _rpcClient$chain13;_classCallCheck(this,LicenseTokenReadOnlyClient);this.address=address||getAddress(licenseTokenAddress,(_rpcClient$chain13=rpcClient.chain)===null||_rpcClient$chain13===void 0?void 0:_rpcClient$chain13.id);this.rpcClient=rpcClient;}/**
|
|
1753
1758
|
* method ownerOf for contract LicenseToken
|
|
1754
1759
|
*
|
|
1755
1760
|
* @param request LicenseTokenOwnerOfRequest
|
|
1756
1761
|
* @return Promise<LicenseTokenOwnerOfResponse>
|
|
1757
|
-
*/return _createClass(LicenseTokenReadOnlyClient,[{key:"ownerOf",value:(function(){var _ownerOf=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee98(request){return _regenerator().w(function(_context98){while(1)switch(_context98.n){case 0:_context98.n=1;return this.rpcClient.readContract({abi:licenseTokenAbi,address:this.address,functionName:"ownerOf",args:[request.tokenId]});case 1:return _context98.a(2,_context98.v);}},_callee98,this);}));function ownerOf(_x72){return _ownerOf.apply(this,arguments);}return ownerOf;}())}]);}()
|
|
1762
|
+
*/return _createClass(LicenseTokenReadOnlyClient,[{key:"ownerOf",value:(function(){var _ownerOf=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee98(request){return _regenerator().w(function(_context98){while(1)switch(_context98.n){case 0:_context98.n=1;return this.rpcClient.readContract({abi:licenseTokenAbi,address:this.address,functionName:"ownerOf",args:[request.tokenId]});case 1:return _context98.a(2,_context98.v);}},_callee98,this);}));function ownerOf(_x72){return _ownerOf.apply(this,arguments);}return ownerOf;}())}]);}();/**
|
|
1763
|
+
* contract LicenseToken write method
|
|
1764
|
+
*/var LicenseTokenClient=/*#__PURE__*/function(_LicenseTokenReadOnly){function LicenseTokenClient(rpcClient,wallet,address){var _this0;_classCallCheck(this,LicenseTokenClient);_this0=_callSuper(this,LicenseTokenClient,[rpcClient,address]);_this0.wallet=wallet;return _this0;}/**
|
|
1765
|
+
* method approve for contract LicenseToken
|
|
1766
|
+
*
|
|
1767
|
+
* @param request LicenseTokenApproveRequest
|
|
1768
|
+
* @return Promise<WriteContractReturnType>
|
|
1769
|
+
*/_inherits(LicenseTokenClient,_LicenseTokenReadOnly);return _createClass(LicenseTokenClient,[{key:"approve",value:(function(){var _approve2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee99(request){var _yield$this$rpcClient52,call;return _regenerator().w(function(_context99){while(1)switch(_context99.n){case 0:_context99.n=1;return this.rpcClient.simulateContract({abi:licenseTokenAbi,address:this.address,functionName:"approve",account:this.wallet.account,args:[request.to,request.tokenId]});case 1:_yield$this$rpcClient52=_context99.v;call=_yield$this$rpcClient52.request;_context99.n=2;return this.wallet.writeContract(call);case 2:return _context99.a(2,_context99.v);}},_callee99,this);}));function approve(_x73){return _approve2.apply(this,arguments);}return approve;}()/**
|
|
1770
|
+
* method approve for contract LicenseToken with only encode
|
|
1771
|
+
*
|
|
1772
|
+
* @param request LicenseTokenApproveRequest
|
|
1773
|
+
* @return EncodedTxData
|
|
1774
|
+
*/)},{key:"approveEncode",value:function approveEncode(request){return {to:this.address,data:encodeFunctionData({abi:licenseTokenAbi,functionName:"approve",args:[request.to,request.tokenId]})};}}]);}(LicenseTokenReadOnlyClient);// Contract LicensingModule =============================================================
|
|
1758
1775
|
/**
|
|
1759
1776
|
* LicensingModuleLicenseTermsAttachedEvent
|
|
1760
1777
|
*
|
|
@@ -1845,14 +1862,14 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1845
1862
|
*
|
|
1846
1863
|
* @param request LicensingModulePredictMintingLicenseFeeRequest
|
|
1847
1864
|
* @return Promise<LicensingModulePredictMintingLicenseFeeResponse>
|
|
1848
|
-
*/_inherits(LicensingModuleReadOnlyClient,_LicensingModuleEvent);return _createClass(LicensingModuleReadOnlyClient,[{key:"predictMintingLicenseFee",value:(function(){var _predictMintingLicenseFee=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1865
|
+
*/_inherits(LicensingModuleReadOnlyClient,_LicensingModuleEvent);return _createClass(LicensingModuleReadOnlyClient,[{key:"predictMintingLicenseFee",value:(function(){var _predictMintingLicenseFee=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee100(request){var result;return _regenerator().w(function(_context100){while(1)switch(_context100.n){case 0:_context100.n=1;return this.rpcClient.readContract({abi:licensingModuleAbi,address:this.address,functionName:"predictMintingLicenseFee",args:[request.licensorIpId,request.licenseTemplate,request.licenseTermsId,request.amount,request.receiver,request.royaltyContext]});case 1:result=_context100.v;return _context100.a(2,{currencyToken:result[0],tokenAmount:result[1]});}},_callee100,this);}));function predictMintingLicenseFee(_x74){return _predictMintingLicenseFee.apply(this,arguments);}return predictMintingLicenseFee;}())}]);}(LicensingModuleEventClient);/**
|
|
1849
1866
|
* contract LicensingModule write method
|
|
1850
|
-
*/var LicensingModuleClient=/*#__PURE__*/function(_LicensingModuleReadO){function LicensingModuleClient(rpcClient,wallet,address){var
|
|
1867
|
+
*/var LicensingModuleClient=/*#__PURE__*/function(_LicensingModuleReadO){function LicensingModuleClient(rpcClient,wallet,address){var _this1;_classCallCheck(this,LicensingModuleClient);_this1=_callSuper(this,LicensingModuleClient,[rpcClient,address]);_this1.wallet=wallet;return _this1;}/**
|
|
1851
1868
|
* method attachLicenseTerms for contract LicensingModule
|
|
1852
1869
|
*
|
|
1853
1870
|
* @param request LicensingModuleAttachLicenseTermsRequest
|
|
1854
1871
|
* @return Promise<WriteContractReturnType>
|
|
1855
|
-
*/_inherits(LicensingModuleClient,_LicensingModuleReadO);return _createClass(LicensingModuleClient,[{key:"attachLicenseTerms",value:(function(){var _attachLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1872
|
+
*/_inherits(LicensingModuleClient,_LicensingModuleReadO);return _createClass(LicensingModuleClient,[{key:"attachLicenseTerms",value:(function(){var _attachLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee101(request){var _yield$this$rpcClient53,call;return _regenerator().w(function(_context101){while(1)switch(_context101.n){case 0:_context101.n=1;return this.rpcClient.simulateContract({abi:licensingModuleAbi,address:this.address,functionName:"attachLicenseTerms",account:this.wallet.account,args:[request.ipId,request.licenseTemplate,request.licenseTermsId]});case 1:_yield$this$rpcClient53=_context101.v;call=_yield$this$rpcClient53.request;_context101.n=2;return this.wallet.writeContract(call);case 2:return _context101.a(2,_context101.v);}},_callee101,this);}));function attachLicenseTerms(_x75){return _attachLicenseTerms.apply(this,arguments);}return attachLicenseTerms;}()/**
|
|
1856
1873
|
* method attachLicenseTerms for contract LicensingModule with only encode
|
|
1857
1874
|
*
|
|
1858
1875
|
* @param request LicensingModuleAttachLicenseTermsRequest
|
|
@@ -1862,7 +1879,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1862
1879
|
*
|
|
1863
1880
|
* @param request LicensingModuleMintLicenseTokensRequest
|
|
1864
1881
|
* @return Promise<WriteContractReturnType>
|
|
1865
|
-
*/},{key:"mintLicenseTokens",value:(function(){var _mintLicenseTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1882
|
+
*/},{key:"mintLicenseTokens",value:(function(){var _mintLicenseTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee102(request){var _yield$this$rpcClient54,call;return _regenerator().w(function(_context102){while(1)switch(_context102.n){case 0:_context102.n=1;return this.rpcClient.simulateContract({abi:licensingModuleAbi,address:this.address,functionName:"mintLicenseTokens",account:this.wallet.account,args:[request.licensorIpId,request.licenseTemplate,request.licenseTermsId,request.amount,request.receiver,request.royaltyContext,request.maxMintingFee,request.maxRevenueShare]});case 1:_yield$this$rpcClient54=_context102.v;call=_yield$this$rpcClient54.request;_context102.n=2;return this.wallet.writeContract(call);case 2:return _context102.a(2,_context102.v);}},_callee102,this);}));function mintLicenseTokens(_x76){return _mintLicenseTokens.apply(this,arguments);}return mintLicenseTokens;}()/**
|
|
1866
1883
|
* method mintLicenseTokens for contract LicensingModule with only encode
|
|
1867
1884
|
*
|
|
1868
1885
|
* @param request LicensingModuleMintLicenseTokensRequest
|
|
@@ -1872,7 +1889,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1872
1889
|
*
|
|
1873
1890
|
* @param request LicensingModuleRegisterDerivativeRequest
|
|
1874
1891
|
* @return Promise<WriteContractReturnType>
|
|
1875
|
-
*/},{key:"registerDerivative",value:(function(){var _registerDerivative=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1892
|
+
*/},{key:"registerDerivative",value:(function(){var _registerDerivative=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee103(request){var _yield$this$rpcClient55,call;return _regenerator().w(function(_context103){while(1)switch(_context103.n){case 0:_context103.n=1;return this.rpcClient.simulateContract({abi:licensingModuleAbi,address:this.address,functionName:"registerDerivative",account:this.wallet.account,args:[request.childIpId,request.parentIpIds,request.licenseTermsIds,request.licenseTemplate,request.royaltyContext,request.maxMintingFee,request.maxRts,request.maxRevenueShare]});case 1:_yield$this$rpcClient55=_context103.v;call=_yield$this$rpcClient55.request;_context103.n=2;return this.wallet.writeContract(call);case 2:return _context103.a(2,_context103.v);}},_callee103,this);}));function registerDerivative(_x77){return _registerDerivative.apply(this,arguments);}return registerDerivative;}()/**
|
|
1876
1893
|
* method registerDerivative for contract LicensingModule with only encode
|
|
1877
1894
|
*
|
|
1878
1895
|
* @param request LicensingModuleRegisterDerivativeRequest
|
|
@@ -1882,7 +1899,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1882
1899
|
*
|
|
1883
1900
|
* @param request LicensingModuleRegisterDerivativeWithLicenseTokensRequest
|
|
1884
1901
|
* @return Promise<WriteContractReturnType>
|
|
1885
|
-
*/},{key:"registerDerivativeWithLicenseTokens",value:(function(){var _registerDerivativeWithLicenseTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1902
|
+
*/},{key:"registerDerivativeWithLicenseTokens",value:(function(){var _registerDerivativeWithLicenseTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee104(request){var _yield$this$rpcClient56,call;return _regenerator().w(function(_context104){while(1)switch(_context104.n){case 0:_context104.n=1;return this.rpcClient.simulateContract({abi:licensingModuleAbi,address:this.address,functionName:"registerDerivativeWithLicenseTokens",account:this.wallet.account,args:[request.childIpId,request.licenseTokenIds,request.royaltyContext,request.maxRts]});case 1:_yield$this$rpcClient56=_context104.v;call=_yield$this$rpcClient56.request;_context104.n=2;return this.wallet.writeContract(call);case 2:return _context104.a(2,_context104.v);}},_callee104,this);}));function registerDerivativeWithLicenseTokens(_x78){return _registerDerivativeWithLicenseTokens.apply(this,arguments);}return registerDerivativeWithLicenseTokens;}()/**
|
|
1886
1903
|
* method registerDerivativeWithLicenseTokens for contract LicensingModule with only encode
|
|
1887
1904
|
*
|
|
1888
1905
|
* @param request LicensingModuleRegisterDerivativeWithLicenseTokensRequest
|
|
@@ -1892,7 +1909,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1892
1909
|
*
|
|
1893
1910
|
* @param request LicensingModuleSetLicensingConfigRequest
|
|
1894
1911
|
* @return Promise<WriteContractReturnType>
|
|
1895
|
-
*/},{key:"setLicensingConfig",value:(function(){var _setLicensingConfig=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1912
|
+
*/},{key:"setLicensingConfig",value:(function(){var _setLicensingConfig=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee105(request){var _yield$this$rpcClient57,call;return _regenerator().w(function(_context105){while(1)switch(_context105.n){case 0:_context105.n=1;return this.rpcClient.simulateContract({abi:licensingModuleAbi,address:this.address,functionName:"setLicensingConfig",account:this.wallet.account,args:[request.ipId,request.licenseTemplate,request.licenseTermsId,request.licensingConfig]});case 1:_yield$this$rpcClient57=_context105.v;call=_yield$this$rpcClient57.request;_context105.n=2;return this.wallet.writeContract(call);case 2:return _context105.a(2,_context105.v);}},_callee105,this);}));function setLicensingConfig(_x79){return _setLicensingConfig.apply(this,arguments);}return setLicensingConfig;}()/**
|
|
1896
1913
|
* method setLicensingConfig for contract LicensingModule with only encode
|
|
1897
1914
|
*
|
|
1898
1915
|
* @param request LicensingModuleSetLicensingConfigRequest
|
|
@@ -1909,7 +1926,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1909
1926
|
*
|
|
1910
1927
|
* @param request ModuleRegistryIsRegisteredRequest
|
|
1911
1928
|
* @return Promise<ModuleRegistryIsRegisteredResponse>
|
|
1912
|
-
*/return _createClass(ModuleRegistryReadOnlyClient,[{key:"isRegistered",value:(function(){var _isRegistered2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1929
|
+
*/return _createClass(ModuleRegistryReadOnlyClient,[{key:"isRegistered",value:(function(){var _isRegistered2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee106(request){return _regenerator().w(function(_context106){while(1)switch(_context106.n){case 0:_context106.n=1;return this.rpcClient.readContract({abi:moduleRegistryAbi,address:this.address,functionName:"isRegistered",args:[request.moduleAddress]});case 1:return _context106.a(2,_context106.v);}},_callee106,this);}));function isRegistered(_x80){return _isRegistered2.apply(this,arguments);}return isRegistered;}())}]);}();// Contract Multicall3 =============================================================
|
|
1913
1930
|
/**
|
|
1914
1931
|
* Multicall3Aggregate3Request
|
|
1915
1932
|
*
|
|
@@ -1921,7 +1938,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1921
1938
|
*
|
|
1922
1939
|
* @param request Multicall3Aggregate3Request
|
|
1923
1940
|
* @return Promise<WriteContractReturnType>
|
|
1924
|
-
*/return _createClass(Multicall3Client,[{key:"aggregate3",value:(function(){var _aggregate=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1941
|
+
*/return _createClass(Multicall3Client,[{key:"aggregate3",value:(function(){var _aggregate=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee107(request){var _yield$this$rpcClient58,call;return _regenerator().w(function(_context107){while(1)switch(_context107.n){case 0:_context107.n=1;return this.rpcClient.simulateContract({abi:multicall3Abi,address:this.address,functionName:"aggregate3",account:this.wallet.account,args:[request.calls]});case 1:_yield$this$rpcClient58=_context107.v;call=_yield$this$rpcClient58.request;_context107.n=2;return this.wallet.writeContract(call);case 2:return _context107.a(2,_context107.v);}},_callee107,this);}));function aggregate3(_x81){return _aggregate.apply(this,arguments);}return aggregate3;}()/**
|
|
1925
1942
|
* method aggregate3 for contract Multicall3 with only encode
|
|
1926
1943
|
*
|
|
1927
1944
|
* @param request Multicall3Aggregate3Request
|
|
@@ -2108,149 +2125,149 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2108
2125
|
*
|
|
2109
2126
|
* @param request PiLicenseTemplateAccessControllerRequest
|
|
2110
2127
|
* @return Promise<PiLicenseTemplateAccessControllerResponse>
|
|
2111
|
-
*/_inherits(PiLicenseTemplateReadOnlyClient,_PiLicenseTemplateEve);return _createClass(PiLicenseTemplateReadOnlyClient,[{key:"accessController",value:(function(){var _accessController2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2128
|
+
*/_inherits(PiLicenseTemplateReadOnlyClient,_PiLicenseTemplateEve);return _createClass(PiLicenseTemplateReadOnlyClient,[{key:"accessController",value:(function(){var _accessController2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee108(){return _regenerator().w(function(_context108){while(1)switch(_context108.n){case 0:_context108.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"ACCESS_CONTROLLER"});case 1:return _context108.a(2,_context108.v);}},_callee108,this);}));function accessController(){return _accessController2.apply(this,arguments);}return accessController;}()/**
|
|
2112
2129
|
* method IP_ASSET_REGISTRY for contract PILicenseTemplate
|
|
2113
2130
|
*
|
|
2114
2131
|
* @param request PiLicenseTemplateIpAssetRegistryRequest
|
|
2115
2132
|
* @return Promise<PiLicenseTemplateIpAssetRegistryResponse>
|
|
2116
|
-
*/)},{key:"ipAssetRegistry",value:(function(){var _ipAssetRegistry2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2133
|
+
*/)},{key:"ipAssetRegistry",value:(function(){var _ipAssetRegistry2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee109(){return _regenerator().w(function(_context109){while(1)switch(_context109.n){case 0:_context109.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"IP_ASSET_REGISTRY"});case 1:return _context109.a(2,_context109.v);}},_callee109,this);}));function ipAssetRegistry(){return _ipAssetRegistry2.apply(this,arguments);}return ipAssetRegistry;}()/**
|
|
2117
2134
|
* method LICENSE_REGISTRY for contract PILicenseTemplate
|
|
2118
2135
|
*
|
|
2119
2136
|
* @param request PiLicenseTemplateLicenseRegistryRequest
|
|
2120
2137
|
* @return Promise<PiLicenseTemplateLicenseRegistryResponse>
|
|
2121
|
-
*/)},{key:"licenseRegistry",value:(function(){var _licenseRegistry=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2138
|
+
*/)},{key:"licenseRegistry",value:(function(){var _licenseRegistry=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee110(){return _regenerator().w(function(_context110){while(1)switch(_context110.n){case 0:_context110.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"LICENSE_REGISTRY"});case 1:return _context110.a(2,_context110.v);}},_callee110,this);}));function licenseRegistry(){return _licenseRegistry.apply(this,arguments);}return licenseRegistry;}()/**
|
|
2122
2139
|
* method MODULE_REGISTRY for contract PILicenseTemplate
|
|
2123
2140
|
*
|
|
2124
2141
|
* @param request PiLicenseTemplateModuleRegistryRequest
|
|
2125
2142
|
* @return Promise<PiLicenseTemplateModuleRegistryResponse>
|
|
2126
|
-
*/)},{key:"moduleRegistry",value:(function(){var _moduleRegistry=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2143
|
+
*/)},{key:"moduleRegistry",value:(function(){var _moduleRegistry=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee111(){return _regenerator().w(function(_context111){while(1)switch(_context111.n){case 0:_context111.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"MODULE_REGISTRY"});case 1:return _context111.a(2,_context111.v);}},_callee111,this);}));function moduleRegistry(){return _moduleRegistry.apply(this,arguments);}return moduleRegistry;}()/**
|
|
2127
2144
|
* method ROYALTY_MODULE for contract PILicenseTemplate
|
|
2128
2145
|
*
|
|
2129
2146
|
* @param request PiLicenseTemplateRoyaltyModuleRequest
|
|
2130
2147
|
* @return Promise<PiLicenseTemplateRoyaltyModuleResponse>
|
|
2131
|
-
*/)},{key:"royaltyModule",value:(function(){var _royaltyModule2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2148
|
+
*/)},{key:"royaltyModule",value:(function(){var _royaltyModule2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee112(){return _regenerator().w(function(_context112){while(1)switch(_context112.n){case 0:_context112.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"ROYALTY_MODULE"});case 1:return _context112.a(2,_context112.v);}},_callee112,this);}));function royaltyModule(){return _royaltyModule2.apply(this,arguments);}return royaltyModule;}()/**
|
|
2132
2149
|
* method TERMS_RENDERER for contract PILicenseTemplate
|
|
2133
2150
|
*
|
|
2134
2151
|
* @param request PiLicenseTemplateTermsRendererRequest
|
|
2135
2152
|
* @return Promise<PiLicenseTemplateTermsRendererResponse>
|
|
2136
|
-
*/)},{key:"termsRenderer",value:(function(){var _termsRenderer=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2153
|
+
*/)},{key:"termsRenderer",value:(function(){var _termsRenderer=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee113(){return _regenerator().w(function(_context113){while(1)switch(_context113.n){case 0:_context113.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"TERMS_RENDERER"});case 1:return _context113.a(2,_context113.v);}},_callee113,this);}));function termsRenderer(){return _termsRenderer.apply(this,arguments);}return termsRenderer;}()/**
|
|
2137
2154
|
* method UPGRADE_INTERFACE_VERSION for contract PILicenseTemplate
|
|
2138
2155
|
*
|
|
2139
2156
|
* @param request PiLicenseTemplateUpgradeInterfaceVersionRequest
|
|
2140
2157
|
* @return Promise<PiLicenseTemplateUpgradeInterfaceVersionResponse>
|
|
2141
|
-
*/)},{key:"upgradeInterfaceVersion",value:(function(){var _upgradeInterfaceVersion3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2158
|
+
*/)},{key:"upgradeInterfaceVersion",value:(function(){var _upgradeInterfaceVersion3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee114(){return _regenerator().w(function(_context114){while(1)switch(_context114.n){case 0:_context114.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"UPGRADE_INTERFACE_VERSION"});case 1:return _context114.a(2,_context114.v);}},_callee114,this);}));function upgradeInterfaceVersion(){return _upgradeInterfaceVersion3.apply(this,arguments);}return upgradeInterfaceVersion;}()/**
|
|
2142
2159
|
* method allowDerivativeRegistration for contract PILicenseTemplate
|
|
2143
2160
|
*
|
|
2144
2161
|
* @param request PiLicenseTemplateAllowDerivativeRegistrationRequest
|
|
2145
2162
|
* @return Promise<PiLicenseTemplateAllowDerivativeRegistrationResponse>
|
|
2146
|
-
*/)},{key:"allowDerivativeRegistration",value:(function(){var _allowDerivativeRegistration=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2163
|
+
*/)},{key:"allowDerivativeRegistration",value:(function(){var _allowDerivativeRegistration=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee115(request){return _regenerator().w(function(_context115){while(1)switch(_context115.n){case 0:_context115.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"allowDerivativeRegistration",args:[request.licenseTermsId]});case 1:return _context115.a(2,_context115.v);}},_callee115,this);}));function allowDerivativeRegistration(_x82){return _allowDerivativeRegistration.apply(this,arguments);}return allowDerivativeRegistration;}()/**
|
|
2147
2164
|
* method authority for contract PILicenseTemplate
|
|
2148
2165
|
*
|
|
2149
2166
|
* @param request PiLicenseTemplateAuthorityRequest
|
|
2150
2167
|
* @return Promise<PiLicenseTemplateAuthorityResponse>
|
|
2151
|
-
*/)},{key:"authority",value:(function(){var _authority3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2168
|
+
*/)},{key:"authority",value:(function(){var _authority3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee116(){return _regenerator().w(function(_context116){while(1)switch(_context116.n){case 0:_context116.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"authority"});case 1:return _context116.a(2,_context116.v);}},_callee116,this);}));function authority(){return _authority3.apply(this,arguments);}return authority;}()/**
|
|
2152
2169
|
* method canAttachToGroupIp for contract PILicenseTemplate
|
|
2153
2170
|
*
|
|
2154
2171
|
* @param request PiLicenseTemplateCanAttachToGroupIpRequest
|
|
2155
2172
|
* @return Promise<PiLicenseTemplateCanAttachToGroupIpResponse>
|
|
2156
|
-
*/)},{key:"canAttachToGroupIp",value:(function(){var _canAttachToGroupIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2173
|
+
*/)},{key:"canAttachToGroupIp",value:(function(){var _canAttachToGroupIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee117(request){return _regenerator().w(function(_context117){while(1)switch(_context117.n){case 0:_context117.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"canAttachToGroupIp",args:[request.licenseTermsId]});case 1:return _context117.a(2,_context117.v);}},_callee117,this);}));function canAttachToGroupIp(_x83){return _canAttachToGroupIp.apply(this,arguments);}return canAttachToGroupIp;}()/**
|
|
2157
2174
|
* method canOverrideRoyaltyPercent for contract PILicenseTemplate
|
|
2158
2175
|
*
|
|
2159
2176
|
* @param request PiLicenseTemplateCanOverrideRoyaltyPercentRequest
|
|
2160
2177
|
* @return Promise<PiLicenseTemplateCanOverrideRoyaltyPercentResponse>
|
|
2161
|
-
*/)},{key:"canOverrideRoyaltyPercent",value:(function(){var _canOverrideRoyaltyPercent=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2178
|
+
*/)},{key:"canOverrideRoyaltyPercent",value:(function(){var _canOverrideRoyaltyPercent=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee118(request){return _regenerator().w(function(_context118){while(1)switch(_context118.n){case 0:_context118.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"canOverrideRoyaltyPercent",args:[request.licenseTermsId,request.newRoyaltyPercent]});case 1:return _context118.a(2,_context118.v);}},_callee118,this);}));function canOverrideRoyaltyPercent(_x84){return _canOverrideRoyaltyPercent.apply(this,arguments);}return canOverrideRoyaltyPercent;}()/**
|
|
2162
2179
|
* method exists for contract PILicenseTemplate
|
|
2163
2180
|
*
|
|
2164
2181
|
* @param request PiLicenseTemplateExistsRequest
|
|
2165
2182
|
* @return Promise<PiLicenseTemplateExistsResponse>
|
|
2166
|
-
*/)},{key:"exists",value:(function(){var _exists=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2183
|
+
*/)},{key:"exists",value:(function(){var _exists=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee119(request){return _regenerator().w(function(_context119){while(1)switch(_context119.n){case 0:_context119.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"exists",args:[request.licenseTermsId]});case 1:return _context119.a(2,_context119.v);}},_callee119,this);}));function exists(_x85){return _exists.apply(this,arguments);}return exists;}()/**
|
|
2167
2184
|
* method getEarlierExpireTime for contract PILicenseTemplate
|
|
2168
2185
|
*
|
|
2169
2186
|
* @param request PiLicenseTemplateGetEarlierExpireTimeRequest
|
|
2170
2187
|
* @return Promise<PiLicenseTemplateGetEarlierExpireTimeResponse>
|
|
2171
|
-
*/)},{key:"getEarlierExpireTime",value:(function(){var _getEarlierExpireTime=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2188
|
+
*/)},{key:"getEarlierExpireTime",value:(function(){var _getEarlierExpireTime=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee120(request){return _regenerator().w(function(_context120){while(1)switch(_context120.n){case 0:_context120.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"getEarlierExpireTime",args:[request.licenseTermsIds,request.start]});case 1:return _context120.a(2,_context120.v);}},_callee120,this);}));function getEarlierExpireTime(_x86){return _getEarlierExpireTime.apply(this,arguments);}return getEarlierExpireTime;}()/**
|
|
2172
2189
|
* method getExpireTime for contract PILicenseTemplate
|
|
2173
2190
|
*
|
|
2174
2191
|
* @param request PiLicenseTemplateGetExpireTimeRequest
|
|
2175
2192
|
* @return Promise<PiLicenseTemplateGetExpireTimeResponse>
|
|
2176
|
-
*/)},{key:"getExpireTime",value:(function(){var _getExpireTime=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2193
|
+
*/)},{key:"getExpireTime",value:(function(){var _getExpireTime=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee121(request){return _regenerator().w(function(_context121){while(1)switch(_context121.n){case 0:_context121.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"getExpireTime",args:[request.licenseTermsId,request.start]});case 1:return _context121.a(2,_context121.v);}},_callee121,this);}));function getExpireTime(_x87){return _getExpireTime.apply(this,arguments);}return getExpireTime;}()/**
|
|
2177
2194
|
* method getLicenseTerms for contract PILicenseTemplate
|
|
2178
2195
|
*
|
|
2179
2196
|
* @param request PiLicenseTemplateGetLicenseTermsRequest
|
|
2180
2197
|
* @return Promise<PiLicenseTemplateGetLicenseTermsResponse>
|
|
2181
|
-
*/)},{key:"getLicenseTerms",value:(function(){var _getLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2198
|
+
*/)},{key:"getLicenseTerms",value:(function(){var _getLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee122(request){var result;return _regenerator().w(function(_context122){while(1)switch(_context122.n){case 0:_context122.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"getLicenseTerms",args:[request.selectedLicenseTermsId]});case 1:result=_context122.v;return _context122.a(2,{terms:result});}},_callee122,this);}));function getLicenseTerms(_x88){return _getLicenseTerms.apply(this,arguments);}return getLicenseTerms;}()/**
|
|
2182
2199
|
* method getLicenseTermsId for contract PILicenseTemplate
|
|
2183
2200
|
*
|
|
2184
2201
|
* @param request PiLicenseTemplateGetLicenseTermsIdRequest
|
|
2185
2202
|
* @return Promise<PiLicenseTemplateGetLicenseTermsIdResponse>
|
|
2186
|
-
*/)},{key:"getLicenseTermsId",value:(function(){var _getLicenseTermsId=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2203
|
+
*/)},{key:"getLicenseTermsId",value:(function(){var _getLicenseTermsId=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee123(request){var result;return _regenerator().w(function(_context123){while(1)switch(_context123.n){case 0:_context123.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"getLicenseTermsId",args:[request.terms]});case 1:result=_context123.v;return _context123.a(2,{selectedLicenseTermsId:result});}},_callee123,this);}));function getLicenseTermsId(_x89){return _getLicenseTermsId.apply(this,arguments);}return getLicenseTermsId;}()/**
|
|
2187
2204
|
* method getLicenseTermsURI for contract PILicenseTemplate
|
|
2188
2205
|
*
|
|
2189
2206
|
* @param request PiLicenseTemplateGetLicenseTermsUriRequest
|
|
2190
2207
|
* @return Promise<PiLicenseTemplateGetLicenseTermsUriResponse>
|
|
2191
|
-
*/)},{key:"getLicenseTermsUri",value:(function(){var _getLicenseTermsUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2208
|
+
*/)},{key:"getLicenseTermsUri",value:(function(){var _getLicenseTermsUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee124(request){return _regenerator().w(function(_context124){while(1)switch(_context124.n){case 0:_context124.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"getLicenseTermsURI",args:[request.licenseTermsId]});case 1:return _context124.a(2,_context124.v);}},_callee124,this);}));function getLicenseTermsUri(_x90){return _getLicenseTermsUri.apply(this,arguments);}return getLicenseTermsUri;}()/**
|
|
2192
2209
|
* method getMetadataURI for contract PILicenseTemplate
|
|
2193
2210
|
*
|
|
2194
2211
|
* @param request PiLicenseTemplateGetMetadataUriRequest
|
|
2195
2212
|
* @return Promise<PiLicenseTemplateGetMetadataUriResponse>
|
|
2196
|
-
*/)},{key:"getMetadataUri",value:(function(){var _getMetadataUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2213
|
+
*/)},{key:"getMetadataUri",value:(function(){var _getMetadataUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee125(){return _regenerator().w(function(_context125){while(1)switch(_context125.n){case 0:_context125.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"getMetadataURI"});case 1:return _context125.a(2,_context125.v);}},_callee125,this);}));function getMetadataUri(){return _getMetadataUri.apply(this,arguments);}return getMetadataUri;}()/**
|
|
2197
2214
|
* method getRoyaltyPolicy for contract PILicenseTemplate
|
|
2198
2215
|
*
|
|
2199
2216
|
* @param request PiLicenseTemplateGetRoyaltyPolicyRequest
|
|
2200
2217
|
* @return Promise<PiLicenseTemplateGetRoyaltyPolicyResponse>
|
|
2201
|
-
*/)},{key:"getRoyaltyPolicy",value:(function(){var _getRoyaltyPolicy=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2218
|
+
*/)},{key:"getRoyaltyPolicy",value:(function(){var _getRoyaltyPolicy=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee126(request){var result;return _regenerator().w(function(_context126){while(1)switch(_context126.n){case 0:_context126.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"getRoyaltyPolicy",args:[request.licenseTermsId]});case 1:result=_context126.v;return _context126.a(2,{royaltyPolicy:result[0],royaltyPercent:result[1],mintingFee:result[2],currency:result[3]});}},_callee126,this);}));function getRoyaltyPolicy(_x91){return _getRoyaltyPolicy.apply(this,arguments);}return getRoyaltyPolicy;}()/**
|
|
2202
2219
|
* method isConsumingScheduledOp for contract PILicenseTemplate
|
|
2203
2220
|
*
|
|
2204
2221
|
* @param request PiLicenseTemplateIsConsumingScheduledOpRequest
|
|
2205
2222
|
* @return Promise<PiLicenseTemplateIsConsumingScheduledOpResponse>
|
|
2206
|
-
*/)},{key:"isConsumingScheduledOp",value:(function(){var _isConsumingScheduledOp3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2223
|
+
*/)},{key:"isConsumingScheduledOp",value:(function(){var _isConsumingScheduledOp3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee127(){return _regenerator().w(function(_context127){while(1)switch(_context127.n){case 0:_context127.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"isConsumingScheduledOp"});case 1:return _context127.a(2,_context127.v);}},_callee127,this);}));function isConsumingScheduledOp(){return _isConsumingScheduledOp3.apply(this,arguments);}return isConsumingScheduledOp;}()/**
|
|
2207
2224
|
* method isDerivativeApproved for contract PILicenseTemplate
|
|
2208
2225
|
*
|
|
2209
2226
|
* @param request PiLicenseTemplateIsDerivativeApprovedRequest
|
|
2210
2227
|
* @return Promise<PiLicenseTemplateIsDerivativeApprovedResponse>
|
|
2211
|
-
*/)},{key:"isDerivativeApproved",value:(function(){var _isDerivativeApproved=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2228
|
+
*/)},{key:"isDerivativeApproved",value:(function(){var _isDerivativeApproved=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee128(request){return _regenerator().w(function(_context128){while(1)switch(_context128.n){case 0:_context128.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"isDerivativeApproved",args:[request.parentIpId,request.licenseTermsId,request.childIpId]});case 1:return _context128.a(2,_context128.v);}},_callee128,this);}));function isDerivativeApproved(_x92){return _isDerivativeApproved.apply(this,arguments);}return isDerivativeApproved;}()/**
|
|
2212
2229
|
* method isLicenseTransferable for contract PILicenseTemplate
|
|
2213
2230
|
*
|
|
2214
2231
|
* @param request PiLicenseTemplateIsLicenseTransferableRequest
|
|
2215
2232
|
* @return Promise<PiLicenseTemplateIsLicenseTransferableResponse>
|
|
2216
|
-
*/)},{key:"isLicenseTransferable",value:(function(){var _isLicenseTransferable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2233
|
+
*/)},{key:"isLicenseTransferable",value:(function(){var _isLicenseTransferable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee129(request){return _regenerator().w(function(_context129){while(1)switch(_context129.n){case 0:_context129.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"isLicenseTransferable",args:[request.licenseTermsId]});case 1:return _context129.a(2,_context129.v);}},_callee129,this);}));function isLicenseTransferable(_x93){return _isLicenseTransferable.apply(this,arguments);}return isLicenseTransferable;}()/**
|
|
2217
2234
|
* method name for contract PILicenseTemplate
|
|
2218
2235
|
*
|
|
2219
2236
|
* @param request PiLicenseTemplateNameRequest
|
|
2220
2237
|
* @return Promise<PiLicenseTemplateNameResponse>
|
|
2221
|
-
*/)},{key:"name",value:(function(){var _name2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2238
|
+
*/)},{key:"name",value:(function(){var _name2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee130(){return _regenerator().w(function(_context130){while(1)switch(_context130.n){case 0:_context130.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"name"});case 1:return _context130.a(2,_context130.v);}},_callee130,this);}));function name(){return _name2.apply(this,arguments);}return name;}()/**
|
|
2222
2239
|
* method proxiableUUID for contract PILicenseTemplate
|
|
2223
2240
|
*
|
|
2224
2241
|
* @param request PiLicenseTemplateProxiableUuidRequest
|
|
2225
2242
|
* @return Promise<PiLicenseTemplateProxiableUuidResponse>
|
|
2226
|
-
*/)},{key:"proxiableUuid",value:(function(){var _proxiableUuid3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2243
|
+
*/)},{key:"proxiableUuid",value:(function(){var _proxiableUuid3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee131(){return _regenerator().w(function(_context131){while(1)switch(_context131.n){case 0:_context131.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"proxiableUUID"});case 1:return _context131.a(2,_context131.v);}},_callee131,this);}));function proxiableUuid(){return _proxiableUuid3.apply(this,arguments);}return proxiableUuid;}()/**
|
|
2227
2244
|
* method supportsInterface for contract PILicenseTemplate
|
|
2228
2245
|
*
|
|
2229
2246
|
* @param request PiLicenseTemplateSupportsInterfaceRequest
|
|
2230
2247
|
* @return Promise<PiLicenseTemplateSupportsInterfaceResponse>
|
|
2231
|
-
*/)},{key:"supportsInterface",value:(function(){var _supportsInterface2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2248
|
+
*/)},{key:"supportsInterface",value:(function(){var _supportsInterface2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee132(request){return _regenerator().w(function(_context132){while(1)switch(_context132.n){case 0:_context132.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"supportsInterface",args:[request.interfaceId]});case 1:return _context132.a(2,_context132.v);}},_callee132,this);}));function supportsInterface(_x94){return _supportsInterface2.apply(this,arguments);}return supportsInterface;}()/**
|
|
2232
2249
|
* method toJson for contract PILicenseTemplate
|
|
2233
2250
|
*
|
|
2234
2251
|
* @param request PiLicenseTemplateToJsonRequest
|
|
2235
2252
|
* @return Promise<PiLicenseTemplateToJsonResponse>
|
|
2236
|
-
*/)},{key:"toJson",value:(function(){var _toJson=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2253
|
+
*/)},{key:"toJson",value:(function(){var _toJson=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee133(request){return _regenerator().w(function(_context133){while(1)switch(_context133.n){case 0:_context133.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"toJson",args:[request.licenseTermsId]});case 1:return _context133.a(2,_context133.v);}},_callee133,this);}));function toJson(_x95){return _toJson.apply(this,arguments);}return toJson;}()/**
|
|
2237
2254
|
* method totalRegisteredLicenseTerms for contract PILicenseTemplate
|
|
2238
2255
|
*
|
|
2239
2256
|
* @param request PiLicenseTemplateTotalRegisteredLicenseTermsRequest
|
|
2240
2257
|
* @return Promise<PiLicenseTemplateTotalRegisteredLicenseTermsResponse>
|
|
2241
|
-
*/)},{key:"totalRegisteredLicenseTerms",value:(function(){var _totalRegisteredLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2258
|
+
*/)},{key:"totalRegisteredLicenseTerms",value:(function(){var _totalRegisteredLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee134(){return _regenerator().w(function(_context134){while(1)switch(_context134.n){case 0:_context134.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"totalRegisteredLicenseTerms"});case 1:return _context134.a(2,_context134.v);}},_callee134,this);}));function totalRegisteredLicenseTerms(){return _totalRegisteredLicenseTerms.apply(this,arguments);}return totalRegisteredLicenseTerms;}()/**
|
|
2242
2259
|
* method verifyCompatibleLicenses for contract PILicenseTemplate
|
|
2243
2260
|
*
|
|
2244
2261
|
* @param request PiLicenseTemplateVerifyCompatibleLicensesRequest
|
|
2245
2262
|
* @return Promise<PiLicenseTemplateVerifyCompatibleLicensesResponse>
|
|
2246
|
-
*/)},{key:"verifyCompatibleLicenses",value:(function(){var _verifyCompatibleLicenses=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2263
|
+
*/)},{key:"verifyCompatibleLicenses",value:(function(){var _verifyCompatibleLicenses=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee135(request){return _regenerator().w(function(_context135){while(1)switch(_context135.n){case 0:_context135.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"verifyCompatibleLicenses",args:[request.licenseTermsIds]});case 1:return _context135.a(2,_context135.v);}},_callee135,this);}));function verifyCompatibleLicenses(_x96){return _verifyCompatibleLicenses.apply(this,arguments);}return verifyCompatibleLicenses;}())}]);}(PiLicenseTemplateEventClient);/**
|
|
2247
2264
|
* contract PILicenseTemplate write method
|
|
2248
|
-
*/var PiLicenseTemplateClient=/*#__PURE__*/function(_PiLicenseTemplateRea){function PiLicenseTemplateClient(rpcClient,wallet,address){var
|
|
2265
|
+
*/var PiLicenseTemplateClient=/*#__PURE__*/function(_PiLicenseTemplateRea){function PiLicenseTemplateClient(rpcClient,wallet,address){var _this10;_classCallCheck(this,PiLicenseTemplateClient);_this10=_callSuper(this,PiLicenseTemplateClient,[rpcClient,address]);_this10.wallet=wallet;return _this10;}/**
|
|
2249
2266
|
* method initialize for contract PILicenseTemplate
|
|
2250
2267
|
*
|
|
2251
2268
|
* @param request PiLicenseTemplateInitializeRequest
|
|
2252
2269
|
* @return Promise<WriteContractReturnType>
|
|
2253
|
-
*/_inherits(PiLicenseTemplateClient,_PiLicenseTemplateRea);return _createClass(PiLicenseTemplateClient,[{key:"initialize",value:(function(){var _initialize3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2270
|
+
*/_inherits(PiLicenseTemplateClient,_PiLicenseTemplateRea);return _createClass(PiLicenseTemplateClient,[{key:"initialize",value:(function(){var _initialize3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee136(request){var _yield$this$rpcClient59,call;return _regenerator().w(function(_context136){while(1)switch(_context136.n){case 0:_context136.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"initialize",account:this.wallet.account,args:[request.accessManager,request.name,request.metadataURI]});case 1:_yield$this$rpcClient59=_context136.v;call=_yield$this$rpcClient59.request;_context136.n=2;return this.wallet.writeContract(call);case 2:return _context136.a(2,_context136.v);}},_callee136,this);}));function initialize(_x97){return _initialize3.apply(this,arguments);}return initialize;}()/**
|
|
2254
2271
|
* method initialize for contract PILicenseTemplate with only encode
|
|
2255
2272
|
*
|
|
2256
2273
|
* @param request PiLicenseTemplateInitializeRequest
|
|
@@ -2260,7 +2277,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2260
2277
|
*
|
|
2261
2278
|
* @param request PiLicenseTemplateRegisterLicenseTermsRequest
|
|
2262
2279
|
* @return Promise<WriteContractReturnType>
|
|
2263
|
-
*/},{key:"registerLicenseTerms",value:(function(){var _registerLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2280
|
+
*/},{key:"registerLicenseTerms",value:(function(){var _registerLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee137(request){var _yield$this$rpcClient60,call;return _regenerator().w(function(_context137){while(1)switch(_context137.n){case 0:_context137.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"registerLicenseTerms",account:this.wallet.account,args:[request.terms]});case 1:_yield$this$rpcClient60=_context137.v;call=_yield$this$rpcClient60.request;_context137.n=2;return this.wallet.writeContract(call);case 2:return _context137.a(2,_context137.v);}},_callee137,this);}));function registerLicenseTerms(_x98){return _registerLicenseTerms.apply(this,arguments);}return registerLicenseTerms;}()/**
|
|
2264
2281
|
* method registerLicenseTerms for contract PILicenseTemplate with only encode
|
|
2265
2282
|
*
|
|
2266
2283
|
* @param request PiLicenseTemplateRegisterLicenseTermsRequest
|
|
@@ -2270,7 +2287,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2270
2287
|
*
|
|
2271
2288
|
* @param request PiLicenseTemplateSetApprovalRequest
|
|
2272
2289
|
* @return Promise<WriteContractReturnType>
|
|
2273
|
-
*/},{key:"setApproval",value:(function(){var _setApproval=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2290
|
+
*/},{key:"setApproval",value:(function(){var _setApproval=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee138(request){var _yield$this$rpcClient61,call;return _regenerator().w(function(_context138){while(1)switch(_context138.n){case 0:_context138.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"setApproval",account:this.wallet.account,args:[request.parentIpId,request.licenseTermsId,request.childIpId,request.approved]});case 1:_yield$this$rpcClient61=_context138.v;call=_yield$this$rpcClient61.request;_context138.n=2;return this.wallet.writeContract(call);case 2:return _context138.a(2,_context138.v);}},_callee138,this);}));function setApproval(_x99){return _setApproval.apply(this,arguments);}return setApproval;}()/**
|
|
2274
2291
|
* method setApproval for contract PILicenseTemplate with only encode
|
|
2275
2292
|
*
|
|
2276
2293
|
* @param request PiLicenseTemplateSetApprovalRequest
|
|
@@ -2280,7 +2297,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2280
2297
|
*
|
|
2281
2298
|
* @param request PiLicenseTemplateSetAuthorityRequest
|
|
2282
2299
|
* @return Promise<WriteContractReturnType>
|
|
2283
|
-
*/},{key:"setAuthority",value:(function(){var _setAuthority3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2300
|
+
*/},{key:"setAuthority",value:(function(){var _setAuthority3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee139(request){var _yield$this$rpcClient62,call;return _regenerator().w(function(_context139){while(1)switch(_context139.n){case 0:_context139.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"setAuthority",account:this.wallet.account,args:[request.newAuthority]});case 1:_yield$this$rpcClient62=_context139.v;call=_yield$this$rpcClient62.request;_context139.n=2;return this.wallet.writeContract(call);case 2:return _context139.a(2,_context139.v);}},_callee139,this);}));function setAuthority(_x100){return _setAuthority3.apply(this,arguments);}return setAuthority;}()/**
|
|
2284
2301
|
* method setAuthority for contract PILicenseTemplate with only encode
|
|
2285
2302
|
*
|
|
2286
2303
|
* @param request PiLicenseTemplateSetAuthorityRequest
|
|
@@ -2290,7 +2307,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2290
2307
|
*
|
|
2291
2308
|
* @param request PiLicenseTemplateUpgradeToAndCallRequest
|
|
2292
2309
|
* @return Promise<WriteContractReturnType>
|
|
2293
|
-
*/},{key:"upgradeToAndCall",value:(function(){var _upgradeToAndCall3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2310
|
+
*/},{key:"upgradeToAndCall",value:(function(){var _upgradeToAndCall3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee140(request){var _yield$this$rpcClient63,call;return _regenerator().w(function(_context140){while(1)switch(_context140.n){case 0:_context140.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"upgradeToAndCall",account:this.wallet.account,args:[request.newImplementation,request.data]});case 1:_yield$this$rpcClient63=_context140.v;call=_yield$this$rpcClient63.request;_context140.n=2;return this.wallet.writeContract(call);case 2:return _context140.a(2,_context140.v);}},_callee140,this);}));function upgradeToAndCall(_x101){return _upgradeToAndCall3.apply(this,arguments);}return upgradeToAndCall;}()/**
|
|
2294
2311
|
* method upgradeToAndCall for contract PILicenseTemplate with only encode
|
|
2295
2312
|
*
|
|
2296
2313
|
* @param request PiLicenseTemplateUpgradeToAndCallRequest
|
|
@@ -2300,7 +2317,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2300
2317
|
*
|
|
2301
2318
|
* @param request PiLicenseTemplateVerifyMintLicenseTokenRequest
|
|
2302
2319
|
* @return Promise<WriteContractReturnType>
|
|
2303
|
-
*/},{key:"verifyMintLicenseToken",value:(function(){var _verifyMintLicenseToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2320
|
+
*/},{key:"verifyMintLicenseToken",value:(function(){var _verifyMintLicenseToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee141(request){var _yield$this$rpcClient64,call;return _regenerator().w(function(_context141){while(1)switch(_context141.n){case 0:_context141.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"verifyMintLicenseToken",account:this.wallet.account,args:[request[0],request[1],request[2],request[3]]});case 1:_yield$this$rpcClient64=_context141.v;call=_yield$this$rpcClient64.request;_context141.n=2;return this.wallet.writeContract(call);case 2:return _context141.a(2,_context141.v);}},_callee141,this);}));function verifyMintLicenseToken(_x102){return _verifyMintLicenseToken.apply(this,arguments);}return verifyMintLicenseToken;}()/**
|
|
2304
2321
|
* method verifyMintLicenseToken for contract PILicenseTemplate with only encode
|
|
2305
2322
|
*
|
|
2306
2323
|
* @param request PiLicenseTemplateVerifyMintLicenseTokenRequest
|
|
@@ -2310,7 +2327,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2310
2327
|
*
|
|
2311
2328
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeRequest
|
|
2312
2329
|
* @return Promise<WriteContractReturnType>
|
|
2313
|
-
*/},{key:"verifyRegisterDerivative",value:(function(){var _verifyRegisterDerivative=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2330
|
+
*/},{key:"verifyRegisterDerivative",value:(function(){var _verifyRegisterDerivative=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee142(request){var _yield$this$rpcClient65,call;return _regenerator().w(function(_context142){while(1)switch(_context142.n){case 0:_context142.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"verifyRegisterDerivative",account:this.wallet.account,args:[request.childIpId,request.parentIpId,request.licenseTermsId,request.licensee]});case 1:_yield$this$rpcClient65=_context142.v;call=_yield$this$rpcClient65.request;_context142.n=2;return this.wallet.writeContract(call);case 2:return _context142.a(2,_context142.v);}},_callee142,this);}));function verifyRegisterDerivative(_x103){return _verifyRegisterDerivative.apply(this,arguments);}return verifyRegisterDerivative;}()/**
|
|
2314
2331
|
* method verifyRegisterDerivative for contract PILicenseTemplate with only encode
|
|
2315
2332
|
*
|
|
2316
2333
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeRequest
|
|
@@ -2320,7 +2337,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2320
2337
|
*
|
|
2321
2338
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeForAllParentsRequest
|
|
2322
2339
|
* @return Promise<WriteContractReturnType>
|
|
2323
|
-
*/},{key:"verifyRegisterDerivativeForAllParents",value:(function(){var _verifyRegisterDerivativeForAllParents=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2340
|
+
*/},{key:"verifyRegisterDerivativeForAllParents",value:(function(){var _verifyRegisterDerivativeForAllParents=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee143(request){var _yield$this$rpcClient66,call;return _regenerator().w(function(_context143){while(1)switch(_context143.n){case 0:_context143.n=1;return this.rpcClient.simulateContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"verifyRegisterDerivativeForAllParents",account:this.wallet.account,args:[request.childIpId,request.parentIpIds,request.licenseTermsIds,request.caller]});case 1:_yield$this$rpcClient66=_context143.v;call=_yield$this$rpcClient66.request;_context143.n=2;return this.wallet.writeContract(call);case 2:return _context143.a(2,_context143.v);}},_callee143,this);}));function verifyRegisterDerivativeForAllParents(_x104){return _verifyRegisterDerivativeForAllParents.apply(this,arguments);}return verifyRegisterDerivativeForAllParents;}()/**
|
|
2324
2341
|
* method verifyRegisterDerivativeForAllParents for contract PILicenseTemplate with only encode
|
|
2325
2342
|
*
|
|
2326
2343
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeForAllParentsRequest
|
|
@@ -2360,12 +2377,12 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2360
2377
|
* parse tx receipt event CollectionCreated for contract RegistrationWorkflows
|
|
2361
2378
|
*/},{key:"parseTxCollectionCreatedEvent",value:function parseTxCollectionCreatedEvent(txReceipt){var targetLogs=[];var _iterator27=_createForOfIteratorHelper(txReceipt.logs),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var log=_step27.value;try{var event=decodeEventLog({abi:registrationWorkflowsAbi,eventName:"CollectionCreated",data:log.data,topics:log.topics});if(event.eventName==="CollectionCreated"){targetLogs.push(event.args);}}catch(e){/* empty */}}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return targetLogs;}}]);}();/**
|
|
2362
2379
|
* contract RegistrationWorkflows write method
|
|
2363
|
-
*/var RegistrationWorkflowsClient=/*#__PURE__*/function(_RegistrationWorkflow){function RegistrationWorkflowsClient(rpcClient,wallet,address){var
|
|
2380
|
+
*/var RegistrationWorkflowsClient=/*#__PURE__*/function(_RegistrationWorkflow){function RegistrationWorkflowsClient(rpcClient,wallet,address){var _this11;_classCallCheck(this,RegistrationWorkflowsClient);_this11=_callSuper(this,RegistrationWorkflowsClient,[rpcClient,address]);_this11.wallet=wallet;return _this11;}/**
|
|
2364
2381
|
* method createCollection for contract RegistrationWorkflows
|
|
2365
2382
|
*
|
|
2366
2383
|
* @param request RegistrationWorkflowsCreateCollectionRequest
|
|
2367
2384
|
* @return Promise<WriteContractReturnType>
|
|
2368
|
-
*/_inherits(RegistrationWorkflowsClient,_RegistrationWorkflow);return _createClass(RegistrationWorkflowsClient,[{key:"createCollection",value:(function(){var _createCollection=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2385
|
+
*/_inherits(RegistrationWorkflowsClient,_RegistrationWorkflow);return _createClass(RegistrationWorkflowsClient,[{key:"createCollection",value:(function(){var _createCollection=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee144(request){var _yield$this$rpcClient67,call;return _regenerator().w(function(_context144){while(1)switch(_context144.n){case 0:_context144.n=1;return this.rpcClient.simulateContract({abi:registrationWorkflowsAbi,address:this.address,functionName:"createCollection",account:this.wallet.account,args:[request.spgNftInitParams]});case 1:_yield$this$rpcClient67=_context144.v;call=_yield$this$rpcClient67.request;_context144.n=2;return this.wallet.writeContract(call);case 2:return _context144.a(2,_context144.v);}},_callee144,this);}));function createCollection(_x105){return _createCollection.apply(this,arguments);}return createCollection;}()/**
|
|
2369
2386
|
* method createCollection for contract RegistrationWorkflows with only encode
|
|
2370
2387
|
*
|
|
2371
2388
|
* @param request RegistrationWorkflowsCreateCollectionRequest
|
|
@@ -2375,7 +2392,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2375
2392
|
*
|
|
2376
2393
|
* @param request RegistrationWorkflowsMintAndRegisterIpRequest
|
|
2377
2394
|
* @return Promise<WriteContractReturnType>
|
|
2378
|
-
*/},{key:"mintAndRegisterIp",value:(function(){var _mintAndRegisterIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2395
|
+
*/},{key:"mintAndRegisterIp",value:(function(){var _mintAndRegisterIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee145(request){var _yield$this$rpcClient68,call;return _regenerator().w(function(_context145){while(1)switch(_context145.n){case 0:_context145.n=1;return this.rpcClient.simulateContract({abi:registrationWorkflowsAbi,address:this.address,functionName:"mintAndRegisterIp",account:this.wallet.account,args:[request.spgNftContract,request.recipient,request.ipMetadata,request.allowDuplicates]});case 1:_yield$this$rpcClient68=_context145.v;call=_yield$this$rpcClient68.request;_context145.n=2;return this.wallet.writeContract(call);case 2:return _context145.a(2,_context145.v);}},_callee145,this);}));function mintAndRegisterIp(_x106){return _mintAndRegisterIp.apply(this,arguments);}return mintAndRegisterIp;}()/**
|
|
2379
2396
|
* method mintAndRegisterIp for contract RegistrationWorkflows with only encode
|
|
2380
2397
|
*
|
|
2381
2398
|
* @param request RegistrationWorkflowsMintAndRegisterIpRequest
|
|
@@ -2385,7 +2402,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2385
2402
|
*
|
|
2386
2403
|
* @param request RegistrationWorkflowsMulticallRequest
|
|
2387
2404
|
* @return Promise<WriteContractReturnType>
|
|
2388
|
-
*/},{key:"multicall",value:(function(){var _multicall3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2405
|
+
*/},{key:"multicall",value:(function(){var _multicall3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee146(request){var _yield$this$rpcClient69,call;return _regenerator().w(function(_context146){while(1)switch(_context146.n){case 0:_context146.n=1;return this.rpcClient.simulateContract({abi:registrationWorkflowsAbi,address:this.address,functionName:"multicall",account:this.wallet.account,args:[request.data]});case 1:_yield$this$rpcClient69=_context146.v;call=_yield$this$rpcClient69.request;_context146.n=2;return this.wallet.writeContract(call);case 2:return _context146.a(2,_context146.v);}},_callee146,this);}));function multicall(_x107){return _multicall3.apply(this,arguments);}return multicall;}()/**
|
|
2389
2406
|
* method multicall for contract RegistrationWorkflows with only encode
|
|
2390
2407
|
*
|
|
2391
2408
|
* @param request RegistrationWorkflowsMulticallRequest
|
|
@@ -2395,7 +2412,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2395
2412
|
*
|
|
2396
2413
|
* @param request RegistrationWorkflowsRegisterIpRequest
|
|
2397
2414
|
* @return Promise<WriteContractReturnType>
|
|
2398
|
-
*/},{key:"registerIp",value:(function(){var _registerIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2415
|
+
*/},{key:"registerIp",value:(function(){var _registerIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee147(request){var _yield$this$rpcClient70,call;return _regenerator().w(function(_context147){while(1)switch(_context147.n){case 0:_context147.n=1;return this.rpcClient.simulateContract({abi:registrationWorkflowsAbi,address:this.address,functionName:"registerIp",account:this.wallet.account,args:[request.nftContract,request.tokenId,request.ipMetadata,request.sigMetadata]});case 1:_yield$this$rpcClient70=_context147.v;call=_yield$this$rpcClient70.request;_context147.n=2;return this.wallet.writeContract(call);case 2:return _context147.a(2,_context147.v);}},_callee147,this);}));function registerIp(_x108){return _registerIp.apply(this,arguments);}return registerIp;}()/**
|
|
2399
2416
|
* method registerIp for contract RegistrationWorkflows with only encode
|
|
2400
2417
|
*
|
|
2401
2418
|
* @param request RegistrationWorkflowsRegisterIpRequest
|
|
@@ -2451,24 +2468,24 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2451
2468
|
*
|
|
2452
2469
|
* @param request RoyaltyModuleIpRoyaltyVaultsRequest
|
|
2453
2470
|
* @return Promise<RoyaltyModuleIpRoyaltyVaultsResponse>
|
|
2454
|
-
*/_inherits(RoyaltyModuleReadOnlyClient,_RoyaltyModuleEventCl);return _createClass(RoyaltyModuleReadOnlyClient,[{key:"ipRoyaltyVaults",value:(function(){var _ipRoyaltyVaults=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2471
|
+
*/_inherits(RoyaltyModuleReadOnlyClient,_RoyaltyModuleEventCl);return _createClass(RoyaltyModuleReadOnlyClient,[{key:"ipRoyaltyVaults",value:(function(){var _ipRoyaltyVaults=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee148(request){return _regenerator().w(function(_context148){while(1)switch(_context148.n){case 0:_context148.n=1;return this.rpcClient.readContract({abi:royaltyModuleAbi,address:this.address,functionName:"ipRoyaltyVaults",args:[request.ipId]});case 1:return _context148.a(2,_context148.v);}},_callee148,this);}));function ipRoyaltyVaults(_x109){return _ipRoyaltyVaults.apply(this,arguments);}return ipRoyaltyVaults;}()/**
|
|
2455
2472
|
* method isWhitelistedRoyaltyPolicy for contract RoyaltyModule
|
|
2456
2473
|
*
|
|
2457
2474
|
* @param request RoyaltyModuleIsWhitelistedRoyaltyPolicyRequest
|
|
2458
2475
|
* @return Promise<RoyaltyModuleIsWhitelistedRoyaltyPolicyResponse>
|
|
2459
|
-
*/)},{key:"isWhitelistedRoyaltyPolicy",value:(function(){var _isWhitelistedRoyaltyPolicy=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2476
|
+
*/)},{key:"isWhitelistedRoyaltyPolicy",value:(function(){var _isWhitelistedRoyaltyPolicy=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee149(request){return _regenerator().w(function(_context149){while(1)switch(_context149.n){case 0:_context149.n=1;return this.rpcClient.readContract({abi:royaltyModuleAbi,address:this.address,functionName:"isWhitelistedRoyaltyPolicy",args:[request.royaltyPolicy]});case 1:return _context149.a(2,_context149.v);}},_callee149,this);}));function isWhitelistedRoyaltyPolicy(_x110){return _isWhitelistedRoyaltyPolicy.apply(this,arguments);}return isWhitelistedRoyaltyPolicy;}()/**
|
|
2460
2477
|
* method isWhitelistedRoyaltyToken for contract RoyaltyModule
|
|
2461
2478
|
*
|
|
2462
2479
|
* @param request RoyaltyModuleIsWhitelistedRoyaltyTokenRequest
|
|
2463
2480
|
* @return Promise<RoyaltyModuleIsWhitelistedRoyaltyTokenResponse>
|
|
2464
|
-
*/)},{key:"isWhitelistedRoyaltyToken",value:(function(){var _isWhitelistedRoyaltyToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2481
|
+
*/)},{key:"isWhitelistedRoyaltyToken",value:(function(){var _isWhitelistedRoyaltyToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee150(request){return _regenerator().w(function(_context150){while(1)switch(_context150.n){case 0:_context150.n=1;return this.rpcClient.readContract({abi:royaltyModuleAbi,address:this.address,functionName:"isWhitelistedRoyaltyToken",args:[request.token]});case 1:return _context150.a(2,_context150.v);}},_callee150,this);}));function isWhitelistedRoyaltyToken(_x111){return _isWhitelistedRoyaltyToken.apply(this,arguments);}return isWhitelistedRoyaltyToken;}())}]);}(RoyaltyModuleEventClient);/**
|
|
2465
2482
|
* contract RoyaltyModule write method
|
|
2466
|
-
*/var RoyaltyModuleClient=/*#__PURE__*/function(_RoyaltyModuleReadOnl){function RoyaltyModuleClient(rpcClient,wallet,address){var
|
|
2483
|
+
*/var RoyaltyModuleClient=/*#__PURE__*/function(_RoyaltyModuleReadOnl){function RoyaltyModuleClient(rpcClient,wallet,address){var _this12;_classCallCheck(this,RoyaltyModuleClient);_this12=_callSuper(this,RoyaltyModuleClient,[rpcClient,address]);_this12.wallet=wallet;return _this12;}/**
|
|
2467
2484
|
* method payRoyaltyOnBehalf for contract RoyaltyModule
|
|
2468
2485
|
*
|
|
2469
2486
|
* @param request RoyaltyModulePayRoyaltyOnBehalfRequest
|
|
2470
2487
|
* @return Promise<WriteContractReturnType>
|
|
2471
|
-
*/_inherits(RoyaltyModuleClient,_RoyaltyModuleReadOnl);return _createClass(RoyaltyModuleClient,[{key:"payRoyaltyOnBehalf",value:(function(){var _payRoyaltyOnBehalf=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2488
|
+
*/_inherits(RoyaltyModuleClient,_RoyaltyModuleReadOnl);return _createClass(RoyaltyModuleClient,[{key:"payRoyaltyOnBehalf",value:(function(){var _payRoyaltyOnBehalf=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee151(request){var _yield$this$rpcClient71,call;return _regenerator().w(function(_context151){while(1)switch(_context151.n){case 0:_context151.n=1;return this.rpcClient.simulateContract({abi:royaltyModuleAbi,address:this.address,functionName:"payRoyaltyOnBehalf",account:this.wallet.account,args:[request.receiverIpId,request.payerIpId,request.token,request.amount]});case 1:_yield$this$rpcClient71=_context151.v;call=_yield$this$rpcClient71.request;_context151.n=2;return this.wallet.writeContract(call);case 2:return _context151.a(2,_context151.v);}},_callee151,this);}));function payRoyaltyOnBehalf(_x112){return _payRoyaltyOnBehalf.apply(this,arguments);}return payRoyaltyOnBehalf;}()/**
|
|
2472
2489
|
* method payRoyaltyOnBehalf for contract RoyaltyModule with only encode
|
|
2473
2490
|
*
|
|
2474
2491
|
* @param request RoyaltyModulePayRoyaltyOnBehalfRequest
|
|
@@ -2525,7 +2542,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2525
2542
|
*
|
|
2526
2543
|
* @param request RoyaltyTokenDistributionWorkflowsDistributeRoyaltyTokensRequest
|
|
2527
2544
|
* @return Promise<WriteContractReturnType>
|
|
2528
|
-
*/return _createClass(RoyaltyTokenDistributionWorkflowsClient,[{key:"distributeRoyaltyTokens",value:(function(){var _distributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2545
|
+
*/return _createClass(RoyaltyTokenDistributionWorkflowsClient,[{key:"distributeRoyaltyTokens",value:(function(){var _distributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee175(request){var _yield$this$rpcClient82,call;return _regenerator().w(function(_context175){while(1)switch(_context175.n){case 0:_context175.n=1;return this.rpcClient.simulateContract({abi:royaltyTokenDistributionWorkflowsAbi,address:this.address,functionName:"distributeRoyaltyTokens",account:this.wallet.account,args:[request.ipId,request.royaltyShares,request.sigApproveRoyaltyTokens]});case 1:_yield$this$rpcClient82=_context175.v;call=_yield$this$rpcClient82.request;_context175.n=2;return this.wallet.writeContract(call);case 2:return _context175.a(2,_context175.v);}},_callee175,this);}));function distributeRoyaltyTokens(_x124){return _distributeRoyaltyTokens.apply(this,arguments);}return distributeRoyaltyTokens;}()/**
|
|
2529
2546
|
* method distributeRoyaltyTokens for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2530
2547
|
*
|
|
2531
2548
|
* @param request RoyaltyTokenDistributionWorkflowsDistributeRoyaltyTokensRequest
|
|
@@ -2535,7 +2552,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2535
2552
|
*
|
|
2536
2553
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
|
|
2537
2554
|
* @return Promise<WriteContractReturnType>
|
|
2538
|
-
*/},{key:"mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens",value:(function(){var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2555
|
+
*/},{key:"mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens",value:(function(){var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee176(request){var _yield$this$rpcClient83,call;return _regenerator().w(function(_context176){while(1)switch(_context176.n){case 0:_context176.n=1;return this.rpcClient.simulateContract({abi:royaltyTokenDistributionWorkflowsAbi,address:this.address,functionName:"mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens",account:this.wallet.account,args:[request.spgNftContract,request.recipient,request.ipMetadata,request.licenseTermsData,request.royaltyShares,request.allowDuplicates]});case 1:_yield$this$rpcClient83=_context176.v;call=_yield$this$rpcClient83.request;_context176.n=2;return this.wallet.writeContract(call);case 2:return _context176.a(2,_context176.v);}},_callee176,this);}));function mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(_x125){return _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens.apply(this,arguments);}return mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens;}()/**
|
|
2539
2556
|
* method mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2540
2557
|
*
|
|
2541
2558
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
|
|
@@ -2545,7 +2562,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2545
2562
|
*
|
|
2546
2563
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
|
|
2547
2564
|
* @return Promise<WriteContractReturnType>
|
|
2548
|
-
*/},{key:"mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",value:(function(){var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2565
|
+
*/},{key:"mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",value:(function(){var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee177(request){var _yield$this$rpcClient84,call;return _regenerator().w(function(_context177){while(1)switch(_context177.n){case 0:_context177.n=1;return this.rpcClient.simulateContract({abi:royaltyTokenDistributionWorkflowsAbi,address:this.address,functionName:"mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",account:this.wallet.account,args:[request.spgNftContract,request.recipient,request.ipMetadata,request.derivData,request.royaltyShares,request.allowDuplicates]});case 1:_yield$this$rpcClient84=_context177.v;call=_yield$this$rpcClient84.request;_context177.n=2;return this.wallet.writeContract(call);case 2:return _context177.a(2,_context177.v);}},_callee177,this);}));function mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens(_x126){return _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens.apply(this,arguments);}return mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens;}()/**
|
|
2549
2566
|
* method mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2550
2567
|
*
|
|
2551
2568
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
|
|
@@ -2555,7 +2572,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2555
2572
|
*
|
|
2556
2573
|
* @param request RoyaltyTokenDistributionWorkflowsMulticallRequest
|
|
2557
2574
|
* @return Promise<WriteContractReturnType>
|
|
2558
|
-
*/},{key:"multicall",value:(function(){var _multicall4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2575
|
+
*/},{key:"multicall",value:(function(){var _multicall4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee178(request){var _yield$this$rpcClient85,call;return _regenerator().w(function(_context178){while(1)switch(_context178.n){case 0:_context178.n=1;return this.rpcClient.simulateContract({abi:royaltyTokenDistributionWorkflowsAbi,address:this.address,functionName:"multicall",account:this.wallet.account,args:[request.data]});case 1:_yield$this$rpcClient85=_context178.v;call=_yield$this$rpcClient85.request;_context178.n=2;return this.wallet.writeContract(call);case 2:return _context178.a(2,_context178.v);}},_callee178,this);}));function multicall(_x127){return _multicall4.apply(this,arguments);}return multicall;}()/**
|
|
2559
2576
|
* method multicall for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2560
2577
|
*
|
|
2561
2578
|
* @param request RoyaltyTokenDistributionWorkflowsMulticallRequest
|
|
@@ -2565,7 +2582,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2565
2582
|
*
|
|
2566
2583
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndAttachPilTermsAndDeployRoyaltyVaultRequest
|
|
2567
2584
|
* @return Promise<WriteContractReturnType>
|
|
2568
|
-
*/},{key:"registerIpAndAttachPilTermsAndDeployRoyaltyVault",value:(function(){var _registerIpAndAttachPilTermsAndDeployRoyaltyVault=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2585
|
+
*/},{key:"registerIpAndAttachPilTermsAndDeployRoyaltyVault",value:(function(){var _registerIpAndAttachPilTermsAndDeployRoyaltyVault=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee179(request){var _yield$this$rpcClient86,call;return _regenerator().w(function(_context179){while(1)switch(_context179.n){case 0:_context179.n=1;return this.rpcClient.simulateContract({abi:royaltyTokenDistributionWorkflowsAbi,address:this.address,functionName:"registerIpAndAttachPILTermsAndDeployRoyaltyVault",account:this.wallet.account,args:[request.nftContract,request.tokenId,request.ipMetadata,request.licenseTermsData,request.sigMetadataAndAttachAndConfig]});case 1:_yield$this$rpcClient86=_context179.v;call=_yield$this$rpcClient86.request;_context179.n=2;return this.wallet.writeContract(call);case 2:return _context179.a(2,_context179.v);}},_callee179,this);}));function registerIpAndAttachPilTermsAndDeployRoyaltyVault(_x128){return _registerIpAndAttachPilTermsAndDeployRoyaltyVault.apply(this,arguments);}return registerIpAndAttachPilTermsAndDeployRoyaltyVault;}()/**
|
|
2569
2586
|
* method registerIpAndAttachPILTermsAndDeployRoyaltyVault for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2570
2587
|
*
|
|
2571
2588
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndAttachPilTermsAndDeployRoyaltyVaultRequest
|
|
@@ -2575,7 +2592,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2575
2592
|
*
|
|
2576
2593
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest
|
|
2577
2594
|
* @return Promise<WriteContractReturnType>
|
|
2578
|
-
*/},{key:"registerIpAndMakeDerivativeAndDeployRoyaltyVault",value:(function(){var _registerIpAndMakeDerivativeAndDeployRoyaltyVault=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2595
|
+
*/},{key:"registerIpAndMakeDerivativeAndDeployRoyaltyVault",value:(function(){var _registerIpAndMakeDerivativeAndDeployRoyaltyVault=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee180(request){var _yield$this$rpcClient87,call;return _regenerator().w(function(_context180){while(1)switch(_context180.n){case 0:_context180.n=1;return this.rpcClient.simulateContract({abi:royaltyTokenDistributionWorkflowsAbi,address:this.address,functionName:"registerIpAndMakeDerivativeAndDeployRoyaltyVault",account:this.wallet.account,args:[request.nftContract,request.tokenId,request.ipMetadata,request.derivData,request.sigMetadataAndRegister]});case 1:_yield$this$rpcClient87=_context180.v;call=_yield$this$rpcClient87.request;_context180.n=2;return this.wallet.writeContract(call);case 2:return _context180.a(2,_context180.v);}},_callee180,this);}));function registerIpAndMakeDerivativeAndDeployRoyaltyVault(_x129){return _registerIpAndMakeDerivativeAndDeployRoyaltyVault.apply(this,arguments);}return registerIpAndMakeDerivativeAndDeployRoyaltyVault;}()/**
|
|
2579
2596
|
* method registerIpAndMakeDerivativeAndDeployRoyaltyVault for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2580
2597
|
*
|
|
2581
2598
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest
|
|
@@ -2600,7 +2617,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2600
2617
|
*
|
|
2601
2618
|
* @param request RoyaltyWorkflowsClaimAllRevenueRequest
|
|
2602
2619
|
* @return Promise<WriteContractReturnType>
|
|
2603
|
-
*/return _createClass(RoyaltyWorkflowsClient,[{key:"claimAllRevenue",value:(function(){var _claimAllRevenue=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2620
|
+
*/return _createClass(RoyaltyWorkflowsClient,[{key:"claimAllRevenue",value:(function(){var _claimAllRevenue=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee181(request){var _yield$this$rpcClient88,call;return _regenerator().w(function(_context181){while(1)switch(_context181.n){case 0:_context181.n=1;return this.rpcClient.simulateContract({abi:royaltyWorkflowsAbi,address:this.address,functionName:"claimAllRevenue",account:this.wallet.account,args:[request.ancestorIpId,request.claimer,request.childIpIds,request.royaltyPolicies,request.currencyTokens]});case 1:_yield$this$rpcClient88=_context181.v;call=_yield$this$rpcClient88.request;_context181.n=2;return this.wallet.writeContract(call);case 2:return _context181.a(2,_context181.v);}},_callee181,this);}));function claimAllRevenue(_x130){return _claimAllRevenue.apply(this,arguments);}return claimAllRevenue;}()/**
|
|
2604
2621
|
* method claimAllRevenue for contract RoyaltyWorkflows with only encode
|
|
2605
2622
|
*
|
|
2606
2623
|
* @param request RoyaltyWorkflowsClaimAllRevenueRequest
|
|
@@ -2610,7 +2627,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2610
2627
|
*
|
|
2611
2628
|
* @param request RoyaltyWorkflowsMulticallRequest
|
|
2612
2629
|
* @return Promise<WriteContractReturnType>
|
|
2613
|
-
*/},{key:"multicall",value:(function(){var _multicall5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2630
|
+
*/},{key:"multicall",value:(function(){var _multicall5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee182(request){var _yield$this$rpcClient89,call;return _regenerator().w(function(_context182){while(1)switch(_context182.n){case 0:_context182.n=1;return this.rpcClient.simulateContract({abi:royaltyWorkflowsAbi,address:this.address,functionName:"multicall",account:this.wallet.account,args:[request.data]});case 1:_yield$this$rpcClient89=_context182.v;call=_yield$this$rpcClient89.request;_context182.n=2;return this.wallet.writeContract(call);case 2:return _context182.a(2,_context182.v);}},_callee182,this);}));function multicall(_x131){return _multicall5.apply(this,arguments);}return multicall;}()/**
|
|
2614
2631
|
* method multicall for contract RoyaltyWorkflows with only encode
|
|
2615
2632
|
*
|
|
2616
2633
|
* @param request RoyaltyWorkflowsMulticallRequest
|
|
@@ -2649,34 +2666,34 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2649
2666
|
*
|
|
2650
2667
|
* @param request SpgnftImplHasRoleRequest
|
|
2651
2668
|
* @return Promise<SpgnftImplHasRoleResponse>
|
|
2652
|
-
*/_inherits(SpgnftImplReadOnlyClient,_SpgnftImplEventClien);return _createClass(SpgnftImplReadOnlyClient,[{key:"hasRole",value:(function(){var _hasRole=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2669
|
+
*/_inherits(SpgnftImplReadOnlyClient,_SpgnftImplEventClien);return _createClass(SpgnftImplReadOnlyClient,[{key:"hasRole",value:(function(){var _hasRole=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee188(request){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:"hasRole",args:[request.role,request.account]});case 1:return _context188.a(2,_context188.v);}},_callee188,this);}));function hasRole(_x134){return _hasRole.apply(this,arguments);}return hasRole;}()/**
|
|
2653
2670
|
* method mintFee for contract SPGNFTImpl
|
|
2654
2671
|
*
|
|
2655
2672
|
* @param request SpgnftImplMintFeeRequest
|
|
2656
2673
|
* @return Promise<SpgnftImplMintFeeResponse>
|
|
2657
|
-
*/)},{key:"mintFee",value:(function(){var _mintFee=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2674
|
+
*/)},{key:"mintFee",value:(function(){var _mintFee=_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:"mintFee"});case 1:return _context189.a(2,_context189.v);}},_callee189,this);}));function mintFee(){return _mintFee.apply(this,arguments);}return mintFee;}()/**
|
|
2658
2675
|
* method mintFeeToken for contract SPGNFTImpl
|
|
2659
2676
|
*
|
|
2660
2677
|
* @param request SpgnftImplMintFeeTokenRequest
|
|
2661
2678
|
* @return Promise<SpgnftImplMintFeeTokenResponse>
|
|
2662
|
-
*/)},{key:"mintFeeToken",value:(function(){var _mintFeeToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2679
|
+
*/)},{key:"mintFeeToken",value:(function(){var _mintFeeToken=_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:"mintFeeToken"});case 1:return _context190.a(2,_context190.v);}},_callee190,this);}));function mintFeeToken(){return _mintFeeToken.apply(this,arguments);}return mintFeeToken;}()/**
|
|
2663
2680
|
* method publicMinting for contract SPGNFTImpl
|
|
2664
2681
|
*
|
|
2665
2682
|
* @param request SpgnftImplPublicMintingRequest
|
|
2666
2683
|
* @return Promise<SpgnftImplPublicMintingResponse>
|
|
2667
|
-
*/)},{key:"publicMinting",value:(function(){var _publicMinting=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2684
|
+
*/)},{key:"publicMinting",value:(function(){var _publicMinting=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee191(){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:"publicMinting"});case 1:return _context191.a(2,_context191.v);}},_callee191,this);}));function publicMinting(){return _publicMinting.apply(this,arguments);}return publicMinting;}()/**
|
|
2668
2685
|
* method tokenURI for contract SPGNFTImpl
|
|
2669
2686
|
*
|
|
2670
2687
|
* @param request SpgnftImplTokenUriRequest
|
|
2671
2688
|
* @return Promise<SpgnftImplTokenUriResponse>
|
|
2672
|
-
*/)},{key:"tokenUri",value:(function(){var _tokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2689
|
+
*/)},{key:"tokenUri",value:(function(){var _tokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee192(request){return _regenerator().w(function(_context192){while(1)switch(_context192.n){case 0:_context192.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"tokenURI",args:[request.tokenId]});case 1:return _context192.a(2,_context192.v);}},_callee192,this);}));function tokenUri(_x135){return _tokenUri.apply(this,arguments);}return tokenUri;}())}]);}(SpgnftImplEventClient);/**
|
|
2673
2690
|
* contract SPGNFTImpl write method
|
|
2674
|
-
*/var SpgnftImplClient=/*#__PURE__*/function(_SpgnftImplReadOnlyCl){function SpgnftImplClient(rpcClient,wallet,address){var
|
|
2691
|
+
*/var SpgnftImplClient=/*#__PURE__*/function(_SpgnftImplReadOnlyCl){function SpgnftImplClient(rpcClient,wallet,address){var _this15;_classCallCheck(this,SpgnftImplClient);_this15=_callSuper(this,SpgnftImplClient,[rpcClient,address]);_this15.wallet=wallet;return _this15;}/**
|
|
2675
2692
|
* method setTokenURI for contract SPGNFTImpl
|
|
2676
2693
|
*
|
|
2677
2694
|
* @param request SpgnftImplSetTokenUriRequest
|
|
2678
2695
|
* @return Promise<WriteContractReturnType>
|
|
2679
|
-
*/_inherits(SpgnftImplClient,_SpgnftImplReadOnlyCl);return _createClass(SpgnftImplClient,[{key:"setTokenUri",value:(function(){var _setTokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2696
|
+
*/_inherits(SpgnftImplClient,_SpgnftImplReadOnlyCl);return _createClass(SpgnftImplClient,[{key:"setTokenUri",value:(function(){var _setTokenUri=_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:spgnftImplAbi,address:this.address,functionName:"setTokenURI",account:this.wallet.account,args:[request.tokenId,request.tokenUri]});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 setTokenUri(_x136){return _setTokenUri.apply(this,arguments);}return setTokenUri;}()/**
|
|
2680
2697
|
* method setTokenURI for contract SPGNFTImpl with only encode
|
|
2681
2698
|
*
|
|
2682
2699
|
* @param request SpgnftImplSetTokenUriRequest
|
|
@@ -2696,7 +2713,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2696
2713
|
*
|
|
2697
2714
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
|
2698
2715
|
* @return Promise<WriteContractReturnType>
|
|
2699
|
-
*/return _createClass(TotalLicenseTokenLimitHookClient,[{key:"setTotalLicenseTokenLimit",value:(function(){var _setTotalLicenseTokenLimit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2716
|
+
*/return _createClass(TotalLicenseTokenLimitHookClient,[{key:"setTotalLicenseTokenLimit",value:(function(){var _setTotalLicenseTokenLimit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee194(request){var _yield$this$rpcClient94,call;return _regenerator().w(function(_context194){while(1)switch(_context194.n){case 0:_context194.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$rpcClient94=_context194.v;call=_yield$this$rpcClient94.request;_context194.n=2;return this.wallet.writeContract(call);case 2:return _context194.a(2,_context194.v);}},_callee194,this);}));function setTotalLicenseTokenLimit(_x137){return _setTotalLicenseTokenLimit.apply(this,arguments);}return setTotalLicenseTokenLimit;}()/**
|
|
2700
2717
|
* method setTotalLicenseTokenLimit for contract TotalLicenseTokenLimitHook with only encode
|
|
2701
2718
|
*
|
|
2702
2719
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
|
@@ -2746,19 +2763,19 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2746
2763
|
*
|
|
2747
2764
|
* @param request WrappedIpAllowanceRequest
|
|
2748
2765
|
* @return Promise<WrappedIpAllowanceResponse>
|
|
2749
|
-
*/return _createClass(WrappedIpReadOnlyClient,[{key:"allowance",value:(function(){var _allowance2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2766
|
+
*/return _createClass(WrappedIpReadOnlyClient,[{key:"allowance",value:(function(){var _allowance2=_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:"allowance",args:[request.owner,request.spender]});case 1:result=_context195.v;return _context195.a(2,{result:result});}},_callee195,this);}));function allowance(_x138){return _allowance2.apply(this,arguments);}return allowance;}()/**
|
|
2750
2767
|
* method balanceOf for contract WrappedIP
|
|
2751
2768
|
*
|
|
2752
2769
|
* @param request WrappedIpBalanceOfRequest
|
|
2753
2770
|
* @return Promise<WrappedIpBalanceOfResponse>
|
|
2754
|
-
*/)},{key:"balanceOf",value:(function(){var _balanceOf3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2771
|
+
*/)},{key:"balanceOf",value:(function(){var _balanceOf3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee196(request){var result;return _regenerator().w(function(_context196){while(1)switch(_context196.n){case 0:_context196.n=1;return this.rpcClient.readContract({abi:wrappedIpAbi,address:this.address,functionName:"balanceOf",args:[request.owner]});case 1:result=_context196.v;return _context196.a(2,{result:result});}},_callee196,this);}));function balanceOf(_x139){return _balanceOf3.apply(this,arguments);}return balanceOf;}())}]);}();/**
|
|
2755
2772
|
* contract WrappedIP write method
|
|
2756
|
-
*/var WrappedIpClient=/*#__PURE__*/function(_WrappedIpReadOnlyCli){function WrappedIpClient(rpcClient,wallet,address){var
|
|
2773
|
+
*/var WrappedIpClient=/*#__PURE__*/function(_WrappedIpReadOnlyCli){function WrappedIpClient(rpcClient,wallet,address){var _this16;_classCallCheck(this,WrappedIpClient);_this16=_callSuper(this,WrappedIpClient,[rpcClient,address]);_this16.wallet=wallet;return _this16;}/**
|
|
2757
2774
|
* method approve for contract WrappedIP
|
|
2758
2775
|
*
|
|
2759
2776
|
* @param request WrappedIpApproveRequest
|
|
2760
2777
|
* @return Promise<WriteContractReturnType>
|
|
2761
|
-
*/_inherits(WrappedIpClient,_WrappedIpReadOnlyCli);return _createClass(WrappedIpClient,[{key:"approve",value:(function(){var
|
|
2778
|
+
*/_inherits(WrappedIpClient,_WrappedIpReadOnlyCli);return _createClass(WrappedIpClient,[{key:"approve",value:(function(){var _approve3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee197(request){var _yield$this$rpcClient95,call;return _regenerator().w(function(_context197){while(1)switch(_context197.n){case 0:_context197.n=1;return this.rpcClient.simulateContract({abi:wrappedIpAbi,address:this.address,functionName:"approve",account:this.wallet.account,args:[request.spender,request.amount]});case 1:_yield$this$rpcClient95=_context197.v;call=_yield$this$rpcClient95.request;_context197.n=2;return this.wallet.writeContract(call);case 2:return _context197.a(2,_context197.v);}},_callee197,this);}));function approve(_x140){return _approve3.apply(this,arguments);}return approve;}()/**
|
|
2762
2779
|
* method approve for contract WrappedIP with only encode
|
|
2763
2780
|
*
|
|
2764
2781
|
* @param request WrappedIpApproveRequest
|
|
@@ -2768,7 +2785,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2768
2785
|
*
|
|
2769
2786
|
* @param request WrappedIpDepositRequest
|
|
2770
2787
|
* @return Promise<WriteContractReturnType>
|
|
2771
|
-
*/},{key:"deposit",value:(function(){var _deposit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2788
|
+
*/},{key:"deposit",value:(function(){var _deposit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee198(){var _yield$this$rpcClient96,call;return _regenerator().w(function(_context198){while(1)switch(_context198.n){case 0:_context198.n=1;return this.rpcClient.simulateContract({abi:wrappedIpAbi,address:this.address,functionName:"deposit",account:this.wallet.account});case 1:_yield$this$rpcClient96=_context198.v;call=_yield$this$rpcClient96.request;_context198.n=2;return this.wallet.writeContract(call);case 2:return _context198.a(2,_context198.v);}},_callee198,this);}));function deposit(){return _deposit.apply(this,arguments);}return deposit;}()/**
|
|
2772
2789
|
* method deposit for contract WrappedIP with only encode
|
|
2773
2790
|
*
|
|
2774
2791
|
* @param request WrappedIpDepositRequest
|
|
@@ -2778,7 +2795,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2778
2795
|
*
|
|
2779
2796
|
* @param request WrappedIpTransferRequest
|
|
2780
2797
|
* @return Promise<WriteContractReturnType>
|
|
2781
|
-
*/},{key:"transfer",value:(function(){var _transfer2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2798
|
+
*/},{key:"transfer",value:(function(){var _transfer2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee199(request){var _yield$this$rpcClient97,call;return _regenerator().w(function(_context199){while(1)switch(_context199.n){case 0:_context199.n=1;return this.rpcClient.simulateContract({abi:wrappedIpAbi,address:this.address,functionName:"transfer",account:this.wallet.account,args:[request.to,request.amount]});case 1:_yield$this$rpcClient97=_context199.v;call=_yield$this$rpcClient97.request;_context199.n=2;return this.wallet.writeContract(call);case 2:return _context199.a(2,_context199.v);}},_callee199,this);}));function transfer(_x141){return _transfer2.apply(this,arguments);}return transfer;}()/**
|
|
2782
2799
|
* method transfer for contract WrappedIP with only encode
|
|
2783
2800
|
*
|
|
2784
2801
|
* @param request WrappedIpTransferRequest
|
|
@@ -2788,7 +2805,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2788
2805
|
*
|
|
2789
2806
|
* @param request WrappedIpTransferFromRequest
|
|
2790
2807
|
* @return Promise<WriteContractReturnType>
|
|
2791
|
-
*/},{key:"transferFrom",value:(function(){var _transferFrom2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2808
|
+
*/},{key:"transferFrom",value:(function(){var _transferFrom2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee200(request){var _yield$this$rpcClient98,call;return _regenerator().w(function(_context200){while(1)switch(_context200.n){case 0:_context200.n=1;return this.rpcClient.simulateContract({abi:wrappedIpAbi,address:this.address,functionName:"transferFrom",account:this.wallet.account,args:[request.from,request.to,request.amount]});case 1:_yield$this$rpcClient98=_context200.v;call=_yield$this$rpcClient98.request;_context200.n=2;return this.wallet.writeContract(call);case 2:return _context200.a(2,_context200.v);}},_callee200,this);}));function transferFrom(_x142){return _transferFrom2.apply(this,arguments);}return transferFrom;}()/**
|
|
2792
2809
|
* method transferFrom for contract WrappedIP with only encode
|
|
2793
2810
|
*
|
|
2794
2811
|
* @param request WrappedIpTransferFromRequest
|
|
@@ -2798,7 +2815,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2798
2815
|
*
|
|
2799
2816
|
* @param request WrappedIpWithdrawRequest
|
|
2800
2817
|
* @return Promise<WriteContractReturnType>
|
|
2801
|
-
*/},{key:"withdraw",value:(function(){var _withdraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2818
|
+
*/},{key:"withdraw",value:(function(){var _withdraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee201(request){var _yield$this$rpcClient99,call;return _regenerator().w(function(_context201){while(1)switch(_context201.n){case 0:_context201.n=1;return this.rpcClient.simulateContract({abi:wrappedIpAbi,address:this.address,functionName:"withdraw",account:this.wallet.account,args:[request.value]});case 1:_yield$this$rpcClient99=_context201.v;call=_yield$this$rpcClient99.request;_context201.n=2;return this.wallet.writeContract(call);case 2:return _context201.a(2,_context201.v);}},_callee201,this);}));function withdraw(_x143){return _withdraw.apply(this,arguments);}return withdraw;}()/**
|
|
2802
2819
|
* method withdraw for contract WrappedIP with only encode
|
|
2803
2820
|
*
|
|
2804
2821
|
* @param request WrappedIpWithdrawRequest
|
|
@@ -2861,7 +2878,6 @@ var mainnet = defineChain({
|
|
|
2861
2878
|
});
|
|
2862
2879
|
|
|
2863
2880
|
var defaultFunctionSelector = "0x00000000";
|
|
2864
|
-
var royaltySharesTotalSupply = 100000000;
|
|
2865
2881
|
var MAX_ROYALTY_TOKEN = 100000000;
|
|
2866
2882
|
var WIP_TOKEN_ADDRESS = wrappedIpAddress[mainnet.id];
|
|
2867
2883
|
|
|
@@ -3230,6 +3246,24 @@ var waitForTxReceipts = /*#__PURE__*/function () {
|
|
|
3230
3246
|
};
|
|
3231
3247
|
}();
|
|
3232
3248
|
|
|
3249
|
+
var waitTx = /*#__PURE__*/function () {
|
|
3250
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(client, txHash, params) {
|
|
3251
|
+
return _regenerator().w(function (_context2) {
|
|
3252
|
+
while (1) switch (_context2.n) {
|
|
3253
|
+
case 0:
|
|
3254
|
+
_context2.n = 1;
|
|
3255
|
+
return client.waitForTransactionReceipt(_objectSpread2({
|
|
3256
|
+
hash: txHash
|
|
3257
|
+
}, params));
|
|
3258
|
+
case 1:
|
|
3259
|
+
return _context2.a(2);
|
|
3260
|
+
}
|
|
3261
|
+
}, _callee2);
|
|
3262
|
+
}));
|
|
3263
|
+
return function waitTx(_x4, _x5, _x6) {
|
|
3264
|
+
return _ref2.apply(this, arguments);
|
|
3265
|
+
};
|
|
3266
|
+
}();
|
|
3233
3267
|
var chainStringToViemChain = function chainStringToViemChain(chainId) {
|
|
3234
3268
|
switch (chainId) {
|
|
3235
3269
|
case 1315:
|
|
@@ -3266,6 +3300,22 @@ var getTokenAmountDisplay = function getTokenAmountDisplay(amount) {
|
|
|
3266
3300
|
return "".concat(formatEther(amount)).concat(unit);
|
|
3267
3301
|
};
|
|
3268
3302
|
|
|
3303
|
+
/**
|
|
3304
|
+
* Merges spenders with the same address by summing their amounts.
|
|
3305
|
+
*/
|
|
3306
|
+
var mergeSpenderByAddress = function mergeSpenderByAddress(spenders, newSpender) {
|
|
3307
|
+
var existingSpender = spenders.find(function (s) {
|
|
3308
|
+
return s.address === newSpender.address && s.token === newSpender.token;
|
|
3309
|
+
});
|
|
3310
|
+
if (existingSpender) {
|
|
3311
|
+
existingSpender.amount = (newSpender.amount || 0n) + (existingSpender.amount || 0n);
|
|
3312
|
+
} else {
|
|
3313
|
+
spenders.push(_objectSpread2(_objectSpread2({}, newSpender), {}, {
|
|
3314
|
+
amount: newSpender.amount || 0n
|
|
3315
|
+
}));
|
|
3316
|
+
}
|
|
3317
|
+
};
|
|
3318
|
+
|
|
3269
3319
|
/**
|
|
3270
3320
|
* check the allowance of all spenders and call approval if any spender
|
|
3271
3321
|
* allowance is lower than the amount they are expected to spend.
|
|
@@ -3475,153 +3525,365 @@ var multiCallWrapIp = /*#__PURE__*/function () {
|
|
|
3475
3525
|
}();
|
|
3476
3526
|
|
|
3477
3527
|
/**
|
|
3478
|
-
*
|
|
3479
|
-
* For all other ERC20 tokens, it handles approvals if insufficient allowance.
|
|
3480
|
-
*
|
|
3481
|
-
* @remarks
|
|
3482
|
-
* This function will automatically handle the following:
|
|
3483
|
-
*
|
|
3484
|
-
* If token is wip and the user does not have enough WIP, it will wrap IP to WIP, unless
|
|
3485
|
-
* disabled via `disableAutoWrappingIp`.
|
|
3486
|
-
*
|
|
3487
|
-
* If the user have enough token, it will check for if approvals are needed
|
|
3488
|
-
* for each spender address and approve it, unless disabled via `disableAutoApprove`.
|
|
3528
|
+
* Calculate the total amount needed from spenders.
|
|
3489
3529
|
*/
|
|
3490
|
-
var
|
|
3530
|
+
var calculateTotalAmount = function calculateTotalAmount(spenders) {
|
|
3531
|
+
return spenders.reduce(function (acc, spender) {
|
|
3532
|
+
return acc + (spender.amount || 0n);
|
|
3533
|
+
}, 0n);
|
|
3534
|
+
};
|
|
3535
|
+
|
|
3536
|
+
/**
|
|
3537
|
+
* Handle ERC20 token payment with approval and balance check.
|
|
3538
|
+
*/
|
|
3539
|
+
var handleErc20Payment = /*#__PURE__*/function () {
|
|
3491
3540
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref6) {
|
|
3492
|
-
var _options$
|
|
3493
|
-
var
|
|
3541
|
+
var _options$erc20Options;
|
|
3542
|
+
var tokenSpenders, sender, options, multicall3Address, rpcClient, wallet, contractCall, txOptions, tokenClient, autoApprove, _t2;
|
|
3494
3543
|
return _regenerator().w(function (_context4) {
|
|
3495
3544
|
while (1) switch (_context4.n) {
|
|
3496
3545
|
case 0:
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
if (!(totalFees === 0n)) {
|
|
3503
|
-
_context4.n = 2;
|
|
3546
|
+
tokenSpenders = _ref6.tokenSpenders, sender = _ref6.sender, options = _ref6.options, multicall3Address = _ref6.multicall3Address, rpcClient = _ref6.rpcClient, wallet = _ref6.wallet, contractCall = _ref6.contractCall, txOptions = _ref6.txOptions;
|
|
3547
|
+
tokenClient = new ERC20Client(rpcClient, wallet, tokenSpenders[0].token);
|
|
3548
|
+
autoApprove = (options === null || options === void 0 || (_options$erc20Options = options.erc20Options) === null || _options$erc20Options === void 0 ? void 0 : _options$erc20Options.enableAutoApprove) !== false;
|
|
3549
|
+
if (!autoApprove) {
|
|
3550
|
+
_context4.n = 1;
|
|
3504
3551
|
break;
|
|
3505
3552
|
}
|
|
3506
3553
|
_context4.n = 1;
|
|
3507
|
-
return
|
|
3554
|
+
return approvalAllSpenders({
|
|
3555
|
+
spenders: tokenSpenders,
|
|
3556
|
+
client: tokenClient,
|
|
3557
|
+
owner: sender,
|
|
3558
|
+
multicallAddress: multicall3Address,
|
|
3559
|
+
rpcClient: rpcClient,
|
|
3560
|
+
useMultiCall: false
|
|
3561
|
+
});
|
|
3508
3562
|
case 1:
|
|
3509
|
-
|
|
3510
|
-
|
|
3563
|
+
_t2 = handleTransactionResponse;
|
|
3564
|
+
_context4.n = 2;
|
|
3565
|
+
return contractCall();
|
|
3511
3566
|
case 2:
|
|
3512
|
-
_context4.
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3567
|
+
return _context4.a(2, _t2(_context4.v, rpcClient, txOptions));
|
|
3568
|
+
}
|
|
3569
|
+
}, _callee4);
|
|
3570
|
+
}));
|
|
3571
|
+
return function handleErc20Payment(_x4) {
|
|
3572
|
+
return _ref7.apply(this, arguments);
|
|
3573
|
+
};
|
|
3574
|
+
}();
|
|
3575
|
+
|
|
3576
|
+
/**
|
|
3577
|
+
* Handle WIP token payment with approval and balance check.
|
|
3578
|
+
*/
|
|
3579
|
+
var handleWipPayment = /*#__PURE__*/function () {
|
|
3580
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref8) {
|
|
3581
|
+
var _options$wipOptions;
|
|
3582
|
+
var tokenSpenders, sender, options, multicall3Address, rpcClient, contractCall, txOptions, wallet, encodedTxs, wipTokenClient, balance, totalFees, autoApprove, _t3;
|
|
3583
|
+
return _regenerator().w(function (_context5) {
|
|
3584
|
+
while (1) switch (_context5.n) {
|
|
3585
|
+
case 0:
|
|
3586
|
+
tokenSpenders = _ref8.tokenSpenders, sender = _ref8.sender, options = _ref8.options, multicall3Address = _ref8.multicall3Address, rpcClient = _ref8.rpcClient, contractCall = _ref8.contractCall, txOptions = _ref8.txOptions, wallet = _ref8.wallet, encodedTxs = _ref8.encodedTxs;
|
|
3587
|
+
wipTokenClient = new WipTokenClient(rpcClient, wallet);
|
|
3588
|
+
_context5.n = 1;
|
|
3589
|
+
return wipTokenClient.balanceOf(sender);
|
|
3590
|
+
case 1:
|
|
3591
|
+
balance = _context5.v;
|
|
3592
|
+
totalFees = calculateTotalAmount(tokenSpenders);
|
|
3593
|
+
if (!(balance < totalFees)) {
|
|
3594
|
+
_context5.n = 2;
|
|
3519
3595
|
break;
|
|
3520
3596
|
}
|
|
3597
|
+
return _context5.a(2, handleIpWrapping({
|
|
3598
|
+
tokenSpenders: tokenSpenders,
|
|
3599
|
+
sender: sender,
|
|
3600
|
+
options: options,
|
|
3601
|
+
rpcClient: rpcClient,
|
|
3602
|
+
multicall3Address: multicall3Address,
|
|
3603
|
+
contractCall: contractCall,
|
|
3604
|
+
encodedTxs: encodedTxs,
|
|
3605
|
+
wallet: wallet,
|
|
3606
|
+
txOptions: txOptions
|
|
3607
|
+
}));
|
|
3608
|
+
case 2:
|
|
3609
|
+
autoApprove = (options === null || options === void 0 || (_options$wipOptions = options.wipOptions) === null || _options$wipOptions === void 0 ? void 0 : _options$wipOptions.enableAutoApprove) !== false;
|
|
3521
3610
|
if (!autoApprove) {
|
|
3522
|
-
|
|
3611
|
+
_context5.n = 3;
|
|
3523
3612
|
break;
|
|
3524
3613
|
}
|
|
3525
|
-
|
|
3614
|
+
_context5.n = 3;
|
|
3526
3615
|
return approvalAllSpenders({
|
|
3527
3616
|
spenders: tokenSpenders,
|
|
3528
|
-
client:
|
|
3617
|
+
client: wipTokenClient,
|
|
3529
3618
|
owner: sender,
|
|
3530
|
-
// sender owns the wip
|
|
3531
3619
|
multicallAddress: multicall3Address,
|
|
3532
3620
|
rpcClient: rpcClient,
|
|
3533
|
-
// since sender has all token, if using multicall, we cannot approve transfer token into multicall by multicall.
|
|
3534
|
-
// So in this case, we don't use multicall here and instead just wait for each approval to be finished.
|
|
3535
3621
|
useMultiCall: false
|
|
3536
3622
|
});
|
|
3537
|
-
case
|
|
3538
|
-
|
|
3623
|
+
case 3:
|
|
3624
|
+
_t3 = handleTransactionResponse;
|
|
3625
|
+
_context5.n = 4;
|
|
3539
3626
|
return contractCall();
|
|
3540
|
-
case
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3627
|
+
case 4:
|
|
3628
|
+
return _context5.a(2, _t3(_context5.v, rpcClient, txOptions));
|
|
3629
|
+
}
|
|
3630
|
+
}, _callee5);
|
|
3631
|
+
}));
|
|
3632
|
+
return function handleWipPayment(_x5) {
|
|
3633
|
+
return _ref9.apply(this, arguments);
|
|
3634
|
+
};
|
|
3635
|
+
}();
|
|
3636
|
+
|
|
3637
|
+
/**
|
|
3638
|
+
* Handle IP wrapping to WIP when insufficient WIP balance.
|
|
3639
|
+
*/
|
|
3640
|
+
var handleIpWrapping = /*#__PURE__*/function () {
|
|
3641
|
+
var _ref1 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref0) {
|
|
3642
|
+
var _options$wipOptions2;
|
|
3643
|
+
var tokenSpenders, sender, options, rpcClient, multicall3Address, contractCall, encodedTxs, wallet, txOptions, autoWrapIp, ipBalance, wipClient, wipBalance, totalFees, _yield$multiCallWrapI, txHash;
|
|
3644
|
+
return _regenerator().w(function (_context6) {
|
|
3645
|
+
while (1) switch (_context6.n) {
|
|
3646
|
+
case 0:
|
|
3647
|
+
tokenSpenders = _ref0.tokenSpenders, sender = _ref0.sender, options = _ref0.options, rpcClient = _ref0.rpcClient, multicall3Address = _ref0.multicall3Address, contractCall = _ref0.contractCall, encodedTxs = _ref0.encodedTxs, wallet = _ref0.wallet, txOptions = _ref0.txOptions;
|
|
3648
|
+
autoWrapIp = (options === null || options === void 0 || (_options$wipOptions2 = options.wipOptions) === null || _options$wipOptions2 === void 0 ? void 0 : _options$wipOptions2.enableAutoWrapIp) !== false;
|
|
3649
|
+
_context6.n = 1;
|
|
3552
3650
|
return rpcClient.getBalance({
|
|
3553
3651
|
address: sender
|
|
3554
3652
|
});
|
|
3555
|
-
case
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3653
|
+
case 1:
|
|
3654
|
+
ipBalance = _context6.v;
|
|
3655
|
+
wipClient = new WipTokenClient(rpcClient, wallet);
|
|
3656
|
+
_context6.n = 2;
|
|
3657
|
+
return wipClient.balanceOf(sender);
|
|
3658
|
+
case 2:
|
|
3659
|
+
wipBalance = _context6.v;
|
|
3660
|
+
totalFees = calculateTotalAmount(tokenSpenders);
|
|
3661
|
+
if (!(ipBalance < totalFees)) {
|
|
3662
|
+
_context6.n = 3;
|
|
3559
3663
|
break;
|
|
3560
3664
|
}
|
|
3561
|
-
throw new Error("Wallet does not have enough IP to wrap to WIP and pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(
|
|
3562
|
-
case
|
|
3665
|
+
throw new Error("Wallet does not have enough IP to wrap to WIP and pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(ipBalance), "."));
|
|
3666
|
+
case 3:
|
|
3563
3667
|
if (autoWrapIp) {
|
|
3564
|
-
|
|
3668
|
+
_context6.n = 4;
|
|
3565
3669
|
break;
|
|
3566
3670
|
}
|
|
3567
|
-
throw new Error("Wallet does not have enough WIP to pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(
|
|
3568
|
-
case
|
|
3569
|
-
|
|
3570
|
-
return {
|
|
3571
|
-
target: data.to,
|
|
3572
|
-
allowFailure: false,
|
|
3573
|
-
value: 0n,
|
|
3574
|
-
callData: data.data
|
|
3575
|
-
};
|
|
3576
|
-
});
|
|
3577
|
-
_context4.n = 11;
|
|
3671
|
+
throw new Error("Wallet does not have enough WIP to pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(wipBalance, "WIP"), "."));
|
|
3672
|
+
case 4:
|
|
3673
|
+
_context6.n = 5;
|
|
3578
3674
|
return multiCallWrapIp({
|
|
3579
3675
|
ipAmountToWrap: totalFees,
|
|
3580
3676
|
multicall3Address: multicall3Address,
|
|
3581
|
-
wipClient:
|
|
3677
|
+
wipClient: wipClient,
|
|
3582
3678
|
wipOptions: options === null || options === void 0 ? void 0 : options.wipOptions,
|
|
3583
3679
|
contractCall: contractCall,
|
|
3584
3680
|
wipSpenders: tokenSpenders,
|
|
3585
3681
|
rpcClient: rpcClient,
|
|
3586
3682
|
wallet: wallet,
|
|
3587
|
-
calls:
|
|
3683
|
+
calls: encodedTxs.map(function (data) {
|
|
3684
|
+
return {
|
|
3685
|
+
target: data.to,
|
|
3686
|
+
allowFailure: false,
|
|
3687
|
+
value: 0n,
|
|
3688
|
+
callData: data.data
|
|
3689
|
+
};
|
|
3690
|
+
})
|
|
3588
3691
|
});
|
|
3589
|
-
case
|
|
3590
|
-
_yield$multiCallWrapI =
|
|
3692
|
+
case 5:
|
|
3693
|
+
_yield$multiCallWrapI = _context6.v;
|
|
3591
3694
|
txHash = _yield$multiCallWrapI.txHash;
|
|
3592
|
-
return
|
|
3695
|
+
return _context6.a(2, handleTransactionResponse(txHash, rpcClient, txOptions));
|
|
3593
3696
|
}
|
|
3594
|
-
},
|
|
3697
|
+
}, _callee6);
|
|
3595
3698
|
}));
|
|
3596
|
-
return function
|
|
3597
|
-
return
|
|
3699
|
+
return function handleIpWrapping(_x6) {
|
|
3700
|
+
return _ref1.apply(this, arguments);
|
|
3701
|
+
};
|
|
3702
|
+
}();
|
|
3703
|
+
|
|
3704
|
+
/**
|
|
3705
|
+
* Handle contract calls that require token fees.
|
|
3706
|
+
* - For fees in `WIP`, it automatically wraps `IP` to `WIP` when insufficient `WIP` balance.
|
|
3707
|
+
* - For fees in `ERC20` tokens, it automatically approves if sufficient balance is available.
|
|
3708
|
+
* - For fees in `WIP` and `ERC20` tokens, it will first check if the wallet has enough `ERC20` token to pay for fees, if not, it will throw an error.
|
|
3709
|
+
*
|
|
3710
|
+
* @remarks
|
|
3711
|
+
* This function will automatically handle the following logic:
|
|
3712
|
+
* - If token is `WIP` and the user does not have enough `WIP` balance, it will wrap `IP` to `WIP`, unless
|
|
3713
|
+
* disabled via `disableAutoWrappingIp`.
|
|
3714
|
+
* - If the user have enough token, it will check for if approvals are needed
|
|
3715
|
+
* for each spender address and approve it, unless disabled via `disableAutoApprove`.
|
|
3716
|
+
* - If the fees are in `WIP` and `ERC20` tokens, it will not use disable `useMulticallWhenPossible` to pay for fees.
|
|
3717
|
+
*/
|
|
3718
|
+
var contractCallWithFees = /*#__PURE__*/function () {
|
|
3719
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref10) {
|
|
3720
|
+
var options, multicall3Address, wallet, tokenSpenders, contractCall, sender, txOptions, encodedTxs, rpcClient, zeroFees, _groupTokenSpenders, wipSpenders, erc20Spenders, baseContractCallArgs, _options$erc20Options2, _erc20Spenders$, autoApproveForErc20, erc20Client, _t4;
|
|
3721
|
+
return _regenerator().w(function (_context7) {
|
|
3722
|
+
while (1) switch (_context7.n) {
|
|
3723
|
+
case 0:
|
|
3724
|
+
options = _ref10.options, multicall3Address = _ref10.multicall3Address, wallet = _ref10.wallet, tokenSpenders = _ref10.tokenSpenders, contractCall = _ref10.contractCall, sender = _ref10.sender, txOptions = _ref10.txOptions, encodedTxs = _ref10.encodedTxs, rpcClient = _ref10.rpcClient;
|
|
3725
|
+
// Skip fee logic if no fees
|
|
3726
|
+
zeroFees = tokenSpenders.every(function (spender) {
|
|
3727
|
+
return spender.amount === 0n;
|
|
3728
|
+
});
|
|
3729
|
+
if (!zeroFees) {
|
|
3730
|
+
_context7.n = 2;
|
|
3731
|
+
break;
|
|
3732
|
+
}
|
|
3733
|
+
_t4 = handleTransactionResponse;
|
|
3734
|
+
_context7.n = 1;
|
|
3735
|
+
return contractCall();
|
|
3736
|
+
case 1:
|
|
3737
|
+
return _context7.a(2, _t4(_context7.v, rpcClient, txOptions));
|
|
3738
|
+
case 2:
|
|
3739
|
+
_groupTokenSpenders = groupTokenSpenders(tokenSpenders), wipSpenders = _groupTokenSpenders.wipSpenders, erc20Spenders = _groupTokenSpenders.erc20Spenders;
|
|
3740
|
+
baseContractCallArgs = {
|
|
3741
|
+
sender: sender,
|
|
3742
|
+
options: options,
|
|
3743
|
+
multicall3Address: multicall3Address,
|
|
3744
|
+
rpcClient: rpcClient,
|
|
3745
|
+
contractCall: contractCall,
|
|
3746
|
+
encodedTxs: encodedTxs,
|
|
3747
|
+
txOptions: txOptions,
|
|
3748
|
+
wallet: wallet
|
|
3749
|
+
};
|
|
3750
|
+
if (!(erc20Spenders.length > 0)) {
|
|
3751
|
+
_context7.n = 3;
|
|
3752
|
+
break;
|
|
3753
|
+
}
|
|
3754
|
+
_context7.n = 3;
|
|
3755
|
+
return checkErc20BalanceBelowFees(erc20Spenders, rpcClient, wallet, sender);
|
|
3756
|
+
case 3:
|
|
3757
|
+
if (!(wipSpenders.length > 0 && erc20Spenders.length > 0)) {
|
|
3758
|
+
_context7.n = 5;
|
|
3759
|
+
break;
|
|
3760
|
+
}
|
|
3761
|
+
autoApproveForErc20 = (options === null || options === void 0 || (_options$erc20Options2 = options.erc20Options) === null || _options$erc20Options2 === void 0 ? void 0 : _options$erc20Options2.enableAutoApprove) !== false;
|
|
3762
|
+
erc20Client = new ERC20Client(rpcClient, wallet, (_erc20Spenders$ = erc20Spenders[0]) === null || _erc20Spenders$ === void 0 ? void 0 : _erc20Spenders$.token);
|
|
3763
|
+
if (!autoApproveForErc20) {
|
|
3764
|
+
_context7.n = 4;
|
|
3765
|
+
break;
|
|
3766
|
+
}
|
|
3767
|
+
_context7.n = 4;
|
|
3768
|
+
return approvalAllSpenders({
|
|
3769
|
+
spenders: erc20Spenders,
|
|
3770
|
+
client: erc20Client,
|
|
3771
|
+
owner: sender,
|
|
3772
|
+
multicallAddress: multicall3Address,
|
|
3773
|
+
rpcClient: rpcClient,
|
|
3774
|
+
useMultiCall: false
|
|
3775
|
+
});
|
|
3776
|
+
case 4:
|
|
3777
|
+
return _context7.a(2, handleWipPayment(_objectSpread2(_objectSpread2({}, baseContractCallArgs), {}, {
|
|
3778
|
+
tokenSpenders: wipSpenders,
|
|
3779
|
+
options: {
|
|
3780
|
+
wipOptions: _objectSpread2(_objectSpread2({}, options === null || options === void 0 ? void 0 : options.wipOptions), {}, {
|
|
3781
|
+
// Need to pay erc20 fees with the wallet, cannot use multicall when handling erc20 payment.
|
|
3782
|
+
useMulticallWhenPossible: false
|
|
3783
|
+
})
|
|
3784
|
+
}
|
|
3785
|
+
})));
|
|
3786
|
+
case 5:
|
|
3787
|
+
if (!(erc20Spenders.length > 0)) {
|
|
3788
|
+
_context7.n = 6;
|
|
3789
|
+
break;
|
|
3790
|
+
}
|
|
3791
|
+
return _context7.a(2, handleErc20Payment(_objectSpread2(_objectSpread2({}, baseContractCallArgs), {}, {
|
|
3792
|
+
tokenSpenders: erc20Spenders
|
|
3793
|
+
})));
|
|
3794
|
+
case 6:
|
|
3795
|
+
return _context7.a(2, handleWipPayment(_objectSpread2(_objectSpread2({}, baseContractCallArgs), {}, {
|
|
3796
|
+
tokenSpenders: wipSpenders
|
|
3797
|
+
})));
|
|
3798
|
+
case 7:
|
|
3799
|
+
return _context7.a(2);
|
|
3800
|
+
}
|
|
3801
|
+
}, _callee7);
|
|
3802
|
+
}));
|
|
3803
|
+
return function contractCallWithFees(_x7) {
|
|
3804
|
+
return _ref11.apply(this, arguments);
|
|
3598
3805
|
};
|
|
3599
3806
|
}();
|
|
3600
3807
|
var handleTransactionResponse = /*#__PURE__*/function () {
|
|
3601
|
-
var
|
|
3602
|
-
return _regenerator().w(function (
|
|
3603
|
-
while (1) switch (
|
|
3808
|
+
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(txHash, rpcClient, txOptions) {
|
|
3809
|
+
return _regenerator().w(function (_context8) {
|
|
3810
|
+
while (1) switch (_context8.n) {
|
|
3604
3811
|
case 0:
|
|
3605
3812
|
if (!Array.isArray(txHash)) {
|
|
3606
|
-
|
|
3813
|
+
_context8.n = 1;
|
|
3607
3814
|
break;
|
|
3608
3815
|
}
|
|
3609
|
-
return
|
|
3816
|
+
return _context8.a(2, waitForTxReceipts({
|
|
3610
3817
|
rpcClient: rpcClient,
|
|
3611
3818
|
txOptions: txOptions,
|
|
3612
3819
|
txHashes: txHash
|
|
3613
3820
|
}));
|
|
3614
3821
|
case 1:
|
|
3615
|
-
return
|
|
3822
|
+
return _context8.a(2, waitForTxReceipt({
|
|
3616
3823
|
rpcClient: rpcClient,
|
|
3617
3824
|
txOptions: txOptions,
|
|
3618
3825
|
txHash: txHash
|
|
3619
3826
|
}));
|
|
3620
3827
|
}
|
|
3621
|
-
},
|
|
3828
|
+
}, _callee8);
|
|
3622
3829
|
}));
|
|
3623
|
-
return function handleTransactionResponse(
|
|
3624
|
-
return
|
|
3830
|
+
return function handleTransactionResponse(_x8, _x9, _x0) {
|
|
3831
|
+
return _ref12.apply(this, arguments);
|
|
3832
|
+
};
|
|
3833
|
+
}();
|
|
3834
|
+
|
|
3835
|
+
/**
|
|
3836
|
+
* Group token spenders into wip and erc20 spenders.
|
|
3837
|
+
*/
|
|
3838
|
+
var groupTokenSpenders = function groupTokenSpenders(tokenSpenders) {
|
|
3839
|
+
var wipSpenders = [];
|
|
3840
|
+
var erc20Spenders = [];
|
|
3841
|
+
var _iterator2 = _createForOfIteratorHelper(tokenSpenders),
|
|
3842
|
+
_step2;
|
|
3843
|
+
try {
|
|
3844
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3845
|
+
var spender = _step2.value;
|
|
3846
|
+
if (spender.token.toLowerCase() === WIP_TOKEN_ADDRESS.toLowerCase()) {
|
|
3847
|
+
mergeSpenderByAddress(wipSpenders, spender);
|
|
3848
|
+
} else {
|
|
3849
|
+
mergeSpenderByAddress(erc20Spenders, spender);
|
|
3850
|
+
}
|
|
3851
|
+
}
|
|
3852
|
+
} catch (err) {
|
|
3853
|
+
_iterator2.e(err);
|
|
3854
|
+
} finally {
|
|
3855
|
+
_iterator2.f();
|
|
3856
|
+
}
|
|
3857
|
+
return {
|
|
3858
|
+
wipSpenders: wipSpenders,
|
|
3859
|
+
erc20Spenders: erc20Spenders
|
|
3860
|
+
};
|
|
3861
|
+
};
|
|
3862
|
+
var checkErc20BalanceBelowFees = /*#__PURE__*/function () {
|
|
3863
|
+
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(erc20Spenders, rpcClient, wallet, sender) {
|
|
3864
|
+
var _erc20Spenders$2;
|
|
3865
|
+
var erc20Client, erc20Balance, erc20TotalFees;
|
|
3866
|
+
return _regenerator().w(function (_context9) {
|
|
3867
|
+
while (1) switch (_context9.n) {
|
|
3868
|
+
case 0:
|
|
3869
|
+
erc20Client = new ERC20Client(rpcClient, wallet, (_erc20Spenders$2 = erc20Spenders[0]) === null || _erc20Spenders$2 === void 0 ? void 0 : _erc20Spenders$2.token);
|
|
3870
|
+
_context9.n = 1;
|
|
3871
|
+
return erc20Client.balanceOf(sender);
|
|
3872
|
+
case 1:
|
|
3873
|
+
erc20Balance = _context9.v;
|
|
3874
|
+
erc20TotalFees = calculateTotalAmount(erc20Spenders); //If the wallet does not have enough erc20 token to pay for fees, throw an error.
|
|
3875
|
+
if (!(erc20Balance < erc20TotalFees)) {
|
|
3876
|
+
_context9.n = 2;
|
|
3877
|
+
break;
|
|
3878
|
+
}
|
|
3879
|
+
throw new Error("Wallet does not have enough erc20 token to pay for fees. Total fees: ".concat(getTokenAmountDisplay(erc20TotalFees), ", balance: ").concat(getTokenAmountDisplay(erc20Balance), "."));
|
|
3880
|
+
case 2:
|
|
3881
|
+
return _context9.a(2);
|
|
3882
|
+
}
|
|
3883
|
+
}, _callee9);
|
|
3884
|
+
}));
|
|
3885
|
+
return function checkErc20BalanceBelowFees(_x1, _x10, _x11, _x12) {
|
|
3886
|
+
return _ref13.apply(this, arguments);
|
|
3625
3887
|
};
|
|
3626
3888
|
}();
|
|
3627
3889
|
|
|
@@ -4013,7 +4275,6 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4013
4275
|
};
|
|
4014
4276
|
_context.n = 8;
|
|
4015
4277
|
return contractCallWithFees({
|
|
4016
|
-
totalFees: bonds,
|
|
4017
4278
|
options: {
|
|
4018
4279
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
4019
4280
|
// Disable multicall because multicall makes more complex due to disputeInitiator in this version.
|
|
@@ -4024,7 +4285,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4024
4285
|
rpcClient: this.rpcClient,
|
|
4025
4286
|
tokenSpenders: [{
|
|
4026
4287
|
address: this.arbitrationPolicyUmaClient.address,
|
|
4027
|
-
amount: bonds
|
|
4288
|
+
amount: bonds,
|
|
4289
|
+
// Currently, only WIP is supported as the whitelisted dispute bond token.
|
|
4290
|
+
token: WIP_TOKEN_ADDRESS
|
|
4028
4291
|
}],
|
|
4029
4292
|
contractCall: contractCall,
|
|
4030
4293
|
encodedTxs: [encodedTxData],
|
|
@@ -4363,7 +4626,6 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4363
4626
|
};
|
|
4364
4627
|
_context5.n = 5;
|
|
4365
4628
|
return contractCallWithFees({
|
|
4366
|
-
totalFees: bond,
|
|
4367
4629
|
options: {
|
|
4368
4630
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
4369
4631
|
// Disable auto approve because msg.sender is ipAccount instead of wallet.
|
|
@@ -4377,7 +4639,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4377
4639
|
contractCall: contractCall,
|
|
4378
4640
|
tokenSpenders: [{
|
|
4379
4641
|
address: this.arbitrationPolicyUmaClient.address,
|
|
4380
|
-
amount: bond
|
|
4642
|
+
amount: bond,
|
|
4643
|
+
// Currently, only WIP is supported as the whitelisted dispute bond token.
|
|
4644
|
+
token: WIP_TOKEN_ADDRESS
|
|
4381
4645
|
}],
|
|
4382
4646
|
encodedTxs: [encodedData],
|
|
4383
4647
|
wallet: this.wallet,
|
|
@@ -4573,13 +4837,13 @@ var royaltyPolicyInputToAddress = function royaltyPolicyInputToAddress(input, ch
|
|
|
4573
4837
|
}
|
|
4574
4838
|
return address;
|
|
4575
4839
|
};
|
|
4576
|
-
var getRevenueShare = function getRevenueShare(
|
|
4840
|
+
var getRevenueShare = function getRevenueShare(revShareNumber) {
|
|
4577
4841
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RevShareType.COMMERCIAL_REVENUE_SHARE;
|
|
4578
|
-
var revShareNumber = Number(revShare);
|
|
4579
4842
|
if (revShareNumber < 0 || revShareNumber > 100) {
|
|
4580
4843
|
throw new Error("".concat(type, " must be between 0 and 100."));
|
|
4581
4844
|
}
|
|
4582
|
-
|
|
4845
|
+
// use Math.trunc to avoid precision issues
|
|
4846
|
+
return Math.trunc(revShareNumber * Math.pow(10, 6));
|
|
4583
4847
|
};
|
|
4584
4848
|
|
|
4585
4849
|
/**
|
|
@@ -5992,13 +6256,13 @@ var predictMintingLicenseFee = /*#__PURE__*/function () {
|
|
|
5992
6256
|
}();
|
|
5993
6257
|
var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
5994
6258
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
|
|
5995
|
-
var derivData, rpcClient, chainId, wallet, sender, walletAddress,
|
|
6259
|
+
var derivData, rpcClient, chainId, wallet, sender, walletAddress, mintFees, i, mintFee;
|
|
5996
6260
|
return _regenerator().w(function (_context2) {
|
|
5997
6261
|
while (1) switch (_context2.n) {
|
|
5998
6262
|
case 0:
|
|
5999
6263
|
derivData = _ref3.derivData, rpcClient = _ref3.rpcClient, chainId = _ref3.chainId, wallet = _ref3.wallet, sender = _ref3.sender;
|
|
6000
6264
|
walletAddress = sender || wallet.account.address;
|
|
6001
|
-
|
|
6265
|
+
mintFees = [];
|
|
6002
6266
|
i = 0;
|
|
6003
6267
|
case 1:
|
|
6004
6268
|
if (!(i < derivData.parentIpIds.length)) {
|
|
@@ -6006,7 +6270,7 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6006
6270
|
break;
|
|
6007
6271
|
}
|
|
6008
6272
|
_context2.n = 2;
|
|
6009
|
-
return
|
|
6273
|
+
return calculateLicenseMintFee({
|
|
6010
6274
|
predictMintingFeeRequest: {
|
|
6011
6275
|
licensorIpId: derivData.parentIpIds[i],
|
|
6012
6276
|
licenseTemplate: derivData.licenseTemplate,
|
|
@@ -6020,14 +6284,16 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6020
6284
|
walletAddress: walletAddress
|
|
6021
6285
|
});
|
|
6022
6286
|
case 2:
|
|
6023
|
-
|
|
6024
|
-
|
|
6287
|
+
mintFee = _context2.v;
|
|
6288
|
+
if (mintFee.amount > 0n) {
|
|
6289
|
+
mintFees.push(mintFee);
|
|
6290
|
+
}
|
|
6025
6291
|
case 3:
|
|
6026
6292
|
i++;
|
|
6027
6293
|
_context2.n = 1;
|
|
6028
6294
|
break;
|
|
6029
6295
|
case 4:
|
|
6030
|
-
return _context2.a(2,
|
|
6296
|
+
return _context2.a(2, mintFees);
|
|
6031
6297
|
}
|
|
6032
6298
|
}, _callee2);
|
|
6033
6299
|
}));
|
|
@@ -6035,9 +6301,9 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6035
6301
|
return _ref4.apply(this, arguments);
|
|
6036
6302
|
};
|
|
6037
6303
|
}();
|
|
6038
|
-
var
|
|
6304
|
+
var calculateLicenseMintFee = /*#__PURE__*/function () {
|
|
6039
6305
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
|
|
6040
|
-
var predictMintingFeeRequest, rpcClient, chainId, walletAddress,
|
|
6306
|
+
var predictMintingFeeRequest, rpcClient, chainId, walletAddress, _yield$predictMinting, currencyToken, tokenAmount;
|
|
6041
6307
|
return _regenerator().w(function (_context3) {
|
|
6042
6308
|
while (1) switch (_context3.n) {
|
|
6043
6309
|
case 0:
|
|
@@ -6050,24 +6316,23 @@ var calculateLicenseWipMintFee = /*#__PURE__*/function () {
|
|
|
6050
6316
|
walletAddress: walletAddress
|
|
6051
6317
|
});
|
|
6052
6318
|
case 1:
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
return _context3.a(2, fee.tokenAmount);
|
|
6319
|
+
_yield$predictMinting = _context3.v;
|
|
6320
|
+
currencyToken = _yield$predictMinting.currencyToken;
|
|
6321
|
+
tokenAmount = _yield$predictMinting.tokenAmount;
|
|
6322
|
+
return _context3.a(2, {
|
|
6323
|
+
token: currencyToken,
|
|
6324
|
+
amount: tokenAmount
|
|
6325
|
+
});
|
|
6061
6326
|
}
|
|
6062
6327
|
}, _callee3);
|
|
6063
6328
|
}));
|
|
6064
|
-
return function
|
|
6329
|
+
return function calculateLicenseMintFee(_x3) {
|
|
6065
6330
|
return _ref6.apply(this, arguments);
|
|
6066
6331
|
};
|
|
6067
6332
|
}();
|
|
6068
|
-
var
|
|
6333
|
+
var calculateSPGMintFee = /*#__PURE__*/function () {
|
|
6069
6334
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(spgNftClient) {
|
|
6070
|
-
var token;
|
|
6335
|
+
var token, amount;
|
|
6071
6336
|
return _regenerator().w(function (_context4) {
|
|
6072
6337
|
while (1) switch (_context4.n) {
|
|
6073
6338
|
case 0:
|
|
@@ -6075,20 +6340,24 @@ var calculateSPGWipMintFee = /*#__PURE__*/function () {
|
|
|
6075
6340
|
return spgNftClient.mintFeeToken();
|
|
6076
6341
|
case 1:
|
|
6077
6342
|
token = _context4.v;
|
|
6078
|
-
|
|
6079
|
-
|
|
6343
|
+
_context4.n = 2;
|
|
6344
|
+
return spgNftClient.mintFee();
|
|
6345
|
+
case 2:
|
|
6346
|
+
amount = _context4.v;
|
|
6347
|
+
if (!(amount > 0n)) {
|
|
6348
|
+
_context4.n = 3;
|
|
6080
6349
|
break;
|
|
6081
6350
|
}
|
|
6082
|
-
return _context4.a(2,
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6351
|
+
return _context4.a(2, {
|
|
6352
|
+
token: token,
|
|
6353
|
+
amount: amount
|
|
6354
|
+
});
|
|
6086
6355
|
case 3:
|
|
6087
|
-
return _context4.a(2
|
|
6356
|
+
return _context4.a(2);
|
|
6088
6357
|
}
|
|
6089
6358
|
}, _callee4);
|
|
6090
6359
|
}));
|
|
6091
|
-
return function
|
|
6360
|
+
return function calculateSPGMintFee(_x4) {
|
|
6092
6361
|
return _ref7.apply(this, arguments);
|
|
6093
6362
|
};
|
|
6094
6363
|
}();
|
|
@@ -6661,15 +6930,17 @@ var getRoyaltyShares = function getRoyaltyShares(royaltyShares) {
|
|
|
6661
6930
|
if (sum > 100) {
|
|
6662
6931
|
throw new Error("The sum of the royalty shares cannot exceeds 100.");
|
|
6663
6932
|
}
|
|
6664
|
-
|
|
6933
|
+
// use Math.trunc to avoid precision issues
|
|
6934
|
+
var value = Math.trunc(share.percentage * Math.pow(10, 6));
|
|
6665
6935
|
actualTotal += value;
|
|
6666
6936
|
return _objectSpread2(_objectSpread2({}, share), {}, {
|
|
6667
6937
|
percentage: value
|
|
6668
6938
|
});
|
|
6669
6939
|
});
|
|
6940
|
+
// use Math.trunc to avoid precision issues
|
|
6670
6941
|
return {
|
|
6671
6942
|
royaltyShares: shares,
|
|
6672
|
-
totalAmount: actualTotal
|
|
6943
|
+
totalAmount: Math.trunc(actualTotal)
|
|
6673
6944
|
};
|
|
6674
6945
|
};
|
|
6675
6946
|
var validateDerivativeData = /*#__PURE__*/function () {
|
|
@@ -6837,7 +7108,7 @@ var mergeSpenders = function mergeSpenders(previousSpenders, newSpenders) {
|
|
|
6837
7108
|
return acc;
|
|
6838
7109
|
}
|
|
6839
7110
|
var existingSpender = acc.find(function (s) {
|
|
6840
|
-
return s.address === spender.address;
|
|
7111
|
+
return s.address === spender.address && s.token === spender.token;
|
|
6841
7112
|
});
|
|
6842
7113
|
if (!existingSpender) {
|
|
6843
7114
|
acc.push(_objectSpread2(_objectSpread2({}, spender), {}, {
|
|
@@ -6903,7 +7174,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6903
7174
|
var _currentRequest$extra;
|
|
6904
7175
|
var res = _step.value;
|
|
6905
7176
|
var spenders = res.spenders,
|
|
6906
|
-
totalFees = res.totalFees,
|
|
6907
7177
|
encodedTxData = res.encodedTxData,
|
|
6908
7178
|
workflowClient = res.workflowClient,
|
|
6909
7179
|
isUseMulticall3 = res.isUseMulticall3,
|
|
@@ -6916,7 +7186,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6916
7186
|
if (!aggregateRegistrationRequest[targetAddress]) {
|
|
6917
7187
|
aggregateRegistrationRequest[targetAddress] = {
|
|
6918
7188
|
spenders: [],
|
|
6919
|
-
totalFees: 0n,
|
|
6920
7189
|
encodedTxData: [],
|
|
6921
7190
|
contractCall: [],
|
|
6922
7191
|
extraData: []
|
|
@@ -6924,7 +7193,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6924
7193
|
}
|
|
6925
7194
|
var currentRequest = aggregateRegistrationRequest[targetAddress];
|
|
6926
7195
|
currentRequest.spenders = mergeSpenders(currentRequest.spenders, spenders || []);
|
|
6927
|
-
currentRequest.totalFees += totalFees || 0n;
|
|
6928
7196
|
currentRequest.encodedTxData = currentRequest.encodedTxData.concat(encodedTxData);
|
|
6929
7197
|
currentRequest.extraData = (_currentRequest$extra = currentRequest.extraData) === null || _currentRequest$extra === void 0 ? void 0 : _currentRequest$extra.concat(extraData || undefined);
|
|
6930
7198
|
if (isUseMulticall3 || disableMulticallWhenPossible) {
|
|
@@ -6951,19 +7219,20 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6951
7219
|
};
|
|
6952
7220
|
var handleMulticall = /*#__PURE__*/function () {
|
|
6953
7221
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
6954
|
-
var
|
|
7222
|
+
var _options$wipOptions;
|
|
7223
|
+
var transferWorkflowRequests, multicall3Address, options, rpcClient, wallet, walletAddress, aggregateRegistrationRequest, txResponses, _loop2, key, _t2, _t3;
|
|
6955
7224
|
return _regenerator().w(function (_context3) {
|
|
6956
7225
|
while (1) switch (_context3.n) {
|
|
6957
7226
|
case 0:
|
|
6958
|
-
transferWorkflowRequests = _ref.transferWorkflowRequests, multicall3Address = _ref.multicall3Address,
|
|
6959
|
-
aggregateRegistrationRequest = aggregateTransformIpRegistrationWorkflow(transferWorkflowRequests, multicall3Address, (wipOptions === null || wipOptions === void 0 ? void 0 : wipOptions.useMulticallWhenPossible) === false);
|
|
7227
|
+
transferWorkflowRequests = _ref.transferWorkflowRequests, multicall3Address = _ref.multicall3Address, options = _ref.options, rpcClient = _ref.rpcClient, wallet = _ref.wallet, walletAddress = _ref.walletAddress;
|
|
7228
|
+
aggregateRegistrationRequest = aggregateTransformIpRegistrationWorkflow(transferWorkflowRequests, multicall3Address, (options === null || options === void 0 || (_options$wipOptions = options.wipOptions) === null || _options$wipOptions === void 0 ? void 0 : _options$wipOptions.useMulticallWhenPossible) === false);
|
|
6960
7229
|
txResponses = [];
|
|
6961
7230
|
_loop2 = /*#__PURE__*/_regenerator().m(function _loop2() {
|
|
6962
|
-
var _aggregateRegistratio, spenders,
|
|
7231
|
+
var _aggregateRegistratio, spenders, encodedTxData, contractCall, contractCalls, useMulticallWhenPossible, txResponse;
|
|
6963
7232
|
return _regenerator().w(function (_context2) {
|
|
6964
7233
|
while (1) switch (_context2.n) {
|
|
6965
7234
|
case 0:
|
|
6966
|
-
_aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders,
|
|
7235
|
+
_aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders, encodedTxData = _aggregateRegistratio.encodedTxData, contractCall = _aggregateRegistratio.contractCall;
|
|
6967
7236
|
contractCalls = /*#__PURE__*/function () {
|
|
6968
7237
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
6969
7238
|
var txHashes, _iterator2, _step2, call, txHash, _t;
|
|
@@ -7011,12 +7280,11 @@ var handleMulticall = /*#__PURE__*/function () {
|
|
|
7011
7280
|
useMulticallWhenPossible = key === multicall3Address ? true : false;
|
|
7012
7281
|
_context2.n = 1;
|
|
7013
7282
|
return contractCallWithFees({
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
|
|
7283
|
+
options: _objectSpread2(_objectSpread2({}, options), {}, {
|
|
7284
|
+
wipOptions: _objectSpread2(_objectSpread2({}, options === null || options === void 0 ? void 0 : options.wipOptions), {}, {
|
|
7017
7285
|
useMulticallWhenPossible: useMulticallWhenPossible
|
|
7018
7286
|
})
|
|
7019
|
-
},
|
|
7287
|
+
}),
|
|
7020
7288
|
multicall3Address: multicall3Address,
|
|
7021
7289
|
rpcClient: rpcClient,
|
|
7022
7290
|
tokenSpenders: spenders,
|
|
@@ -7135,7 +7403,7 @@ var transformRegistrationRequest = /*#__PURE__*/function () {
|
|
|
7135
7403
|
*/
|
|
7136
7404
|
var handleRegisterRequest = /*#__PURE__*/function () {
|
|
7137
7405
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
|
|
7138
|
-
var request, rpcClient, wallet, chainId, ipIdAddress, baseRequest, calculatedDeadline, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, _yield$validateLicens, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData,
|
|
7406
|
+
var request, rpcClient, wallet, chainId, ipIdAddress, baseRequest, calculatedDeadline, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, _yield$validateLicens, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, derivativeMintingFee;
|
|
7139
7407
|
return _regenerator().w(function (_context2) {
|
|
7140
7408
|
while (1) switch (_context2.n) {
|
|
7141
7409
|
case 0:
|
|
@@ -7227,7 +7495,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7227
7495
|
wallet: wallet
|
|
7228
7496
|
});
|
|
7229
7497
|
case 9:
|
|
7230
|
-
|
|
7498
|
+
derivativeMintingFee = _context2.v;
|
|
7231
7499
|
if (!("royaltyShares" in request)) {
|
|
7232
7500
|
_context2.n = 11;
|
|
7233
7501
|
break;
|
|
@@ -7242,7 +7510,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7242
7510
|
wallet: wallet,
|
|
7243
7511
|
chainId: chainId,
|
|
7244
7512
|
royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient,
|
|
7245
|
-
|
|
7513
|
+
derivativeMintingFee: derivativeMintingFee,
|
|
7246
7514
|
royaltyShares: request.royaltyShares
|
|
7247
7515
|
});
|
|
7248
7516
|
case 10:
|
|
@@ -7258,7 +7526,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7258
7526
|
wallet: wallet,
|
|
7259
7527
|
chainId: chainId,
|
|
7260
7528
|
derivativeWorkflowsClient: derivativeWorkflowsClient,
|
|
7261
|
-
|
|
7529
|
+
derivativeMintingFee: derivativeMintingFee
|
|
7262
7530
|
});
|
|
7263
7531
|
case 12:
|
|
7264
7532
|
return _context2.a(2, _context2.v);
|
|
@@ -7279,11 +7547,11 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7279
7547
|
*/
|
|
7280
7548
|
var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
|
|
7281
7549
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
|
|
7282
|
-
var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient,
|
|
7550
|
+
var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient, derivativeMintingFee, signature, transformRequest, spenders;
|
|
7283
7551
|
return _regenerator().w(function (_context3) {
|
|
7284
7552
|
while (1) switch (_context3.n) {
|
|
7285
7553
|
case 0:
|
|
7286
|
-
request = _ref5.request, calculatedDeadline = _ref5.calculatedDeadline, ipIdAddress = _ref5.ipIdAddress, wallet = _ref5.wallet, chainId = _ref5.chainId, derivativeWorkflowsClient = _ref5.derivativeWorkflowsClient,
|
|
7554
|
+
request = _ref5.request, calculatedDeadline = _ref5.calculatedDeadline, ipIdAddress = _ref5.ipIdAddress, wallet = _ref5.wallet, chainId = _ref5.chainId, derivativeWorkflowsClient = _ref5.derivativeWorkflowsClient, derivativeMintingFee = _ref5.derivativeMintingFee;
|
|
7287
7555
|
_context3.n = 1;
|
|
7288
7556
|
return generateOperationSignature({
|
|
7289
7557
|
ipIdAddress: ipIdAddress,
|
|
@@ -7301,15 +7569,16 @@ var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
|
|
|
7301
7569
|
signature: signature
|
|
7302
7570
|
}
|
|
7303
7571
|
});
|
|
7572
|
+
spenders = derivativeMintingFee.map(function (fee) {
|
|
7573
|
+
return _objectSpread2({
|
|
7574
|
+
address: derivativeWorkflowsClient.address
|
|
7575
|
+
}, fee);
|
|
7576
|
+
});
|
|
7304
7577
|
return _context3.a(2, {
|
|
7305
7578
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7306
7579
|
transformRequest: transformRequest,
|
|
7307
7580
|
isUseMulticall3: false,
|
|
7308
|
-
spenders:
|
|
7309
|
-
address: derivativeWorkflowsClient.address,
|
|
7310
|
-
amount: totalFees
|
|
7311
|
-
}],
|
|
7312
|
-
totalFees: totalFees,
|
|
7581
|
+
spenders: spenders,
|
|
7313
7582
|
contractCall: function contractCall() {
|
|
7314
7583
|
return derivativeWorkflowsClient.registerIpAndMakeDerivative(transformRequest);
|
|
7315
7584
|
},
|
|
@@ -7450,11 +7719,11 @@ var transferRegisterIpAndAttachPilTermsRequest = /*#__PURE__*/function () {
|
|
|
7450
7719
|
*/
|
|
7451
7720
|
var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE__*/function () {
|
|
7452
7721
|
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref1) {
|
|
7453
|
-
var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient,
|
|
7722
|
+
var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient, derivativeMintingFee, royaltyShares, signature, transformRequest, spenders;
|
|
7454
7723
|
return _regenerator().w(function (_context6) {
|
|
7455
7724
|
while (1) switch (_context6.n) {
|
|
7456
7725
|
case 0:
|
|
7457
|
-
request = _ref1.request, calculatedDeadline = _ref1.calculatedDeadline, ipIdAddress = _ref1.ipIdAddress, wallet = _ref1.wallet, chainId = _ref1.chainId, royaltyTokenDistributionWorkflowsClient = _ref1.royaltyTokenDistributionWorkflowsClient,
|
|
7726
|
+
request = _ref1.request, calculatedDeadline = _ref1.calculatedDeadline, ipIdAddress = _ref1.ipIdAddress, wallet = _ref1.wallet, chainId = _ref1.chainId, royaltyTokenDistributionWorkflowsClient = _ref1.royaltyTokenDistributionWorkflowsClient, derivativeMintingFee = _ref1.derivativeMintingFee, royaltyShares = _ref1.royaltyShares;
|
|
7458
7727
|
_context6.n = 1;
|
|
7459
7728
|
return generateOperationSignature({
|
|
7460
7729
|
ipIdAddress: ipIdAddress,
|
|
@@ -7472,15 +7741,16 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
|
|
|
7472
7741
|
signature: signature
|
|
7473
7742
|
}
|
|
7474
7743
|
});
|
|
7744
|
+
spenders = derivativeMintingFee.map(function (fee) {
|
|
7745
|
+
return _objectSpread2({
|
|
7746
|
+
address: royaltyTokenDistributionWorkflowsClient.address
|
|
7747
|
+
}, fee);
|
|
7748
|
+
});
|
|
7475
7749
|
return _context6.a(2, {
|
|
7476
7750
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7477
7751
|
transformRequest: transformRequest,
|
|
7478
7752
|
isUseMulticall3: false,
|
|
7479
|
-
spenders:
|
|
7480
|
-
address: royaltyTokenDistributionWorkflowsClient.address,
|
|
7481
|
-
amount: totalFees
|
|
7482
|
-
}],
|
|
7483
|
-
totalFees: totalFees,
|
|
7753
|
+
spenders: spenders,
|
|
7484
7754
|
contractCall: function contractCall() {
|
|
7485
7755
|
return royaltyTokenDistributionWorkflowsClient.registerIpAndMakeDerivativeAndDeployRoyaltyVault(transformRequest);
|
|
7486
7756
|
},
|
|
@@ -7528,7 +7798,7 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
|
|
|
7528
7798
|
var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
7529
7799
|
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref11) {
|
|
7530
7800
|
var _request$allowDuplica;
|
|
7531
|
-
var request, rpcClient, wallet, chainId, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, isPublicMinting, nftMintFee, baseRequest, _yield$validateLicens2, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData,
|
|
7801
|
+
var request, rpcClient, wallet, chainId, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, isPublicMinting, nftMintFee, baseRequest, _yield$validateLicens2, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, derivativeMintingFee, requestWithDeriv;
|
|
7532
7802
|
return _regenerator().w(function (_context7) {
|
|
7533
7803
|
while (1) switch (_context7.n) {
|
|
7534
7804
|
case 0:
|
|
@@ -7541,7 +7811,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7541
7811
|
case 1:
|
|
7542
7812
|
isPublicMinting = _context7.v;
|
|
7543
7813
|
_context7.n = 2;
|
|
7544
|
-
return
|
|
7814
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(rpcClient, request.spgNftContract));
|
|
7545
7815
|
case 2:
|
|
7546
7816
|
nftMintFee = _context7.v;
|
|
7547
7817
|
baseRequest = {
|
|
@@ -7607,7 +7877,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7607
7877
|
wallet: wallet
|
|
7608
7878
|
});
|
|
7609
7879
|
case 7:
|
|
7610
|
-
|
|
7880
|
+
derivativeMintingFee = _context7.v;
|
|
7611
7881
|
requestWithDeriv = _objectSpread2(_objectSpread2({}, baseRequest), {}, {
|
|
7612
7882
|
derivData: derivData
|
|
7613
7883
|
});
|
|
@@ -7621,7 +7891,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7621
7891
|
}),
|
|
7622
7892
|
nftMintFee: nftMintFee,
|
|
7623
7893
|
isPublicMinting: isPublicMinting,
|
|
7624
|
-
|
|
7894
|
+
derivativeMintingFee: derivativeMintingFee,
|
|
7625
7895
|
royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient
|
|
7626
7896
|
}));
|
|
7627
7897
|
case 8:
|
|
@@ -7632,7 +7902,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7632
7902
|
derivativeWorkflowsClient: derivativeWorkflowsClient,
|
|
7633
7903
|
nftMintFee: nftMintFee,
|
|
7634
7904
|
isPublicMinting: isPublicMinting,
|
|
7635
|
-
|
|
7905
|
+
derivativeMintingFee: derivativeMintingFee
|
|
7636
7906
|
}));
|
|
7637
7907
|
case 9:
|
|
7638
7908
|
throw new Error("Invalid mint and register request type");
|
|
@@ -7667,11 +7937,9 @@ var transformMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
|
|
|
7667
7937
|
contractCall: function contractCall() {
|
|
7668
7938
|
return royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(transformRequest);
|
|
7669
7939
|
},
|
|
7670
|
-
spenders: [{
|
|
7671
|
-
address: transformRequest.spgNftContract
|
|
7672
|
-
|
|
7673
|
-
}],
|
|
7674
|
-
totalFees: nftMintFee,
|
|
7940
|
+
spenders: _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
7941
|
+
address: transformRequest.spgNftContract
|
|
7942
|
+
}, nftMintFee)] : []),
|
|
7675
7943
|
encodedTxData: {
|
|
7676
7944
|
to: royaltyTokenDistributionWorkflowsClient.address,
|
|
7677
7945
|
data: encodeFunctionData({
|
|
@@ -7697,15 +7965,14 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
|
|
|
7697
7965
|
nftMintFee = _ref14.nftMintFee,
|
|
7698
7966
|
isPublicMinting = _ref14.isPublicMinting,
|
|
7699
7967
|
maxLicenseTokens = _ref14.maxLicenseTokens;
|
|
7968
|
+
var spenders = nftMintFee ? [_objectSpread2({
|
|
7969
|
+
address: request.spgNftContract
|
|
7970
|
+
}, nftMintFee)] : [];
|
|
7700
7971
|
return {
|
|
7701
7972
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7702
7973
|
transformRequest: request,
|
|
7703
|
-
isUseMulticall3: isPublicMinting,
|
|
7704
|
-
spenders:
|
|
7705
|
-
address: request.spgNftContract,
|
|
7706
|
-
amount: nftMintFee
|
|
7707
|
-
}],
|
|
7708
|
-
totalFees: nftMintFee,
|
|
7974
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
7975
|
+
spenders: spenders,
|
|
7709
7976
|
encodedTxData: {
|
|
7710
7977
|
to: licenseAttachmentWorkflowsClient.address,
|
|
7711
7978
|
data: encodeFunctionData({
|
|
@@ -7729,39 +7996,39 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
|
|
|
7729
7996
|
* Transforms a request for the `mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens` contract method.
|
|
7730
7997
|
*/
|
|
7731
7998
|
var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest = function transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest(_ref15) {
|
|
7999
|
+
var _derivativeMintingFee;
|
|
7732
8000
|
var request = _ref15.request,
|
|
7733
8001
|
nftMintFee = _ref15.nftMintFee,
|
|
7734
8002
|
isPublicMinting = _ref15.isPublicMinting,
|
|
7735
|
-
|
|
8003
|
+
derivativeMintingFee = _ref15.derivativeMintingFee,
|
|
7736
8004
|
royaltyTokenDistributionWorkflowsClient = _ref15.royaltyTokenDistributionWorkflowsClient;
|
|
7737
8005
|
var _getRoyaltyShares2 = getRoyaltyShares(request.royaltyShares),
|
|
7738
8006
|
royaltyShares = _getRoyaltyShares2.royaltyShares;
|
|
7739
8007
|
/**
|
|
7740
|
-
* TODO: Consider the scenario where the SPG token is WIP and the derivative token is ERC20.
|
|
7741
8008
|
* The SDK should handle both cases in the `contractCallWithFees` method.
|
|
7742
8009
|
* Currently, it only supports WIP tokens and does not handle ERC20 tokens, such as approving ERC20 tokens.
|
|
7743
8010
|
*/
|
|
7744
8011
|
var transformRequest = _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7745
8012
|
royaltyShares: royaltyShares
|
|
7746
8013
|
});
|
|
8014
|
+
var spenders = (_derivativeMintingFee = derivativeMintingFee.map(function (fee) {
|
|
8015
|
+
return _objectSpread2({
|
|
8016
|
+
address: royaltyTokenDistributionWorkflowsClient.address
|
|
8017
|
+
}, fee);
|
|
8018
|
+
})).concat.apply(_derivativeMintingFee, _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
8019
|
+
address: request.spgNftContract
|
|
8020
|
+
}, nftMintFee)] : []));
|
|
7747
8021
|
return {
|
|
7748
8022
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7749
8023
|
transformRequest: transformRequest,
|
|
7750
|
-
isUseMulticall3: isPublicMinting,
|
|
7751
|
-
spenders:
|
|
7752
|
-
address: royaltyTokenDistributionWorkflowsClient.address,
|
|
7753
|
-
amount: totalDerivativeMintingFee
|
|
7754
|
-
}, {
|
|
7755
|
-
address: request.spgNftContract,
|
|
7756
|
-
amount: nftMintFee
|
|
7757
|
-
}],
|
|
7758
|
-
totalFees: totalDerivativeMintingFee + nftMintFee,
|
|
8024
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
8025
|
+
spenders: spenders,
|
|
7759
8026
|
encodedTxData: {
|
|
7760
8027
|
to: royaltyTokenDistributionWorkflowsClient.address,
|
|
7761
8028
|
data: encodeFunctionData({
|
|
7762
8029
|
abi: royaltyTokenDistributionWorkflowsAbi,
|
|
7763
8030
|
functionName: "mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",
|
|
7764
|
-
args: [
|
|
8031
|
+
args: [transformRequest.spgNftContract, transformRequest.recipient, transformRequest.ipMetadata, transformRequest.derivData, transformRequest.royaltyShares, transformRequest.allowDuplicates]
|
|
7765
8032
|
})
|
|
7766
8033
|
},
|
|
7767
8034
|
workflowClient: royaltyTokenDistributionWorkflowsClient,
|
|
@@ -7775,23 +8042,24 @@ var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
|
|
|
7775
8042
|
*/
|
|
7776
8043
|
|
|
7777
8044
|
var transferMintAndRegisterIpAndMakeDerivativeRequest = function transferMintAndRegisterIpAndMakeDerivativeRequest(_ref16) {
|
|
8045
|
+
var _derivativeMintingFee2;
|
|
7778
8046
|
var request = _ref16.request,
|
|
7779
8047
|
derivativeWorkflowsClient = _ref16.derivativeWorkflowsClient,
|
|
7780
8048
|
nftMintFee = _ref16.nftMintFee,
|
|
7781
8049
|
isPublicMinting = _ref16.isPublicMinting,
|
|
7782
|
-
|
|
8050
|
+
derivativeMintingFee = _ref16.derivativeMintingFee;
|
|
8051
|
+
var spenders = (_derivativeMintingFee2 = derivativeMintingFee.map(function (fee) {
|
|
8052
|
+
return _objectSpread2({
|
|
8053
|
+
address: derivativeWorkflowsClient.address
|
|
8054
|
+
}, fee);
|
|
8055
|
+
})).concat.apply(_derivativeMintingFee2, _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
8056
|
+
address: request.spgNftContract
|
|
8057
|
+
}, nftMintFee)] : []));
|
|
7783
8058
|
return {
|
|
7784
8059
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7785
8060
|
transformRequest: request,
|
|
7786
|
-
isUseMulticall3: isPublicMinting,
|
|
7787
|
-
spenders:
|
|
7788
|
-
address: derivativeWorkflowsClient.address,
|
|
7789
|
-
amount: totalDerivativeMintingFee
|
|
7790
|
-
}, {
|
|
7791
|
-
address: request.spgNftContract,
|
|
7792
|
-
amount: nftMintFee
|
|
7793
|
-
}],
|
|
7794
|
-
totalFees: totalDerivativeMintingFee + nftMintFee,
|
|
8061
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
8062
|
+
spenders: spenders,
|
|
7795
8063
|
encodedTxData: {
|
|
7796
8064
|
to: derivativeWorkflowsClient.address,
|
|
7797
8065
|
data: encodeFunctionData({
|
|
@@ -7895,7 +8163,7 @@ var transferDistributeRoyaltyTokensRequest = /*#__PURE__*/function () {
|
|
|
7895
8163
|
}();
|
|
7896
8164
|
var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
7897
8165
|
var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref19) {
|
|
7898
|
-
var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId,
|
|
8166
|
+
var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId, requests, ipRoyaltyVaults, _iterator, _step, _loop, _t;
|
|
7899
8167
|
return _regenerator().w(function (_context0) {
|
|
7900
8168
|
while (1) switch (_context0.p = _context0.n) {
|
|
7901
8169
|
case 0:
|
|
@@ -7904,13 +8172,17 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7904
8172
|
_context0.n = 1;
|
|
7905
8173
|
break;
|
|
7906
8174
|
}
|
|
7907
|
-
return _context0.a(2,
|
|
8175
|
+
return _context0.a(2, {
|
|
8176
|
+
requests: [],
|
|
8177
|
+
ipRoyaltyVaults: []
|
|
8178
|
+
});
|
|
7908
8179
|
case 1:
|
|
7909
|
-
|
|
8180
|
+
requests = [];
|
|
8181
|
+
ipRoyaltyVaults = [];
|
|
7910
8182
|
_iterator = _createForOfIteratorHelper(royaltyDistributionRequests);
|
|
7911
8183
|
_context0.p = 2;
|
|
7912
8184
|
_loop = /*#__PURE__*/_regenerator().m(function _loop() {
|
|
7913
|
-
var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, response;
|
|
8185
|
+
var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, ipRoyaltyVaultItem, response;
|
|
7914
8186
|
return _regenerator().w(function (_context9) {
|
|
7915
8187
|
while (1) switch (_context9.n) {
|
|
7916
8188
|
case 0:
|
|
@@ -7929,13 +8201,15 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7929
8201
|
return getCalculatedDeadline(rpcClient, req.deadline);
|
|
7930
8202
|
case 1:
|
|
7931
8203
|
calculatedDeadline = _context9.v;
|
|
8204
|
+
// The ipRoyaltyVaultItem must be found, otherwise, the request is invalid.
|
|
8205
|
+
ipRoyaltyVaultItem = ipRoyaltyVault.find(function (item) {
|
|
8206
|
+
return item.ipId === filterIpIdAndTokenId.ipId;
|
|
8207
|
+
});
|
|
7932
8208
|
_context9.n = 2;
|
|
7933
8209
|
return transferDistributeRoyaltyTokensRequest({
|
|
7934
8210
|
request: {
|
|
7935
8211
|
ipId: filterIpIdAndTokenId.ipId,
|
|
7936
|
-
ipRoyaltyVault: ipRoyaltyVault
|
|
7937
|
-
return item.ipId === filterIpIdAndTokenId.ipId;
|
|
7938
|
-
}).ipRoyaltyVault,
|
|
8212
|
+
ipRoyaltyVault: ipRoyaltyVaultItem.ipRoyaltyVault,
|
|
7939
8213
|
royaltyShares: royaltyShares,
|
|
7940
8214
|
totalAmount: totalAmount,
|
|
7941
8215
|
deadline: calculatedDeadline
|
|
@@ -7946,7 +8220,8 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7946
8220
|
});
|
|
7947
8221
|
case 2:
|
|
7948
8222
|
response = _context9.v;
|
|
7949
|
-
|
|
8223
|
+
requests.push(response);
|
|
8224
|
+
ipRoyaltyVaults.push(ipRoyaltyVaultItem);
|
|
7950
8225
|
case 3:
|
|
7951
8226
|
return _context9.a(2);
|
|
7952
8227
|
}
|
|
@@ -7974,7 +8249,10 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7974
8249
|
_iterator.f();
|
|
7975
8250
|
return _context0.f(7);
|
|
7976
8251
|
case 8:
|
|
7977
|
-
return _context0.a(2,
|
|
8252
|
+
return _context0.a(2, {
|
|
8253
|
+
requests: requests,
|
|
8254
|
+
ipRoyaltyVaults: ipRoyaltyVaults
|
|
8255
|
+
});
|
|
7978
8256
|
}
|
|
7979
8257
|
}, _callee9, null, [[2, 6, 7, 8]]);
|
|
7980
8258
|
}));
|
|
@@ -7983,6 +8261,22 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7983
8261
|
};
|
|
7984
8262
|
}();
|
|
7985
8263
|
|
|
8264
|
+
/**
|
|
8265
|
+
* Checks if the spenders contain ERC20 tokens with amount above zero.
|
|
8266
|
+
* Due to the `msg.sender` context limitations, if the spenders contain ERC20 tokens with amount above zero, the multicall3 cannot be used.
|
|
8267
|
+
*/
|
|
8268
|
+
|
|
8269
|
+
var isErc20AboveZero = function isErc20AboveZero(spenders) {
|
|
8270
|
+
var erc20Spenders = spenders.filter(function (spender) {
|
|
8271
|
+
return spender.token !== WIP_TOKEN_ADDRESS;
|
|
8272
|
+
});
|
|
8273
|
+
var erc20TotalAmount = erc20Spenders.reduce(function (acc, spender) {
|
|
8274
|
+
var _spender$amount;
|
|
8275
|
+
return acc + ((_spender$amount = spender.amount) !== null && _spender$amount !== void 0 ? _spender$amount : 0n);
|
|
8276
|
+
}, 0n);
|
|
8277
|
+
return erc20TotalAmount > 0n;
|
|
8278
|
+
};
|
|
8279
|
+
|
|
7986
8280
|
var setMaxLicenseTokens = /*#__PURE__*/function () {
|
|
7987
8281
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
7988
8282
|
var maxLicenseTokensData, licensorIpId, licenseTermsIds, totalLicenseTokenLimitHookClient, templateAddress, licenseTermsMaxLimitTxHashes, i, maxLicenseTokens, txHash;
|
|
@@ -8049,6 +8343,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8049
8343
|
this.multicall3Client = new Multicall3Client(rpcClient, wallet);
|
|
8050
8344
|
this.spgNftClient = new SpgnftImplReadOnlyClient(rpcClient);
|
|
8051
8345
|
this.totalLicenseTokenLimitHookClient = new TotalLicenseTokenLimitHookClient(rpcClient, wallet);
|
|
8346
|
+
this.licenseTokenClient = new LicenseTokenClient(rpcClient, wallet);
|
|
8052
8347
|
this.rpcClient = rpcClient;
|
|
8053
8348
|
this.wallet = wallet;
|
|
8054
8349
|
this.chainId = chainId;
|
|
@@ -8358,6 +8653,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8358
8653
|
* The license terms must be attached to the parent IP before calling this function.
|
|
8359
8654
|
* All IPs attached default license terms by default.
|
|
8360
8655
|
* The derivative IP owner must be the caller or an authorized operator.
|
|
8656
|
+
*
|
|
8657
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link linkDerivative} instead.
|
|
8658
|
+
* This method will become internal soon.
|
|
8659
|
+
*
|
|
8660
|
+
* @example Migration Example
|
|
8661
|
+
* ```typescript
|
|
8662
|
+
* // Before (deprecated):
|
|
8663
|
+
* await client.ipAsset.registerDerivative({
|
|
8664
|
+
* childIpId: '0x...',
|
|
8665
|
+
* parentIpIds: ['0x...'],
|
|
8666
|
+
* licenseTermsIds: [1n]
|
|
8667
|
+
* });
|
|
8668
|
+
*
|
|
8669
|
+
* // After (recommended):
|
|
8670
|
+
* await client.ipAsset.linkDerivative({
|
|
8671
|
+
* childIpId: '0x...',
|
|
8672
|
+
* parentIpIds: ['0x...'],
|
|
8673
|
+
* licenseTermsIds: [1n]
|
|
8674
|
+
* });
|
|
8675
|
+
* ```
|
|
8361
8676
|
*/
|
|
8362
8677
|
)
|
|
8363
8678
|
}, {
|
|
@@ -8411,8 +8726,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8411
8726
|
txOptions: request.txOptions,
|
|
8412
8727
|
encodedTxs: [encodedTxData],
|
|
8413
8728
|
spgSpenderAddress: this.royaltyModuleEventClient.address,
|
|
8414
|
-
|
|
8415
|
-
|
|
8729
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
8730
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options = request.options) === null || _request$options === void 0 ? void 0 : _request$options.wipOptions), {}, {
|
|
8731
|
+
useMulticallWhenPossible: false
|
|
8732
|
+
})
|
|
8416
8733
|
})
|
|
8417
8734
|
}));
|
|
8418
8735
|
case 5:
|
|
@@ -8554,6 +8871,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8554
8871
|
* Registers a derivative with license tokens. The derivative IP is registered with license tokens minted from the parent IP's license terms.
|
|
8555
8872
|
* The license terms of the parent IPs issued with license tokens are attached to the derivative IP.
|
|
8556
8873
|
* The caller must be the derivative IP owner or an authorized operator.
|
|
8874
|
+
*
|
|
8875
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link linkDerivative} instead.
|
|
8876
|
+
* This method will become internal soon.
|
|
8877
|
+
*
|
|
8878
|
+
* @example Migration Example
|
|
8879
|
+
* ```typescript
|
|
8880
|
+
* // Before (deprecated):
|
|
8881
|
+
* await client.ipAsset.registerDerivativeWithLicenseTokens({
|
|
8882
|
+
* childIpId: '0x...',
|
|
8883
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
8884
|
+
* });
|
|
8885
|
+
*
|
|
8886
|
+
* // After (recommended):
|
|
8887
|
+
* await client.ipAsset.linkDerivative({
|
|
8888
|
+
* childIpId: '0x...',
|
|
8889
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
8890
|
+
* });
|
|
8891
|
+
* ```
|
|
8557
8892
|
*/
|
|
8558
8893
|
)
|
|
8559
8894
|
}, {
|
|
@@ -8633,6 +8968,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8633
8968
|
/**
|
|
8634
8969
|
* Mint an NFT from a collection and register it as an IP.
|
|
8635
8970
|
*
|
|
8971
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
8972
|
+
* This method will become internal soon.
|
|
8973
|
+
*
|
|
8974
|
+
* @example Migration Example
|
|
8975
|
+
* ```typescript
|
|
8976
|
+
* // Before (deprecated):
|
|
8977
|
+
* await client.ipAsset.mintAndRegisterIpAssetWithPilTerms({
|
|
8978
|
+
* spgNftContract: '0x...',
|
|
8979
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }]
|
|
8980
|
+
* });
|
|
8981
|
+
*
|
|
8982
|
+
* // After (recommended):
|
|
8983
|
+
* await client.ipAsset.registerIpAsset({
|
|
8984
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
8985
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }]
|
|
8986
|
+
* });
|
|
8987
|
+
* ```
|
|
8988
|
+
*
|
|
8636
8989
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} and {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/licensing/ILicensingModule.sol#L19 | `LicenseTermsAttached`} events.
|
|
8637
8990
|
*/
|
|
8638
8991
|
)
|
|
@@ -8641,7 +8994,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8641
8994
|
value: (function () {
|
|
8642
8995
|
var _mintAndRegisterIpAssetWithPilTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(request) {
|
|
8643
8996
|
var _this3 = this;
|
|
8644
|
-
var _request$txOptions4,
|
|
8997
|
+
var _request$txOptions4, _yield$transformRegis, transformRequest, encodedTxData, contractCall, rsp, computedLicenseTermsIds, maxLicenseTokensTxHashes, _t0;
|
|
8645
8998
|
return _regenerator().w(function (_context7) {
|
|
8646
8999
|
while (1) switch (_context7.p = _context7.n) {
|
|
8647
9000
|
case 0:
|
|
@@ -8670,7 +9023,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8670
9023
|
};
|
|
8671
9024
|
_context7.n = 3;
|
|
8672
9025
|
return this.handleRegistrationWithFees({
|
|
8673
|
-
|
|
9026
|
+
options: request.options,
|
|
8674
9027
|
sender: this.walletAddress,
|
|
8675
9028
|
spgNftContract: transformRequest.spgNftContract,
|
|
8676
9029
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -8836,6 +9189,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8836
9189
|
/**
|
|
8837
9190
|
* Register a given NFT as an IP and attach Programmable IP License Terms.
|
|
8838
9191
|
*
|
|
9192
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
9193
|
+
* This method will become internal soon.
|
|
9194
|
+
*
|
|
9195
|
+
* @example Migration Example
|
|
9196
|
+
* ```typescript
|
|
9197
|
+
* // Before (deprecated):
|
|
9198
|
+
* await client.ipAsset.registerIpAndAttachPilTerms({
|
|
9199
|
+
* nftContract: '0x...',
|
|
9200
|
+
* tokenId: 123n,
|
|
9201
|
+
* licenseTermsData: [{ terms: PILFlavor.nonCommercialSocialRemixing() }]
|
|
9202
|
+
* });
|
|
9203
|
+
*
|
|
9204
|
+
* // After (recommended):
|
|
9205
|
+
* await client.ipAsset.registerIpAsset({
|
|
9206
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
9207
|
+
* licenseTermsData: [{ terms: PILFlavor.nonCommercialSocialRemixing() }]
|
|
9208
|
+
* });
|
|
9209
|
+
* ```
|
|
9210
|
+
*
|
|
8839
9211
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} and {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/licensing/ILicensingModule.sol#L19 | `LicenseTermsAttached`} events.
|
|
8840
9212
|
*/
|
|
8841
9213
|
)
|
|
@@ -8943,6 +9315,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8943
9315
|
/**
|
|
8944
9316
|
* Register the given NFT as a derivative IP with metadata without using license tokens.
|
|
8945
9317
|
*
|
|
9318
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
9319
|
+
* This method will become internal soon.
|
|
9320
|
+
*
|
|
9321
|
+
* @example Migration Example
|
|
9322
|
+
* ```typescript
|
|
9323
|
+
* // Before (deprecated):
|
|
9324
|
+
* await client.ipAsset.registerDerivativeIp({
|
|
9325
|
+
* nftContract: '0x...',
|
|
9326
|
+
* tokenId: 123n,
|
|
9327
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9328
|
+
* });
|
|
9329
|
+
*
|
|
9330
|
+
* // After (recommended):
|
|
9331
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
9332
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
9333
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9334
|
+
* });
|
|
9335
|
+
* ```
|
|
9336
|
+
*
|
|
8946
9337
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
8947
9338
|
*/
|
|
8948
9339
|
)
|
|
@@ -8951,7 +9342,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8951
9342
|
value: (function () {
|
|
8952
9343
|
var _registerDerivativeIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(request) {
|
|
8953
9344
|
var _this4 = this;
|
|
8954
|
-
var _request$txOptions6, _request$
|
|
9345
|
+
var _request$txOptions6, _request$options2, tokenId, ipIdAddress, isRegistered, _yield$transformRegis3, _transformRequest2, encodedTxData, contractCall, _t12;
|
|
8955
9346
|
return _regenerator().w(function (_context0) {
|
|
8956
9347
|
while (1) switch (_context0.p = _context0.n) {
|
|
8957
9348
|
case 0:
|
|
@@ -9000,8 +9391,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9000
9391
|
return _this4.derivativeWorkflowsClient.registerIpAndMakeDerivative(_transformRequest2);
|
|
9001
9392
|
};
|
|
9002
9393
|
return _context0.a(2, this.handleRegistrationWithFees({
|
|
9003
|
-
|
|
9004
|
-
|
|
9394
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
9395
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options2 = request.options) === null || _request$options2 === void 0 ? void 0 : _request$options2.wipOptions), {}, {
|
|
9396
|
+
useMulticallWhenPossible: false
|
|
9397
|
+
})
|
|
9005
9398
|
}),
|
|
9006
9399
|
sender: this.walletAddress,
|
|
9007
9400
|
spgSpenderAddress: this.derivativeWorkflowsClient.address,
|
|
@@ -9025,6 +9418,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9025
9418
|
/**
|
|
9026
9419
|
* Mint an NFT from a collection and register it as a derivative IP without license tokens.
|
|
9027
9420
|
*
|
|
9421
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
9422
|
+
* This method will become internal soon.
|
|
9423
|
+
*
|
|
9424
|
+
* @example Migration Example
|
|
9425
|
+
* ```typescript
|
|
9426
|
+
* // Before (deprecated):
|
|
9427
|
+
* await client.ipAsset.mintAndRegisterIpAndMakeDerivative({
|
|
9428
|
+
* spgNftContract: '0x...',
|
|
9429
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9430
|
+
* });
|
|
9431
|
+
*
|
|
9432
|
+
* // After (recommended):
|
|
9433
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
9434
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
9435
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9436
|
+
* });
|
|
9437
|
+
* ```
|
|
9438
|
+
*
|
|
9028
9439
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9029
9440
|
*/
|
|
9030
9441
|
)
|
|
@@ -9033,7 +9444,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9033
9444
|
value: (function () {
|
|
9034
9445
|
var _mintAndRegisterIpAndMakeDerivative = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(request) {
|
|
9035
9446
|
var _this5 = this;
|
|
9036
|
-
var _request$txOptions7,
|
|
9447
|
+
var _request$txOptions7, spgNftContract, _yield$transformRegis4, _transformRequest3, encodedTxData, contractCall, _t13;
|
|
9037
9448
|
return _regenerator().w(function (_context1) {
|
|
9038
9449
|
while (1) switch (_context1.p = _context1.n) {
|
|
9039
9450
|
case 0:
|
|
@@ -9062,7 +9473,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9062
9473
|
return _this5.derivativeWorkflowsClient.mintAndRegisterIpAndMakeDerivative(_transformRequest3);
|
|
9063
9474
|
};
|
|
9064
9475
|
return _context1.a(2, this.handleRegistrationWithFees({
|
|
9065
|
-
|
|
9476
|
+
options: request.options,
|
|
9066
9477
|
sender: this.walletAddress,
|
|
9067
9478
|
spgSpenderAddress: this.derivativeWorkflowsClient.address,
|
|
9068
9479
|
spgNftContract: spgNftContract,
|
|
@@ -9170,6 +9581,23 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9170
9581
|
/**
|
|
9171
9582
|
* Mint an NFT from a SPGNFT collection and register it with metadata as an IP.
|
|
9172
9583
|
*
|
|
9584
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
9585
|
+
* This method will become internal soon.
|
|
9586
|
+
*
|
|
9587
|
+
* @example Migration Example
|
|
9588
|
+
* ```typescript
|
|
9589
|
+
* // Before (deprecated):
|
|
9590
|
+
* await client.ipAsset.mintAndRegisterIp({
|
|
9591
|
+
* spgNftContract: '0x...',
|
|
9592
|
+
* recipient: '0x...'
|
|
9593
|
+
* });
|
|
9594
|
+
*
|
|
9595
|
+
* // After (recommended):
|
|
9596
|
+
* await client.ipAsset.registerIpAsset({
|
|
9597
|
+
* nft: { type: 'mint', spgNftContract: '0x...', recipient: '0x...' }
|
|
9598
|
+
* });
|
|
9599
|
+
* ```
|
|
9600
|
+
*
|
|
9173
9601
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9174
9602
|
*/
|
|
9175
9603
|
)
|
|
@@ -9178,7 +9606,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9178
9606
|
value: (function () {
|
|
9179
9607
|
var _mintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(request) {
|
|
9180
9608
|
var _this6 = this;
|
|
9181
|
-
var _request$txOptions8, _request$
|
|
9609
|
+
var _request$txOptions8, _request$options3, _object, encodedTxData, contractCall, _t17;
|
|
9182
9610
|
return _regenerator().w(function (_context11) {
|
|
9183
9611
|
while (1) switch (_context11.p = _context11.n) {
|
|
9184
9612
|
case 0:
|
|
@@ -9208,8 +9636,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9208
9636
|
contractCall: contractCall,
|
|
9209
9637
|
spgNftContract: _object.spgNftContract,
|
|
9210
9638
|
txOptions: request.txOptions,
|
|
9211
|
-
|
|
9212
|
-
|
|
9639
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
9640
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options3 = request.options) === null || _request$options3 === void 0 ? void 0 : _request$options3.wipOptions), {}, {
|
|
9641
|
+
useMulticallWhenPossible: false
|
|
9642
|
+
})
|
|
9213
9643
|
})
|
|
9214
9644
|
}));
|
|
9215
9645
|
case 2:
|
|
@@ -9245,7 +9675,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9245
9675
|
value: (function () {
|
|
9246
9676
|
var _batchMintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(request) {
|
|
9247
9677
|
var _this7 = this;
|
|
9248
|
-
var publicMintEncodedTxs, publicMintSpenders, privateMintEncodedTxs, privateMintSpenders,
|
|
9678
|
+
var publicMintEncodedTxs, publicMintSpenders, privateMintEncodedTxs, privateMintSpenders, _iterator5, _step5, req, registrationRequest, isPublicMinting, nftMintFee, encodeTx, isMinterRole, handlePublicMintTransactions, handlePrivateMintTransactions, transactionResponses, publicMintResponse, privateMintResponse, _t18, _t19, _t20, _t21;
|
|
9249
9679
|
return _regenerator().w(function (_context14) {
|
|
9250
9680
|
while (1) switch (_context14.p = _context14.n) {
|
|
9251
9681
|
case 0:
|
|
@@ -9254,8 +9684,6 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9254
9684
|
publicMintSpenders = [];
|
|
9255
9685
|
privateMintEncodedTxs = [];
|
|
9256
9686
|
privateMintSpenders = [];
|
|
9257
|
-
publicMintFeesTotal = 0n;
|
|
9258
|
-
privateMintFeesTotal = 0n;
|
|
9259
9687
|
_iterator5 = _createForOfIteratorHelper(request.requests);
|
|
9260
9688
|
_context14.p = 1;
|
|
9261
9689
|
_iterator5.s();
|
|
@@ -9276,7 +9704,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9276
9704
|
case 3:
|
|
9277
9705
|
isPublicMinting = _context14.v;
|
|
9278
9706
|
_context14.n = 4;
|
|
9279
|
-
return
|
|
9707
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, registrationRequest.spgNftContract));
|
|
9280
9708
|
case 4:
|
|
9281
9709
|
nftMintFee = _context14.v;
|
|
9282
9710
|
encodeTx = {
|
|
@@ -9291,11 +9719,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9291
9719
|
_context14.n = 5;
|
|
9292
9720
|
break;
|
|
9293
9721
|
}
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
amount: nftMintFee
|
|
9298
|
-
}]);
|
|
9722
|
+
publicMintSpenders = mergeSpenders(publicMintSpenders, nftMintFee ? [_objectSpread2({
|
|
9723
|
+
address: registrationRequest.spgNftContract
|
|
9724
|
+
}, nftMintFee)] : []);
|
|
9299
9725
|
publicMintEncodedTxs.push(encodeTx);
|
|
9300
9726
|
_context14.n = 8;
|
|
9301
9727
|
break;
|
|
@@ -9310,11 +9736,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9310
9736
|
}
|
|
9311
9737
|
throw new Error("Caller ".concat(this.walletAddress, " does not have the minter role for ").concat(registrationRequest.spgNftContract));
|
|
9312
9738
|
case 7:
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
amount: nftMintFee
|
|
9317
|
-
}]);
|
|
9739
|
+
privateMintSpenders = mergeSpenders(privateMintSpenders, nftMintFee ? [_objectSpread2({
|
|
9740
|
+
address: registrationRequest.spgNftContract
|
|
9741
|
+
}, nftMintFee)] : []);
|
|
9318
9742
|
privateMintEncodedTxs.push(encodeTx);
|
|
9319
9743
|
case 8:
|
|
9320
9744
|
_context14.n = 2;
|
|
@@ -9338,9 +9762,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9338
9762
|
case 0:
|
|
9339
9763
|
_context12.n = 1;
|
|
9340
9764
|
return contractCallWithFees({
|
|
9341
|
-
totalFees: publicMintFeesTotal,
|
|
9342
9765
|
options: {
|
|
9343
|
-
wipOptions: request.wipOptions
|
|
9766
|
+
wipOptions: request.wipOptions,
|
|
9767
|
+
erc20Options: request.erc20Options
|
|
9344
9768
|
},
|
|
9345
9769
|
multicall3Address: _this7.multicall3Client.address,
|
|
9346
9770
|
rpcClient: _this7.rpcClient,
|
|
@@ -9373,11 +9797,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9373
9797
|
case 0:
|
|
9374
9798
|
_context13.n = 1;
|
|
9375
9799
|
return contractCallWithFees({
|
|
9376
|
-
totalFees: privateMintFeesTotal,
|
|
9377
9800
|
options: {
|
|
9378
9801
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
9379
9802
|
useMulticallWhenPossible: false
|
|
9380
|
-
})
|
|
9803
|
+
}),
|
|
9804
|
+
erc20Options: request.erc20Options
|
|
9381
9805
|
},
|
|
9382
9806
|
multicall3Address: _this7.multicall3Client.address,
|
|
9383
9807
|
rpcClient: _this7.rpcClient,
|
|
@@ -9463,6 +9887,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9463
9887
|
* Mint an NFT from a collection and register it as a derivative IP using license tokens.
|
|
9464
9888
|
* Requires caller to have the minter role or the SPG NFT to allow public minting. Caller must own the license tokens and have approved DerivativeWorkflows to transfer them.
|
|
9465
9889
|
*
|
|
9890
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
9891
|
+
* This method will become internal soon.
|
|
9892
|
+
*
|
|
9893
|
+
* @example Migration Example
|
|
9894
|
+
* ```typescript
|
|
9895
|
+
* // Before (deprecated):
|
|
9896
|
+
* await client.ipAsset.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens({
|
|
9897
|
+
* spgNftContract: '0x...',
|
|
9898
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
9899
|
+
* });
|
|
9900
|
+
*
|
|
9901
|
+
* // After (recommended):
|
|
9902
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
9903
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
9904
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
9905
|
+
* });
|
|
9906
|
+
* ```
|
|
9907
|
+
*
|
|
9466
9908
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9467
9909
|
*/
|
|
9468
9910
|
)
|
|
@@ -9471,7 +9913,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9471
9913
|
value: (function () {
|
|
9472
9914
|
var _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(request) {
|
|
9473
9915
|
var _this8 = this;
|
|
9474
|
-
var _request$txOptions9, _request$
|
|
9916
|
+
var _request$txOptions9, _request$options4, licenseTokenIds, _object2, encodedTxData, contractCall, _t22;
|
|
9475
9917
|
return _regenerator().w(function (_context16) {
|
|
9476
9918
|
while (1) switch (_context16.p = _context16.n) {
|
|
9477
9919
|
case 0:
|
|
@@ -9498,6 +9940,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9498
9940
|
encodedTxData: encodedTxData
|
|
9499
9941
|
});
|
|
9500
9942
|
case 2:
|
|
9943
|
+
_context16.n = 3;
|
|
9944
|
+
return this.approveLicenseTokensForDerivativeWorkflows(request.licenseTokenIds, request.autoApproveLicenseTokens);
|
|
9945
|
+
case 3:
|
|
9501
9946
|
contractCall = /*#__PURE__*/function () {
|
|
9502
9947
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
9503
9948
|
return _regenerator().w(function (_context15) {
|
|
@@ -9512,10 +9957,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9512
9957
|
};
|
|
9513
9958
|
}();
|
|
9514
9959
|
return _context16.a(2, this.handleRegistrationWithFees({
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9960
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
9961
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options4 = request.options) === null || _request$options4 === void 0 ? void 0 : _request$options4.wipOptions), {}, {
|
|
9962
|
+
// need to disable multicall to avoid needing to transfer the license
|
|
9963
|
+
// token to the multicall contract.
|
|
9964
|
+
useMulticallWhenPossible: false
|
|
9965
|
+
})
|
|
9519
9966
|
}),
|
|
9520
9967
|
sender: this.walletAddress,
|
|
9521
9968
|
spgNftContract: _object2.spgNftContract,
|
|
@@ -9524,12 +9971,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9524
9971
|
contractCall: contractCall,
|
|
9525
9972
|
txOptions: request.txOptions
|
|
9526
9973
|
}));
|
|
9527
|
-
case
|
|
9528
|
-
_context16.p =
|
|
9974
|
+
case 4:
|
|
9975
|
+
_context16.p = 4;
|
|
9529
9976
|
_t22 = _context16.v;
|
|
9530
9977
|
return _context16.a(2, handleError(_t22, "Failed to mint and register IP and make derivative with license tokens"));
|
|
9531
9978
|
}
|
|
9532
|
-
}, _callee16, this, [[0,
|
|
9979
|
+
}, _callee16, this, [[0, 4]]);
|
|
9533
9980
|
}));
|
|
9534
9981
|
function mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_x14) {
|
|
9535
9982
|
return _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
|
@@ -9539,6 +9986,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9539
9986
|
/**
|
|
9540
9987
|
* Register the given NFT as a derivative IP using license tokens.
|
|
9541
9988
|
*
|
|
9989
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
9990
|
+
* This method will become internal soon.
|
|
9991
|
+
*
|
|
9992
|
+
* @example Migration Example
|
|
9993
|
+
* ```typescript
|
|
9994
|
+
* // Before (deprecated):
|
|
9995
|
+
* await client.ipAsset.registerIpAndMakeDerivativeWithLicenseTokens({
|
|
9996
|
+
* nftContract: '0x...',
|
|
9997
|
+
* tokenId: 123n,
|
|
9998
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
9999
|
+
* });
|
|
10000
|
+
*
|
|
10001
|
+
* // After (recommended):
|
|
10002
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
10003
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
10004
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
10005
|
+
* });
|
|
10006
|
+
* ```
|
|
10007
|
+
*
|
|
9542
10008
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9543
10009
|
*/
|
|
9544
10010
|
)
|
|
@@ -9590,6 +10056,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9590
10056
|
});
|
|
9591
10057
|
case 6:
|
|
9592
10058
|
signature = _context17.v;
|
|
10059
|
+
_context17.n = 7;
|
|
10060
|
+
return this.approveLicenseTokensForDerivativeWorkflows(licenseTokenIds, request.autoApproveLicenseTokens);
|
|
10061
|
+
case 7:
|
|
9593
10062
|
_object3 = _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9594
10063
|
tokenId: tokenId,
|
|
9595
10064
|
licenseTokenIds: licenseTokenIds,
|
|
@@ -9603,38 +10072,38 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9603
10072
|
maxRts: validateMaxRts(request.maxRts)
|
|
9604
10073
|
});
|
|
9605
10074
|
if (!((_request$txOptions0 = request.txOptions) !== null && _request$txOptions0 !== void 0 && _request$txOptions0.encodedTxDataOnly)) {
|
|
9606
|
-
_context17.n =
|
|
10075
|
+
_context17.n = 8;
|
|
9607
10076
|
break;
|
|
9608
10077
|
}
|
|
9609
10078
|
return _context17.a(2, {
|
|
9610
10079
|
encodedTxData: this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokensEncode(_object3)
|
|
9611
10080
|
});
|
|
9612
|
-
case 7:
|
|
9613
|
-
_context17.n = 8;
|
|
9614
|
-
return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
|
|
9615
10081
|
case 8:
|
|
9616
|
-
txHash = _context17.v;
|
|
9617
10082
|
_context17.n = 9;
|
|
10083
|
+
return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
|
|
10084
|
+
case 9:
|
|
10085
|
+
txHash = _context17.v;
|
|
10086
|
+
_context17.n = 10;
|
|
9618
10087
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
|
9619
10088
|
hash: txHash
|
|
9620
10089
|
}));
|
|
9621
|
-
case
|
|
10090
|
+
case 10:
|
|
9622
10091
|
receipt = _context17.v;
|
|
9623
10092
|
log = this.getIpIdAndTokenIdsFromEvent(receipt)[0];
|
|
9624
10093
|
return _context17.a(2, _objectSpread2({
|
|
9625
10094
|
txHash: txHash
|
|
9626
10095
|
}, log));
|
|
9627
|
-
case 10:
|
|
9628
|
-
_context17.n = 12;
|
|
9629
|
-
break;
|
|
9630
10096
|
case 11:
|
|
9631
|
-
_context17.
|
|
10097
|
+
_context17.n = 13;
|
|
10098
|
+
break;
|
|
10099
|
+
case 12:
|
|
10100
|
+
_context17.p = 12;
|
|
9632
10101
|
_t23 = _context17.v;
|
|
9633
10102
|
return _context17.a(2, handleError(_t23, "Failed to register IP and make derivative with license tokens"));
|
|
9634
|
-
case
|
|
10103
|
+
case 13:
|
|
9635
10104
|
return _context17.a(2);
|
|
9636
10105
|
}
|
|
9637
|
-
}, _callee17, this, [[0,
|
|
10106
|
+
}, _callee17, this, [[0, 12]]);
|
|
9638
10107
|
}));
|
|
9639
10108
|
function registerIpAndMakeDerivativeWithLicenseTokens(_x15) {
|
|
9640
10109
|
return _registerIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
|
@@ -9646,6 +10115,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9646
10115
|
* tokens. In order to successfully distribute royalty tokens, the first
|
|
9647
10116
|
* license terms attached to the IP must be a commercial license.
|
|
9648
10117
|
*
|
|
10118
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
10119
|
+
* This method will become internal soon.
|
|
10120
|
+
*
|
|
10121
|
+
* @example Migration Example
|
|
10122
|
+
* ```typescript
|
|
10123
|
+
* // Before (deprecated):
|
|
10124
|
+
* await client.ipAsset.registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens({
|
|
10125
|
+
* nftContract: '0x...',
|
|
10126
|
+
* tokenId: 123n,
|
|
10127
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10128
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10129
|
+
* });
|
|
10130
|
+
*
|
|
10131
|
+
* // After (recommended):
|
|
10132
|
+
* await client.ipAsset.registerIpAsset({
|
|
10133
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
10134
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10135
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10136
|
+
* });
|
|
10137
|
+
* ```
|
|
10138
|
+
*
|
|
9649
10139
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} and {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/royalty/IRoyaltyModule.sol#L88 | `IpRoyaltyVaultDeployed`} events.
|
|
9650
10140
|
*/
|
|
9651
10141
|
)
|
|
@@ -9765,6 +10255,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9765
10255
|
* Register the given NFT as a derivative IP and attach license terms and distribute royalty tokens. In order to successfully distribute royalty tokens, the license terms attached to the IP must be
|
|
9766
10256
|
* a commercial license.
|
|
9767
10257
|
*
|
|
10258
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
10259
|
+
* This method will become internal soon.
|
|
10260
|
+
*
|
|
10261
|
+
* @example Migration Example
|
|
10262
|
+
* ```typescript
|
|
10263
|
+
* // Before (deprecated):
|
|
10264
|
+
* await client.ipAsset.registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens({
|
|
10265
|
+
* nftContract: '0x...',
|
|
10266
|
+
* tokenId: 123n,
|
|
10267
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10268
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10269
|
+
* });
|
|
10270
|
+
*
|
|
10271
|
+
* // After (recommended):
|
|
10272
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
10273
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
10274
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10275
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10276
|
+
* });
|
|
10277
|
+
* ```
|
|
10278
|
+
*
|
|
9768
10279
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} and {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/royalty/IRoyaltyModule.sol#L88| `IpRoyaltyVaultDeployed`} events.
|
|
9769
10280
|
*/
|
|
9770
10281
|
)
|
|
@@ -9773,7 +10284,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9773
10284
|
value: (function () {
|
|
9774
10285
|
var _registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(request) {
|
|
9775
10286
|
var _this9 = this;
|
|
9776
|
-
var _request$
|
|
10287
|
+
var _request$options5, ipIdAddress, _yield$transformRegis6, _transformRequest5, _getRoyaltyShares2, royaltyShares, totalAmount, isRegistered, encodedTxData, contractCall, _yield$this$handleReg, txHash, ipId, tokenId, receipt, ipRoyaltyVault, distributeRoyaltyTokensTxHash, _t25;
|
|
9777
10288
|
return _regenerator().w(function (_context19) {
|
|
9778
10289
|
while (1) switch (_context19.p = _context19.n) {
|
|
9779
10290
|
case 0:
|
|
@@ -9815,8 +10326,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9815
10326
|
};
|
|
9816
10327
|
_context19.n = 5;
|
|
9817
10328
|
return this.handleRegistrationWithFees({
|
|
9818
|
-
|
|
9819
|
-
|
|
10329
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
10330
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options5 = request.options) === null || _request$options5 === void 0 ? void 0 : _request$options5.wipOptions), {}, {
|
|
10331
|
+
useMulticallWhenPossible: false
|
|
10332
|
+
})
|
|
9820
10333
|
}),
|
|
9821
10334
|
sender: this.walletAddress,
|
|
9822
10335
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -9878,6 +10391,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9878
10391
|
/**
|
|
9879
10392
|
* Mint an NFT and register the IP, attach PIL terms, and distribute royalty tokens.
|
|
9880
10393
|
*
|
|
10394
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
10395
|
+
* This method will become internal soon.
|
|
10396
|
+
*
|
|
10397
|
+
* @example Migration Example
|
|
10398
|
+
* ```typescript
|
|
10399
|
+
* // Before (deprecated):
|
|
10400
|
+
* await client.ipAsset.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens({
|
|
10401
|
+
* spgNftContract: '0x...',
|
|
10402
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10403
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10404
|
+
* });
|
|
10405
|
+
*
|
|
10406
|
+
* // After (recommended):
|
|
10407
|
+
* await client.ipAsset.registerIpAsset({
|
|
10408
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
10409
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10410
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10411
|
+
* });
|
|
10412
|
+
* ```
|
|
10413
|
+
*
|
|
9881
10414
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} and {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/modules/royalty/IRoyaltyModule.sol#L88| `IpRoyaltyVaultDeployed`} events.
|
|
9882
10415
|
*/
|
|
9883
10416
|
)
|
|
@@ -9886,7 +10419,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9886
10419
|
value: (function () {
|
|
9887
10420
|
var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(request) {
|
|
9888
10421
|
var _this0 = this;
|
|
9889
|
-
var _request$
|
|
10422
|
+
var _request$options6, _yield$validateLicens3, licenseTerms, _yield$transformRegis7, _transformRequest6, encodedTxData, contractCall, _yield$this$handleReg2, txHash, ipId, tokenId, receipt, licenseTermsIds, ipRoyaltyVault, maxLicenseTokensTxHashes, _t26;
|
|
9890
10423
|
return _regenerator().w(function (_context20) {
|
|
9891
10424
|
while (1) switch (_context20.p = _context20.n) {
|
|
9892
10425
|
case 0:
|
|
@@ -9912,7 +10445,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9912
10445
|
};
|
|
9913
10446
|
_context20.n = 3;
|
|
9914
10447
|
return this.handleRegistrationWithFees({
|
|
9915
|
-
|
|
10448
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
10449
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options6 = request.options) === null || _request$options6 === void 0 ? void 0 : _request$options6.wipOptions), {}, {
|
|
10450
|
+
useMulticallWhenPossible: false
|
|
10451
|
+
})
|
|
10452
|
+
}),
|
|
9916
10453
|
sender: this.walletAddress,
|
|
9917
10454
|
spgNftContract: _transformRequest6.spgNftContract,
|
|
9918
10455
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -9973,6 +10510,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9973
10510
|
/**
|
|
9974
10511
|
* Mint an NFT and register the IP, make a derivative, and distribute royalty tokens.
|
|
9975
10512
|
*
|
|
10513
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
10514
|
+
* This method will become internal soon.
|
|
10515
|
+
*
|
|
10516
|
+
* @example Migration Example
|
|
10517
|
+
* ```typescript
|
|
10518
|
+
* // Before (deprecated):
|
|
10519
|
+
* await client.ipAsset.mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens({
|
|
10520
|
+
* spgNftContract: '0x...',
|
|
10521
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10522
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10523
|
+
* });
|
|
10524
|
+
*
|
|
10525
|
+
* // After (recommended):
|
|
10526
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
10527
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
10528
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10529
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10530
|
+
* });
|
|
10531
|
+
* ```
|
|
10532
|
+
*
|
|
9976
10533
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9977
10534
|
*/
|
|
9978
10535
|
)
|
|
@@ -9981,7 +10538,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9981
10538
|
value: (function () {
|
|
9982
10539
|
var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(request) {
|
|
9983
10540
|
var _this1 = this;
|
|
9984
|
-
var
|
|
10541
|
+
var _yield$transformRegis8, _transformRequest7, encodedTxData, contractCall, _t27;
|
|
9985
10542
|
return _regenerator().w(function (_context21) {
|
|
9986
10543
|
while (1) switch (_context21.p = _context21.n) {
|
|
9987
10544
|
case 0:
|
|
@@ -10003,7 +10560,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10003
10560
|
_context21.n = 2;
|
|
10004
10561
|
return this.handleRegistrationWithFees({
|
|
10005
10562
|
spgNftContract: _transformRequest7.spgNftContract,
|
|
10006
|
-
|
|
10563
|
+
options: request.options,
|
|
10007
10564
|
sender: this.walletAddress,
|
|
10008
10565
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
10009
10566
|
derivData: _transformRequest7.derivData,
|
|
@@ -10105,7 +10662,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10105
10662
|
* The method supports automatic token handling for minting fees:
|
|
10106
10663
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10107
10664
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10108
|
-
* - These automatic processes can be configured through the `
|
|
10665
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10109
10666
|
*
|
|
10110
10667
|
* @remark Multicall selection logic:
|
|
10111
10668
|
*
|
|
@@ -10117,12 +10674,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10117
10674
|
*
|
|
10118
10675
|
* 2. For `register*` methods:
|
|
10119
10676
|
* - Always uses SPG's multicall for batching registration operations
|
|
10677
|
+
*
|
|
10678
|
+
* Additionally, when multicall3 methods are used, transactions maybe cannot use multicall3 based on fee sufficiency and the presence of ERC20 tokens due to `msg.sender` context limitations.
|
|
10120
10679
|
*/
|
|
10121
10680
|
}, {
|
|
10122
10681
|
key: "batchRegisterIpAssetsWithOptimizedWorkflows",
|
|
10123
10682
|
value: (function () {
|
|
10124
10683
|
var _batchRegisterIpAssetsWithOptimizedWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(request) {
|
|
10125
|
-
var
|
|
10684
|
+
var transferWorkflowRequests, _iterator6, _step6, req, res, royaltyDistributionRequests, _yield$handleMultical, txResponses, aggregateRegistrationRequest, responses, royaltyTokensDistributionRequests, _iterator7, _step7, _step7$value, txHash, receipt, iPRegisteredLog, ipRoyaltyVaultEvent, _yield$prepareRoyalty, requests, ipRoyaltyVaults, distributeRoyaltyTokensTxHashes, _yield$handleMultical2, txResponse, registrationResults, _t28, _t29, _t30;
|
|
10126
10685
|
return _regenerator().w(function (_context24) {
|
|
10127
10686
|
while (1) switch (_context24.p = _context24.n) {
|
|
10128
10687
|
case 0:
|
|
@@ -10186,7 +10745,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10186
10745
|
rpcClient: this.rpcClient,
|
|
10187
10746
|
wallet: this.wallet,
|
|
10188
10747
|
walletAddress: this.walletAddress,
|
|
10189
|
-
|
|
10748
|
+
options: request.options,
|
|
10190
10749
|
chainId: this.chainId
|
|
10191
10750
|
});
|
|
10192
10751
|
case 9:
|
|
@@ -10216,11 +10775,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10216
10775
|
chainId: this.chainId
|
|
10217
10776
|
});
|
|
10218
10777
|
case 12:
|
|
10219
|
-
|
|
10220
|
-
|
|
10778
|
+
_yield$prepareRoyalty = _context24.v;
|
|
10779
|
+
requests = _yield$prepareRoyalty.requests;
|
|
10780
|
+
ipRoyaltyVaults = _yield$prepareRoyalty.ipRoyaltyVaults;
|
|
10781
|
+
royaltyTokensDistributionRequests.push.apply(royaltyTokensDistributionRequests, _toConsumableArray(requests));
|
|
10221
10782
|
responses.push({
|
|
10222
10783
|
txHash: txHash,
|
|
10223
10784
|
receipt: receipt,
|
|
10785
|
+
ipRoyaltyVault: ipRoyaltyVaults,
|
|
10224
10786
|
ipAssetsWithLicenseTerms: iPRegisteredLog.map(function (log) {
|
|
10225
10787
|
return {
|
|
10226
10788
|
ipId: log.ipId,
|
|
@@ -10254,7 +10816,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10254
10816
|
rpcClient: this.rpcClient,
|
|
10255
10817
|
wallet: this.wallet,
|
|
10256
10818
|
walletAddress: this.walletAddress,
|
|
10257
|
-
|
|
10819
|
+
options: request.options,
|
|
10258
10820
|
chainId: this.chainId
|
|
10259
10821
|
});
|
|
10260
10822
|
case 18:
|
|
@@ -10265,7 +10827,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10265
10827
|
});
|
|
10266
10828
|
case 19:
|
|
10267
10829
|
_context24.n = 20;
|
|
10268
|
-
return this.
|
|
10830
|
+
return this.populateLicenseAndTokenIdsForRegistrationResults(responses, aggregateRegistrationRequest);
|
|
10269
10831
|
case 20:
|
|
10270
10832
|
registrationResults = _context24.v;
|
|
10271
10833
|
return _context24.a(2, _objectSpread2({
|
|
@@ -10340,7 +10902,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10340
10902
|
* **Automatic Token Handling:**
|
|
10341
10903
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10342
10904
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10343
|
-
* - These automatic processes can be configured through the `
|
|
10905
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10344
10906
|
*
|
|
10345
10907
|
* @throws {Error} If the NFT type is invalid.
|
|
10346
10908
|
* @throws {Error} If `licenseTermsData` is not provided when `royaltyShares` are specified.
|
|
@@ -10453,7 +11015,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10453
11015
|
* **Automatic Token Handling:**
|
|
10454
11016
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10455
11017
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10456
|
-
* - These automatic processes can be configured through the `
|
|
11018
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10457
11019
|
*
|
|
10458
11020
|
* @throws {Error} If `derivData` is not provided when `royaltyShares` are provided.
|
|
10459
11021
|
* @throws {Error} If neither `derivData` nor `licenseTokenIds` are provided.
|
|
@@ -10566,7 +11128,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10566
11128
|
case 2:
|
|
10567
11129
|
return _context27.a(2, this.registerIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
|
|
10568
11130
|
licenseTokenIds: licenseTokenIds,
|
|
10569
|
-
maxRts: maxRts
|
|
11131
|
+
maxRts: maxRts,
|
|
11132
|
+
autoApproveLicenseTokens: request.autoApproveLicenseTokens
|
|
10570
11133
|
})));
|
|
10571
11134
|
}
|
|
10572
11135
|
}, _callee27, this);
|
|
@@ -10621,7 +11184,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10621
11184
|
case 2:
|
|
10622
11185
|
return _context28.a(2, this.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
|
|
10623
11186
|
licenseTokenIds: licenseTokenIds,
|
|
10624
|
-
maxRts: maxRts
|
|
11187
|
+
maxRts: maxRts,
|
|
11188
|
+
autoApproveLicenseTokens: request.autoApproveLicenseTokens
|
|
10625
11189
|
})));
|
|
10626
11190
|
}
|
|
10627
11191
|
}, _callee28, this);
|
|
@@ -10658,7 +11222,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10658
11222
|
* **Automatic Token Handling:**
|
|
10659
11223
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10660
11224
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10661
|
-
* - These automatic processes can be configured through the `
|
|
11225
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10662
11226
|
*/
|
|
10663
11227
|
)
|
|
10664
11228
|
}, {
|
|
@@ -10927,20 +11491,20 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10927
11491
|
value: function () {
|
|
10928
11492
|
var _handleRegistrationWithFees = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(_ref5) {
|
|
10929
11493
|
var _wipOptions$useMultic, _this$getIpIdAndToken, _event$ipId, _event$tokenId;
|
|
10930
|
-
var sender, derivData, spgNftContract, spgSpenderAddress, txOptions,
|
|
11494
|
+
var sender, derivData, spgNftContract, spgSpenderAddress, txOptions, options, encodedTxs, contractCall, tokenSpenders, wipOptions, useMulticallWhenPossible, nftMintFee, publicMinting, mintFees, _iterator0, _step0, mintFee, _yield$contractCallWi, txHash, receipt, event;
|
|
10931
11495
|
return _regenerator().w(function (_context34) {
|
|
10932
11496
|
while (1) switch (_context34.n) {
|
|
10933
11497
|
case 0:
|
|
10934
|
-
sender = _ref5.sender, derivData = _ref5.derivData, spgNftContract = _ref5.spgNftContract, spgSpenderAddress = _ref5.spgSpenderAddress, txOptions = _ref5.txOptions,
|
|
10935
|
-
|
|
10936
|
-
|
|
11498
|
+
sender = _ref5.sender, derivData = _ref5.derivData, spgNftContract = _ref5.spgNftContract, spgSpenderAddress = _ref5.spgSpenderAddress, txOptions = _ref5.txOptions, options = _ref5.options, encodedTxs = _ref5.encodedTxs, contractCall = _ref5.contractCall;
|
|
11499
|
+
tokenSpenders = [];
|
|
11500
|
+
wipOptions = options === null || options === void 0 ? void 0 : options.wipOptions;
|
|
10937
11501
|
useMulticallWhenPossible = (_wipOptions$useMultic = wipOptions === null || wipOptions === void 0 ? void 0 : wipOptions.useMulticallWhenPossible) !== null && _wipOptions$useMultic !== void 0 ? _wipOptions$useMultic : true; // get spg minting fee
|
|
10938
11502
|
if (!spgNftContract) {
|
|
10939
11503
|
_context34.n = 3;
|
|
10940
11504
|
break;
|
|
10941
11505
|
}
|
|
10942
11506
|
_context34.n = 1;
|
|
10943
|
-
return
|
|
11507
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, spgNftContract));
|
|
10944
11508
|
case 1:
|
|
10945
11509
|
nftMintFee = _context34.v;
|
|
10946
11510
|
_context34.n = 2;
|
|
@@ -10958,11 +11522,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10958
11522
|
if (!publicMinting) {
|
|
10959
11523
|
useMulticallWhenPossible = false;
|
|
10960
11524
|
}
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
amount: nftMintFee
|
|
10965
|
-
});
|
|
11525
|
+
tokenSpenders.push.apply(tokenSpenders, _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
11526
|
+
address: spgNftContract
|
|
11527
|
+
}, nftMintFee)] : []));
|
|
10966
11528
|
case 3:
|
|
10967
11529
|
if (!derivData) {
|
|
10968
11530
|
_context34.n = 5;
|
|
@@ -10977,39 +11539,38 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10977
11539
|
sender: sender
|
|
10978
11540
|
});
|
|
10979
11541
|
case 4:
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
11542
|
+
mintFees = _context34.v;
|
|
11543
|
+
_iterator0 = _createForOfIteratorHelper(mintFees);
|
|
11544
|
+
try {
|
|
11545
|
+
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
11546
|
+
mintFee = _step0.value;
|
|
11547
|
+
tokenSpenders.push(_objectSpread2({
|
|
11548
|
+
address: spgSpenderAddress
|
|
11549
|
+
}, mintFee));
|
|
11550
|
+
}
|
|
11551
|
+
} catch (err) {
|
|
11552
|
+
_iterator0.e(err);
|
|
11553
|
+
} finally {
|
|
11554
|
+
_iterator0.f();
|
|
10987
11555
|
}
|
|
10988
11556
|
case 5:
|
|
10989
|
-
|
|
10990
|
-
_context34.n = 6;
|
|
10991
|
-
break;
|
|
10992
|
-
}
|
|
10993
|
-
throw new Error("Total fees for registering derivative should never be negative: ".concat(totalFees));
|
|
10994
|
-
case 6:
|
|
10995
|
-
_context34.n = 7;
|
|
11557
|
+
_context34.n = 6;
|
|
10996
11558
|
return contractCallWithFees({
|
|
10997
|
-
|
|
10998
|
-
options: {
|
|
11559
|
+
options: _objectSpread2(_objectSpread2({}, options), {}, {
|
|
10999
11560
|
wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
|
|
11000
11561
|
useMulticallWhenPossible: useMulticallWhenPossible
|
|
11001
11562
|
})
|
|
11002
|
-
},
|
|
11563
|
+
}),
|
|
11003
11564
|
multicall3Address: this.multicall3Client.address,
|
|
11004
11565
|
rpcClient: this.rpcClient,
|
|
11005
|
-
tokenSpenders:
|
|
11566
|
+
tokenSpenders: tokenSpenders,
|
|
11006
11567
|
contractCall: contractCall,
|
|
11007
11568
|
sender: sender,
|
|
11008
11569
|
wallet: this.wallet,
|
|
11009
11570
|
txOptions: txOptions,
|
|
11010
11571
|
encodedTxs: encodedTxs
|
|
11011
11572
|
});
|
|
11012
|
-
case
|
|
11573
|
+
case 6:
|
|
11013
11574
|
_yield$contractCallWi = _context34.v;
|
|
11014
11575
|
txHash = _yield$contractCallWi.txHash;
|
|
11015
11576
|
receipt = _yield$contractCallWi.receipt;
|
|
@@ -11033,43 +11594,50 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11033
11594
|
* Process the `LicenseTermsIds` and `maxLicenseTokensTxHashes` for each IP asset.
|
|
11034
11595
|
*/
|
|
11035
11596
|
}, {
|
|
11036
|
-
key: "
|
|
11597
|
+
key: "populateLicenseAndTokenIdsForRegistrationResults",
|
|
11037
11598
|
value: (function () {
|
|
11038
|
-
var
|
|
11039
|
-
var
|
|
11599
|
+
var _populateLicenseAndTokenIdsForRegistrationResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(registrationResults, aggregateRegistrationRequest) {
|
|
11600
|
+
var allExtraDataArrays, allExtraData, extraDataFlatIndex, _iterator1, _step1, registrationResult, i, ipAsset, _t36;
|
|
11040
11601
|
return _regenerator().w(function (_context35) {
|
|
11041
11602
|
while (1) switch (_context35.p = _context35.n) {
|
|
11042
11603
|
case 0:
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
}
|
|
11047
|
-
|
|
11604
|
+
allExtraDataArrays = Object.values(aggregateRegistrationRequest).map(function (_ref6) {
|
|
11605
|
+
var extraData = _ref6.extraData;
|
|
11606
|
+
return extraData;
|
|
11607
|
+
});
|
|
11608
|
+
allExtraData = allExtraDataArrays.flat();
|
|
11609
|
+
extraDataFlatIndex = -1;
|
|
11610
|
+
_iterator1 = _createForOfIteratorHelper(registrationResults);
|
|
11048
11611
|
_context35.p = 1;
|
|
11049
|
-
_iterator0.s();
|
|
11050
|
-
case 2:
|
|
11051
|
-
if ((_step0 = _iterator0.n()).done) {
|
|
11052
|
-
_context35.n = 11;
|
|
11053
|
-
break;
|
|
11054
|
-
}
|
|
11055
|
-
_step0$value = _slicedToArray(_step0.value, 2), responseIndex = _step0$value[0], response = _step0$value[1];
|
|
11056
|
-
_iterator1 = _createForOfIteratorHelper(response.ipAssetsWithLicenseTerms.entries());
|
|
11057
|
-
_context35.p = 3;
|
|
11058
11612
|
_iterator1.s();
|
|
11059
|
-
case
|
|
11613
|
+
case 2:
|
|
11060
11614
|
if ((_step1 = _iterator1.n()).done) {
|
|
11061
11615
|
_context35.n = 7;
|
|
11062
11616
|
break;
|
|
11063
11617
|
}
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11618
|
+
registrationResult = _step1.value;
|
|
11619
|
+
i = 0;
|
|
11620
|
+
case 3:
|
|
11621
|
+
if (!(i < registrationResult.ipAssetsWithLicenseTerms.length)) {
|
|
11622
|
+
_context35.n = 6;
|
|
11623
|
+
break;
|
|
11624
|
+
}
|
|
11625
|
+
extraDataFlatIndex++;
|
|
11626
|
+
if (!(registrationResult.ipAssetsWithLicenseTerms[i] && allExtraData[extraDataFlatIndex])) {
|
|
11627
|
+
_context35.n = 5;
|
|
11628
|
+
break;
|
|
11629
|
+
}
|
|
11630
|
+
_context35.n = 4;
|
|
11631
|
+
return this.processIpAssetLicenseTerms(registrationResult.ipAssetsWithLicenseTerms[i], allExtraData[extraDataFlatIndex]);
|
|
11632
|
+
case 4:
|
|
11633
|
+
ipAsset = _context35.v;
|
|
11634
|
+
registrationResult.ipAssetsWithLicenseTerms[i] = ipAsset;
|
|
11068
11635
|
case 5:
|
|
11069
|
-
|
|
11070
|
-
|
|
11636
|
+
i++;
|
|
11637
|
+
_context35.n = 3;
|
|
11638
|
+
break;
|
|
11071
11639
|
case 6:
|
|
11072
|
-
_context35.n =
|
|
11640
|
+
_context35.n = 2;
|
|
11073
11641
|
break;
|
|
11074
11642
|
case 7:
|
|
11075
11643
|
_context35.n = 9;
|
|
@@ -11083,54 +11651,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11083
11651
|
_iterator1.f();
|
|
11084
11652
|
return _context35.f(9);
|
|
11085
11653
|
case 10:
|
|
11086
|
-
_context35.
|
|
11087
|
-
break;
|
|
11088
|
-
case 11:
|
|
11089
|
-
_context35.n = 13;
|
|
11090
|
-
break;
|
|
11091
|
-
case 12:
|
|
11092
|
-
_context35.p = 12;
|
|
11093
|
-
_t37 = _context35.v;
|
|
11094
|
-
_iterator0.e(_t37);
|
|
11095
|
-
case 13:
|
|
11096
|
-
_context35.p = 13;
|
|
11097
|
-
_iterator0.f();
|
|
11098
|
-
return _context35.f(13);
|
|
11099
|
-
case 14:
|
|
11100
|
-
_context35.n = 19;
|
|
11101
|
-
break;
|
|
11102
|
-
case 15:
|
|
11103
|
-
_extraData = [];
|
|
11104
|
-
Object.values(aggregateRegistrationRequest).map(function (item) {
|
|
11105
|
-
var _item$extraData;
|
|
11106
|
-
_extraData.push.apply(_extraData, _toConsumableArray((_item$extraData = item.extraData) !== null && _item$extraData !== void 0 ? _item$extraData : undefined));
|
|
11107
|
-
});
|
|
11108
|
-
i = 0;
|
|
11109
|
-
case 16:
|
|
11110
|
-
if (!(i < responses.length)) {
|
|
11111
|
-
_context35.n = 19;
|
|
11112
|
-
break;
|
|
11113
|
-
}
|
|
11114
|
-
_response = responses[i];
|
|
11115
|
-
extraDataItem = _extraData[i];
|
|
11116
|
-
_context35.n = 17;
|
|
11117
|
-
return this.processIpAssetLicenseTerms(_response.ipAssetsWithLicenseTerms[0], extraDataItem);
|
|
11118
|
-
case 17:
|
|
11119
|
-
_ipAsset = _context35.v;
|
|
11120
|
-
responses[i].ipAssetsWithLicenseTerms[0] = _ipAsset;
|
|
11121
|
-
case 18:
|
|
11122
|
-
i++;
|
|
11123
|
-
_context35.n = 16;
|
|
11124
|
-
break;
|
|
11125
|
-
case 19:
|
|
11126
|
-
return _context35.a(2, responses);
|
|
11654
|
+
return _context35.a(2, registrationResults);
|
|
11127
11655
|
}
|
|
11128
|
-
}, _callee35, this, [[
|
|
11656
|
+
}, _callee35, this, [[1, 8, 9, 10]]);
|
|
11129
11657
|
}));
|
|
11130
|
-
function
|
|
11131
|
-
return
|
|
11658
|
+
function populateLicenseAndTokenIdsForRegistrationResults(_x33, _x34) {
|
|
11659
|
+
return _populateLicenseAndTokenIdsForRegistrationResults.apply(this, arguments);
|
|
11132
11660
|
}
|
|
11133
|
-
return
|
|
11661
|
+
return populateLicenseAndTokenIdsForRegistrationResults;
|
|
11134
11662
|
}())
|
|
11135
11663
|
}, {
|
|
11136
11664
|
key: "processIpAssetLicenseTerms",
|
|
@@ -11185,11 +11713,65 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11185
11713
|
}
|
|
11186
11714
|
}, _callee36, this);
|
|
11187
11715
|
}));
|
|
11188
|
-
function processIpAssetLicenseTerms(
|
|
11716
|
+
function processIpAssetLicenseTerms(_x35, _x36) {
|
|
11189
11717
|
return _processIpAssetLicenseTerms.apply(this, arguments);
|
|
11190
11718
|
}
|
|
11191
11719
|
return processIpAssetLicenseTerms;
|
|
11192
11720
|
}()
|
|
11721
|
+
}, {
|
|
11722
|
+
key: "approveLicenseTokensForDerivativeWorkflows",
|
|
11723
|
+
value: function () {
|
|
11724
|
+
var _approveLicenseTokensForDerivativeWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37(licenseTokenIds, autoApproveLicenseTokens) {
|
|
11725
|
+
var _iterator10, _step10, licenseTokenId, txHash, _t37;
|
|
11726
|
+
return _regenerator().w(function (_context37) {
|
|
11727
|
+
while (1) switch (_context37.p = _context37.n) {
|
|
11728
|
+
case 0:
|
|
11729
|
+
if (!(autoApproveLicenseTokens !== false)) {
|
|
11730
|
+
_context37.n = 8;
|
|
11731
|
+
break;
|
|
11732
|
+
}
|
|
11733
|
+
_iterator10 = _createForOfIteratorHelper(licenseTokenIds);
|
|
11734
|
+
_context37.p = 1;
|
|
11735
|
+
_iterator10.s();
|
|
11736
|
+
case 2:
|
|
11737
|
+
if ((_step10 = _iterator10.n()).done) {
|
|
11738
|
+
_context37.n = 5;
|
|
11739
|
+
break;
|
|
11740
|
+
}
|
|
11741
|
+
licenseTokenId = _step10.value;
|
|
11742
|
+
_context37.n = 3;
|
|
11743
|
+
return this.licenseTokenClient.approve({
|
|
11744
|
+
to: this.derivativeWorkflowsClient.address,
|
|
11745
|
+
tokenId: BigInt(licenseTokenId)
|
|
11746
|
+
});
|
|
11747
|
+
case 3:
|
|
11748
|
+
txHash = _context37.v;
|
|
11749
|
+
_context37.n = 4;
|
|
11750
|
+
return waitTx(this.rpcClient, txHash);
|
|
11751
|
+
case 4:
|
|
11752
|
+
_context37.n = 2;
|
|
11753
|
+
break;
|
|
11754
|
+
case 5:
|
|
11755
|
+
_context37.n = 7;
|
|
11756
|
+
break;
|
|
11757
|
+
case 6:
|
|
11758
|
+
_context37.p = 6;
|
|
11759
|
+
_t37 = _context37.v;
|
|
11760
|
+
_iterator10.e(_t37);
|
|
11761
|
+
case 7:
|
|
11762
|
+
_context37.p = 7;
|
|
11763
|
+
_iterator10.f();
|
|
11764
|
+
return _context37.f(7);
|
|
11765
|
+
case 8:
|
|
11766
|
+
return _context37.a(2);
|
|
11767
|
+
}
|
|
11768
|
+
}, _callee37, this, [[1, 6, 7, 8]]);
|
|
11769
|
+
}));
|
|
11770
|
+
function approveLicenseTokensForDerivativeWorkflows(_x37, _x38) {
|
|
11771
|
+
return _approveLicenseTokensForDerivativeWorkflows.apply(this, arguments);
|
|
11772
|
+
}
|
|
11773
|
+
return approveLicenseTokensForDerivativeWorkflows;
|
|
11774
|
+
}()
|
|
11193
11775
|
}]);
|
|
11194
11776
|
}();
|
|
11195
11777
|
|
|
@@ -11361,7 +11943,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11361
11943
|
value: (function () {
|
|
11362
11944
|
var _mintLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
|
11363
11945
|
var _this = this;
|
|
11364
|
-
var _request$maxMintingFe, _request$maxRevenueSh, _request$txOptions2,
|
|
11946
|
+
var _request$maxMintingFe, _request$maxRevenueSh, _request$txOptions2, receiver, req, isLicenseIpIdRegistered, isExisted, ipAccount, ipOwner, isAttachedLicenseTerms, encodedTxData, licenseMintingFee, wipSpenders, _yield$contractCallWi, txHash, receipt, targetLogs, startLicenseTokenId, licenseTokenIds, i, _t3;
|
|
11365
11947
|
return _regenerator().w(function (_context3) {
|
|
11366
11948
|
while (1) switch (_context3.p = _context3.n) {
|
|
11367
11949
|
case 0:
|
|
@@ -11440,7 +12022,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11440
12022
|
});
|
|
11441
12023
|
case 9:
|
|
11442
12024
|
_context3.n = 10;
|
|
11443
|
-
return
|
|
12025
|
+
return calculateLicenseMintFee({
|
|
11444
12026
|
predictMintingFeeRequest: req,
|
|
11445
12027
|
rpcClient: this.rpcClient,
|
|
11446
12028
|
chainId: this.chainId,
|
|
@@ -11449,18 +12031,14 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11449
12031
|
case 10:
|
|
11450
12032
|
licenseMintingFee = _context3.v;
|
|
11451
12033
|
wipSpenders = [];
|
|
11452
|
-
if (licenseMintingFee > 0n) {
|
|
11453
|
-
wipSpenders.push({
|
|
11454
|
-
address: royaltyModuleAddress[this.chainId]
|
|
11455
|
-
|
|
11456
|
-
});
|
|
12034
|
+
if (licenseMintingFee.amount > 0n) {
|
|
12035
|
+
wipSpenders.push(_objectSpread2({
|
|
12036
|
+
address: royaltyModuleAddress[this.chainId]
|
|
12037
|
+
}, licenseMintingFee));
|
|
11457
12038
|
}
|
|
11458
12039
|
_context3.n = 11;
|
|
11459
12040
|
return contractCallWithFees({
|
|
11460
|
-
|
|
11461
|
-
options: {
|
|
11462
|
-
wipOptions: (_request$options = request.options) === null || _request$options === void 0 ? void 0 : _request$options.wipOptions
|
|
11463
|
-
},
|
|
12041
|
+
options: request.options,
|
|
11464
12042
|
multicall3Address: this.multicall3Client.address,
|
|
11465
12043
|
rpcClient: this.rpcClient,
|
|
11466
12044
|
tokenSpenders: wipSpenders,
|
|
@@ -11752,7 +12330,8 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11752
12330
|
licenseTemplate: newLicenseTemplate,
|
|
11753
12331
|
licensingConfig: _objectSpread2(_objectSpread2({}, licensingConfig), {}, {
|
|
11754
12332
|
licensingHook: this.totalLicenseTokenLimitHookClient.address,
|
|
11755
|
-
|
|
12333
|
+
// use Math.trunc to avoid precision issues
|
|
12334
|
+
expectMinimumGroupRewardShare: Math.trunc(licensingConfig.expectMinimumGroupRewardShare / 1000000)
|
|
11756
12335
|
})
|
|
11757
12336
|
});
|
|
11758
12337
|
case 4:
|
|
@@ -13229,12 +13808,12 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
|
13229
13808
|
value: (function () {
|
|
13230
13809
|
var _payRoyaltyOnBehalf = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
|
13231
13810
|
var _this2 = this;
|
|
13232
|
-
var _request$txOptions, receiverIpId, payerIpId, token, amount,
|
|
13811
|
+
var _request$txOptions, receiverIpId, payerIpId, token, amount, options, txOptions, sender, payAmount, isReceiverRegistered, isPayerRegistered, req, encodedTxData, contractCall, tokenSpenders, _t5;
|
|
13233
13812
|
return _regenerator().w(function (_context4) {
|
|
13234
13813
|
while (1) switch (_context4.p = _context4.n) {
|
|
13235
13814
|
case 0:
|
|
13236
13815
|
_context4.p = 0;
|
|
13237
|
-
receiverIpId = request.receiverIpId, payerIpId = request.payerIpId, token = request.token, amount = request.amount,
|
|
13816
|
+
receiverIpId = request.receiverIpId, payerIpId = request.payerIpId, token = request.token, amount = request.amount, options = request.options, txOptions = request.txOptions;
|
|
13238
13817
|
sender = this.wallet.account.address;
|
|
13239
13818
|
payAmount = BigInt(amount);
|
|
13240
13819
|
if (!(payAmount <= 0n)) {
|
|
@@ -13291,21 +13870,17 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
|
13291
13870
|
};
|
|
13292
13871
|
tokenSpenders = [{
|
|
13293
13872
|
address: this.royaltyModuleClient.address,
|
|
13294
|
-
amount: payAmount
|
|
13873
|
+
amount: payAmount,
|
|
13874
|
+
token: token
|
|
13295
13875
|
}];
|
|
13296
13876
|
_context4.n = 7;
|
|
13297
13877
|
return contractCallWithFees({
|
|
13298
|
-
|
|
13299
|
-
options: {
|
|
13300
|
-
erc20Options: erc20Options,
|
|
13301
|
-
wipOptions: wipOptions
|
|
13302
|
-
},
|
|
13878
|
+
options: options,
|
|
13303
13879
|
multicall3Address: this.multicall3Client.address,
|
|
13304
13880
|
rpcClient: this.rpcClient,
|
|
13305
13881
|
tokenSpenders: tokenSpenders,
|
|
13306
13882
|
contractCall: contractCall,
|
|
13307
13883
|
sender: sender,
|
|
13308
|
-
token: token,
|
|
13309
13884
|
wallet: this.wallet,
|
|
13310
13885
|
txOptions: txOptions,
|
|
13311
13886
|
encodedTxs: [encodedTxData]
|