@story-protocol/core-sdk 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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;}())}]);}();// Contract LicensingModule =============================================================
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 _callee99(request){var result;return _regenerator().w(function(_context99){while(1)switch(_context99.n){case 0:_context99.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=_context99.v;return _context99.a(2,{currencyToken:result[0],tokenAmount:result[1]});}},_callee99,this);}));function predictMintingLicenseFee(_x73){return _predictMintingLicenseFee.apply(this,arguments);}return predictMintingLicenseFee;}())}]);}(LicensingModuleEventClient);/**
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 _this0;_classCallCheck(this,LicensingModuleClient);_this0=_callSuper(this,LicensingModuleClient,[rpcClient,address]);_this0.wallet=wallet;return _this0;}/**
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 _callee100(request){var _yield$this$rpcClient52,call;return _regenerator().w(function(_context100){while(1)switch(_context100.n){case 0:_context100.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$rpcClient52=_context100.v;call=_yield$this$rpcClient52.request;_context100.n=2;return this.wallet.writeContract(call);case 2:return _context100.a(2,_context100.v);}},_callee100,this);}));function attachLicenseTerms(_x74){return _attachLicenseTerms.apply(this,arguments);}return attachLicenseTerms;}()/**
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 _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:"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$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 mintLicenseTokens(_x75){return _mintLicenseTokens.apply(this,arguments);}return mintLicenseTokens;}()/**
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 _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:"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$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 registerDerivative(_x76){return _registerDerivative.apply(this,arguments);}return registerDerivative;}()/**
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 _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:"registerDerivativeWithLicenseTokens",account:this.wallet.account,args:[request.childIpId,request.licenseTokenIds,request.royaltyContext,request.maxRts]});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 registerDerivativeWithLicenseTokens(_x77){return _registerDerivativeWithLicenseTokens.apply(this,arguments);}return registerDerivativeWithLicenseTokens;}()/**
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 _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:"setLicensingConfig",account:this.wallet.account,args:[request.ipId,request.licenseTemplate,request.licenseTermsId,request.licensingConfig]});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 setLicensingConfig(_x78){return _setLicensingConfig.apply(this,arguments);}return setLicensingConfig;}()/**
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 _callee105(request){return _regenerator().w(function(_context105){while(1)switch(_context105.n){case 0:_context105.n=1;return this.rpcClient.readContract({abi:moduleRegistryAbi,address:this.address,functionName:"isRegistered",args:[request.moduleAddress]});case 1:return _context105.a(2,_context105.v);}},_callee105,this);}));function isRegistered(_x79){return _isRegistered2.apply(this,arguments);}return isRegistered;}())}]);}();// Contract Multicall3 =============================================================
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 _callee106(request){var _yield$this$rpcClient57,call;return _regenerator().w(function(_context106){while(1)switch(_context106.n){case 0:_context106.n=1;return this.rpcClient.simulateContract({abi:multicall3Abi,address:this.address,functionName:"aggregate3",account:this.wallet.account,args:[request.calls]});case 1:_yield$this$rpcClient57=_context106.v;call=_yield$this$rpcClient57.request;_context106.n=2;return this.wallet.writeContract(call);case 2:return _context106.a(2,_context106.v);}},_callee106,this);}));function aggregate3(_x80){return _aggregate.apply(this,arguments);}return aggregate3;}()/**
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 _callee107(){return _regenerator().w(function(_context107){while(1)switch(_context107.n){case 0:_context107.n=1;return this.rpcClient.readContract({abi:piLicenseTemplateAbi,address:this.address,functionName:"ACCESS_CONTROLLER"});case 1:return _context107.a(2,_context107.v);}},_callee107,this);}));function accessController(){return _accessController2.apply(this,arguments);}return accessController;}()/**
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 _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:"IP_ASSET_REGISTRY"});case 1:return _context108.a(2,_context108.v);}},_callee108,this);}));function ipAssetRegistry(){return _ipAssetRegistry2.apply(this,arguments);}return ipAssetRegistry;}()/**
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 _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:"LICENSE_REGISTRY"});case 1:return _context109.a(2,_context109.v);}},_callee109,this);}));function licenseRegistry(){return _licenseRegistry.apply(this,arguments);}return licenseRegistry;}()/**
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 _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:"MODULE_REGISTRY"});case 1:return _context110.a(2,_context110.v);}},_callee110,this);}));function moduleRegistry(){return _moduleRegistry.apply(this,arguments);}return moduleRegistry;}()/**
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 _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:"ROYALTY_MODULE"});case 1:return _context111.a(2,_context111.v);}},_callee111,this);}));function royaltyModule(){return _royaltyModule2.apply(this,arguments);}return royaltyModule;}()/**
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 _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:"TERMS_RENDERER"});case 1:return _context112.a(2,_context112.v);}},_callee112,this);}));function termsRenderer(){return _termsRenderer.apply(this,arguments);}return termsRenderer;}()/**
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 _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:"UPGRADE_INTERFACE_VERSION"});case 1:return _context113.a(2,_context113.v);}},_callee113,this);}));function upgradeInterfaceVersion(){return _upgradeInterfaceVersion3.apply(this,arguments);}return upgradeInterfaceVersion;}()/**
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 _callee114(request){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:"allowDerivativeRegistration",args:[request.licenseTermsId]});case 1:return _context114.a(2,_context114.v);}},_callee114,this);}));function allowDerivativeRegistration(_x81){return _allowDerivativeRegistration.apply(this,arguments);}return allowDerivativeRegistration;}()/**
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 _callee115(){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:"authority"});case 1:return _context115.a(2,_context115.v);}},_callee115,this);}));function authority(){return _authority3.apply(this,arguments);}return authority;}()/**
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 _callee116(request){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:"canAttachToGroupIp",args:[request.licenseTermsId]});case 1:return _context116.a(2,_context116.v);}},_callee116,this);}));function canAttachToGroupIp(_x82){return _canAttachToGroupIp.apply(this,arguments);}return canAttachToGroupIp;}()/**
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 _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:"canOverrideRoyaltyPercent",args:[request.licenseTermsId,request.newRoyaltyPercent]});case 1:return _context117.a(2,_context117.v);}},_callee117,this);}));function canOverrideRoyaltyPercent(_x83){return _canOverrideRoyaltyPercent.apply(this,arguments);}return canOverrideRoyaltyPercent;}()/**
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 _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:"exists",args:[request.licenseTermsId]});case 1:return _context118.a(2,_context118.v);}},_callee118,this);}));function exists(_x84){return _exists.apply(this,arguments);}return exists;}()/**
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 _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:"getEarlierExpireTime",args:[request.licenseTermsIds,request.start]});case 1:return _context119.a(2,_context119.v);}},_callee119,this);}));function getEarlierExpireTime(_x85){return _getEarlierExpireTime.apply(this,arguments);}return getEarlierExpireTime;}()/**
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 _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:"getExpireTime",args:[request.licenseTermsId,request.start]});case 1:return _context120.a(2,_context120.v);}},_callee120,this);}));function getExpireTime(_x86){return _getExpireTime.apply(this,arguments);}return getExpireTime;}()/**
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 _callee121(request){var result;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:"getLicenseTerms",args:[request.selectedLicenseTermsId]});case 1:result=_context121.v;return _context121.a(2,{terms:result});}},_callee121,this);}));function getLicenseTerms(_x87){return _getLicenseTerms.apply(this,arguments);}return getLicenseTerms;}()/**
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 _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:"getLicenseTermsId",args:[request.terms]});case 1:result=_context122.v;return _context122.a(2,{selectedLicenseTermsId:result});}},_callee122,this);}));function getLicenseTermsId(_x88){return _getLicenseTermsId.apply(this,arguments);}return getLicenseTermsId;}()/**
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 _callee123(request){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:"getLicenseTermsURI",args:[request.licenseTermsId]});case 1:return _context123.a(2,_context123.v);}},_callee123,this);}));function getLicenseTermsUri(_x89){return _getLicenseTermsUri.apply(this,arguments);}return getLicenseTermsUri;}()/**
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 _callee124(){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:"getMetadataURI"});case 1:return _context124.a(2,_context124.v);}},_callee124,this);}));function getMetadataUri(){return _getMetadataUri.apply(this,arguments);}return getMetadataUri;}()/**
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 _callee125(request){var result;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:"getRoyaltyPolicy",args:[request.licenseTermsId]});case 1:result=_context125.v;return _context125.a(2,{royaltyPolicy:result[0],royaltyPercent:result[1],mintingFee:result[2],currency:result[3]});}},_callee125,this);}));function getRoyaltyPolicy(_x90){return _getRoyaltyPolicy.apply(this,arguments);}return getRoyaltyPolicy;}()/**
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 _callee126(){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:"isConsumingScheduledOp"});case 1:return _context126.a(2,_context126.v);}},_callee126,this);}));function isConsumingScheduledOp(){return _isConsumingScheduledOp3.apply(this,arguments);}return isConsumingScheduledOp;}()/**
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 _callee127(request){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:"isDerivativeApproved",args:[request.parentIpId,request.licenseTermsId,request.childIpId]});case 1:return _context127.a(2,_context127.v);}},_callee127,this);}));function isDerivativeApproved(_x91){return _isDerivativeApproved.apply(this,arguments);}return isDerivativeApproved;}()/**
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 _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:"isLicenseTransferable",args:[request.licenseTermsId]});case 1:return _context128.a(2,_context128.v);}},_callee128,this);}));function isLicenseTransferable(_x92){return _isLicenseTransferable.apply(this,arguments);}return isLicenseTransferable;}()/**
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 _callee129(){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:"name"});case 1:return _context129.a(2,_context129.v);}},_callee129,this);}));function name(){return _name2.apply(this,arguments);}return name;}()/**
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 _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:"proxiableUUID"});case 1:return _context130.a(2,_context130.v);}},_callee130,this);}));function proxiableUuid(){return _proxiableUuid3.apply(this,arguments);}return proxiableUuid;}()/**
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 _callee131(request){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:"supportsInterface",args:[request.interfaceId]});case 1:return _context131.a(2,_context131.v);}},_callee131,this);}));function supportsInterface(_x93){return _supportsInterface2.apply(this,arguments);}return supportsInterface;}()/**
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 _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:"toJson",args:[request.licenseTermsId]});case 1:return _context132.a(2,_context132.v);}},_callee132,this);}));function toJson(_x94){return _toJson.apply(this,arguments);}return toJson;}()/**
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 _callee133(){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:"totalRegisteredLicenseTerms"});case 1:return _context133.a(2,_context133.v);}},_callee133,this);}));function totalRegisteredLicenseTerms(){return _totalRegisteredLicenseTerms.apply(this,arguments);}return totalRegisteredLicenseTerms;}()/**
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 _callee134(request){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:"verifyCompatibleLicenses",args:[request.licenseTermsIds]});case 1:return _context134.a(2,_context134.v);}},_callee134,this);}));function verifyCompatibleLicenses(_x95){return _verifyCompatibleLicenses.apply(this,arguments);}return verifyCompatibleLicenses;}())}]);}(PiLicenseTemplateEventClient);/**
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 _this1;_classCallCheck(this,PiLicenseTemplateClient);_this1=_callSuper(this,PiLicenseTemplateClient,[rpcClient,address]);_this1.wallet=wallet;return _this1;}/**
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 _callee135(request){var _yield$this$rpcClient58,call;return _regenerator().w(function(_context135){while(1)switch(_context135.n){case 0:_context135.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$rpcClient58=_context135.v;call=_yield$this$rpcClient58.request;_context135.n=2;return this.wallet.writeContract(call);case 2:return _context135.a(2,_context135.v);}},_callee135,this);}));function initialize(_x96){return _initialize3.apply(this,arguments);}return initialize;}()/**
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 _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:"registerLicenseTerms",account:this.wallet.account,args:[request.terms]});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 registerLicenseTerms(_x97){return _registerLicenseTerms.apply(this,arguments);}return registerLicenseTerms;}()/**
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 _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:"setApproval",account:this.wallet.account,args:[request.parentIpId,request.licenseTermsId,request.childIpId,request.approved]});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 setApproval(_x98){return _setApproval.apply(this,arguments);}return setApproval;}()/**
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 _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:"setAuthority",account:this.wallet.account,args:[request.newAuthority]});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 setAuthority(_x99){return _setAuthority3.apply(this,arguments);}return setAuthority;}()/**
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 _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:"upgradeToAndCall",account:this.wallet.account,args:[request.newImplementation,request.data]});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 upgradeToAndCall(_x100){return _upgradeToAndCall3.apply(this,arguments);}return upgradeToAndCall;}()/**
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 _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:"verifyMintLicenseToken",account:this.wallet.account,args:[request[0],request[1],request[2],request[3]]});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 verifyMintLicenseToken(_x101){return _verifyMintLicenseToken.apply(this,arguments);}return verifyMintLicenseToken;}()/**
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 _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:"verifyRegisterDerivative",account:this.wallet.account,args:[request.childIpId,request.parentIpId,request.licenseTermsId,request.licensee]});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 verifyRegisterDerivative(_x102){return _verifyRegisterDerivative.apply(this,arguments);}return verifyRegisterDerivative;}()/**
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 _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:"verifyRegisterDerivativeForAllParents",account:this.wallet.account,args:[request.childIpId,request.parentIpIds,request.licenseTermsIds,request.caller]});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 verifyRegisterDerivativeForAllParents(_x103){return _verifyRegisterDerivativeForAllParents.apply(this,arguments);}return verifyRegisterDerivativeForAllParents;}()/**
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 _this10;_classCallCheck(this,RegistrationWorkflowsClient);_this10=_callSuper(this,RegistrationWorkflowsClient,[rpcClient,address]);_this10.wallet=wallet;return _this10;}/**
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 _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:registrationWorkflowsAbi,address:this.address,functionName:"createCollection",account:this.wallet.account,args:[request.spgNftInitParams]});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 createCollection(_x104){return _createCollection.apply(this,arguments);}return createCollection;}()/**
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 _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:"mintAndRegisterIp",account:this.wallet.account,args:[request.spgNftContract,request.recipient,request.ipMetadata,request.allowDuplicates]});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 mintAndRegisterIp(_x105){return _mintAndRegisterIp.apply(this,arguments);}return mintAndRegisterIp;}()/**
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 _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:"multicall",account:this.wallet.account,args:[request.data]});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 multicall(_x106){return _multicall3.apply(this,arguments);}return multicall;}()/**
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 _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:"registerIp",account:this.wallet.account,args:[request.nftContract,request.tokenId,request.ipMetadata,request.sigMetadata]});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 registerIp(_x107){return _registerIp.apply(this,arguments);}return registerIp;}()/**
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 _callee147(request){return _regenerator().w(function(_context147){while(1)switch(_context147.n){case 0:_context147.n=1;return this.rpcClient.readContract({abi:royaltyModuleAbi,address:this.address,functionName:"ipRoyaltyVaults",args:[request.ipId]});case 1:return _context147.a(2,_context147.v);}},_callee147,this);}));function ipRoyaltyVaults(_x108){return _ipRoyaltyVaults.apply(this,arguments);}return ipRoyaltyVaults;}()/**
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 _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:"isWhitelistedRoyaltyPolicy",args:[request.royaltyPolicy]});case 1:return _context148.a(2,_context148.v);}},_callee148,this);}));function isWhitelistedRoyaltyPolicy(_x109){return _isWhitelistedRoyaltyPolicy.apply(this,arguments);}return isWhitelistedRoyaltyPolicy;}()/**
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 _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:"isWhitelistedRoyaltyToken",args:[request.token]});case 1:return _context149.a(2,_context149.v);}},_callee149,this);}));function isWhitelistedRoyaltyToken(_x110){return _isWhitelistedRoyaltyToken.apply(this,arguments);}return isWhitelistedRoyaltyToken;}())}]);}(RoyaltyModuleEventClient);/**
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 _this11;_classCallCheck(this,RoyaltyModuleClient);_this11=_callSuper(this,RoyaltyModuleClient,[rpcClient,address]);_this11.wallet=wallet;return _this11;}/**
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 _callee150(request){var _yield$this$rpcClient70,call;return _regenerator().w(function(_context150){while(1)switch(_context150.n){case 0:_context150.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$rpcClient70=_context150.v;call=_yield$this$rpcClient70.request;_context150.n=2;return this.wallet.writeContract(call);case 2:return _context150.a(2,_context150.v);}},_callee150,this);}));function payRoyaltyOnBehalf(_x111){return _payRoyaltyOnBehalf.apply(this,arguments);}return payRoyaltyOnBehalf;}()/**
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 _callee174(request){var _yield$this$rpcClient81,call;return _regenerator().w(function(_context174){while(1)switch(_context174.n){case 0:_context174.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$rpcClient81=_context174.v;call=_yield$this$rpcClient81.request;_context174.n=2;return this.wallet.writeContract(call);case 2:return _context174.a(2,_context174.v);}},_callee174,this);}));function distributeRoyaltyTokens(_x123){return _distributeRoyaltyTokens.apply(this,arguments);}return distributeRoyaltyTokens;}()/**
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 _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:"mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens",account:this.wallet.account,args:[request.spgNftContract,request.recipient,request.ipMetadata,request.licenseTermsData,request.royaltyShares,request.allowDuplicates]});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 mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(_x124){return _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens.apply(this,arguments);}return mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens;}()/**
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 _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:"mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",account:this.wallet.account,args:[request.spgNftContract,request.recipient,request.ipMetadata,request.derivData,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 mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens(_x125){return _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens.apply(this,arguments);}return mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens;}()/**
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 _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:"multicall",account:this.wallet.account,args:[request.data]});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 multicall(_x126){return _multicall4.apply(this,arguments);}return multicall;}()/**
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 _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:"registerIpAndAttachPILTermsAndDeployRoyaltyVault",account:this.wallet.account,args:[request.nftContract,request.tokenId,request.ipMetadata,request.licenseTermsData,request.sigMetadataAndAttachAndConfig]});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 registerIpAndAttachPilTermsAndDeployRoyaltyVault(_x127){return _registerIpAndAttachPilTermsAndDeployRoyaltyVault.apply(this,arguments);}return registerIpAndAttachPilTermsAndDeployRoyaltyVault;}()/**
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 _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:"registerIpAndMakeDerivativeAndDeployRoyaltyVault",account:this.wallet.account,args:[request.nftContract,request.tokenId,request.ipMetadata,request.derivData,request.sigMetadataAndRegister]});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 registerIpAndMakeDerivativeAndDeployRoyaltyVault(_x128){return _registerIpAndMakeDerivativeAndDeployRoyaltyVault.apply(this,arguments);}return registerIpAndMakeDerivativeAndDeployRoyaltyVault;}()/**
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 _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: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$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 claimAllRevenue(_x129){return _claimAllRevenue.apply(this,arguments);}return claimAllRevenue;}()/**
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 _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:"multicall",account:this.wallet.account,args:[request.data]});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 multicall(_x130){return _multicall5.apply(this,arguments);}return multicall;}()/**
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 _callee187(request){return _regenerator().w(function(_context187){while(1)switch(_context187.n){case 0:_context187.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"hasRole",args:[request.role,request.account]});case 1:return _context187.a(2,_context187.v);}},_callee187,this);}));function hasRole(_x133){return _hasRole.apply(this,arguments);}return hasRole;}()/**
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 _callee188(){return _regenerator().w(function(_context188){while(1)switch(_context188.n){case 0:_context188.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"mintFee"});case 1:return _context188.a(2,_context188.v);}},_callee188,this);}));function mintFee(){return _mintFee.apply(this,arguments);}return mintFee;}()/**
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 _callee189(){return _regenerator().w(function(_context189){while(1)switch(_context189.n){case 0:_context189.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"mintFeeToken"});case 1:return _context189.a(2,_context189.v);}},_callee189,this);}));function mintFeeToken(){return _mintFeeToken.apply(this,arguments);}return mintFeeToken;}()/**
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 _callee190(){return _regenerator().w(function(_context190){while(1)switch(_context190.n){case 0:_context190.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"publicMinting"});case 1:return _context190.a(2,_context190.v);}},_callee190,this);}));function publicMinting(){return _publicMinting.apply(this,arguments);}return publicMinting;}()/**
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 _callee191(request){return _regenerator().w(function(_context191){while(1)switch(_context191.n){case 0:_context191.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"tokenURI",args:[request.tokenId]});case 1:return _context191.a(2,_context191.v);}},_callee191,this);}));function tokenUri(_x134){return _tokenUri.apply(this,arguments);}return tokenUri;}())}]);}(SpgnftImplEventClient);/**
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 _this14;_classCallCheck(this,SpgnftImplClient);_this14=_callSuper(this,SpgnftImplClient,[rpcClient,address]);_this14.wallet=wallet;return _this14;}/**
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 _callee192(request){var _yield$this$rpcClient92,call;return _regenerator().w(function(_context192){while(1)switch(_context192.n){case 0:_context192.n=1;return this.rpcClient.simulateContract({abi:spgnftImplAbi,address:this.address,functionName:"setTokenURI",account:this.wallet.account,args:[request.tokenId,request.tokenUri]});case 1:_yield$this$rpcClient92=_context192.v;call=_yield$this$rpcClient92.request;_context192.n=2;return this.wallet.writeContract(call);case 2:return _context192.a(2,_context192.v);}},_callee192,this);}));function setTokenUri(_x135){return _setTokenUri.apply(this,arguments);}return setTokenUri;}()/**
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 _callee193(request){var _yield$this$rpcClient93,call;return _regenerator().w(function(_context193){while(1)switch(_context193.n){case 0:_context193.n=1;return this.rpcClient.simulateContract({abi:totalLicenseTokenLimitHookAbi,address:this.address,functionName:"setTotalLicenseTokenLimit",account:this.wallet.account,args:[request.licensorIpId,request.licenseTemplate,request.licenseTermsId,request.limit]});case 1:_yield$this$rpcClient93=_context193.v;call=_yield$this$rpcClient93.request;_context193.n=2;return this.wallet.writeContract(call);case 2:return _context193.a(2,_context193.v);}},_callee193,this);}));function setTotalLicenseTokenLimit(_x136){return _setTotalLicenseTokenLimit.apply(this,arguments);}return setTotalLicenseTokenLimit;}()/**
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 _callee194(request){var result;return _regenerator().w(function(_context194){while(1)switch(_context194.n){case 0:_context194.n=1;return this.rpcClient.readContract({abi:wrappedIpAbi,address:this.address,functionName:"allowance",args:[request.owner,request.spender]});case 1:result=_context194.v;return _context194.a(2,{result:result});}},_callee194,this);}));function allowance(_x137){return _allowance2.apply(this,arguments);}return allowance;}()/**
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 _callee195(request){var result;return _regenerator().w(function(_context195){while(1)switch(_context195.n){case 0:_context195.n=1;return this.rpcClient.readContract({abi:wrappedIpAbi,address:this.address,functionName:"balanceOf",args:[request.owner]});case 1:result=_context195.v;return _context195.a(2,{result:result});}},_callee195,this);}));function balanceOf(_x138){return _balanceOf3.apply(this,arguments);}return balanceOf;}())}]);}();/**
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 _this15;_classCallCheck(this,WrappedIpClient);_this15=_callSuper(this,WrappedIpClient,[rpcClient,address]);_this15.wallet=wallet;return _this15;}/**
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 _approve2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee196(request){var _yield$this$rpcClient94,call;return _regenerator().w(function(_context196){while(1)switch(_context196.n){case 0:_context196.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$rpcClient94=_context196.v;call=_yield$this$rpcClient94.request;_context196.n=2;return this.wallet.writeContract(call);case 2:return _context196.a(2,_context196.v);}},_callee196,this);}));function approve(_x139){return _approve2.apply(this,arguments);}return approve;}()/**
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 _callee197(){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:"deposit",account:this.wallet.account});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 deposit(){return _deposit.apply(this,arguments);}return deposit;}()/**
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 _callee198(request){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:"transfer",account:this.wallet.account,args:[request.to,request.amount]});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 transfer(_x140){return _transfer2.apply(this,arguments);}return transfer;}()/**
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 _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:"transferFrom",account:this.wallet.account,args:[request.from,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 transferFrom(_x141){return _transferFrom2.apply(this,arguments);}return transferFrom;}()/**
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 _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:"withdraw",account:this.wallet.account,args:[request.value]});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 withdraw(_x142){return _withdraw.apply(this,arguments);}return withdraw;}()/**
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
@@ -2886,7 +2903,6 @@ var mainnet = utils.defineChain({
2886
2903
  });
2887
2904
 
2888
2905
  var defaultFunctionSelector = "0x00000000";
2889
- var royaltySharesTotalSupply = 100000000;
2890
2906
  var MAX_ROYALTY_TOKEN = 100000000;
2891
2907
  var WIP_TOKEN_ADDRESS = wrappedIpAddress[mainnet.id];
2892
2908
 
@@ -3255,6 +3271,24 @@ var waitForTxReceipts = /*#__PURE__*/function () {
3255
3271
  };
