@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
|
@@ -1773,13 +1773,30 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1773
1773
|
*
|
|
1774
1774
|
* @param tokenId uint256
|
|
1775
1775
|
*//**
|
|
1776
|
+
* LicenseTokenApproveRequest
|
|
1777
|
+
*
|
|
1778
|
+
* @param to address
|
|
1779
|
+
* @param tokenId uint256
|
|
1780
|
+
*//**
|
|
1776
1781
|
* contract LicenseToken readonly method
|
|
1777
1782
|
*/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;}/**
|
|
1778
1783
|
* method ownerOf for contract LicenseToken
|
|
1779
1784
|
*
|
|
1780
1785
|
* @param request LicenseTokenOwnerOfRequest
|
|
1781
1786
|
* @return Promise<LicenseTokenOwnerOfResponse>
|
|
1782
|
-
*/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;}())}]);}()
|
|
1787
|
+
*/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;}())}]);}();/**
|
|
1788
|
+
* contract LicenseToken write method
|
|
1789
|
+
*/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;}/**
|
|
1790
|
+
* method approve for contract LicenseToken
|
|
1791
|
+
*
|
|
1792
|
+
* @param request LicenseTokenApproveRequest
|
|
1793
|
+
* @return Promise<WriteContractReturnType>
|
|
1794
|
+
*/_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;}()/**
|
|
1795
|
+
* method approve for contract LicenseToken with only encode
|
|
1796
|
+
*
|
|
1797
|
+
* @param request LicenseTokenApproveRequest
|
|
1798
|
+
* @return EncodedTxData
|
|
1799
|
+
*/)},{key:"approveEncode",value:function approveEncode(request){return {to:this.address,data:viem.encodeFunctionData({abi:licenseTokenAbi,functionName:"approve",args:[request.to,request.tokenId]})};}}]);}(LicenseTokenReadOnlyClient);// Contract LicensingModule =============================================================
|
|
1783
1800
|
/**
|
|
1784
1801
|
* LicensingModuleLicenseTermsAttachedEvent
|
|
1785
1802
|
*
|
|
@@ -1870,14 +1887,14 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1870
1887
|
*
|
|
1871
1888
|
* @param request LicensingModulePredictMintingLicenseFeeRequest
|
|
1872
1889
|
* @return Promise<LicensingModulePredictMintingLicenseFeeResponse>
|
|
1873
|
-
*/_inherits(LicensingModuleReadOnlyClient,_LicensingModuleEvent);return _createClass(LicensingModuleReadOnlyClient,[{key:"predictMintingLicenseFee",value:(function(){var _predictMintingLicenseFee=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1890
|
+
*/_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);/**
|
|
1874
1891
|
* contract LicensingModule write method
|
|
1875
|
-
*/var LicensingModuleClient=/*#__PURE__*/function(_LicensingModuleReadO){function LicensingModuleClient(rpcClient,wallet,address){var
|
|
1892
|
+
*/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;}/**
|
|
1876
1893
|
* method attachLicenseTerms for contract LicensingModule
|
|
1877
1894
|
*
|
|
1878
1895
|
* @param request LicensingModuleAttachLicenseTermsRequest
|
|
1879
1896
|
* @return Promise<WriteContractReturnType>
|
|
1880
|
-
*/_inherits(LicensingModuleClient,_LicensingModuleReadO);return _createClass(LicensingModuleClient,[{key:"attachLicenseTerms",value:(function(){var _attachLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1897
|
+
*/_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;}()/**
|
|
1881
1898
|
* method attachLicenseTerms for contract LicensingModule with only encode
|
|
1882
1899
|
*
|
|
1883
1900
|
* @param request LicensingModuleAttachLicenseTermsRequest
|
|
@@ -1887,7 +1904,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1887
1904
|
*
|
|
1888
1905
|
* @param request LicensingModuleMintLicenseTokensRequest
|
|
1889
1906
|
* @return Promise<WriteContractReturnType>
|
|
1890
|
-
*/},{key:"mintLicenseTokens",value:(function(){var _mintLicenseTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1907
|
+
*/},{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;}()/**
|
|
1891
1908
|
* method mintLicenseTokens for contract LicensingModule with only encode
|
|
1892
1909
|
*
|
|
1893
1910
|
* @param request LicensingModuleMintLicenseTokensRequest
|
|
@@ -1897,7 +1914,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1897
1914
|
*
|
|
1898
1915
|
* @param request LicensingModuleRegisterDerivativeRequest
|
|
1899
1916
|
* @return Promise<WriteContractReturnType>
|
|
1900
|
-
*/},{key:"registerDerivative",value:(function(){var _registerDerivative=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1917
|
+
*/},{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;}()/**
|
|
1901
1918
|
* method registerDerivative for contract LicensingModule with only encode
|
|
1902
1919
|
*
|
|
1903
1920
|
* @param request LicensingModuleRegisterDerivativeRequest
|
|
@@ -1907,7 +1924,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1907
1924
|
*
|
|
1908
1925
|
* @param request LicensingModuleRegisterDerivativeWithLicenseTokensRequest
|
|
1909
1926
|
* @return Promise<WriteContractReturnType>
|
|
1910
|
-
*/},{key:"registerDerivativeWithLicenseTokens",value:(function(){var _registerDerivativeWithLicenseTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1927
|
+
*/},{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;}()/**
|
|
1911
1928
|
* method registerDerivativeWithLicenseTokens for contract LicensingModule with only encode
|
|
1912
1929
|
*
|
|
1913
1930
|
* @param request LicensingModuleRegisterDerivativeWithLicenseTokensRequest
|
|
@@ -1917,7 +1934,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1917
1934
|
*
|
|
1918
1935
|
* @param request LicensingModuleSetLicensingConfigRequest
|
|
1919
1936
|
* @return Promise<WriteContractReturnType>
|
|
1920
|
-
*/},{key:"setLicensingConfig",value:(function(){var _setLicensingConfig=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1937
|
+
*/},{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;}()/**
|
|
1921
1938
|
* method setLicensingConfig for contract LicensingModule with only encode
|
|
1922
1939
|
*
|
|
1923
1940
|
* @param request LicensingModuleSetLicensingConfigRequest
|
|
@@ -1934,7 +1951,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1934
1951
|
*
|
|
1935
1952
|
* @param request ModuleRegistryIsRegisteredRequest
|
|
1936
1953
|
* @return Promise<ModuleRegistryIsRegisteredResponse>
|
|
1937
|
-
*/return _createClass(ModuleRegistryReadOnlyClient,[{key:"isRegistered",value:(function(){var _isRegistered2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1954
|
+
*/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 =============================================================
|
|
1938
1955
|
/**
|
|
1939
1956
|
* Multicall3Aggregate3Request
|
|
1940
1957
|
*
|
|
@@ -1946,7 +1963,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
1946
1963
|
*
|
|
1947
1964
|
* @param request Multicall3Aggregate3Request
|
|
1948
1965
|
* @return Promise<WriteContractReturnType>
|
|
1949
|
-
*/return _createClass(Multicall3Client,[{key:"aggregate3",value:(function(){var _aggregate=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1966
|
+
*/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;}()/**
|
|
1950
1967
|
* method aggregate3 for contract Multicall3 with only encode
|
|
1951
1968
|
*
|
|
1952
1969
|
* @param request Multicall3Aggregate3Request
|
|
@@ -2133,149 +2150,149 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2133
2150
|
*
|
|
2134
2151
|
* @param request PiLicenseTemplateAccessControllerRequest
|
|
2135
2152
|
* @return Promise<PiLicenseTemplateAccessControllerResponse>
|
|
2136
|
-
*/_inherits(PiLicenseTemplateReadOnlyClient,_PiLicenseTemplateEve);return _createClass(PiLicenseTemplateReadOnlyClient,[{key:"accessController",value:(function(){var _accessController2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2153
|
+
*/_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;}()/**
|
|
2137
2154
|
* method IP_ASSET_REGISTRY for contract PILicenseTemplate
|
|
2138
2155
|
*
|
|
2139
2156
|
* @param request PiLicenseTemplateIpAssetRegistryRequest
|
|
2140
2157
|
* @return Promise<PiLicenseTemplateIpAssetRegistryResponse>
|
|
2141
|
-
*/)},{key:"ipAssetRegistry",value:(function(){var _ipAssetRegistry2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2158
|
+
*/)},{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;}()/**
|
|
2142
2159
|
* method LICENSE_REGISTRY for contract PILicenseTemplate
|
|
2143
2160
|
*
|
|
2144
2161
|
* @param request PiLicenseTemplateLicenseRegistryRequest
|
|
2145
2162
|
* @return Promise<PiLicenseTemplateLicenseRegistryResponse>
|
|
2146
|
-
*/)},{key:"licenseRegistry",value:(function(){var _licenseRegistry=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2163
|
+
*/)},{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;}()/**
|
|
2147
2164
|
* method MODULE_REGISTRY for contract PILicenseTemplate
|
|
2148
2165
|
*
|
|
2149
2166
|
* @param request PiLicenseTemplateModuleRegistryRequest
|
|
2150
2167
|
* @return Promise<PiLicenseTemplateModuleRegistryResponse>
|
|
2151
|
-
*/)},{key:"moduleRegistry",value:(function(){var _moduleRegistry=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2168
|
+
*/)},{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;}()/**
|
|
2152
2169
|
* method ROYALTY_MODULE for contract PILicenseTemplate
|
|
2153
2170
|
*
|
|
2154
2171
|
* @param request PiLicenseTemplateRoyaltyModuleRequest
|
|
2155
2172
|
* @return Promise<PiLicenseTemplateRoyaltyModuleResponse>
|
|
2156
|
-
*/)},{key:"royaltyModule",value:(function(){var _royaltyModule2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2173
|
+
*/)},{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;}()/**
|
|
2157
2174
|
* method TERMS_RENDERER for contract PILicenseTemplate
|
|
2158
2175
|
*
|
|
2159
2176
|
* @param request PiLicenseTemplateTermsRendererRequest
|
|
2160
2177
|
* @return Promise<PiLicenseTemplateTermsRendererResponse>
|
|
2161
|
-
*/)},{key:"termsRenderer",value:(function(){var _termsRenderer=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2178
|
+
*/)},{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;}()/**
|
|
2162
2179
|
* method UPGRADE_INTERFACE_VERSION for contract PILicenseTemplate
|
|
2163
2180
|
*
|
|
2164
2181
|
* @param request PiLicenseTemplateUpgradeInterfaceVersionRequest
|
|
2165
2182
|
* @return Promise<PiLicenseTemplateUpgradeInterfaceVersionResponse>
|
|
2166
|
-
*/)},{key:"upgradeInterfaceVersion",value:(function(){var _upgradeInterfaceVersion3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2183
|
+
*/)},{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;}()/**
|
|
2167
2184
|
* method allowDerivativeRegistration for contract PILicenseTemplate
|
|
2168
2185
|
*
|
|
2169
2186
|
* @param request PiLicenseTemplateAllowDerivativeRegistrationRequest
|
|
2170
2187
|
* @return Promise<PiLicenseTemplateAllowDerivativeRegistrationResponse>
|
|
2171
|
-
*/)},{key:"allowDerivativeRegistration",value:(function(){var _allowDerivativeRegistration=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2188
|
+
*/)},{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;}()/**
|
|
2172
2189
|
* method authority for contract PILicenseTemplate
|
|
2173
2190
|
*
|
|
2174
2191
|
* @param request PiLicenseTemplateAuthorityRequest
|
|
2175
2192
|
* @return Promise<PiLicenseTemplateAuthorityResponse>
|
|
2176
|
-
*/)},{key:"authority",value:(function(){var _authority3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2193
|
+
*/)},{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;}()/**
|
|
2177
2194
|
* method canAttachToGroupIp for contract PILicenseTemplate
|
|
2178
2195
|
*
|
|
2179
2196
|
* @param request PiLicenseTemplateCanAttachToGroupIpRequest
|
|
2180
2197
|
* @return Promise<PiLicenseTemplateCanAttachToGroupIpResponse>
|
|
2181
|
-
*/)},{key:"canAttachToGroupIp",value:(function(){var _canAttachToGroupIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2198
|
+
*/)},{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;}()/**
|
|
2182
2199
|
* method canOverrideRoyaltyPercent for contract PILicenseTemplate
|
|
2183
2200
|
*
|
|
2184
2201
|
* @param request PiLicenseTemplateCanOverrideRoyaltyPercentRequest
|
|
2185
2202
|
* @return Promise<PiLicenseTemplateCanOverrideRoyaltyPercentResponse>
|
|
2186
|
-
*/)},{key:"canOverrideRoyaltyPercent",value:(function(){var _canOverrideRoyaltyPercent=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2203
|
+
*/)},{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;}()/**
|
|
2187
2204
|
* method exists for contract PILicenseTemplate
|
|
2188
2205
|
*
|
|
2189
2206
|
* @param request PiLicenseTemplateExistsRequest
|
|
2190
2207
|
* @return Promise<PiLicenseTemplateExistsResponse>
|
|
2191
|
-
*/)},{key:"exists",value:(function(){var _exists=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2208
|
+
*/)},{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;}()/**
|
|
2192
2209
|
* method getEarlierExpireTime for contract PILicenseTemplate
|
|
2193
2210
|
*
|
|
2194
2211
|
* @param request PiLicenseTemplateGetEarlierExpireTimeRequest
|
|
2195
2212
|
* @return Promise<PiLicenseTemplateGetEarlierExpireTimeResponse>
|
|
2196
|
-
*/)},{key:"getEarlierExpireTime",value:(function(){var _getEarlierExpireTime=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2213
|
+
*/)},{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;}()/**
|
|
2197
2214
|
* method getExpireTime for contract PILicenseTemplate
|
|
2198
2215
|
*
|
|
2199
2216
|
* @param request PiLicenseTemplateGetExpireTimeRequest
|
|
2200
2217
|
* @return Promise<PiLicenseTemplateGetExpireTimeResponse>
|
|
2201
|
-
*/)},{key:"getExpireTime",value:(function(){var _getExpireTime=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2218
|
+
*/)},{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;}()/**
|
|
2202
2219
|
* method getLicenseTerms for contract PILicenseTemplate
|
|
2203
2220
|
*
|
|
2204
2221
|
* @param request PiLicenseTemplateGetLicenseTermsRequest
|
|
2205
2222
|
* @return Promise<PiLicenseTemplateGetLicenseTermsResponse>
|
|
2206
|
-
*/)},{key:"getLicenseTerms",value:(function(){var _getLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2223
|
+
*/)},{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;}()/**
|
|
2207
2224
|
* method getLicenseTermsId for contract PILicenseTemplate
|
|
2208
2225
|
*
|
|
2209
2226
|
* @param request PiLicenseTemplateGetLicenseTermsIdRequest
|
|
2210
2227
|
* @return Promise<PiLicenseTemplateGetLicenseTermsIdResponse>
|
|
2211
|
-
*/)},{key:"getLicenseTermsId",value:(function(){var _getLicenseTermsId=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2228
|
+
*/)},{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;}()/**
|
|
2212
2229
|
* method getLicenseTermsURI for contract PILicenseTemplate
|
|
2213
2230
|
*
|
|
2214
2231
|
* @param request PiLicenseTemplateGetLicenseTermsUriRequest
|
|
2215
2232
|
* @return Promise<PiLicenseTemplateGetLicenseTermsUriResponse>
|
|
2216
|
-
*/)},{key:"getLicenseTermsUri",value:(function(){var _getLicenseTermsUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2233
|
+
*/)},{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;}()/**
|
|
2217
2234
|
* method getMetadataURI for contract PILicenseTemplate
|
|
2218
2235
|
*
|
|
2219
2236
|
* @param request PiLicenseTemplateGetMetadataUriRequest
|
|
2220
2237
|
* @return Promise<PiLicenseTemplateGetMetadataUriResponse>
|
|
2221
|
-
*/)},{key:"getMetadataUri",value:(function(){var _getMetadataUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2238
|
+
*/)},{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;}()/**
|
|
2222
2239
|
* method getRoyaltyPolicy for contract PILicenseTemplate
|
|
2223
2240
|
*
|
|
2224
2241
|
* @param request PiLicenseTemplateGetRoyaltyPolicyRequest
|
|
2225
2242
|
* @return Promise<PiLicenseTemplateGetRoyaltyPolicyResponse>
|
|
2226
|
-
*/)},{key:"getRoyaltyPolicy",value:(function(){var _getRoyaltyPolicy=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2243
|
+
*/)},{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;}()/**
|
|
2227
2244
|
* method isConsumingScheduledOp for contract PILicenseTemplate
|
|
2228
2245
|
*
|
|
2229
2246
|
* @param request PiLicenseTemplateIsConsumingScheduledOpRequest
|
|
2230
2247
|
* @return Promise<PiLicenseTemplateIsConsumingScheduledOpResponse>
|
|
2231
|
-
*/)},{key:"isConsumingScheduledOp",value:(function(){var _isConsumingScheduledOp3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2248
|
+
*/)},{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;}()/**
|
|
2232
2249
|
* method isDerivativeApproved for contract PILicenseTemplate
|
|
2233
2250
|
*
|
|
2234
2251
|
* @param request PiLicenseTemplateIsDerivativeApprovedRequest
|
|
2235
2252
|
* @return Promise<PiLicenseTemplateIsDerivativeApprovedResponse>
|
|
2236
|
-
*/)},{key:"isDerivativeApproved",value:(function(){var _isDerivativeApproved=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2253
|
+
*/)},{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;}()/**
|
|
2237
2254
|
* method isLicenseTransferable for contract PILicenseTemplate
|
|
2238
2255
|
*
|
|
2239
2256
|
* @param request PiLicenseTemplateIsLicenseTransferableRequest
|
|
2240
2257
|
* @return Promise<PiLicenseTemplateIsLicenseTransferableResponse>
|
|
2241
|
-
*/)},{key:"isLicenseTransferable",value:(function(){var _isLicenseTransferable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2258
|
+
*/)},{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;}()/**
|
|
2242
2259
|
* method name for contract PILicenseTemplate
|
|
2243
2260
|
*
|
|
2244
2261
|
* @param request PiLicenseTemplateNameRequest
|
|
2245
2262
|
* @return Promise<PiLicenseTemplateNameResponse>
|
|
2246
|
-
*/)},{key:"name",value:(function(){var _name2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2263
|
+
*/)},{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;}()/**
|
|
2247
2264
|
* method proxiableUUID for contract PILicenseTemplate
|
|
2248
2265
|
*
|
|
2249
2266
|
* @param request PiLicenseTemplateProxiableUuidRequest
|
|
2250
2267
|
* @return Promise<PiLicenseTemplateProxiableUuidResponse>
|
|
2251
|
-
*/)},{key:"proxiableUuid",value:(function(){var _proxiableUuid3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2268
|
+
*/)},{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;}()/**
|
|
2252
2269
|
* method supportsInterface for contract PILicenseTemplate
|
|
2253
2270
|
*
|
|
2254
2271
|
* @param request PiLicenseTemplateSupportsInterfaceRequest
|
|
2255
2272
|
* @return Promise<PiLicenseTemplateSupportsInterfaceResponse>
|
|
2256
|
-
*/)},{key:"supportsInterface",value:(function(){var _supportsInterface2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2273
|
+
*/)},{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;}()/**
|
|
2257
2274
|
* method toJson for contract PILicenseTemplate
|
|
2258
2275
|
*
|
|
2259
2276
|
* @param request PiLicenseTemplateToJsonRequest
|
|
2260
2277
|
* @return Promise<PiLicenseTemplateToJsonResponse>
|
|
2261
|
-
*/)},{key:"toJson",value:(function(){var _toJson=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2278
|
+
*/)},{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;}()/**
|
|
2262
2279
|
* method totalRegisteredLicenseTerms for contract PILicenseTemplate
|
|
2263
2280
|
*
|
|
2264
2281
|
* @param request PiLicenseTemplateTotalRegisteredLicenseTermsRequest
|
|
2265
2282
|
* @return Promise<PiLicenseTemplateTotalRegisteredLicenseTermsResponse>
|
|
2266
|
-
*/)},{key:"totalRegisteredLicenseTerms",value:(function(){var _totalRegisteredLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2283
|
+
*/)},{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;}()/**
|
|
2267
2284
|
* method verifyCompatibleLicenses for contract PILicenseTemplate
|
|
2268
2285
|
*
|
|
2269
2286
|
* @param request PiLicenseTemplateVerifyCompatibleLicensesRequest
|
|
2270
2287
|
* @return Promise<PiLicenseTemplateVerifyCompatibleLicensesResponse>
|
|
2271
|
-
*/)},{key:"verifyCompatibleLicenses",value:(function(){var _verifyCompatibleLicenses=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2288
|
+
*/)},{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);/**
|
|
2272
2289
|
* contract PILicenseTemplate write method
|
|
2273
|
-
*/var PiLicenseTemplateClient=/*#__PURE__*/function(_PiLicenseTemplateRea){function PiLicenseTemplateClient(rpcClient,wallet,address){var
|
|
2290
|
+
*/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;}/**
|
|
2274
2291
|
* method initialize for contract PILicenseTemplate
|
|
2275
2292
|
*
|
|
2276
2293
|
* @param request PiLicenseTemplateInitializeRequest
|
|
2277
2294
|
* @return Promise<WriteContractReturnType>
|
|
2278
|
-
*/_inherits(PiLicenseTemplateClient,_PiLicenseTemplateRea);return _createClass(PiLicenseTemplateClient,[{key:"initialize",value:(function(){var _initialize3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2295
|
+
*/_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;}()/**
|
|
2279
2296
|
* method initialize for contract PILicenseTemplate with only encode
|
|
2280
2297
|
*
|
|
2281
2298
|
* @param request PiLicenseTemplateInitializeRequest
|
|
@@ -2285,7 +2302,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2285
2302
|
*
|
|
2286
2303
|
* @param request PiLicenseTemplateRegisterLicenseTermsRequest
|
|
2287
2304
|
* @return Promise<WriteContractReturnType>
|
|
2288
|
-
*/},{key:"registerLicenseTerms",value:(function(){var _registerLicenseTerms=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2305
|
+
*/},{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;}()/**
|
|
2289
2306
|
* method registerLicenseTerms for contract PILicenseTemplate with only encode
|
|
2290
2307
|
*
|
|
2291
2308
|
* @param request PiLicenseTemplateRegisterLicenseTermsRequest
|
|
@@ -2295,7 +2312,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2295
2312
|
*
|
|
2296
2313
|
* @param request PiLicenseTemplateSetApprovalRequest
|
|
2297
2314
|
* @return Promise<WriteContractReturnType>
|
|
2298
|
-
*/},{key:"setApproval",value:(function(){var _setApproval=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2315
|
+
*/},{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;}()/**
|
|
2299
2316
|
* method setApproval for contract PILicenseTemplate with only encode
|
|
2300
2317
|
*
|
|
2301
2318
|
* @param request PiLicenseTemplateSetApprovalRequest
|
|
@@ -2305,7 +2322,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2305
2322
|
*
|
|
2306
2323
|
* @param request PiLicenseTemplateSetAuthorityRequest
|
|
2307
2324
|
* @return Promise<WriteContractReturnType>
|
|
2308
|
-
*/},{key:"setAuthority",value:(function(){var _setAuthority3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2325
|
+
*/},{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;}()/**
|
|
2309
2326
|
* method setAuthority for contract PILicenseTemplate with only encode
|
|
2310
2327
|
*
|
|
2311
2328
|
* @param request PiLicenseTemplateSetAuthorityRequest
|
|
@@ -2315,7 +2332,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2315
2332
|
*
|
|
2316
2333
|
* @param request PiLicenseTemplateUpgradeToAndCallRequest
|
|
2317
2334
|
* @return Promise<WriteContractReturnType>
|
|
2318
|
-
*/},{key:"upgradeToAndCall",value:(function(){var _upgradeToAndCall3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2335
|
+
*/},{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;}()/**
|
|
2319
2336
|
* method upgradeToAndCall for contract PILicenseTemplate with only encode
|
|
2320
2337
|
*
|
|
2321
2338
|
* @param request PiLicenseTemplateUpgradeToAndCallRequest
|
|
@@ -2325,7 +2342,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2325
2342
|
*
|
|
2326
2343
|
* @param request PiLicenseTemplateVerifyMintLicenseTokenRequest
|
|
2327
2344
|
* @return Promise<WriteContractReturnType>
|
|
2328
|
-
*/},{key:"verifyMintLicenseToken",value:(function(){var _verifyMintLicenseToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2345
|
+
*/},{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;}()/**
|
|
2329
2346
|
* method verifyMintLicenseToken for contract PILicenseTemplate with only encode
|
|
2330
2347
|
*
|
|
2331
2348
|
* @param request PiLicenseTemplateVerifyMintLicenseTokenRequest
|
|
@@ -2335,7 +2352,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2335
2352
|
*
|
|
2336
2353
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeRequest
|
|
2337
2354
|
* @return Promise<WriteContractReturnType>
|
|
2338
|
-
*/},{key:"verifyRegisterDerivative",value:(function(){var _verifyRegisterDerivative=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2355
|
+
*/},{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;}()/**
|
|
2339
2356
|
* method verifyRegisterDerivative for contract PILicenseTemplate with only encode
|
|
2340
2357
|
*
|
|
2341
2358
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeRequest
|
|
@@ -2345,7 +2362,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2345
2362
|
*
|
|
2346
2363
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeForAllParentsRequest
|
|
2347
2364
|
* @return Promise<WriteContractReturnType>
|
|
2348
|
-
*/},{key:"verifyRegisterDerivativeForAllParents",value:(function(){var _verifyRegisterDerivativeForAllParents=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2365
|
+
*/},{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;}()/**
|
|
2349
2366
|
* method verifyRegisterDerivativeForAllParents for contract PILicenseTemplate with only encode
|
|
2350
2367
|
*
|
|
2351
2368
|
* @param request PiLicenseTemplateVerifyRegisterDerivativeForAllParentsRequest
|
|
@@ -2385,12 +2402,12 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2385
2402
|
* parse tx receipt event CollectionCreated for contract RegistrationWorkflows
|
|
2386
2403
|
*/},{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=viem.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;}}]);}();/**
|
|
2387
2404
|
* contract RegistrationWorkflows write method
|
|
2388
|
-
*/var RegistrationWorkflowsClient=/*#__PURE__*/function(_RegistrationWorkflow){function RegistrationWorkflowsClient(rpcClient,wallet,address){var
|
|
2405
|
+
*/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;}/**
|
|
2389
2406
|
* method createCollection for contract RegistrationWorkflows
|
|
2390
2407
|
*
|
|
2391
2408
|
* @param request RegistrationWorkflowsCreateCollectionRequest
|
|
2392
2409
|
* @return Promise<WriteContractReturnType>
|
|
2393
|
-
*/_inherits(RegistrationWorkflowsClient,_RegistrationWorkflow);return _createClass(RegistrationWorkflowsClient,[{key:"createCollection",value:(function(){var _createCollection=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2410
|
+
*/_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;}()/**
|
|
2394
2411
|
* method createCollection for contract RegistrationWorkflows with only encode
|
|
2395
2412
|
*
|
|
2396
2413
|
* @param request RegistrationWorkflowsCreateCollectionRequest
|
|
@@ -2400,7 +2417,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2400
2417
|
*
|
|
2401
2418
|
* @param request RegistrationWorkflowsMintAndRegisterIpRequest
|
|
2402
2419
|
* @return Promise<WriteContractReturnType>
|
|
2403
|
-
*/},{key:"mintAndRegisterIp",value:(function(){var _mintAndRegisterIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2420
|
+
*/},{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;}()/**
|
|
2404
2421
|
* method mintAndRegisterIp for contract RegistrationWorkflows with only encode
|
|
2405
2422
|
*
|
|
2406
2423
|
* @param request RegistrationWorkflowsMintAndRegisterIpRequest
|
|
@@ -2410,7 +2427,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2410
2427
|
*
|
|
2411
2428
|
* @param request RegistrationWorkflowsMulticallRequest
|
|
2412
2429
|
* @return Promise<WriteContractReturnType>
|
|
2413
|
-
*/},{key:"multicall",value:(function(){var _multicall3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2430
|
+
*/},{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;}()/**
|
|
2414
2431
|
* method multicall for contract RegistrationWorkflows with only encode
|
|
2415
2432
|
*
|
|
2416
2433
|
* @param request RegistrationWorkflowsMulticallRequest
|
|
@@ -2420,7 +2437,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2420
2437
|
*
|
|
2421
2438
|
* @param request RegistrationWorkflowsRegisterIpRequest
|
|
2422
2439
|
* @return Promise<WriteContractReturnType>
|
|
2423
|
-
*/},{key:"registerIp",value:(function(){var _registerIp=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2440
|
+
*/},{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;}()/**
|
|
2424
2441
|
* method registerIp for contract RegistrationWorkflows with only encode
|
|
2425
2442
|
*
|
|
2426
2443
|
* @param request RegistrationWorkflowsRegisterIpRequest
|
|
@@ -2476,24 +2493,24 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2476
2493
|
*
|
|
2477
2494
|
* @param request RoyaltyModuleIpRoyaltyVaultsRequest
|
|
2478
2495
|
* @return Promise<RoyaltyModuleIpRoyaltyVaultsResponse>
|
|
2479
|
-
*/_inherits(RoyaltyModuleReadOnlyClient,_RoyaltyModuleEventCl);return _createClass(RoyaltyModuleReadOnlyClient,[{key:"ipRoyaltyVaults",value:(function(){var _ipRoyaltyVaults=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2496
|
+
*/_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;}()/**
|
|
2480
2497
|
* method isWhitelistedRoyaltyPolicy for contract RoyaltyModule
|
|
2481
2498
|
*
|
|
2482
2499
|
* @param request RoyaltyModuleIsWhitelistedRoyaltyPolicyRequest
|
|
2483
2500
|
* @return Promise<RoyaltyModuleIsWhitelistedRoyaltyPolicyResponse>
|
|
2484
|
-
*/)},{key:"isWhitelistedRoyaltyPolicy",value:(function(){var _isWhitelistedRoyaltyPolicy=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2501
|
+
*/)},{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;}()/**
|
|
2485
2502
|
* method isWhitelistedRoyaltyToken for contract RoyaltyModule
|
|
2486
2503
|
*
|
|
2487
2504
|
* @param request RoyaltyModuleIsWhitelistedRoyaltyTokenRequest
|
|
2488
2505
|
* @return Promise<RoyaltyModuleIsWhitelistedRoyaltyTokenResponse>
|
|
2489
|
-
*/)},{key:"isWhitelistedRoyaltyToken",value:(function(){var _isWhitelistedRoyaltyToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2506
|
+
*/)},{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);/**
|
|
2490
2507
|
* contract RoyaltyModule write method
|
|
2491
|
-
*/var RoyaltyModuleClient=/*#__PURE__*/function(_RoyaltyModuleReadOnl){function RoyaltyModuleClient(rpcClient,wallet,address){var
|
|
2508
|
+
*/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;}/**
|
|
2492
2509
|
* method payRoyaltyOnBehalf for contract RoyaltyModule
|
|
2493
2510
|
*
|
|
2494
2511
|
* @param request RoyaltyModulePayRoyaltyOnBehalfRequest
|
|
2495
2512
|
* @return Promise<WriteContractReturnType>
|
|
2496
|
-
*/_inherits(RoyaltyModuleClient,_RoyaltyModuleReadOnl);return _createClass(RoyaltyModuleClient,[{key:"payRoyaltyOnBehalf",value:(function(){var _payRoyaltyOnBehalf=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2513
|
+
*/_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;}()/**
|
|
2497
2514
|
* method payRoyaltyOnBehalf for contract RoyaltyModule with only encode
|
|
2498
2515
|
*
|
|
2499
2516
|
* @param request RoyaltyModulePayRoyaltyOnBehalfRequest
|
|
@@ -2550,7 +2567,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2550
2567
|
*
|
|
2551
2568
|
* @param request RoyaltyTokenDistributionWorkflowsDistributeRoyaltyTokensRequest
|
|
2552
2569
|
* @return Promise<WriteContractReturnType>
|
|
2553
|
-
*/return _createClass(RoyaltyTokenDistributionWorkflowsClient,[{key:"distributeRoyaltyTokens",value:(function(){var _distributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2570
|
+
*/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;}()/**
|
|
2554
2571
|
* method distributeRoyaltyTokens for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2555
2572
|
*
|
|
2556
2573
|
* @param request RoyaltyTokenDistributionWorkflowsDistributeRoyaltyTokensRequest
|
|
@@ -2560,7 +2577,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2560
2577
|
*
|
|
2561
2578
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
|
|
2562
2579
|
* @return Promise<WriteContractReturnType>
|
|
2563
|
-
*/},{key:"mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens",value:(function(){var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2580
|
+
*/},{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;}()/**
|
|
2564
2581
|
* method mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2565
2582
|
*
|
|
2566
2583
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
|
|
@@ -2570,7 +2587,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2570
2587
|
*
|
|
2571
2588
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
|
|
2572
2589
|
* @return Promise<WriteContractReturnType>
|
|
2573
|
-
*/},{key:"mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",value:(function(){var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2590
|
+
*/},{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;}()/**
|
|
2574
2591
|
* method mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2575
2592
|
*
|
|
2576
2593
|
* @param request RoyaltyTokenDistributionWorkflowsMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
|
|
@@ -2580,7 +2597,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2580
2597
|
*
|
|
2581
2598
|
* @param request RoyaltyTokenDistributionWorkflowsMulticallRequest
|
|
2582
2599
|
* @return Promise<WriteContractReturnType>
|
|
2583
|
-
*/},{key:"multicall",value:(function(){var _multicall4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2600
|
+
*/},{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;}()/**
|
|
2584
2601
|
* method multicall for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2585
2602
|
*
|
|
2586
2603
|
* @param request RoyaltyTokenDistributionWorkflowsMulticallRequest
|
|
@@ -2590,7 +2607,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2590
2607
|
*
|
|
2591
2608
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndAttachPilTermsAndDeployRoyaltyVaultRequest
|
|
2592
2609
|
* @return Promise<WriteContractReturnType>
|
|
2593
|
-
*/},{key:"registerIpAndAttachPilTermsAndDeployRoyaltyVault",value:(function(){var _registerIpAndAttachPilTermsAndDeployRoyaltyVault=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2610
|
+
*/},{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;}()/**
|
|
2594
2611
|
* method registerIpAndAttachPILTermsAndDeployRoyaltyVault for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2595
2612
|
*
|
|
2596
2613
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndAttachPilTermsAndDeployRoyaltyVaultRequest
|
|
@@ -2600,7 +2617,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2600
2617
|
*
|
|
2601
2618
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest
|
|
2602
2619
|
* @return Promise<WriteContractReturnType>
|
|
2603
|
-
*/},{key:"registerIpAndMakeDerivativeAndDeployRoyaltyVault",value:(function(){var _registerIpAndMakeDerivativeAndDeployRoyaltyVault=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2620
|
+
*/},{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;}()/**
|
|
2604
2621
|
* method registerIpAndMakeDerivativeAndDeployRoyaltyVault for contract RoyaltyTokenDistributionWorkflows with only encode
|
|
2605
2622
|
*
|
|
2606
2623
|
* @param request RoyaltyTokenDistributionWorkflowsRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest
|
|
@@ -2625,7 +2642,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2625
2642
|
*
|
|
2626
2643
|
* @param request RoyaltyWorkflowsClaimAllRevenueRequest
|
|
2627
2644
|
* @return Promise<WriteContractReturnType>
|
|
2628
|
-
*/return _createClass(RoyaltyWorkflowsClient,[{key:"claimAllRevenue",value:(function(){var _claimAllRevenue=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2645
|
+
*/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;}()/**
|
|
2629
2646
|
* method claimAllRevenue for contract RoyaltyWorkflows with only encode
|
|
2630
2647
|
*
|
|
2631
2648
|
* @param request RoyaltyWorkflowsClaimAllRevenueRequest
|
|
@@ -2635,7 +2652,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2635
2652
|
*
|
|
2636
2653
|
* @param request RoyaltyWorkflowsMulticallRequest
|
|
2637
2654
|
* @return Promise<WriteContractReturnType>
|
|
2638
|
-
*/},{key:"multicall",value:(function(){var _multicall5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2655
|
+
*/},{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;}()/**
|
|
2639
2656
|
* method multicall for contract RoyaltyWorkflows with only encode
|
|
2640
2657
|
*
|
|
2641
2658
|
* @param request RoyaltyWorkflowsMulticallRequest
|
|
@@ -2674,34 +2691,34 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2674
2691
|
*
|
|
2675
2692
|
* @param request SpgnftImplHasRoleRequest
|
|
2676
2693
|
* @return Promise<SpgnftImplHasRoleResponse>
|
|
2677
|
-
*/_inherits(SpgnftImplReadOnlyClient,_SpgnftImplEventClien);return _createClass(SpgnftImplReadOnlyClient,[{key:"hasRole",value:(function(){var _hasRole=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2694
|
+
*/_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;}()/**
|
|
2678
2695
|
* method mintFee for contract SPGNFTImpl
|
|
2679
2696
|
*
|
|
2680
2697
|
* @param request SpgnftImplMintFeeRequest
|
|
2681
2698
|
* @return Promise<SpgnftImplMintFeeResponse>
|
|
2682
|
-
*/)},{key:"mintFee",value:(function(){var _mintFee=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2699
|
+
*/)},{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;}()/**
|
|
2683
2700
|
* method mintFeeToken for contract SPGNFTImpl
|
|
2684
2701
|
*
|
|
2685
2702
|
* @param request SpgnftImplMintFeeTokenRequest
|
|
2686
2703
|
* @return Promise<SpgnftImplMintFeeTokenResponse>
|
|
2687
|
-
*/)},{key:"mintFeeToken",value:(function(){var _mintFeeToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2704
|
+
*/)},{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;}()/**
|
|
2688
2705
|
* method publicMinting for contract SPGNFTImpl
|
|
2689
2706
|
*
|
|
2690
2707
|
* @param request SpgnftImplPublicMintingRequest
|
|
2691
2708
|
* @return Promise<SpgnftImplPublicMintingResponse>
|
|
2692
|
-
*/)},{key:"publicMinting",value:(function(){var _publicMinting=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2709
|
+
*/)},{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;}()/**
|
|
2693
2710
|
* method tokenURI for contract SPGNFTImpl
|
|
2694
2711
|
*
|
|
2695
2712
|
* @param request SpgnftImplTokenUriRequest
|
|
2696
2713
|
* @return Promise<SpgnftImplTokenUriResponse>
|
|
2697
|
-
*/)},{key:"tokenUri",value:(function(){var _tokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2714
|
+
*/)},{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);/**
|
|
2698
2715
|
* contract SPGNFTImpl write method
|
|
2699
|
-
*/var SpgnftImplClient=/*#__PURE__*/function(_SpgnftImplReadOnlyCl){function SpgnftImplClient(rpcClient,wallet,address){var
|
|
2716
|
+
*/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;}/**
|
|
2700
2717
|
* method setTokenURI for contract SPGNFTImpl
|
|
2701
2718
|
*
|
|
2702
2719
|
* @param request SpgnftImplSetTokenUriRequest
|
|
2703
2720
|
* @return Promise<WriteContractReturnType>
|
|
2704
|
-
*/_inherits(SpgnftImplClient,_SpgnftImplReadOnlyCl);return _createClass(SpgnftImplClient,[{key:"setTokenUri",value:(function(){var _setTokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2721
|
+
*/_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;}()/**
|
|
2705
2722
|
* method setTokenURI for contract SPGNFTImpl with only encode
|
|
2706
2723
|
*
|
|
2707
2724
|
* @param request SpgnftImplSetTokenUriRequest
|
|
@@ -2721,7 +2738,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2721
2738
|
*
|
|
2722
2739
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
|
2723
2740
|
* @return Promise<WriteContractReturnType>
|
|
2724
|
-
*/return _createClass(TotalLicenseTokenLimitHookClient,[{key:"setTotalLicenseTokenLimit",value:(function(){var _setTotalLicenseTokenLimit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2741
|
+
*/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;}()/**
|
|
2725
2742
|
* method setTotalLicenseTokenLimit for contract TotalLicenseTokenLimitHook with only encode
|
|
2726
2743
|
*
|
|
2727
2744
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
|
@@ -2771,19 +2788,19 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2771
2788
|
*
|
|
2772
2789
|
* @param request WrappedIpAllowanceRequest
|
|
2773
2790
|
* @return Promise<WrappedIpAllowanceResponse>
|
|
2774
|
-
*/return _createClass(WrappedIpReadOnlyClient,[{key:"allowance",value:(function(){var _allowance2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2791
|
+
*/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;}()/**
|
|
2775
2792
|
* method balanceOf for contract WrappedIP
|
|
2776
2793
|
*
|
|
2777
2794
|
* @param request WrappedIpBalanceOfRequest
|
|
2778
2795
|
* @return Promise<WrappedIpBalanceOfResponse>
|
|
2779
|
-
*/)},{key:"balanceOf",value:(function(){var _balanceOf3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2796
|
+
*/)},{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;}())}]);}();/**
|
|
2780
2797
|
* contract WrappedIP write method
|
|
2781
|
-
*/var WrappedIpClient=/*#__PURE__*/function(_WrappedIpReadOnlyCli){function WrappedIpClient(rpcClient,wallet,address){var
|
|
2798
|
+
*/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;}/**
|
|
2782
2799
|
* method approve for contract WrappedIP
|
|
2783
2800
|
*
|
|
2784
2801
|
* @param request WrappedIpApproveRequest
|
|
2785
2802
|
* @return Promise<WriteContractReturnType>
|
|
2786
|
-
*/_inherits(WrappedIpClient,_WrappedIpReadOnlyCli);return _createClass(WrappedIpClient,[{key:"approve",value:(function(){var
|
|
2803
|
+
*/_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;}()/**
|
|
2787
2804
|
* method approve for contract WrappedIP with only encode
|
|
2788
2805
|
*
|
|
2789
2806
|
* @param request WrappedIpApproveRequest
|
|
@@ -2793,7 +2810,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2793
2810
|
*
|
|
2794
2811
|
* @param request WrappedIpDepositRequest
|
|
2795
2812
|
* @return Promise<WriteContractReturnType>
|
|
2796
|
-
*/},{key:"deposit",value:(function(){var _deposit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2813
|
+
*/},{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;}()/**
|
|
2797
2814
|
* method deposit for contract WrappedIP with only encode
|
|
2798
2815
|
*
|
|
2799
2816
|
* @param request WrappedIpDepositRequest
|
|
@@ -2803,7 +2820,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2803
2820
|
*
|
|
2804
2821
|
* @param request WrappedIpTransferRequest
|
|
2805
2822
|
* @return Promise<WriteContractReturnType>
|
|
2806
|
-
*/},{key:"transfer",value:(function(){var _transfer2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2823
|
+
*/},{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;}()/**
|
|
2807
2824
|
* method transfer for contract WrappedIP with only encode
|
|
2808
2825
|
*
|
|
2809
2826
|
* @param request WrappedIpTransferRequest
|
|
@@ -2813,7 +2830,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2813
2830
|
*
|
|
2814
2831
|
* @param request WrappedIpTransferFromRequest
|
|
2815
2832
|
* @return Promise<WriteContractReturnType>
|
|
2816
|
-
*/},{key:"transferFrom",value:(function(){var _transferFrom2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2833
|
+
*/},{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;}()/**
|
|
2817
2834
|
* method transferFrom for contract WrappedIP with only encode
|
|
2818
2835
|
*
|
|
2819
2836
|
* @param request WrappedIpTransferFromRequest
|
|
@@ -2823,7 +2840,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2823
2840
|
*
|
|
2824
2841
|
* @param request WrappedIpWithdrawRequest
|
|
2825
2842
|
* @return Promise<WriteContractReturnType>
|
|
2826
|
-
*/},{key:"withdraw",value:(function(){var _withdraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2843
|
+
*/},{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;}()/**
|
|
2827
2844
|
* method withdraw for contract WrappedIP with only encode
|
|
2828
2845
|
*
|
|
2829
2846
|
* @param request WrappedIpWithdrawRequest
|
|
@@ -3254,6 +3271,24 @@ var waitForTxReceipts = /*#__PURE__*/function () {
|
|
|
3254
3271
|
};
|
|
3255
3272
|
}();
|
|
3256
3273
|
|
|
3274
|
+
var waitTx = /*#__PURE__*/function () {
|
|
3275
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(client, txHash, params) {
|
|
3276
|
+
return _regenerator().w(function (_context2) {
|
|
3277
|
+
while (1) switch (_context2.n) {
|
|
3278
|
+
case 0:
|
|
3279
|
+
_context2.n = 1;
|
|
3280
|
+
return client.waitForTransactionReceipt(_objectSpread2({
|
|
3281
|
+
hash: txHash
|
|
3282
|
+
}, params));
|
|
3283
|
+
case 1:
|
|
3284
|
+
return _context2.a(2);
|
|
3285
|
+
}
|
|
3286
|
+
}, _callee2);
|
|
3287
|
+
}));
|
|
3288
|
+
return function waitTx(_x4, _x5, _x6) {
|
|
3289
|
+
return _ref2.apply(this, arguments);
|
|
3290
|
+
};
|
|
3291
|
+
}();
|
|
3257
3292
|
var chainStringToViemChain = function chainStringToViemChain(chainId) {
|
|
3258
3293
|
switch (chainId) {
|
|
3259
3294
|
case 1315:
|
|
@@ -3290,6 +3325,22 @@ var getTokenAmountDisplay = function getTokenAmountDisplay(amount) {
|
|
|
3290
3325
|
return "".concat(viem.formatEther(amount)).concat(unit);
|
|
3291
3326
|
};
|
|
3292
3327
|
|
|
3328
|
+
/**
|
|
3329
|
+
* Merges spenders with the same address by summing their amounts.
|
|
3330
|
+
*/
|
|
3331
|
+
var mergeSpenderByAddress = function mergeSpenderByAddress(spenders, newSpender) {
|
|
3332
|
+
var existingSpender = spenders.find(function (s) {
|
|
3333
|
+
return s.address === newSpender.address && s.token === newSpender.token;
|
|
3334
|
+
});
|
|
3335
|
+
if (existingSpender) {
|
|
3336
|
+
existingSpender.amount = (newSpender.amount || 0n) + (existingSpender.amount || 0n);
|
|
3337
|
+
} else {
|
|
3338
|
+
spenders.push(_objectSpread2(_objectSpread2({}, newSpender), {}, {
|
|
3339
|
+
amount: newSpender.amount || 0n
|
|
3340
|
+
}));
|
|
3341
|
+
}
|
|
3342
|
+
};
|
|
3343
|
+
|
|
3293
3344
|
/**
|
|
3294
3345
|
* check the allowance of all spenders and call approval if any spender
|
|
3295
3346
|
* allowance is lower than the amount they are expected to spend.
|
|
@@ -3499,153 +3550,365 @@ var multiCallWrapIp = /*#__PURE__*/function () {
|
|
|
3499
3550
|
}();
|
|
3500
3551
|
|
|
3501
3552
|
/**
|
|
3502
|
-
*
|
|
3503
|
-
* For all other ERC20 tokens, it handles approvals if insufficient allowance.
|
|
3504
|
-
*
|
|
3505
|
-
* @remarks
|
|
3506
|
-
* This function will automatically handle the following:
|
|
3507
|
-
*
|
|
3508
|
-
* If token is wip and the user does not have enough WIP, it will wrap IP to WIP, unless
|
|
3509
|
-
* disabled via `disableAutoWrappingIp`.
|
|
3510
|
-
*
|
|
3511
|
-
* If the user have enough token, it will check for if approvals are needed
|
|
3512
|
-
* for each spender address and approve it, unless disabled via `disableAutoApprove`.
|
|
3553
|
+
* Calculate the total amount needed from spenders.
|
|
3513
3554
|
*/
|
|
3514
|
-
var
|
|
3555
|
+
var calculateTotalAmount = function calculateTotalAmount(spenders) {
|
|
3556
|
+
return spenders.reduce(function (acc, spender) {
|
|
3557
|
+
return acc + (spender.amount || 0n);
|
|
3558
|
+
}, 0n);
|
|
3559
|
+
};
|
|
3560
|
+
|
|
3561
|
+
/**
|
|
3562
|
+
* Handle ERC20 token payment with approval and balance check.
|
|
3563
|
+
*/
|
|
3564
|
+
var handleErc20Payment = /*#__PURE__*/function () {
|
|
3515
3565
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref6) {
|
|
3516
|
-
var _options$
|
|
3517
|
-
var
|
|
3566
|
+
var _options$erc20Options;
|
|
3567
|
+
var tokenSpenders, sender, options, multicall3Address, rpcClient, wallet, contractCall, txOptions, tokenClient, autoApprove, _t2;
|
|
3518
3568
|
return _regenerator().w(function (_context4) {
|
|
3519
3569
|
while (1) switch (_context4.n) {
|
|
3520
3570
|
case 0:
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
if (!(totalFees === 0n)) {
|
|
3527
|
-
_context4.n = 2;
|
|
3571
|
+
tokenSpenders = _ref6.tokenSpenders, sender = _ref6.sender, options = _ref6.options, multicall3Address = _ref6.multicall3Address, rpcClient = _ref6.rpcClient, wallet = _ref6.wallet, contractCall = _ref6.contractCall, txOptions = _ref6.txOptions;
|
|
3572
|
+
tokenClient = new ERC20Client(rpcClient, wallet, tokenSpenders[0].token);
|
|
3573
|
+
autoApprove = (options === null || options === void 0 || (_options$erc20Options = options.erc20Options) === null || _options$erc20Options === void 0 ? void 0 : _options$erc20Options.enableAutoApprove) !== false;
|
|
3574
|
+
if (!autoApprove) {
|
|
3575
|
+
_context4.n = 1;
|
|
3528
3576
|
break;
|
|
3529
3577
|
}
|
|
3530
3578
|
_context4.n = 1;
|
|
3531
|
-
return
|
|
3579
|
+
return approvalAllSpenders({
|
|
3580
|
+
spenders: tokenSpenders,
|
|
3581
|
+
client: tokenClient,
|
|
3582
|
+
owner: sender,
|
|
3583
|
+
multicallAddress: multicall3Address,
|
|
3584
|
+
rpcClient: rpcClient,
|
|
3585
|
+
useMultiCall: false
|
|
3586
|
+
});
|
|
3532
3587
|
case 1:
|
|
3533
|
-
|
|
3534
|
-
|
|
3588
|
+
_t2 = handleTransactionResponse;
|
|
3589
|
+
_context4.n = 2;
|
|
3590
|
+
return contractCall();
|
|
3535
3591
|
case 2:
|
|
3536
|
-
_context4.
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3592
|
+
return _context4.a(2, _t2(_context4.v, rpcClient, txOptions));
|
|
3593
|
+
}
|
|
3594
|
+
}, _callee4);
|
|
3595
|
+
}));
|
|
3596
|
+
return function handleErc20Payment(_x4) {
|
|
3597
|
+
return _ref7.apply(this, arguments);
|
|
3598
|
+
};
|
|
3599
|
+
}();
|
|
3600
|
+
|
|
3601
|
+
/**
|
|
3602
|
+
* Handle WIP token payment with approval and balance check.
|
|
3603
|
+
*/
|
|
3604
|
+
var handleWipPayment = /*#__PURE__*/function () {
|
|
3605
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref8) {
|
|
3606
|
+
var _options$wipOptions;
|
|
3607
|
+
var tokenSpenders, sender, options, multicall3Address, rpcClient, contractCall, txOptions, wallet, encodedTxs, wipTokenClient, balance, totalFees, autoApprove, _t3;
|
|
3608
|
+
return _regenerator().w(function (_context5) {
|
|
3609
|
+
while (1) switch (_context5.n) {
|
|
3610
|
+
case 0:
|
|
3611
|
+
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;
|
|
3612
|
+
wipTokenClient = new WipTokenClient(rpcClient, wallet);
|
|
3613
|
+
_context5.n = 1;
|
|
3614
|
+
return wipTokenClient.balanceOf(sender);
|
|
3615
|
+
case 1:
|
|
3616
|
+
balance = _context5.v;
|
|
3617
|
+
totalFees = calculateTotalAmount(tokenSpenders);
|
|
3618
|
+
if (!(balance < totalFees)) {
|
|
3619
|
+
_context5.n = 2;
|
|
3543
3620
|
break;
|
|
3544
3621
|
}
|
|
3622
|
+
return _context5.a(2, handleIpWrapping({
|
|
3623
|
+
tokenSpenders: tokenSpenders,
|
|
3624
|
+
sender: sender,
|
|
3625
|
+
options: options,
|
|
3626
|
+
rpcClient: rpcClient,
|
|
3627
|
+
multicall3Address: multicall3Address,
|
|
3628
|
+
contractCall: contractCall,
|
|
3629
|
+
encodedTxs: encodedTxs,
|
|
3630
|
+
wallet: wallet,
|
|
3631
|
+
txOptions: txOptions
|
|
3632
|
+
}));
|
|
3633
|
+
case 2:
|
|
3634
|
+
autoApprove = (options === null || options === void 0 || (_options$wipOptions = options.wipOptions) === null || _options$wipOptions === void 0 ? void 0 : _options$wipOptions.enableAutoApprove) !== false;
|
|
3545
3635
|
if (!autoApprove) {
|
|
3546
|
-
|
|
3636
|
+
_context5.n = 3;
|
|
3547
3637
|
break;
|
|
3548
3638
|
}
|
|
3549
|
-
|
|
3639
|
+
_context5.n = 3;
|
|
3550
3640
|
return approvalAllSpenders({
|
|
3551
3641
|
spenders: tokenSpenders,
|
|
3552
|
-
client:
|
|
3642
|
+
client: wipTokenClient,
|
|
3553
3643
|
owner: sender,
|
|
3554
|
-
// sender owns the wip
|
|
3555
3644
|
multicallAddress: multicall3Address,
|
|
3556
3645
|
rpcClient: rpcClient,
|
|
3557
|
-
// since sender has all token, if using multicall, we cannot approve transfer token into multicall by multicall.
|
|
3558
|
-
// So in this case, we don't use multicall here and instead just wait for each approval to be finished.
|
|
3559
3646
|
useMultiCall: false
|
|
3560
3647
|
});
|
|
3561
|
-
case
|
|
3562
|
-
|
|
3648
|
+
case 3:
|
|
3649
|
+
_t3 = handleTransactionResponse;
|
|
3650
|
+
_context5.n = 4;
|
|
3563
3651
|
return contractCall();
|
|
3564
|
-
case
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3652
|
+
case 4:
|
|
3653
|
+
return _context5.a(2, _t3(_context5.v, rpcClient, txOptions));
|
|
3654
|
+
}
|
|
3655
|
+
}, _callee5);
|
|
3656
|
+
}));
|
|
3657
|
+
return function handleWipPayment(_x5) {
|
|
3658
|
+
return _ref9.apply(this, arguments);
|
|
3659
|
+
};
|
|
3660
|
+
}();
|
|
3661
|
+
|
|
3662
|
+
/**
|
|
3663
|
+
* Handle IP wrapping to WIP when insufficient WIP balance.
|
|
3664
|
+
*/
|
|
3665
|
+
var handleIpWrapping = /*#__PURE__*/function () {
|
|
3666
|
+
var _ref1 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref0) {
|
|
3667
|
+
var _options$wipOptions2;
|
|
3668
|
+
var tokenSpenders, sender, options, rpcClient, multicall3Address, contractCall, encodedTxs, wallet, txOptions, autoWrapIp, ipBalance, wipClient, wipBalance, totalFees, _yield$multiCallWrapI, txHash;
|
|
3669
|
+
return _regenerator().w(function (_context6) {
|
|
3670
|
+
while (1) switch (_context6.n) {
|
|
3671
|
+
case 0:
|
|
3672
|
+
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;
|
|
3673
|
+
autoWrapIp = (options === null || options === void 0 || (_options$wipOptions2 = options.wipOptions) === null || _options$wipOptions2 === void 0 ? void 0 : _options$wipOptions2.enableAutoWrapIp) !== false;
|
|
3674
|
+
_context6.n = 1;
|
|
3576
3675
|
return rpcClient.getBalance({
|
|
3577
3676
|
address: sender
|
|
3578
3677
|
});
|
|
3579
|
-
case
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3678
|
+
case 1:
|
|
3679
|
+
ipBalance = _context6.v;
|
|
3680
|
+
wipClient = new WipTokenClient(rpcClient, wallet);
|
|
3681
|
+
_context6.n = 2;
|
|
3682
|
+
return wipClient.balanceOf(sender);
|
|
3683
|
+
case 2:
|
|
3684
|
+
wipBalance = _context6.v;
|
|
3685
|
+
totalFees = calculateTotalAmount(tokenSpenders);
|
|
3686
|
+
if (!(ipBalance < totalFees)) {
|
|
3687
|
+
_context6.n = 3;
|
|
3583
3688
|
break;
|
|
3584
3689
|
}
|
|
3585
|
-
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(
|
|
3586
|
-
case
|
|
3690
|
+
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), "."));
|
|
3691
|
+
case 3:
|
|
3587
3692
|
if (autoWrapIp) {
|
|
3588
|
-
|
|
3693
|
+
_context6.n = 4;
|
|
3589
3694
|
break;
|
|
3590
3695
|
}
|
|
3591
|
-
throw new Error("Wallet does not have enough WIP to pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(
|
|
3592
|
-
case
|
|
3593
|
-
|
|
3594
|
-
return {
|
|
3595
|
-
target: data.to,
|
|
3596
|
-
allowFailure: false,
|
|
3597
|
-
value: 0n,
|
|
3598
|
-
callData: data.data
|
|
3599
|
-
};
|
|
3600
|
-
});
|
|
3601
|
-
_context4.n = 11;
|
|
3696
|
+
throw new Error("Wallet does not have enough WIP to pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(wipBalance, "WIP"), "."));
|
|
3697
|
+
case 4:
|
|
3698
|
+
_context6.n = 5;
|
|
3602
3699
|
return multiCallWrapIp({
|
|
3603
3700
|
ipAmountToWrap: totalFees,
|
|
3604
3701
|
multicall3Address: multicall3Address,
|
|
3605
|
-
wipClient:
|
|
3702
|
+
wipClient: wipClient,
|
|
3606
3703
|
wipOptions: options === null || options === void 0 ? void 0 : options.wipOptions,
|
|
3607
3704
|
contractCall: contractCall,
|
|
3608
3705
|
wipSpenders: tokenSpenders,
|
|
3609
3706
|
rpcClient: rpcClient,
|
|
3610
3707
|
wallet: wallet,
|
|
3611
|
-
calls:
|
|
3708
|
+
calls: encodedTxs.map(function (data) {
|
|
3709
|
+
return {
|
|
3710
|
+
target: data.to,
|
|
3711
|
+
allowFailure: false,
|
|
3712
|
+
value: 0n,
|
|
3713
|
+
callData: data.data
|
|
3714
|
+
};
|
|
3715
|
+
})
|
|
3612
3716
|
});
|
|
3613
|
-
case
|
|
3614
|
-
_yield$multiCallWrapI =
|
|
3717
|
+
case 5:
|
|
3718
|
+
_yield$multiCallWrapI = _context6.v;
|
|
3615
3719
|
txHash = _yield$multiCallWrapI.txHash;
|
|
3616
|
-
return
|
|
3720
|
+
return _context6.a(2, handleTransactionResponse(txHash, rpcClient, txOptions));
|
|
3617
3721
|
}
|
|
3618
|
-
},
|
|
3722
|
+
}, _callee6);
|
|
3619
3723
|
}));
|
|
3620
|
-
return function
|
|
3621
|
-
return
|
|
3724
|
+
return function handleIpWrapping(_x6) {
|
|
3725
|
+
return _ref1.apply(this, arguments);
|
|
3726
|
+
};
|
|
3727
|
+
}();
|
|
3728
|
+
|
|
3729
|
+
/**
|
|
3730
|
+
* Handle contract calls that require token fees.
|
|
3731
|
+
* - For fees in `WIP`, it automatically wraps `IP` to `WIP` when insufficient `WIP` balance.
|
|
3732
|
+
* - For fees in `ERC20` tokens, it automatically approves if sufficient balance is available.
|
|
3733
|
+
* - 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.
|
|
3734
|
+
*
|
|
3735
|
+
* @remarks
|
|
3736
|
+
* This function will automatically handle the following logic:
|
|
3737
|
+
* - If token is `WIP` and the user does not have enough `WIP` balance, it will wrap `IP` to `WIP`, unless
|
|
3738
|
+
* disabled via `disableAutoWrappingIp`.
|
|
3739
|
+
* - If the user have enough token, it will check for if approvals are needed
|
|
3740
|
+
* for each spender address and approve it, unless disabled via `disableAutoApprove`.
|
|
3741
|
+
* - If the fees are in `WIP` and `ERC20` tokens, it will not use disable `useMulticallWhenPossible` to pay for fees.
|
|
3742
|
+
*/
|
|
3743
|
+
var contractCallWithFees = /*#__PURE__*/function () {
|
|
3744
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref10) {
|
|
3745
|
+
var options, multicall3Address, wallet, tokenSpenders, contractCall, sender, txOptions, encodedTxs, rpcClient, zeroFees, _groupTokenSpenders, wipSpenders, erc20Spenders, baseContractCallArgs, _options$erc20Options2, _erc20Spenders$, autoApproveForErc20, erc20Client, _t4;
|
|
3746
|
+
return _regenerator().w(function (_context7) {
|
|
3747
|
+
while (1) switch (_context7.n) {
|
|
3748
|
+
case 0:
|
|
3749
|
+
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;
|
|
3750
|
+
// Skip fee logic if no fees
|
|
3751
|
+
zeroFees = tokenSpenders.every(function (spender) {
|
|
3752
|
+
return spender.amount === 0n;
|
|
3753
|
+
});
|
|
3754
|
+
if (!zeroFees) {
|
|
3755
|
+
_context7.n = 2;
|
|
3756
|
+
break;
|
|
3757
|
+
}
|
|
3758
|
+
_t4 = handleTransactionResponse;
|
|
3759
|
+
_context7.n = 1;
|
|
3760
|
+
return contractCall();
|
|
3761
|
+
case 1:
|
|
3762
|
+
return _context7.a(2, _t4(_context7.v, rpcClient, txOptions));
|
|
3763
|
+
case 2:
|
|
3764
|
+
_groupTokenSpenders = groupTokenSpenders(tokenSpenders), wipSpenders = _groupTokenSpenders.wipSpenders, erc20Spenders = _groupTokenSpenders.erc20Spenders;
|
|
3765
|
+
baseContractCallArgs = {
|
|
3766
|
+
sender: sender,
|
|
3767
|
+
options: options,
|
|
3768
|
+
multicall3Address: multicall3Address,
|
|
3769
|
+
rpcClient: rpcClient,
|
|
3770
|
+
contractCall: contractCall,
|
|
3771
|
+
encodedTxs: encodedTxs,
|
|
3772
|
+
txOptions: txOptions,
|
|
3773
|
+
wallet: wallet
|
|
3774
|
+
};
|
|
3775
|
+
if (!(erc20Spenders.length > 0)) {
|
|
3776
|
+
_context7.n = 3;
|
|
3777
|
+
break;
|
|
3778
|
+
}
|
|
3779
|
+
_context7.n = 3;
|
|
3780
|
+
return checkErc20BalanceBelowFees(erc20Spenders, rpcClient, wallet, sender);
|
|
3781
|
+
case 3:
|
|
3782
|
+
if (!(wipSpenders.length > 0 && erc20Spenders.length > 0)) {
|
|
3783
|
+
_context7.n = 5;
|
|
3784
|
+
break;
|
|
3785
|
+
}
|
|
3786
|
+
autoApproveForErc20 = (options === null || options === void 0 || (_options$erc20Options2 = options.erc20Options) === null || _options$erc20Options2 === void 0 ? void 0 : _options$erc20Options2.enableAutoApprove) !== false;
|
|
3787
|
+
erc20Client = new ERC20Client(rpcClient, wallet, (_erc20Spenders$ = erc20Spenders[0]) === null || _erc20Spenders$ === void 0 ? void 0 : _erc20Spenders$.token);
|
|
3788
|
+
if (!autoApproveForErc20) {
|
|
3789
|
+
_context7.n = 4;
|
|
3790
|
+
break;
|
|
3791
|
+
}
|
|
3792
|
+
_context7.n = 4;
|
|
3793
|
+
return approvalAllSpenders({
|
|
3794
|
+
spenders: erc20Spenders,
|
|
3795
|
+
client: erc20Client,
|
|
3796
|
+
owner: sender,
|
|
3797
|
+
multicallAddress: multicall3Address,
|
|
3798
|
+
rpcClient: rpcClient,
|
|
3799
|
+
useMultiCall: false
|
|
3800
|
+
});
|
|
3801
|
+
case 4:
|
|
3802
|
+
return _context7.a(2, handleWipPayment(_objectSpread2(_objectSpread2({}, baseContractCallArgs), {}, {
|
|
3803
|
+
tokenSpenders: wipSpenders,
|
|
3804
|
+
options: {
|
|
3805
|
+
wipOptions: _objectSpread2(_objectSpread2({}, options === null || options === void 0 ? void 0 : options.wipOptions), {}, {
|
|
3806
|
+
// Need to pay erc20 fees with the wallet, cannot use multicall when handling erc20 payment.
|
|
3807
|
+
useMulticallWhenPossible: false
|
|
3808
|
+
})
|
|
3809
|
+
}
|
|
3810
|
+
})));
|
|
3811
|
+
case 5:
|
|
3812
|
+
if (!(erc20Spenders.length > 0)) {
|
|
3813
|
+
_context7.n = 6;
|
|
3814
|
+
break;
|
|
3815
|
+
}
|
|
3816
|
+
return _context7.a(2, handleErc20Payment(_objectSpread2(_objectSpread2({}, baseContractCallArgs), {}, {
|
|
3817
|
+
tokenSpenders: erc20Spenders
|
|
3818
|
+
})));
|
|
3819
|
+
case 6:
|
|
3820
|
+
return _context7.a(2, handleWipPayment(_objectSpread2(_objectSpread2({}, baseContractCallArgs), {}, {
|
|
3821
|
+
tokenSpenders: wipSpenders
|
|
3822
|
+
})));
|
|
3823
|
+
case 7:
|
|
3824
|
+
return _context7.a(2);
|
|
3825
|
+
}
|
|
3826
|
+
}, _callee7);
|
|
3827
|
+
}));
|
|
3828
|
+
return function contractCallWithFees(_x7) {
|
|
3829
|
+
return _ref11.apply(this, arguments);
|
|
3622
3830
|
};
|
|
3623
3831
|
}();
|
|
3624
3832
|
var handleTransactionResponse = /*#__PURE__*/function () {
|
|
3625
|
-
var
|
|
3626
|
-
return _regenerator().w(function (
|
|
3627
|
-
while (1) switch (
|
|
3833
|
+
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(txHash, rpcClient, txOptions) {
|
|
3834
|
+
return _regenerator().w(function (_context8) {
|
|
3835
|
+
while (1) switch (_context8.n) {
|
|
3628
3836
|
case 0:
|
|
3629
3837
|
if (!Array.isArray(txHash)) {
|
|
3630
|
-
|
|
3838
|
+
_context8.n = 1;
|
|
3631
3839
|
break;
|
|
3632
3840
|
}
|
|
3633
|
-
return
|
|
3841
|
+
return _context8.a(2, waitForTxReceipts({
|
|
3634
3842
|
rpcClient: rpcClient,
|
|
3635
3843
|
txOptions: txOptions,
|
|
3636
3844
|
txHashes: txHash
|
|
3637
3845
|
}));
|
|
3638
3846
|
case 1:
|
|
3639
|
-
return
|
|
3847
|
+
return _context8.a(2, waitForTxReceipt({
|
|
3640
3848
|
rpcClient: rpcClient,
|
|
3641
3849
|
txOptions: txOptions,
|
|
3642
3850
|
txHash: txHash
|
|
3643
3851
|
}));
|
|
3644
3852
|
}
|
|
3645
|
-
},
|
|
3853
|
+
}, _callee8);
|
|
3646
3854
|
}));
|
|
3647
|
-
return function handleTransactionResponse(
|
|
3648
|
-
return
|
|
3855
|
+
return function handleTransactionResponse(_x8, _x9, _x0) {
|
|
3856
|
+
return _ref12.apply(this, arguments);
|
|
3857
|
+
};
|
|
3858
|
+
}();
|
|
3859
|
+
|
|
3860
|
+
/**
|
|
3861
|
+
* Group token spenders into wip and erc20 spenders.
|
|
3862
|
+
*/
|
|
3863
|
+
var groupTokenSpenders = function groupTokenSpenders(tokenSpenders) {
|
|
3864
|
+
var wipSpenders = [];
|
|
3865
|
+
var erc20Spenders = [];
|
|
3866
|
+
var _iterator2 = _createForOfIteratorHelper(tokenSpenders),
|
|
3867
|
+
_step2;
|
|
3868
|
+
try {
|
|
3869
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3870
|
+
var spender = _step2.value;
|
|
3871
|
+
if (spender.token.toLowerCase() === WIP_TOKEN_ADDRESS.toLowerCase()) {
|
|
3872
|
+
mergeSpenderByAddress(wipSpenders, spender);
|
|
3873
|
+
} else {
|
|
3874
|
+
mergeSpenderByAddress(erc20Spenders, spender);
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
} catch (err) {
|
|
3878
|
+
_iterator2.e(err);
|
|
3879
|
+
} finally {
|
|
3880
|
+
_iterator2.f();
|
|
3881
|
+
}
|
|
3882
|
+
return {
|
|
3883
|
+
wipSpenders: wipSpenders,
|
|
3884
|
+
erc20Spenders: erc20Spenders
|
|
3885
|
+
};
|
|
3886
|
+
};
|
|
3887
|
+
var checkErc20BalanceBelowFees = /*#__PURE__*/function () {
|
|
3888
|
+
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(erc20Spenders, rpcClient, wallet, sender) {
|
|
3889
|
+
var _erc20Spenders$2;
|
|
3890
|
+
var erc20Client, erc20Balance, erc20TotalFees;
|
|
3891
|
+
return _regenerator().w(function (_context9) {
|
|
3892
|
+
while (1) switch (_context9.n) {
|
|
3893
|
+
case 0:
|
|
3894
|
+
erc20Client = new ERC20Client(rpcClient, wallet, (_erc20Spenders$2 = erc20Spenders[0]) === null || _erc20Spenders$2 === void 0 ? void 0 : _erc20Spenders$2.token);
|
|
3895
|
+
_context9.n = 1;
|
|
3896
|
+
return erc20Client.balanceOf(sender);
|
|
3897
|
+
case 1:
|
|
3898
|
+
erc20Balance = _context9.v;
|
|
3899
|
+
erc20TotalFees = calculateTotalAmount(erc20Spenders); //If the wallet does not have enough erc20 token to pay for fees, throw an error.
|
|
3900
|
+
if (!(erc20Balance < erc20TotalFees)) {
|
|
3901
|
+
_context9.n = 2;
|
|
3902
|
+
break;
|
|
3903
|
+
}
|
|
3904
|
+
throw new Error("Wallet does not have enough erc20 token to pay for fees. Total fees: ".concat(getTokenAmountDisplay(erc20TotalFees), ", balance: ").concat(getTokenAmountDisplay(erc20Balance), "."));
|
|
3905
|
+
case 2:
|
|
3906
|
+
return _context9.a(2);
|
|
3907
|
+
}
|
|
3908
|
+
}, _callee9);
|
|
3909
|
+
}));
|
|
3910
|
+
return function checkErc20BalanceBelowFees(_x1, _x10, _x11, _x12) {
|
|
3911
|
+
return _ref13.apply(this, arguments);
|
|
3649
3912
|
};
|
|
3650
3913
|
}();
|
|
3651
3914
|
|
|
@@ -4037,7 +4300,6 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4037
4300
|
};
|
|
4038
4301
|
_context.n = 8;
|
|
4039
4302
|
return contractCallWithFees({
|
|
4040
|
-
totalFees: bonds,
|
|
4041
4303
|
options: {
|
|
4042
4304
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
4043
4305
|
// Disable multicall because multicall makes more complex due to disputeInitiator in this version.
|
|
@@ -4048,7 +4310,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4048
4310
|
rpcClient: this.rpcClient,
|
|
4049
4311
|
tokenSpenders: [{
|
|
4050
4312
|
address: this.arbitrationPolicyUmaClient.address,
|
|
4051
|
-
amount: bonds
|
|
4313
|
+
amount: bonds,
|
|
4314
|
+
// Currently, only WIP is supported as the whitelisted dispute bond token.
|
|
4315
|
+
token: WIP_TOKEN_ADDRESS
|
|
4052
4316
|
}],
|
|
4053
4317
|
contractCall: contractCall,
|
|
4054
4318
|
encodedTxs: [encodedTxData],
|
|
@@ -4387,7 +4651,6 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4387
4651
|
};
|
|
4388
4652
|
_context5.n = 5;
|
|
4389
4653
|
return contractCallWithFees({
|
|
4390
|
-
totalFees: bond,
|
|
4391
4654
|
options: {
|
|
4392
4655
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
4393
4656
|
// Disable auto approve because msg.sender is ipAccount instead of wallet.
|
|
@@ -4401,7 +4664,9 @@ var DisputeClient = /*#__PURE__*/function () {
|
|
|
4401
4664
|
contractCall: contractCall,
|
|
4402
4665
|
tokenSpenders: [{
|
|
4403
4666
|
address: this.arbitrationPolicyUmaClient.address,
|
|
4404
|
-
amount: bond
|
|
4667
|
+
amount: bond,
|
|
4668
|
+
// Currently, only WIP is supported as the whitelisted dispute bond token.
|
|
4669
|
+
token: WIP_TOKEN_ADDRESS
|
|
4405
4670
|
}],
|
|
4406
4671
|
encodedTxs: [encodedData],
|
|
4407
4672
|
wallet: this.wallet,
|
|
@@ -6016,13 +6281,13 @@ var predictMintingLicenseFee = /*#__PURE__*/function () {
|
|
|
6016
6281
|
}();
|
|
6017
6282
|
var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
6018
6283
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
|
|
6019
|
-
var derivData, rpcClient, chainId, wallet, sender, walletAddress,
|
|
6284
|
+
var derivData, rpcClient, chainId, wallet, sender, walletAddress, mintFees, i, mintFee;
|
|
6020
6285
|
return _regenerator().w(function (_context2) {
|
|
6021
6286
|
while (1) switch (_context2.n) {
|
|
6022
6287
|
case 0:
|
|
6023
6288
|
derivData = _ref3.derivData, rpcClient = _ref3.rpcClient, chainId = _ref3.chainId, wallet = _ref3.wallet, sender = _ref3.sender;
|
|
6024
6289
|
walletAddress = sender || wallet.account.address;
|
|
6025
|
-
|
|
6290
|
+
mintFees = [];
|
|
6026
6291
|
i = 0;
|
|
6027
6292
|
case 1:
|
|
6028
6293
|
if (!(i < derivData.parentIpIds.length)) {
|
|
@@ -6030,7 +6295,7 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6030
6295
|
break;
|
|
6031
6296
|
}
|
|
6032
6297
|
_context2.n = 2;
|
|
6033
|
-
return
|
|
6298
|
+
return calculateLicenseMintFee({
|
|
6034
6299
|
predictMintingFeeRequest: {
|
|
6035
6300
|
licensorIpId: derivData.parentIpIds[i],
|
|
6036
6301
|
licenseTemplate: derivData.licenseTemplate,
|
|
@@ -6044,14 +6309,16 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6044
6309
|
walletAddress: walletAddress
|
|
6045
6310
|
});
|
|
6046
6311
|
case 2:
|
|
6047
|
-
|
|
6048
|
-
|
|
6312
|
+
mintFee = _context2.v;
|
|
6313
|
+
if (mintFee.amount > 0n) {
|
|
6314
|
+
mintFees.push(mintFee);
|
|
6315
|
+
}
|
|
6049
6316
|
case 3:
|
|
6050
6317
|
i++;
|
|
6051
6318
|
_context2.n = 1;
|
|
6052
6319
|
break;
|
|
6053
6320
|
case 4:
|
|
6054
|
-
return _context2.a(2,
|
|
6321
|
+
return _context2.a(2, mintFees);
|
|
6055
6322
|
}
|
|
6056
6323
|
}, _callee2);
|
|
6057
6324
|
}));
|
|
@@ -6059,9 +6326,9 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
|
|
|
6059
6326
|
return _ref4.apply(this, arguments);
|
|
6060
6327
|
};
|
|
6061
6328
|
}();
|
|
6062
|
-
var
|
|
6329
|
+
var calculateLicenseMintFee = /*#__PURE__*/function () {
|
|
6063
6330
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
|
|
6064
|
-
var predictMintingFeeRequest, rpcClient, chainId, walletAddress,
|
|
6331
|
+
var predictMintingFeeRequest, rpcClient, chainId, walletAddress, _yield$predictMinting, currencyToken, tokenAmount;
|
|
6065
6332
|
return _regenerator().w(function (_context3) {
|
|
6066
6333
|
while (1) switch (_context3.n) {
|
|
6067
6334
|
case 0:
|
|
@@ -6074,24 +6341,23 @@ var calculateLicenseWipMintFee = /*#__PURE__*/function () {
|
|
|
6074
6341
|
walletAddress: walletAddress
|
|
6075
6342
|
});
|
|
6076
6343
|
case 1:
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
return _context3.a(2, fee.tokenAmount);
|
|
6344
|
+
_yield$predictMinting = _context3.v;
|
|
6345
|
+
currencyToken = _yield$predictMinting.currencyToken;
|
|
6346
|
+
tokenAmount = _yield$predictMinting.tokenAmount;
|
|
6347
|
+
return _context3.a(2, {
|
|
6348
|
+
token: currencyToken,
|
|
6349
|
+
amount: tokenAmount
|
|
6350
|
+
});
|
|
6085
6351
|
}
|
|
6086
6352
|
}, _callee3);
|
|
6087
6353
|
}));
|
|
6088
|
-
return function
|
|
6354
|
+
return function calculateLicenseMintFee(_x3) {
|
|
6089
6355
|
return _ref6.apply(this, arguments);
|
|
6090
6356
|
};
|
|
6091
6357
|
}();
|
|
6092
|
-
var
|
|
6358
|
+
var calculateSPGMintFee = /*#__PURE__*/function () {
|
|
6093
6359
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(spgNftClient) {
|
|
6094
|
-
var token;
|
|
6360
|
+
var token, amount;
|
|
6095
6361
|
return _regenerator().w(function (_context4) {
|
|
6096
6362
|
while (1) switch (_context4.n) {
|
|
6097
6363
|
case 0:
|
|
@@ -6099,20 +6365,24 @@ var calculateSPGWipMintFee = /*#__PURE__*/function () {
|
|
|
6099
6365
|
return spgNftClient.mintFeeToken();
|
|
6100
6366
|
case 1:
|
|
6101
6367
|
token = _context4.v;
|
|
6102
|
-
|
|
6103
|
-
|
|
6368
|
+
_context4.n = 2;
|
|
6369
|
+
return spgNftClient.mintFee();
|
|
6370
|
+
case 2:
|
|
6371
|
+
amount = _context4.v;
|
|
6372
|
+
if (!(amount > 0n)) {
|
|
6373
|
+
_context4.n = 3;
|
|
6104
6374
|
break;
|
|
6105
6375
|
}
|
|
6106
|
-
return _context4.a(2,
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6376
|
+
return _context4.a(2, {
|
|
6377
|
+
token: token,
|
|
6378
|
+
amount: amount
|
|
6379
|
+
});
|
|
6110
6380
|
case 3:
|
|
6111
|
-
return _context4.a(2
|
|
6381
|
+
return _context4.a(2);
|
|
6112
6382
|
}
|
|
6113
6383
|
}, _callee4);
|
|
6114
6384
|
}));
|
|
6115
|
-
return function
|
|
6385
|
+
return function calculateSPGMintFee(_x4) {
|
|
6116
6386
|
return _ref7.apply(this, arguments);
|
|
6117
6387
|
};
|
|
6118
6388
|
}();
|
|
@@ -6863,7 +7133,7 @@ var mergeSpenders = function mergeSpenders(previousSpenders, newSpenders) {
|
|
|
6863
7133
|
return acc;
|
|
6864
7134
|
}
|
|
6865
7135
|
var existingSpender = acc.find(function (s) {
|
|
6866
|
-
return s.address === spender.address;
|
|
7136
|
+
return s.address === spender.address && s.token === spender.token;
|
|
6867
7137
|
});
|
|
6868
7138
|
if (!existingSpender) {
|
|
6869
7139
|
acc.push(_objectSpread2(_objectSpread2({}, spender), {}, {
|
|
@@ -6929,7 +7199,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6929
7199
|
var _currentRequest$extra;
|
|
6930
7200
|
var res = _step.value;
|
|
6931
7201
|
var spenders = res.spenders,
|
|
6932
|
-
totalFees = res.totalFees,
|
|
6933
7202
|
encodedTxData = res.encodedTxData,
|
|
6934
7203
|
workflowClient = res.workflowClient,
|
|
6935
7204
|
isUseMulticall3 = res.isUseMulticall3,
|
|
@@ -6942,7 +7211,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6942
7211
|
if (!aggregateRegistrationRequest[targetAddress]) {
|
|
6943
7212
|
aggregateRegistrationRequest[targetAddress] = {
|
|
6944
7213
|
spenders: [],
|
|
6945
|
-
totalFees: 0n,
|
|
6946
7214
|
encodedTxData: [],
|
|
6947
7215
|
contractCall: [],
|
|
6948
7216
|
extraData: []
|
|
@@ -6950,7 +7218,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6950
7218
|
}
|
|
6951
7219
|
var currentRequest = aggregateRegistrationRequest[targetAddress];
|
|
6952
7220
|
currentRequest.spenders = mergeSpenders(currentRequest.spenders, spenders || []);
|
|
6953
|
-
currentRequest.totalFees += totalFees || 0n;
|
|
6954
7221
|
currentRequest.encodedTxData = currentRequest.encodedTxData.concat(encodedTxData);
|
|
6955
7222
|
currentRequest.extraData = (_currentRequest$extra = currentRequest.extraData) === null || _currentRequest$extra === void 0 ? void 0 : _currentRequest$extra.concat(extraData || undefined);
|
|
6956
7223
|
if (isUseMulticall3 || disableMulticallWhenPossible) {
|
|
@@ -6977,19 +7244,20 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
|
|
|
6977
7244
|
};
|
|
6978
7245
|
var handleMulticall = /*#__PURE__*/function () {
|
|
6979
7246
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
6980
|
-
var
|
|
7247
|
+
var _options$wipOptions;
|
|
7248
|
+
var transferWorkflowRequests, multicall3Address, options, rpcClient, wallet, walletAddress, aggregateRegistrationRequest, txResponses, _loop2, key, _t2, _t3;
|
|
6981
7249
|
return _regenerator().w(function (_context3) {
|
|
6982
7250
|
while (1) switch (_context3.n) {
|
|
6983
7251
|
case 0:
|
|
6984
|
-
transferWorkflowRequests = _ref.transferWorkflowRequests, multicall3Address = _ref.multicall3Address,
|
|
6985
|
-
aggregateRegistrationRequest = aggregateTransformIpRegistrationWorkflow(transferWorkflowRequests, multicall3Address, (wipOptions === null || wipOptions === void 0 ? void 0 : wipOptions.useMulticallWhenPossible) === false);
|
|
7252
|
+
transferWorkflowRequests = _ref.transferWorkflowRequests, multicall3Address = _ref.multicall3Address, options = _ref.options, rpcClient = _ref.rpcClient, wallet = _ref.wallet, walletAddress = _ref.walletAddress;
|
|
7253
|
+
aggregateRegistrationRequest = aggregateTransformIpRegistrationWorkflow(transferWorkflowRequests, multicall3Address, (options === null || options === void 0 || (_options$wipOptions = options.wipOptions) === null || _options$wipOptions === void 0 ? void 0 : _options$wipOptions.useMulticallWhenPossible) === false);
|
|
6986
7254
|
txResponses = [];
|
|
6987
7255
|
_loop2 = /*#__PURE__*/_regenerator().m(function _loop2() {
|
|
6988
|
-
var _aggregateRegistratio, spenders,
|
|
7256
|
+
var _aggregateRegistratio, spenders, encodedTxData, contractCall, contractCalls, useMulticallWhenPossible, txResponse;
|
|
6989
7257
|
return _regenerator().w(function (_context2) {
|
|
6990
7258
|
while (1) switch (_context2.n) {
|
|
6991
7259
|
case 0:
|
|
6992
|
-
_aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders,
|
|
7260
|
+
_aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders, encodedTxData = _aggregateRegistratio.encodedTxData, contractCall = _aggregateRegistratio.contractCall;
|
|
6993
7261
|
contractCalls = /*#__PURE__*/function () {
|
|
6994
7262
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
6995
7263
|
var txHashes, _iterator2, _step2, call, txHash, _t;
|
|
@@ -7037,12 +7305,11 @@ var handleMulticall = /*#__PURE__*/function () {
|
|
|
7037
7305
|
useMulticallWhenPossible = key === multicall3Address ? true : false;
|
|
7038
7306
|
_context2.n = 1;
|
|
7039
7307
|
return contractCallWithFees({
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
|
|
7308
|
+
options: _objectSpread2(_objectSpread2({}, options), {}, {
|
|
7309
|
+
wipOptions: _objectSpread2(_objectSpread2({}, options === null || options === void 0 ? void 0 : options.wipOptions), {}, {
|
|
7043
7310
|
useMulticallWhenPossible: useMulticallWhenPossible
|
|
7044
7311
|
})
|
|
7045
|
-
},
|
|
7312
|
+
}),
|
|
7046
7313
|
multicall3Address: multicall3Address,
|
|
7047
7314
|
rpcClient: rpcClient,
|
|
7048
7315
|
tokenSpenders: spenders,
|
|
@@ -7161,7 +7428,7 @@ var transformRegistrationRequest = /*#__PURE__*/function () {
|
|
|
7161
7428
|
*/
|
|
7162
7429
|
var handleRegisterRequest = /*#__PURE__*/function () {
|
|
7163
7430
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
|
|
7164
|
-
var request, rpcClient, wallet, chainId, ipIdAddress, baseRequest, calculatedDeadline, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, _yield$validateLicens, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData,
|
|
7431
|
+
var request, rpcClient, wallet, chainId, ipIdAddress, baseRequest, calculatedDeadline, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, _yield$validateLicens, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, derivativeMintingFee;
|
|
7165
7432
|
return _regenerator().w(function (_context2) {
|
|
7166
7433
|
while (1) switch (_context2.n) {
|
|
7167
7434
|
case 0:
|
|
@@ -7253,7 +7520,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7253
7520
|
wallet: wallet
|
|
7254
7521
|
});
|
|
7255
7522
|
case 9:
|
|
7256
|
-
|
|
7523
|
+
derivativeMintingFee = _context2.v;
|
|
7257
7524
|
if (!("royaltyShares" in request)) {
|
|
7258
7525
|
_context2.n = 11;
|
|
7259
7526
|
break;
|
|
@@ -7268,7 +7535,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7268
7535
|
wallet: wallet,
|
|
7269
7536
|
chainId: chainId,
|
|
7270
7537
|
royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient,
|
|
7271
|
-
|
|
7538
|
+
derivativeMintingFee: derivativeMintingFee,
|
|
7272
7539
|
royaltyShares: request.royaltyShares
|
|
7273
7540
|
});
|
|
7274
7541
|
case 10:
|
|
@@ -7284,7 +7551,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7284
7551
|
wallet: wallet,
|
|
7285
7552
|
chainId: chainId,
|
|
7286
7553
|
derivativeWorkflowsClient: derivativeWorkflowsClient,
|
|
7287
|
-
|
|
7554
|
+
derivativeMintingFee: derivativeMintingFee
|
|
7288
7555
|
});
|
|
7289
7556
|
case 12:
|
|
7290
7557
|
return _context2.a(2, _context2.v);
|
|
@@ -7305,11 +7572,11 @@ var handleRegisterRequest = /*#__PURE__*/function () {
|
|
|
7305
7572
|
*/
|
|
7306
7573
|
var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
|
|
7307
7574
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
|
|
7308
|
-
var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient,
|
|
7575
|
+
var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient, derivativeMintingFee, signature, transformRequest, spenders;
|
|
7309
7576
|
return _regenerator().w(function (_context3) {
|
|
7310
7577
|
while (1) switch (_context3.n) {
|
|
7311
7578
|
case 0:
|
|
7312
|
-
request = _ref5.request, calculatedDeadline = _ref5.calculatedDeadline, ipIdAddress = _ref5.ipIdAddress, wallet = _ref5.wallet, chainId = _ref5.chainId, derivativeWorkflowsClient = _ref5.derivativeWorkflowsClient,
|
|
7579
|
+
request = _ref5.request, calculatedDeadline = _ref5.calculatedDeadline, ipIdAddress = _ref5.ipIdAddress, wallet = _ref5.wallet, chainId = _ref5.chainId, derivativeWorkflowsClient = _ref5.derivativeWorkflowsClient, derivativeMintingFee = _ref5.derivativeMintingFee;
|
|
7313
7580
|
_context3.n = 1;
|
|
7314
7581
|
return generateOperationSignature({
|
|
7315
7582
|
ipIdAddress: ipIdAddress,
|
|
@@ -7327,15 +7594,16 @@ var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
|
|
|
7327
7594
|
signature: signature
|
|
7328
7595
|
}
|
|
7329
7596
|
});
|
|
7597
|
+
spenders = derivativeMintingFee.map(function (fee) {
|
|
7598
|
+
return _objectSpread2({
|
|
7599
|
+
address: derivativeWorkflowsClient.address
|
|
7600
|
+
}, fee);
|
|
7601
|
+
});
|
|
7330
7602
|
return _context3.a(2, {
|
|
7331
7603
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7332
7604
|
transformRequest: transformRequest,
|
|
7333
7605
|
isUseMulticall3: false,
|
|
7334
|
-
spenders:
|
|
7335
|
-
address: derivativeWorkflowsClient.address,
|
|
7336
|
-
amount: totalFees
|
|
7337
|
-
}],
|
|
7338
|
-
totalFees: totalFees,
|
|
7606
|
+
spenders: spenders,
|
|
7339
7607
|
contractCall: function contractCall() {
|
|
7340
7608
|
return derivativeWorkflowsClient.registerIpAndMakeDerivative(transformRequest);
|
|
7341
7609
|
},
|
|
@@ -7476,11 +7744,11 @@ var transferRegisterIpAndAttachPilTermsRequest = /*#__PURE__*/function () {
|
|
|
7476
7744
|
*/
|
|
7477
7745
|
var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE__*/function () {
|
|
7478
7746
|
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref1) {
|
|
7479
|
-
var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient,
|
|
7747
|
+
var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient, derivativeMintingFee, royaltyShares, signature, transformRequest, spenders;
|
|
7480
7748
|
return _regenerator().w(function (_context6) {
|
|
7481
7749
|
while (1) switch (_context6.n) {
|
|
7482
7750
|
case 0:
|
|
7483
|
-
request = _ref1.request, calculatedDeadline = _ref1.calculatedDeadline, ipIdAddress = _ref1.ipIdAddress, wallet = _ref1.wallet, chainId = _ref1.chainId, royaltyTokenDistributionWorkflowsClient = _ref1.royaltyTokenDistributionWorkflowsClient,
|
|
7751
|
+
request = _ref1.request, calculatedDeadline = _ref1.calculatedDeadline, ipIdAddress = _ref1.ipIdAddress, wallet = _ref1.wallet, chainId = _ref1.chainId, royaltyTokenDistributionWorkflowsClient = _ref1.royaltyTokenDistributionWorkflowsClient, derivativeMintingFee = _ref1.derivativeMintingFee, royaltyShares = _ref1.royaltyShares;
|
|
7484
7752
|
_context6.n = 1;
|
|
7485
7753
|
return generateOperationSignature({
|
|
7486
7754
|
ipIdAddress: ipIdAddress,
|
|
@@ -7498,15 +7766,16 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
|
|
|
7498
7766
|
signature: signature
|
|
7499
7767
|
}
|
|
7500
7768
|
});
|
|
7769
|
+
spenders = derivativeMintingFee.map(function (fee) {
|
|
7770
|
+
return _objectSpread2({
|
|
7771
|
+
address: royaltyTokenDistributionWorkflowsClient.address
|
|
7772
|
+
}, fee);
|
|
7773
|
+
});
|
|
7501
7774
|
return _context6.a(2, {
|
|
7502
7775
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7503
7776
|
transformRequest: transformRequest,
|
|
7504
7777
|
isUseMulticall3: false,
|
|
7505
|
-
spenders:
|
|
7506
|
-
address: royaltyTokenDistributionWorkflowsClient.address,
|
|
7507
|
-
amount: totalFees
|
|
7508
|
-
}],
|
|
7509
|
-
totalFees: totalFees,
|
|
7778
|
+
spenders: spenders,
|
|
7510
7779
|
contractCall: function contractCall() {
|
|
7511
7780
|
return royaltyTokenDistributionWorkflowsClient.registerIpAndMakeDerivativeAndDeployRoyaltyVault(transformRequest);
|
|
7512
7781
|
},
|
|
@@ -7554,7 +7823,7 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
|
|
|
7554
7823
|
var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
7555
7824
|
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref11) {
|
|
7556
7825
|
var _request$allowDuplica;
|
|
7557
|
-
var request, rpcClient, wallet, chainId, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, isPublicMinting, nftMintFee, baseRequest, _yield$validateLicens2, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData,
|
|
7826
|
+
var request, rpcClient, wallet, chainId, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, isPublicMinting, nftMintFee, baseRequest, _yield$validateLicens2, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, derivativeMintingFee, requestWithDeriv;
|
|
7558
7827
|
return _regenerator().w(function (_context7) {
|
|
7559
7828
|
while (1) switch (_context7.n) {
|
|
7560
7829
|
case 0:
|
|
@@ -7567,7 +7836,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7567
7836
|
case 1:
|
|
7568
7837
|
isPublicMinting = _context7.v;
|
|
7569
7838
|
_context7.n = 2;
|
|
7570
|
-
return
|
|
7839
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(rpcClient, request.spgNftContract));
|
|
7571
7840
|
case 2:
|
|
7572
7841
|
nftMintFee = _context7.v;
|
|
7573
7842
|
baseRequest = {
|
|
@@ -7633,7 +7902,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7633
7902
|
wallet: wallet
|
|
7634
7903
|
});
|
|
7635
7904
|
case 7:
|
|
7636
|
-
|
|
7905
|
+
derivativeMintingFee = _context7.v;
|
|
7637
7906
|
requestWithDeriv = _objectSpread2(_objectSpread2({}, baseRequest), {}, {
|
|
7638
7907
|
derivData: derivData
|
|
7639
7908
|
});
|
|
@@ -7647,7 +7916,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7647
7916
|
}),
|
|
7648
7917
|
nftMintFee: nftMintFee,
|
|
7649
7918
|
isPublicMinting: isPublicMinting,
|
|
7650
|
-
|
|
7919
|
+
derivativeMintingFee: derivativeMintingFee,
|
|
7651
7920
|
royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient
|
|
7652
7921
|
}));
|
|
7653
7922
|
case 8:
|
|
@@ -7658,7 +7927,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
|
|
|
7658
7927
|
derivativeWorkflowsClient: derivativeWorkflowsClient,
|
|
7659
7928
|
nftMintFee: nftMintFee,
|
|
7660
7929
|
isPublicMinting: isPublicMinting,
|
|
7661
|
-
|
|
7930
|
+
derivativeMintingFee: derivativeMintingFee
|
|
7662
7931
|
}));
|
|
7663
7932
|
case 9:
|
|
7664
7933
|
throw new Error("Invalid mint and register request type");
|
|
@@ -7693,11 +7962,9 @@ var transformMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
|
|
|
7693
7962
|
contractCall: function contractCall() {
|
|
7694
7963
|
return royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(transformRequest);
|
|
7695
7964
|
},
|
|
7696
|
-
spenders: [{
|
|
7697
|
-
address: transformRequest.spgNftContract
|
|
7698
|
-
|
|
7699
|
-
}],
|
|
7700
|
-
totalFees: nftMintFee,
|
|
7965
|
+
spenders: _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
7966
|
+
address: transformRequest.spgNftContract
|
|
7967
|
+
}, nftMintFee)] : []),
|
|
7701
7968
|
encodedTxData: {
|
|
7702
7969
|
to: royaltyTokenDistributionWorkflowsClient.address,
|
|
7703
7970
|
data: viem.encodeFunctionData({
|
|
@@ -7723,15 +7990,14 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
|
|
|
7723
7990
|
nftMintFee = _ref14.nftMintFee,
|
|
7724
7991
|
isPublicMinting = _ref14.isPublicMinting,
|
|
7725
7992
|
maxLicenseTokens = _ref14.maxLicenseTokens;
|
|
7993
|
+
var spenders = nftMintFee ? [_objectSpread2({
|
|
7994
|
+
address: request.spgNftContract
|
|
7995
|
+
}, nftMintFee)] : [];
|
|
7726
7996
|
return {
|
|
7727
7997
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7728
7998
|
transformRequest: request,
|
|
7729
|
-
isUseMulticall3: isPublicMinting,
|
|
7730
|
-
spenders:
|
|
7731
|
-
address: request.spgNftContract,
|
|
7732
|
-
amount: nftMintFee
|
|
7733
|
-
}],
|
|
7734
|
-
totalFees: nftMintFee,
|
|
7999
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
8000
|
+
spenders: spenders,
|
|
7735
8001
|
encodedTxData: {
|
|
7736
8002
|
to: licenseAttachmentWorkflowsClient.address,
|
|
7737
8003
|
data: viem.encodeFunctionData({
|
|
@@ -7755,33 +8021,33 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
|
|
|
7755
8021
|
* Transforms a request for the `mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens` contract method.
|
|
7756
8022
|
*/
|
|
7757
8023
|
var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest = function transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest(_ref15) {
|
|
8024
|
+
var _derivativeMintingFee;
|
|
7758
8025
|
var request = _ref15.request,
|
|
7759
8026
|
nftMintFee = _ref15.nftMintFee,
|
|
7760
8027
|
isPublicMinting = _ref15.isPublicMinting,
|
|
7761
|
-
|
|
8028
|
+
derivativeMintingFee = _ref15.derivativeMintingFee,
|
|
7762
8029
|
royaltyTokenDistributionWorkflowsClient = _ref15.royaltyTokenDistributionWorkflowsClient;
|
|
7763
8030
|
var _getRoyaltyShares2 = getRoyaltyShares(request.royaltyShares),
|
|
7764
8031
|
royaltyShares = _getRoyaltyShares2.royaltyShares;
|
|
7765
8032
|
/**
|
|
7766
|
-
* TODO: Consider the scenario where the SPG token is WIP and the derivative token is ERC20.
|
|
7767
8033
|
* The SDK should handle both cases in the `contractCallWithFees` method.
|
|
7768
8034
|
* Currently, it only supports WIP tokens and does not handle ERC20 tokens, such as approving ERC20 tokens.
|
|
7769
8035
|
*/
|
|
7770
8036
|
var transformRequest = _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7771
8037
|
royaltyShares: royaltyShares
|
|
7772
8038
|
});
|
|
8039
|
+
var spenders = (_derivativeMintingFee = derivativeMintingFee.map(function (fee) {
|
|
8040
|
+
return _objectSpread2({
|
|
8041
|
+
address: royaltyTokenDistributionWorkflowsClient.address
|
|
8042
|
+
}, fee);
|
|
8043
|
+
})).concat.apply(_derivativeMintingFee, _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
8044
|
+
address: request.spgNftContract
|
|
8045
|
+
}, nftMintFee)] : []));
|
|
7773
8046
|
return {
|
|
7774
8047
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7775
8048
|
transformRequest: transformRequest,
|
|
7776
|
-
isUseMulticall3: isPublicMinting,
|
|
7777
|
-
spenders:
|
|
7778
|
-
address: royaltyTokenDistributionWorkflowsClient.address,
|
|
7779
|
-
amount: totalDerivativeMintingFee
|
|
7780
|
-
}, {
|
|
7781
|
-
address: request.spgNftContract,
|
|
7782
|
-
amount: nftMintFee
|
|
7783
|
-
}],
|
|
7784
|
-
totalFees: totalDerivativeMintingFee + nftMintFee,
|
|
8049
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
8050
|
+
spenders: spenders,
|
|
7785
8051
|
encodedTxData: {
|
|
7786
8052
|
to: royaltyTokenDistributionWorkflowsClient.address,
|
|
7787
8053
|
data: viem.encodeFunctionData({
|
|
@@ -7801,23 +8067,24 @@ var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
|
|
|
7801
8067
|
*/
|
|
7802
8068
|
|
|
7803
8069
|
var transferMintAndRegisterIpAndMakeDerivativeRequest = function transferMintAndRegisterIpAndMakeDerivativeRequest(_ref16) {
|
|
8070
|
+
var _derivativeMintingFee2;
|
|
7804
8071
|
var request = _ref16.request,
|
|
7805
8072
|
derivativeWorkflowsClient = _ref16.derivativeWorkflowsClient,
|
|
7806
8073
|
nftMintFee = _ref16.nftMintFee,
|
|
7807
8074
|
isPublicMinting = _ref16.isPublicMinting,
|
|
7808
|
-
|
|
8075
|
+
derivativeMintingFee = _ref16.derivativeMintingFee;
|
|
8076
|
+
var spenders = (_derivativeMintingFee2 = derivativeMintingFee.map(function (fee) {
|
|
8077
|
+
return _objectSpread2({
|
|
8078
|
+
address: derivativeWorkflowsClient.address
|
|
8079
|
+
}, fee);
|
|
8080
|
+
})).concat.apply(_derivativeMintingFee2, _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
8081
|
+
address: request.spgNftContract
|
|
8082
|
+
}, nftMintFee)] : []));
|
|
7809
8083
|
return {
|
|
7810
8084
|
// The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
|
|
7811
8085
|
transformRequest: request,
|
|
7812
|
-
isUseMulticall3: isPublicMinting,
|
|
7813
|
-
spenders:
|
|
7814
|
-
address: derivativeWorkflowsClient.address,
|
|
7815
|
-
amount: totalDerivativeMintingFee
|
|
7816
|
-
}, {
|
|
7817
|
-
address: request.spgNftContract,
|
|
7818
|
-
amount: nftMintFee
|
|
7819
|
-
}],
|
|
7820
|
-
totalFees: totalDerivativeMintingFee + nftMintFee,
|
|
8086
|
+
isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
|
|
8087
|
+
spenders: spenders,
|
|
7821
8088
|
encodedTxData: {
|
|
7822
8089
|
to: derivativeWorkflowsClient.address,
|
|
7823
8090
|
data: viem.encodeFunctionData({
|
|
@@ -7921,7 +8188,7 @@ var transferDistributeRoyaltyTokensRequest = /*#__PURE__*/function () {
|
|
|
7921
8188
|
}();
|
|
7922
8189
|
var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
7923
8190
|
var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref19) {
|
|
7924
|
-
var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId,
|
|
8191
|
+
var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId, requests, ipRoyaltyVaults, _iterator, _step, _loop, _t;
|
|
7925
8192
|
return _regenerator().w(function (_context0) {
|
|
7926
8193
|
while (1) switch (_context0.p = _context0.n) {
|
|
7927
8194
|
case 0:
|
|
@@ -7930,13 +8197,17 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7930
8197
|
_context0.n = 1;
|
|
7931
8198
|
break;
|
|
7932
8199
|
}
|
|
7933
|
-
return _context0.a(2,
|
|
8200
|
+
return _context0.a(2, {
|
|
8201
|
+
requests: [],
|
|
8202
|
+
ipRoyaltyVaults: []
|
|
8203
|
+
});
|
|
7934
8204
|
case 1:
|
|
7935
|
-
|
|
8205
|
+
requests = [];
|
|
8206
|
+
ipRoyaltyVaults = [];
|
|
7936
8207
|
_iterator = _createForOfIteratorHelper(royaltyDistributionRequests);
|
|
7937
8208
|
_context0.p = 2;
|
|
7938
8209
|
_loop = /*#__PURE__*/_regenerator().m(function _loop() {
|
|
7939
|
-
var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, response;
|
|
8210
|
+
var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, ipRoyaltyVaultItem, response;
|
|
7940
8211
|
return _regenerator().w(function (_context9) {
|
|
7941
8212
|
while (1) switch (_context9.n) {
|
|
7942
8213
|
case 0:
|
|
@@ -7955,13 +8226,15 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7955
8226
|
return getCalculatedDeadline(rpcClient, req.deadline);
|
|
7956
8227
|
case 1:
|
|
7957
8228
|
calculatedDeadline = _context9.v;
|
|
8229
|
+
// The ipRoyaltyVaultItem must be found, otherwise, the request is invalid.
|
|
8230
|
+
ipRoyaltyVaultItem = ipRoyaltyVault.find(function (item) {
|
|
8231
|
+
return item.ipId === filterIpIdAndTokenId.ipId;
|
|
8232
|
+
});
|
|
7958
8233
|
_context9.n = 2;
|
|
7959
8234
|
return transferDistributeRoyaltyTokensRequest({
|
|
7960
8235
|
request: {
|
|
7961
8236
|
ipId: filterIpIdAndTokenId.ipId,
|
|
7962
|
-
ipRoyaltyVault: ipRoyaltyVault
|
|
7963
|
-
return item.ipId === filterIpIdAndTokenId.ipId;
|
|
7964
|
-
}).ipRoyaltyVault,
|
|
8237
|
+
ipRoyaltyVault: ipRoyaltyVaultItem.ipRoyaltyVault,
|
|
7965
8238
|
royaltyShares: royaltyShares,
|
|
7966
8239
|
totalAmount: totalAmount,
|
|
7967
8240
|
deadline: calculatedDeadline
|
|
@@ -7972,7 +8245,8 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
7972
8245
|
});
|
|
7973
8246
|
case 2:
|
|
7974
8247
|
response = _context9.v;
|
|
7975
|
-
|
|
8248
|
+
requests.push(response);
|
|
8249
|
+
ipRoyaltyVaults.push(ipRoyaltyVaultItem);
|
|
7976
8250
|
case 3:
|
|
7977
8251
|
return _context9.a(2);
|
|
7978
8252
|
}
|
|
@@ -8000,7 +8274,10 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
8000
8274
|
_iterator.f();
|
|
8001
8275
|
return _context0.f(7);
|
|
8002
8276
|
case 8:
|
|
8003
|
-
return _context0.a(2,
|
|
8277
|
+
return _context0.a(2, {
|
|
8278
|
+
requests: requests,
|
|
8279
|
+
ipRoyaltyVaults: ipRoyaltyVaults
|
|
8280
|
+
});
|
|
8004
8281
|
}
|
|
8005
8282
|
}, _callee9, null, [[2, 6, 7, 8]]);
|
|
8006
8283
|
}));
|
|
@@ -8009,6 +8286,22 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
|
|
|
8009
8286
|
};
|
|
8010
8287
|
}();
|
|
8011
8288
|
|
|
8289
|
+
/**
|
|
8290
|
+
* Checks if the spenders contain ERC20 tokens with amount above zero.
|
|
8291
|
+
* Due to the `msg.sender` context limitations, if the spenders contain ERC20 tokens with amount above zero, the multicall3 cannot be used.
|
|
8292
|
+
*/
|
|
8293
|
+
|
|
8294
|
+
var isErc20AboveZero = function isErc20AboveZero(spenders) {
|
|
8295
|
+
var erc20Spenders = spenders.filter(function (spender) {
|
|
8296
|
+
return spender.token !== WIP_TOKEN_ADDRESS;
|
|
8297
|
+
});
|
|
8298
|
+
var erc20TotalAmount = erc20Spenders.reduce(function (acc, spender) {
|
|
8299
|
+
var _spender$amount;
|
|
8300
|
+
return acc + ((_spender$amount = spender.amount) !== null && _spender$amount !== void 0 ? _spender$amount : 0n);
|
|
8301
|
+
}, 0n);
|
|
8302
|
+
return erc20TotalAmount > 0n;
|
|
8303
|
+
};
|
|
8304
|
+
|
|
8012
8305
|
var setMaxLicenseTokens = /*#__PURE__*/function () {
|
|
8013
8306
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
8014
8307
|
var maxLicenseTokensData, licensorIpId, licenseTermsIds, totalLicenseTokenLimitHookClient, templateAddress, licenseTermsMaxLimitTxHashes, i, maxLicenseTokens, txHash;
|
|
@@ -8075,6 +8368,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8075
8368
|
this.multicall3Client = new Multicall3Client(rpcClient, wallet);
|
|
8076
8369
|
this.spgNftClient = new SpgnftImplReadOnlyClient(rpcClient);
|
|
8077
8370
|
this.totalLicenseTokenLimitHookClient = new TotalLicenseTokenLimitHookClient(rpcClient, wallet);
|
|
8371
|
+
this.licenseTokenClient = new LicenseTokenClient(rpcClient, wallet);
|
|
8078
8372
|
this.rpcClient = rpcClient;
|
|
8079
8373
|
this.wallet = wallet;
|
|
8080
8374
|
this.chainId = chainId;
|
|
@@ -8384,6 +8678,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8384
8678
|
* The license terms must be attached to the parent IP before calling this function.
|
|
8385
8679
|
* All IPs attached default license terms by default.
|
|
8386
8680
|
* The derivative IP owner must be the caller or an authorized operator.
|
|
8681
|
+
*
|
|
8682
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link linkDerivative} instead.
|
|
8683
|
+
* This method will become internal soon.
|
|
8684
|
+
*
|
|
8685
|
+
* @example Migration Example
|
|
8686
|
+
* ```typescript
|
|
8687
|
+
* // Before (deprecated):
|
|
8688
|
+
* await client.ipAsset.registerDerivative({
|
|
8689
|
+
* childIpId: '0x...',
|
|
8690
|
+
* parentIpIds: ['0x...'],
|
|
8691
|
+
* licenseTermsIds: [1n]
|
|
8692
|
+
* });
|
|
8693
|
+
*
|
|
8694
|
+
* // After (recommended):
|
|
8695
|
+
* await client.ipAsset.linkDerivative({
|
|
8696
|
+
* childIpId: '0x...',
|
|
8697
|
+
* parentIpIds: ['0x...'],
|
|
8698
|
+
* licenseTermsIds: [1n]
|
|
8699
|
+
* });
|
|
8700
|
+
* ```
|
|
8387
8701
|
*/
|
|
8388
8702
|
)
|
|
8389
8703
|
}, {
|
|
@@ -8437,8 +8751,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8437
8751
|
txOptions: request.txOptions,
|
|
8438
8752
|
encodedTxs: [encodedTxData],
|
|
8439
8753
|
spgSpenderAddress: this.royaltyModuleEventClient.address,
|
|
8440
|
-
|
|
8441
|
-
|
|
8754
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
8755
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options = request.options) === null || _request$options === void 0 ? void 0 : _request$options.wipOptions), {}, {
|
|
8756
|
+
useMulticallWhenPossible: false
|
|
8757
|
+
})
|
|
8442
8758
|
})
|
|
8443
8759
|
}));
|
|
8444
8760
|
case 5:
|
|
@@ -8580,6 +8896,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8580
8896
|
* Registers a derivative with license tokens. The derivative IP is registered with license tokens minted from the parent IP's license terms.
|
|
8581
8897
|
* The license terms of the parent IPs issued with license tokens are attached to the derivative IP.
|
|
8582
8898
|
* The caller must be the derivative IP owner or an authorized operator.
|
|
8899
|
+
*
|
|
8900
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link linkDerivative} instead.
|
|
8901
|
+
* This method will become internal soon.
|
|
8902
|
+
*
|
|
8903
|
+
* @example Migration Example
|
|
8904
|
+
* ```typescript
|
|
8905
|
+
* // Before (deprecated):
|
|
8906
|
+
* await client.ipAsset.registerDerivativeWithLicenseTokens({
|
|
8907
|
+
* childIpId: '0x...',
|
|
8908
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
8909
|
+
* });
|
|
8910
|
+
*
|
|
8911
|
+
* // After (recommended):
|
|
8912
|
+
* await client.ipAsset.linkDerivative({
|
|
8913
|
+
* childIpId: '0x...',
|
|
8914
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
8915
|
+
* });
|
|
8916
|
+
* ```
|
|
8583
8917
|
*/
|
|
8584
8918
|
)
|
|
8585
8919
|
}, {
|
|
@@ -8659,6 +8993,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8659
8993
|
/**
|
|
8660
8994
|
* Mint an NFT from a collection and register it as an IP.
|
|
8661
8995
|
*
|
|
8996
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
8997
|
+
* This method will become internal soon.
|
|
8998
|
+
*
|
|
8999
|
+
* @example Migration Example
|
|
9000
|
+
* ```typescript
|
|
9001
|
+
* // Before (deprecated):
|
|
9002
|
+
* await client.ipAsset.mintAndRegisterIpAssetWithPilTerms({
|
|
9003
|
+
* spgNftContract: '0x...',
|
|
9004
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }]
|
|
9005
|
+
* });
|
|
9006
|
+
*
|
|
9007
|
+
* // After (recommended):
|
|
9008
|
+
* await client.ipAsset.registerIpAsset({
|
|
9009
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
9010
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }]
|
|
9011
|
+
* });
|
|
9012
|
+
* ```
|
|
9013
|
+
*
|
|
8662
9014
|
* 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.
|
|
8663
9015
|
*/
|
|
8664
9016
|
)
|
|
@@ -8667,7 +9019,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8667
9019
|
value: (function () {
|
|
8668
9020
|
var _mintAndRegisterIpAssetWithPilTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(request) {
|
|
8669
9021
|
var _this3 = this;
|
|
8670
|
-
var _request$txOptions4,
|
|
9022
|
+
var _request$txOptions4, _yield$transformRegis, transformRequest, encodedTxData, contractCall, rsp, computedLicenseTermsIds, maxLicenseTokensTxHashes, _t0;
|
|
8671
9023
|
return _regenerator().w(function (_context7) {
|
|
8672
9024
|
while (1) switch (_context7.p = _context7.n) {
|
|
8673
9025
|
case 0:
|
|
@@ -8696,7 +9048,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8696
9048
|
};
|
|
8697
9049
|
_context7.n = 3;
|
|
8698
9050
|
return this.handleRegistrationWithFees({
|
|
8699
|
-
|
|
9051
|
+
options: request.options,
|
|
8700
9052
|
sender: this.walletAddress,
|
|
8701
9053
|
spgNftContract: transformRequest.spgNftContract,
|
|
8702
9054
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -8862,6 +9214,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8862
9214
|
/**
|
|
8863
9215
|
* Register a given NFT as an IP and attach Programmable IP License Terms.
|
|
8864
9216
|
*
|
|
9217
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
9218
|
+
* This method will become internal soon.
|
|
9219
|
+
*
|
|
9220
|
+
* @example Migration Example
|
|
9221
|
+
* ```typescript
|
|
9222
|
+
* // Before (deprecated):
|
|
9223
|
+
* await client.ipAsset.registerIpAndAttachPilTerms({
|
|
9224
|
+
* nftContract: '0x...',
|
|
9225
|
+
* tokenId: 123n,
|
|
9226
|
+
* licenseTermsData: [{ terms: PILFlavor.nonCommercialSocialRemixing() }]
|
|
9227
|
+
* });
|
|
9228
|
+
*
|
|
9229
|
+
* // After (recommended):
|
|
9230
|
+
* await client.ipAsset.registerIpAsset({
|
|
9231
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
9232
|
+
* licenseTermsData: [{ terms: PILFlavor.nonCommercialSocialRemixing() }]
|
|
9233
|
+
* });
|
|
9234
|
+
* ```
|
|
9235
|
+
*
|
|
8865
9236
|
* 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.
|
|
8866
9237
|
*/
|
|
8867
9238
|
)
|
|
@@ -8969,6 +9340,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8969
9340
|
/**
|
|
8970
9341
|
* Register the given NFT as a derivative IP with metadata without using license tokens.
|
|
8971
9342
|
*
|
|
9343
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
9344
|
+
* This method will become internal soon.
|
|
9345
|
+
*
|
|
9346
|
+
* @example Migration Example
|
|
9347
|
+
* ```typescript
|
|
9348
|
+
* // Before (deprecated):
|
|
9349
|
+
* await client.ipAsset.registerDerivativeIp({
|
|
9350
|
+
* nftContract: '0x...',
|
|
9351
|
+
* tokenId: 123n,
|
|
9352
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9353
|
+
* });
|
|
9354
|
+
*
|
|
9355
|
+
* // After (recommended):
|
|
9356
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
9357
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
9358
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9359
|
+
* });
|
|
9360
|
+
* ```
|
|
9361
|
+
*
|
|
8972
9362
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
8973
9363
|
*/
|
|
8974
9364
|
)
|
|
@@ -8977,7 +9367,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
8977
9367
|
value: (function () {
|
|
8978
9368
|
var _registerDerivativeIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(request) {
|
|
8979
9369
|
var _this4 = this;
|
|
8980
|
-
var _request$txOptions6, _request$
|
|
9370
|
+
var _request$txOptions6, _request$options2, tokenId, ipIdAddress, isRegistered, _yield$transformRegis3, _transformRequest2, encodedTxData, contractCall, _t12;
|
|
8981
9371
|
return _regenerator().w(function (_context0) {
|
|
8982
9372
|
while (1) switch (_context0.p = _context0.n) {
|
|
8983
9373
|
case 0:
|
|
@@ -9026,8 +9416,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9026
9416
|
return _this4.derivativeWorkflowsClient.registerIpAndMakeDerivative(_transformRequest2);
|
|
9027
9417
|
};
|
|
9028
9418
|
return _context0.a(2, this.handleRegistrationWithFees({
|
|
9029
|
-
|
|
9030
|
-
|
|
9419
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
9420
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options2 = request.options) === null || _request$options2 === void 0 ? void 0 : _request$options2.wipOptions), {}, {
|
|
9421
|
+
useMulticallWhenPossible: false
|
|
9422
|
+
})
|
|
9031
9423
|
}),
|
|
9032
9424
|
sender: this.walletAddress,
|
|
9033
9425
|
spgSpenderAddress: this.derivativeWorkflowsClient.address,
|
|
@@ -9051,6 +9443,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9051
9443
|
/**
|
|
9052
9444
|
* Mint an NFT from a collection and register it as a derivative IP without license tokens.
|
|
9053
9445
|
*
|
|
9446
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
9447
|
+
* This method will become internal soon.
|
|
9448
|
+
*
|
|
9449
|
+
* @example Migration Example
|
|
9450
|
+
* ```typescript
|
|
9451
|
+
* // Before (deprecated):
|
|
9452
|
+
* await client.ipAsset.mintAndRegisterIpAndMakeDerivative({
|
|
9453
|
+
* spgNftContract: '0x...',
|
|
9454
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9455
|
+
* });
|
|
9456
|
+
*
|
|
9457
|
+
* // After (recommended):
|
|
9458
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
9459
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
9460
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] }
|
|
9461
|
+
* });
|
|
9462
|
+
* ```
|
|
9463
|
+
*
|
|
9054
9464
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9055
9465
|
*/
|
|
9056
9466
|
)
|
|
@@ -9059,7 +9469,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9059
9469
|
value: (function () {
|
|
9060
9470
|
var _mintAndRegisterIpAndMakeDerivative = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(request) {
|
|
9061
9471
|
var _this5 = this;
|
|
9062
|
-
var _request$txOptions7,
|
|
9472
|
+
var _request$txOptions7, spgNftContract, _yield$transformRegis4, _transformRequest3, encodedTxData, contractCall, _t13;
|
|
9063
9473
|
return _regenerator().w(function (_context1) {
|
|
9064
9474
|
while (1) switch (_context1.p = _context1.n) {
|
|
9065
9475
|
case 0:
|
|
@@ -9088,7 +9498,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9088
9498
|
return _this5.derivativeWorkflowsClient.mintAndRegisterIpAndMakeDerivative(_transformRequest3);
|
|
9089
9499
|
};
|
|
9090
9500
|
return _context1.a(2, this.handleRegistrationWithFees({
|
|
9091
|
-
|
|
9501
|
+
options: request.options,
|
|
9092
9502
|
sender: this.walletAddress,
|
|
9093
9503
|
spgSpenderAddress: this.derivativeWorkflowsClient.address,
|
|
9094
9504
|
spgNftContract: spgNftContract,
|
|
@@ -9196,6 +9606,23 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9196
9606
|
/**
|
|
9197
9607
|
* Mint an NFT from a SPGNFT collection and register it with metadata as an IP.
|
|
9198
9608
|
*
|
|
9609
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
9610
|
+
* This method will become internal soon.
|
|
9611
|
+
*
|
|
9612
|
+
* @example Migration Example
|
|
9613
|
+
* ```typescript
|
|
9614
|
+
* // Before (deprecated):
|
|
9615
|
+
* await client.ipAsset.mintAndRegisterIp({
|
|
9616
|
+
* spgNftContract: '0x...',
|
|
9617
|
+
* recipient: '0x...'
|
|
9618
|
+
* });
|
|
9619
|
+
*
|
|
9620
|
+
* // After (recommended):
|
|
9621
|
+
* await client.ipAsset.registerIpAsset({
|
|
9622
|
+
* nft: { type: 'mint', spgNftContract: '0x...', recipient: '0x...' }
|
|
9623
|
+
* });
|
|
9624
|
+
* ```
|
|
9625
|
+
*
|
|
9199
9626
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9200
9627
|
*/
|
|
9201
9628
|
)
|
|
@@ -9204,7 +9631,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9204
9631
|
value: (function () {
|
|
9205
9632
|
var _mintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(request) {
|
|
9206
9633
|
var _this6 = this;
|
|
9207
|
-
var _request$txOptions8, _request$
|
|
9634
|
+
var _request$txOptions8, _request$options3, _object, encodedTxData, contractCall, _t17;
|
|
9208
9635
|
return _regenerator().w(function (_context11) {
|
|
9209
9636
|
while (1) switch (_context11.p = _context11.n) {
|
|
9210
9637
|
case 0:
|
|
@@ -9234,8 +9661,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9234
9661
|
contractCall: contractCall,
|
|
9235
9662
|
spgNftContract: _object.spgNftContract,
|
|
9236
9663
|
txOptions: request.txOptions,
|
|
9237
|
-
|
|
9238
|
-
|
|
9664
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
9665
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options3 = request.options) === null || _request$options3 === void 0 ? void 0 : _request$options3.wipOptions), {}, {
|
|
9666
|
+
useMulticallWhenPossible: false
|
|
9667
|
+
})
|
|
9239
9668
|
})
|
|
9240
9669
|
}));
|
|
9241
9670
|
case 2:
|
|
@@ -9271,7 +9700,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9271
9700
|
value: (function () {
|
|
9272
9701
|
var _batchMintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(request) {
|
|
9273
9702
|
var _this7 = this;
|
|
9274
|
-
var publicMintEncodedTxs, publicMintSpenders, privateMintEncodedTxs, privateMintSpenders,
|
|
9703
|
+
var publicMintEncodedTxs, publicMintSpenders, privateMintEncodedTxs, privateMintSpenders, _iterator5, _step5, req, registrationRequest, isPublicMinting, nftMintFee, encodeTx, isMinterRole, handlePublicMintTransactions, handlePrivateMintTransactions, transactionResponses, publicMintResponse, privateMintResponse, _t18, _t19, _t20, _t21;
|
|
9275
9704
|
return _regenerator().w(function (_context14) {
|
|
9276
9705
|
while (1) switch (_context14.p = _context14.n) {
|
|
9277
9706
|
case 0:
|
|
@@ -9280,8 +9709,6 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9280
9709
|
publicMintSpenders = [];
|
|
9281
9710
|
privateMintEncodedTxs = [];
|
|
9282
9711
|
privateMintSpenders = [];
|
|
9283
|
-
publicMintFeesTotal = 0n;
|
|
9284
|
-
privateMintFeesTotal = 0n;
|
|
9285
9712
|
_iterator5 = _createForOfIteratorHelper(request.requests);
|
|
9286
9713
|
_context14.p = 1;
|
|
9287
9714
|
_iterator5.s();
|
|
@@ -9302,7 +9729,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9302
9729
|
case 3:
|
|
9303
9730
|
isPublicMinting = _context14.v;
|
|
9304
9731
|
_context14.n = 4;
|
|
9305
|
-
return
|
|
9732
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, registrationRequest.spgNftContract));
|
|
9306
9733
|
case 4:
|
|
9307
9734
|
nftMintFee = _context14.v;
|
|
9308
9735
|
encodeTx = {
|
|
@@ -9317,11 +9744,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9317
9744
|
_context14.n = 5;
|
|
9318
9745
|
break;
|
|
9319
9746
|
}
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
amount: nftMintFee
|
|
9324
|
-
}]);
|
|
9747
|
+
publicMintSpenders = mergeSpenders(publicMintSpenders, nftMintFee ? [_objectSpread2({
|
|
9748
|
+
address: registrationRequest.spgNftContract
|
|
9749
|
+
}, nftMintFee)] : []);
|
|
9325
9750
|
publicMintEncodedTxs.push(encodeTx);
|
|
9326
9751
|
_context14.n = 8;
|
|
9327
9752
|
break;
|
|
@@ -9336,11 +9761,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9336
9761
|
}
|
|
9337
9762
|
throw new Error("Caller ".concat(this.walletAddress, " does not have the minter role for ").concat(registrationRequest.spgNftContract));
|
|
9338
9763
|
case 7:
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
amount: nftMintFee
|
|
9343
|
-
}]);
|
|
9764
|
+
privateMintSpenders = mergeSpenders(privateMintSpenders, nftMintFee ? [_objectSpread2({
|
|
9765
|
+
address: registrationRequest.spgNftContract
|
|
9766
|
+
}, nftMintFee)] : []);
|
|
9344
9767
|
privateMintEncodedTxs.push(encodeTx);
|
|
9345
9768
|
case 8:
|
|
9346
9769
|
_context14.n = 2;
|
|
@@ -9364,9 +9787,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9364
9787
|
case 0:
|
|
9365
9788
|
_context12.n = 1;
|
|
9366
9789
|
return contractCallWithFees({
|
|
9367
|
-
totalFees: publicMintFeesTotal,
|
|
9368
9790
|
options: {
|
|
9369
|
-
wipOptions: request.wipOptions
|
|
9791
|
+
wipOptions: request.wipOptions,
|
|
9792
|
+
erc20Options: request.erc20Options
|
|
9370
9793
|
},
|
|
9371
9794
|
multicall3Address: _this7.multicall3Client.address,
|
|
9372
9795
|
rpcClient: _this7.rpcClient,
|
|
@@ -9399,11 +9822,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9399
9822
|
case 0:
|
|
9400
9823
|
_context13.n = 1;
|
|
9401
9824
|
return contractCallWithFees({
|
|
9402
|
-
totalFees: privateMintFeesTotal,
|
|
9403
9825
|
options: {
|
|
9404
9826
|
wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
|
|
9405
9827
|
useMulticallWhenPossible: false
|
|
9406
|
-
})
|
|
9828
|
+
}),
|
|
9829
|
+
erc20Options: request.erc20Options
|
|
9407
9830
|
},
|
|
9408
9831
|
multicall3Address: _this7.multicall3Client.address,
|
|
9409
9832
|
rpcClient: _this7.rpcClient,
|
|
@@ -9489,6 +9912,24 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9489
9912
|
* Mint an NFT from a collection and register it as a derivative IP using license tokens.
|
|
9490
9913
|
* 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.
|
|
9491
9914
|
*
|
|
9915
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
9916
|
+
* This method will become internal soon.
|
|
9917
|
+
*
|
|
9918
|
+
* @example Migration Example
|
|
9919
|
+
* ```typescript
|
|
9920
|
+
* // Before (deprecated):
|
|
9921
|
+
* await client.ipAsset.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens({
|
|
9922
|
+
* spgNftContract: '0x...',
|
|
9923
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
9924
|
+
* });
|
|
9925
|
+
*
|
|
9926
|
+
* // After (recommended):
|
|
9927
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
9928
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
9929
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
9930
|
+
* });
|
|
9931
|
+
* ```
|
|
9932
|
+
*
|
|
9492
9933
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9493
9934
|
*/
|
|
9494
9935
|
)
|
|
@@ -9497,7 +9938,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9497
9938
|
value: (function () {
|
|
9498
9939
|
var _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(request) {
|
|
9499
9940
|
var _this8 = this;
|
|
9500
|
-
var _request$txOptions9, _request$
|
|
9941
|
+
var _request$txOptions9, _request$options4, licenseTokenIds, _object2, encodedTxData, contractCall, _t22;
|
|
9501
9942
|
return _regenerator().w(function (_context16) {
|
|
9502
9943
|
while (1) switch (_context16.p = _context16.n) {
|
|
9503
9944
|
case 0:
|
|
@@ -9524,6 +9965,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9524
9965
|
encodedTxData: encodedTxData
|
|
9525
9966
|
});
|
|
9526
9967
|
case 2:
|
|
9968
|
+
_context16.n = 3;
|
|
9969
|
+
return this.approveLicenseTokensForDerivativeWorkflows(request.licenseTokenIds, request.autoApproveLicenseTokens);
|
|
9970
|
+
case 3:
|
|
9527
9971
|
contractCall = /*#__PURE__*/function () {
|
|
9528
9972
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
9529
9973
|
return _regenerator().w(function (_context15) {
|
|
@@ -9538,10 +9982,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9538
9982
|
};
|
|
9539
9983
|
}();
|
|
9540
9984
|
return _context16.a(2, this.handleRegistrationWithFees({
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9985
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
9986
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options4 = request.options) === null || _request$options4 === void 0 ? void 0 : _request$options4.wipOptions), {}, {
|
|
9987
|
+
// need to disable multicall to avoid needing to transfer the license
|
|
9988
|
+
// token to the multicall contract.
|
|
9989
|
+
useMulticallWhenPossible: false
|
|
9990
|
+
})
|
|
9545
9991
|
}),
|
|
9546
9992
|
sender: this.walletAddress,
|
|
9547
9993
|
spgNftContract: _object2.spgNftContract,
|
|
@@ -9550,12 +9996,12 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9550
9996
|
contractCall: contractCall,
|
|
9551
9997
|
txOptions: request.txOptions
|
|
9552
9998
|
}));
|
|
9553
|
-
case
|
|
9554
|
-
_context16.p =
|
|
9999
|
+
case 4:
|
|
10000
|
+
_context16.p = 4;
|
|
9555
10001
|
_t22 = _context16.v;
|
|
9556
10002
|
return _context16.a(2, handleError(_t22, "Failed to mint and register IP and make derivative with license tokens"));
|
|
9557
10003
|
}
|
|
9558
|
-
}, _callee16, this, [[0,
|
|
10004
|
+
}, _callee16, this, [[0, 4]]);
|
|
9559
10005
|
}));
|
|
9560
10006
|
function mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_x14) {
|
|
9561
10007
|
return _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
|
@@ -9565,6 +10011,25 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9565
10011
|
/**
|
|
9566
10012
|
* Register the given NFT as a derivative IP using license tokens.
|
|
9567
10013
|
*
|
|
10014
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
10015
|
+
* This method will become internal soon.
|
|
10016
|
+
*
|
|
10017
|
+
* @example Migration Example
|
|
10018
|
+
* ```typescript
|
|
10019
|
+
* // Before (deprecated):
|
|
10020
|
+
* await client.ipAsset.registerIpAndMakeDerivativeWithLicenseTokens({
|
|
10021
|
+
* nftContract: '0x...',
|
|
10022
|
+
* tokenId: 123n,
|
|
10023
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
10024
|
+
* });
|
|
10025
|
+
*
|
|
10026
|
+
* // After (recommended):
|
|
10027
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
10028
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
10029
|
+
* licenseTokenIds: [1n, 2n, 3n]
|
|
10030
|
+
* });
|
|
10031
|
+
* ```
|
|
10032
|
+
*
|
|
9568
10033
|
* Emits an on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
9569
10034
|
*/
|
|
9570
10035
|
)
|
|
@@ -9616,6 +10081,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9616
10081
|
});
|
|
9617
10082
|
case 6:
|
|
9618
10083
|
signature = _context17.v;
|
|
10084
|
+
_context17.n = 7;
|
|
10085
|
+
return this.approveLicenseTokensForDerivativeWorkflows(licenseTokenIds, request.autoApproveLicenseTokens);
|
|
10086
|
+
case 7:
|
|
9619
10087
|
_object3 = _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9620
10088
|
tokenId: tokenId,
|
|
9621
10089
|
licenseTokenIds: licenseTokenIds,
|
|
@@ -9629,38 +10097,38 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9629
10097
|
maxRts: validateMaxRts(request.maxRts)
|
|
9630
10098
|
});
|
|
9631
10099
|
if (!((_request$txOptions0 = request.txOptions) !== null && _request$txOptions0 !== void 0 && _request$txOptions0.encodedTxDataOnly)) {
|
|
9632
|
-
_context17.n =
|
|
10100
|
+
_context17.n = 8;
|
|
9633
10101
|
break;
|
|
9634
10102
|
}
|
|
9635
10103
|
return _context17.a(2, {
|
|
9636
10104
|
encodedTxData: this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokensEncode(_object3)
|
|
9637
10105
|
});
|
|
9638
|
-
case 7:
|
|
9639
|
-
_context17.n = 8;
|
|
9640
|
-
return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
|
|
9641
10106
|
case 8:
|
|
9642
|
-
txHash = _context17.v;
|
|
9643
10107
|
_context17.n = 9;
|
|
10108
|
+
return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
|
|
10109
|
+
case 9:
|
|
10110
|
+
txHash = _context17.v;
|
|
10111
|
+
_context17.n = 10;
|
|
9644
10112
|
return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
|
|
9645
10113
|
hash: txHash
|
|
9646
10114
|
}));
|
|
9647
|
-
case
|
|
10115
|
+
case 10:
|
|
9648
10116
|
receipt = _context17.v;
|
|
9649
10117
|
log = this.getIpIdAndTokenIdsFromEvent(receipt)[0];
|
|
9650
10118
|
return _context17.a(2, _objectSpread2({
|
|
9651
10119
|
txHash: txHash
|
|
9652
10120
|
}, log));
|
|
9653
|
-
case 10:
|
|
9654
|
-
_context17.n = 12;
|
|
9655
|
-
break;
|
|
9656
10121
|
case 11:
|
|
9657
|
-
_context17.
|
|
10122
|
+
_context17.n = 13;
|
|
10123
|
+
break;
|
|
10124
|
+
case 12:
|
|
10125
|
+
_context17.p = 12;
|
|
9658
10126
|
_t23 = _context17.v;
|
|
9659
10127
|
return _context17.a(2, handleError(_t23, "Failed to register IP and make derivative with license tokens"));
|
|
9660
|
-
case
|
|
10128
|
+
case 13:
|
|
9661
10129
|
return _context17.a(2);
|
|
9662
10130
|
}
|
|
9663
|
-
}, _callee17, this, [[0,
|
|
10131
|
+
}, _callee17, this, [[0, 12]]);
|
|
9664
10132
|
}));
|
|
9665
10133
|
function registerIpAndMakeDerivativeWithLicenseTokens(_x15) {
|
|
9666
10134
|
return _registerIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
|
|
@@ -9672,6 +10140,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9672
10140
|
* tokens. In order to successfully distribute royalty tokens, the first
|
|
9673
10141
|
* license terms attached to the IP must be a commercial license.
|
|
9674
10142
|
*
|
|
10143
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
10144
|
+
* This method will become internal soon.
|
|
10145
|
+
*
|
|
10146
|
+
* @example Migration Example
|
|
10147
|
+
* ```typescript
|
|
10148
|
+
* // Before (deprecated):
|
|
10149
|
+
* await client.ipAsset.registerIPAndAttachLicenseTermsAndDistributeRoyaltyTokens({
|
|
10150
|
+
* nftContract: '0x...',
|
|
10151
|
+
* tokenId: 123n,
|
|
10152
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10153
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10154
|
+
* });
|
|
10155
|
+
*
|
|
10156
|
+
* // After (recommended):
|
|
10157
|
+
* await client.ipAsset.registerIpAsset({
|
|
10158
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
10159
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10160
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10161
|
+
* });
|
|
10162
|
+
* ```
|
|
10163
|
+
*
|
|
9675
10164
|
* 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.
|
|
9676
10165
|
*/
|
|
9677
10166
|
)
|
|
@@ -9791,6 +10280,27 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9791
10280
|
* 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
|
|
9792
10281
|
* a commercial license.
|
|
9793
10282
|
*
|
|
10283
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
10284
|
+
* This method will become internal soon.
|
|
10285
|
+
*
|
|
10286
|
+
* @example Migration Example
|
|
10287
|
+
* ```typescript
|
|
10288
|
+
* // Before (deprecated):
|
|
10289
|
+
* await client.ipAsset.registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens({
|
|
10290
|
+
* nftContract: '0x...',
|
|
10291
|
+
* tokenId: 123n,
|
|
10292
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10293
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10294
|
+
* });
|
|
10295
|
+
*
|
|
10296
|
+
* // After (recommended):
|
|
10297
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
10298
|
+
* nft: { type: 'minted', nftContract: '0x...', tokenId: 123n },
|
|
10299
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10300
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10301
|
+
* });
|
|
10302
|
+
* ```
|
|
10303
|
+
*
|
|
9794
10304
|
* 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.
|
|
9795
10305
|
*/
|
|
9796
10306
|
)
|
|
@@ -9799,7 +10309,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9799
10309
|
value: (function () {
|
|
9800
10310
|
var _registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(request) {
|
|
9801
10311
|
var _this9 = this;
|
|
9802
|
-
var _request$
|
|
10312
|
+
var _request$options5, ipIdAddress, _yield$transformRegis6, _transformRequest5, _getRoyaltyShares2, royaltyShares, totalAmount, isRegistered, encodedTxData, contractCall, _yield$this$handleReg, txHash, ipId, tokenId, receipt, ipRoyaltyVault, distributeRoyaltyTokensTxHash, _t25;
|
|
9803
10313
|
return _regenerator().w(function (_context19) {
|
|
9804
10314
|
while (1) switch (_context19.p = _context19.n) {
|
|
9805
10315
|
case 0:
|
|
@@ -9841,8 +10351,10 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9841
10351
|
};
|
|
9842
10352
|
_context19.n = 5;
|
|
9843
10353
|
return this.handleRegistrationWithFees({
|
|
9844
|
-
|
|
9845
|
-
|
|
10354
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
10355
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options5 = request.options) === null || _request$options5 === void 0 ? void 0 : _request$options5.wipOptions), {}, {
|
|
10356
|
+
useMulticallWhenPossible: false
|
|
10357
|
+
})
|
|
9846
10358
|
}),
|
|
9847
10359
|
sender: this.walletAddress,
|
|
9848
10360
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -9904,6 +10416,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9904
10416
|
/**
|
|
9905
10417
|
* Mint an NFT and register the IP, attach PIL terms, and distribute royalty tokens.
|
|
9906
10418
|
*
|
|
10419
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerIpAsset} instead.
|
|
10420
|
+
* This method will become internal soon.
|
|
10421
|
+
*
|
|
10422
|
+
* @example Migration Example
|
|
10423
|
+
* ```typescript
|
|
10424
|
+
* // Before (deprecated):
|
|
10425
|
+
* await client.ipAsset.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens({
|
|
10426
|
+
* spgNftContract: '0x...',
|
|
10427
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10428
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10429
|
+
* });
|
|
10430
|
+
*
|
|
10431
|
+
* // After (recommended):
|
|
10432
|
+
* await client.ipAsset.registerIpAsset({
|
|
10433
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
10434
|
+
* licenseTermsData: [{ terms: PILFlavor.commercialRemix({...}) }],
|
|
10435
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10436
|
+
* });
|
|
10437
|
+
* ```
|
|
10438
|
+
*
|
|
9907
10439
|
* 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.
|
|
9908
10440
|
*/
|
|
9909
10441
|
)
|
|
@@ -9912,7 +10444,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9912
10444
|
value: (function () {
|
|
9913
10445
|
var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(request) {
|
|
9914
10446
|
var _this0 = this;
|
|
9915
|
-
var _request$
|
|
10447
|
+
var _request$options6, _yield$validateLicens3, licenseTerms, _yield$transformRegis7, _transformRequest6, encodedTxData, contractCall, _yield$this$handleReg2, txHash, ipId, tokenId, receipt, licenseTermsIds, ipRoyaltyVault, maxLicenseTokensTxHashes, _t26;
|
|
9916
10448
|
return _regenerator().w(function (_context20) {
|
|
9917
10449
|
while (1) switch (_context20.p = _context20.n) {
|
|
9918
10450
|
case 0:
|
|
@@ -9938,7 +10470,11 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9938
10470
|
};
|
|
9939
10471
|
_context20.n = 3;
|
|
9940
10472
|
return this.handleRegistrationWithFees({
|
|
9941
|
-
|
|
10473
|
+
options: _objectSpread2(_objectSpread2({}, request.options), {}, {
|
|
10474
|
+
wipOptions: _objectSpread2(_objectSpread2({}, (_request$options6 = request.options) === null || _request$options6 === void 0 ? void 0 : _request$options6.wipOptions), {}, {
|
|
10475
|
+
useMulticallWhenPossible: false
|
|
10476
|
+
})
|
|
10477
|
+
}),
|
|
9942
10478
|
sender: this.walletAddress,
|
|
9943
10479
|
spgNftContract: _transformRequest6.spgNftContract,
|
|
9944
10480
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
@@ -9999,6 +10535,26 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
9999
10535
|
/**
|
|
10000
10536
|
* Mint an NFT and register the IP, make a derivative, and distribute royalty tokens.
|
|
10001
10537
|
*
|
|
10538
|
+
* @deprecated This method is deprecated. Please use the unified entry point {@link registerDerivativeIpAsset} instead.
|
|
10539
|
+
* This method will become internal soon.
|
|
10540
|
+
*
|
|
10541
|
+
* @example Migration Example
|
|
10542
|
+
* ```typescript
|
|
10543
|
+
* // Before (deprecated):
|
|
10544
|
+
* await client.ipAsset.mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens({
|
|
10545
|
+
* spgNftContract: '0x...',
|
|
10546
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10547
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10548
|
+
* });
|
|
10549
|
+
*
|
|
10550
|
+
* // After (recommended):
|
|
10551
|
+
* await client.ipAsset.registerDerivativeIpAsset({
|
|
10552
|
+
* nft: { type: 'mint', spgNftContract: '0x...' },
|
|
10553
|
+
* derivData: { parentIpIds: ['0x...'], licenseTermsIds: [1n] },
|
|
10554
|
+
* royaltyShares: [{ recipient: '0x...', percentage: 100 }]
|
|
10555
|
+
* });
|
|
10556
|
+
* ```
|
|
10557
|
+
*
|
|
10002
10558
|
* Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
|
|
10003
10559
|
*/
|
|
10004
10560
|
)
|
|
@@ -10007,7 +10563,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10007
10563
|
value: (function () {
|
|
10008
10564
|
var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(request) {
|
|
10009
10565
|
var _this1 = this;
|
|
10010
|
-
var
|
|
10566
|
+
var _yield$transformRegis8, _transformRequest7, encodedTxData, contractCall, _t27;
|
|
10011
10567
|
return _regenerator().w(function (_context21) {
|
|
10012
10568
|
while (1) switch (_context21.p = _context21.n) {
|
|
10013
10569
|
case 0:
|
|
@@ -10029,7 +10585,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10029
10585
|
_context21.n = 2;
|
|
10030
10586
|
return this.handleRegistrationWithFees({
|
|
10031
10587
|
spgNftContract: _transformRequest7.spgNftContract,
|
|
10032
|
-
|
|
10588
|
+
options: request.options,
|
|
10033
10589
|
sender: this.walletAddress,
|
|
10034
10590
|
spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
|
|
10035
10591
|
derivData: _transformRequest7.derivData,
|
|
@@ -10131,7 +10687,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10131
10687
|
* The method supports automatic token handling for minting fees:
|
|
10132
10688
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10133
10689
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10134
|
-
* - These automatic processes can be configured through the `
|
|
10690
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10135
10691
|
*
|
|
10136
10692
|
* @remark Multicall selection logic:
|
|
10137
10693
|
*
|
|
@@ -10143,12 +10699,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10143
10699
|
*
|
|
10144
10700
|
* 2. For `register*` methods:
|
|
10145
10701
|
* - Always uses SPG's multicall for batching registration operations
|
|
10702
|
+
*
|
|
10703
|
+
* 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.
|
|
10146
10704
|
*/
|
|
10147
10705
|
}, {
|
|
10148
10706
|
key: "batchRegisterIpAssetsWithOptimizedWorkflows",
|
|
10149
10707
|
value: (function () {
|
|
10150
10708
|
var _batchRegisterIpAssetsWithOptimizedWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(request) {
|
|
10151
|
-
var
|
|
10709
|
+
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;
|
|
10152
10710
|
return _regenerator().w(function (_context24) {
|
|
10153
10711
|
while (1) switch (_context24.p = _context24.n) {
|
|
10154
10712
|
case 0:
|
|
@@ -10212,7 +10770,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10212
10770
|
rpcClient: this.rpcClient,
|
|
10213
10771
|
wallet: this.wallet,
|
|
10214
10772
|
walletAddress: this.walletAddress,
|
|
10215
|
-
|
|
10773
|
+
options: request.options,
|
|
10216
10774
|
chainId: this.chainId
|
|
10217
10775
|
});
|
|
10218
10776
|
case 9:
|
|
@@ -10242,11 +10800,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10242
10800
|
chainId: this.chainId
|
|
10243
10801
|
});
|
|
10244
10802
|
case 12:
|
|
10245
|
-
|
|
10246
|
-
|
|
10803
|
+
_yield$prepareRoyalty = _context24.v;
|
|
10804
|
+
requests = _yield$prepareRoyalty.requests;
|
|
10805
|
+
ipRoyaltyVaults = _yield$prepareRoyalty.ipRoyaltyVaults;
|
|
10806
|
+
royaltyTokensDistributionRequests.push.apply(royaltyTokensDistributionRequests, _toConsumableArray(requests));
|
|
10247
10807
|
responses.push({
|
|
10248
10808
|
txHash: txHash,
|
|
10249
10809
|
receipt: receipt,
|
|
10810
|
+
ipRoyaltyVault: ipRoyaltyVaults,
|
|
10250
10811
|
ipAssetsWithLicenseTerms: iPRegisteredLog.map(function (log) {
|
|
10251
10812
|
return {
|
|
10252
10813
|
ipId: log.ipId,
|
|
@@ -10280,7 +10841,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10280
10841
|
rpcClient: this.rpcClient,
|
|
10281
10842
|
wallet: this.wallet,
|
|
10282
10843
|
walletAddress: this.walletAddress,
|
|
10283
|
-
|
|
10844
|
+
options: request.options,
|
|
10284
10845
|
chainId: this.chainId
|
|
10285
10846
|
});
|
|
10286
10847
|
case 18:
|
|
@@ -10291,7 +10852,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10291
10852
|
});
|
|
10292
10853
|
case 19:
|
|
10293
10854
|
_context24.n = 20;
|
|
10294
|
-
return this.
|
|
10855
|
+
return this.populateLicenseAndTokenIdsForRegistrationResults(responses, aggregateRegistrationRequest);
|
|
10295
10856
|
case 20:
|
|
10296
10857
|
registrationResults = _context24.v;
|
|
10297
10858
|
return _context24.a(2, _objectSpread2({
|
|
@@ -10366,7 +10927,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10366
10927
|
* **Automatic Token Handling:**
|
|
10367
10928
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10368
10929
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10369
|
-
* - These automatic processes can be configured through the `
|
|
10930
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10370
10931
|
*
|
|
10371
10932
|
* @throws {Error} If the NFT type is invalid.
|
|
10372
10933
|
* @throws {Error} If `licenseTermsData` is not provided when `royaltyShares` are specified.
|
|
@@ -10479,7 +11040,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10479
11040
|
* **Automatic Token Handling:**
|
|
10480
11041
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10481
11042
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10482
|
-
* - These automatic processes can be configured through the `
|
|
11043
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10483
11044
|
*
|
|
10484
11045
|
* @throws {Error} If `derivData` is not provided when `royaltyShares` are provided.
|
|
10485
11046
|
* @throws {Error} If neither `derivData` nor `licenseTokenIds` are provided.
|
|
@@ -10592,7 +11153,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10592
11153
|
case 2:
|
|
10593
11154
|
return _context27.a(2, this.registerIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
|
|
10594
11155
|
licenseTokenIds: licenseTokenIds,
|
|
10595
|
-
maxRts: maxRts
|
|
11156
|
+
maxRts: maxRts,
|
|
11157
|
+
autoApproveLicenseTokens: request.autoApproveLicenseTokens
|
|
10596
11158
|
})));
|
|
10597
11159
|
}
|
|
10598
11160
|
}, _callee27, this);
|
|
@@ -10647,7 +11209,8 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10647
11209
|
case 2:
|
|
10648
11210
|
return _context28.a(2, this.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
|
|
10649
11211
|
licenseTokenIds: licenseTokenIds,
|
|
10650
|
-
maxRts: maxRts
|
|
11212
|
+
maxRts: maxRts,
|
|
11213
|
+
autoApproveLicenseTokens: request.autoApproveLicenseTokens
|
|
10651
11214
|
})));
|
|
10652
11215
|
}
|
|
10653
11216
|
}, _callee28, this);
|
|
@@ -10684,7 +11247,7 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10684
11247
|
* **Automatic Token Handling:**
|
|
10685
11248
|
* - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
|
|
10686
11249
|
* - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
|
|
10687
|
-
* - These automatic processes can be configured through the `
|
|
11250
|
+
* - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
|
|
10688
11251
|
*/
|
|
10689
11252
|
)
|
|
10690
11253
|
}, {
|
|
@@ -10953,20 +11516,20 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10953
11516
|
value: function () {
|
|
10954
11517
|
var _handleRegistrationWithFees = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(_ref5) {
|
|
10955
11518
|
var _wipOptions$useMultic, _this$getIpIdAndToken, _event$ipId, _event$tokenId;
|
|
10956
|
-
var sender, derivData, spgNftContract, spgSpenderAddress, txOptions,
|
|
11519
|
+
var sender, derivData, spgNftContract, spgSpenderAddress, txOptions, options, encodedTxs, contractCall, tokenSpenders, wipOptions, useMulticallWhenPossible, nftMintFee, publicMinting, mintFees, _iterator0, _step0, mintFee, _yield$contractCallWi, txHash, receipt, event;
|
|
10957
11520
|
return _regenerator().w(function (_context34) {
|
|
10958
11521
|
while (1) switch (_context34.n) {
|
|
10959
11522
|
case 0:
|
|
10960
|
-
sender = _ref5.sender, derivData = _ref5.derivData, spgNftContract = _ref5.spgNftContract, spgSpenderAddress = _ref5.spgSpenderAddress, txOptions = _ref5.txOptions,
|
|
10961
|
-
|
|
10962
|
-
|
|
11523
|
+
sender = _ref5.sender, derivData = _ref5.derivData, spgNftContract = _ref5.spgNftContract, spgSpenderAddress = _ref5.spgSpenderAddress, txOptions = _ref5.txOptions, options = _ref5.options, encodedTxs = _ref5.encodedTxs, contractCall = _ref5.contractCall;
|
|
11524
|
+
tokenSpenders = [];
|
|
11525
|
+
wipOptions = options === null || options === void 0 ? void 0 : options.wipOptions;
|
|
10963
11526
|
useMulticallWhenPossible = (_wipOptions$useMultic = wipOptions === null || wipOptions === void 0 ? void 0 : wipOptions.useMulticallWhenPossible) !== null && _wipOptions$useMultic !== void 0 ? _wipOptions$useMultic : true; // get spg minting fee
|
|
10964
11527
|
if (!spgNftContract) {
|
|
10965
11528
|
_context34.n = 3;
|
|
10966
11529
|
break;
|
|
10967
11530
|
}
|
|
10968
11531
|
_context34.n = 1;
|
|
10969
|
-
return
|
|
11532
|
+
return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, spgNftContract));
|
|
10970
11533
|
case 1:
|
|
10971
11534
|
nftMintFee = _context34.v;
|
|
10972
11535
|
_context34.n = 2;
|
|
@@ -10984,11 +11547,9 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
10984
11547
|
if (!publicMinting) {
|
|
10985
11548
|
useMulticallWhenPossible = false;
|
|
10986
11549
|
}
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
amount: nftMintFee
|
|
10991
|
-
});
|
|
11550
|
+
tokenSpenders.push.apply(tokenSpenders, _toConsumableArray(nftMintFee ? [_objectSpread2({
|
|
11551
|
+
address: spgNftContract
|
|
11552
|
+
}, nftMintFee)] : []));
|
|
10992
11553
|
case 3:
|
|
10993
11554
|
if (!derivData) {
|
|
10994
11555
|
_context34.n = 5;
|
|
@@ -11003,39 +11564,38 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11003
11564
|
sender: sender
|
|
11004
11565
|
});
|
|
11005
11566
|
case 4:
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11567
|
+
mintFees = _context34.v;
|
|
11568
|
+
_iterator0 = _createForOfIteratorHelper(mintFees);
|
|
11569
|
+
try {
|
|
11570
|
+
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
11571
|
+
mintFee = _step0.value;
|
|
11572
|
+
tokenSpenders.push(_objectSpread2({
|
|
11573
|
+
address: spgSpenderAddress
|
|
11574
|
+
}, mintFee));
|
|
11575
|
+
}
|
|
11576
|
+
} catch (err) {
|
|
11577
|
+
_iterator0.e(err);
|
|
11578
|
+
} finally {
|
|
11579
|
+
_iterator0.f();
|
|
11013
11580
|
}
|
|
11014
11581
|
case 5:
|
|
11015
|
-
|
|
11016
|
-
_context34.n = 6;
|
|
11017
|
-
break;
|
|
11018
|
-
}
|
|
11019
|
-
throw new Error("Total fees for registering derivative should never be negative: ".concat(totalFees));
|
|
11020
|
-
case 6:
|
|
11021
|
-
_context34.n = 7;
|
|
11582
|
+
_context34.n = 6;
|
|
11022
11583
|
return contractCallWithFees({
|
|
11023
|
-
|
|
11024
|
-
options: {
|
|
11584
|
+
options: _objectSpread2(_objectSpread2({}, options), {}, {
|
|
11025
11585
|
wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
|
|
11026
11586
|
useMulticallWhenPossible: useMulticallWhenPossible
|
|
11027
11587
|
})
|
|
11028
|
-
},
|
|
11588
|
+
}),
|
|
11029
11589
|
multicall3Address: this.multicall3Client.address,
|
|
11030
11590
|
rpcClient: this.rpcClient,
|
|
11031
|
-
tokenSpenders:
|
|
11591
|
+
tokenSpenders: tokenSpenders,
|
|
11032
11592
|
contractCall: contractCall,
|
|
11033
11593
|
sender: sender,
|
|
11034
11594
|
wallet: this.wallet,
|
|
11035
11595
|
txOptions: txOptions,
|
|
11036
11596
|
encodedTxs: encodedTxs
|
|
11037
11597
|
});
|
|
11038
|
-
case
|
|
11598
|
+
case 6:
|
|
11039
11599
|
_yield$contractCallWi = _context34.v;
|
|
11040
11600
|
txHash = _yield$contractCallWi.txHash;
|
|
11041
11601
|
receipt = _yield$contractCallWi.receipt;
|
|
@@ -11059,43 +11619,50 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11059
11619
|
* Process the `LicenseTermsIds` and `maxLicenseTokensTxHashes` for each IP asset.
|
|
11060
11620
|
*/
|
|
11061
11621
|
}, {
|
|
11062
|
-
key: "
|
|
11622
|
+
key: "populateLicenseAndTokenIdsForRegistrationResults",
|
|
11063
11623
|
value: (function () {
|
|
11064
|
-
var
|
|
11065
|
-
var
|
|
11624
|
+
var _populateLicenseAndTokenIdsForRegistrationResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(registrationResults, aggregateRegistrationRequest) {
|
|
11625
|
+
var allExtraDataArrays, allExtraData, extraDataFlatIndex, _iterator1, _step1, registrationResult, i, ipAsset, _t36;
|
|
11066
11626
|
return _regenerator().w(function (_context35) {
|
|
11067
11627
|
while (1) switch (_context35.p = _context35.n) {
|
|
11068
11628
|
case 0:
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
}
|
|
11073
|
-
|
|
11629
|
+
allExtraDataArrays = Object.values(aggregateRegistrationRequest).map(function (_ref6) {
|
|
11630
|
+
var extraData = _ref6.extraData;
|
|
11631
|
+
return extraData;
|
|
11632
|
+
});
|
|
11633
|
+
allExtraData = allExtraDataArrays.flat();
|
|
11634
|
+
extraDataFlatIndex = -1;
|
|
11635
|
+
_iterator1 = _createForOfIteratorHelper(registrationResults);
|
|
11074
11636
|
_context35.p = 1;
|
|
11075
|
-
_iterator0.s();
|
|
11076
|
-
case 2:
|
|
11077
|
-
if ((_step0 = _iterator0.n()).done) {
|
|
11078
|
-
_context35.n = 11;
|
|
11079
|
-
break;
|
|
11080
|
-
}
|
|
11081
|
-
_step0$value = _slicedToArray(_step0.value, 2), responseIndex = _step0$value[0], response = _step0$value[1];
|
|
11082
|
-
_iterator1 = _createForOfIteratorHelper(response.ipAssetsWithLicenseTerms.entries());
|
|
11083
|
-
_context35.p = 3;
|
|
11084
11637
|
_iterator1.s();
|
|
11085
|
-
case
|
|
11638
|
+
case 2:
|
|
11086
11639
|
if ((_step1 = _iterator1.n()).done) {
|
|
11087
11640
|
_context35.n = 7;
|
|
11088
11641
|
break;
|
|
11089
11642
|
}
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11643
|
+
registrationResult = _step1.value;
|
|
11644
|
+
i = 0;
|
|
11645
|
+
case 3:
|
|
11646
|
+
if (!(i < registrationResult.ipAssetsWithLicenseTerms.length)) {
|
|
11647
|
+
_context35.n = 6;
|
|
11648
|
+
break;
|
|
11649
|
+
}
|
|
11650
|
+
extraDataFlatIndex++;
|
|
11651
|
+
if (!(registrationResult.ipAssetsWithLicenseTerms[i] && allExtraData[extraDataFlatIndex])) {
|
|
11652
|
+
_context35.n = 5;
|
|
11653
|
+
break;
|
|
11654
|
+
}
|
|
11655
|
+
_context35.n = 4;
|
|
11656
|
+
return this.processIpAssetLicenseTerms(registrationResult.ipAssetsWithLicenseTerms[i], allExtraData[extraDataFlatIndex]);
|
|
11657
|
+
case 4:
|
|
11658
|
+
ipAsset = _context35.v;
|
|
11659
|
+
registrationResult.ipAssetsWithLicenseTerms[i] = ipAsset;
|
|
11094
11660
|
case 5:
|
|
11095
|
-
|
|
11096
|
-
|
|
11661
|
+
i++;
|
|
11662
|
+
_context35.n = 3;
|
|
11663
|
+
break;
|
|
11097
11664
|
case 6:
|
|
11098
|
-
_context35.n =
|
|
11665
|
+
_context35.n = 2;
|
|
11099
11666
|
break;
|
|
11100
11667
|
case 7:
|
|
11101
11668
|
_context35.n = 9;
|
|
@@ -11109,54 +11676,14 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11109
11676
|
_iterator1.f();
|
|
11110
11677
|
return _context35.f(9);
|
|
11111
11678
|
case 10:
|
|
11112
|
-
_context35.
|
|
11113
|
-
break;
|
|
11114
|
-
case 11:
|
|
11115
|
-
_context35.n = 13;
|
|
11116
|
-
break;
|
|
11117
|
-
case 12:
|
|
11118
|
-
_context35.p = 12;
|
|
11119
|
-
_t37 = _context35.v;
|
|
11120
|
-
_iterator0.e(_t37);
|
|
11121
|
-
case 13:
|
|
11122
|
-
_context35.p = 13;
|
|
11123
|
-
_iterator0.f();
|
|
11124
|
-
return _context35.f(13);
|
|
11125
|
-
case 14:
|
|
11126
|
-
_context35.n = 19;
|
|
11127
|
-
break;
|
|
11128
|
-
case 15:
|
|
11129
|
-
_extraData = [];
|
|
11130
|
-
Object.values(aggregateRegistrationRequest).map(function (item) {
|
|
11131
|
-
var _item$extraData;
|
|
11132
|
-
_extraData.push.apply(_extraData, _toConsumableArray((_item$extraData = item.extraData) !== null && _item$extraData !== void 0 ? _item$extraData : undefined));
|
|
11133
|
-
});
|
|
11134
|
-
i = 0;
|
|
11135
|
-
case 16:
|
|
11136
|
-
if (!(i < responses.length)) {
|
|
11137
|
-
_context35.n = 19;
|
|
11138
|
-
break;
|
|
11139
|
-
}
|
|
11140
|
-
_response = responses[i];
|
|
11141
|
-
extraDataItem = _extraData[i];
|
|
11142
|
-
_context35.n = 17;
|
|
11143
|
-
return this.processIpAssetLicenseTerms(_response.ipAssetsWithLicenseTerms[0], extraDataItem);
|
|
11144
|
-
case 17:
|
|
11145
|
-
_ipAsset = _context35.v;
|
|
11146
|
-
responses[i].ipAssetsWithLicenseTerms[0] = _ipAsset;
|
|
11147
|
-
case 18:
|
|
11148
|
-
i++;
|
|
11149
|
-
_context35.n = 16;
|
|
11150
|
-
break;
|
|
11151
|
-
case 19:
|
|
11152
|
-
return _context35.a(2, responses);
|
|
11679
|
+
return _context35.a(2, registrationResults);
|
|
11153
11680
|
}
|
|
11154
|
-
}, _callee35, this, [[
|
|
11681
|
+
}, _callee35, this, [[1, 8, 9, 10]]);
|
|
11155
11682
|
}));
|
|
11156
|
-
function
|
|
11157
|
-
return
|
|
11683
|
+
function populateLicenseAndTokenIdsForRegistrationResults(_x33, _x34) {
|
|
11684
|
+
return _populateLicenseAndTokenIdsForRegistrationResults.apply(this, arguments);
|
|
11158
11685
|
}
|
|
11159
|
-
return
|
|
11686
|
+
return populateLicenseAndTokenIdsForRegistrationResults;
|
|
11160
11687
|
}())
|
|
11161
11688
|
}, {
|
|
11162
11689
|
key: "processIpAssetLicenseTerms",
|
|
@@ -11211,11 +11738,65 @@ var IPAssetClient = /*#__PURE__*/function () {
|
|
|
11211
11738
|
}
|
|
11212
11739
|
}, _callee36, this);
|
|
11213
11740
|
}));
|
|
11214
|
-
function processIpAssetLicenseTerms(
|
|
11741
|
+
function processIpAssetLicenseTerms(_x35, _x36) {
|
|
11215
11742
|
return _processIpAssetLicenseTerms.apply(this, arguments);
|
|
11216
11743
|
}
|
|
11217
11744
|
return processIpAssetLicenseTerms;
|
|
11218
11745
|
}()
|
|
11746
|
+
}, {
|
|
11747
|
+
key: "approveLicenseTokensForDerivativeWorkflows",
|
|
11748
|
+
value: function () {
|
|
11749
|
+
var _approveLicenseTokensForDerivativeWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37(licenseTokenIds, autoApproveLicenseTokens) {
|
|
11750
|
+
var _iterator10, _step10, licenseTokenId, txHash, _t37;
|
|
11751
|
+
return _regenerator().w(function (_context37) {
|
|
11752
|
+
while (1) switch (_context37.p = _context37.n) {
|
|
11753
|
+
case 0:
|
|
11754
|
+
if (!(autoApproveLicenseTokens !== false)) {
|
|
11755
|
+
_context37.n = 8;
|
|
11756
|
+
break;
|
|
11757
|
+
}
|
|
11758
|
+
_iterator10 = _createForOfIteratorHelper(licenseTokenIds);
|
|
11759
|
+
_context37.p = 1;
|
|
11760
|
+
_iterator10.s();
|
|
11761
|
+
case 2:
|
|
11762
|
+
if ((_step10 = _iterator10.n()).done) {
|
|
11763
|
+
_context37.n = 5;
|
|
11764
|
+
break;
|
|
11765
|
+
}
|
|
11766
|
+
licenseTokenId = _step10.value;
|
|
11767
|
+
_context37.n = 3;
|
|
11768
|
+
return this.licenseTokenClient.approve({
|
|
11769
|
+
to: this.derivativeWorkflowsClient.address,
|
|
11770
|
+
tokenId: BigInt(licenseTokenId)
|
|
11771
|
+
});
|
|
11772
|
+
case 3:
|
|
11773
|
+
txHash = _context37.v;
|
|
11774
|
+
_context37.n = 4;
|
|
11775
|
+
return waitTx(this.rpcClient, txHash);
|
|
11776
|
+
case 4:
|
|
11777
|
+
_context37.n = 2;
|
|
11778
|
+
break;
|
|
11779
|
+
case 5:
|
|
11780
|
+
_context37.n = 7;
|
|
11781
|
+
break;
|
|
11782
|
+
case 6:
|
|
11783
|
+
_context37.p = 6;
|
|
11784
|
+
_t37 = _context37.v;
|
|
11785
|
+
_iterator10.e(_t37);
|
|
11786
|
+
case 7:
|
|
11787
|
+
_context37.p = 7;
|
|
11788
|
+
_iterator10.f();
|
|
11789
|
+
return _context37.f(7);
|
|
11790
|
+
case 8:
|
|
11791
|
+
return _context37.a(2);
|
|
11792
|
+
}
|
|
11793
|
+
}, _callee37, this, [[1, 6, 7, 8]]);
|
|
11794
|
+
}));
|
|
11795
|
+
function approveLicenseTokensForDerivativeWorkflows(_x37, _x38) {
|
|
11796
|
+
return _approveLicenseTokensForDerivativeWorkflows.apply(this, arguments);
|
|
11797
|
+
}
|
|
11798
|
+
return approveLicenseTokensForDerivativeWorkflows;
|
|
11799
|
+
}()
|
|
11219
11800
|
}]);
|
|
11220
11801
|
}();
|
|
11221
11802
|
|
|
@@ -11387,7 +11968,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11387
11968
|
value: (function () {
|
|
11388
11969
|
var _mintLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
|
11389
11970
|
var _this = this;
|
|
11390
|
-
var _request$maxMintingFe, _request$maxRevenueSh, _request$txOptions2,
|
|
11971
|
+
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;
|
|
11391
11972
|
return _regenerator().w(function (_context3) {
|
|
11392
11973
|
while (1) switch (_context3.p = _context3.n) {
|
|
11393
11974
|
case 0:
|
|
@@ -11466,7 +12047,7 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11466
12047
|
});
|
|
11467
12048
|
case 9:
|
|
11468
12049
|
_context3.n = 10;
|
|
11469
|
-
return
|
|
12050
|
+
return calculateLicenseMintFee({
|
|
11470
12051
|
predictMintingFeeRequest: req,
|
|
11471
12052
|
rpcClient: this.rpcClient,
|
|
11472
12053
|
chainId: this.chainId,
|
|
@@ -11475,18 +12056,14 @@ var LicenseClient = /*#__PURE__*/function () {
|
|
|
11475
12056
|
case 10:
|
|
11476
12057
|
licenseMintingFee = _context3.v;
|
|
11477
12058
|
wipSpenders = [];
|
|
11478
|
-
if (licenseMintingFee > 0n) {
|
|
11479
|
-
wipSpenders.push({
|
|
11480
|
-
address: royaltyModuleAddress[this.chainId]
|
|
11481
|
-
|
|
11482
|
-
});
|
|
12059
|
+
if (licenseMintingFee.amount > 0n) {
|
|
12060
|
+
wipSpenders.push(_objectSpread2({
|
|
12061
|
+
address: royaltyModuleAddress[this.chainId]
|
|
12062
|
+
}, licenseMintingFee));
|
|
11483
12063
|
}
|
|
11484
12064
|
_context3.n = 11;
|
|
11485
12065
|
return contractCallWithFees({
|
|
11486
|
-
|
|
11487
|
-
options: {
|
|
11488
|
-
wipOptions: (_request$options = request.options) === null || _request$options === void 0 ? void 0 : _request$options.wipOptions
|
|
11489
|
-
},
|
|
12066
|
+
options: request.options,
|
|
11490
12067
|
multicall3Address: this.multicall3Client.address,
|
|
11491
12068
|
rpcClient: this.rpcClient,
|
|
11492
12069
|
tokenSpenders: wipSpenders,
|
|
@@ -13256,12 +13833,12 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
|
13256
13833
|
value: (function () {
|
|
13257
13834
|
var _payRoyaltyOnBehalf = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
|
|
13258
13835
|
var _this2 = this;
|
|
13259
|
-
var _request$txOptions, receiverIpId, payerIpId, token, amount,
|
|
13836
|
+
var _request$txOptions, receiverIpId, payerIpId, token, amount, options, txOptions, sender, payAmount, isReceiverRegistered, isPayerRegistered, req, encodedTxData, contractCall, tokenSpenders, _t5;
|
|
13260
13837
|
return _regenerator().w(function (_context4) {
|
|
13261
13838
|
while (1) switch (_context4.p = _context4.n) {
|
|
13262
13839
|
case 0:
|
|
13263
13840
|
_context4.p = 0;
|
|
13264
|
-
receiverIpId = request.receiverIpId, payerIpId = request.payerIpId, token = request.token, amount = request.amount,
|
|
13841
|
+
receiverIpId = request.receiverIpId, payerIpId = request.payerIpId, token = request.token, amount = request.amount, options = request.options, txOptions = request.txOptions;
|
|
13265
13842
|
sender = this.wallet.account.address;
|
|
13266
13843
|
payAmount = BigInt(amount);
|
|
13267
13844
|
if (!(payAmount <= 0n)) {
|
|
@@ -13318,21 +13895,17 @@ var RoyaltyClient = /*#__PURE__*/function () {
|
|
|
13318
13895
|
};
|
|
13319
13896
|
tokenSpenders = [{
|
|
13320
13897
|
address: this.royaltyModuleClient.address,
|
|
13321
|
-
amount: payAmount
|
|
13898
|
+
amount: payAmount,
|
|
13899
|
+
token: token
|
|
13322
13900
|
}];
|
|
13323
13901
|
_context4.n = 7;
|
|
13324
13902
|
return contractCallWithFees({
|
|
13325
|
-
|
|
13326
|
-
options: {
|
|
13327
|
-
erc20Options: erc20Options,
|
|
13328
|
-
wipOptions: wipOptions
|
|
13329
|
-
},
|
|
13903
|
+
options: options,
|
|
13330
13904
|
multicall3Address: this.multicall3Client.address,
|
|
13331
13905
|
rpcClient: this.rpcClient,
|
|
13332
13906
|
tokenSpenders: tokenSpenders,
|
|
13333
13907
|
contractCall: contractCall,
|
|
13334
13908
|
sender: sender,
|
|
13335
|
-
token: token,
|
|
13336
13909
|
wallet: this.wallet,
|
|
13337
13910
|
txOptions: txOptions,
|
|
13338
13911
|
encodedTxs: [encodedTxData]
|