@story-protocol/core-sdk 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/declarations/src/abi/generated.d.ts +16 -0
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/client.d.ts +6 -0
- package/dist/declarations/src/client.d.ts.map +1 -1
- package/dist/declarations/src/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/resources/nftClient.d.ts +5 -1
- package/dist/declarations/src/resources/nftClient.d.ts.map +1 -1
- package/dist/declarations/src/types/config.d.ts +48 -1
- package/dist/declarations/src/types/config.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/nftClient.d.ts +6 -0
- package/dist/declarations/src/types/resources/nftClient.d.ts.map +1 -1
- package/dist/declarations/src/utils/oov3.d.ts +4 -0
- package/dist/declarations/src/utils/oov3.d.ts.map +1 -1
- package/dist/declarations/src/utils/pilFlavor.d.ts.map +1 -1
- package/dist/story-protocol-core-sdk.cjs.dev.js +203 -43
- package/dist/story-protocol-core-sdk.cjs.prod.js +203 -43
- package/dist/story-protocol-core-sdk.esm.js +204 -44
- package/package.json +3 -1
|
@@ -2665,6 +2665,10 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2665
2665
|
* @param to address
|
|
2666
2666
|
* @param tokenId uint256
|
|
2667
2667
|
*//**
|
|
2668
|
+
* SpgnftImplBalanceOfRequest
|
|
2669
|
+
*
|
|
2670
|
+
* @param owner address
|
|
2671
|
+
*//**
|
|
2668
2672
|
* SpgnftImplHasRoleRequest
|
|
2669
2673
|
*
|
|
2670
2674
|
* @param role bytes32
|
|
@@ -2687,38 +2691,43 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2687
2691
|
*/},{key:"parseTxTransferEvent",value:function parseTxTransferEvent(txReceipt){var targetLogs=[];var _iterator38=_createForOfIteratorHelper(txReceipt.logs),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var log=_step38.value;try{var event=viem.decodeEventLog({abi:spgnftImplAbi,eventName:"Transfer",data:log.data,topics:log.topics});if(event.eventName==="Transfer"){targetLogs.push(event.args);}}catch(e){/* empty */}}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return targetLogs;}}]);}();/**
|
|
2688
2692
|
* contract SPGNFTImpl readonly method
|
|
2689
2693
|
*/var SpgnftImplReadOnlyClient=/*#__PURE__*/function(_SpgnftImplEventClien){function SpgnftImplReadOnlyClient(rpcClient,address){_classCallCheck(this,SpgnftImplReadOnlyClient);return _callSuper(this,SpgnftImplReadOnlyClient,[rpcClient,address]);}/**
|
|
2694
|
+
* method balanceOf for contract SPGNFTImpl
|
|
2695
|
+
*
|
|
2696
|
+
* @param request SpgnftImplBalanceOfRequest
|
|
2697
|
+
* @return Promise<SpgnftImplBalanceOfResponse>
|
|
2698
|
+
*/_inherits(SpgnftImplReadOnlyClient,_SpgnftImplEventClien);return _createClass(SpgnftImplReadOnlyClient,[{key:"balanceOf",value:(function(){var _balanceOf3=_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:"balanceOf",args:[request.owner]});case 1:return _context188.a(2,_context188.v);}},_callee188,this);}));function balanceOf(_x134){return _balanceOf3.apply(this,arguments);}return balanceOf;}()/**
|
|
2690
2699
|
* method hasRole for contract SPGNFTImpl
|
|
2691
2700
|
*
|
|
2692
2701
|
* @param request SpgnftImplHasRoleRequest
|
|
2693
2702
|
* @return Promise<SpgnftImplHasRoleResponse>
|
|
2694
|
-
*/
|
|
2703
|
+
*/)},{key:"hasRole",value:(function(){var _hasRole=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee189(request){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:"hasRole",args:[request.role,request.account]});case 1:return _context189.a(2,_context189.v);}},_callee189,this);}));function hasRole(_x135){return _hasRole.apply(this,arguments);}return hasRole;}()/**
|
|
2695
2704
|
* method mintFee for contract SPGNFTImpl
|
|
2696
2705
|
*
|
|
2697
2706
|
* @param request SpgnftImplMintFeeRequest
|
|
2698
2707
|
* @return Promise<SpgnftImplMintFeeResponse>
|
|
2699
|
-
*/)},{key:"mintFee",value:(function(){var _mintFee=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2708
|
+
*/)},{key:"mintFee",value:(function(){var _mintFee=_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:"mintFee"});case 1:return _context190.a(2,_context190.v);}},_callee190,this);}));function mintFee(){return _mintFee.apply(this,arguments);}return mintFee;}()/**
|
|
2700
2709
|
* method mintFeeToken for contract SPGNFTImpl
|
|
2701
2710
|
*
|
|
2702
2711
|
* @param request SpgnftImplMintFeeTokenRequest
|
|
2703
2712
|
* @return Promise<SpgnftImplMintFeeTokenResponse>
|
|
2704
|
-
*/)},{key:"mintFeeToken",value:(function(){var _mintFeeToken=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2713
|
+
*/)},{key:"mintFeeToken",value:(function(){var _mintFeeToken=_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:"mintFeeToken"});case 1:return _context191.a(2,_context191.v);}},_callee191,this);}));function mintFeeToken(){return _mintFeeToken.apply(this,arguments);}return mintFeeToken;}()/**
|
|
2705
2714
|
* method publicMinting for contract SPGNFTImpl
|
|
2706
2715
|
*
|
|
2707
2716
|
* @param request SpgnftImplPublicMintingRequest
|
|
2708
2717
|
* @return Promise<SpgnftImplPublicMintingResponse>
|
|
2709
|
-
*/)},{key:"publicMinting",value:(function(){var _publicMinting=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2718
|
+
*/)},{key:"publicMinting",value:(function(){var _publicMinting=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee192(){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:"publicMinting"});case 1:return _context192.a(2,_context192.v);}},_callee192,this);}));function publicMinting(){return _publicMinting.apply(this,arguments);}return publicMinting;}()/**
|
|
2710
2719
|
* method tokenURI for contract SPGNFTImpl
|
|
2711
2720
|
*
|
|
2712
2721
|
* @param request SpgnftImplTokenUriRequest
|
|
2713
2722
|
* @return Promise<SpgnftImplTokenUriResponse>
|
|
2714
|
-
*/)},{key:"tokenUri",value:(function(){var _tokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2723
|
+
*/)},{key:"tokenUri",value:(function(){var _tokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee193(request){return _regenerator().w(function(_context193){while(1)switch(_context193.n){case 0:_context193.n=1;return this.rpcClient.readContract({abi:spgnftImplAbi,address:this.address,functionName:"tokenURI",args:[request.tokenId]});case 1:return _context193.a(2,_context193.v);}},_callee193,this);}));function tokenUri(_x136){return _tokenUri.apply(this,arguments);}return tokenUri;}())}]);}(SpgnftImplEventClient);/**
|
|
2715
2724
|
* contract SPGNFTImpl write method
|
|
2716
2725
|
*/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;}/**
|
|
2717
2726
|
* method setTokenURI for contract SPGNFTImpl
|
|
2718
2727
|
*
|
|
2719
2728
|
* @param request SpgnftImplSetTokenUriRequest
|
|
2720
2729
|
* @return Promise<WriteContractReturnType>
|
|
2721
|
-
*/_inherits(SpgnftImplClient,_SpgnftImplReadOnlyCl);return _createClass(SpgnftImplClient,[{key:"setTokenUri",value:(function(){var _setTokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2730
|
+
*/_inherits(SpgnftImplClient,_SpgnftImplReadOnlyCl);return _createClass(SpgnftImplClient,[{key:"setTokenUri",value:(function(){var _setTokenUri=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee194(request){var _yield$this$rpcClient93,call;return _regenerator().w(function(_context194){while(1)switch(_context194.n){case 0:_context194.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=_context194.v;call=_yield$this$rpcClient93.request;_context194.n=2;return this.wallet.writeContract(call);case 2:return _context194.a(2,_context194.v);}},_callee194,this);}));function setTokenUri(_x137){return _setTokenUri.apply(this,arguments);}return setTokenUri;}()/**
|
|
2722
2731
|
* method setTokenURI for contract SPGNFTImpl with only encode
|
|
2723
2732
|
*
|
|
2724
2733
|
* @param request SpgnftImplSetTokenUriRequest
|
|
@@ -2738,7 +2747,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2738
2747
|
*
|
|
2739
2748
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
|
2740
2749
|
* @return Promise<WriteContractReturnType>
|
|
2741
|
-
*/return _createClass(TotalLicenseTokenLimitHookClient,[{key:"setTotalLicenseTokenLimit",value:(function(){var _setTotalLicenseTokenLimit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2750
|
+
*/return _createClass(TotalLicenseTokenLimitHookClient,[{key:"setTotalLicenseTokenLimit",value:(function(){var _setTotalLicenseTokenLimit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee195(request){var _yield$this$rpcClient94,call;return _regenerator().w(function(_context195){while(1)switch(_context195.n){case 0:_context195.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=_context195.v;call=_yield$this$rpcClient94.request;_context195.n=2;return this.wallet.writeContract(call);case 2:return _context195.a(2,_context195.v);}},_callee195,this);}));function setTotalLicenseTokenLimit(_x138){return _setTotalLicenseTokenLimit.apply(this,arguments);}return setTotalLicenseTokenLimit;}()/**
|
|
2742
2751
|
* method setTotalLicenseTokenLimit for contract TotalLicenseTokenLimitHook with only encode
|
|
2743
2752
|
*
|
|
2744
2753
|
* @param request TotalLicenseTokenLimitHookSetTotalLicenseTokenLimitRequest
|
|
@@ -2788,19 +2797,19 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2788
2797
|
*
|
|
2789
2798
|
* @param request WrappedIpAllowanceRequest
|
|
2790
2799
|
* @return Promise<WrappedIpAllowanceResponse>
|
|
2791
|
-
*/return _createClass(WrappedIpReadOnlyClient,[{key:"allowance",value:(function(){var _allowance2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2800
|
+
*/return _createClass(WrappedIpReadOnlyClient,[{key:"allowance",value:(function(){var _allowance2=_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:"allowance",args:[request.owner,request.spender]});case 1:result=_context196.v;return _context196.a(2,{result:result});}},_callee196,this);}));function allowance(_x139){return _allowance2.apply(this,arguments);}return allowance;}()/**
|
|
2792
2801
|
* method balanceOf for contract WrappedIP
|
|
2793
2802
|
*
|
|
2794
2803
|
* @param request WrappedIpBalanceOfRequest
|
|
2795
2804
|
* @return Promise<WrappedIpBalanceOfResponse>
|
|
2796
|
-
*/)},{key:"balanceOf",value:(function(){var
|
|
2805
|
+
*/)},{key:"balanceOf",value:(function(){var _balanceOf4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee197(request){var result;return _regenerator().w(function(_context197){while(1)switch(_context197.n){case 0:_context197.n=1;return this.rpcClient.readContract({abi:wrappedIpAbi,address:this.address,functionName:"balanceOf",args:[request.owner]});case 1:result=_context197.v;return _context197.a(2,{result:result});}},_callee197,this);}));function balanceOf(_x140){return _balanceOf4.apply(this,arguments);}return balanceOf;}())}]);}();/**
|
|
2797
2806
|
* contract WrappedIP write method
|
|
2798
2807
|
*/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;}/**
|
|
2799
2808
|
* method approve for contract WrappedIP
|
|
2800
2809
|
*
|
|
2801
2810
|
* @param request WrappedIpApproveRequest
|
|
2802
2811
|
* @return Promise<WriteContractReturnType>
|
|
2803
|
-
*/_inherits(WrappedIpClient,_WrappedIpReadOnlyCli);return _createClass(WrappedIpClient,[{key:"approve",value:(function(){var _approve3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2812
|
+
*/_inherits(WrappedIpClient,_WrappedIpReadOnlyCli);return _createClass(WrappedIpClient,[{key:"approve",value:(function(){var _approve3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee198(request){var _yield$this$rpcClient95,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:"approve",account:this.wallet.account,args:[request.spender,request.amount]});case 1:_yield$this$rpcClient95=_context198.v;call=_yield$this$rpcClient95.request;_context198.n=2;return this.wallet.writeContract(call);case 2:return _context198.a(2,_context198.v);}},_callee198,this);}));function approve(_x141){return _approve3.apply(this,arguments);}return approve;}()/**
|
|
2804
2813
|
* method approve for contract WrappedIP with only encode
|
|
2805
2814
|
*
|
|
2806
2815
|
* @param request WrappedIpApproveRequest
|
|
@@ -2810,7 +2819,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2810
2819
|
*
|
|
2811
2820
|
* @param request WrappedIpDepositRequest
|
|
2812
2821
|
* @return Promise<WriteContractReturnType>
|
|
2813
|
-
*/},{key:"deposit",value:(function(){var _deposit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2822
|
+
*/},{key:"deposit",value:(function(){var _deposit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee199(){var _yield$this$rpcClient96,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:"deposit",account:this.wallet.account});case 1:_yield$this$rpcClient96=_context199.v;call=_yield$this$rpcClient96.request;_context199.n=2;return this.wallet.writeContract(call);case 2:return _context199.a(2,_context199.v);}},_callee199,this);}));function deposit(){return _deposit.apply(this,arguments);}return deposit;}()/**
|
|
2814
2823
|
* method deposit for contract WrappedIP with only encode
|
|
2815
2824
|
*
|
|
2816
2825
|
* @param request WrappedIpDepositRequest
|
|
@@ -2820,7 +2829,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2820
2829
|
*
|
|
2821
2830
|
* @param request WrappedIpTransferRequest
|
|
2822
2831
|
* @return Promise<WriteContractReturnType>
|
|
2823
|
-
*/},{key:"transfer",value:(function(){var _transfer2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2832
|
+
*/},{key:"transfer",value:(function(){var _transfer2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee200(request){var _yield$this$rpcClient97,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:"transfer",account:this.wallet.account,args:[request.to,request.amount]});case 1:_yield$this$rpcClient97=_context200.v;call=_yield$this$rpcClient97.request;_context200.n=2;return this.wallet.writeContract(call);case 2:return _context200.a(2,_context200.v);}},_callee200,this);}));function transfer(_x142){return _transfer2.apply(this,arguments);}return transfer;}()/**
|
|
2824
2833
|
* method transfer for contract WrappedIP with only encode
|
|
2825
2834
|
*
|
|
2826
2835
|
* @param request WrappedIpTransferRequest
|
|
@@ -2830,7 +2839,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2830
2839
|
*
|
|
2831
2840
|
* @param request WrappedIpTransferFromRequest
|
|
2832
2841
|
* @return Promise<WriteContractReturnType>
|
|
2833
|
-
*/},{key:"transferFrom",value:(function(){var _transferFrom2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2842
|
+
*/},{key:"transferFrom",value:(function(){var _transferFrom2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee201(request){var _yield$this$rpcClient98,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:"transferFrom",account:this.wallet.account,args:[request.from,request.to,request.amount]});case 1:_yield$this$rpcClient98=_context201.v;call=_yield$this$rpcClient98.request;_context201.n=2;return this.wallet.writeContract(call);case 2:return _context201.a(2,_context201.v);}},_callee201,this);}));function transferFrom(_x143){return _transferFrom2.apply(this,arguments);}return transferFrom;}()/**
|
|
2834
2843
|
* method transferFrom for contract WrappedIP with only encode
|
|
2835
2844
|
*
|
|
2836
2845
|
* @param request WrappedIpTransferFromRequest
|
|
@@ -2840,7 +2849,7 @@ function getAddress(address,chainId){return address[chainId||0]||"0x";}// Contra
|
|
|
2840
2849
|
*
|
|
2841
2850
|
* @param request WrappedIpWithdrawRequest
|
|
2842
2851
|
* @return Promise<WriteContractReturnType>
|
|
2843
|
-
*/},{key:"withdraw",value:(function(){var _withdraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2852
|
+
*/},{key:"withdraw",value:(function(){var _withdraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee202(request){var _yield$this$rpcClient99,call;return _regenerator().w(function(_context202){while(1)switch(_context202.n){case 0:_context202.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=_context202.v;call=_yield$this$rpcClient99.request;_context202.n=2;return this.wallet.writeContract(call);case 2:return _context202.a(2,_context202.v);}},_callee202,this);}));function withdraw(_x144){return _withdraw.apply(this,arguments);}return withdraw;}()/**
|
|
2844
2853
|
* method withdraw for contract WrappedIP with only encode
|
|
2845
2854
|
*
|
|
2846
2855
|
* @param request WrappedIpWithdrawRequest
|
|
@@ -4154,6 +4163,10 @@ var getMinimumBond = /*#__PURE__*/function () {
|
|
|
4154
4163
|
* - Executing the settlement transaction
|
|
4155
4164
|
* - Waiting for transaction confirmation
|
|
4156
4165
|
*
|
|
4166
|
+
* Retry behavior: If the OOV3 contract reverts with "Assertion not expired" (because
|
|
4167
|
+
* the assertion liveness period has not yet elapsed), the function retries up to 5 times
|
|
4168
|
+
* with a 3-second delay between attempts. Other errors are not retried.
|
|
4169
|
+
*
|
|
4157
4170
|
* @see https://docs.story.foundation/docs/uma-arbitration-policy#/
|
|
4158
4171
|
* @see https://docs.uma.xyz/developers/optimistic-oracle-v3
|
|
4159
4172
|
*
|
|
@@ -4164,11 +4177,19 @@ var getMinimumBond = /*#__PURE__*/function () {
|
|
|
4164
4177
|
*/
|
|
4165
4178
|
var settleAssertion = /*#__PURE__*/function () {
|
|
4166
4179
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(privateKey, disputeId, transport) {
|
|
4167
|
-
var baseConfig, rpcClient, walletClient, arbitrationPolicyUmaClient, oov3Contract, assertionId, txHash, _t;
|
|
4180
|
+
var maxAttempts, retryDelayMs, attempt, baseConfig, rpcClient, walletClient, arbitrationPolicyUmaClient, oov3Contract, assertionId, txHash, msg, _t;
|
|
4168
4181
|
return _regenerator().w(function (_context4) {
|
|
4169
4182
|
while (1) switch (_context4.p = _context4.n) {
|
|
4170
4183
|
case 0:
|
|
4171
|
-
|
|
4184
|
+
maxAttempts = 5;
|
|
4185
|
+
retryDelayMs = 3000;
|
|
4186
|
+
attempt = 1;
|
|
4187
|
+
case 1:
|
|
4188
|
+
if (!(attempt <= maxAttempts)) {
|
|
4189
|
+
_context4.n = 11;
|
|
4190
|
+
break;
|
|
4191
|
+
}
|
|
4192
|
+
_context4.p = 2;
|
|
4172
4193
|
baseConfig = {
|
|
4173
4194
|
chain: chainStringToViemChain("aeneid"),
|
|
4174
4195
|
transport: viem.http(transport !== null && transport !== void 0 ? transport : aeneid.rpcUrls["default"].http[0])
|
|
@@ -4178,37 +4199,57 @@ var settleAssertion = /*#__PURE__*/function () {
|
|
|
4178
4199
|
account: accounts.privateKeyToAccount(privateKey)
|
|
4179
4200
|
}));
|
|
4180
4201
|
arbitrationPolicyUmaClient = new ArbitrationPolicyUmaClient(rpcClient, walletClient);
|
|
4181
|
-
_context4.n =
|
|
4202
|
+
_context4.n = 3;
|
|
4182
4203
|
return getOov3Contract(arbitrationPolicyUmaClient);
|
|
4183
|
-
case
|
|
4204
|
+
case 3:
|
|
4184
4205
|
oov3Contract = _context4.v;
|
|
4185
|
-
_context4.n =
|
|
4206
|
+
_context4.n = 4;
|
|
4186
4207
|
return arbitrationPolicyUmaClient.disputeIdToAssertionId({
|
|
4187
4208
|
disputeId: BigInt(disputeId)
|
|
4188
4209
|
});
|
|
4189
|
-
case
|
|
4210
|
+
case 4:
|
|
4190
4211
|
assertionId = _context4.v;
|
|
4191
|
-
_context4.n =
|
|
4212
|
+
_context4.n = 5;
|
|
4192
4213
|
return walletClient.writeContract({
|
|
4193
4214
|
address: oov3Contract,
|
|
4194
4215
|
abi: ASSERTION_ABI,
|
|
4195
4216
|
functionName: "settleAssertion",
|
|
4196
4217
|
args: [assertionId]
|
|
4197
4218
|
});
|
|
4198
|
-
case
|
|
4219
|
+
case 5:
|
|
4199
4220
|
txHash = _context4.v;
|
|
4200
|
-
_context4.n =
|
|
4221
|
+
_context4.n = 6;
|
|
4201
4222
|
return rpcClient.waitForTransactionReceipt({
|
|
4202
4223
|
hash: txHash
|
|
4203
4224
|
});
|
|
4204
|
-
case
|
|
4225
|
+
case 6:
|
|
4205
4226
|
return _context4.a(2, txHash);
|
|
4206
|
-
case
|
|
4207
|
-
_context4.p =
|
|
4227
|
+
case 7:
|
|
4228
|
+
_context4.p = 7;
|
|
4208
4229
|
_t = _context4.v;
|
|
4230
|
+
msg = _t instanceof Error ? _t.message : String(_t);
|
|
4231
|
+
if (!(attempt < maxAttempts && msg.includes("Assertion not expired"))) {
|
|
4232
|
+
_context4.n = 9;
|
|
4233
|
+
break;
|
|
4234
|
+
}
|
|
4235
|
+
_context4.n = 8;
|
|
4236
|
+
return new Promise(function (resolve) {
|
|
4237
|
+
return setTimeout(resolve, retryDelayMs);
|
|
4238
|
+
});
|
|
4239
|
+
case 8:
|
|
4240
|
+
return _context4.a(3, 10);
|
|
4241
|
+
case 9:
|
|
4209
4242
|
return _context4.a(2, handleError(_t, "Failed to settle assertion"));
|
|
4243
|
+
case 10:
|
|
4244
|
+
attempt++;
|
|
4245
|
+
_context4.n = 1;
|
|
4246
|
+
break;
|
|
4247
|
+
case 11:
|
|
4248
|
+
throw new Error("Failed to settle assertion: max retries exceeded");
|
|
4249
|
+
case 12:
|
|
4250
|
+
return _context4.a(2);
|
|
4210
4251
|
}
|
|
4211
|
-
}, _callee4, null, [[
|
|
4252
|
+
}, _callee4, null, [[2, 7]]);
|
|
4212
4253
|
}));
|
|
4213
4254
|
return function settleAssertion(_x8, _x9, _x0) {
|
|
4214
4255
|
return _ref4.apply(this, arguments);
|
|
@@ -4802,6 +4843,48 @@ var AccessPermission = /*#__PURE__*/function (AccessPermission) {
|
|
|
4802
4843
|
return AccessPermission;
|
|
4803
4844
|
}({});
|
|
4804
4845
|
|
|
4846
|
+
var MAINNET_CHAIN_ID = 1514;
|
|
4847
|
+
var AENEID_CHAIN_ID = 1315;
|
|
4848
|
+
|
|
4849
|
+
/** Per-chain whitelist: chainId -> set of allowed currency token addresses (checksummed). */
|
|
4850
|
+
var CURRENCY_TOKEN_WHITELIST = _defineProperty(_defineProperty({}, MAINNET_CHAIN_ID, new Set([viem.getAddress(wrappedIpAddress[MAINNET_CHAIN_ID])])), AENEID_CHAIN_ID, new Set([viem.getAddress(wrappedIpAddress[AENEID_CHAIN_ID]), viem.getAddress(erc20Address[AENEID_CHAIN_ID])]));
|
|
4851
|
+
|
|
4852
|
+
/** Human-readable description and error hint per chain. */
|
|
4853
|
+
var CHAIN_CURRENCY_HINT = _defineProperty(_defineProperty({}, MAINNET_CHAIN_ID, "On Mainnet, only WIP is allowed as currency token."), AENEID_CHAIN_ID, "On Aeneid Testnet, only WIP or MERC20 is allowed as currency token.");
|
|
4854
|
+
var toChainId = function toChainId(chainId) {
|
|
4855
|
+
if (chainId === "mainnet" || chainId === 1514) {
|
|
4856
|
+
return 1514;
|
|
4857
|
+
}
|
|
4858
|
+
if (chainId === "aeneid" || chainId === 1315) {
|
|
4859
|
+
return 1315;
|
|
4860
|
+
}
|
|
4861
|
+
return chainId;
|
|
4862
|
+
};
|
|
4863
|
+
|
|
4864
|
+
/**
|
|
4865
|
+
* Validates that the currency token is allowed for the given chain.
|
|
4866
|
+
* - Aeneid Testnet (1315): allows WIP or MERC20
|
|
4867
|
+
* - Mainnet (1514): allows WIP only
|
|
4868
|
+
*
|
|
4869
|
+
* @param token - The currency token address to validate
|
|
4870
|
+
* @param chainId - The chain ID (1315 or "aeneid" for Aeneid, 1514 or "mainnet" for Mainnet)
|
|
4871
|
+
* @throws Error if token is zero address or not allowed for the chain
|
|
4872
|
+
*/
|
|
4873
|
+
var validateCurrencyToken = function validateCurrencyToken(token, chainId) {
|
|
4874
|
+
if (token === null || token === undefined || token === viem.zeroAddress) {
|
|
4875
|
+
throw new Error("Currency token cannot be zero address.");
|
|
4876
|
+
}
|
|
4877
|
+
var resolvedChainId = toChainId(chainId);
|
|
4878
|
+
var allowedTokens = CURRENCY_TOKEN_WHITELIST[resolvedChainId];
|
|
4879
|
+
if (allowedTokens === null || allowedTokens === undefined) {
|
|
4880
|
+
throw new Error("Unsupported chain ID: ".concat(chainId, "."));
|
|
4881
|
+
}
|
|
4882
|
+
var normalizedToken = viem.getAddress(token);
|
|
4883
|
+
if (!allowedTokens.has(normalizedToken)) {
|
|
4884
|
+
throw new Error("".concat(CHAIN_CURRENCY_HINT[resolvedChainId], " The provided token is not allowed."));
|
|
4885
|
+
}
|
|
4886
|
+
};
|
|
4887
|
+
|
|
4805
4888
|
/**
|
|
4806
4889
|
* Gets the function signature from an ABI for a given method name
|
|
4807
4890
|
* @param abi - The contract ABI
|
|
@@ -5576,6 +5659,9 @@ var GroupClient = /*#__PURE__*/function () {
|
|
|
5576
5659
|
}
|
|
5577
5660
|
throw new Error("Currency token cannot be the zero address.");
|
|
5578
5661
|
case 4:
|
|
5662
|
+
currencyTokens.forEach(function (token) {
|
|
5663
|
+
return validateCurrencyToken(validateAddress(token), _this.chainId);
|
|
5664
|
+
});
|
|
5579
5665
|
collectAndClaimParams = {
|
|
5580
5666
|
groupIpId: validateAddress(groupIpId),
|
|
5581
5667
|
currencyTokens: validateAddresses(currencyTokens),
|
|
@@ -5739,6 +5825,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
|
5739
5825
|
case 0:
|
|
5740
5826
|
groupIpId = _ref6.groupIpId, currencyToken = _ref6.currencyToken, memberIpIds = _ref6.memberIpIds;
|
|
5741
5827
|
_context9.p = 1;
|
|
5828
|
+
validateCurrencyToken(validateAddress(currencyToken), this.chainId);
|
|
5742
5829
|
_context9.n = 2;
|
|
5743
5830
|
return this.groupingModuleClient.getClaimableReward({
|
|
5744
5831
|
groupId: validateAddress(groupIpId),
|
|
@@ -5819,6 +5906,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
|
5819
5906
|
case 0:
|
|
5820
5907
|
groupIpId = _ref8.groupIpId, currencyToken = _ref8.currencyToken, memberIpIds = _ref8.memberIpIds, txOptions = _ref8.txOptions;
|
|
5821
5908
|
_context1.p = 1;
|
|
5909
|
+
validateCurrencyToken(validateAddress(currencyToken), this.chainId);
|
|
5822
5910
|
claimRewardParam = {
|
|
5823
5911
|
groupId: validateAddress(groupIpId),
|
|
5824
5912
|
ipIds: validateAddresses(memberIpIds),
|
|
@@ -5878,6 +5966,7 @@ var GroupClient = /*#__PURE__*/function () {
|
|
|
5878
5966
|
case 0:
|
|
5879
5967
|
groupIpId = _ref9.groupIpId, currencyToken = _ref9.currencyToken, txOptions = _ref9.txOptions;
|
|
5880
5968
|
_context10.p = 1;
|
|
5969
|
+
validateCurrencyToken(validateAddress(currencyToken), this.chainId);
|
|
5881
5970
|
collectRoyaltiesParam = {
|
|
5882
5971
|
groupId: validateAddress(groupIpId),
|
|
5883
5972
|
token: validateAddress(currencyToken)
|
|
@@ -7147,6 +7236,11 @@ _defineProperty(PILFlavor, "validateLicenseTerms", function (params, chainId) {
|
|
|
7147
7236
|
throw new PILFlavorError("Royalty policy requires currency token.");
|
|
7148
7237
|
}
|
|
7149
7238
|
|
|
7239
|
+
// Validate currency token is allowed for the chain when currency is set (Aeneid: WIP or MERC20; Mainnet: WIP only). Zero address is allowed (e.g. no royalty).
|
|
7240
|
+
if (currency !== null && currency !== undefined && currency !== viem.zeroAddress && chainId !== undefined) {
|
|
7241
|
+
validateCurrencyToken(currency, chainId);
|
|
7242
|
+
}
|
|
7243
|
+
|
|
7150
7244
|
// Validate defaultMintingFee
|
|
7151
7245
|
if (normalized.defaultMintingFee < 0n) {
|
|
7152
7246
|
throw new PILFlavorError("DefaultMintingFee should be greater than or equal to 0.");
|
|
@@ -7296,6 +7390,7 @@ var validateLicenseTermsData = /*#__PURE__*/function () {
|
|
|
7296
7390
|
_context2.n = 5;
|
|
7297
7391
|
break;
|
|
7298
7392
|
}
|
|
7393
|
+
validateCurrencyToken(licenseTerm.currency, chainId);
|
|
7299
7394
|
_context2.n = 4;
|
|
7300
7395
|
return royaltyModuleReadOnlyClient.isWhitelistedRoyaltyToken({
|
|
7301
7396
|
token: licenseTerm.currency
|
|
@@ -13546,6 +13641,32 @@ var NftClient = /*#__PURE__*/function () {
|
|
|
13546
13641
|
return _getTokenURI.apply(this, arguments);
|
|
13547
13642
|
}
|
|
13548
13643
|
return getTokenURI;
|
|
13644
|
+
}()
|
|
13645
|
+
/**
|
|
13646
|
+
* Returns the number of NFTs owned by an address in a specific SPG NFT collection.
|
|
13647
|
+
*/
|
|
13648
|
+
)
|
|
13649
|
+
}, {
|
|
13650
|
+
key: "getNFTBalance",
|
|
13651
|
+
value: (function () {
|
|
13652
|
+
var _getNFTBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref3) {
|
|
13653
|
+
var spgNftContract, owner, spgNftClient, ownerAddress;
|
|
13654
|
+
return _regenerator().w(function (_context6) {
|
|
13655
|
+
while (1) switch (_context6.n) {
|
|
13656
|
+
case 0:
|
|
13657
|
+
spgNftContract = _ref3.spgNftContract, owner = _ref3.owner;
|
|
13658
|
+
spgNftClient = new SpgnftImplReadOnlyClient(this.rpcClient, validateAddress(spgNftContract));
|
|
13659
|
+
ownerAddress = validateAddress(owner !== null && owner !== void 0 ? owner : this.wallet.account.address);
|
|
13660
|
+
return _context6.a(2, spgNftClient.balanceOf({
|
|
13661
|
+
owner: ownerAddress
|
|
13662
|
+
}));
|
|
13663
|
+
}
|
|
13664
|
+
}, _callee6, this);
|
|
13665
|
+
}));
|
|
13666
|
+
function getNFTBalance(_x6) {
|
|
13667
|
+
return _getNFTBalance.apply(this, arguments);
|
|
13668
|
+
}
|
|
13669
|
+
return getNFTBalance;
|
|
13549
13670
|
}())
|
|
13550
13671
|
}]);
|
|
13551
13672
|
}();
|
|
@@ -15038,6 +15159,12 @@ var StoryClient = /*#__PURE__*/function () {
|
|
|
15038
15159
|
transport: this.config.transport
|
|
15039
15160
|
};
|
|
15040
15161
|
this.rpcClient = viem.createPublicClient(clientConfig);
|
|
15162
|
+
|
|
15163
|
+
// If a txHashResolver is provided (e.g. for AA wallets like ZeroDev/Dynamic),
|
|
15164
|
+
// patch waitForTransactionReceipt to resolve the hash first.
|
|
15165
|
+
if (config.txHashResolver) {
|
|
15166
|
+
this.applyTxHashResolver(config.txHashResolver);
|
|
15167
|
+
}
|
|
15041
15168
|
if (this.config.wallet) {
|
|
15042
15169
|
this.wallet = this.config.wallet;
|
|
15043
15170
|
} else if (this.config.account) {
|
|
@@ -15049,7 +15176,38 @@ var StoryClient = /*#__PURE__*/function () {
|
|
|
15049
15176
|
throw new Error("must specify a wallet or account");
|
|
15050
15177
|
}
|
|
15051
15178
|
}
|
|
15179
|
+
|
|
15180
|
+
/**
|
|
15181
|
+
* Patches rpcClient.waitForTransactionReceipt to first resolve the hash
|
|
15182
|
+
* through the provided resolver. This transparently supports AA wallets
|
|
15183
|
+
* where writeContract returns a UserOperation hash instead of a tx hash.
|
|
15184
|
+
*/
|
|
15052
15185
|
return _createClass(StoryClient, [{
|
|
15186
|
+
key: "applyTxHashResolver",
|
|
15187
|
+
value: function applyTxHashResolver(resolver) {
|
|
15188
|
+
var originalWaitForReceipt = this.rpcClient.waitForTransactionReceipt.bind(this.rpcClient);
|
|
15189
|
+
this.rpcClient.waitForTransactionReceipt = /*#__PURE__*/function () {
|
|
15190
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(args) {
|
|
15191
|
+
var resolvedHash;
|
|
15192
|
+
return _regenerator().w(function (_context) {
|
|
15193
|
+
while (1) switch (_context.n) {
|
|
15194
|
+
case 0:
|
|
15195
|
+
_context.n = 1;
|
|
15196
|
+
return resolver(args.hash);
|
|
15197
|
+
case 1:
|
|
15198
|
+
resolvedHash = _context.v;
|
|
15199
|
+
return _context.a(2, originalWaitForReceipt(_objectSpread2(_objectSpread2({}, args), {}, {
|
|
15200
|
+
hash: resolvedHash
|
|
15201
|
+
})));
|
|
15202
|
+
}
|
|
15203
|
+
}, _callee);
|
|
15204
|
+
}));
|
|
15205
|
+
return function (_x) {
|
|
15206
|
+
return _ref.apply(this, arguments);
|
|
15207
|
+
};
|
|
15208
|
+
}();
|
|
15209
|
+
}
|
|
15210
|
+
}, {
|
|
15053
15211
|
key: "chainId",
|
|
15054
15212
|
get: function get() {
|
|
15055
15213
|
return this.config.chainId;
|
|
@@ -15174,22 +15332,22 @@ var StoryClient = /*#__PURE__*/function () {
|
|
|
15174
15332
|
}, {
|
|
15175
15333
|
key: "getWalletBalance",
|
|
15176
15334
|
value: function () {
|
|
15177
|
-
var _getWalletBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
15178
|
-
return _regenerator().w(function (
|
|
15179
|
-
while (1) switch (
|
|
15335
|
+
var _getWalletBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
15336
|
+
return _regenerator().w(function (_context2) {
|
|
15337
|
+
while (1) switch (_context2.n) {
|
|
15180
15338
|
case 0:
|
|
15181
15339
|
if (this.wallet.account) {
|
|
15182
|
-
|
|
15340
|
+
_context2.n = 1;
|
|
15183
15341
|
break;
|
|
15184
15342
|
}
|
|
15185
15343
|
throw new Error("No account found in wallet");
|
|
15186
15344
|
case 1:
|
|
15187
|
-
|
|
15345
|
+
_context2.n = 2;
|
|
15188
15346
|
return this.getBalance(this.wallet.account.address);
|
|
15189
15347
|
case 2:
|
|
15190
|
-
return
|
|
15348
|
+
return _context2.a(2, _context2.v);
|
|
15191
15349
|
}
|
|
15192
|
-
},
|
|
15350
|
+
}, _callee2, this);
|
|
15193
15351
|
}));
|
|
15194
15352
|
function getWalletBalance() {
|
|
15195
15353
|
return _getWalletBalance.apply(this, arguments);
|
|
@@ -15199,22 +15357,22 @@ var StoryClient = /*#__PURE__*/function () {
|
|
|
15199
15357
|
}, {
|
|
15200
15358
|
key: "getBalance",
|
|
15201
15359
|
value: function () {
|
|
15202
|
-
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
15360
|
+
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(address) {
|
|
15203
15361
|
var validAddress;
|
|
15204
|
-
return _regenerator().w(function (
|
|
15205
|
-
while (1) switch (
|
|
15362
|
+
return _regenerator().w(function (_context3) {
|
|
15363
|
+
while (1) switch (_context3.n) {
|
|
15206
15364
|
case 0:
|
|
15207
15365
|
validAddress = validateAddress(address);
|
|
15208
|
-
|
|
15366
|
+
_context3.n = 1;
|
|
15209
15367
|
return this.rpcClient.getBalance({
|
|
15210
15368
|
address: validAddress
|
|
15211
15369
|
});
|
|
15212
15370
|
case 1:
|
|
15213
|
-
return
|
|
15371
|
+
return _context3.a(2, _context3.v);
|
|
15214
15372
|
}
|
|
15215
|
-
},
|
|
15373
|
+
}, _callee3, this);
|
|
15216
15374
|
}));
|
|
15217
|
-
function getBalance(
|
|
15375
|
+
function getBalance(_x2) {
|
|
15218
15376
|
return _getBalance.apply(this, arguments);
|
|
15219
15377
|
}
|
|
15220
15378
|
return getBalance;
|
|
@@ -15234,7 +15392,8 @@ var StoryClient = /*#__PURE__*/function () {
|
|
|
15234
15392
|
return new StoryClient({
|
|
15235
15393
|
chainId: config.chainId,
|
|
15236
15394
|
transport: config.transport,
|
|
15237
|
-
wallet: config.wallet
|
|
15395
|
+
wallet: config.wallet,
|
|
15396
|
+
txHashResolver: config.txHashResolver
|
|
15238
15397
|
});
|
|
15239
15398
|
}
|
|
15240
15399
|
|
|
@@ -15247,7 +15406,8 @@ var StoryClient = /*#__PURE__*/function () {
|
|
|
15247
15406
|
return new StoryClient({
|
|
15248
15407
|
account: config.account,
|
|
15249
15408
|
chainId: config.chainId,
|
|
15250
|
-
transport: config.transport
|
|
15409
|
+
transport: config.transport,
|
|
15410
|
+
txHashResolver: config.txHashResolver
|
|
15251
15411
|
});
|
|
15252
15412
|
}
|
|
15253
15413
|
}]);
|