3256
3272
  }();
3257
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
+ }();
3258
3292
  var chainStringToViemChain = function chainStringToViemChain(chainId) {
3259
3293
  switch (chainId) {
3260
3294
  case 1315:
@@ -3291,6 +3325,22 @@ var getTokenAmountDisplay = function getTokenAmountDisplay(amount) {
3291
3325
  return "".concat(viem.formatEther(amount)).concat(unit);
3292
3326
  };
3293
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
+
3294
3344
  /**
3295
3345
  * check the allowance of all spenders and call approval if any spender
3296
3346
  * allowance is lower than the amount they are expected to spend.
@@ -3500,153 +3550,365 @@ var multiCallWrapIp = /*#__PURE__*/function () {
3500
3550
  }();
3501
3551
 
3502
3552
  /**
3503
- * Handle contract calls that require token fees. For fees in WIP, it automatically wraps IP to WIP when insufficient WIP balance.
3504
- * For all other ERC20 tokens, it handles approvals if insufficient allowance.
3505
- *
3506
- * @remarks
3507
- * This function will automatically handle the following:
3508
- *
3509
- * If token is wip and the user does not have enough WIP, it will wrap IP to WIP, unless
3510
- * disabled via `disableAutoWrappingIp`.
3511
- *
3512
- * If the user have enough token, it will check for if approvals are needed
3513
- * for each spender address and approve it, unless disabled via `disableAutoApprove`.
3553
+ * Calculate the total amount needed from spenders.
3514
3554
  */
3515
- var contractCallWithFees = /*#__PURE__*/function () {
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 () {
3516
3565
  var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref6) {
3517
- var _options$wipOptions;
3518
- var totalFees, options, multicall3Address, wallet, tokenSpenders, contractCall, sender, txOptions, encodedTxs, rpcClient, token, wipTokenClient, isWip, selectedOptions, tokenClient, _txHash, balance, autoApprove, _txHash2, autoWrapIp, startingBalance, calls, _yield$multiCallWrapI, txHash;
3566
+ var _options$erc20Options;
3567
+ var tokenSpenders, sender, options, multicall3Address, rpcClient, wallet, contractCall, txOptions, tokenClient, autoApprove, _t2;
3519
3568
  return _regenerator().w(function (_context4) {
3520
3569
  while (1) switch (_context4.n) {
3521
3570
  case 0:
3522
- totalFees = _ref6.totalFees, options = _ref6.options, multicall3Address = _ref6.multicall3Address, wallet = _ref6.wallet, tokenSpenders = _ref6.tokenSpenders, contractCall = _ref6.contractCall, sender = _ref6.sender, txOptions = _ref6.txOptions, encodedTxs = _ref6.encodedTxs, rpcClient = _ref6.rpcClient, token = _ref6.token;
3523
- wipTokenClient = new WipTokenClient(rpcClient, wallet);
3524
- isWip = token === wipTokenClient.address || token === undefined;
3525
- selectedOptions = isWip ? options === null || options === void 0 ? void 0 : options.wipOptions : options.erc20Options;
3526
- tokenClient = isWip ? wipTokenClient : new ERC20Client(rpcClient, wallet, token); // if no fees, skip all logic
3527
- if (!(totalFees === 0n)) {
3528
- _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;
3529
3576
  break;
3530
3577
  }
3531
3578
  _context4.n = 1;
3532
- return contractCall();
3579
+ return approvalAllSpenders({
3580
+ spenders: tokenSpenders,
3581
+ client: tokenClient,
3582
+ owner: sender,
3583
+ multicallAddress: multicall3Address,
3584
+ rpcClient: rpcClient,
3585
+ useMultiCall: false
3586
+ });
3533
3587
  case 1:
3534
- _txHash = _context4.v;
3535
- return _context4.a(2, handleTransactionResponse(_txHash, rpcClient, txOptions));
3588
+ _t2 = handleTransactionResponse;
3589
+ _context4.n = 2;
3590
+ return contractCall();
3536
3591
  case 2:
3537
- _context4.n = 3;
3538
- return tokenClient.balanceOf(sender);
3539
- case 3:
3540
- balance = _context4.v;
3541
- autoApprove = (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.enableAutoApprove) !== false; // handle when there's enough token to cover all fees
3542
- if (!(balance >= totalFees)) {
3543
- _context4.n = 6;
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;
3544
3620
  break;
3545
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;
3546
3635
  if (!autoApprove) {
3547
- _context4.n = 4;
3636
+ _context5.n = 3;
3548
3637
  break;
3549
3638
  }
3550
- _context4.n = 4;
3639
+ _context5.n = 3;
3551
3640
  return approvalAllSpenders({
3552
3641
  spenders: tokenSpenders,
3553
- client: tokenClient,
3642
+ client: wipTokenClient,
3554
3643
  owner: sender,
3555
- // sender owns the wip
3556
3644
  multicallAddress: multicall3Address,
3557
3645
  rpcClient: rpcClient,
3558
- // since sender has all token, if using multicall, we cannot approve transfer token into multicall by multicall.
3559
- // So in this case, we don't use multicall here and instead just wait for each approval to be finished.
3560
3646
  useMultiCall: false
3561
3647
  });
3562
- case 4:
3563
- _context4.n = 5;
3648
+ case 3:
3649
+ _t3 = handleTransactionResponse;
3650
+ _context5.n = 4;
3564
3651
  return contractCall();
3565
- case 5:
3566
- _txHash2 = _context4.v;
3567
- return _context4.a(2, handleTransactionResponse(_txHash2, rpcClient, txOptions));
3568
- case 6:
3569
- if (isWip) {
3570
- _context4.n = 7;
3571
- break;
3572
- }
3573
- throw new Error("Wallet does not have enough erc20 token to pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(balance), "."));
3574
- case 7:
3575
- autoWrapIp = (options === null || options === void 0 || (_options$wipOptions = options.wipOptions) === null || _options$wipOptions === void 0 ? void 0 : _options$wipOptions.enableAutoWrapIp) !== false;
3576
- _context4.n = 8;
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;
3577
3675
  return rpcClient.getBalance({
3578
3676
  address: sender
3579
3677
  });
3580
- case 8:
3581
- startingBalance = _context4.v;
3582
- if (!(startingBalance < totalFees)) {
3583
- _context4.n = 9;
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;
3584
3688
  break;
3585
3689
  }
3586
- 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(startingBalance), "."));
3587
- case 9:
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:
3588
3692
  if (autoWrapIp) {
3589
- _context4.n = 10;
3693
+ _context6.n = 4;
3590
3694
  break;
3591
3695
  }
3592
- throw new Error("Wallet does not have enough WIP to pay for fees. Total fees: ".concat(getTokenAmountDisplay(totalFees), ", balance: ").concat(getTokenAmountDisplay(balance, "WIP"), "."));
3593
- case 10:
3594
- calls = encodedTxs === null || encodedTxs === void 0 ? void 0 : encodedTxs.map(function (data) {
3595
- return {
3596
- target: data.to,
3597
- allowFailure: false,
3598
- value: 0n,
3599
- callData: data.data
3600
- };
3601
- });
3602
- _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;
3603
3699
  return multiCallWrapIp({
3604
3700
  ipAmountToWrap: totalFees,
3605
3701
  multicall3Address: multicall3Address,
3606
- wipClient: wipTokenClient,
3702
+ wipClient: wipClient,
3607
3703
  wipOptions: options === null || options === void 0 ? void 0 : options.wipOptions,
3608
3704
  contractCall: contractCall,
3609
3705
  wipSpenders: tokenSpenders,
3610
3706
  rpcClient: rpcClient,
3611
3707
  wallet: wallet,
3612
- calls: 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
+ })
3613
3716
  });
3614
- case 11:
3615
- _yield$multiCallWrapI = _context4.v;
3717
+ case 5:
3718
+ _yield$multiCallWrapI = _context6.v;
3616
3719
  txHash = _yield$multiCallWrapI.txHash;
3617
- return _context4.a(2, handleTransactionResponse(txHash, rpcClient, txOptions));
3720
+ return _context6.a(2, handleTransactionResponse(txHash, rpcClient, txOptions));
3618
3721
  }
3619
- }, _callee4);
3722
+ }, _callee6);
3620
3723
  }));
