@story-protocol/core-sdk 1.4.1 → 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 +1037 -464
- package/dist/story-protocol-core-sdk.cjs.prod.js +1037 -464
- package/dist/story-protocol-core-sdk.esm.js +1037 -464
- 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
|
|
@@ -3229,6 +3246,24 @@ var waitForTxReceipts = /*#__PURE__*/function () {
|
|
|
3229
3246
|
};
|
|
3230
3247
|
}();
|
|
3231
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
|
+
}();
|
|
3232
3267
|
var chainStringToViemChain = function chainStringToViemChain(chainId) {
|
|
3233
3268
|
switch (chainId) {
|
|
3234
3269
|
case 1315:
|
|
@@ -3265,6 +3300,22 @@ var getTokenAmountDisplay = function getTokenAmountDisplay(amount) {
|
|
|
3265
3300
|
return "".concat(formatEther(amount)).concat(unit);
|
|
3266
3301
|
};
|
|
3267
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
|
+
|
|
3268
3319
|
/**
|
|
3269
3320
|
* check the allowance of all spenders and call approval if any spender
|
|
3270
3321
|
* allowance is lower than the amount they are expected to spend.
|
|
@@ -3474,153 +3525,365 @@ var multiCallWrapIp = /*#__PURE__*/function () {
|
|
|
3474
3525
|
}();
|
|
3475
3526
|
|
|
3476
3527
|
/**
|
|
3477
|
-
*
|
|
3478
|
-
* For all other ERC20 tokens, it handles approvals if insufficient allowance.
|
|
3479
|
-
*
|
|
3480
|
-
* @remarks
|
|
3481
|
-
* This function will automatically handle the following:
|
|
3482
|
-
*
|
|
3483
|
-
* If token is wip and the user does not have enough WIP, it will wrap IP to WIP, unless
|
|
3484
|
-
* disabled via `disableAutoWrappingIp`.
|
|
3485
|
-
*
|
|
3486
|
-
* If the user have enough token, it will check for if approvals are needed
|
|
3487
|
-
* for each spender address and approve it, unless disabled via `disableAutoApprove`.
|
|
3528
|
+
* Calculate the total amount needed from spenders.
|
|
3488
3529
|
*/
|
|
3489
|
-
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 () {
|
|
3490
3540
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref6) {
|
|
3491
|
-
var _options$
|
|
3492
|
-
var
|
|
3541
|
+
var _options$erc20Options;
|
|
3542
|
+
var tokenSpenders, sender, options, multicall3Address, rpcClient, wallet, contractCall, txOptions, tokenClient, autoApprove, _t2;
|
|
3493
3543
|
return _regenerator().w(function (_context4) {
|
|
3494
3544
|
while (1) switch (_context4.n) {
|
|
3495
3545
|
case 0:
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
if (!(totalFees === 0n)) {
|
|
3502
|
-
_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;
|
|
3503
3551
|
break;
|
|
3504
3552
|
}
|
|
3505
3553
|
_context4.n = 1;
|
|
3506
|
-
return
|
|
3554
|
+
return approvalAllSpenders({
|
|
3555
|
+
spenders: tokenSpenders,
|
|
3556
|
+
client: tokenClient,
|
|
3557
|
+
owner: sender,
|
|
3558
|
+
multicallAddress: multicall3Address,
|
|
3559
|
+
rpcClient: rpcClient,
|
|
3560
|
+
useMultiCall: false
|
|
3561
|
+
});
|
|
3507
3562
|
case 1:
|
|
3508
|
-
|
|
3509
|
-
|
|
3563
|
+
_t2 = handleTransactionResponse;
|
|
3564
|
+
_context4.n = 2;
|
|
3565
|
+
return contractCall();
|
|
3510
3566
|
case 2:
|
|
3511
|
-
_context4.
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
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;
|
|
3518
3595
|
break;
|
|
3519
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;
|
|
3520
3610
|
if (!autoApprove) {
|
|
3521
|
-
|
|
3611
|
+
_context5.n = 3;
|
|
3522
3612
|
break;
|
|
3523
3613
|
}
|
|
3524
|
-
|
|
3614
|
+
_context5.n = 3;
|
|
3525
3615
|
return approvalAllSpenders({
|
|
3526
3616
|
spenders: tokenSpenders,
|
|
3527
|
-
client:
|
|
3617
|
+
client: wipTokenClient,
|
|
3528
3618
|
owner: sender,
|
|
3529
|
-
// sender owns the wip
|
|
3530
3619
|
multicallAddress: multicall3Address,
|
|
3531
3620
|
rpcClient: rpcClient,
|
|
3532
|
-
// since sender has all token, if using multicall, we cannot approve transfer token into multicall by multicall.
|
|
3533
|
-
// So in this case, we don't use multicall here and instead just wait for each approval to be finished.
|
|
3534
3621
|
useMultiCall: false
|
|
3535
3622
|
});
|
|
3536
|
-
case
|
|
3537
|
-
|
|
3623
|
+
case 3:
|
|
3624
|
+
_t3 = handleTransactionResponse;
|
|
3625
|
+
_context5.n = 4;
|
|
3538
3626
|
return contractCall();
|
|
3539
|
-
case
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
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;
|
|
3551
3650
|
return rpcClient.getBalance({
|
|
3552
3651
|
address: sender
|
|
3553
3652
|
});
|
|
3554
|
-
case
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
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;
|
|
3558
3663
|
break;
|
|
3559
3664
|
}
|
|
3560
|
-
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(
|
|
3561
|
-
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:
|
|
3562
3667
|
if (autoWrapIp) {
|
|
3563
|
-
|
|
3668
|
+
_context6.n = 4;
|
|
3564
3669
|
break;
|
|
3565
3670
|
}
|
|
3566
|
-
throw new Error("Wallet does not have enough WIP to pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(
|
|
3567
|
-
case
|
|
3568
|
-
|
|
3569
|
-
return {
|
|
3570
|
-
target: data.to,
|
|
3571
|
-
allowFailure: false,
|
|
3572
|
-
value: 0n,
|
|
3573
|
-
callData: data.data
|
|
3574
|
-
};
|
|
3575
|
-
});
|
|
3576
|
-
_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;
|
|
3577
3674
|
return multiCallWrapIp({
|
|
3578
3675
|
ipAmountToWrap: totalFees,
|
|
3579
3676
|
multicall3Address: multicall3Address,
|
|
3580
|
-
wipClient:
|
|
3677
|
+
wipClient: wipClient,
|
|
3581
3678
|
wipOptions: options === null || options === void 0 ? void 0 : options.wipOptions,
|
|
3582
3679
|
contractCall: contractCall,
|
|
3583
3680
|
wipSpenders: tokenSpenders,
|
|
3584
3681
|
rpcClient: rpcClient,
|
|
3585
3682
|
wallet: wallet,
|
|
3586
|
-
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
|
+
})
|
|
3587
3691
|
});
|
|
3588
|
-
case
|
|
3589
|
-
_yield$multiCallWrapI =
|
|
3692
|
+
case 5:
|
|
3693
|
+
_yield$multiCallWrapI = _context6.v;
|
|
3590
3694
|
txHash = _yield$multiCallWrapI.txHash;
|
|
3591
|
-
return
|
|
3695
|
+
return _context6.a(2, handleTransactionResponse(txHash, rpcClient, txOptions));
|
|
3592
3696
|
}
|
|
3593
|
-
},
|
|
3697
|
+
}, _callee6);
|
|
3594
3698
|
}));
|
|
3595
|
-
return function
|
|
3596
|
-
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);
|
|
3597
3805
|
};
|
|
3598
3806
|
}();
|
|
3599
3807
|
var handleTransactionResponse = /*#__PURE__*/function () {
|
|
3600
|
-
var
|
|
3601
|
-
return _regenerator().w(function (
|
|
3602
|
-
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) {
|
|
3603
3811
|
case 0:
|
|
3604
3812
|
if (!Array.isArray(txHash)) {
|
|
3605
|
-
|
|
3813
|
+
_context8.n = 1;
|
|
3606
3814
|
break;
|
|
3607
3815
|
}
|
|
3608
|
-
return
|
|
3816
|
+
return _context8.a(2, waitForTxReceipts({
|
|
3609
3817
|
rpcClient: rpcClient,
|
|
3610
3818
|
txOptions: txOptions,
|
|
3611
3819
|
txHashes: txHash
|
|
3612
3820
|
}));
|
|
3613
3821
|
case 1:
|
|
3614
|
-
return
|
|
3822
|
+
return _context8.a(2, waitForTxReceipt({
|
|
3615
3823
|
rpcClient: rpcClient,
|
|
3616
3824
|
txOptions: txOptions,
|
|
3617
3825
|
txHash: txHash
|
|
3618
3826
|
}));
|
|
3619
3827
|
}
|
|
3620
|
-
},
|
|
3828
|
+
}, _callee8);
|
|
3621
3829
|
}));
|
|
3622
|
-
return function handleTransactionResponse(
|
|
3623
|
-
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);
|
|
3624
3887
|
};
|
|
3625
3888
|
}();
|
|
3626
3889
|
|
|
@@ -4012,7 +4275,6 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4012
4275
|
};
|
|
4013
4276
|
_context.n = 8;
|
|
4014
4277
|
return contractCallWithFees({
|
|
4015
|
-
totalFees: bonds,
|
|
4016
4278
|
options: {
|
|
4017
4279
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
4018
4280
|
// Disable multicall because multicall makes more complex due to disputeInitiator in this version.
|
|
@@ -4023,7 +4285,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4023
4285
|
rpcClient: this.rpcClient,
|
|
4024
4286
|
tokenSpenders: [{
|
|
4025
4287
|
address: this.arbitrationPolicyUmaClient.address,
|
|
4026
|
-
amount: bonds
|
|
4288
|
+
amount: bonds,
|
|
4289
|
+
// Currently, only WIP is supported as the whitelisted dispute bond token.
|
|
4290
|
+
token: WIP_TOKEN_ADDRESS
|
|
4027
4291
|
}],
|
|
4028
4292
|
contractCall: contractCall,
|
|
4029
4293
|
encodedTxs: [encodedTxData],
|
|
@@ -4362,7 +4626,6 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4362
4626
|
};
|
|
4363
4627
|
_context5.n = 5;
|
|
4364
4628
|
return contractCallWithFees({
|
|
4365
|
-
totalFees: bond,
|
|
4366
4629
|
options: {
|
|
4367
4630
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
4368
4631
|
// Disable auto approve because msg.sender is ipAccount instead of wallet.
|
|
@@ -4376,7 +4639,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4376
4639
|
contractCall: contractCall,
|
|
4377
4640
|
tokenSpenders: [{
|
|
4378
4641
|
address: this.arbitrationPolicyUmaClient.address,
|
|
4379
|
-
amount: bond
|
|
4642
|
+
amount: bond,
|
|
4643
|
+
// Currently, only WIP is supported as the whitelisted dispute bond token.
|
|
4644
|
+
token: WIP_TOKEN_ADDRESS
|
|
4380
4645
|
}],
|
|
4381
4646
|
encodedTxs: [encodedData],
|
|
4382
4647
|
wallet: this.wallet,
|
|
@@ -5991,13 +6256,13 @@ var predictMintingLicenseFee = /*#__PURE__*/function () {
|
|
|
5991
6256
|
}();
|
|
5992
6257
|
var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
5993
6258
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
|
|
5994
|
-
var derivData, rpcClient, chainId, wallet, sender, walletAddress,
|
|
6259
|
+
var derivData, rpcClient, chainId, wallet, sender, walletAddress, mintFees, i, mintFee;
|
|
5995
6260
|
return _regenerator().w(function (_context2) {
|
|
5996
6261
|
while (1) switch (_context2.n) {
|
|
5997
6262
|
case 0:
|
|
5998
6263
|
derivData = _ref3.derivData, rpcClient = _ref3.rpcClient, chainId = _ref3.chainId, wallet = _ref3.wallet, sender = _ref3.sender;
|
|
5999
6264
|
walletAddress = sender || wallet.account.address;
|
|
6000
|
-
|
|
6265
|
+
mintFees = [];
|
|
6001
6266
|
i = 0;
|
|
6002
6267
|
case 1:
|
|
6003
6268
|
if (!(i < derivData.parentIpIds.length)) {
|
|
@@ -6005,7 +6270,7 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6005
6270
|
break;
|
|
6006
6271
|
}
|
|
6007
6272
|
_context2.n = 2;
|
|
6008
|
-
return
|
|
6273
|
+
return calculateLicenseMintFee({
|
|
6009
6274
|
predictMintingFeeRequest: {
|
|
6010
6275
|
licensorIpId: derivData.parentIpIds[i],
|
|
6011
6276
|
licenseTemplate: derivData.licenseTemplate,
|
|
@@ -6019,14 +6284,16 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6019
6284
|
walletAddress: walletAddress
|
|
6020
6285
|
});
|
|
6021
6286
|
case 2:
|
|
6022
|
-
|
|
6023
|
-
|
|
6287
|
+
mintFee = _context2.v;
|
|
6288
|
+
if (mintFee.amount > 0n) {
|
|
6289
|
+
mintFees.push(mintFee);
|
|
6290
|
+
}
|
|
6024
6291
|
case 3:
|
|
6025
6292
|
i++;
|
|
6026
6293
|
_context2.n = 1;
|
|
6027
6294
|
break;
|
|
6028
6295
|
case 4:
|
|
6029
|
-
return _context2.a(2,
|
|
6296
|
+
return _context2.a(2, mintFees);
|
|
6030
6297
|
}
|
|
6031
6298
|
}, _callee2);
|
|
6032
6299
|
}));
|
|
@@ -6034,9 +6301,9 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6034
6301
|
return _ref4.apply(this, arguments);
|
|
6035
6302
|
};
|
|
6036
6303
|
}();
|
|
6037
|
-
var
|
|
6304
|
+
var calculateLicenseMintFee = /*#__PURE__*/function () {
|
|
6038
6305
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
|
|
6039
|
-
var predictMintingFeeRequest, rpcClient, chainId, walletAddress,
|
|
6306
|
+
var predictMintingFeeRequest, rpcClient, chainId, walletAddress, _yield$predictMinting, currencyToken, tokenAmount;
|
|
6040
6307
|
return _regenerator().w(function (_context3) {
|
|
6041
6308
|
while (1) switch (_context3.n) {
|
|
6042
6309
|
case 0:
|
|
@@ -6049,24 +6316,23 @@ var calculateLicenseWipMintFee = /*#__PURE__*/function () {
|
|
|
6049
6316
|
walletAddress: walletAddress
|
|
6050
6317
|
});
|
|
6051
6318
|
case 1:
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
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
|
+
});
|
|
6060
6326
|
}
|
|
6061
6327
|
}, _callee3);
|
|
6062
6328
|
}));
|
|
6063
|
-
return function
|
|
6329
|
+
return function calculateLicenseMintFee(_x3) {
|
|
6064
6330
|
return _ref6.apply(this, arguments);
|
|
6065
6331
|
};
|
|
6066
6332
|
}();
|
|
6067
|
-
var
|
|
6333
|
+
var calculateSPGMintFee = /*#__PURE__*/function () {
|
|
6068
6334
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(spgNftClient) {
|
|
6069
|
-
var token;
|
|
6335
|
+
var token, amount;
|
|
6070
6336
|
return _regenerator().w(function (_context4) {
|
|
6071
6337
|
while (1) switch (_context4.n) {
|
|
6072
6338
|
case 0:
|
|
@@ -6074,20 +6340,24 @@ var calculateSPGWipMintFee = /*#__PURE__*/function () {
|
|
|
6074
6340
|
return spgNftClient.mintFeeToken();
|
|
6075
6341
|
case 1:
|
|
6076
6342
|
token = _context4.v;
|
|
6077
|
-
|
|
6078
|
-
|
|
6343
|
+
_context4.n = 2;
|
|
6344
|
+
return spgNftClient.mintFee();
|
|
6345
|
+
case 2:
|
|
6346
|
+
amount = _context4.v;
|
|
6347
|
+
if (!(amount > 0n)) {
|
|
6348
|
+
_context4.n = 3;
|
|
6079
6349
|
break;
|
|
6080
6350
|
}
|
|
6081
|
-
return _context4.a(2,
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6351
|
+
return _context4.a(2, {
|
|
6352
|
+
token: token,
|
|
6353
|
+
amount: amount
|
|
6354
|
+
});
|
|
6085
6355
|
case 3:
|
|
6086
|
-
return _context4.a(2
|
|
6356
|
+
return _context4.a(2);
|
|
6087
6357
|
}
|
|
6088
6358
|
}, _callee4);
|
|
6089
6359
|
}));
|
|
6090
|
-
return function
|
|
6360
|
+
return function calculateSPGMintFee(_x4) {
|
|
6091
6361
|
return _ref7.apply(this, arguments);
|
|
6092
6362
|
};
|
|
6093
6363
|
}();
|
|
@@ -6838,7 +7108,7 @@ var mergeSpenders = function mergeSpenders(previousSpenders, newSpenders) {
|
|
|
6838
7108
|
return acc;
|
|
6839
7109
|
}
|
|
6840
7110
|
var existingSpender = acc.find(function (s) {
|
|
6841
|
-
return s.address === spender.address;
|
|
7111
|
+
return s.address === spender.address && s.token === spender.token;
|
|
6842
7112
|
});
|
|
6843
7113
|
if (!existingSpender) {
|
|
6844
7114
|
acc.push(_objectSpread2(_objectSpread2({}, spender), {}, {
|
|
@@ -6904,7 +7174,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6904
7174
|
var _currentRequest$extra;
|
|
6905
7175
|
var res = _step.value;
|
|
6906
7176
|
var spenders = res.spenders,
|
|
6907
|
-
totalFees = res.totalFees,
|
|
6908
7177
|
encodedTxData = res.encodedTxData,
|
|
6909
7178
|
workflowClient = res.workflowClient,
|
|
6910
7179
|
isUseMulticall3 = res.isUseMulticall3,
|
|
@@ -6917,7 +7186,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6917
7186
|
if (!aggregateRegistrationRequest[targetAddress]) {
|
|
6918
7187
|
aggregateRegistrationRequest[targetAddress] = {
|
|
6919
7188
|
spenders: [],
|
|
6920
|
-
totalFees: 0n,
|
|
6921
7189
|
encodedTxData: [],
|
|
6922
7190
|
contractCall: [],
|
|
6923
7191
|
extraData: []
|
|
@@ -6925,7 +7193,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6925
7193
|
}
|
|
6926
7194
|
var currentRequest = aggregateRegistrationRequest[targetAddress];
|
|
6927
7195
|
currentRequest.spenders = mergeSpenders(currentRequest.spenders, spenders || []);
|
|
6928
|
-
currentRequest.totalFees += totalFees || 0n;
|
|
6929
7196
|
currentRequest.encodedTxData = currentRequest.encodedTxData.concat(encodedTxData);
|
|
6930
7197
|
currentRequest.extraData = (_currentRequest$extra = currentRequest.extraData) === null || _currentRequest$extra === void 0 ? void 0 : _currentRequest$extra.concat(extraData || undefined);
|
|
6931
7198
|
if (isUseMulticall3 || disableMulticallWhenPossible) {
|
|
@@ -6952,19 +7219,20 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6952
7219
|
};
|
|
6953
7220
|
var handleMulticall = /*#__PURE__*/function () {
|
|
6954
7221
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
6955
|
-
var
|
|
7222
|
+
var _options$wipOptions;
|
|
7223
|
+
var transferWorkflowRequests, multicall3Address, options, rpcClient, wallet, walletAddress, aggregateRegistrationRequest, txResponses, _loop2, key, _t2, _t3;
|
|
6956
7224
|
return _regenerator().w(function (_context3) {
|
|
6957
7225
|
while (1) switch (_context3.n) {
|
|
6958
7226
|
case 0:
|
|
6959
|
-
transferWorkflowRequests = _ref.transferWorkflowRequests, multicall3Address = _ref.multicall3Address,
|
|
6960
|
-
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);
|
|
6961
7229
|
txResponses = [];
|
|
6962
7230
|
_loop2 = /*#__PURE__*/_regenerator().m(function _loop2() {
|
|
6963
|
-
var _aggregateRegistratio, spenders,
|
|
7231
|
+
var _aggregateRegistratio, spenders, encodedTxData, contractCall, contractCalls, useMulticallWhenPossible, txResponse;
|
|
6964
7232
|
return _regenerator().w(function (_context2) {
|
|
6965
7233
|
while (1) switch (_context2.n) {
|
|
6966
7234
|
case 0:
|
|
6967
|
-
_aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders,
|
|
7235
|
+
_aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders, encodedTxData = _aggregateRegistratio.encodedTxData, contractCall = _aggregateRegistratio.contractCall;
|
|
6968
7236
|
contractCalls = /*#__PURE__*/function () {
|
|
6969
7237
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
6970
7238
|
var txHashes, _iterator2, _step2, call, txHash, _t;
|
|
@@ -7012,12 +7280,11 @@ var handleMulticall = /*#__PURE__*/function () {
|
|
|
7012
7280
|
useMulticallWhenPossible = key === multicall3Address ? true : false;
|
|
7013
7281
|
_context2.n = 1;
|
|
7014
7282
|
return contractCallWithFees({
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
|
|
7283
|
+
options: _objectSpread2(_objectSpread2({}, options), {}, {
|
|
7284
|
+
wipOptions: _objectSpread2(_objectSpread2({}, options === null || options === void 0 ? void 0 : options.wipOptions), {}, {
|
|
7018
7285
|
useMulticallWhenPossible: useMulticallWhenPossible
|
|
7019
7286
|
})
|
|
7020
|
-
},
|
|
7287
|
+
}),
|
|
7021
7288
|
multicall3Address: multicall3Address,
|
|
7022
7289
|
rpcClient: rpcClient,
|
|
7023
7290
|
tokenSpenders: spenders,
|
|
@@ -7136,7 +7403,7 @@ var transformRegistrationRequest = /*#__PURE__*/function () {
|
|
|
7136
7403
|
*/
|
|
7137
7404
|
var handleRegisterRequest = /*#__PURE__*/function () {
|
|
7138
7405
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
|
|
7139
|
-
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;
|
|
7140
7407
|
return _regenerator().w(function (_context2) {
|
|
7141
7408
|
while (1) switch (_context2.n) {
|
|
7142
7409
|
case 0:
|
|
@@ -7228,7 +7495,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7228
7495
|
wallet: wallet
|
|
7229
7496
|
});
|
|
7230
7497
|
case 9:
|
|
7231
|
-
|
|
7498
|
+
derivativeMintingFee = _context2.v;
|
|
7232
7499
|
if (!("royaltyShares" in request)) {
|
|
7233
7500
|
_context2.n = 11;
|
|
7234
7501
|
break;
|
|
@@ -7243,7 +7510,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7243
7510
|
wallet: wallet,
|
|
7244
7511
|
chainId: chainId,
|
|
7245
7512
|
royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient,
|
|
7246
|
-
|
|
7513
|
+
derivativeMintingFee: derivativeMintingFee,
|
|
7247
7514
|
royaltyShares: request.royaltyShares
|
|
7248
7515
|
});
|
|
7249
7516
|
case 10:
|
|
@@ -7259,7 +7526,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7259
7526
|
wallet: wallet,
|
|
7260
7527
|
chainId: chainId,
|
|
7261
7528
|
derivativeWorkflowsClient: derivativeWorkflowsClient,
|
|
7262
|
-
|
|
7529
|
+
derivativeMintingFee: derivativeMintingFee
|
|
7263
7530
|
});
|
|
7264
7531
|
case 12:
|
|
7265
7532
|
return _context2.a(2, _context2.v);
|
|
@@ -7280,11 +7547,11 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7280
7547
|
*/
|
|
7281
7548
|
var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
|
|
7282
7549
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
|
|
7283
|
-
var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient,
|
|
7550
|
+
var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient, derivativeMintingFee, signature, transformRequest, spenders;
|
|
7284
7551
|
return _regenerator().w(function (_context3) {
|
|
7285
7552
|
while (1) switch (_context3.n) {
|
|
7286
7553
|
case 0:
|
|
7287
|
-
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;
|
|
7288
7555
|
_context3.n = 1;
|
|
7289
7556
|
return generateOperationSignature({
|
|
7290
7557
|
ipIdAddress: ipIdAddress,
|
|
@@ -7302,15 +7569,16 @@ var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
|
|
|
7302
7569
|
signature: signature
|
|
7303
7570
|
}
|
|
7304
7571
|
});
|
|
7572
|
+
spenders = derivativeMintingFee.map(function (fee) {
|
|
7573
|
+
return _objectSpread2({
|
|
7574
|
+
address: derivativeWorkflowsClient.address
|
|
7575
|
+
}, fee);
|
|
7576
|
+
});
|
|
7305
7577
|
return _context3.a(2, {
|
|
7306
7578
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7307
7579
|
transformRequest: transformRequest,
|
|
7308
7580
|
isUseMulticall3: false,
|
|
7309
|
-
spenders:
|
|
7310
|
-
address: derivativeWorkflowsClient.address,
|
|
7311
|
-
amount: totalFees
|
|
7312
|
-
}],
|
|
7313
|
-
totalFees: totalFees,
|
|
7581
|
+
spenders: spenders,
|
|
7314
7582
|
contractCall: function contractCall() {
|
|
7315
7583
|
return derivativeWorkflowsClient.registerIpAndMakeDerivative(transformRequest);
|
|
7316
7584
|
},
|
|
@@ -7451,11 +7719,11 @@ var transferRegisterIpAndAttachPilTermsRequest = /*#__PURE__*/function () {
|
|
|
7451
7719
|
*/
|
|
7452
7720
|
var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE__*/function () {
|
|
7453
7721
|
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref1) {
|
|
7454
|
-
var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient,
|
|
7722
|
+
var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient, derivativeMintingFee, royaltyShares, signature, transformRequest, spenders;
|
|
7455
7723
|
return _regenerator().w(function (_context6) {
|
|
7456
7724
|
while (1) switch (_context6.n) {
|
|
7457
7725
|
case 0:
|
|
7458
|
-
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;
|
|
7459
7727
|
_context6.n = 1;
|
|
7460
7728
|
return generateOperationSignature({
|
|
7461
7729
|
ipIdAddress: ipIdAddress,
|
|
@@ -7473,15 +7741,16 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
|
|
|
7473
7741
|
signature: signature
|
|
7474
7742
|
}
|
|
7475
7743
|
});
|
|
7744
|
+
spenders = derivativeMintingFee.map(function (fee) {
|
|
7745
|
+
return _objectSpread2({
|
|
7746
|
+
address: royaltyTokenDistributionWorkflowsClient.address
|
|
7747
|
+
}, fee);
|
|
7748
|
+
});
|
|
7476
7749
|
return _context6.a(2, {
|
|
7477
7750
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7478
7751
|
transformRequest: transformRequest,
|
|
7479
7752
|
isUseMulticall3: false,
|
|
7480
|
-
spenders:
|
|
7481
|
-
address: royaltyTokenDistributionWorkflowsClient.address,
|
|
7482
|
-
amount: totalFees
|
|
7483
|
-
}],
|
|
7484
|
-
totalFees: totalFees,
|
|
7753
|
+
spenders: spenders,
|
|
7485
7754
|
contractCall: function contractCall() {
|
|
7486
7755
|
return royaltyTokenDistributionWorkflowsClient.registerIpAndMakeDerivativeAndDeployRoyaltyVault(transformRequest);
|
|
7487
7756
|
},
|
|
@@ -7529,7 +7798,7 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
|
|
|
7529
7798
|
var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
7530
7799
|
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref11) {
|
|
7531
7800
|
var _request$allowDuplica;
|
|
7532
|
-
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;
|
|
7533
7802
|
return _regenerator().w(function (_context7) {
|
|
7534
7803
|
while (1) switch (_context7.n) {
|
|
7535
7804
|
case 0:
|
|
@@ -7542,7 +7811,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7542
7811
|
case 1:
|
|
7543
7812
|
isPublicMinting = _context7.v;
|
|
7544
7813
|
_context7.n = 2;
|
|
7545
|
-
return
|
|
7814
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(rpcClient, request.spgNftContract));
|
|
7546
7815
|
case 2:
|
|
7547
7816
|
nftMintFee = _context7.v;
|
|
7548
7817
|
baseRequest = {
|
|
@@ -7608,7 +7877,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7608
7877
|
wallet: wallet
|
|
7609
7878
|
});
|
|
7610
7879
|
case 7:
|
|
7611
|
-
|
|
7880
|
+
derivativeMintingFee = _context7.v;
|
|
7612
7881
|
requestWithDeriv = _objectSpread2(_objectSpread2({}, baseRequest), {}, {
|
|
7613
7882
|
derivData: derivData
|
|
7614
7883
|
});
|
|
@@ -7622,7 +7891,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7622
7891
|
}),
|
|
7623
7892
|
nftMintFee: nftMintFee,
|
|
7624
7893
|
isPublicMinting: isPublicMinting,
|
|
7625
|
-
|
|
7894
|
+
derivativeMintingFee: derivativeMintingFee,
|
|
7626
7895
|
royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient
|
|
7627
7896
|
}));
|
|
7628
7897
|
case 8:
|
|
@@ -7633,7 +7902,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7633
7902
|
derivativeWorkflowsClient: derivativeWorkflowsClient,
|
|
7634
7903
|
nftMintFee: nftMintFee,
|
|
7635
7904
|
isPublicMinting: isPublicMinting,
|
|
7636
|
-
|
|
7905
|
+
derivativeMintingFee: derivativeMintingFee
|
|
7637
7906
|
}));
|
|
7638
7907
|
case 9:
|
|
7639
7908
|
throw new Error("Invalid mint and register request type");
|
|
@@ -7668,11 +7937,9 @@ var transformMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
|
|
|
7668
7937
|
contractCall: function contractCall() {
|
|
7669
7938
|
return royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(transformRequest);
|
|
7670
7939
|
},
|
|
7671
|
-
spenders: [{
|
|
7672
|
-
address: transformRequest.spgNftContract
|
|
7673
|
-
|
|
7674
|
-
}],
|
|
7675
|
-
totalFees: nftMintFee,
|
|
7940
|
+
spenders: _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
7941
|
+
address: transformRequest.spgNftContract
|
|
7942
|
+
}, nftMintFee)] : []),
|
|
7676
7943
|
encodedTxData: {
|
|
7677
7944
|
to: royaltyTokenDistributionWorkflowsClient.address,
|
|
7678
7945
|
data: encodeFunctionData({
|
|
@@ -7698,15 +7965,14 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
|
|
|
7698
7965
|
nftMintFee = _ref14.nftMintFee,
|
|
7699
7966
|
isPublicMinting = _ref14.isPublicMinting,
|
|
7700
7967
|
maxLicenseTokens = _ref14.maxLicenseTokens;
|
|
7968
|
+
var spenders = nftMintFee ? [_objectSpread2({
|
|
7969
|
+
address: request.spgNftContract
|
|
7970
|
+
}, nftMintFee)] : [];
|
|
7701
7971
|
return {
|
|
7702
7972
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7703
7973
|
transformRequest: request,
|
|
7704
|
-
isUseMulticall3: isPublicMinting,
|
|
7705
|
-
spenders:
|
|
7706
|
-
address: request.spgNftContract,
|
|
7707
|
-
amount: nftMintFee
|
|
7708
|
-
}],
|
|
7709
|
-
totalFees: nftMintFee,
|
|
7974
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
7975
|
+
spenders: spenders,
|
|
7710
7976
|
encodedTxData: {
|
|
7711
7977
|
to: licenseAttachmentWorkflowsClient.address,
|
|
7712
7978
|
data: encodeFunctionData({
|
|
@@ -7730,33 +7996,33 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
|
|
|
7730
7996
|
* Transforms a request for the `mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens` contract method.
|
|
7731
7997
|
*/
|
|
7732
7998
|
var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest = function transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest(_ref15) {
|
|
7999
|
+
var _derivativeMintingFee;
|
|
7733
8000
|
var request = _ref15.request,
|
|
7734
8001
|
nftMintFee = _ref15.nftMintFee,
|
|
7735
8002
|
isPublicMinting = _ref15.isPublicMinting,
|
|
7736
|
-
|
|
8003
|
+
derivativeMintingFee = _ref15.derivativeMintingFee,
|
|
7737
8004
|
royaltyTokenDistributionWorkflowsClient = _ref15.royaltyTokenDistributionWorkflowsClient;
|
|
7738
8005
|
var _getRoyaltyShares2 = getRoyaltyShares(request.royaltyShares),
|
|
7739
8006
|
royaltyShares = _getRoyaltyShares2.royaltyShares;
|
|
7740
8007
|
/**
|
|
7741
|
-
* TODO: Consider the scenario where the SPG token is WIP and the derivative token is ERC20.
|
|
7742
8008
|
* The SDK should handle both cases in the `contractCallWithFees` method.
|
|
7743
8009
|
* Currently, it only supports WIP tokens and does not handle ERC20 tokens, such as approving ERC20 tokens.
|
|
7744
8010
|
*/
|
|
7745
8011
|
var transformRequest = _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7746
8012
|
royaltyShares: royaltyShares
|
|
7747
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)] : []));
|
|
7748
8021
|
return {
|
|
7749
8022
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7750
8023
|
transformRequest: transformRequest,
|
|
7751
|
-
isUseMulticall3: isPublicMinting,
|
|
7752
|
-
spenders:
|
|
7753
|
-
address: royaltyTokenDistributionWorkflowsClient.address,
|
|
7754
|
-
amount: totalDerivativeMintingFee
|
|
7755
|
-
}, {
|
|
7756
|
-
address: request.spgNftContract,
|
|
7757
|
-
amount: nftMintFee
|
|
7758
|
-
}],
|
|
7759
|
-
totalFees: totalDerivativeMintingFee + nftMintFee,
|
|
8024
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
8025
|
+
spenders: spenders,
|
|
7760
8026
|
encodedTxData: {
|
|
7761
8027
|
to: royaltyTokenDistributionWorkflowsClient.address,
|
|
7762
8028
|
data: encodeFunctionData({
|
|
@@ -7776,23 +8042,24 @@ var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
|
|
|
7776
8042
|
*/
|
|
7777
8043
|
|
|
7778
8044
|
var transferMintAndRegisterIpAndMakeDerivativeRequest = function transferMintAndRegisterIpAndMakeDerivativeRequest(_ref16) {
|
|
8045
|
+
var _derivativeMintingFee2;
|
|
7779
8046
|
var request = _ref16.request,
|
|
7780
8047
|
derivativeWorkflowsClient = _ref16.derivativeWorkflowsClient,
|
|
7781
8048
|
nftMintFee = _ref16.nftMintFee,
|
|
7782
8049
|
isPublicMinting = _ref16.isPublicMinting,
|
|
7783
|
-
|
|
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)] : []));
|
|
7784
8058
|
return {
|
|
7785
8059
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7786
8060
|
transformRequest: request,
|
|
7787
|
-
isUseMulticall3: isPublicMinting,
|
|
7788
|
-
spenders:
|
|
7789
|
-
address: derivativeWorkflowsClient.address,
|
|
7790
|
-
amount: totalDerivativeMintingFee
|
|
7791
|
-
}, {
|
|
7792
|
-
address: request.spgNftContract,
|
|
7793
|
-
amount: nftMintFee
|
|
7794
|
-
}],
|
|
7795
|
-
totalFees: totalDerivativeMintingFee + nftMintFee,
|
|
8061
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
8062
|
+
spenders: spenders,
|
|
7796
8063
|
encodedTxData: {
|
|
7797
8064
|
to: derivativeWorkflowsClient.address,
|
|
7798
8065
|
data: encodeFunctionData({
|
|
@@ -7896,7 +8163,7 @@ var transferDistributeRoyaltyTokensRequest = /*#__PURE__*/function () {
|
|
|
7896
8163
|
}();
|
|
7897
8164
|
var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
7898
8165
|
var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref19) {
|
|
7899
|
-
var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId,
|
|
8166
|
+
var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId, requests, ipRoyaltyVaults, _iterator, _step, _loop, _t;
|
|
7900
8167
|
return _regenerator().w(function (_context0) {
|
|
7901
8168
|
while (1) switch (_context0.p = _context0.n) {
|
|
7902
8169
|
case 0:
|
|
@@ -7905,13 +8172,17 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7905
8172
|
_context0.n = 1;
|
|
7906
8173
|
break;
|
|
7907
8174
|
}
|
|
7908
|
-
return _context0.a(2,
|
|
8175
|
+
return _context0.a(2, {
|
|
8176
|
+
requests: [],
|
|
8177
|
+
ipRoyaltyVaults: []
|
|
8178
|
+
});
|
|
7909
8179
|
case 1:
|
|
7910
|
-
|
|
8180
|
+
requests = [];
|
|
8181
|
+
ipRoyaltyVaults = [];
|
|
7911
8182
|
_iterator = _createForOfIteratorHelper(royaltyDistributionRequests);
|
|
7912
8183
|
_context0.p = 2;
|
|
7913
8184
|
_loop = /*#__PURE__*/_regenerator().m(function _loop() {
|
|
7914
|
-
var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, response;
|
|
8185
|
+
var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, ipRoyaltyVaultItem, response;
|
|
7915
8186
|
return _regenerator().w(function (_context9) {
|
|
7916
8187
|
while (1) switch (_context9.n) {
|
|
7917
8188
|
case 0:
|
|
@@ -7930,13 +8201,15 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7930
8201
|
return getCalculatedDeadline(rpcClient, req.deadline);
|
|
7931
8202
|
case 1:
|
|
7932
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
|
+
});
|
|
7933
8208
|
_context9.n = 2;
|
|
7934
8209
|
return transferDistributeRoyaltyTokensRequest({
|
|
7935
8210
|
request: {
|
|
7936
8211
|
ipId: filterIpIdAndTokenId.ipId,
|
|
7937
|
-
ipRoyaltyVault: ipRoyaltyVault
|
|
7938
|
-
return item.ipId === filterIpIdAndTokenId.ipId;
|
|
7939
|
-
}).ipRoyaltyVault,
|
|
8212
|
+
ipRoyaltyVault: ipRoyaltyVaultItem.ipRoyaltyVault,
|
|
7940
8213
|
royaltyShares: royaltyShares,
|
|
7941
8214
|
totalAmount: totalAmount,
|
|
7942
8215
|
deadline: calculatedDeadline
|
|
@@ -7947,7 +8220,8 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7947
8220
|
});
|
|
7948
8221
|
case 2:
|
|
7949
8222
|
response = _context9.v;
|
|
7950
|
-
|
|
8223
|
+
requests.push(response);
|
|
8224
|
+
ipRoyaltyVaults.push(ipRoyaltyVaultItem);
|
|
7951
8225
|
case 3:
|
|
7952
8226
|
return _context9.a(2);
|
|
7953
8227
|
}
|
|
@@ -7975,7 +8249,10 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7975
8249
|
_iterator.f();
|
|
7976
8250
|
return _context0.f(7);
|
|
7977
8251
|
case 8:
|
|
7978
|
-
return _context0.a(2,
|
|
8252
|
+
return _context0.a(2, {
|
|
8253
|
+
requests: requests,
|
|
8254
|
+
ipRoyaltyVaults: ipRoyaltyVaults
|
|
8255
|
+
});
|
|
7979
8256
|
}
|
|
7980
8257
|
}, _callee9, null, [[2, 6, 7, 8]]);
|
|
7981
8258
|
}));
|
|
@@ -7984,6 +8261,22 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7984
8261
|
};
|
|
7985
8262
|
}();
|
|
7986
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
|
+
|
|
7987
8280
|
var setMaxLicenseTokens = /*#__PURE__*/function () {
|
|
7988
8281
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
7989
8282
|
var maxLicenseTokensData, licensorIpId, licenseTermsIds, totalLicenseTokenLimitHookClient, templateAddress, licenseTermsMaxLimitTxHashes, i, maxLicenseTokens, txHash;
|
|
@@ -8050,6 +8343,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8050
8343
|
this.multicall3Client = new Multicall3Client(rpcClient, wallet);
|
|
8051
8344
|
this.spgNftClient = new SpgnftImplReadOnlyClient(rpcClient);
|
|
8052
8345
|
this.totalLicenseTokenLimitHookClient = new TotalLicenseTokenLimitHookClient(rpcClient, wallet);
|
|
8346
|
+
this.licenseTokenClient = new LicenseTokenClient(rpcClient, wallet);
|
|
8053
8347
|
this.rpcClient = rpcClient;
|
|
8054
8348
|
this.wallet = wallet;
|
|
8055
8349
|
this.chainId = chainId;
|
|
@@ -8359,6 +8653,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8359
8653
|
* The license terms must be attached to the parent IP before calling this function.
|
|
8360
8654
|
* All IPs attached default license terms by default.
|
|
8361
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
|
+
* ```
|
|
8362
8676
|
*/
|
|
8363
8677
|
)
|
|
8364
8678
|
}, {
|
|
@@ -8412,8 +8726,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8412
8726
|
txOptions: request.txOptions,
|
|
8413
8727
|
encodedTxs: [encodedTxData],
|
|
8414
8728
|
spgSpenderAddress: this.royaltyModuleEventClient.address,
|
|
8415
|
-
|
|
8416
|
-
|
|
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
|
+
})
|
|
8417
8733
|
})
|
|
8418
8734
|
}));
|
|
8419
8735
|
case 5:
|
|
@@ -8555,6 +8871,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8555
8871
|
* Registers a derivative with license tokens. The derivative IP is registered with license tokens minted from the parent IP's license terms.
|
|
8556
8872
|
* The license terms of the parent IPs issued with license tokens are attached to the derivative IP.
|
|
8557
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
|
+
* ```
|
|
8558
8892
|
*/
|
|
8559
8893
|
)
|
|
8560
8894
|
}, {
|
|
@@ -8634,6 +8968,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8634
8968
|
/**
|
|
8635
8969
|
* Mint an NFT from a collection and register it as an IP.
|
|
8636
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
|
+
*
|
|
8637
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.
|
|
8638
8990
|
*/
|
|
8639
8991
|
)
|
|
@@ -8642,7 +8994,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8642
8994
|
value: (function () {
|
|
8643
8995
|
var _mintAndRegisterIpAssetWithPilTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(request) {
|
|
8644
8996
|
var _this3 = this;
|
|
8645
|
-
var _request$txOptions4,
|
|
8997
|
+
var _request$txOptions4, _yield$transformRegis, transformRequest, encodedTxData, contractCall, rsp, computedLicenseTermsIds, maxLicenseTokensTxHashes, _t0;
|
|
8646
8998
|
return _regenerator().w(function (_context7) {
|
|
8647
8999
|
while (1) switch (_context7.p = _context7.n) {
|
|
8648
9000
|
case 0:
|
|
@@ -8671,7 +9023,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8671
9023
|
};
|
|
8672
9024
|
_context7.n = 3;
|
|
8673
9025
|
return this.handleRegistrationWithFees({
|
|
8674
|
-
|
|
9026
|
+
options: request.options,
|
|
8675
9027
|
sender: this.walletAddress,
|
|
8676
9028
|
spgNftContract: transformRequest.spgNftContract,
|
|
8677
9029
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -8837,6 +9189,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8837
9189
|
/**
|
|
8838
9190
|
* Register a given NFT as an IP and attach Programmable IP License Terms.
|
|
8839
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
|
+
*
|
|
8840
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.
|
|
8841
9212
|
*/
|
|
8842
9213
|
)
|
|
@@ -8944,6 +9315,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8944
9315
|
/**
|
|
8945
9316
|
* Register the given NFT as a derivative IP with metadata without using license tokens.
|
|
8946
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
|
+
*
|
|
8947
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.
|
|
8948
9338
|
*/
|
|
8949
9339
|
)
|
|
@@ -8952,7 +9342,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8952
9342
|
value: (function () {
|
|
8953
9343
|
var _registerDerivativeIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(request) {
|
|
8954
9344
|
var _this4 = this;
|
|
8955
|
-
var _request$txOptions6, _request$
|
|
9345
|
+
var _request$txOptions6, _request$options2, tokenId, ipIdAddress, isRegistered, _yield$transformRegis3, _transformRequest2, encodedTxData, contractCall, _t12;
|
|
8956
9346
|
return _regenerator().w(function (_context0) {
|
|
8957
9347
|
while (1) switch (_context0.p = _context0.n) {
|
|
8958
9348
|
case 0:
|
|
@@ -9001,8 +9391,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9001
9391
|
return _this4.derivativeWorkflowsClient.registerIpAndMakeDerivative(_transformRequest2);
|
|
9002
9392
|
};
|
|
9003
9393
|
return _context0.a(2, this.handleRegistrationWithFees({
|
|
9004
|
-
|
|
9005
|
-
|
|
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
|
+
})
|
|
9006
9398
|
}),
|
|
9007
9399
|
sender: this.walletAddress,
|
|
9008
9400
|
spgSpenderAddress: this.derivativeWorkflowsClient.address,
|
|
@@ -9026,6 +9418,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9026
9418
|
/**
|
|
9027
9419
|
* Mint an NFT from a collection and register it as a derivative IP without license tokens.
|
|
9028
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
|
+
*
|
|
9029
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.
|
|
9030
9440
|
*/
|
|
9031
9441
|
)
|
|
@@ -9034,7 +9444,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9034
9444
|
value: (function () {
|
|
9035
9445
|
var _mintAndRegisterIpAndMakeDerivative = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(request) {
|
|
9036
9446
|
var _this5 = this;
|
|
9037
|
-
var _request$txOptions7,
|
|
9447
|
+
var _request$txOptions7, spgNftContract, _yield$transformRegis4, _transformRequest3, encodedTxData, contractCall, _t13;
|
|
9038
9448
|
return _regenerator().w(function (_context1) {
|
|
9039
9449
|
while (1) switch (_context1.p = _context1.n) {
|
|
9040
9450
|
case 0:
|
|
@@ -9063,7 +9473,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9063
9473
|
return _this5.derivativeWorkflowsClient.mintAndRegisterIpAndMakeDerivative(_transformRequest3);
|
|
9064
9474
|
};
|
|
9065
9475
|
return _context1.a(2, this.handleRegistrationWithFees({
|
|
9066
|
-
|
|
9476
|
+
options: request.options,
|
|
9067
9477
|
sender: this.walletAddress,
|
|
9068
9478
|
spgSpenderAddress: this.derivativeWorkflowsClient.address,
|
|
9069
9479
|
spgNftContract: spgNftContract,
|
|
@@ -9171,6 +9581,23 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9171
9581
|
/**
|
|
9172
9582
|
* Mint an NFT from a SPGNFT collection and register it with metadata as an IP.
|
|
9173
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
|
+
*
|
|
9174
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.
|
|
9175
9602
|
*/
|
|
9176
9603
|
)
|
|
@@ -9179,7 +9606,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9179
9606
|
value: (function () {
|
|
9180
9607
|
var _mintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(request) {
|
|
9181
9608
|
var _this6 = this;
|
|
9182
|
-
var _request$txOptions8, _request$
|
|
9609
|
+
var _request$txOptions8, _request$options3, _object, encodedTxData, contractCall, _t17;
|
|
9183
9610
|
return _regenerator().w(function (_context11) {
|
|
9184
9611
|
while (1) switch (_context11.p = _context11.n) {
|
|
9185
9612
|
case 0:
|
|
@@ -9209,8 +9636,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9209
9636
|
contractCall: contractCall,
|
|
9210
9637
|
spgNftContract: _object.spgNftContract,
|
|
9211
9638
|
txOptions: request.txOptions,
|
|
9212
|
-
|
|
9213
|
-
|
|
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
|
+
})
|
|
9214
9643
|
})
|
|
9215
9644
|
}));
|
|
9216
9645
|
case 2:
|
|
@@ -9246,7 +9675,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9246
9675
|
value: (function () {
|
|
9247
9676
|
var _batchMintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(request) {
|
|
9248
9677
|
var _this7 = this;
|
|
9249
|
-
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;
|
|
9250
9679
|
return _regenerator().w(function (_context14) {
|
|
9251
9680
|
while (1) switch (_context14.p = _context14.n) {
|
|
9252
9681
|
case 0:
|
|
@@ -9255,8 +9684,6 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9255
9684
|
publicMintSpenders = [];
|
|
9256
9685
|
privateMintEncodedTxs = [];
|
|
9257
9686
|
privateMintSpenders = [];
|
|
9258
|
-
publicMintFeesTotal = 0n;
|
|
9259
|
-
privateMintFeesTotal = 0n;
|
|
9260
9687
|
_iterator5 = _createForOfIteratorHelper(request.requests);
|
|
9261
9688
|
_context14.p = 1;
|
|
9262
9689
|
_iterator5.s();
|
|
@@ -9277,7 +9704,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9277
9704
|
case 3:
|
|
9278
9705
|
isPublicMinting = _context14.v;
|
|
9279
9706
|
_context14.n = 4;
|
|
9280
|
-
return
|
|
9707
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, registrationRequest.spgNftContract));
|
|
9281
9708
|
case 4:
|
|
9282
9709
|
nftMintFee = _context14.v;
|
|
9283
9710
|
encodeTx = {
|
|
@@ -9292,11 +9719,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9292
9719
|
_context14.n = 5;
|
|
9293
9720
|
break;
|
|
9294
9721
|
}
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
amount: nftMintFee
|
|
9299
|
-
}]);
|
|
9722
|
+
publicMintSpenders = mergeSpenders(publicMintSpenders, nftMintFee ? [_objectSpread2({
|
|
9723
|
+
address: registrationRequest.spgNftContract
|
|
9724
|
+
}, nftMintFee)] : []);
|
|
9300
9725
|
publicMintEncodedTxs.push(encodeTx);
|
|
9301
9726
|
_context14.n = 8;
|
|
9302
9727
|
break;
|
|
@@ -9311,11 +9736,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9311
9736
|
}
|
|
9312
9737
|
throw new Error("Caller ".concat(this.walletAddress, " does not have the minter role for ").concat(registrationRequest.spgNftContract));
|
|
9313
9738
|
case 7:
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
amount: nftMintFee
|
|
9318
|
-
}]);
|
|
9739
|
+
privateMintSpenders = mergeSpenders(privateMintSpenders, nftMintFee ? [_objectSpread2({
|
|
9740
|
+
address: registrationRequest.spgNftContract
|
|
9741
|
+
}, nftMintFee)] : []);
|
|
9319
9742
|
privateMintEncodedTxs.push(encodeTx);
|
|
9320
9743
|
case 8:
|
|
9321
9744
|
_context14.n = 2;
|
|
@@ -9339,9 +9762,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9339
9762
|
case 0:
|
|
9340
9763
|
_context12.n = 1;
|
|
9341
9764
|
return contractCallWithFees({
|
|
9342
|
-
totalFees: publicMintFeesTotal,
|
|
9343
9765
|
options: {
|
|
9344
|
-
wipOptions: request.wipOptions
|
|
9766
|
+
wipOptions: request.wipOptions,
|
|
9767
|
+
erc20Options: request.erc20Options
|
|
9345
9768
|
},
|
|
9346
9769
|
multicall3Address: _this7.multicall3Client.address,
|
|
9347
9770
|
rpcClient: _this7.rpcClient,
|
|
@@ -9374,11 +9797,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9374
9797
|
case 0:
|
|
9375
9798
|
_context13.n = 1;
|
|
9376
9799
|
return contractCallWithFees({
|
|
9377
|
-
totalFees: privateMintFeesTotal,
|
|
9378
9800
|
options: {
|
|
9379
9801
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
9380
9802
|
useMulticallWhenPossible: false
|
|
9381
|
-
})
|
|
9803
|
+
}),
|
|
9804
|
+
erc20Options: request.erc20Options
|
|
9382
9805
|
},
|
|
9383
9806
|
multicall3Address: _this7.multicall3Client.address,
|
|
9384
9807
|
rpcClient: _this7.rpcClient,
|
|
@@ -9464,6 +9887,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9464
9887
|
* Mint an NFT from a collection and register it as a derivative IP using license tokens.
|
|
9465
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.
|
|
9466
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
|
+
*
|
|
9467
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.
|
|
9468
9909
|
*/
|
|
9469
9910
|
)
|
|
@@ -9472,7 +9913,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9472
9913
|
value: (function () {
|
|
9473
9914
|
var _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(request) {
|
|
9474
9915
|
var _this8 = this;
|
|
9475
|
-
var _request$txOptions9, _request$
|
|
9916
|
+
var _request$txOptions9, _request$options4, licenseTokenIds, _object2, encodedTxData, contractCall, _t22;
|
|
9476
9917
|
return _regenerator().w(function (_context16) {
|
|
9477
9918
|
while (1) switch (_context16.p = _context16.n) {
|
|
9478
9919
|
case 0:
|
|
@@ -9499,6 +9940,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9499
9940
|
encodedTxData: encodedTxData
|
|
9500
9941
|
});
|
|
9501
9942
|
case 2:
|
|
9943
|
+
_context16.n = 3;
|
|
9944
|
+
return this.approveLicenseTokensForDerivativeWorkflows(request.licenseTokenIds, request.autoApproveLicenseTokens);
|
|
9945
|
+
case 3:
|
|
9502
9946
|
contractCall = /*#__PURE__*/function () {
|
|
9503
9947
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
9504
9948
|
return _regenerator().w(function (_context15) {
|
|
@@ -9513,10 +9957,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9513
9957
|
};
|
|
9514
9958
|
}();
|
|
9515
9959
|
return _context16.a(2, this.handleRegistrationWithFees({
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
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
|
+
})
|
|
9520
9966
|
}),
|
|
9521
9967
|
sender: this.walletAddress,
|
|
9522
9968
|
spgNftContract: _object2.spgNftContract,
|
|
@@ -9525,12 +9971,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9525
9971
|
contractCall: contractCall,
|
|
9526
9972
|
txOptions: request.txOptions
|
|
9527
9973
|
}));
|
|
9528
|
-
case
|
|
9529
|
-
_context16.p =
|
|
9974
|
+
case 4:
|
|
9975
|
+
_context16.p = 4;
|
|
9530
9976
|
_t22 = _context16.v;
|
|
9531
9977
|
return _context16.a(2, handleError(_t22, "Failed to mint and register IP and make derivative with license tokens"));
|
|
9532
9978
|
}
|
|
9533
|
-
}, _callee16, this, [[0,
|
|
9979
|
+
}, _callee16, this, [[0, 4]]);
|
|
9534
9980
|
}));
|
|
9535
9981
|
function mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_x14) {
|
|
9536
9982
|
return _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
|
@@ -9540,6 +9986,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9540
9986
|
/**
|
|
9541
9987
|
* Register the given NFT as a derivative IP using license tokens.
|
|
9542
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
|
+
*
|
|
9543
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.
|
|
9544
10009
|
*/
|
|
9545
10010
|
)
|
|
@@ -9591,6 +10056,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9591
10056
|
});
|
|
9592
10057
|
case 6:
|
|
9593
10058
|
signature = _context17.v;
|
|
10059
|
+
_context17.n = 7;
|
|
10060
|
+
return this.approveLicenseTokensForDerivativeWorkflows(licenseTokenIds, request.autoApproveLicenseTokens);
|
|
10061
|
+
case 7:
|
|
9594
10062
|
_object3 = _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9595
10063
|
tokenId: tokenId,
|
|
9596
10064
|
licenseTokenIds: licenseTokenIds,
|
|
@@ -9604,38 +10072,38 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9604
10072
|
maxRts: validateMaxRts(request.maxRts)
|
|
9605
10073
|
});
|
|
9606
10074
|
if (!((_request$txOptions0 = request.txOptions) !== null && _request$txOptions0 !== void 0 && _request$txOptions0.encodedTxDataOnly)) {
|
|
9607
|
-
_context17.n =
|
|
10075
|
+
_context17.n = 8;
|
|
9608
10076
|
break;
|
|
9609
10077
|
}
|
|
9610
10078
|
return _context17.a(2, {
|
|
9611
10079
|
encodedTxData: this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokensEncode(_object3)
|
|
9612
10080
|
});
|
|
9613
|
-
case 7:
|
|
9614
|
-
_context17.n = 8;
|
|
9615
|
-
return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
|
|
9616
10081
|
case 8:
|
|
9617
|
-
txHash = _context17.v;
|
|
9618
10082
|
_context17.n = 9;
|
|
10083
|
+
return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
|
|
10084
|
+
case 9:
|
|
10085
|
+
txHash = _context17.v;
|
|
10086
|
+
_context17.n = 10;
|
|
9619
10087
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
|
9620
10088
|
hash: txHash
|
|
9621
10089
|
}));
|
|
9622
|
-
case
|
|
10090
|
+
case 10:
|
|
9623
10091
|
receipt = _context17.v;
|
|
9624
10092
|
log = this.getIpIdAndTokenIdsFromEvent(receipt)[0];
|
|
9625
10093
|
return _context17.a(2, _objectSpread2({
|
|
9626
10094
|
txHash: txHash
|
|
9627
10095
|
}, log));
|
|
9628
|
-
case 10:
|
|
9629
|
-
_context17.n = 12;
|
|
9630
|
-
break;
|
|
9631
10096
|
case 11:
|
|
9632
|
-
_context17.
|
|
10097
|
+
_context17.n = 13;
|
|
10098
|
+
break;
|
|
10099
|
+
case 12:
|
|
10100
|
+
_context17.p = 12;
|
|
9633
10101
|
_t23 = _context17.v;
|
|
9634
10102
|
return _context17.a(2, handleError(_t23, "Failed to register IP and make derivative with license tokens"));
|
|
9635
|
-
case
|
|
10103
|
+
case 13:
|
|
9636
10104
|
return _context17.a(2);
|
|
9637
10105
|
}
|
|
9638
|
-
}, _callee17, this, [[0,
|
|
10106
|
+
}, _callee17, this, [[0, 12]]);
|
|
9639
10107
|
}));
|
|
9640
10108
|
function registerIpAndMakeDerivativeWithLicenseTokens(_x15) {
|
|
9641
10109
|
return _registerIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
|
@@ -9647,6 +10115,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9647
10115
|
* tokens. In order to successfully distribute royalty tokens, the first
|
|
9648
10116
|
* license terms attached to the IP must be a commercial license.
|
|
9649
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
|
+
*
|
|
9650
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.
|
|
9651
10140
|
*/
|
|
9652
10141
|
)
|
|
@@ -9766,6 +10255,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9766
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
|
|
9767
10256
|
* a commercial license.
|
|
9768
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
|
+
*
|
|
9769
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.
|
|
9770
10280
|
*/
|
|
9771
10281
|
)
|
|
@@ -9774,7 +10284,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9774
10284
|
value: (function () {
|
|
9775
10285
|
var _registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(request) {
|
|
9776
10286
|
var _this9 = this;
|
|
9777
|
-
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;
|
|
9778
10288
|
return _regenerator().w(function (_context19) {
|
|
9779
10289
|
while (1) switch (_context19.p = _context19.n) {
|
|
9780
10290
|
case 0:
|
|
@@ -9816,8 +10326,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9816
10326
|
};
|
|
9817
10327
|
_context19.n = 5;
|
|
9818
10328
|
return this.handleRegistrationWithFees({
|
|
9819
|
-
|
|
9820
|
-
|
|
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
|
+
})
|
|
9821
10333
|
}),
|
|
9822
10334
|
sender: this.walletAddress,
|
|
9823
10335
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -9879,6 +10391,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9879
10391
|
/**
|
|
9880
10392
|
* Mint an NFT and register the IP, attach PIL terms, and distribute royalty tokens.
|
|
9881
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
|
+
*
|
|
9882
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.
|
|
9883
10415
|
*/
|
|
9884
10416
|
)
|
|
@@ -9887,7 +10419,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9887
10419
|
value: (function () {
|
|
9888
10420
|
var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(request) {
|
|
9889
10421
|
var _this0 = this;
|
|
9890
|
-
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;
|
|
9891
10423
|
return _regenerator().w(function (_context20) {
|
|
9892
10424
|
while (1) switch (_context20.p = _context20.n) {
|
|
9893
10425
|
case 0:
|
|
@@ -9913,7 +10445,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9913
10445
|
};
|
|
9914
10446
|
_context20.n = 3;
|
|
9915
10447
|
return this.handleRegistrationWithFees({
|
|
9916
|
-
|
|
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
|
+
}),
|
|
9917
10453
|
sender: this.walletAddress,
|
|
9918
10454
|
spgNftContract: _transformRequest6.spgNftContract,
|
|
9919
10455
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -9974,6 +10510,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9974
10510
|
/**
|
|
9975
10511
|
* Mint an NFT and register the IP, make a derivative, and distribute royalty tokens.
|
|
9976
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
|
+
*
|
|
9977
10533
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9978
10534
|
*/
|
|
9979
10535
|
)
|
|
@@ -9982,7 +10538,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9982
10538
|
value: (function () {
|
|
9983
10539
|
var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(request) {
|
|
9984
10540
|
var _this1 = this;
|
|
9985
|
-
var
|
|
10541
|
+
var _yield$transformRegis8, _transformRequest7, encodedTxData, contractCall, _t27;
|
|
9986
10542
|
return _regenerator().w(function (_context21) {
|
|
9987
10543
|
while (1) switch (_context21.p = _context21.n) {
|
|
9988
10544
|
case 0:
|
|
@@ -10004,7 +10560,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10004
10560
|
_context21.n = 2;
|
|
10005
10561
|
return this.handleRegistrationWithFees({
|
|
10006
10562
|
spgNftContract: _transformRequest7.spgNftContract,
|
|
10007
|
-
|
|
10563
|
+
options: request.options,
|
|
10008
10564
|
sender: this.walletAddress,
|
|
10009
10565
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
10010
10566
|
derivData: _transformRequest7.derivData,
|
|
@@ -10106,7 +10662,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10106
10662
|
* The method supports automatic token handling for minting fees:
|
|
10107
10663
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10108
10664
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10109
|
-
* - 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.
|
|
10110
10666
|
*
|
|
10111
10667
|
* @remark Multicall selection logic:
|
|
10112
10668
|
*
|
|
@@ -10118,12 +10674,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10118
10674
|
*
|
|
10119
10675
|
* 2. For `register*` methods:
|
|
10120
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.
|
|
10121
10679
|
*/
|
|
10122
10680
|
}, {
|
|
10123
10681
|
key: "batchRegisterIpAssetsWithOptimizedWorkflows",
|
|
10124
10682
|
value: (function () {
|
|
10125
10683
|
var _batchRegisterIpAssetsWithOptimizedWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(request) {
|
|
10126
|
-
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;
|
|
10127
10685
|
return _regenerator().w(function (_context24) {
|
|
10128
10686
|
while (1) switch (_context24.p = _context24.n) {
|
|
10129
10687
|
case 0:
|
|
@@ -10187,7 +10745,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10187
10745
|
rpcClient: this.rpcClient,
|
|
10188
10746
|
wallet: this.wallet,
|
|
10189
10747
|
walletAddress: this.walletAddress,
|
|
10190
|
-
|
|
10748
|
+
options: request.options,
|
|
10191
10749
|
chainId: this.chainId
|
|
10192
10750
|
});
|
|
10193
10751
|
case 9:
|
|
@@ -10217,11 +10775,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10217
10775
|
chainId: this.chainId
|
|
10218
10776
|
});
|
|
10219
10777
|
case 12:
|
|
10220
|
-
|
|
10221
|
-
|
|
10778
|
+
_yield$prepareRoyalty = _context24.v;
|
|
10779
|
+
requests = _yield$prepareRoyalty.requests;
|
|
10780
|
+
ipRoyaltyVaults = _yield$prepareRoyalty.ipRoyaltyVaults;
|
|
10781
|
+
royaltyTokensDistributionRequests.push.apply(royaltyTokensDistributionRequests, _toConsumableArray(requests));
|
|
10222
10782
|
responses.push({
|
|
10223
10783
|
txHash: txHash,
|
|
10224
10784
|
receipt: receipt,
|
|
10785
|
+
ipRoyaltyVault: ipRoyaltyVaults,
|
|
10225
10786
|
ipAssetsWithLicenseTerms: iPRegisteredLog.map(function (log) {
|
|
10226
10787
|
return {
|
|
10227
10788
|
ipId: log.ipId,
|
|
@@ -10255,7 +10816,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10255
10816
|
rpcClient: this.rpcClient,
|
|
10256
10817
|
wallet: this.wallet,
|
|
10257
10818
|
walletAddress: this.walletAddress,
|
|
10258
|
-
|
|
10819
|
+
options: request.options,
|
|
10259
10820
|
chainId: this.chainId
|
|
10260
10821
|
});
|
|
10261
10822
|
case 18:
|
|
@@ -10266,7 +10827,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10266
10827
|
});
|
|
10267
10828
|
case 19:
|
|
10268
10829
|
_context24.n = 20;
|
|
10269
|
-
return this.
|
|
10830
|
+
return this.populateLicenseAndTokenIdsForRegistrationResults(responses, aggregateRegistrationRequest);
|
|
10270
10831
|
case 20:
|
|
10271
10832
|
registrationResults = _context24.v;
|
|
10272
10833
|
return _context24.a(2, _objectSpread2({
|
|
@@ -10341,7 +10902,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10341
10902
|
* **Automatic Token Handling:**
|
|
10342
10903
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10343
10904
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10344
|
-
* - 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.
|
|
10345
10906
|
*
|
|
10346
10907
|
* @throws {Error} If the NFT type is invalid.
|
|
10347
10908
|
* @throws {Error} If `licenseTermsData` is not provided when `royaltyShares` are specified.
|
|
@@ -10454,7 +11015,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10454
11015
|
* **Automatic Token Handling:**
|
|
10455
11016
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10456
11017
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10457
|
-
* - 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.
|
|
10458
11019
|
*
|
|
10459
11020
|
* @throws {Error} If `derivData` is not provided when `royaltyShares` are provided.
|
|
10460
11021
|
* @throws {Error} If neither `derivData` nor `licenseTokenIds` are provided.
|
|
@@ -10567,7 +11128,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10567
11128
|
case 2:
|
|
10568
11129
|
return _context27.a(2, this.registerIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
|
|
10569
11130
|
licenseTokenIds: licenseTokenIds,
|
|
10570
|
-
maxRts: maxRts
|
|
11131
|
+
maxRts: maxRts,
|
|
11132
|
+
autoApproveLicenseTokens: request.autoApproveLicenseTokens
|
|
10571
11133
|
})));
|
|
10572
11134
|
}
|
|
10573
11135
|
}, _callee27, this);
|
|
@@ -10622,7 +11184,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10622
11184
|
case 2:
|
|
10623
11185
|
return _context28.a(2, this.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
|
|
10624
11186
|
licenseTokenIds: licenseTokenIds,
|
|
10625
|
-
maxRts: maxRts
|
|
11187
|
+
maxRts: maxRts,
|
|
11188
|
+
autoApproveLicenseTokens: request.autoApproveLicenseTokens
|
|
10626
11189
|
})));
|
|
10627
11190
|
}
|
|
10628
11191
|
}, _callee28, this);
|
|
@@ -10659,7 +11222,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10659
11222
|
* **Automatic Token Handling:**
|
|
10660
11223
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10661
11224
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10662
|
-
* - 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.
|
|
10663
11226
|
*/
|
|
10664
11227
|
)
|
|
10665
11228
|
}, {
|
|
@@ -10928,20 +11491,20 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10928
11491
|
value: function () {
|
|
10929
11492
|
var _handleRegistrationWithFees = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(_ref5) {
|
|
10930
11493
|
var _wipOptions$useMultic, _this$getIpIdAndToken, _event$ipId, _event$tokenId;
|
|
10931
|
-
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;
|
|
10932
11495
|
return _regenerator().w(function (_context34) {
|
|
10933
11496
|
while (1) switch (_context34.n) {
|
|
10934
11497
|
case 0:
|
|
10935
|
-
sender = _ref5.sender, derivData = _ref5.derivData, spgNftContract = _ref5.spgNftContract, spgSpenderAddress = _ref5.spgSpenderAddress, txOptions = _ref5.txOptions,
|
|
10936
|
-
|
|
10937
|
-
|
|
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;
|
|
10938
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
|
|
10939
11502
|
if (!spgNftContract) {
|
|
10940
11503
|
_context34.n = 3;
|
|
10941
11504
|
break;
|
|
10942
11505
|
}
|
|
10943
11506
|
_context34.n = 1;
|
|
10944
|
-
return
|
|
11507
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, spgNftContract));
|
|
10945
11508
|
case 1:
|
|
10946
11509
|
nftMintFee = _context34.v;
|
|
10947
11510
|
_context34.n = 2;
|
|
@@ -10959,11 +11522,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10959
11522
|
if (!publicMinting) {
|
|
10960
11523
|
useMulticallWhenPossible = false;
|
|
10961
11524
|
}
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
amount: nftMintFee
|
|
10966
|
-
});
|
|
11525
|
+
tokenSpenders.push.apply(tokenSpenders, _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
11526
|
+
address: spgNftContract
|
|
11527
|
+
}, nftMintFee)] : []));
|
|
10967
11528
|
case 3:
|
|
10968
11529
|
if (!derivData) {
|
|
10969
11530
|
_context34.n = 5;
|
|
@@ -10978,39 +11539,38 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10978
11539
|
sender: sender
|
|
10979
11540
|
});
|
|
10980
11541
|
case 4:
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
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();
|
|
10988
11555
|
}
|
|
10989
11556
|
case 5:
|
|
10990
|
-
|
|
10991
|
-
_context34.n = 6;
|
|
10992
|
-
break;
|
|
10993
|
-
}
|
|
10994
|
-
throw new Error("Total fees for registering derivative should never be negative: ".concat(totalFees));
|
|
10995
|
-
case 6:
|
|
10996
|
-
_context34.n = 7;
|
|
11557
|
+
_context34.n = 6;
|
|
10997
11558
|
return contractCallWithFees({
|
|
10998
|
-
|
|
10999
|
-
options: {
|
|
11559
|
+
options: _objectSpread2(_objectSpread2({}, options), {}, {
|
|
11000
11560
|
wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
|
|
11001
11561
|
useMulticallWhenPossible: useMulticallWhenPossible
|
|
11002
11562
|
})
|
|
11003
|
-
},
|
|
11563
|
+
}),
|
|
11004
11564
|
multicall3Address: this.multicall3Client.address,
|
|
11005
11565
|
rpcClient: this.rpcClient,
|
|
11006
|
-
tokenSpenders:
|
|
11566
|
+
tokenSpenders: tokenSpenders,
|
|
11007
11567
|
contractCall: contractCall,
|
|
11008
11568
|
sender: sender,
|
|
11009
11569
|
wallet: this.wallet,
|
|
11010
11570
|
txOptions: txOptions,
|
|
11011
11571
|
encodedTxs: encodedTxs
|
|
11012
11572
|
});
|
|
11013
|
-
case
|
|
11573
|
+
case 6:
|
|
11014
11574
|
_yield$contractCallWi = _context34.v;
|
|
11015
11575
|
txHash = _yield$contractCallWi.txHash;
|
|
11016
11576
|
receipt = _yield$contractCallWi.receipt;
|
|
@@ -11034,43 +11594,50 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11034
11594
|
* Process the `LicenseTermsIds` and `maxLicenseTokensTxHashes` for each IP asset.
|
|
11035
11595
|
*/
|
|
11036
11596
|
}, {
|
|
11037
|
-
key: "
|
|
11597
|
+
key: "populateLicenseAndTokenIdsForRegistrationResults",
|
|
11038
11598
|
value: (function () {
|
|
11039
|
-
var
|
|
11040
|
-
var
|
|
11599
|
+
var _populateLicenseAndTokenIdsForRegistrationResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(registrationResults, aggregateRegistrationRequest) {
|
|
11600
|
+
var allExtraDataArrays, allExtraData, extraDataFlatIndex, _iterator1, _step1, registrationResult, i, ipAsset, _t36;
|
|
11041
11601
|
return _regenerator().w(function (_context35) {
|
|
11042
11602
|
while (1) switch (_context35.p = _context35.n) {
|
|
11043
11603
|
case 0:
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
}
|
|
11048
|
-
|
|
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);
|
|
11049
11611
|
_context35.p = 1;
|
|
11050
|
-
_iterator0.s();
|
|
11051
|
-
case 2:
|
|
11052
|
-
if ((_step0 = _iterator0.n()).done) {
|
|
11053
|
-
_context35.n = 11;
|
|
11054
|
-
break;
|
|
11055
|
-
}
|
|
11056
|
-
_step0$value = _slicedToArray(_step0.value, 2), responseIndex = _step0$value[0], response = _step0$value[1];
|
|
11057
|
-
_iterator1 = _createForOfIteratorHelper(response.ipAssetsWithLicenseTerms.entries());
|
|
11058
|
-
_context35.p = 3;
|
|
11059
11612
|
_iterator1.s();
|
|
11060
|
-
case
|
|
11613
|
+
case 2:
|
|
11061
11614
|
if ((_step1 = _iterator1.n()).done) {
|
|
11062
11615
|
_context35.n = 7;
|
|
11063
11616
|
break;
|
|
11064
11617
|
}
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
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;
|
|
11069
11635
|
case 5:
|
|
11070
|
-
|
|
11071
|
-
|
|
11636
|
+
i++;
|
|
11637
|
+
_context35.n = 3;
|
|
11638
|
+
break;
|
|
11072
11639
|
case 6:
|
|
11073
|
-
_context35.n =
|
|
11640
|
+
_context35.n = 2;
|
|
11074
11641
|
break;
|
|
11075
11642
|
case 7:
|
|
11076
11643
|
_context35.n = 9;
|
|
@@ -11084,54 +11651,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11084
11651
|
_iterator1.f();
|
|
11085
11652
|
return _context35.f(9);
|
|
11086
11653
|
case 10:
|
|
11087
|
-
_context35.
|
|
11088
|
-
break;
|
|
11089
|
-
case 11:
|
|
11090
|
-
_context35.n = 13;
|
|
11091
|
-
break;
|
|
11092
|
-
case 12:
|
|
11093
|
-
_context35.p = 12;
|
|
11094
|
-
_t37 = _context35.v;
|
|
11095
|
-
_iterator0.e(_t37);
|
|
11096
|
-
case 13:
|
|
11097
|
-
_context35.p = 13;
|
|
11098
|
-
_iterator0.f();
|
|
11099
|
-
return _context35.f(13);
|
|
11100
|
-
case 14:
|
|
11101
|
-
_context35.n = 19;
|
|
11102
|
-
break;
|
|
11103
|
-
case 15:
|
|
11104
|
-
_extraData = [];
|
|
11105
|
-
Object.values(aggregateRegistrationRequest).map(function (item) {
|
|
11106
|
-
var _item$extraData;
|
|
11107
|
-
_extraData.push.apply(_extraData, _toConsumableArray((_item$extraData = item.extraData) !== null && _item$extraData !== void 0 ? _item$extraData : undefined));
|
|
11108
|
-
});
|
|
11109
|
-
i = 0;
|
|
11110
|
-
case 16:
|
|
11111
|
-
if (!(i < responses.length)) {
|
|
11112
|
-
_context35.n = 19;
|
|
11113
|
-
break;
|
|
11114
|
-
}
|
|
11115
|
-
_response = responses[i];
|
|
11116
|
-
extraDataItem = _extraData[i];
|
|
11117
|
-
_context35.n = 17;
|
|
11118
|
-
return this.processIpAssetLicenseTerms(_response.ipAssetsWithLicenseTerms[0], extraDataItem);
|
|
11119
|
-
case 17:
|
|
11120
|
-
_ipAsset = _context35.v;
|
|
11121
|
-
responses[i].ipAssetsWithLicenseTerms[0] = _ipAsset;
|
|
11122
|
-
case 18:
|
|
11123
|
-
i++;
|
|
11124
|
-
_context35.n = 16;
|
|
11125
|
-
break;
|
|
11126
|
-
case 19:
|
|
11127
|
-
return _context35.a(2, responses);
|
|
11654
|
+
return _context35.a(2, registrationResults);
|
|
11128
11655
|
}
|
|
11129
|
-
}, _callee35, this, [[
|
|
11656
|
+
}, _callee35, this, [[1, 8, 9, 10]]);
|
|
11130
11657
|
}));
|
|
11131
|
-
function
|
|
11132
|
-
return
|
|
11658
|
+
function populateLicenseAndTokenIdsForRegistrationResults(_x33, _x34) {
|
|
11659
|
+
return _populateLicenseAndTokenIdsForRegistrationResults.apply(this, arguments);
|
|
11133
11660
|
}
|
|
11134
|
-
return
|
|
11661
|
+
return populateLicenseAndTokenIdsForRegistrationResults;
|
|
11135
11662
|
}())
|
|
11136
11663
|
}, {
|
|
11137
11664
|
key: "processIpAssetLicenseTerms",
|
|
@@ -11186,11 +11713,65 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11186
11713
|
}
|
|
11187
11714
|
}, _callee36, this);
|
|
11188
11715
|
}));
|
|
11189
|
-
function processIpAssetLicenseTerms(
|
|
11716
|
+
function processIpAssetLicenseTerms(_x35, _x36) {
|
|
11190
11717
|
return _processIpAssetLicenseTerms.apply(this, arguments);
|
|
11191
11718
|
}
|
|
11192
11719
|
return processIpAssetLicenseTerms;
|
|
11193
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
|
+
}()
|
|
11194
11775
|
}]);
|
|
11195
11776
|
}();
|
|
11196
11777
|
|
|
@@ -11362,7 +11943,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11362
11943
|
value: (function () {
|
|
11363
11944
|
var _mintLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
|
11364
11945
|
var _this = this;
|
|
11365
|
-
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;
|
|
11366
11947
|
return _regenerator().w(function (_context3) {
|
|
11367
11948
|
while (1) switch (_context3.p = _context3.n) {
|
|
11368
11949
|
case 0:
|
|
@@ -11441,7 +12022,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11441
12022
|
});
|
|
11442
12023
|
case 9:
|
|
11443
12024
|
_context3.n = 10;
|
|
11444
|
-
return
|
|
12025
|
+
return calculateLicenseMintFee({
|
|
11445
12026
|
predictMintingFeeRequest: req,
|
|
11446
12027
|
rpcClient: this.rpcClient,
|
|
11447
12028
|
chainId: this.chainId,
|
|
@@ -11450,18 +12031,14 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11450
12031
|
case 10:
|
|
11451
12032
|
licenseMintingFee = _context3.v;
|
|
11452
12033
|
wipSpenders = [];
|
|
11453
|
-
if (licenseMintingFee > 0n) {
|
|
11454
|
-
wipSpenders.push({
|
|
11455
|
-
address: royaltyModuleAddress[this.chainId]
|
|
11456
|
-
|
|
11457
|
-
});
|
|
12034
|
+
if (licenseMintingFee.amount > 0n) {
|
|
12035
|
+
wipSpenders.push(_objectSpread2({
|
|
12036
|
+
address: royaltyModuleAddress[this.chainId]
|
|
12037
|
+
}, licenseMintingFee));
|
|
11458
12038
|
}
|
|
11459
12039
|
_context3.n = 11;
|
|
11460
12040
|
return contractCallWithFees({
|
|
11461
|
-
|
|
11462
|
-
options: {
|
|
11463
|
-
wipOptions: (_request$options = request.options) === null || _request$options === void 0 ? void 0 : _request$options.wipOptions
|
|
11464
|
-
},
|
|
12041
|
+
options: request.options,
|
|
11465
12042
|
multicall3Address: this.multicall3Client.address,
|
|
11466
12043
|
rpcClient: this.rpcClient,
|
|
11467
12044
|
tokenSpenders: wipSpenders,
|
|
@@ -13231,12 +13808,12 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
|
13231
13808
|
value: (function () {
|
|
13232
13809
|
var _payRoyaltyOnBehalf = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
|
13233
13810
|
var _this2 = this;
|
|
13234
|
-
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;
|
|
13235
13812
|
return _regenerator().w(function (_context4) {
|
|
13236
13813
|
while (1) switch (_context4.p = _context4.n) {
|
|
13237
13814
|
case 0:
|
|
13238
13815
|
_context4.p = 0;
|
|
13239
|
-
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;
|
|
13240
13817
|
sender = this.wallet.account.address;
|
|
13241
13818
|
payAmount = BigInt(amount);
|
|
13242
13819
|
if (!(payAmount <= 0n)) {
|
|
@@ -13293,21 +13870,17 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
|
13293
13870
|
};
|
|
13294
13871
|
tokenSpenders = [{
|
|
13295
13872
|
address: this.royaltyModuleClient.address,
|
|
13296
|
-
amount: payAmount
|
|
13873
|
+
amount: payAmount,
|
|
13874
|
+
token: token
|
|
13297
13875
|
}];
|
|
13298
13876
|
_context4.n = 7;
|
|
13299
13877
|
return contractCallWithFees({
|
|
13300
|
-
|
|
13301
|
-
options: {
|
|
13302
|
-
erc20Options: erc20Options,
|
|
13303
|
-
wipOptions: wipOptions
|
|
13304
|
-
},
|
|
13878
|
+
options: options,
|
|
13305
13879
|
multicall3Address: this.multicall3Client.address,
|
|
13306
13880
|
rpcClient: this.rpcClient,
|
|
13307
13881
|
tokenSpenders: tokenSpenders,
|
|
13308
13882
|
contractCall: contractCall,
|
|
13309
13883
|
sender: sender,
|
|
13310
|
-
token: token,
|
|
13311
13884
|
wallet: this.wallet,
|
|
13312
13885
|
txOptions: txOptions,
|
|
13313
13886
|
encodedTxs: [encodedTxData]
|