3621
- return function contractCallWithFees(_x4) {
3622
- return _ref7.apply(this, arguments);
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);
3623
3830
  };
3624
3831
  }();
3625
3832
  var handleTransactionResponse = /*#__PURE__*/function () {
3626
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(txHash, rpcClient, txOptions) {
3627
- return _regenerator().w(function (_context5) {
3628
- while (1) switch (_context5.n) {
3833
+ var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(txHash, rpcClient, txOptions) {
3834
+ return _regenerator().w(function (_context8) {
3835
+ while (1) switch (_context8.n) {
3629
3836
  case 0:
3630
3837
  if (!Array.isArray(txHash)) {
3631
- _context5.n = 1;
3838
+ _context8.n = 1;
3632
3839
  break;
3633
3840
  }
3634
- return _context5.a(2, waitForTxReceipts({
3841
+ return _context8.a(2, waitForTxReceipts({
3635
3842
  rpcClient: rpcClient,
3636
3843
  txOptions: txOptions,
3637
3844
  txHashes: txHash
3638
3845
  }));
3639
3846
  case 1:
3640
- return _context5.a(2, waitForTxReceipt({
3847
+ return _context8.a(2, waitForTxReceipt({
3641
3848
  rpcClient: rpcClient,
3642
3849
  txOptions: txOptions,
3643
3850
  txHash: txHash
3644
3851
  }));
3645
3852
  }
3646
- }, _callee5);
3853
+ }, _callee8);
3647
3854
  }));
3648
- return function handleTransactionResponse(_x5, _x6, _x7) {
3649
- return _ref8.apply(this, arguments);
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);
3650
3912
  };
3651
3913
  }();
3652
3914
 
@@ -4038,7 +4300,6 @@ var DisputeClient = /*#__PURE__*/function () {
4038
4300
  };
4039
4301
  _context.n = 8;
4040
4302
  return contractCallWithFees({
4041
- totalFees: bonds,
4042
4303
  options: {
4043
4304
  wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
4044
4305
  // Disable multicall because multicall makes more complex due to disputeInitiator in this version.
@@ -4049,7 +4310,9 @@ var DisputeClient = /*#__PURE__*/function () {
4049
4310
  rpcClient: this.rpcClient,
4050
4311
  tokenSpenders: [{
4051
4312
  address: this.arbitrationPolicyUmaClient.address,
4052
- amount: bonds
4313
+ amount: bonds,
4314
+ // Currently, only WIP is supported as the whitelisted dispute bond token.
4315
+ token: WIP_TOKEN_ADDRESS
4053
4316
  }],
4054
4317
  contractCall: contractCall,
4055
4318
  encodedTxs: [encodedTxData],
@@ -4388,7 +4651,6 @@ var DisputeClient = /*#__PURE__*/function () {
4388
4651
  };
4389
4652
  _context5.n = 5;
4390
4653
  return contractCallWithFees({
4391
- totalFees: bond,
4392
4654
  options: {
4393
4655
  wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
4394
4656
  // Disable auto approve because msg.sender is ipAccount instead of wallet.
@@ -4402,7 +4664,9 @@ var DisputeClient = /*#__PURE__*/function () {
4402
4664
  contractCall: contractCall,
4403
4665
  tokenSpenders: [{
4404
4666
  address: this.arbitrationPolicyUmaClient.address,
4405
- amount: bond
4667
+ amount: bond,
4668
+ // Currently, only WIP is supported as the whitelisted dispute bond token.
4669
+ token: WIP_TOKEN_ADDRESS
4406
4670
  }],
4407
4671
  encodedTxs: [encodedData],
4408
4672
  wallet: this.wallet,
@@ -4598,13 +4862,13 @@ var royaltyPolicyInputToAddress = function royaltyPolicyInputToAddress(input, ch
4598
4862
  }
4599
4863
  return address;
4600
4864
  };
4601
- var getRevenueShare = function getRevenueShare(revShare) {
4865
+ var getRevenueShare = function getRevenueShare(revShareNumber) {
4602
4866
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RevShareType.COMMERCIAL_REVENUE_SHARE;
4603
- var revShareNumber = Number(revShare);
4604
4867
  if (revShareNumber < 0 || revShareNumber > 100) {
4605
4868
  throw new Error("".concat(type, " must be between 0 and 100."));
4606
4869
  }
4607
- return revShareNumber * Math.pow(10, 6);
4870
+ // use Math.trunc to avoid precision issues
4871
+ return Math.trunc(revShareNumber * Math.pow(10, 6));
4608
4872
  };
4609
4873
 
4610
4874
  /**
@@ -6017,13 +6281,13 @@ var predictMintingLicenseFee = /*#__PURE__*/function () {
6017
6281
  }();
6018
6282
  var calculateDerivativeMintingFee = /*#__PURE__*/function () {
6019
6283
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
6020
- var derivData, rpcClient, chainId, wallet, sender, walletAddress, totalDerivativeMintingFee, i, derivativeMintingFee;
6284
+ var derivData, rpcClient, chainId, wallet, sender, walletAddress, mintFees, i, mintFee;
6021
6285
  return _regenerator().w(function (_context2) {
6022
6286
  while (1) switch (_context2.n) {
6023
6287
  case 0:
6024
6288
  derivData = _ref3.derivData, rpcClient = _ref3.rpcClient, chainId = _ref3.chainId, wallet = _ref3.wallet, sender = _ref3.sender;
6025
6289
  walletAddress = sender || wallet.account.address;
6026
- totalDerivativeMintingFee = 0n;
6290
+ mintFees = [];
6027
6291
  i = 0;
6028
6292
  case 1:
6029
6293
  if (!(i < derivData.parentIpIds.length)) {
@@ -6031,7 +6295,7 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
6031
6295
  break;
6032
6296
  }
6033
6297
  _context2.n = 2;
6034
- return calculateLicenseWipMintFee({
6298
+ return calculateLicenseMintFee({
6035
6299
  predictMintingFeeRequest: {
6036
6300
  licensorIpId: derivData.parentIpIds[i],
6037
6301
  licenseTemplate: derivData.licenseTemplate,
@@ -6045,14 +6309,16 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
6045
6309
  walletAddress: walletAddress
6046
6310
  });
6047
6311
  case 2:
6048
- derivativeMintingFee = _context2.v;
6049
- totalDerivativeMintingFee += derivativeMintingFee;
6312
+ mintFee = _context2.v;
6313
+ if (mintFee.amount > 0n) {
6314
+ mintFees.push(mintFee);
6315
+ }
6050
6316
  case 3:
6051
6317
  i++;
6052
6318
  _context2.n = 1;
6053
6319
  break;
6054
6320
  case 4:
6055
- return _context2.a(2, totalDerivativeMintingFee);
6321
+ return _context2.a(2, mintFees);
6056
6322
  }
6057
6323
  }, _callee2);
6058
6324
  }));
@@ -6060,9 +6326,9 @@ var calculateDerivativeMintingFee = /*#__PURE__*/function () {
6060
6326
  return _ref4.apply(this, arguments);
6061
6327
  };
6062
6328
  }();
6063
- var calculateLicenseWipMintFee = /*#__PURE__*/function () {
6329
+ var calculateLicenseMintFee = /*#__PURE__*/function () {
6064
6330
  var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
6065
- var predictMintingFeeRequest, rpcClient, chainId, walletAddress, fee;
6331
+ var predictMintingFeeRequest, rpcClient, chainId, walletAddress, _yield$predictMinting, currencyToken, tokenAmount;
6066
6332
  return _regenerator().w(function (_context3) {
6067
6333
  while (1) switch (_context3.n) {
6068
6334
  case 0:
@@ -6075,24 +6341,23 @@ var calculateLicenseWipMintFee = /*#__PURE__*/function () {
6075
6341
  walletAddress: walletAddress
6076
6342
  });
6077
6343
  case 1:
6078
- fee = _context3.v;
6079
- if (!(fee.currencyToken !== WIP_TOKEN_ADDRESS)) {
6080
- _context3.n = 2;
6081
- break;
6082
- }
6083
- return _context3.a(2, 0n);
6084
- case 2:
6085
- 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
+ });
6086
6351
  }
6087
6352
  }, _callee3);
6088
6353
  }));
6089
- return function calculateLicenseWipMintFee(_x3) {
6354
+ return function calculateLicenseMintFee(_x3) {
6090
6355
  return _ref6.apply(this, arguments);
6091
6356
  };
6092
6357
  }();
6093
- var calculateSPGWipMintFee = /*#__PURE__*/function () {
6358
+ var calculateSPGMintFee = /*#__PURE__*/function () {
6094
6359
  var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(spgNftClient) {
6095
- var token;
6360
+ var token, amount;
6096
6361
  return _regenerator().w(function (_context4) {
6097
6362
  while (1) switch (_context4.n) {
6098
6363
  case 0:
@@ -6100,20 +6365,24 @@ var calculateSPGWipMintFee = /*#__PURE__*/function () {
6100
6365
  return spgNftClient.mintFeeToken();
6101
6366
  case 1:
6102
6367
  token = _context4.v;
6103
- if (!(token !== WIP_TOKEN_ADDRESS)) {
6104
- _context4.n = 2;
6368
+ _context4.n = 2;
6369
+ return spgNftClient.mintFee();
6370
+ case 2:
6371
+ amount = _context4.v;
6372
+ if (!(amount > 0n)) {
6373
+ _context4.n = 3;
6105
6374
  break;
6106
6375
  }
6107
- return _context4.a(2, 0n);
6108
- case 2:
6109
- _context4.n = 3;
6110
- return spgNftClient.mintFee();
6376
+ return _context4.a(2, {
6377
+ token: token,
6378
+ amount: amount
6379
+ });
6111
6380
  case 3:
6112
- return _context4.a(2, _context4.v);
6381
+ return _context4.a(2);
6113
6382
  }
6114
6383
  }, _callee4);
6115
6384
  }));
6116
- return function calculateSPGWipMintFee(_x4) {
6385
+ return function calculateSPGMintFee(_x4) {
6117
6386
  return _ref7.apply(this, arguments);
6118
6387
  };
6119
6388
  }();
@@ -6686,15 +6955,17 @@ var getRoyaltyShares = function getRoyaltyShares(royaltyShares) {
6686
6955
  if (sum > 100) {
6687
6956
  throw new Error("The sum of the royalty shares cannot exceeds 100.");
6688
6957
  }
6689
- var value = share.percentage / 100 * royaltySharesTotalSupply;
6958
+ // use Math.trunc to avoid precision issues
6959
+ var value = Math.trunc(share.percentage * Math.pow(10, 6));
6690
6960
  actualTotal += value;
6691
6961
  return _objectSpread2(_objectSpread2({}, share), {}, {
6692
6962
  percentage: value
6693
6963
  });
6694
6964
  });
6965
+ // use Math.trunc to avoid precision issues
6695
6966
  return {
6696
6967
  royaltyShares: shares,
6697
- totalAmount: actualTotal
6968
+ totalAmount: Math.trunc(actualTotal)
6698
6969
  };
6699
6970
  };
6700
6971
  var validateDerivativeData = /*#__PURE__*/function () {
@@ -6862,7 +7133,7 @@ var mergeSpenders = function mergeSpenders(previousSpenders, newSpenders) {
6862
7133
  return acc;
6863
7134
  }
6864
7135
  var existingSpender = acc.find(function (s) {
6865
- return s.address === spender.address;
7136
+ return s.address === spender.address && s.token === spender.token;
6866
7137
  });
6867
7138
  if (!existingSpender) {
6868
7139
  acc.push(_objectSpread2(_objectSpread2({}, spender), {}, {
@@ -6928,7 +7199,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
6928
7199
  var _currentRequest$extra;
6929
7200
  var res = _step.value;
6930
7201
  var spenders = res.spenders,
6931
- totalFees = res.totalFees,
6932
7202
  encodedTxData = res.encodedTxData,
6933
7203
  workflowClient = res.workflowClient,
6934
7204
  isUseMulticall3 = res.isUseMulticall3,
@@ -6941,7 +7211,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
6941
7211
  if (!aggregateRegistrationRequest[targetAddress]) {
6942
7212
  aggregateRegistrationRequest[targetAddress] = {
6943
7213
  spenders: [],
6944
- totalFees: 0n,
6945
7214
  encodedTxData: [],
6946
7215
  contractCall: [],
6947
7216
  extraData: []
@@ -6949,7 +7218,6 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
6949
7218
  }
6950
7219
  var currentRequest = aggregateRegistrationRequest[targetAddress];
6951
7220
  currentRequest.spenders = mergeSpenders(currentRequest.spenders, spenders || []);
6952
- currentRequest.totalFees += totalFees || 0n;
6953
7221
  currentRequest.encodedTxData = currentRequest.encodedTxData.concat(encodedTxData);
6954
7222
  currentRequest.extraData = (_currentRequest$extra = currentRequest.extraData) === null || _currentRequest$extra === void 0 ? void 0 : _currentRequest$extra.concat(extraData || undefined);
6955
7223
  if (isUseMulticall3 || disableMulticallWhenPossible) {
@@ -6976,19 +7244,20 @@ var aggregateTransformIpRegistrationWorkflow = function aggregateTransformIpRegi
6976
7244
  };
6977
7245
  var handleMulticall = /*#__PURE__*/function () {
6978
7246
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
6979
- var transferWorkflowRequests, multicall3Address, wipOptions, rpcClient, wallet, walletAddress, aggregateRegistrationRequest, txResponses, _loop2, key, _t2, _t3;
7247
+ var _options$wipOptions;
7248
+ var transferWorkflowRequests, multicall3Address, options, rpcClient, wallet, walletAddress, aggregateRegistrationRequest, txResponses, _loop2, key, _t2, _t3;
6980
7249
  return _regenerator().w(function (_context3) {
6981
7250
  while (1) switch (_context3.n) {
6982
7251
  case 0:
6983
- transferWorkflowRequests = _ref.transferWorkflowRequests, multicall3Address = _ref.multicall3Address, wipOptions = _ref.wipOptions, rpcClient = _ref.rpcClient, wallet = _ref.wallet, walletAddress = _ref.walletAddress;
6984
- 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);
6985
7254
  txResponses = [];
6986
7255
  _loop2 = /*#__PURE__*/_regenerator().m(function _loop2() {
6987
- var _aggregateRegistratio, spenders, totalFees, encodedTxData, contractCall, contractCalls, useMulticallWhenPossible, txResponse;
7256
+ var _aggregateRegistratio, spenders, encodedTxData, contractCall, contractCalls, useMulticallWhenPossible, txResponse;
6988
7257
  return _regenerator().w(function (_context2) {
6989
7258
  while (1) switch (_context2.n) {
6990
7259
  case 0:
6991
- _aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders, totalFees = _aggregateRegistratio.totalFees, encodedTxData = _aggregateRegistratio.encodedTxData, contractCall = _aggregateRegistratio.contractCall;
7260
+ _aggregateRegistratio = aggregateRegistrationRequest[key], spenders = _aggregateRegistratio.spenders, encodedTxData = _aggregateRegistratio.encodedTxData, contractCall = _aggregateRegistratio.contractCall;
6992
7261
  contractCalls = /*#__PURE__*/function () {
6993
7262
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
6994
7263
  var txHashes, _iterator2, _step2, call, txHash, _t;
@@ -7036,12 +7305,11 @@ var handleMulticall = /*#__PURE__*/function () {
7036
7305
  useMulticallWhenPossible = key === multicall3Address ? true : false;
7037
7306
  _context2.n = 1;
7038
7307
  return contractCallWithFees({
7039
- totalFees: totalFees,
7040
- options: {
7041
- wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
7308
+ options: _objectSpread2(_objectSpread2({}, options), {}, {
7309
+ wipOptions: _objectSpread2(_objectSpread2({}, options === null || options === void 0 ? void 0 : options.wipOptions), {}, {
7042
7310
  useMulticallWhenPossible: useMulticallWhenPossible
7043
7311
  })
7044
- },
7312
+ }),
7045
7313
  multicall3Address: multicall3Address,
7046
7314
  rpcClient: rpcClient,
7047
7315
  tokenSpenders: spenders,
@@ -7160,7 +7428,7 @@ var transformRegistrationRequest = /*#__PURE__*/function () {
7160
7428
  */
7161
7429
  var handleRegisterRequest = /*#__PURE__*/function () {
7162
7430
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3) {
7163
- var request, rpcClient, wallet, chainId, ipIdAddress, baseRequest, calculatedDeadline, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, _yield$validateLicens, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, totalFees;
7431
+ var request, rpcClient, wallet, chainId, ipIdAddress, baseRequest, calculatedDeadline, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, _yield$validateLicens, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, derivativeMintingFee;
7164
7432
  return _regenerator().w(function (_context2) {
7165
7433
  while (1) switch (_context2.n) {
7166
7434
  case 0:
@@ -7252,7 +7520,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
7252
7520
  wallet: wallet
7253
7521
  });
7254
7522
  case 9:
7255
- totalFees = _context2.v;
7523
+ derivativeMintingFee = _context2.v;
7256
7524
  if (!("royaltyShares" in request)) {
7257
7525
  _context2.n = 11;
7258
7526
  break;
@@ -7267,7 +7535,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
7267
7535
  wallet: wallet,
7268
7536
  chainId: chainId,
7269
7537
  royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient,
7270
- totalFees: totalFees,
7538
+ derivativeMintingFee: derivativeMintingFee,
7271
7539
  royaltyShares: request.royaltyShares
7272
7540
  });
7273
7541
  case 10:
@@ -7283,7 +7551,7 @@ var handleRegisterRequest = /*#__PURE__*/function () {
7283
7551
  wallet: wallet,
7284
7552
  chainId: chainId,
7285
7553
  derivativeWorkflowsClient: derivativeWorkflowsClient,
7286
- totalFees: totalFees
7554
+ derivativeMintingFee: derivativeMintingFee
7287
7555
  });
7288
7556
  case 12:
7289
7557
  return _context2.a(2, _context2.v);
@@ -7304,11 +7572,11 @@ var handleRegisterRequest = /*#__PURE__*/function () {
7304
7572
  */
7305
7573
  var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
7306
7574
  var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {
7307
- var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient, totalFees, signature, transformRequest;
7575
+ var request, calculatedDeadline, ipIdAddress, wallet, chainId, derivativeWorkflowsClient, derivativeMintingFee, signature, transformRequest, spenders;
7308
7576
  return _regenerator().w(function (_context3) {
7309
7577
  while (1) switch (_context3.n) {
7310
7578
  case 0:
7311
- request = _ref5.request, calculatedDeadline = _ref5.calculatedDeadline, ipIdAddress = _ref5.ipIdAddress, wallet = _ref5.wallet, chainId = _ref5.chainId, derivativeWorkflowsClient = _ref5.derivativeWorkflowsClient, totalFees = _ref5.totalFees;
7579
+ request = _ref5.request, calculatedDeadline = _ref5.calculatedDeadline, ipIdAddress = _ref5.ipIdAddress, wallet = _ref5.wallet, chainId = _ref5.chainId, derivativeWorkflowsClient = _ref5.derivativeWorkflowsClient, derivativeMintingFee = _ref5.derivativeMintingFee;
7312
7580
  _context3.n = 1;
7313
7581
  return generateOperationSignature({
7314
7582
  ipIdAddress: ipIdAddress,
@@ -7326,15 +7594,16 @@ var transferRegisterDerivativeIpRequest = /*#__PURE__*/function () {
7326
7594
  signature: signature
7327
7595
  }
7328
7596
  });
7597
+ spenders = derivativeMintingFee.map(function (fee) {
7598
+ return _objectSpread2({
7599
+ address: derivativeWorkflowsClient.address
7600
+ }, fee);
7601
+ });
7329
7602
  return _context3.a(2, {
7330
7603
  // The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
7331
7604
  transformRequest: transformRequest,
7332
7605
  isUseMulticall3: false,
7333
- spenders: [{
7334
- address: derivativeWorkflowsClient.address,
7335
- amount: totalFees
7336
- }],
7337
- totalFees: totalFees,
7606
+ spenders: spenders,
7338
7607
  contractCall: function contractCall() {
7339
7608
  return derivativeWorkflowsClient.registerIpAndMakeDerivative(transformRequest);
7340
7609
  },
@@ -7475,11 +7744,11 @@ var transferRegisterIpAndAttachPilTermsRequest = /*#__PURE__*/function () {
7475
7744
  */
7476
7745
  var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE__*/function () {
7477
7746
  var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref1) {
7478
- var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient, totalFees, royaltyShares, signature, transformRequest;
7747
+ var request, calculatedDeadline, ipIdAddress, wallet, chainId, royaltyTokenDistributionWorkflowsClient, derivativeMintingFee, royaltyShares, signature, transformRequest, spenders;
7479
7748
  return _regenerator().w(function (_context6) {
7480
7749
  while (1) switch (_context6.n) {
7481
7750
  case 0:
7482
- request = _ref1.request, calculatedDeadline = _ref1.calculatedDeadline, ipIdAddress = _ref1.ipIdAddress, wallet = _ref1.wallet, chainId = _ref1.chainId, royaltyTokenDistributionWorkflowsClient = _ref1.royaltyTokenDistributionWorkflowsClient, totalFees = _ref1.totalFees, royaltyShares = _ref1.royaltyShares;
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;
7483
7752
  _context6.n = 1;
7484
7753
  return generateOperationSignature({
7485
7754
  ipIdAddress: ipIdAddress,
@@ -7497,15 +7766,16 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
7497
7766
  signature: signature
7498
7767
  }
7499
7768
  });
7769
+ spenders = derivativeMintingFee.map(function (fee) {
7770
+ return _objectSpread2({
7771
+ address: royaltyTokenDistributionWorkflowsClient.address
7772
+ }, fee);
7773
+ });
7500
7774
  return _context6.a(2, {
7501
7775
  // The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
7502
7776
  transformRequest: transformRequest,
7503
7777
  isUseMulticall3: false,
7504
- spenders: [{
7505
- address: royaltyTokenDistributionWorkflowsClient.address,
7506
- amount: totalFees
7507
- }],
7508
- totalFees: totalFees,
7778
+ spenders: spenders,
7509
7779
  contractCall: function contractCall() {
7510
7780
  return royaltyTokenDistributionWorkflowsClient.registerIpAndMakeDerivativeAndDeployRoyaltyVault(transformRequest);
7511
7781
  },
@@ -7553,7 +7823,7 @@ var transferRegisterIpAndMakeDerivativeAndDeployRoyaltyVaultRequest = /*#__PURE_
7553
7823
  var handleMintAndRegisterRequest = /*#__PURE__*/function () {
7554
7824
  var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref11) {
7555
7825
  var _request$allowDuplica;
7556
- var request, rpcClient, wallet, chainId, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, isPublicMinting, nftMintFee, baseRequest, _yield$validateLicens2, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, totalDerivativeMintingFee, requestWithDeriv;
7826
+ var request, rpcClient, wallet, chainId, royaltyTokenDistributionWorkflowsClient, licenseAttachmentWorkflowsClient, derivativeWorkflowsClient, isPublicMinting, nftMintFee, baseRequest, _yield$validateLicens2, licenseTermsData, maxLicenseTokens, requestWithTerms, derivData, derivativeMintingFee, requestWithDeriv;
7557
7827
  return _regenerator().w(function (_context7) {
7558
7828
  while (1) switch (_context7.n) {
7559
7829
  case 0:
@@ -7566,7 +7836,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
7566
7836
  case 1:
7567
7837
  isPublicMinting = _context7.v;
7568
7838
  _context7.n = 2;
7569
- return calculateSPGWipMintFee(new SpgnftImplReadOnlyClient(rpcClient, request.spgNftContract));
7839
+ return calculateSPGMintFee(new SpgnftImplReadOnlyClient(rpcClient, request.spgNftContract));
7570
7840
  case 2:
7571
7841
  nftMintFee = _context7.v;
7572
7842
  baseRequest = {
@@ -7632,7 +7902,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
7632
7902
  wallet: wallet
7633
7903
  });
7634
7904
  case 7:
7635
- totalDerivativeMintingFee = _context7.v;
7905
+ derivativeMintingFee = _context7.v;
7636
7906
  requestWithDeriv = _objectSpread2(_objectSpread2({}, baseRequest), {}, {
7637
7907
  derivData: derivData
7638
7908
  });
@@ -7646,7 +7916,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
7646
7916
  }),
7647
7917
  nftMintFee: nftMintFee,
7648
7918
  isPublicMinting: isPublicMinting,
7649
- totalDerivativeMintingFee: totalDerivativeMintingFee,
7919
+ derivativeMintingFee: derivativeMintingFee,
7650
7920
  royaltyTokenDistributionWorkflowsClient: royaltyTokenDistributionWorkflowsClient
7651
7921
  }));
7652
7922
  case 8:
@@ -7657,7 +7927,7 @@ var handleMintAndRegisterRequest = /*#__PURE__*/function () {
7657
7927
  derivativeWorkflowsClient: derivativeWorkflowsClient,
7658
7928
  nftMintFee: nftMintFee,
7659
7929
  isPublicMinting: isPublicMinting,
7660
- totalDerivativeMintingFee: totalDerivativeMintingFee
7930
+ derivativeMintingFee: derivativeMintingFee
7661
7931
  }));
7662
7932
  case 9:
7663
7933
  throw new Error("Invalid mint and register request type");
@@ -7692,11 +7962,9 @@ var transformMintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokensRequest
7692
7962
  contractCall: function contractCall() {
7693
7963
  return royaltyTokenDistributionWorkflowsClient.mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens(transformRequest);
7694
7964
  },
7695
- spenders: [{
7696
- address: transformRequest.spgNftContract,
7697
- amount: nftMintFee
7698
- }],
7699
- totalFees: nftMintFee,
7965
+ spenders: _toConsumableArray(nftMintFee ? [_objectSpread2({
7966
+ address: transformRequest.spgNftContract
7967
+ }, nftMintFee)] : []),
7700
7968
  encodedTxData: {
7701
7969
  to: royaltyTokenDistributionWorkflowsClient.address,
7702
7970
  data: viem.encodeFunctionData({
@@ -7722,15 +7990,14 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
7722
7990
  nftMintFee = _ref14.nftMintFee,
7723
7991
  isPublicMinting = _ref14.isPublicMinting,
7724
7992
  maxLicenseTokens = _ref14.maxLicenseTokens;
7993
+ var spenders = nftMintFee ? [_objectSpread2({
7994
+ address: request.spgNftContract
7995
+ }, nftMintFee)] : [];
7725
7996
  return {
7726
7997
  // The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
7727
7998
  transformRequest: request,
7728
- isUseMulticall3: isPublicMinting,
7729
- spenders: [{
7730
- address: request.spgNftContract,
7731
- amount: nftMintFee
7732
- }],
7733
- totalFees: nftMintFee,
7999
+ isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
8000
+ spenders: spenders,
7734
8001
  encodedTxData: {
7735
8002
  to: licenseAttachmentWorkflowsClient.address,
7736
8003
  data: viem.encodeFunctionData({
@@ -7754,39 +8021,39 @@ var transferMintAndRegisterIpAssetWithPilTermsRequest = function transferMintAnd
7754
8021
  * Transforms a request for the `mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens` contract method.
7755
8022
  */
7756
8023
  var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest = function transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest(_ref15) {
8024
+ var _derivativeMintingFee;
7757
8025
  var request = _ref15.request,
7758
8026
  nftMintFee = _ref15.nftMintFee,
7759
8027
  isPublicMinting = _ref15.isPublicMinting,
7760
- totalDerivativeMintingFee = _ref15.totalDerivativeMintingFee,
8028
+ derivativeMintingFee = _ref15.derivativeMintingFee,
7761
8029
  royaltyTokenDistributionWorkflowsClient = _ref15.royaltyTokenDistributionWorkflowsClient;
7762
8030
  var _getRoyaltyShares2 = getRoyaltyShares(request.royaltyShares),
7763
8031
  royaltyShares = _getRoyaltyShares2.royaltyShares;
7764
8032
  /**
7765
- * TODO: Consider the scenario where the SPG token is WIP and the derivative token is ERC20.
7766
8033
  * The SDK should handle both cases in the `contractCallWithFees` method.
7767
8034
  * Currently, it only supports WIP tokens and does not handle ERC20 tokens, such as approving ERC20 tokens.
7768
8035
  */
7769
8036
  var transformRequest = _objectSpread2(_objectSpread2({}, request), {}, {
7770
8037
  royaltyShares: royaltyShares
7771
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)] : []));
7772
8046
  return {
7773
8047
  // The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
7774
8048
  transformRequest: transformRequest,
7775
- isUseMulticall3: isPublicMinting,
7776
- spenders: [{
7777
- address: royaltyTokenDistributionWorkflowsClient.address,
7778
- amount: totalDerivativeMintingFee
7779
- }, {
7780
- address: request.spgNftContract,
7781
- amount: nftMintFee
7782
- }],
7783
- totalFees: totalDerivativeMintingFee + nftMintFee,
8049
+ isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
8050
+ spenders: spenders,
7784
8051
  encodedTxData: {
7785
8052
  to: royaltyTokenDistributionWorkflowsClient.address,
7786
8053
  data: viem.encodeFunctionData({
7787
8054
  abi: royaltyTokenDistributionWorkflowsAbi,
7788
8055
  functionName: "mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens",
7789
- args: [request.spgNftContract, request.recipient, request.ipMetadata, request.derivData, request.royaltyShares, request.allowDuplicates]
8056
+ args: [transformRequest.spgNftContract, transformRequest.recipient, transformRequest.ipMetadata, transformRequest.derivData, transformRequest.royaltyShares, transformRequest.allowDuplicates]
7790
8057
  })
7791
8058
  },
7792
8059
  workflowClient: royaltyTokenDistributionWorkflowsClient,
@@ -7800,23 +8067,24 @@ var transferMintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokensRequest
7800
8067
  */
7801
8068
 
7802
8069
  var transferMintAndRegisterIpAndMakeDerivativeRequest = function transferMintAndRegisterIpAndMakeDerivativeRequest(_ref16) {
8070
+ var _derivativeMintingFee2;
7803
8071
  var request = _ref16.request,
7804
8072
  derivativeWorkflowsClient = _ref16.derivativeWorkflowsClient,
7805
8073
  nftMintFee = _ref16.nftMintFee,
7806
8074
  isPublicMinting = _ref16.isPublicMinting,
7807
- totalDerivativeMintingFee = _ref16.totalDerivativeMintingFee;
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)] : []));
7808
8083
  return {
7809
8084
  // The `TransformIpRegistrationWorkflowResponse` is a union of all the possible requests, so we need to explicitly cast the type.
7810
8085
  transformRequest: request,
7811
- isUseMulticall3: isPublicMinting,
7812
- spenders: [{
7813
- address: derivativeWorkflowsClient.address,
7814
- amount: totalDerivativeMintingFee
7815
- }, {
7816
- address: request.spgNftContract,
7817
- amount: nftMintFee
7818
- }],
7819
- totalFees: totalDerivativeMintingFee + nftMintFee,
8086
+ isUseMulticall3: isErc20AboveZero(spenders) ? false : isPublicMinting,
8087
+ spenders: spenders,
7820
8088
  encodedTxData: {
7821
8089
  to: derivativeWorkflowsClient.address,
7822
8090
  data: viem.encodeFunctionData({
@@ -7920,7 +8188,7 @@ var transferDistributeRoyaltyTokensRequest = /*#__PURE__*/function () {
7920
8188
  }();
7921
8189
  var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
7922
8190
  var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref19) {
7923
- var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId, results, _iterator, _step, _loop, _t;
8191
+ var royaltyDistributionRequests, ipRegisteredLog, ipRoyaltyVault, rpcClient, wallet, chainId, requests, ipRoyaltyVaults, _iterator, _step, _loop, _t;
7924
8192
  return _regenerator().w(function (_context0) {
7925
8193
  while (1) switch (_context0.p = _context0.n) {
7926
8194
  case 0:
@@ -7929,13 +8197,17 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
7929
8197
  _context0.n = 1;
7930
8198
  break;
7931
8199
  }
7932
- return _context0.a(2, []);
8200
+ return _context0.a(2, {
8201
+ requests: [],
8202
+ ipRoyaltyVaults: []
8203
+ });
7933
8204
  case 1:
7934
- results = [];
8205
+ requests = [];
8206
+ ipRoyaltyVaults = [];
7935
8207
  _iterator = _createForOfIteratorHelper(royaltyDistributionRequests);
7936
8208
  _context0.p = 2;
7937
8209
  _loop = /*#__PURE__*/_regenerator().m(function _loop() {
7938
- var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, response;
8210
+ var req, filterIpIdAndTokenId, _req$royaltyShares, _getRoyaltyShares3, royaltyShares, totalAmount, calculatedDeadline, ipRoyaltyVaultItem, response;
7939
8211
  return _regenerator().w(function (_context9) {
7940
8212
  while (1) switch (_context9.n) {
7941
8213
  case 0:
@@ -7954,13 +8226,15 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
7954
8226
  return getCalculatedDeadline(rpcClient, req.deadline);
7955
8227
  case 1:
7956
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
+ });
7957
8233
  _context9.n = 2;
7958
8234
  return transferDistributeRoyaltyTokensRequest({
7959
8235
  request: {
7960
8236
  ipId: filterIpIdAndTokenId.ipId,
7961
- ipRoyaltyVault: ipRoyaltyVault.find(function (item) {
7962
- return item.ipId === filterIpIdAndTokenId.ipId;
7963
- }).ipRoyaltyVault,
8237
+ ipRoyaltyVault: ipRoyaltyVaultItem.ipRoyaltyVault,
7964
8238
  royaltyShares: royaltyShares,
7965
8239
  totalAmount: totalAmount,
7966
8240
  deadline: calculatedDeadline
@@ -7971,7 +8245,8 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
7971
8245
  });
7972
8246
  case 2:
7973
8247
  response = _context9.v;
7974
- results.push(response);
8248
+ requests.push(response);
8249
+ ipRoyaltyVaults.push(ipRoyaltyVaultItem);
7975
8250
  case 3:
7976
8251
  return _context9.a(2);
7977
8252
  }
@@ -7999,7 +8274,10 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
7999
8274
  _iterator.f();
8000
8275
  return _context0.f(7);
8001
8276
  case 8:
8002
- return _context0.a(2, results);
8277
+ return _context0.a(2, {
8278
+ requests: requests,
8279
+ ipRoyaltyVaults: ipRoyaltyVaults
8280
+ });
8003
8281
  }
8004
8282
  }, _callee9, null, [[2, 6, 7, 8]]);
8005
8283
  }));
@@ -8008,6 +8286,22 @@ var prepareRoyaltyTokensDistributionRequests = /*#__PURE__*/function () {
8008
8286
  };
8009
8287
  }();
8010
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
+
8011
8305
  var setMaxLicenseTokens = /*#__PURE__*/function () {
8012
8306
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
8013
8307
  var maxLicenseTokensData, licensorIpId, licenseTermsIds, totalLicenseTokenLimitHookClient, templateAddress, licenseTermsMaxLimitTxHashes, i, maxLicenseTokens, txHash;
@@ -8074,6 +8368,7 @@ var IPAssetClient = /*#__PURE__*/function () {
8074
8368
  this.multicall3Client = new Multicall3Client(rpcClient, wallet);
8075
8369
  this.spgNftClient = new SpgnftImplReadOnlyClient(rpcClient);
8076
8370
  this.totalLicenseTokenLimitHookClient = new TotalLicenseTokenLimitHookClient(rpcClient, wallet);
8371
+ this.licenseTokenClient = new LicenseTokenClient(rpcClient, wallet);
8077
8372
  this.rpcClient = rpcClient;
8078
8373
  this.wallet = wallet;
8079
8374
  this.chainId = chainId;
@@ -8383,6 +8678,26 @@ var IPAssetClient = /*#__PURE__*/function () {
8383
8678
  * The license terms must be attached to the parent IP before calling this function.
8384
8679
  * All IPs attached default license terms by default.
8385
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
+ * ```
8386
8701
  */
8387
8702
  )
8388
8703
  }, {
@@ -8436,8 +8751,10 @@ var IPAssetClient = /*#__PURE__*/function () {
8436
8751
  txOptions: request.txOptions,
8437
8752
  encodedTxs: [encodedTxData],
8438
8753
  spgSpenderAddress: this.royaltyModuleEventClient.address,
8439
- wipOptions: _objectSpread2(_objectSpread2({}, (_request$options = request.options) === null || _request$options === void 0 ? void 0 : _request$options.wipOptions), {}, {
8440
- useMulticallWhenPossible: false
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
+ })
8441
8758
  })
8442
8759
  }));
8443
8760
  case 5:
@@ -8579,6 +8896,24 @@ var IPAssetClient = /*#__PURE__*/function () {
8579
8896
  * Registers a derivative with license tokens. The derivative IP is registered with license tokens minted from the parent IP's license terms.
8580
8897
  * The license terms of the parent IPs issued with license tokens are attached to the derivative IP.
8581
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
+ * ```
8582
8917
  */
8583
8918
  )
8584
8919
  }, {
@@ -8658,6 +8993,24 @@ var IPAssetClient = /*#__PURE__*/function () {
8658
8993
  /**
8659
8994
  * Mint an NFT from a collection and register it as an IP.
8660
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
+ *
8661
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.
8662
9015
  */
8663
9016
  )
@@ -8666,7 +9019,7 @@ var IPAssetClient = /*#__PURE__*/function () {
8666
9019
  value: (function () {
8667
9020
  var _mintAndRegisterIpAssetWithPilTerms = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(request) {
8668
9021
  var _this3 = this;
8669
- var _request$txOptions4, _request$options2, _yield$transformRegis, transformRequest, encodedTxData, contractCall, rsp, computedLicenseTermsIds, maxLicenseTokensTxHashes, _t0;
9022
+ var _request$txOptions4, _yield$transformRegis, transformRequest, encodedTxData, contractCall, rsp, computedLicenseTermsIds, maxLicenseTokensTxHashes, _t0;
8670
9023
  return _regenerator().w(function (_context7) {
8671
9024
  while (1) switch (_context7.p = _context7.n) {
8672
9025
  case 0:
@@ -8695,7 +9048,7 @@ var IPAssetClient = /*#__PURE__*/function () {
8695
9048
  };
8696
9049
  _context7.n = 3;
8697
9050
  return this.handleRegistrationWithFees({
8698
- wipOptions: (_request$options2 = request.options) === null || _request$options2 === void 0 ? void 0 : _request$options2.wipOptions,
9051
+ options: request.options,
8699
9052
  sender: this.walletAddress,
8700
9053
  spgNftContract: transformRequest.spgNftContract,
8701
9054
  spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
@@ -8861,6 +9214,25 @@ var IPAssetClient = /*#__PURE__*/function () {
8861
9214
  /**
8862
9215
  * Register a given NFT as an IP and attach Programmable IP License Terms.
8863
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
+ *
8864
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.
8865
9237
  */
8866
9238
  )
@@ -8968,6 +9340,25 @@ var IPAssetClient = /*#__PURE__*/function () {
8968
9340
  /**
8969
9341
  * Register the given NFT as a derivative IP with metadata without using license tokens.
8970
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
+ *
8971
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.
8972
9363
  */
8973
9364
  )
@@ -8976,7 +9367,7 @@ var IPAssetClient = /*#__PURE__*/function () {
8976
9367
  value: (function () {
8977
9368
  var _registerDerivativeIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(request) {
8978
9369
  var _this4 = this;
8979
- var _request$txOptions6, _request$options3, tokenId, ipIdAddress, isRegistered, _yield$transformRegis3, _transformRequest2, encodedTxData, contractCall, _t12;
9370
+ var _request$txOptions6, _request$options2, tokenId, ipIdAddress, isRegistered, _yield$transformRegis3, _transformRequest2, encodedTxData, contractCall, _t12;
8980
9371
  return _regenerator().w(function (_context0) {
8981
9372
  while (1) switch (_context0.p = _context0.n) {
8982
9373
  case 0:
@@ -9025,8 +9416,10 @@ var IPAssetClient = /*#__PURE__*/function () {
9025
9416
  return _this4.derivativeWorkflowsClient.registerIpAndMakeDerivative(_transformRequest2);
9026
9417
  };
9027
9418
  return _context0.a(2, this.handleRegistrationWithFees({
9028
- wipOptions: _objectSpread2(_objectSpread2({}, (_request$options3 = request.options) === null || _request$options3 === void 0 ? void 0 : _request$options3.wipOptions), {}, {
9029
- useMulticallWhenPossible: false
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
+ })
9030
9423
  }),
9031
9424
  sender: this.walletAddress,
9032
9425
  spgSpenderAddress: this.derivativeWorkflowsClient.address,
@@ -9050,6 +9443,24 @@ var IPAssetClient = /*#__PURE__*/function () {
9050
9443
  /**
9051
9444
  * Mint an NFT from a collection and register it as a derivative IP without license tokens.
9052
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
+ *
9053
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.
9054
9465
  */
9055
9466
  )
@@ -9058,7 +9469,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9058
9469
  value: (function () {
9059
9470
  var _mintAndRegisterIpAndMakeDerivative = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(request) {
9060
9471
  var _this5 = this;
9061
- var _request$txOptions7, _request$options4, spgNftContract, _yield$transformRegis4, _transformRequest3, encodedTxData, contractCall, _t13;
9472
+ var _request$txOptions7, spgNftContract, _yield$transformRegis4, _transformRequest3, encodedTxData, contractCall, _t13;
9062
9473
  return _regenerator().w(function (_context1) {
9063
9474
  while (1) switch (_context1.p = _context1.n) {
9064
9475
  case 0:
@@ -9087,7 +9498,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9087
9498
  return _this5.derivativeWorkflowsClient.mintAndRegisterIpAndMakeDerivative(_transformRequest3);
9088
9499
  };
9089
9500
  return _context1.a(2, this.handleRegistrationWithFees({
9090
- wipOptions: (_request$options4 = request.options) === null || _request$options4 === void 0 ? void 0 : _request$options4.wipOptions,
9501
+ options: request.options,
9091
9502
  sender: this.walletAddress,
9092
9503
  spgSpenderAddress: this.derivativeWorkflowsClient.address,
9093
9504
  spgNftContract: spgNftContract,
@@ -9195,6 +9606,23 @@ var IPAssetClient = /*#__PURE__*/function () {
9195
9606
  /**
9196
9607
  * Mint an NFT from a SPGNFT collection and register it with metadata as an IP.
9197
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
+ *
9198
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.
9199
9627
  */
9200
9628
  )
@@ -9203,7 +9631,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9203
9631
  value: (function () {
9204
9632
  var _mintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(request) {
9205
9633
  var _this6 = this;
9206
- var _request$txOptions8, _request$options5, _object, encodedTxData, contractCall, _t17;
9634
+ var _request$txOptions8, _request$options3, _object, encodedTxData, contractCall, _t17;
9207
9635
  return _regenerator().w(function (_context11) {
9208
9636
  while (1) switch (_context11.p = _context11.n) {
9209
9637
  case 0:
@@ -9233,8 +9661,10 @@ var IPAssetClient = /*#__PURE__*/function () {
9233
9661
  contractCall: contractCall,
9234
9662
  spgNftContract: _object.spgNftContract,
9235
9663
  txOptions: request.txOptions,
9236
- wipOptions: _objectSpread2(_objectSpread2({}, (_request$options5 = request.options) === null || _request$options5 === void 0 ? void 0 : _request$options5.wipOptions), {}, {
9237
- useMulticallWhenPossible: false
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
+ })
9238
9668
  })
9239
9669
  }));
9240
9670
  case 2:
@@ -9270,7 +9700,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9270
9700
  value: (function () {
9271
9701
  var _batchMintAndRegisterIp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(request) {
9272
9702
  var _this7 = this;
9273
- var publicMintEncodedTxs, publicMintSpenders, privateMintEncodedTxs, privateMintSpenders, publicMintFeesTotal, privateMintFeesTotal, _iterator5, _step5, req, registrationRequest, isPublicMinting, nftMintFee, encodeTx, isMinterRole, handlePublicMintTransactions, handlePrivateMintTransactions, transactionResponses, publicMintResponse, privateMintResponse, _t18, _t19, _t20, _t21;
9703
+ var publicMintEncodedTxs, publicMintSpenders, privateMintEncodedTxs, privateMintSpenders, _iterator5, _step5, req, registrationRequest, isPublicMinting, nftMintFee, encodeTx, isMinterRole, handlePublicMintTransactions, handlePrivateMintTransactions, transactionResponses, publicMintResponse, privateMintResponse, _t18, _t19, _t20, _t21;
9274
9704
  return _regenerator().w(function (_context14) {
9275
9705
  while (1) switch (_context14.p = _context14.n) {
9276
9706
  case 0:
@@ -9279,8 +9709,6 @@ var IPAssetClient = /*#__PURE__*/function () {
9279
9709
  publicMintSpenders = [];
9280
9710
  privateMintEncodedTxs = [];
9281
9711
  privateMintSpenders = [];
9282
- publicMintFeesTotal = 0n;
9283
- privateMintFeesTotal = 0n;
9284
9712
  _iterator5 = _createForOfIteratorHelper(request.requests);
9285
9713
  _context14.p = 1;
9286
9714
  _iterator5.s();
@@ -9301,7 +9729,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9301
9729
  case 3:
9302
9730
  isPublicMinting = _context14.v;
9303
9731
  _context14.n = 4;
9304
- return calculateSPGWipMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, registrationRequest.spgNftContract));
9732
+ return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, registrationRequest.spgNftContract));
9305
9733
  case 4:
9306
9734
  nftMintFee = _context14.v;
9307
9735
  encodeTx = {
@@ -9316,11 +9744,9 @@ var IPAssetClient = /*#__PURE__*/function () {
9316
9744
  _context14.n = 5;
9317
9745
  break;
9318
9746
  }
9319
- publicMintFeesTotal += nftMintFee;
9320
- publicMintSpenders = mergeSpenders(publicMintSpenders, [{
9321
- address: registrationRequest.spgNftContract,
9322
- amount: nftMintFee
9323
- }]);
9747
+ publicMintSpenders = mergeSpenders(publicMintSpenders, nftMintFee ? [_objectSpread2({
9748
+ address: registrationRequest.spgNftContract
9749
+ }, nftMintFee)] : []);
9324
9750
  publicMintEncodedTxs.push(encodeTx);
9325
9751
  _context14.n = 8;
9326
9752
  break;
@@ -9335,11 +9761,9 @@ var IPAssetClient = /*#__PURE__*/function () {
9335
9761
  }
9336
9762
  throw new Error("Caller ".concat(this.walletAddress, " does not have the minter role for ").concat(registrationRequest.spgNftContract));
9337
9763
  case 7:
9338
- privateMintFeesTotal += nftMintFee;
9339
- privateMintSpenders = mergeSpenders(privateMintSpenders, [{
9340
- address: registrationRequest.spgNftContract,
9341
- amount: nftMintFee
9342
- }]);
9764
+ privateMintSpenders = mergeSpenders(privateMintSpenders, nftMintFee ? [_objectSpread2({
9765
+ address: registrationRequest.spgNftContract
9766
+ }, nftMintFee)] : []);
9343
9767
  privateMintEncodedTxs.push(encodeTx);
9344
9768
  case 8:
9345
9769
  _context14.n = 2;
@@ -9363,9 +9787,9 @@ var IPAssetClient = /*#__PURE__*/function () {
9363
9787
  case 0:
9364
9788
  _context12.n = 1;
9365
9789
  return contractCallWithFees({
9366
- totalFees: publicMintFeesTotal,
9367
9790
  options: {
9368
- wipOptions: request.wipOptions
9791
+ wipOptions: request.wipOptions,
9792
+ erc20Options: request.erc20Options
9369
9793
  },
9370
9794
  multicall3Address: _this7.multicall3Client.address,
9371
9795
  rpcClient: _this7.rpcClient,
@@ -9398,11 +9822,11 @@ var IPAssetClient = /*#__PURE__*/function () {
9398
9822
  case 0:
9399
9823
  _context13.n = 1;
9400
9824
  return contractCallWithFees({
9401
- totalFees: privateMintFeesTotal,
9402
9825
  options: {
9403
9826
  wipOptions: _objectSpread2(_objectSpread2({}, request.wipOptions), {}, {
9404
9827
  useMulticallWhenPossible: false
9405
- })
9828
+ }),
9829
+ erc20Options: request.erc20Options
9406
9830
  },
9407
9831
  multicall3Address: _this7.multicall3Client.address,
9408
9832
  rpcClient: _this7.rpcClient,
@@ -9488,6 +9912,24 @@ var IPAssetClient = /*#__PURE__*/function () {
9488
9912
  * Mint an NFT from a collection and register it as a derivative IP using license tokens.
9489
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.
9490
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
+ *
9491
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.
9492
9934
  */
9493
9935
  )
@@ -9496,7 +9938,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9496
9938
  value: (function () {
9497
9939
  var _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(request) {
9498
9940
  var _this8 = this;
9499
- var _request$txOptions9, _request$options6, licenseTokenIds, _object2, encodedTxData, contractCall, _t22;
9941
+ var _request$txOptions9, _request$options4, licenseTokenIds, _object2, encodedTxData, contractCall, _t22;
9500
9942
  return _regenerator().w(function (_context16) {
9501
9943
  while (1) switch (_context16.p = _context16.n) {
9502
9944
  case 0:
@@ -9523,6 +9965,9 @@ var IPAssetClient = /*#__PURE__*/function () {
9523
9965
  encodedTxData: encodedTxData
9524
9966
  });
9525
9967
  case 2:
9968
+ _context16.n = 3;
9969
+ return this.approveLicenseTokensForDerivativeWorkflows(request.licenseTokenIds, request.autoApproveLicenseTokens);
9970
+ case 3:
9526
9971
  contractCall = /*#__PURE__*/function () {
9527
9972
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
9528
9973
  return _regenerator().w(function (_context15) {
@@ -9537,10 +9982,12 @@ var IPAssetClient = /*#__PURE__*/function () {
9537
9982
  };
9538
9983
  }();
9539
9984
  return _context16.a(2, this.handleRegistrationWithFees({
9540
- wipOptions: _objectSpread2(_objectSpread2({}, (_request$options6 = request.options) === null || _request$options6 === void 0 ? void 0 : _request$options6.wipOptions), {}, {
9541
- // need to disable multicall to avoid needing to transfer the license
9542
- // token to the multicall contract.
9543
- useMulticallWhenPossible: false
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
+ })
9544
9991
  }),
9545
9992
  sender: this.walletAddress,
9546
9993
  spgNftContract: _object2.spgNftContract,
@@ -9549,12 +9996,12 @@ var IPAssetClient = /*#__PURE__*/function () {
9549
9996
  contractCall: contractCall,
9550
9997
  txOptions: request.txOptions
9551
9998
  }));
9552
- case 3:
9553
- _context16.p = 3;
9999
+ case 4:
10000
+ _context16.p = 4;
9554
10001
  _t22 = _context16.v;
9555
10002
  return _context16.a(2, handleError(_t22, "Failed to mint and register IP and make derivative with license tokens"));
9556
10003
  }
9557
- }, _callee16, this, [[0, 3]]);
10004
+ }, _callee16, this, [[0, 4]]);
9558
10005
  }));
9559
10006
  function mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_x14) {
9560
10007
  return _mintAndRegisterIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
@@ -9564,6 +10011,25 @@ var IPAssetClient = /*#__PURE__*/function () {
9564
10011
  /**
9565
10012
  * Register the given NFT as a derivative IP using license tokens.
9566
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
+ *
9567
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.
9568
10034
  */
9569
10035
  )
@@ -9615,6 +10081,9 @@ var IPAssetClient = /*#__PURE__*/function () {
9615
10081
  });
9616
10082
  case 6:
9617
10083
  signature = _context17.v;
10084
+ _context17.n = 7;
10085
+ return this.approveLicenseTokensForDerivativeWorkflows(licenseTokenIds, request.autoApproveLicenseTokens);
10086
+ case 7:
9618
10087
  _object3 = _objectSpread2(_objectSpread2({}, request), {}, {
9619
10088
  tokenId: tokenId,
9620
10089
  licenseTokenIds: licenseTokenIds,
@@ -9628,38 +10097,38 @@ var IPAssetClient = /*#__PURE__*/function () {
9628
10097
  maxRts: validateMaxRts(request.maxRts)
9629
10098
  });
9630
10099
  if (!((_request$txOptions0 = request.txOptions) !== null && _request$txOptions0 !== void 0 && _request$txOptions0.encodedTxDataOnly)) {
9631
- _context17.n = 7;
10100
+ _context17.n = 8;
9632
10101
  break;
9633
10102
  }
9634
10103
  return _context17.a(2, {
9635
10104
  encodedTxData: this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokensEncode(_object3)
9636
10105
  });
9637
- case 7:
9638
- _context17.n = 8;
9639
- return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
9640
10106
  case 8:
9641
- txHash = _context17.v;
9642
10107
  _context17.n = 9;
10108
+ return this.derivativeWorkflowsClient.registerIpAndMakeDerivativeWithLicenseTokens(_object3);
10109
+ case 9:
10110
+ txHash = _context17.v;
10111
+ _context17.n = 10;
9643
10112
  return this.rpcClient.waitForTransactionReceipt(_objectSpread2(_objectSpread2({}, request.txOptions), {}, {
9644
10113
  hash: txHash
9645
10114
  }));
9646
- case 9:
10115
+ case 10:
9647
10116
  receipt = _context17.v;
9648
10117
  log = this.getIpIdAndTokenIdsFromEvent(receipt)[0];
9649
10118
  return _context17.a(2, _objectSpread2({
9650
10119
  txHash: txHash
9651
10120
  }, log));
9652
- case 10:
9653
- _context17.n = 12;
9654
- break;
9655
10121
  case 11:
9656
- _context17.p = 11;
10122
+ _context17.n = 13;
10123
+ break;
10124
+ case 12:
10125
+ _context17.p = 12;
9657
10126
  _t23 = _context17.v;
9658
10127
  return _context17.a(2, handleError(_t23, "Failed to register IP and make derivative with license tokens"));
9659
- case 12:
10128
+ case 13:
9660
10129
  return _context17.a(2);
9661
10130
  }
9662
- }, _callee17, this, [[0, 11]]);
10131
+ }, _callee17, this, [[0, 12]]);
9663
10132
  }));
9664
10133
  function registerIpAndMakeDerivativeWithLicenseTokens(_x15) {
9665
10134
  return _registerIpAndMakeDerivativeWithLicenseTokens.apply(this, arguments);
@@ -9671,6 +10140,27 @@ var IPAssetClient = /*#__PURE__*/function () {
9671
10140
  * tokens. In order to successfully distribute royalty tokens, the first
9672
10141
  * license terms attached to the IP must be a commercial license.
9673
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
+ *
9674
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.
9675
10165
  */
9676
10166
  )
@@ -9790,6 +10280,27 @@ var IPAssetClient = /*#__PURE__*/function () {
9790
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
9791
10281
  * a commercial license.
9792
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
+ *
9793
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.
9794
10305
  */
9795
10306
  )
@@ -9798,7 +10309,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9798
10309
  value: (function () {
9799
10310
  var _registerDerivativeIpAndAttachLicenseTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(request) {
9800
10311
  var _this9 = this;
9801
- var _request$options7, ipIdAddress, _yield$transformRegis6, _transformRequest5, _getRoyaltyShares2, royaltyShares, totalAmount, isRegistered, encodedTxData, contractCall, _yield$this$handleReg, txHash, ipId, tokenId, receipt, ipRoyaltyVault, distributeRoyaltyTokensTxHash, _t25;
10312
+ var _request$options5, ipIdAddress, _yield$transformRegis6, _transformRequest5, _getRoyaltyShares2, royaltyShares, totalAmount, isRegistered, encodedTxData, contractCall, _yield$this$handleReg, txHash, ipId, tokenId, receipt, ipRoyaltyVault, distributeRoyaltyTokensTxHash, _t25;
9802
10313
  return _regenerator().w(function (_context19) {
9803
10314
  while (1) switch (_context19.p = _context19.n) {
9804
10315
  case 0:
@@ -9840,8 +10351,10 @@ var IPAssetClient = /*#__PURE__*/function () {
9840
10351
  };
9841
10352
  _context19.n = 5;
9842
10353
  return this.handleRegistrationWithFees({
9843
- wipOptions: _objectSpread2(_objectSpread2({}, (_request$options7 = request.options) === null || _request$options7 === void 0 ? void 0 : _request$options7.wipOptions), {}, {
9844
- useMulticallWhenPossible: false
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
+ })
9845
10358
  }),
9846
10359
  sender: this.walletAddress,
9847
10360
  spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
@@ -9903,6 +10416,26 @@ var IPAssetClient = /*#__PURE__*/function () {
9903
10416
  /**
9904
10417
  * Mint an NFT and register the IP, attach PIL terms, and distribute royalty tokens.
9905
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
+ *
9906
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.
9907
10440
  */
9908
10441
  )
@@ -9911,7 +10444,7 @@ var IPAssetClient = /*#__PURE__*/function () {
9911
10444
  value: (function () {
9912
10445
  var _mintAndRegisterIpAndAttachPilTermsAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(request) {
9913
10446
  var _this0 = this;
9914
- var _request$options8, _yield$validateLicens3, licenseTerms, _yield$transformRegis7, _transformRequest6, encodedTxData, contractCall, _yield$this$handleReg2, txHash, ipId, tokenId, receipt, licenseTermsIds, ipRoyaltyVault, maxLicenseTokensTxHashes, _t26;
10447
+ var _request$options6, _yield$validateLicens3, licenseTerms, _yield$transformRegis7, _transformRequest6, encodedTxData, contractCall, _yield$this$handleReg2, txHash, ipId, tokenId, receipt, licenseTermsIds, ipRoyaltyVault, maxLicenseTokensTxHashes, _t26;
9915
10448
  return _regenerator().w(function (_context20) {
9916
10449
  while (1) switch (_context20.p = _context20.n) {
9917
10450
  case 0:
@@ -9937,7 +10470,11 @@ var IPAssetClient = /*#__PURE__*/function () {
9937
10470
  };
9938
10471
  _context20.n = 3;
9939
10472
  return this.handleRegistrationWithFees({
9940
- wipOptions: (_request$options8 = request.options) === null || _request$options8 === void 0 ? void 0 : _request$options8.wipOptions,
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
+ }),
9941
10478
  sender: this.walletAddress,
9942
10479
  spgNftContract: _transformRequest6.spgNftContract,
9943
10480
  spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
@@ -9998,6 +10535,26 @@ var IPAssetClient = /*#__PURE__*/function () {
9998
10535
  /**
9999
10536
  * Mint an NFT and register the IP, make a derivative, and distribute royalty tokens.
10000
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
+ *
10001
10558
  * Emits on-chain {@link https://github.com/storyprotocol/protocol-core-v1/blob/v1.3.1/contracts/interfaces/registries/IIPAssetRegistry.sol#L17 | `IPRegistered`} event.
10002
10559
  */
10003
10560
  )
@@ -10006,7 +10563,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10006
10563
  value: (function () {
10007
10564
  var _mintAndRegisterIpAndMakeDerivativeAndDistributeRoyaltyTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(request) {
10008
10565
  var _this1 = this;
10009
- var _request$options9, _yield$transformRegis8, _transformRequest7, encodedTxData, contractCall, _t27;
10566
+ var _yield$transformRegis8, _transformRequest7, encodedTxData, contractCall, _t27;
10010
10567
  return _regenerator().w(function (_context21) {
10011
10568
  while (1) switch (_context21.p = _context21.n) {
10012
10569
  case 0:
@@ -10028,7 +10585,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10028
10585
  _context21.n = 2;
10029
10586
  return this.handleRegistrationWithFees({
10030
10587
  spgNftContract: _transformRequest7.spgNftContract,
10031
- wipOptions: (_request$options9 = request.options) === null || _request$options9 === void 0 ? void 0 : _request$options9.wipOptions,
10588
+ options: request.options,
10032
10589
  sender: this.walletAddress,
10033
10590
  spgSpenderAddress: this.royaltyTokenDistributionWorkflowsClient.address,
10034
10591
  derivData: _transformRequest7.derivData,
@@ -10130,7 +10687,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10130
10687
  * The method supports automatic token handling for minting fees:
10131
10688
  * - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
10132
10689
  * - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
10133
- * - These automatic processes can be configured through the `wipOptions` parameter to control behavior like multicall usage and approval settings.
10690
+ * - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
10134
10691
  *
10135
10692
  * @remark Multicall selection logic:
10136
10693
  *
@@ -10142,12 +10699,14 @@ var IPAssetClient = /*#__PURE__*/function () {
10142
10699
  *
10143
10700
  * 2. For `register*` methods:
10144
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.
10145
10704
  */
10146
10705
  }, {
10147
10706
  key: "batchRegisterIpAssetsWithOptimizedWorkflows",
10148
10707
  value: (function () {
10149
10708
  var _batchRegisterIpAssetsWithOptimizedWorkflows = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(request) {
10150
- var _request$options0, _request$options10, transferWorkflowRequests, _iterator6, _step6, req, res, royaltyDistributionRequests, _yield$handleMultical, txResponses, aggregateRegistrationRequest, responses, royaltyTokensDistributionRequests, _iterator7, _step7, _step7$value, txHash, receipt, iPRegisteredLog, ipRoyaltyVaultEvent, response, distributeRoyaltyTokensTxHashes, _request$options1, _yield$handleMultical2, txResponse, registrationResults, _t28, _t29, _t30;
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;
10151
10710
  return _regenerator().w(function (_context24) {
10152
10711
  while (1) switch (_context24.p = _context24.n) {
10153
10712
  case 0:
@@ -10211,7 +10770,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10211
10770
  rpcClient: this.rpcClient,
10212
10771
  wallet: this.wallet,
10213
10772
  walletAddress: this.walletAddress,
10214
- wipOptions: (_request$options0 = request.options) === null || _request$options0 === void 0 ? void 0 : _request$options0.wipOptions,
10773
+ options: request.options,
10215
10774
  chainId: this.chainId
10216
10775
  });
10217
10776
  case 9:
@@ -10241,11 +10800,14 @@ var IPAssetClient = /*#__PURE__*/function () {
10241
10800
  chainId: this.chainId
10242
10801
  });
10243
10802
  case 12:
10244
- response = _context24.v;
10245
- royaltyTokensDistributionRequests.push.apply(royaltyTokensDistributionRequests, _toConsumableArray(response));
10803
+ _yield$prepareRoyalty = _context24.v;
10804
+ requests = _yield$prepareRoyalty.requests;
10805
+ ipRoyaltyVaults = _yield$prepareRoyalty.ipRoyaltyVaults;
10806
+ royaltyTokensDistributionRequests.push.apply(royaltyTokensDistributionRequests, _toConsumableArray(requests));
10246
10807
  responses.push({
10247
10808
  txHash: txHash,
10248
10809
  receipt: receipt,
10810
+ ipRoyaltyVault: ipRoyaltyVaults,
10249
10811
  ipAssetsWithLicenseTerms: iPRegisteredLog.map(function (log) {
10250
10812
  return {
10251
10813
  ipId: log.ipId,
@@ -10279,7 +10841,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10279
10841
  rpcClient: this.rpcClient,
10280
10842
  wallet: this.wallet,
10281
10843
  walletAddress: this.walletAddress,
10282
- wipOptions: (_request$options1 = request.options) === null || _request$options1 === void 0 ? void 0 : _request$options1.wipOptions,
10844
+ options: request.options,
10283
10845
  chainId: this.chainId
10284
10846
  });
10285
10847
  case 18:
@@ -10290,7 +10852,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10290
10852
  });
10291
10853
  case 19:
10292
10854
  _context24.n = 20;
10293
- return this.processResponses(responses, aggregateRegistrationRequest, ((_request$options10 = request.options) === null || _request$options10 === void 0 || (_request$options10 = _request$options10.wipOptions) === null || _request$options10 === void 0 ? void 0 : _request$options10.useMulticallWhenPossible) !== false);
10855
+ return this.populateLicenseAndTokenIdsForRegistrationResults(responses, aggregateRegistrationRequest);
10294
10856
  case 20:
10295
10857
  registrationResults = _context24.v;
10296
10858
  return _context24.a(2, _objectSpread2({
@@ -10365,7 +10927,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10365
10927
  * **Automatic Token Handling:**
10366
10928
  * - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
10367
10929
  * - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
10368
- * - These automatic processes can be configured through the `wipOptions` parameter to control behavior like multicall usage and approval settings.
10930
+ * - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
10369
10931
  *
10370
10932
  * @throws {Error} If the NFT type is invalid.
10371
10933
  * @throws {Error} If `licenseTermsData` is not provided when `royaltyShares` are specified.
@@ -10478,7 +11040,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10478
11040
  * **Automatic Token Handling:**
10479
11041
  * - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
10480
11042
  * - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
10481
- * - These automatic processes can be configured through the `wipOptions` parameter to control behavior like multicall usage and approval settings.
11043
+ * - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
10482
11044
  *
10483
11045
  * @throws {Error} If `derivData` is not provided when `royaltyShares` are provided.
10484
11046
  * @throws {Error} If neither `derivData` nor `licenseTokenIds` are provided.
@@ -10591,7 +11153,8 @@ var IPAssetClient = /*#__PURE__*/function () {
10591
11153
  case 2:
10592
11154
  return _context27.a(2, this.registerIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
10593
11155
  licenseTokenIds: licenseTokenIds,
10594
- maxRts: maxRts
11156
+ maxRts: maxRts,
11157
+ autoApproveLicenseTokens: request.autoApproveLicenseTokens
10595
11158
  })));
10596
11159
  }
10597
11160
  }, _callee27, this);
@@ -10646,7 +11209,8 @@ var IPAssetClient = /*#__PURE__*/function () {
10646
11209
  case 2:
10647
11210
  return _context28.a(2, this.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(_objectSpread2(_objectSpread2({}, baseParams), {}, {
10648
11211
  licenseTokenIds: licenseTokenIds,
10649
- maxRts: maxRts
11212
+ maxRts: maxRts,
11213
+ autoApproveLicenseTokens: request.autoApproveLicenseTokens
10650
11214
  })));
10651
11215
  }
10652
11216
  }, _callee28, this);
@@ -10683,7 +11247,7 @@ var IPAssetClient = /*#__PURE__*/function () {
10683
11247
  * **Automatic Token Handling:**
10684
11248
  * - If the wallet's IP token balance is insufficient to cover minting fees, it automatically wraps native IP tokens into WIP tokens.
10685
11249
  * - It checks allowances for all required spenders and automatically approves them if their current allowance is lower than needed.
10686
- * - These automatic processes can be configured through the `wipOptions` parameter to control behavior like multicall usage and approval settings.
11250
+ * - These automatic processes can be configured through the `options` parameter to control behavior like multicall usage and approval settings.
10687
11251
  */
10688
11252
  )
10689
11253
  }, {
@@ -10952,20 +11516,20 @@ var IPAssetClient = /*#__PURE__*/function () {
10952
11516
  value: function () {
10953
11517
  var _handleRegistrationWithFees = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(_ref5) {
10954
11518
  var _wipOptions$useMultic, _this$getIpIdAndToken, _event$ipId, _event$tokenId;
10955
- var sender, derivData, spgNftContract, spgSpenderAddress, txOptions, wipOptions, encodedTxs, contractCall, totalFees, wipSpenders, useMulticallWhenPossible, nftMintFee, publicMinting, totalDerivativeMintingFee, _yield$contractCallWi, txHash, receipt, event;
11519
+ var sender, derivData, spgNftContract, spgSpenderAddress, txOptions, options, encodedTxs, contractCall, tokenSpenders, wipOptions, useMulticallWhenPossible, nftMintFee, publicMinting, mintFees, _iterator0, _step0, mintFee, _yield$contractCallWi, txHash, receipt, event;
10956
11520
  return _regenerator().w(function (_context34) {
10957
11521
  while (1) switch (_context34.n) {
10958
11522
  case 0:
10959
- sender = _ref5.sender, derivData = _ref5.derivData, spgNftContract = _ref5.spgNftContract, spgSpenderAddress = _ref5.spgSpenderAddress, txOptions = _ref5.txOptions, wipOptions = _ref5.wipOptions, encodedTxs = _ref5.encodedTxs, contractCall = _ref5.contractCall;
10960
- totalFees = 0n;
10961
- wipSpenders = [];
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;
10962
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
10963
11527
  if (!spgNftContract) {
10964
11528
  _context34.n = 3;
10965
11529
  break;
10966
11530
  }
10967
11531
  _context34.n = 1;
10968
- return calculateSPGWipMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, spgNftContract));
11532
+ return calculateSPGMintFee(new SpgnftImplReadOnlyClient(this.rpcClient, spgNftContract));
10969
11533
  case 1:
10970
11534
  nftMintFee = _context34.v;
10971
11535
  _context34.n = 2;
@@ -10983,11 +11547,9 @@ var IPAssetClient = /*#__PURE__*/function () {
10983
11547
  if (!publicMinting) {
10984
11548
  useMulticallWhenPossible = false;
10985
11549
  }
10986
- totalFees += nftMintFee;
10987
- wipSpenders.push({
10988
- address: spgNftContract,
10989
- amount: nftMintFee
10990
- });
11550
+ tokenSpenders.push.apply(tokenSpenders, _toConsumableArray(nftMintFee ? [_objectSpread2({
11551
+ address: spgNftContract
11552
+ }, nftMintFee)] : []));
10991
11553
  case 3:
10992
11554
  if (!derivData) {
10993
11555
  _context34.n = 5;
@@ -11002,39 +11564,38 @@ var IPAssetClient = /*#__PURE__*/function () {
11002
11564
  sender: sender
11003
11565
  });
11004
11566
  case 4:
11005
- totalDerivativeMintingFee = _context34.v;
11006
- totalFees += totalDerivativeMintingFee;
11007
- if (totalDerivativeMintingFee > 0) {
11008
- wipSpenders.push({
11009
- address: spgSpenderAddress,
11010
- amount: totalDerivativeMintingFee
11011
- });
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();
11012
11580
  }
11013
11581
  case 5:
11014
- if (!(totalFees < 0)) {
11015
- _context34.n = 6;
11016
- break;
11017
- }
11018
- throw new Error("Total fees for registering derivative should never be negative: ".concat(totalFees));
11019
- case 6:
11020
- _context34.n = 7;
11582
+ _context34.n = 6;
11021
11583
  return contractCallWithFees({
11022
- totalFees: totalFees,
11023
- options: {
11584
+ options: _objectSpread2(_objectSpread2({}, options), {}, {
11024
11585
  wipOptions: _objectSpread2(_objectSpread2({}, wipOptions), {}, {
11025
11586
  useMulticallWhenPossible: useMulticallWhenPossible
11026
11587
  })
11027
- },
11588
+ }),
11028
11589
  multicall3Address: this.multicall3Client.address,
11029
11590
  rpcClient: this.rpcClient,
11030
- tokenSpenders: wipSpenders,
11591
+ tokenSpenders: tokenSpenders,
11031
11592
  contractCall: contractCall,
11032
11593
  sender: sender,
11033
11594
  wallet: this.wallet,
11034
11595
  txOptions: txOptions,
11035
11596
  encodedTxs: encodedTxs
11036
11597
  });
11037
- case 7:
11598
+ case 6:
11038
11599
  _yield$contractCallWi = _context34.v;
11039
11600
  txHash = _yield$contractCallWi.txHash;
11040
11601
  receipt = _yield$contractCallWi.receipt;
@@ -11058,43 +11619,50 @@ var IPAssetClient = /*#__PURE__*/function () {
11058
11619
  * Process the `LicenseTermsIds` and `maxLicenseTokensTxHashes` for each IP asset.
11059
11620
  */
11060
11621
  }, {
11061
- key: "processResponses",
11622
+ key: "populateLicenseAndTokenIdsForRegistrationResults",
11062
11623
  value: (function () {
11063
- var _processResponses = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(responses, aggregateRegistrationRequest, useMulticall) {
11064
- var _iterator0, _step0, _step0$value, responseIndex, response, _iterator1, _step1, _Object$values$respon, _step1$value, assetIndex, ipAsset, extraData, result, _extraData, i, _response, extraDataItem, _ipAsset, _t36, _t37;
11624
+ var _populateLicenseAndTokenIdsForRegistrationResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(registrationResults, aggregateRegistrationRequest) {
11625
+ var allExtraDataArrays, allExtraData, extraDataFlatIndex, _iterator1, _step1, registrationResult, i, ipAsset, _t36;
11065
11626
  return _regenerator().w(function (_context35) {
11066
11627
  while (1) switch (_context35.p = _context35.n) {
11067
11628
  case 0:
11068
- if (!useMulticall) {
11069
- _context35.n = 15;
11070
- break;
11071
- }
11072
- _iterator0 = _createForOfIteratorHelper(responses.entries());
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);
11073
11636
  _context35.p = 1;
11074
- _iterator0.s();
11075
- case 2:
11076
- if ((_step0 = _iterator0.n()).done) {
11077
- _context35.n = 11;
11078
- break;
11079
- }
11080
- _step0$value = _slicedToArray(_step0.value, 2), responseIndex = _step0$value[0], response = _step0$value[1];
11081
- _iterator1 = _createForOfIteratorHelper(response.ipAssetsWithLicenseTerms.entries());
11082
- _context35.p = 3;
11083
11637
  _iterator1.s();
11084
- case 4:
11638
+ case 2:
11085
11639
  if ((_step1 = _iterator1.n()).done) {
11086
11640
  _context35.n = 7;
11087
11641
  break;
11088
11642
  }
11089
- _step1$value = _slicedToArray(_step1.value, 2), assetIndex = _step1$value[0], ipAsset = _step1$value[1];
11090
- extraData = (_Object$values$respon = Object.values(aggregateRegistrationRequest)[responseIndex]) === null || _Object$values$respon === void 0 || (_Object$values$respon = _Object$values$respon.extraData) === null || _Object$values$respon === void 0 ? void 0 : _Object$values$respon[assetIndex];
11091
- _context35.n = 5;
11092
- return this.processIpAssetLicenseTerms(ipAsset, extraData);
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;
11093
11660
  case 5:
11094
- result = _context35.v;
11095
- responses[responseIndex].ipAssetsWithLicenseTerms[assetIndex] = result;
11661
+ i++;
11662
+ _context35.n = 3;
11663
+ break;
11096
11664
  case 6:
11097
- _context35.n = 4;
11665
+ _context35.n = 2;
11098
11666
  break;
11099
11667
  case 7:
11100
11668
  _context35.n = 9;
@@ -11108,54 +11676,14 @@ var IPAssetClient = /*#__PURE__*/function () {
11108
11676
  _iterator1.f();
11109
11677
  return _context35.f(9);
11110
11678
  case 10:
11111
- _context35.n = 2;
11112
- break;
11113
- case 11:
11114
- _context35.n = 13;
11115
- break;
11116
- case 12:
11117
- _context35.p = 12;
11118
- _t37 = _context35.v;
11119
- _iterator0.e(_t37);
11120
- case 13:
11121
- _context35.p = 13;
11122
- _iterator0.f();
11123
- return _context35.f(13);
11124
- case 14:
11125
- _context35.n = 19;
11126
- break;
11127
- case 15:
11128
- _extraData = [];
11129
- Object.values(aggregateRegistrationRequest).map(function (item) {
11130
- var _item$extraData;
11131
- _extraData.push.apply(_extraData, _toConsumableArray((_item$extraData = item.extraData) !== null && _item$extraData !== void 0 ? _item$extraData : undefined));
11132
- });
11133
- i = 0;
11134
- case 16:
11135
- if (!(i < responses.length)) {
11136
- _context35.n = 19;
11137
- break;
11138
- }
11139
- _response = responses[i];
11140
- extraDataItem = _extraData[i];
11141
- _context35.n = 17;
11142
- return this.processIpAssetLicenseTerms(_response.ipAssetsWithLicenseTerms[0], extraDataItem);
11143
- case 17:
11144
- _ipAsset = _context35.v;
11145
- responses[i].ipAssetsWithLicenseTerms[0] = _ipAsset;
11146
- case 18:
11147
- i++;
11148
- _context35.n = 16;
11149
- break;
11150
- case 19:
11151
- return _context35.a(2, responses);
11679
+ return _context35.a(2, registrationResults);
11152
11680
  }
11153
- }, _callee35, this, [[3, 8, 9, 10], [1, 12, 13, 14]]);
11681
+ }, _callee35, this, [[1, 8, 9, 10]]);
11154
11682
  }));
11155
- function processResponses(_x33, _x34, _x35) {
11156
- return _processResponses.apply(this, arguments);
11683
+ function populateLicenseAndTokenIdsForRegistrationResults(_x33, _x34) {
11684
+ return _populateLicenseAndTokenIdsForRegistrationResults.apply(this, arguments);
11157
11685
  }
11158
- return processResponses;
11686
+ return populateLicenseAndTokenIdsForRegistrationResults;
11159
11687
  }())
11160
11688
  }, {
11161
11689
  key: "processIpAssetLicenseTerms",
@@ -11210,11 +11738,65 @@ var IPAssetClient = /*#__PURE__*/function () {
11210
11738
  }
11211
11739
  }, _callee36, this);
11212
11740
  }));
11213
- function processIpAssetLicenseTerms(_x36, _x37) {
11741
+ function processIpAssetLicenseTerms(_x35, _x36) {
11214
11742
  return _processIpAssetLicenseTerms.apply(this, arguments);
11215
11743
  }
11216
11744
  return processIpAssetLicenseTerms;
11217
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
+ }()
11218
11800
  }]);
11219
11801
  }();
11220
11802
 
@@ -11386,7 +11968,7 @@ var LicenseClient = /*#__PURE__*/function () {
11386
11968
  value: (function () {
11387
11969
  var _mintLicenseTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
11388
11970
  var _this = this;
11389
- var _request$maxMintingFe, _request$maxRevenueSh, _request$txOptions2, _request$options, receiver, req, isLicenseIpIdRegistered, isExisted, ipAccount, ipOwner, isAttachedLicenseTerms, encodedTxData, licenseMintingFee, wipSpenders, _yield$contractCallWi, txHash, receipt, targetLogs, startLicenseTokenId, licenseTokenIds, i, _t3;
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;
11390
11972
  return _regenerator().w(function (_context3) {
11391
11973
  while (1) switch (_context3.p = _context3.n) {
11392
11974
  case 0:
@@ -11465,7 +12047,7 @@ var LicenseClient = /*#__PURE__*/function () {
11465
12047
  });
11466
12048
  case 9:
11467
12049
  _context3.n = 10;
11468
- return calculateLicenseWipMintFee({
12050
+ return calculateLicenseMintFee({
11469
12051
  predictMintingFeeRequest: req,
11470
12052
  rpcClient: this.rpcClient,
11471
12053
  chainId: this.chainId,
@@ -11474,18 +12056,14 @@ var LicenseClient = /*#__PURE__*/function () {
11474
12056
  case 10:
11475
12057
  licenseMintingFee = _context3.v;
11476
12058
  wipSpenders = [];
11477
- if (licenseMintingFee > 0n) {
11478
- wipSpenders.push({
11479
- address: royaltyModuleAddress[this.chainId],
11480
- amount: licenseMintingFee
11481
- });
12059
+ if (licenseMintingFee.amount > 0n) {
12060
+ wipSpenders.push(_objectSpread2({
12061
+ address: royaltyModuleAddress[this.chainId]
12062
+ }, licenseMintingFee));
11482
12063
  }
11483
12064
  _context3.n = 11;
11484
12065
  return contractCallWithFees({
11485
- totalFees: licenseMintingFee,
11486
- options: {
11487
- wipOptions: (_request$options = request.options) === null || _request$options === void 0 ? void 0 : _request$options.wipOptions
11488
- },
12066
+ options: request.options,
11489
12067
  multicall3Address: this.multicall3Client.address,
11490
12068
  rpcClient: this.rpcClient,
11491
12069
  tokenSpenders: wipSpenders,
@@ -11777,7 +12355,8 @@ var LicenseClient = /*#__PURE__*/function () {
11777
12355
  licenseTemplate: newLicenseTemplate,
11778
12356
  licensingConfig: _objectSpread2(_objectSpread2({}, licensingConfig), {}, {
11779
12357
  licensingHook: this.totalLicenseTokenLimitHookClient.address,
11780
- expectMinimumGroupRewardShare: licensingConfig.expectMinimumGroupRewardShare / 1000000
12358
+ // use Math.trunc to avoid precision issues
12359
+ expectMinimumGroupRewardShare: Math.trunc(licensingConfig.expectMinimumGroupRewardShare / 1000000)
11781
12360
  })
11782
12361
  });
11783
12362
  case 4:
@@ -13254,12 +13833,12 @@ var RoyaltyClient = /*#__PURE__*/function () {
13254
13833
  value: (function () {
13255
13834
  var _payRoyaltyOnBehalf = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(request) {
13256
13835
  var _this2 = this;
13257
- var _request$txOptions, receiverIpId, payerIpId, token, amount, _request$options2, _request$options3, erc20Options, wipOptions, txOptions, sender, payAmount, isReceiverRegistered, isPayerRegistered, req, encodedTxData, contractCall, tokenSpenders, _t5;
13836
+ var _request$txOptions, receiverIpId, payerIpId, token, amount, options, txOptions, sender, payAmount, isReceiverRegistered, isPayerRegistered, req, encodedTxData, contractCall, tokenSpenders, _t5;
13258
13837
  return _regenerator().w(function (_context4) {
13259
13838
  while (1) switch (_context4.p = _context4.n) {
13260
13839
  case 0:
13261
13840
  _context4.p = 0;
13262
- receiverIpId = request.receiverIpId, payerIpId = request.payerIpId, token = request.token, amount = request.amount, _request$options2 = request.options, _request$options3 = _request$options2 === void 0 ? {} : _request$options2, erc20Options = _request$options3.erc20Options, wipOptions = _request$options3.wipOptions, txOptions = request.txOptions;
13841
+ receiverIpId = request.receiverIpId, payerIpId = request.payerIpId, token = request.token, amount = request.amount, options = request.options, txOptions = request.txOptions;
13263
13842
  sender = this.wallet.account.address;
13264
13843
  payAmount = BigInt(amount);
13265
13844
  if (!(payAmount <= 0n)) {
@@ -13316,21 +13895,17 @@ var RoyaltyClient = /*#__PURE__*/function () {
13316
13895
  };
13317
13896
  tokenSpenders = [{
13318
13897
  address: this.royaltyModuleClient.address,
13319
- amount: payAmount
13898
+ amount: payAmount,
13899
+ token: token
13320
13900
  }];
13321
13901
  _context4.n = 7;
13322
13902
  return contractCallWithFees({
13323
- totalFees: payAmount,
13324
- options: {
13325
- erc20Options: erc20Options,
13326
- wipOptions: wipOptions
13327
- },
13903
+ options: options,
13328
13904
  multicall3Address: this.multicall3Client.address,
13329
13905
  rpcClient: this.rpcClient,
13330
13906
  tokenSpenders: tokenSpenders,
13331
13907
  contractCall: contractCall,
13332
13908
  sender: sender,
13333
- token: token,
13334
13909
  wallet: this.wallet,
13335
13910
  txOptions: txOptions,
13336
13911
  encodedTxs: [encodedTxData]