@sentio/sdk-bundle 2.63.0 → 2.63.1
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/lib/aptos/builtin/0x1.js +1 -1
- package/lib/aptos/builtin/0x3.js +1 -1
- package/lib/aptos/builtin/0x4.js +1 -1
- package/lib/aptos/builtin/index.js +1 -1
- package/lib/aptos/ext/index.js +1 -1
- package/lib/aptos/index.js +1 -1
- package/lib/{chunk-RWNFJKBC.js → chunk-3UW3O4RI.js} +2 -2
- package/lib/{chunk-INM2JQXV.js → chunk-3XOMJPOV.js} +2 -2
- package/lib/{chunk-MEXIWEPZ.js → chunk-4CH3FO2Y.js} +2 -2
- package/lib/{chunk-MEXIWEPZ.js.map → chunk-4CH3FO2Y.js.map} +1 -1
- package/lib/chunk-67VWORXP.js +7 -0
- package/lib/chunk-67VWORXP.js.map +1 -0
- package/lib/{chunk-57B2QEFU.js → chunk-ATNNVLSV.js} +2 -2
- package/lib/{chunk-CIT277G3.js → chunk-CQUCT4WO.js} +2 -2
- package/lib/{chunk-MV77KZ7X.js → chunk-D2UTA6NP.js} +3 -3
- package/lib/{chunk-MV77KZ7X.js.map → chunk-D2UTA6NP.js.map} +1 -1
- package/lib/{chunk-NF7SQC5T.js → chunk-DCBB6WSY.js} +2 -2
- package/lib/{chunk-IRMT3JAE.js → chunk-E32G76ZD.js} +2 -2
- package/lib/{chunk-45NSVYWS.js → chunk-HYBAVEVS.js} +2 -2
- package/lib/{chunk-EDLEFVHW.js → chunk-MEWILSVR.js} +2 -2
- package/lib/{chunk-33Y7LZTL.js → chunk-OSRVBU5W.js} +2 -2
- package/lib/{chunk-XCZJCPWS.js → chunk-PJJSNY3A.js} +2 -2
- package/lib/{chunk-VG7IARUK.js → chunk-STFYLBQW.js} +2 -2
- package/lib/{chunk-RFTTBMZW.js → chunk-US7CSPMG.js} +2 -2
- package/lib/{chunk-TLJXINOL.js → chunk-WESN5VPX.js} +2 -2
- package/lib/{chunk-JWIM4IJV.js → chunk-WS3R3PHZ.js} +2 -2
- package/lib/{chunk-XMZYAXTX.js → chunk-ZXTBG7Q4.js} +2 -2
- package/lib/{chunk-VGSWB3RH.js → chunk-ZXUK2KRA.js} +2 -2
- package/lib/core/index.js +1 -1
- package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
- package/lib/eth/builtin/erc1155.js +1 -1
- package/lib/eth/builtin/erc20.js +1 -1
- package/lib/eth/builtin/erc721.js +1 -1
- package/lib/eth/builtin/index.js +1 -1
- package/lib/eth/builtin/weth9.js +1 -1
- package/lib/eth/index.js +1 -1
- package/lib/fuel/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/iota/builtin/0x1.js +1 -1
- package/lib/iota/builtin/0x2.js +1 -1
- package/lib/iota/builtin/0x3.js +1 -1
- package/lib/iota/builtin/index.js +1 -1
- package/lib/iota/ext/index.js +1 -1
- package/lib/iota/index.js +1 -1
- package/lib/move/index.js +1 -1
- package/lib/solana/builtin/index.js +1 -1
- package/lib/solana/index.js +1 -1
- package/lib/stark/index.js +1 -1
- package/lib/store/index.js +1 -1
- package/lib/sui/builtin/0x1.js +1 -1
- package/lib/sui/builtin/0x2.js +1 -1
- package/lib/sui/builtin/0x3.js +1 -1
- package/lib/sui/builtin/index.js +1 -1
- package/lib/sui/ext/index.js +1 -1
- package/lib/sui/index.js +1 -1
- package/lib/testing/index.js +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +2 -2
- package/lib/chunk-V7ONVBT4.js +0 -7
- package/lib/chunk-V7ONVBT4.js.map +0 -1
- /package/lib/{chunk-RWNFJKBC.js.map → chunk-3UW3O4RI.js.map} +0 -0
- /package/lib/{chunk-INM2JQXV.js.map → chunk-3XOMJPOV.js.map} +0 -0
- /package/lib/{chunk-57B2QEFU.js.map → chunk-ATNNVLSV.js.map} +0 -0
- /package/lib/{chunk-CIT277G3.js.map → chunk-CQUCT4WO.js.map} +0 -0
- /package/lib/{chunk-NF7SQC5T.js.map → chunk-DCBB6WSY.js.map} +0 -0
- /package/lib/{chunk-IRMT3JAE.js.map → chunk-E32G76ZD.js.map} +0 -0
- /package/lib/{chunk-45NSVYWS.js.map → chunk-HYBAVEVS.js.map} +0 -0
- /package/lib/{chunk-EDLEFVHW.js.map → chunk-MEWILSVR.js.map} +0 -0
- /package/lib/{chunk-33Y7LZTL.js.map → chunk-OSRVBU5W.js.map} +0 -0
- /package/lib/{chunk-XCZJCPWS.js.map → chunk-PJJSNY3A.js.map} +0 -0
- /package/lib/{chunk-VG7IARUK.js.map → chunk-STFYLBQW.js.map} +0 -0
- /package/lib/{chunk-RFTTBMZW.js.map → chunk-US7CSPMG.js.map} +0 -0
- /package/lib/{chunk-TLJXINOL.js.map → chunk-WESN5VPX.js.map} +0 -0
- /package/lib/{chunk-JWIM4IJV.js.map → chunk-WS3R3PHZ.js.map} +0 -0
- /package/lib/{chunk-XMZYAXTX.js.map → chunk-ZXTBG7Q4.js.map} +0 -0
- /package/lib/{chunk-VGSWB3RH.js.map → chunk-ZXUK2KRA.js.map} +0 -0
|
@@ -1323,7 +1323,7 @@ This error originated at ${JSON.stringify(i,null,2)}`:"";if(a)s=`A sway "panic"
|
|
|
1323
1323
|
`;return a(m,p)}}),"customOperations");return{...Qb(n),...i(n)}}async getVersion(){let{nodeInfo:{nodeVersion:t}}=await this.operations.getVersion();return t}async getBlockNumber(){let{chain:{latestBlock:{height:t}}}=await this.operations.getLatestBlockHeight();return T(t)}async fetchNode(){let{nodeInfo:t}=await this.operations.getNodeInfo(),r=k4(t);return Ee.nodeInfoCache[this.urlWithoutAuth]=r,r}async fetchChain(){let{chain:t}=await this.operations.getChain(),r=x4(t);return Ee.chainInfoCache[this.urlWithoutAuth]=r,r}async getChainId(){let{consensusParameters:{chainId:t}}=await this.getChain();return t.toNumber()}async getBaseAssetId(){let t=await this.getChain(),{consensusParameters:{baseAssetId:r}}=t;return r}async getAssetDetails(t){let{assetMetadata:r}=await this.getNodeFeatures();if(!r)throw new I(x.UNSUPPORTED_FEATURE,"The current node does not supports fetching asset details");let{assetDetails:n}=await this.operations.getAssetDetails({assetId:t}),{contractId:i,subId:a,totalSupply:s}=n;return{subId:a,contractId:i,totalSupply:T(s)}}#e(t,r){this.cache&&this.cache.set(r,t)}async validateTransaction(t){let{consensusParameters:{txParameters:{maxInputs:r,maxOutputs:n}}}=await this.getChain();if(T(t.inputs.length).gt(r))throw new I(x.MAX_INPUTS_EXCEEDED,`The transaction exceeds the maximum allowed number of inputs. Tx inputs: ${t.inputs.length}, max inputs: ${r}`);if(T(t.outputs.length).gt(n))throw new I(x.MAX_OUTPUTS_EXCEEDED,`The transaction exceeds the maximum allowed number of outputs. Tx outputs: ${t.outputs.length}, max outputs: ${n}`)}async sendTransaction(t,{enableAssetBurn:r,estimateTxDependencies:n=!0,includePreConfirmation:i=!0}={}){let a=Tn(t);jb(await this.getBaseAssetId(),a,r),n&&await this.estimateTxDependencies(a),await this.validateTransaction(a);let s=J(a.toTransactionBytes()),d;Vs(a)&&(d=a.abis);let u=await this.operations.submitAndAwaitStatus({encodedTransaction:s,includePreConfirmation:!0});this.#e(a.inputs,a.getTransactionId(await this.getChainId()));let p=await this.getChainId();return new gb({transactionRequestOrId:a,provider:this,chainId:p,abis:d,submitAndAwaitSubscription:u})}async dryRun(t,{utxoValidation:r,estimateTxDependencies:n=!0}={}){let i=Tn(t);if(n)return this.estimateTxDependencies(i);let a=J(i.toTransactionBytes()),{dryRun:s}=await this.operations.dryRun({encodedTransactions:a,utxoValidation:r||!1}),[{receipts:d,status:u}]=s;return{receipts:d.map(xn),dryRunStatus:u}}async estimatePredicates(t){if(!t.inputs.some(s=>cb(s)&&T(s.predicateGasUsed).isZero()))return t;let n=J(t.toTransactionBytes()),i=await this.operations.estimatePredicates({encodedTransaction:n}),{estimatePredicates:a}=i;return t=this.parseEstimatePredicatesResponse(t,a),t}async estimatePredicatesAndGasPrice(t,r){if(!t.inputs.some(s=>cb(s)&&T(s.predicateGasUsed).isZero())){let s=await this.estimateGasPrice(r);return{transactionRequest:t,gasPrice:s}}let{estimateGasPrice:{gasPrice:i},estimatePredicates:a}=await this.operations.estimatePredicatesAndGasPrice({blockHorizon:String(r),encodedTransaction:J(t.toTransactionBytes())});return t=this.parseEstimatePredicatesResponse(t,a),{transactionRequest:t,gasPrice:T(i)}}async estimateTxDependencies(t,{gasPrice:r}={}){if(EQ(t))return{rawReceipts:[],receipts:[],outputVariables:0,missingContractIds:[]};let n=[],i=[],a=[],s=0,d;await this.validateTransaction(t);let u=r??await this.estimateGasPrice(10);for(let p=0;p<_b;p++){let{dryRun:[{receipts:m,status:g}]}=await this.operations.dryRun({encodedTransactions:[J(t.toTransactionBytes())],utxoValidation:!1,gasPrice:u.toString()});n=m,i=m.map(xn),d=g;let{missingOutputVariables:A,missingOutputContractIds:E}=ub(i);if((A.length!==0||E.length!==0)&&Vs(t)){s+=A.length,t.addVariableOutputs(A.length),E.forEach(({contractId:D})=>{t.addContractInputAndOutput(new Te(D)),a.push(D)});let{maxFee:L}=await this.estimateTxGasAndFee({transactionRequest:t,gasPrice:u});t.maxFee=L}else break}return{rawReceipts:n,receipts:i,outputVariables:s,missingContractIds:a,dryRunStatus:d}}async estimateMultipleTxDependencies(t){let r=t.map(()=>({rawReceipts:[],receipts:[],outputVariables:0,missingContractIds:[],dryRunStatus:void 0})),n=pt(t),i=new Map;n.forEach((d,u)=>{Vs(d)&&i.set(u,J(d.toTransactionBytes()))});let a=Array.from(i.keys()),s=0;for(;a.length>0&&s<_b;){let d=a.map(m=>i.get(m)),u=await this.operations.dryRun({encodedTransactions:d,utxoValidation:!1}),p=[];for(let m=0;m<u.dryRun.length;m++){let g=a[m],{receipts:A,status:E}=u.dryRun[m],B=r[g];B.receipts=A.map(xn),B.dryRunStatus=E;let{missingOutputVariables:L,missingOutputContractIds:D}=ub(B.receipts),Q=L.length>0||D.length>0,W=n[g];if(Q&&Vs(W)){B.outputVariables+=L.length,W.addVariableOutputs(L.length),D.forEach(({contractId:K})=>{W.addContractInputAndOutput(new Te(K)),B.missingContractIds.push(K)});let{maxFee:H}=await this.estimateTxGasAndFee({transactionRequest:W});W.maxFee=H,i.set(g,J(W.toTransactionBytes())),p.push(g)}}a=p,s+=1}return r}async dryRunMultipleTransactions(t,{utxoValidation:r,estimateTxDependencies:n=!0}={}){if(n)return this.estimateMultipleTxDependencies(t);let i=t.map(d=>J(d.toTransactionBytes())),{dryRun:a}=await this.operations.dryRun({encodedTransactions:i,utxoValidation:r||!1});return a.map(({receipts:d,status:u})=>({receipts:d.map(xn),dryRunStatus:u}))}async autoRefetchConfigs(){if(Date.now()-(this.consensusParametersTimestamp??0)<6e4)return;if(!Ee.chainInfoCache?.[this.urlWithoutAuth]){await this.fetchChainAndNodeInfo(!0);return}let n=Ee.chainInfoCache[this.urlWithoutAuth],{latestBlock:{header:{consensusParametersVersion:i}}}=n,{chain:{latestBlock:{header:{consensusParametersVersion:a}}}}=await this.operations.getConsensusParametersVersion();i!==a&&await this.fetchChainAndNodeInfo(!0)}async estimateTxGasAndFee(t){let{transactionRequest:r,gasPrice:n}=t,i=n;await this.autoRefetchConfigs();let a=await this.getChain(),{gasPriceFactor:s,maxGasPerTx:d}=await this.getGasConfig(),u=r.calculateMinGas(a);Jr(i)||(i=await this.estimateGasPrice(10));let p=ao({gasPrice:T(i),gas:u,priceFactor:s,tip:r.tip}).add(1),m=T(0);Vs(r)&&(m=r.gasLimit,r.gasLimit.eq(0)&&(r.gasLimit=u,r.gasLimit=d.sub(r.calculateMaxGas(a,u)),m=r.gasLimit));let g=r.calculateMaxGas(a,u),A=ao({gasPrice:T(i),gas:g,priceFactor:s,tip:r.tip}).add(1);return{minGas:u,minFee:p,maxGas:g,maxFee:A,gasPrice:i,gasLimit:m}}async simulate(t,{estimateTxDependencies:r=!0}={}){let n=Tn(t);if(r)return this.estimateTxDependencies(n);let i=[J(n.toTransactionBytes())],{dryRun:a}=await this.operations.dryRun({encodedTransactions:i,utxoValidation:!0});return{receipts:a.map(d=>{let{id:u,receipts:p,status:m}=d,g=p.map(xn);return{id:u,receipts:g,status:m}})[0].receipts}}async getTransactionCost(t,{signatureCallback:r,gasPrice:n}={}){let i=pt(Tn(t)),a=i.maxFee.eq(0),s=Vs(i);s&&(i.gasLimit=T(0));let d=pt(i),u=0;if(r&&Vs(d)){let X=d.witnesses.length;await r(d),u=d.witnesses.length-X}let p;n?(p=n,await this.estimatePredicates(d)):{gasPrice:p}=await this.estimatePredicatesAndGasPrice(d,10),i.updatePredicateGasUsed(d.inputs);let{maxFee:m,maxGas:g,minFee:A,minGas:E,gasLimit:B}=await this.estimateTxGasAndFee({transactionRequest:d,gasPrice:p}),L=[],D=[],Q,W=[],H=0,K=T(0);if(i.maxFee=m,s){if(i.gasLimit=B,r&&await r(i),{rawReceipts:L,receipts:D,missingContractIds:W,outputVariables:H,dryRunStatus:Q}=await this.estimateTxDependencies(i,{gasPrice:p}),Q&&"reason"in Q)throw this.extractDryRunError(i,D,Q.reason);let{maxGasPerTx:X}=await this.getGasConfig(),j=Qs(D);K=T(j.muln(LQ)).max(X.sub(E)),i.gasLimit=K,{maxFee:m,maxGas:g,minFee:A,minGas:E}=await this.estimateTxGasAndFee({transactionRequest:i,gasPrice:p})}let Y={gasPrice:p.toString(),receipts:L};return{rawReceipts:L,receipts:D,gasUsed:K,gasPrice:p,minGas:E,maxGas:g,minFee:A,maxFee:m,outputVariables:H,missingContractIds:W,addedSignatures:u,estimatedPredicates:i.inputs,dryRunStatus:Q,updateMaxFee:a,transactionSummary:Y}}async assembleTx(t){let{request:r,reserveGas:n,resourcesIdsToIgnore:i,feePayerAccount:a,blockHorizon:s=10,estimatePredicates:d=!0,accountCoinQuantities:u=[]}=t,p=new Set,m=await this.getBaseAssetId(),g=-1,A,E=u.map((K,Y)=>{let{amount:X,assetId:j,account:ue=a,changeOutputAccount:U}=K,te=U?U.address.toB256():ue.address.toB256();p.add(ue.address.toB256());let ne={change:te};return j===m&&(A=ne.change),ue.address.equals(a.address)&&(g=Y),{account:ab(ue),amount:T(X).toString(10),assetId:j,changePolicy:ne}});g===-1&&(p.add(a.address.toB256()),g=E.push({account:ab(a),amount:T(0).toString(10),assetId:m,changePolicy:{change:A||a.address.toB256()}})-1);let B=await this.adjustResourcesToIgnoreForAddresses(Array.from(p),i),{assembleTx:{status:L,transaction:D,gasPrice:Q}}=await this.operations.assembleTx({tx:J(r.toTransactionBytes()),blockHorizon:String(s),feeAddressIndex:String(g),requiredBalances:E,estimatePredicates:d,excludeInput:B,reserveGas:n?T(n).toString(10):void 0});if(L.type==="DryRunFailureStatus"){let K=L.receipts.map(xn);throw this.extractDryRunError(r,K,L.reason)}r.witnesses=D.witnesses||r.witnesses,r.inputs=D.inputs?.map(uQ)||r.inputs,r.outputs=D.outputs?.map(cQ)||r.outputs,D.policies?.maxFee&&(r.maxFee=T(D.policies.maxFee)),r.type===Be.Script&&(r.gasLimit=T(D.scriptGasLimit).add(T(n)));let W=L.receipts,H=await this.getChainId();return r.updateState(H,"funded",{gasPrice:Q.toString(),receipts:W}),{assembledRequest:r,gasPrice:T(Q),receipts:L.receipts.map(xn),rawReceipts:W}}async getCoins(t,r,n){let i=new Te(t),{coins:{edges:a,pageInfo:s}}=await this.operations.getCoins({...zd({paginationLimit:Ab,inputArgs:n}),filter:{owner:i.toB256(),assetId:r&&J(r)}});return{coins:a.map(({node:u})=>({id:u.utxoId,assetId:u.assetId,amount:T(u.amount),owner:i,blockCreated:T(u.blockCreated),txCreatedIdx:T(u.txCreatedIdx)})),pageInfo:s}}async getResourcesToSpend(t,r,n){let i=new Te(t),a=await this.adjustResourcesToIgnoreForAddresses([i.b256Address],n),s={owner:i.toB256(),queryPerAsset:r.map(Q1).map(({assetId:p,amount:m,max:g})=>({assetId:J(p),amount:(m.eqn(0)?T(1):m).toString(10),max:g?g.toString(10):void 0})),excludedIds:a};return(await this.operations.getCoinsToSpend(s)).coinsToSpend.flat().map(p=>{switch(p.type){case"MessageCoin":return{amount:T(p.amount),assetId:p.assetId,daHeight:T(p.daHeight),sender:new Te(p.sender),recipient:new Te(p.recipient),nonce:p.nonce};case"Coin":return{id:p.utxoId,amount:T(p.amount),assetId:p.assetId,owner:i,blockCreated:T(p.blockCreated),txCreatedIdx:T(p.txCreatedIdx)};default:return null}}).filter(p=>!!p)}async getBlobs(t){let r=await this.operations.getBlobs({blobIds:t}),n=[];return Object.keys(r).forEach(i=>{let a=r[i];n.push(a?.id??null)}),n.filter(i=>i)}async getBlock(t){let r;if(t==="latest"){let{chain:{latestBlock:d}}=await this.operations.getLatestBlock();r=d}else{let u=typeof t=="string"&&No(t)?{blockId:t}:{height:T(t).toString(10)};r=(await this.operations.getBlock(u)).block}if(!r)return null;let{header:n,height:i,id:a,transactions:s}=r;return{id:a,height:T(i),time:n.time,header:{applicationHash:n.applicationHash,daHeight:T(n.daHeight),eventInboxRoot:n.eventInboxRoot,messageOutboxRoot:n.messageOutboxRoot,prevRoot:n.prevRoot,stateTransitionBytecodeVersion:n.stateTransitionBytecodeVersion,transactionsCount:n.transactionsCount,transactionsRoot:n.transactionsRoot},transactionIds:s.map(d=>d.id)}}async getBlocks(t){let{blocks:{edges:r,pageInfo:n}}=await this.operations.getBlocks({...zd({paginationLimit:DQ,inputArgs:t})});return{blocks:r.map(({node:a})=>({id:a.id,height:T(a.height),time:a.header.time,header:{applicationHash:a.header.applicationHash,daHeight:T(a.header.daHeight),eventInboxRoot:a.header.eventInboxRoot,messageOutboxRoot:a.header.messageOutboxRoot,prevRoot:a.header.prevRoot,stateTransitionBytecodeVersion:a.header.stateTransitionBytecodeVersion,transactionsCount:a.header.transactionsCount,transactionsRoot:a.header.transactionsRoot},transactionIds:a.transactions.map(s=>s.id)})),pageInfo:n}}async getBlockWithTransactions(t){let r;typeof t=="number"?r={blockHeight:T(t).toString(10)}:t==="latest"?r={blockHeight:(await this.getBlockNumber()).toString()}:typeof t=="string"&&No(t)?r={blockId:t}:r={blockHeight:T(t).toString()};let{block:n}=await this.operations.getBlockWithTransactions(r);return n?{id:n.id,height:T(n.height,10),time:n.header.time,header:{applicationHash:n.header.applicationHash,daHeight:T(n.header.daHeight),eventInboxRoot:n.header.eventInboxRoot,messageOutboxRoot:n.header.messageOutboxRoot,prevRoot:n.header.prevRoot,stateTransitionBytecodeVersion:n.header.stateTransitionBytecodeVersion,transactionsCount:n.header.transactionsCount,transactionsRoot:n.header.transactionsRoot},transactionIds:n.transactions.map(i=>i.id),transactions:n.transactions.map(i=>new Br().decode(q(i.rawPayload),0)?.[0])}:null}async getTransaction(t){let{transaction:r}=await this.operations.getTransaction({transactionId:t});if(!r)return null;try{return new Br().decode(q(r.rawPayload),0)?.[0]}catch(n){if(n instanceof I&&n.code===x.UNSUPPORTED_TRANSACTION_TYPE)return console.warn("Unsupported transaction type encountered"),null;throw n}}async getTransactions(t){let{transactions:{edges:r,pageInfo:n}}=await this.operations.getTransactions({...zd({inputArgs:t,paginationLimit:VI})}),i=new Br;return{transactions:r.map(({node:{rawPayload:s}})=>{try{return i.decode(q(s),0)[0]}catch(d){if(d instanceof I&&d.code===x.UNSUPPORTED_TRANSACTION_TYPE)return console.warn("Unsupported transaction type encountered"),null;throw d}}).filter(s=>s!==null),pageInfo:n}}async daCompressedBlock(t){let{daCompressedBlock:r}=await this.operations.daCompressedBlock({height:t});return r||null}async getContract(t){let{contract:r}=await this.operations.getContract({contractId:t});return r||null}async getContractBalance(t,r){let{contractBalance:n}=await this.operations.getContractBalance({contract:new Te(t).toB256(),asset:J(r)});return T(n.amount,10)}async getBalance(t,r){let{balance:n}=await this.operations.getBalanceV2({owner:new Te(t).toB256(),assetId:J(r)});return T(n.amountU128,10)}async getBalances(t,r){let n={first:kQ},{balancesPagination:i}=await this.getNodeFeatures();i&&(n=zd({inputArgs:r,paginationLimit:xQ}));let{balances:{edges:a,pageInfo:s}}=await this.operations.getBalancesV2({...n,filter:{owner:new Te(t).toB256()},supportsPagination:i});return{balances:a.map(({node:u})=>({assetId:u.assetId,amount:T(u.amountU128)})),...i?{pageInfo:s}:{}}}async getMessages(t,r){let{messages:{edges:n,pageInfo:i}}=await this.operations.getMessages({...zd({inputArgs:r,paginationLimit:Ab}),owner:new Te(t).toB256()});return{messages:n.map(({node:s})=>({messageId:za.getMessageId({sender:s.sender,recipient:s.recipient,nonce:s.nonce,amount:T(s.amount),data:s.data}),sender:new Te(s.sender),recipient:new Te(s.recipient),nonce:s.nonce,amount:T(s.amount),data:za.decodeData(s.data),daHeight:T(s.daHeight)})),pageInfo:i}}async getMessageProof(t,r,n,i){let a={transactionId:t,nonce:r};if(n&&i)throw new I(x.INVALID_INPUT_PARAMETERS,"commitBlockId and commitBlockHeight cannot be used together");n&&(a={...a,commitBlockId:n}),i&&(a={...a,commitBlockHeight:i.toNumber().toString()});let s=await this.operations.getMessageProof(a),{messageProof:d,messageBlockHeader:u,commitBlockHeader:p,blockProof:m,sender:g,recipient:A,amount:E,data:B}=s.messageProof;return{messageProof:{proofIndex:T(d.proofIndex),proofSet:d.proofSet},blockProof:{proofIndex:T(m.proofIndex),proofSet:m.proofSet},messageBlockHeader:{id:u.id,daHeight:T(u.daHeight),transactionsCount:Number(u.transactionsCount),transactionsRoot:u.transactionsRoot,height:T(u.height),prevRoot:u.prevRoot,time:u.time,applicationHash:u.applicationHash,messageReceiptCount:Number(u.messageReceiptCount),messageOutboxRoot:u.messageOutboxRoot,consensusParametersVersion:Number(u.consensusParametersVersion),eventInboxRoot:u.eventInboxRoot,stateTransitionBytecodeVersion:Number(u.stateTransitionBytecodeVersion)},commitBlockHeader:{id:p.id,daHeight:T(p.daHeight),transactionsCount:Number(p.transactionsCount),transactionsRoot:p.transactionsRoot,height:T(p.height),prevRoot:p.prevRoot,time:p.time,applicationHash:p.applicationHash,messageReceiptCount:Number(p.messageReceiptCount),messageOutboxRoot:p.messageOutboxRoot,consensusParametersVersion:Number(p.consensusParametersVersion),eventInboxRoot:p.eventInboxRoot,stateTransitionBytecodeVersion:Number(p.stateTransitionBytecodeVersion)},sender:new Te(g),recipient:new Te(A),nonce:r,amount:T(E),data:B}}async getLatestGasPrice(){let{latestGasPrice:t}=await this.operations.getLatestGasPrice();return T(t.gasPrice)}async estimateGasPrice(t){let{estimateGasPrice:r}=await this.operations.estimateGasPrice({blockHorizon:String(t)});return T(r.gasPrice)}async getMessageStatus(t){return(await this.operations.getMessageStatus({nonce:t})).messageStatus}async produceBlocks(t,r){let{produceBlocks:n}=await this.operations.produceBlocks({blocksToProduce:T(t).toString(10),startTimestamp:r?xl.fromUnixMilliseconds(r).toTai64():void 0});return T(n)}async isUserAccount(t){return await this.getAddressType(t)==="Account"}async getAddressType(t){let{contract:r,blob:n,transaction:i}=await this.operations.isUserAccount({blobId:t,contractId:t,transactionId:t});if(r)return"Contract";if(n)return"Blob";if(i)return"Transaction";try{if(await this.getAssetDetails(t))return"Asset"}catch{}return"Account"}async getTransactionResponse(t){let r=await this.getChainId();return new gb({transactionRequestOrId:t,provider:this,chainId:r})}async getMessageByNonce(t){let{message:r}=await this.operations.getMessageByNonce({nonce:t});return r?{messageId:za.getMessageId({sender:r.sender,recipient:r.recipient,nonce:t,amount:T(r.amount),data:r.data}),sender:new Te(r.sender),recipient:new Te(r.recipient),nonce:t,amount:T(r.amount),data:za.decodeData(r.data),daHeight:T(r.daHeight)}:null}async getRelayedTransactionStatus(t){let{relayedTransactionStatus:r}=await this.operations.getRelayedTransactionStatus({relayedTransactionId:t});return r||null}extractDryRunError(t,r,n){let i=[],a={},s;return t.type===Be.Script&&t.abis&&({logs:i,groupedLogs:a}=Kd({receipts:r,mainAbi:t.abis.main,externalAbis:t.abis.otherContractsAbis}),s=t.abis),J1({logs:i,groupedLogs:a,receipts:r,statusReason:n,abis:s})}async getNodeFeatures(){let{indexation:t}=await this.getNode();return{assetMetadata:!!t?.assetMetadata,balancesPagination:!!t?.balances,coinsToSpend:!!t?.coinsToSpend}}parseEstimatePredicatesResponse(t,{inputs:r}){return r&&r.forEach((n,i)=>{n&&"predicateGasUsed"in n&&T(n.predicateGasUsed).gt(0)&&(t.inputs[i].predicateGasUsed=n.predicateGasUsed)}),t}async adjustResourcesToIgnoreForAddresses(t,r){let n={messages:r?.messages?.map(i=>J(i))||[],utxos:r?.utxos?.map(i=>J(i))||[]};if(this.cache){let i=this.cache,a=t.map(u=>i.getActiveData(u)),{consensusParameters:{txParameters:{maxInputs:s}}}=await this.getChain(),d=s.toNumber();for(let u=0;u<a.length;u++){let p=n.utxos.length+n.messages.length;if(p>=d||(n.utxos=[...n.utxos,...a[u].utxos.slice(0,d-p)],p=n.utxos.length+n.messages.length,p>=d))break;n.messages=[...n.messages,...a[u].messages.slice(0,d-p)]}}return n}};async function VQ(e){let{id:t,provider:r,abiMap:n}=e,{transaction:i}=await r.operations.getTransactionWithReceipts({transactionId:t});if(!i)throw new I(x.TRANSACTION_NOT_FOUND,`Transaction not found for given id: ${t}.`);let[a]=new Br().decode(q(i.rawPayload),0),s=[];i?.status&&"receipts"in i.status&&(s=i.status.receipts);let d=s.map(xn),{consensusParameters:{feeParameters:{gasPerByte:u,gasPriceFactor:p},txParameters:{maxInputs:m,maxGasPerTx:g},gasCosts:A}}=await r.getChain(),B=DI(i.status)?T(0):await r.getLatestGasPrice(),L=await r.getBaseAssetId();return{..._p({id:i.id,receipts:d,transaction:a,transactionBytes:q(i.rawPayload),gqlTransactionStatus:i.status,gasPerByte:T(u),gasPriceFactor:T(p),abiMap:n,maxInputs:m,gasCosts:A,maxGasPerTx:g,gasPrice:B,baseAssetId:L})}}o(VQ,"getTransactionSummary");F(VQ,"getTransactionSummary");async function MQ(e){let{provider:t,transactionRequest:r,abiMap:n}=e,{receipts:i}=await t.dryRun(r),{gasPerByte:a,gasPriceFactor:s,gasCosts:d,maxGasPerTx:u}=await t.getGasConfig(),p=(await t.getChain()).consensusParameters.txParameters.maxInputs,m=r.toTransaction(),g=r.toTransactionBytes(),A=await t.getLatestGasPrice(),E=await t.getBaseAssetId();return _p({id:r.getTransactionId(await t.getChainId()),receipts:i,transaction:m,transactionBytes:g,abiMap:n,gasPerByte:a,gasPriceFactor:s,maxInputs:p,gasCosts:d,maxGasPerTx:u,gasPrice:A,baseAssetId:E})}o(MQ,"getTransactionSummaryFromRequest");F(MQ,"getTransactionSummaryFromRequest");async function UQ(e){let{filters:t,provider:r,abiMap:n}=e,{owner:i,...a}=t,s=zd({inputArgs:a,paginationLimit:VI}),{transactionsByOwner:d}=await r.operations.getTransactionsByOwner({...s,owner:i}),{edges:u,pageInfo:p}=d,{consensusParameters:{feeParameters:{gasPerByte:m,gasPriceFactor:g},txParameters:{maxInputs:A,maxGasPerTx:E},gasCosts:B}}=await r.getChain(),L=await r.getLatestGasPrice(),D=await r.getBaseAssetId();return{transactions:u.map(W=>{let{node:H}=W,{id:K,rawPayload:Y,status:X}=H,[j]=new Br().decode(q(Y),0),ue=[];H?.status&&"receipts"in H.status&&(ue=H.status.receipts);let U=ue.map(xn);return{..._p({id:K,receipts:U,transaction:j,transactionBytes:q(Y),gqlTransactionStatus:X,abiMap:n,gasPerByte:m,gasPriceFactor:g,maxInputs:A,gasCosts:B,maxGasPerTx:E,gasPrice:L,baseAssetId:D})}}),pageInfo:p}}o(UQ,"getTransactionsSummaries");F(UQ,"getTransactionsSummaries");var QQ=class{static{o(this,"AbstractAccount")}static{F(this,"AbstractAccount")}},GQ=[x.MAX_COINS_REACHED],U1=F(async e=>{let{error:t,account:r,skipAutoConsolidation:n=!1}=e;if(n)return!1;let i=I.parse(t);if(GQ.includes(i.code)){let{assetId:a,owner:s}=i.metadata;return r.startConsolidation({owner:s,assetId:a})}return!1},"consolidateCoinsIfRequired"),C4=F(async(e,t)=>{let r=[],n=!0,i;for(;n;){let{coins:a,pageInfo:s}=await e.getCoins(t,{after:i});r.push(...a),i=a.pop()?.id,n=s.hasNextPage}return{coins:r}},"getAllCoins"),wb=F(({coins:e})=>e.sort((t,r)=>r.amount.cmp(t.amount)),"sortCoins"),qQ=F(e=>{let{transactionId:t,outputs:r,baseAssetId:n}=e,i=r.findIndex(d=>d.type===ve.Change&&d.assetId===n);if(i===-1)throw new I(x.UNKNOWN,"No change output found");let a=r[i],s=Number(i).toString().padStart(4,"0");return{id:`${t}${s}`,assetId:a.assetId,amount:a.amount,owner:new Te(a.to),blockCreated:T(0),txCreatedIdx:T(0)}},"createOuputCoin"),JQ=F(async({account:e,assetId:t})=>{let r=await e.provider.getChain(),n=r.consensusParameters.chainId.toNumber(),i=await e.provider.estimateGasPrice(10),a=r.consensusParameters.txParameters.maxInputs.toNumber(),s=await e.provider.getBaseAssetId(),d=t===s,u=a,p=a,m=[],g=[];if(d){let L=await C4(e,s).then(wb);m=L.slice(0,p),g=L.slice(p)}else m=await C4(e,s).then(wb).then(L=>L.slice(0,p)),g=await C4(e,t).then(({coins:L})=>L);if(m.length===0)throw new I(x.INSUFFICIENT_FUNDS,`Insufficient funds to consolidate.
|
|
1324
1324
|
Asset ID: ${s}
|
|
1325
1325
|
Owner: ${e.address.toB256()}`);let E=[...Yl(u,m),...Yl(u-1,g)].map(L=>{let D=new Li({scriptData:"0x"});return D.addResources(L),D}),B=F(async(L={})=>{let D=[],Q;for(let W=0;W<E.length;W++){let H=E[W],K=W+1;if(Q){let ue=qQ({transactionId:Q.transactionId,outputs:Q.outputs,baseAssetId:s});H.addResource(ue)}"populateTransactionPredicateData"in e&&typeof e.populateTransactionPredicateData=="function"&&(H=e.populateTransactionPredicateData(H),H=await e.provider.estimatePredicates(H));let Y=ao({gasPrice:i,gas:H.calculateMinGas(r),priceFactor:r.consensusParameters.feeParameters.gasPriceFactor,tip:H.tip});H.maxFee=Y,H.gasLimit=T(1e3),L.onTransactionStart?.({tx:H,step:K,assetId:t,transactionId:H.getTransactionId(n)});let X=await e.sendTransaction(H),j=await X.waitForResult();D.push(j),Q={transactionId:X.id,outputs:j.transaction.outputs}}return{txResponses:D,errors:[]}},"submitAll");return{txs:E,totalFeeCost:E.reduce((L,D)=>L.add(D.maxFee),T(0)),submitAll:B}},"consolidateCoins"),zQ=F(e=>{let t=new le("u64");return e.reduce((r,n)=>{let{assetId:i,amount:a,contractId:s}=n,d=t.encode(a),u=ce([new Te(s).toBytes(),d,q(i)]);return ce([r,u])},new Uint8Array)},"formatTransferToContractScriptData"),WQ=F(async e=>{let t=zQ(e);await hn.initWasm();let r=new Uint8Array;return e.forEach((n,i)=>{let a=(vs+Ae+Ja)*i;r=ce([r,hn.gtf(16,0,hn.GTFArgs.ScriptData).to_bytes(),hn.addi(17,16,a).to_bytes(),hn.addi(18,17,vs).to_bytes(),hn.lw(19,18,0).to_bytes(),hn.addi(20,18,Ae).to_bytes(),hn.tr(17,19,20).to_bytes()])}),r=ce([r,hn.ret(1).to_bytes()]),{script:r,scriptData:t}},"assembleTransferToContractScript"),vb=F((e,t)=>{let r=Math.ceil(e.length/t),n=[];for(let i=0;i<r;i+=1){let a=i*t,s=(i+1)*t;n.push(e.slice(a,s))}return n},"splitCoinsIntoBatches"),HQ=5,Y1=class extends QQ{static{o(this,"Account")}static{F(this,"Account")}address;_provider;_connector;constructor(e,t,r){super(),this._provider=t,this._connector=r,this.address=new Te(e)}get provider(){if(!this._provider)throw new I(x.MISSING_PROVIDER,"Provider not set");return this._provider}set provider(e){this._provider=e}connect(e){return this._provider=e,this.provider}async getResourcesToSpend(e,t,{skipAutoConsolidation:r}={}){let n=F(()=>this.provider.getResourcesToSpend(this.address,e,t),"getResourcesToSpend");try{return await n()}catch(i){if(!await U1({error:i,account:this,skipAutoConsolidation:r}))throw i;return await n()}}async getCoins(e,t){return this.provider.getCoins(this.address,e,t)}async getMessages(e){return this.provider.getMessages(this.address,e)}async getBalance(e){let t=e??await this.provider.getBaseAssetId();return await this.provider.getBalance(this.address,t)}async getBalances(){return this.provider.getBalances(this.address)}async fund(e,t,{skipAutoConsolidation:r}={}){let{addedSignatures:n,estimatedPredicates:i,requiredQuantities:a,updateMaxFee:s,gasPrice:d,transactionSummary:u}=t,p=await this.provider.getChainId(),m=e.maxFee,g=await this.provider.getBaseAssetId(),A=a.find(K=>K.assetId===g)?.amount||T(0),E=PM({amount:T(m),assetId:g,coinQuantities:a}),B={};E.forEach(({amount:K,assetId:Y})=>{B[Y]={required:K,owned:T(0)}}),e.inputs.filter(Hd).forEach(K=>{let X=ba(K)?String(K.assetId):g;B[X]&&(B[X].owned=B[X].owned.add(K.amount))});let L=[];Object.entries(B).forEach(([K,{owned:Y,required:X}])=>{Y.lt(X)&&L.push({assetId:K,amount:X.sub(Y)})});let D=L.length>0,Q=0;for(;D&&Q<HQ;){let K=await this.getResourcesToSpend(L,AQ(e.inputs,this.address),{skipAutoConsolidation:r});e.addResources(K),e.updatePredicateGasUsed(i);let Y=pt(e);if(n&&Array.from({length:n}).forEach(()=>Y.addEmptyWitness()),!s){D=!1;break}let{maxFee:X}=await this.provider.estimateTxGasAndFee({transactionRequest:Y,gasPrice:d}),j=_Q(e.inputs.filter(Hd),g,g),ue=A.add(X);j.gt(ue)?D=!1:L=[{amount:ue.sub(j),assetId:g}],Q+=1}if(D)throw new I(x.INSUFFICIENT_FUNDS,`The account ${this.address} does not have enough base asset funds to cover the transaction execution.`);e.updateState(p,"funded",u),await this.provider.validateTransaction(e),e.updatePredicateGasUsed(i);let W=pt(e);if(n&&Array.from({length:n}).forEach(()=>W.addEmptyWitness()),!s)return e;let{maxFee:H}=await this.provider.estimateTxGasAndFee({transactionRequest:W,gasPrice:d});return e.maxFee=H,e}async createTransfer(e,t,r,n={},{skipAutoConsolidation:i}={}){let a=new Li(n);a=this.addTransfer(a,{destination:e,amount:t,assetId:r||await this.provider.getBaseAssetId()});let{gasPrice:s,transactionRequest:d}=await this.assembleTx({transactionRequest:a,skipAutoConsolidation:i});return a=await Go({gasPrice:s,provider:this.provider,transactionRequest:d,setGasLimit:n?.gasLimit,setMaxFee:n?.maxFee}),a}async transfer(e,t,r,n={},{skipAutoConsolidation:i}={}){let a=await this.createTransfer(e,t,r,n,{skipAutoConsolidation:i});return this.sendTransaction(a,{estimateTxDependencies:!1})}async batchTransfer(e,t={},{skipAutoConsolidation:r}={}){let n=new Li(t);n=this.addBatchTransfer(n,e);let{gasPrice:i,transactionRequest:a}=await this.assembleTx({transactionRequest:n,skipAutoConsolidation:r});return n=await Go({gasPrice:i,provider:this.provider,transactionRequest:a,setGasLimit:t?.gasLimit,setMaxFee:t?.maxFee}),this.sendTransaction(n,{estimateTxDependencies:!1})}addTransfer(e,t){let{destination:r,amount:n,assetId:i}=t;return this.validateTransferAmount(n),e.addCoinOutput(new Te(r),n,i),e}addBatchTransfer(e,t){return t.forEach(({destination:r,amount:n,assetId:i})=>{this.addTransfer(e,{destination:r,amount:n,assetId:i})}),e}async transferToContract(e,t,r,n={},{skipAutoConsolidation:i}={}){return this.batchTransferToContracts([{amount:t,assetId:r,contractId:e}],n,{skipAutoConsolidation:i})}async batchTransferToContracts(e,t={},{skipAutoConsolidation:r}={}){let n=new Li({...t}),i=[],a=await this.provider.getBaseAssetId(),s=e.map(g=>{let A=T(g.amount),E=new Te(g.contractId),B=g.assetId?J(g.assetId):a;if(A.lte(0))throw new I(x.INVALID_TRANSFER_AMOUNT,"Transfer amount must be a positive number.");return n.addContractInputAndOutput(E),i.push({amount:A,assetId:B}),{amount:A,contractId:E.toB256(),assetId:B}}),{script:d,scriptData:u}=await WQ(s);n.script=d,n.scriptData=u;let{gasPrice:p,transactionRequest:m}=await this.assembleTx({transactionRequest:n,quantities:i,skipAutoConsolidation:r});return n=await Go({gasPrice:p,provider:this.provider,transactionRequest:m,setGasLimit:t?.gasLimit,setMaxFee:t?.maxFee}),this.sendTransaction(n)}async withdrawToBaseLayer(e,t,r={},{skipAutoConsolidation:n}={}){let i=new Te(e),a=q("0x".concat(i.toHexString().substring(2).padStart(64,"0"))),s=q("0x".concat(T(t).toHex().substring(2).padStart(16,"0"))),u={script:new Uint8Array([...q(IQ.bytes),...a,...s]),...r},p=await this.provider.getBaseAssetId(),m=new Li(u),g=[{amount:T(t),assetId:p}],{gasPrice:A,transactionRequest:E}=await this.assembleTx({transactionRequest:m,quantities:g,skipAutoConsolidation:n});return m=await Go({gasPrice:A,provider:this.provider,transactionRequest:E,setGasLimit:r?.gasLimit,setMaxFee:r?.maxFee}),this.sendTransaction(m)}async startConsolidation(e){if(this._connector)return await this._connector.startConsolidation(e),!1;let{owner:t,assetId:r}=e;if(t!==this.address.toB256())return!1;let{submitAll:n}=await JQ({account:this,assetId:r});return await n(),!0}async consolidateCoins(e){let{assetId:t}=e,{coins:r}=await this.getCoins(t),i=await this.provider.getBaseAssetId()===t,a,s={assetId:t,coins:r,mode:e.mode,outputNum:e.outputNum};return i?{submitAll:a}=await this.assembleBaseAssetConsolidationTxs(s):{submitAll:a}=await this.assembleNonBaseAssetConsolidationTxs(s),a()}async assembleBaseAssetConsolidationTxs(e){let{coins:t,mode:r="parallel",outputNum:n=1}=e,i=await this.provider.getBaseAssetId();this.validateConsolidationTxsCoins(t,i);let a=await this.provider.getChain(),s=a.consensusParameters.txParameters.maxInputs.toNumber(),d=T(0),u=[],p=vb(t,s),m=await this.provider.estimateGasPrice(10),g=n>1;p.filter(E=>E.length>1).forEach(E=>{let B=new Li({script:"0x"});B.addResources(E),g&&Array.from({length:n-1}).forEach(()=>{B.addCoinOutput(this.address,0,i)});let L=B.calculateMinGas(a),D=ao({gasPrice:m,gas:L,priceFactor:a.consensusParameters.feeParameters.gasPriceFactor,tip:B.tip});if(B.maxFee=D,g){let W=B.inputs.filter(ba).reduce((H,K)=>H.add(K.amount),T(0)).div(n+1);B.outputs.forEach(H=>{H.type===ve.Coin&&(H.amount=W)})}d=d.add(D),u.push(B)});let A=this.prepareSubmitAll({txs:u,mode:r});return{txs:u,totalFeeCost:d,submitAll:A}}async assembleNonBaseAssetConsolidationTxs(e){let{assetId:t,coins:r,mode:n="parallel",outputNum:i=1}=e;this.validateConsolidationTxsCoins(r,t);let a=await this.provider.getChain(),s=a.consensusParameters.txParameters.maxInputs.toNumber(),d=a.consensusParameters.baseAssetId,{coins:u}=await this.provider.getCoins(this.address,d),p=T(0),m=[],g=await this.provider.estimateGasPrice(10),A=i>1,E=vb(r,s);E.filter(L=>L.length>1).forEach(L=>{let D=new Li({script:"0x"});D.addResources(L),A&&Array.from({length:i-1}).forEach(()=>{D.addCoinOutput(this.address,0,t)});let Q=D.calculateMinGas(a),W=ao({gasPrice:g,gas:Q,priceFactor:a.consensusParameters.feeParameters.gasPriceFactor,tip:D.tip});if(D.maxFee=W,A){let U=D.inputs.filter(ba).reduce((te,ne)=>te.add(ne.amount),T(0)).div(i+1);D.outputs.forEach(te=>{te.type===ve.Coin&&(te.amount=U)})}p=p.add(W);let H=[],K=T(0);for(;K.lt(W);){let ue=u.pop();if(!ue)break;H.push(ue),K=K.add(ue.amount)}let{inputs:Y}=D;D.inputs=Y.slice(0,s-H.length);let X=L.slice(s-H.length);D.addResources(H);let j=E[E.length-1];j.push(...X),j.length>s&&E.push(j.slice(s)),m.push(D)});let B=this.prepareSubmitAll({txs:m,mode:n});return{txs:m,totalFeeCost:p,submitAll:B}}prepareSubmitAll=F(e=>{let{txs:t,mode:r="sequential"}=e;return async()=>{let n=[],i=[];if(r==="sequential")for(let a of t)try{let d=await(await this.sendTransaction(a)).waitForResult();n.push(d)}catch(s){i.push(s)}else(await Promise.allSettled(t.map(async s=>(await this.sendTransaction(s)).waitForResult()))).forEach(s=>{s.status==="fulfilled"?n.push(s.value):i.push(s.reason)});return{txResponses:n,errors:i}}},"prepareSubmitAll");async getTransactionCost(e,{signatureCallback:t,quantities:r=[],gasPrice:n}={}){let i=pt(Tn(e)),a=await this.provider.getBaseAssetId(),s=i.getCoinOutputsQuantities(),d=fp(s,r),u=[{assetId:a,amount:T("100000000000000000")}],p=F(A=>i.inputs.find(E=>E.type===De.Coin?E.assetId===A:$b(E)?a===A:!1),"findAssetInput"),m=F((A,E)=>{let B=p(A),L=E;B&&"amount"in B?B.amount=L:i.addResources(this.generateFakeResources([{amount:E,assetId:A}]))},"updateAssetInput");return fp(d,u).forEach(({amount:A,assetId:E})=>m(E,A)),{...await this.provider.getTransactionCost(i,{signatureCallback:t,gasPrice:n}),requiredQuantities:d}}async signMessage(e){if(!this._connector)throw new I(x.MISSING_CONNECTOR,"A connector is required to sign messages.");return this._connector.signMessage(this.address.toString(),e)}async signTransaction(e,t={}){if(!this._connector)throw new I(x.MISSING_CONNECTOR,"A connector is required to sign transactions.");let r=Tn(e),{transactionRequest:n,connectorsSendTxParams:i}=await this.setTransactionStateForConnectors({transactionRequest:r,connectorOptions:t});return this._connector.signTransaction(this.address.toString(),n,i)}async sendTransaction(e,{estimateTxDependencies:t=!0,...r}={}){let n=Tn(e);if(this._connector){let i=await this.setTransactionStateForConnectors({transactionRequest:n,connectorOptions:r}),a=await this._connector.sendTransaction(this.address.toString(),i.transactionRequest,i.connectorsSendTxParams);return typeof a=="string"?this.provider.getTransactionResponse(a):a}return t&&await this.provider.estimateTxDependencies(n),this.provider.sendTransaction(n,{estimateTxDependencies:!1})}async simulateTransaction(e,{estimateTxDependencies:t=!0}={}){let r=Tn(e);return t&&await this.provider.estimateTxDependencies(r),this.provider.simulate(r,{estimateTxDependencies:!1})}generateFakeResources(e){return e.map(t=>({id:J(kr(ws)),owner:this.address,blockCreated:T(1),txCreatedIdx:T(1),...t}))}async prepareTransactionForSend(e){let{transactionId:t}=e.flag;if(!Jr(t))return e;let r=await this.provider.getChainId(),n=e.getTransactionId(r);return t!==n&&e.updateState(r),e}async prepareTransactionSummary(e){let t=await this.provider.getChainId();return Jr(e.flag.summary)?{...e.flag.summary,id:e.getTransactionId(t),transactionBytes:J(e.toTransactionBytes())}:void 0}async assembleTx(e){let{transactionRequest:t,quantities:r=[],skipAutoConsolidation:n}=e,i=t.outputs.filter(s=>s.type===ve.Coin).map(({amount:s,assetId:d})=>({assetId:String(d),amount:T(s)}));t.gasLimit=T(0),t.maxFee=T(0);let a=F(async()=>{let{assembledRequest:s,gasPrice:d}=await this.provider.assembleTx({request:t,accountCoinQuantities:fp(i,r),feePayerAccount:this});return{transactionRequest:s,gasPrice:d}},"assembleTx");try{return await a()}catch(s){if(!await U1({error:s,account:this,skipAutoConsolidation:n}))throw s;return await a()}}validateTransferAmount(e){if(T(e).lte(0))throw new I(x.INVALID_TRANSFER_AMOUNT,"Transfer amount must be a positive number.")}validateConsolidationTxsCoins(e,t){if(e.length<=1)throw new I(x.NO_COINS_TO_CONSOLIDATE,"No coins to consolidate.");if(!e.every(r=>r.assetId===t))throw new I(x.COINS_ASSET_ID_MISMATCH,"All coins to consolidate must be from the same asset id.")}async setTransactionStateForConnectors(e){let{transactionRequest:t,connectorOptions:r}=e,{onBeforeSend:n,skipCustomFee:i=!1}=r,a=await this.prepareTransactionForSend(t),s={onBeforeSend:n,skipCustomFee:i,provider:{url:this.provider.url,cache:await dQ(this.provider)},transactionState:t.flag.state,transactionSummary:await this.prepareTransactionSummary(t)};return{transactionRequest:a,connectorsSendTxParams:s}}},hp=class MI{static{o(this,"_Signer")}static{F(this,"Signer")}address;publicKey;compressedPublicKey;privateKey;constructor(t){typeof t=="string"&&t.match(/^[0-9a-f]*$/i)&&t.length===64&&(t=`0x${t}`);let r=qr(t,32);this.privateKey=J(r),this.publicKey=J(to.getPublicKey(r,!1).slice(1)),this.compressedPublicKey=J(to.getPublicKey(r,!0)),this.address=new Te(this.publicKey)}sign(t){let r=to.sign(q(t),q(this.privateKey)),n=qr(`0x${r.r.toString(16)}`,32),i=qr(`0x${r.s.toString(16)}`,32);return i[0]|=(r.recovery||0)<<7,J(ce([n,i]))}addPoint(t){let r=to.ProjectivePoint.fromHex(q(this.compressedPublicKey)),n=to.ProjectivePoint.fromHex(q(t));return`0x${r.add(n).toHex(!0)}`}static recoverPublicKey(t,r){let n=q(r),i=n.slice(0,32),a=n.slice(32,64),s=(a[0]&128)>>7;a[0]&=127;let u=new to.Signature(BigInt(J(i)),BigInt(J(a))).addRecoveryBit(s).recoverPublicKey(q(t)).toRawBytes(!1).slice(1);return J(u)}static recoverAddress(t,r){return new Te(MI.recoverPublicKey(t,r))}static generatePrivateKey(t){return t?zr(ce([kr(32),q(t)])):kr(32)}static extendPublicKey(t){let r=to.ProjectivePoint.fromHex(q(t));return J(r.toRawBytes(!1).slice(1))}},bb=13,Ib=8,Eb=1,O4=32,XQ=16,Tb=F(e=>/^0x/.test(e)?e.slice(2):e,"removeHexPrefix");async function UI(e,t,r){let n=qa(Tb(e),"hex"),i=new Te(t),a=kr(O4),s=Qh({password:qa(r),salt:a,dklen:O4,n:2**bb,r:Ib,p:Eb}),d=kr(XQ),u=await d7(n,s,d),p=Uint8Array.from([...s.subarray(16,32),...u]),m=Gh(p),g=Ed(m,"hex"),A={id:p7(),version:3,address:Tb(i.toHexString()),crypto:{cipher:"aes-128-ctr",mac:g,cipherparams:{iv:Ed(d,"hex")},ciphertext:Ed(u,"hex"),kdf:"scrypt",kdfparams:{dklen:O4,n:2**bb,p:Eb,r:Ib,salt:Ed(a,"hex")}}};return JSON.stringify(A)}o(UI,"encryptKeystoreWallet");F(UI,"encryptKeystoreWallet");async function QI(e,t){let r=JSON.parse(e),{crypto:{mac:n,ciphertext:i,cipherparams:{iv:a},kdfparams:{dklen:s,n:d,r:u,p,salt:m}}}=r,g=qa(i,"hex"),A=qa(a,"hex"),E=qa(m,"hex"),B=qa(t),L=Qh({password:B,salt:E,n:d,p,r:u,dklen:s}),D=Uint8Array.from([...L.subarray(16,32),...g]),Q=Gh(D),W=Ed(Q,"hex");if(n!==W)throw new I(x.INVALID_PASSWORD,"Failed to decrypt the keystore wallet, the provided password is incorrect.");let H=await s7(g,L,A);return J(H)}o(QI,"decryptKeystoreWallet");F(QI,"decryptKeystoreWallet");var ZQ=class extends Y1{static{o(this,"BaseWalletUnlocked")}static{F(this,"BaseWalletUnlocked")}static defaultPath="m/44'/1179993420'/0'/0/0";signer;constructor(e,t){let r=new hp(e);super(r.address,t),this.signer=()=>r}get privateKey(){return this.signer().privateKey}get publicKey(){return this.signer().publicKey}async signMessage(e){let t=await this.signer().sign(Jh(e));return J(t)}async signTransaction(e){let t=Tn(e),r=await this.provider.getChainId(),n=t.getTransactionId(r),i=await this.signer().sign(n);return J(i)}async populateTransactionWitnessesSignature(e){let t=Tn(e),r=await this.signTransaction(t);return t.updateWitnessByOwner(this.address,r),t}async sendTransaction(e,{estimateTxDependencies:t=!1,enableAssetBurn:r}={}){let n=Tn(e);return jb(await this.provider.getBaseAssetId(),n,r),t&&await this.provider.estimateTxDependencies(n),this.provider.sendTransaction(await this.populateTransactionWitnessesSignature(n),{estimateTxDependencies:!1,enableAssetBurn:r})}async simulateTransaction(e,{estimateTxDependencies:t=!0}={}){let r=Tn(e);return t&&await this.provider.estimateTxDependencies(r),this.provider.dryRun(await this.populateTransactionWitnessesSignature(r),{utxoValidation:!0,estimateTxDependencies:!1})}async encrypt(e){return UI(this.privateKey,this.address,e)}},P1=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];function GI(e){return(1<<e)-1}o(GI,"getLowerMask");F(GI,"getLowerMask");function r6(e){return(1<<e)-1<<8-e}o(r6,"getUpperMask");F(r6,"getUpperMask");function L1(e){return Array.isArray(e)?e:e.split(/\s+/)}o(L1,"getWords");F(L1,"getWords");function qI(e){return Array.isArray(e)?e.join(" "):e}o(qI,"getPhrase");F(qI,"getPhrase");function JI(e){let t=[0],r=11;for(let a=0;a<e.length;a+=1)r>8?(t[t.length-1]<<=8,t[t.length-1]|=e[a],r-=8):(t[t.length-1]<<=r,t[t.length-1]|=e[a]>>8-r,t.push(e[a]&GI(8-r)),r+=3);let n=e.length/4,i=q(ct(e))[0]&r6(n);return t[t.length-1]<<=n,t[t.length-1]|=i>>8-n,t}o(JI,"entropyToMnemonicIndices");F(JI,"entropyToMnemonicIndices");function zI(e,t){let r=Math.ceil(11*e.length/8),n=q(new Uint8Array(r)),i=0;for(let p=0;p<e.length;p+=1){let m=t.indexOf(e[p].normalize("NFKD"));if(m===-1)throw new I(x.INVALID_MNEMONIC,`Invalid mnemonic: the word '${e[p]}' is not found in the provided wordlist.`);for(let g=0;g<11;g+=1)m&1<<10-g&&(n[i>>3]|=1<<7-i%8),i+=1}let a=32*e.length/3,s=e.length/3,d=r6(s);if((q(ct(n.slice(0,a/8)))[0]&d)!==(n[n.length-1]&d))throw new I(x.INVALID_CHECKSUM,"Checksum validation failed for the provided mnemonic.");return n.slice(0,a/8)}o(zI,"mnemonicWordsToEntropy");F(zI,"mnemonicWordsToEntropy");var KQ=cn("Bitcoin seed"),$Q="0x0488ade4",YQ="0x04358394",Nb=[12,15,18,21,24];function F4(e){if(e.length!==2048)throw new I(x.INVALID_WORD_LIST,`Expected word list length of 2048, but got ${e.length}.`)}o(F4,"assertWordList");F(F4,"assertWordList");function WI(e){if(e.length%4!==0||e.length<16||e.length>32)throw new I(x.INVALID_ENTROPY,`Entropy should be between 16 and 32 bytes and a multiple of 4, but got ${e.length} bytes.`)}o(WI,"assertEntropy");F(WI,"assertEntropy");function F1(e){if(!Nb.includes(e.length)){let t=`Invalid mnemonic size. Expected one of [${Nb.join(", ")}] words, but got ${e.length}.`;throw new I(x.INVALID_MNEMONIC,t)}}o(F1,"assertMnemonic");F(F1,"assertMnemonic");var jQ=class Uo{static{o(this,"_Mnemonic")}static{F(this,"Mnemonic")}wordlist;constructor(t=P1){this.wordlist=t,F4(this.wordlist)}mnemonicToEntropy(t){return Uo.mnemonicToEntropy(t,this.wordlist)}entropyToMnemonic(t){return Uo.entropyToMnemonic(t,this.wordlist)}static mnemonicToEntropy(t,r=P1){let n=L1(t);return F1(n),J(zI(n,r))}static entropyToMnemonic(t,r=P1){let n=q(t);return F4(r),WI(n),JI(n).map(i=>r[i]).join(" ")}static mnemonicToSeed(t,r=""){F1(L1(t));let n=cn(qI(t)),i=cn(`mnemonic${r}`);return u7(n,i,2048,64,"sha512")}static mnemonicToMasterKeys(t,r=""){let n=Uo.mnemonicToSeed(t,r);return Uo.masterKeysFromSeed(n)}static isMnemonicValid(t){let r=L1(t),n=0;try{F1(r)}catch{return!1}for(;n<r.length;){if(Uo.binarySearch(r[n])===!1)return!1;n+=1}return!0}static binarySearch(t){let r=P1,n=0,i=r.length-1;for(;n<=i;){let a=Math.floor((n+i)/2);if(r[a]===t)return!0;t<r[a]?i=a-1:n=a+1}return!1}static masterKeysFromSeed(t){let r=q(t);if(r.length<16||r.length>64)throw new I(x.INVALID_SEED,`Seed length should be between 16 and 64 bytes, but received ${r.length} bytes.`);return q(Ql("sha512",KQ,r))}static seedToExtendedKey(t,r=!1){let n=Uo.masterKeysFromSeed(t),i=q(r?YQ:$Q),a="0x00",s="0x00000000",d="0x00000000",u=n.slice(32),p=n.slice(0,32),m=ce([i,a,s,d,u,ce(["0x00",p])]),g=_d(ct(ct(m)),0,4);return Uc(ce([m,g]))}static generate(t=32,r=""){let n=r?ct(ce([kr(t),q(r)])):kr(t);return Uo.entropyToMnemonic(n)}},n6=jQ,HI=2147483648,XI=J("0x0488ade4"),i6=J("0x0488b21e"),ZI=J("0x04358394"),a6=J("0x043587cf");function V4(e){return Uc(ce([e,_d(ct(ct(e)),0,4)]))}o(V4,"base58check");F(V4,"base58check");function KI(e=!1,t=!1){return e?t?a6:i6:t?ZI:XI}o(KI,"getExtendedKeyPrefix");F(KI,"getExtendedKeyPrefix");function $I(e){return[i6,a6].includes(J(e.slice(0,4)))}o($I,"isPublicExtendedKey");F($I,"isPublicExtendedKey");function YI(e){return[XI,ZI,i6,a6].includes(J(e.slice(0,4)))}o(YI,"isValidExtendedKey");F(YI,"isValidExtendedKey");function jI(e,t=0){let r=e.split("/");if(r.length===0||r[0]==="m"&&t!==0)throw new I(x.HD_WALLET_ERROR,`invalid path - ${e}`);return r[0]==="m"&&r.shift(),r.map(n=>~n.indexOf("'")?parseInt(n,10)+HI:parseInt(n,10))}o(jI,"parsePath");F(jI,"parsePath");var eG=class Wd{static{o(this,"_HDWallet")}static{F(this,"HDWallet")}depth=0;index=0;fingerprint=J("0x00000000");parentFingerprint=J("0x00000000");privateKey;publicKey;chainCode;constructor(t){if(t.privateKey){let r=new hp(t.privateKey);this.publicKey=J(r.compressedPublicKey),this.privateKey=J(t.privateKey)}else{if(!t.publicKey)throw new I(x.HD_WALLET_ERROR,"Both public and private Key cannot be missing. At least one should be provided.");this.publicKey=J(t.publicKey)}this.parentFingerprint=t.parentFingerprint||this.parentFingerprint,this.fingerprint=_d(c7(ct(this.publicKey)),0,4),this.depth=t.depth||this.depth,this.index=t.index||this.index,this.chainCode=t.chainCode}get extendedKey(){return this.toExtendedKey()}deriveIndex(t){let r=this.privateKey&&q(this.privateKey),n=q(this.publicKey),i=q(this.chainCode),a=new Uint8Array(37);if(t&HI){if(!r)throw new I(x.HD_WALLET_ERROR,"Cannot derive a hardened index without a private Key.");a.set(r,1)}else a.set(q(this.publicKey));a.set(qr(t,4),33);let s=q(Ql("sha512",i,a)),d=s.slice(0,32),u=s.slice(32);if(r){let A=T(d).add(r).mod("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141").toBytes(32);return new Wd({privateKey:A,chainCode:u,index:t,depth:this.depth+1,parentFingerprint:this.fingerprint})}let m=new hp(J(d)).addPoint(n);return new Wd({publicKey:m,chainCode:u,index:t,depth:this.depth+1,parentFingerprint:this.fingerprint})}derivePath(t){return jI(t,this.depth).reduce((n,i)=>n.deriveIndex(i),this)}toExtendedKey(t=!1,r=!1){if(this.depth>=256)throw new I(x.HD_WALLET_ERROR,`Exceeded max depth of 255. Current depth: ${this.depth}.`);let n=KI(this.privateKey==null||t,r),i=J(Uint8Array.from([this.depth])),a=this.parentFingerprint,s=ms(this.index,4),d=this.chainCode,u=this.privateKey!=null&&!t?ce(["0x00",this.privateKey]):this.publicKey,p=q(ce([n,i,a,s,d,u]));return V4(p)}static fromSeed(t){let r=n6.masterKeysFromSeed(t);return new Wd({chainCode:q(r.slice(32)),privateKey:q(r.slice(0,32))})}static fromExtendedKey(t){let r=J(qr(Rh(t))),n=q(r),i=V4(n.slice(0,78))===t;if(n.length!==82||!YI(n))throw new I(x.HD_WALLET_ERROR,"Provided key is not a valid extended key.");if(!i)throw new I(x.HD_WALLET_ERROR,"Provided key has an invalid checksum.");let a=n[4],s=J(n.slice(5,9)),d=parseInt(J(n.slice(9,13)).substring(2),16),u=J(n.slice(13,45)),p=n.slice(45,78);if(a===0&&s!=="0x00000000"||a===0&&d!==0)throw new I(x.HD_WALLET_ERROR,"Inconsistency detected: Depth is zero but fingerprint/index is non-zero.");if($I(n)){if(p[0]!==3)throw new I(x.HD_WALLET_ERROR,"Invalid public extended key.");return new Wd({publicKey:p,chainCode:u,index:d,depth:a,parentFingerprint:s})}if(p[0]!==0)throw new I(x.HD_WALLET_ERROR,"Invalid private extended key.");return new Wd({privateKey:p.slice(1),chainCode:u,index:d,depth:a,parentFingerprint:s})}},B4=eG,eE=class extends Y1{static{o(this,"WalletLocked")}static{F(this,"WalletLocked")}unlock(e){return new Ms(e,this._provider)}},Ms=class Qo extends ZQ{static{o(this,"_WalletUnlocked")}static{F(this,"WalletUnlocked")}lock(){return this.signer=()=>new hp("0x00"),new eE(this.address,this._provider)}static generate(t){let r=hp.generatePrivateKey(t?.entropy);return new Qo(r,t?.provider)}static fromSeed(t,r,n){let a=B4.fromSeed(t).derivePath(r||Qo.defaultPath);return new Qo(a.privateKey,n)}static fromMnemonic(t,r,n,i){let a=n6.mnemonicToSeed(t,n),d=B4.fromSeed(a).derivePath(r||Qo.defaultPath);return new Qo(d.privateKey,i)}static fromExtendedKey(t,r){let n=B4.fromExtendedKey(t);return new Qo(n.privateKey,r)}static async fromEncryptedJson(t,r,n){let i=await QI(t,r);return new Qo(i,n)}},Xn=class{static{o(this,"Wallet")}static{F(this,"Wallet")}static fromAddress(e,t){return new eE(e,t)}static fromPrivateKey(e,t){return new Ms(e,t)}static generate=Ms.generate;static fromSeed=Ms.fromSeed;static fromMnemonic=Ms.fromMnemonic;static fromExtendedKey=Ms.fromExtendedKey;static fromEncryptedJson=Ms.fromEncryptedJson},rG=class{static{o(this,"MemoryStorage")}static{F(this,"MemoryStorage")}storage=new Map;async getItem(e){return await this.storage.get(e)}async setItem(e,t){await this.storage.set(e,t)}async removeItem(e){await this.storage.delete(e)}async clear(){await this.storage.clear()}},nG=class{static{o(this,"MnemonicVault")}static{F(this,"MnemonicVault")}static type="mnemonic";#e;pathKey="{}";rootPath=`m/44'/1179993420'/${this.pathKey}'/0/0`;numberOfAccounts=0;constructor(e){this.#e=e.secret||n6.generate(),this.rootPath=e.rootPath||this.rootPath,this.numberOfAccounts=e.numberOfAccounts||1}getDerivePath(e){return this.rootPath.includes(this.pathKey)?this.rootPath.replace(this.pathKey,String(e)):`${this.rootPath}/${e}`}serialize(){return{secret:this.#e,rootPath:this.rootPath,numberOfAccounts:this.numberOfAccounts}}getAccounts(){let e=[],t=0;do{let r=Xn.fromMnemonic(this.#e,this.getDerivePath(t));e.push({publicKey:r.publicKey,address:r.address}),t+=1}while(t<this.numberOfAccounts);return e}addAccount(){this.numberOfAccounts+=1;let e=Xn.fromMnemonic(this.#e,this.getDerivePath(this.numberOfAccounts-1));return{publicKey:e.publicKey,address:e.address}}exportAccount(e){let t=0,r=new Te(e);do{let n=Xn.fromMnemonic(this.#e,this.getDerivePath(t));if(n.address.equals(r))return n.privateKey;t+=1}while(t<this.numberOfAccounts);throw new I(x.WALLET_MANAGER_ERROR,`Account with address '${e}' not found in derived wallets.`)}getWallet(e){let t=this.exportAccount(e);return Xn.fromPrivateKey(t)}},iG=class{static{o(this,"PrivateKeyVault")}static{F(this,"PrivateKeyVault")}static type="privateKey";#e=[];constructor(e={}){e.secret?this.#e=[e.secret]:this.#e=e.accounts||[Xn.generate().privateKey]}serialize(){return{accounts:this.#e}}getPublicAccount(e){let t=Xn.fromPrivateKey(e);return{address:t.address,publicKey:t.publicKey}}getAccounts(){return this.#e.map(e=>this.getPublicAccount(e))}addAccount(){let e=Xn.generate();return this.#e.push(e.privateKey),this.getPublicAccount(e.privateKey)}exportAccount(e){let t=new Te(e),r=this.#e.find(n=>Xn.fromPrivateKey(n).address.equals(t));if(!r)throw new I(x.WALLET_MANAGER_ERROR,`No private key found for address '${e}'.`);return r}getWallet(e){let t=this.exportAccount(e);return Xn.fromPrivateKey(t)}},io={invalid_vault_type:"The provided Vault type is invalid.",address_not_found:"No private key found for address the specified wallet address.",vault_not_found:"The specified vault was not found.",wallet_not_unlocked:"The wallet is currently locked.",passphrase_not_match:"The provided passphrase did not match the expected value."};function va(e,t){if(!e)throw new I(x.WALLET_MANAGER_ERROR,t)}o(va,"assert");F(va,"assert");var Mce=class tE extends tG{static{o(this,"_WalletManager")}static{F(this,"WalletManager")}static Vaults=[nG,iG];storage=new rG;STORAGE_KEY="WalletManager";#e=[];#r="";#t=!0;constructor(t){super(),this.storage=t?.storage||this.storage}get isLocked(){return this.#t}exportVault(t){va(!this.#t,io.wallet_not_unlocked);let r=this.#e.find((n,i)=>i===t);return va(r,io.vault_not_found),r.vault.serialize()}getVaults(){return this.#e.map((t,r)=>({title:t.title,type:t.type,vaultId:r}))}getAccounts(){return this.#e.flatMap((t,r)=>t.vault.getAccounts().map(n=>({...n,vaultId:r})))}getWallet(t){let r=new Te(t),n=this.#e.find(i=>i.vault.getAccounts().find(a=>a.address.equals(r)));return va(n,io.address_not_found),n.vault.getWallet(r)}exportPrivateKey(t){let r=new Te(t);va(!this.#t,io.wallet_not_unlocked);let n=this.#e.find(i=>i.vault.getAccounts().find(a=>a.address.equals(r)));return va(n,io.address_not_found),n.vault.exportAccount(r)}async addAccount(t){await this.loadState();let r=this.#e[t?.vaultId||0];await va(r,io.vault_not_found);let n=r.vault.addAccount();return await this.saveState(),n}async removeVault(t){this.#e.splice(t,1),await this.saveState()}async addVault(t){await this.loadState();let r=this.getVaultClass(t.type),n=new r(t);this.#e=this.#e.concat({title:t.title,type:t.type,vault:n}),await this.saveState()}lock(){this.#t=!0,this.#e=[],this.#r="",this.emit("lock")}async unlock(t){this.#r=t,this.#t=!1;try{await this.loadState(),this.emit("unlock")}catch(r){throw await this.lock(),r}}async updatePassphrase(t,r){let n=this.#t;await this.unlock(t),this.#r=r,await this.saveState(),await this.loadState(),n&&await this.lock()}async loadState(){await va(!this.#t,io.wallet_not_unlocked);let t=await this.storage.getItem(this.STORAGE_KEY);if(t){let r=await a7(this.#r,JSON.parse(t));this.#e=this.#i(r.vaults)}}async saveState(){await va(!this.#t,io.wallet_not_unlocked);let t=await o7(this.#r,{vaults:this.#n(this.#e)});await this.storage.setItem(this.STORAGE_KEY,JSON.stringify(t)),this.emit("update")}#n(t){return t.map(({title:r,type:n,vault:i})=>({title:r,type:n,data:i.serialize()}))}#i(t){return t.map(({title:r,type:n,data:i})=>{let a=this.getVaultClass(n);return{title:r,type:n,vault:new a(i)}})}getVaultClass(t){let r=tE.Vaults.find(n=>n.type===t);return va(r,io.invalid_vault_type),r}},Qce=class{static{o(this,"Vault")}static{F(this,"Vault")}static type;constructor(e){throw new I(x.NOT_IMPLEMENTED,"Not implemented.")}serialize(){throw new I(x.NOT_IMPLEMENTED,"Not implemented.")}getAccounts(){throw new I(x.NOT_IMPLEMENTED,"Not implemented.")}addAccount(){throw new I(x.NOT_IMPLEMENTED,"Not implemented.")}exportAccount(e){throw new I(x.NOT_IMPLEMENTED,"Not implemented.")}getWallet(e){throw new I(x.NOT_IMPLEMENTED,"Not implemented.")}},Gce=class{static{o(this,"StorageAbstract")}static{F(this,"StorageAbstract")}},aG=32,fn=16,ui=17,qd=18,oG=8,sG=8,dG=16;function rE(e){let[t]=new le("u64").decode(e,sG);return t.toNumber()}o(rE,"getBytecodeDataOffset");F(rE,"getBytecodeDataOffset");function j1(e){let[t]=new le("u64").decode(e,dG);return t.toNumber()}o(j1,"getBytecodeConfigurableOffset");F(j1,"getBytecodeConfigurableOffset");function nE(e){let t=j1(e),r=e.slice(0,t);return ct(r)}o(nE,"getBytecodeId");F(nE,"getBytecodeId");function uG(e){let t=rE(e),r=e.slice(0,t);return ct(r)}o(uG,"getLegacyBlobId");F(uG,"getLegacyBlobId");function iE(e,t){let{RegId:r,Instruction:n}=lt,i=r.pc().to_u8(),a=r.sp().to_u8(),s=r.is().to_u8(),d=F(L=>[lt.move_(fn,i),lt.addi(fn,fn,L*n.size()),lt.move_(ui,a),lt.bsiz(qd,fn),lt.ldc(fn,0,qd,1),lt.addi(fn,fn,aG),lt.lw(qd,fn,0),lt.addi(fn,fn,oG),lt.ldc(fn,0,qd,2),lt.sub(ui,ui,s),lt.divi(ui,ui,4),lt.jmp(ui)],"getInstructions"),u=F(L=>[lt.move_(fn,i),lt.addi(fn,fn,L*n.size()),lt.move_(ui,a),lt.bsiz(qd,fn),lt.ldc(fn,0,qd,1),lt.sub(ui,ui,s),lt.divi(ui,ui,4),lt.jmp(ui)],"getInstructionsNoDataSection"),p=j1(e);if(e.length<p)throw new Error(`Data section offset is out of bounds, offset: ${p}, binary length: ${e.length}`);let m=e.slice(p);if(m.length>0){let L=d(0).length;if(L>65535)throw new Error("Too many instructions, exceeding u16::MAX.");let D=new Uint8Array(d(L).flatMap(Y=>Array.from(Y.to_bytes()))),Q=new Uint8Array(t),W=new Uint8Array(8);new DataView(W.buffer).setBigUint64(0,BigInt(m.length),!1);let K=new Uint8Array([...D,...Q,...W]);return{loaderBytecode:ce([K,m]),blobOffset:K.length}}let g=u(0).length;if(g>65535)throw new Error("Too many instructions, exceeding u16::MAX.");let A=new Uint8Array(u(g).flatMap(L=>Array.from(L.to_bytes()))),E=new Uint8Array(t);return{loaderBytecode:new Uint8Array([...A,...E])}}o(iE,"getPredicateScriptLoaderInstructions");F(iE,"getPredicateScriptLoaderInstructions");async function aE(e,t){let{assembledRequest:r}=await e.provider.assembleTx({request:t,feePayerAccount:e,accountCoinQuantities:[]});return r}o(aE,"fundBlobTx");F(aE,"fundBlobTx");function oE(e,t){let{configurables:r}=e,n=[];return r.forEach(i=>{n.push({...i,offset:i.offset-t})}),{...e,configurables:n}}o(oE,"adjustConfigurableOffsets");F(oE,"adjustConfigurableOffsets");async function ef({deployer:e,bytecode:t,abi:r,loaderInstanceCallback:n}){let i=nE(q(t)),a=j1(q(t)),s=t.slice(0,a),d=new mp({blobId:i,witnessIndex:0,witnesses:[s]}),{loaderBytecode:u,blobOffset:p}=iE(q(t),q(i)),m=s.length-(p||0),g=oE(r,m),A=(await e.provider.getBlobs([i])).length>0,E=n(u,g);if(A)return{waitForResult:F(()=>Promise.resolve(E),"waitForResult"),blobId:i};let B=await aE(e,d);return{waitForResult:F(async()=>{try{if((await(await e.sendTransaction(B)).waitForResult()).status!=="success")throw new Error}catch{throw new I(x.TRANSACTION_FAILED,"Failed to deploy predicate chunk")}return E},"waitForResult"),blobId:i}}o(ef,"deployScriptOrPredicate");F(ef,"deployScriptOrPredicate");var cG=F(e=>{let r=q(e),n=Rl(r,16384),i=dp(n.map(s=>J(s)));return zr(ce(["0x4655454C",i]))},"getPredicateRoot"),tpe=class cp extends Y1{static{o(this,"_Predicate")}static{F(this,"Predicate")}bytes;predicateData=[];interface;initialBytecode;configurableConstants;constructor({bytecode:t,abi:r,provider:n,data:i,configurableConstants:a}){let{predicateBytes:s,predicateInterface:d}=cp.processPredicateData(t,r,a),u=new Te(cG(s));super(u,n),this.initialBytecode=q(t),this.bytes=s,this.interface=d,this.configurableConstants=a,i!==void 0&&i.length>0&&(this.predicateData=i)}populateTransactionPredicateData(t){let r=Tn(t),n=this.getIndexFromPlaceholderWitness(r);return n!==-1&&r.removeWitness(n),r.inputs.filter(W1).forEach(i=>{P4(i,this.address)&&(i.predicate=J(this.bytes),i.predicateData=J(this.getPredicateData()),i.witnessIndex=0)}),r}sendTransaction(t){let r=Tn(t);return super.sendTransaction(r,{estimateTxDependencies:!1})}simulateTransaction(t){let r=Tn(t);return super.simulateTransaction(r,{estimateTxDependencies:!1})}getPredicateData(){return this.predicateData.length?this.interface?.functions.main?.encodeArguments(this.predicateData)||new Uint8Array:new Uint8Array}toNewInstance(t={}){return new cp({bytecode:this.initialBytecode,abi:this.interface.jsonAbi,provider:this.provider,data:t.data??this.predicateData,configurableConstants:t.configurableConstants??this.configurableConstants})}setData(t){this.predicateData=t}static processPredicateData(t,r,n){let i=q(t),a=new Or(r);if(a.functions.main===void 0)throw new I(x.ABI_MAIN_METHOD_MISSING,'Cannot use ABI without "main" function.');return n&&Object.keys(n).length&&(i=cp.setConfigurableConstants(i,n,a)),{predicateBytes:i,predicateInterface:a}}async getResourcesToSpend(t,r){return(await this.provider.getResourcesToSpend(this.address,t,r)).map(i=>({...i,predicate:J(this.bytes),predicateData:J(this.getPredicateData())}))}generateFakeResources(t){return super.generateFakeResources(t).map(r=>({...r,predicate:J(this.bytes),predicateData:J(this.getPredicateData())}))}static setConfigurableConstants(t,r,n){let i=t;try{if(Object.keys(n.configurables).length===0)throw new I(x.INVALID_CONFIGURABLE_CONSTANTS,"Predicate has no configurable constants to be set");Object.entries(r).forEach(([a,s])=>{if(!n?.configurables[a])throw new I(x.CONFIGURABLE_NOT_FOUND,`No configurable constant named '${a}' found in the Predicate`);let{offset:d}=n.configurables[a],u=n.encodeConfigurable(a,s);i.set(u,d)})}catch(a){throw new I(x.INVALID_CONFIGURABLE_CONSTANTS,`Error setting configurable constants: ${a.message}.`)}return i}getIndexFromPlaceholderWitness(t){let r=t.inputs.filter(Hd).filter(a=>P4(a,this.address)),n=-1,i=r.find(a=>!a.predicate);return i&&(n=i.witnessIndex,r.every(s=>!s.predicate)||r[0]?.predicate&&(n=-1)),n}async deploy(t){return ef({deployer:t,abi:this.interface.jsonAbi,bytecode:this.bytes,loaderInstanceCallback:F((r,n)=>new cp({bytecode:r,abi:n,provider:this.provider,data:this.predicateData}),"loaderInstanceCallback")})}},sE=(e=>(e.ping="ping",e.version="version",e.connect="connect",e.disconnect="disconnect",e.isConnected="isConnected",e.accounts="accounts",e.currentAccount="currentAccount",e.signTransaction="signTransaction",e.signMessage="signMessage",e.sendTransaction="sendTransaction",e.assets="assets",e.addAsset="addAsset",e.addAssets="addAssets",e.networks="networks",e.currentNetwork="currentNetwork",e.addNetwork="addNetwork",e.selectNetwork="selectNetwork",e.addABI="addABI",e.getABI="getABI",e.hasABI="hasABI",e.startConsolidation="startConsolidation",e))(sE||{}),o6=(e=>(e.connectors="connectors",e.currentConnector="currentConnector",e.connection="connection",e.accounts="accounts",e.currentAccount="currentAccount",e.networks="networks",e.currentNetwork="currentNetwork",e.assets="assets",e.abis="abis",e.consolidateCoins="consolidateCoins",e))(o6||{}),dE="FuelConnector",lG=class{static{o(this,"LocalStorage")}static{F(this,"LocalStorage")}storage;constructor(e){this.storage=e}async setItem(e,t){this.storage.setItem(e,t)}async getItem(e){return this.storage.getItem(e)}async removeItem(e){this.storage.removeItem(e)}async clear(){this.storage.clear()}},fG=class extends pG{static{o(this,"FuelConnector")}static{F(this,"FuelConnector")}name="";metadata={};connected=!1;installed=!1;external=!0;events=o6;async ping(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async version(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async isConnected(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async accounts(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async connect(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async disconnect(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async signMessage(e,t){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async signTransaction(e,t,r){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async sendTransaction(e,t,r){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async currentAccount(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async addAssets(e){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async addAsset(e){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async assets(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async addNetwork(e){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async selectNetwork(e){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async networks(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async currentNetwork(){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async addABI(e,t){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async getABI(e){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async hasABI(e){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}async startConsolidation(e){throw new I(I.CODES.NOT_IMPLEMENTED,"Method not implemented.")}on(e,t){return super.on(e,t),this}};function uE(e,{cache:t,cacheTime:r,key:n}){return async(...i)=>{if(t[n]&&t[n]?.value)return t[n]?.value;clearTimeout(t[n]?.timeout);let a=await e(...i);return t[n]={timeout:Number(setTimeout(()=>{t[n]=null},r)),value:a},a}}o(uE,"cacheFor");F(uE,"cacheFor");function mG(e){window.dispatchEvent(new CustomEvent(dE,{detail:e}))}o(mG,"dispatchFuelConnectorEvent");F(mG,"dispatchFuelConnectorEvent");function cE(){let e={};return e.promise=new Promise((t,r)=>{e.reject=r,e.resolve=t}),e}o(cE,"deferPromise");F(cE,"deferPromise");async function pp(e,t=1050){let r=new Promise((n,i)=>{setTimeout(()=>{i(new I(I.CODES.TIMEOUT_EXCEEDED,"Promise timed out"))},t)});return Promise.race([r,e])}o(pp,"withTimeout");F(pp,"withTimeout");var hG=2e3,gG=5e3,{warn:_G}=console,ope=class lp extends fG{static{o(this,"_Fuel")}static{F(this,"Fuel")}static STORAGE_KEY="fuel-current-connector";static defaultConfig={};_storage=null;_connectors=[];_targetObject=null;_unsubscribes=[];_targetUnsubscribe=F(()=>{},"_targetUnsubscribe");_pingCache={};_currentConnector;_initializationPromise=null;constructor(t=lp.defaultConfig){super(),this.setMaxListeners(1e3),this._connectors=t.connectors??[],this._targetObject=this.getTargetObject(t.targetObject),this._storage=t.storage===void 0?this.getStorage():t.storage,this.setupMethods(),this._initializationPromise=this.initialize()}async initialize(){try{let t=this.setDefaultConnector();this._targetUnsubscribe=this.setupConnectorListener(),await t}catch{throw new I(x.INVALID_PROVIDER,"Error initializing Fuel Connector")}}async init(){return await this._initializationPromise,this}getTargetObject(t){return t||(typeof window<"u"?window:typeof document<"u"?document:null)}getStorage(){if(typeof window<"u")return new lG(window.localStorage)}async setDefaultConnector(){let t=await this._storage?.getItem(lp.STORAGE_KEY)||this._connectors[0]?.name;if(t)return this.selectConnector(t,{emitEvents:!1})}setupConnectorEvents(t){if(!this._currentConnector)return;let r=this._currentConnector;this._unsubscribes.map(n=>n()),this._unsubscribes=t.map(n=>{let i=F((...a)=>this.emit(n,...a),"handler");return r.on(n,i),()=>r.off(n,i)})}async callMethod(t,...r){let n=await this.hasConnector();if(await this.pingConnector(),!this._currentConnector||!n)throw new I(x.MISSING_CONNECTOR,`No connector selected for calling ${t}. Use hasConnector before executing other methods.`);if(typeof this._currentConnector[t]=="function")return this._currentConnector[t](...r)}setupMethods(){Object.values(sE).forEach(t=>{this[t]=async(...r)=>this.callMethod(t,...r)})}async fetchConnectorStatus(t){let r=Date.now(),[n,i]=await Promise.allSettled([pp(t.isConnected()),pp(this.pingConnector(t))]);return r<(t._latestUpdate||0)||(t._latestUpdate=Date.now(),t.installed=i.status==="fulfilled"&&i.value,t.connected=n.status==="fulfilled"&&n.value),{installed:t.installed,connected:t.connected}}async fetchConnectorsStatus(){return Promise.all(this._connectors.map(async t=>this.fetchConnectorStatus(t)))}async pingConnector(t){let r=t||this._currentConnector;if(!r)return!1;try{return await uE(async()=>pp(r.ping()),{key:r.name,cache:this._pingCache,cacheTime:gG})()}catch{throw new I(x.INVALID_PROVIDER,"Current connector is not available.")}}setupConnectorListener=F(()=>{let{_targetObject:t}=this,r=dE;if(t?.on)return t.on(r,this.addConnector),()=>{t.off?.(r,this.addConnector)};if(t?.addEventListener){let n=F(i=>{this.addConnector(i.detail)},"handler");return t.addEventListener(r,n),()=>{t.removeEventListener?.(r,n)}}return()=>{}},"setupConnectorListener");addConnector=F(async t=>{this.getConnector(t)||this._connectors.push(t),await this.fetchConnectorStatus(t),this.emit(this.events.connectors,this._connectors),this._currentConnector||await this.selectConnector(t.name,{emitEvents:!1})},"addConnector");triggerConnectorEvents=F(async()=>{let[t,r,n]=await Promise.all([this.isConnected(),this.networks(),this.currentNetwork()]);if(this.emit(this.events.connection,t),this.emit(this.events.networks,r),this.emit(this.events.currentNetwork,n),t){let[i,a]=await Promise.all([this.accounts(),this.currentAccount()]);this.emit(this.events.accounts,i),this.emit(this.events.currentAccount,a)}},"triggerConnectorEvents");getConnector=F(t=>this._connectors.find(r=>{let n=typeof t=="string"?t:t.name;return r.name===n||r===t})||null,"getConnector");async connectors(){return await this.fetchConnectorsStatus(),this._connectors}async selectConnector(t,r={emitEvents:!0}){let n=this.getConnector(t);if(!n)return!1;if(this._currentConnector?.name===t)return!0;let{installed:i}=await this.fetchConnectorStatus(n);return i?(this._currentConnector=n,this.emit(this.events.currentConnector,n),this.setupConnectorEvents(Object.values(o6)),await this._storage?.setItem(lp.STORAGE_KEY,n.name),r.emitEvents&&this.triggerConnectorEvents(),!0):!1}currentConnector(){return this._currentConnector}async hasConnector(){if(this._currentConnector)return!0;let t=cE();return this.once(this.events.currentConnector,()=>{t.resolve(!0)}),pp(t.promise,hG).then(()=>!0).catch(()=>!1)}async hasWallet(){return this.hasConnector()}async getProvider(t){return _G("getProvider is deprecated and is going to be removed in the future, use getWallet instead."),this._getProvider(t)}async _getProvider(t){let r;if(t&&"getTransactionResponse"in t)r=t;else if(t&&"chainId"in t&&"url"in t)r=new yb(t.url);else{if(t)throw new I(x.INVALID_PROVIDER,"Provider is not valid.");{let n=await this.currentNetwork();r=new yb(n.url)}}return r}async getWallet(t,r){let n=await this._getProvider(r);return new Y1(t,n,this)}unsubscribe(){this._unsubscribes.map(t=>t()),this._targetUnsubscribe(),this.removeAllListeners()}async clean(){await this._storage?.removeItem(lp.STORAGE_KEY)}async destroy(){this.unsubscribe(),await this.clean()}};var pE=xr(ls(),1);var sn=xr(ls(),1);var AG=Object.defineProperty,Xe=o((e,t)=>AG(e,"name",{value:t,configurable:!0}),"__name"),c6=class{static{o(this,"AbstractProgram")}static{Xe(this,"AbstractProgram")}},Ope=class extends c6{static{o(this,"AbstractContract")}static{Xe(this,"AbstractContract")}};function d6(e,t){if(!e)throw new I(x.TRANSACTION_ERROR,t)}o(d6,"assert");Xe(d6,"assert");function tf(e){return e.reduce((t,r,n)=>{let{program:i,externalAbis:a}=r.getCallConfig();return n===0?(t.main=i.interface.jsonAbi,t.otherContractsAbis={}):t.otherContractsAbis[i.id.toB256()]=i.interface.jsonAbi,t.otherContractsAbis={...t.otherContractsAbis,...a},t},{})}o(tf,"getAbisFromAllCalls");Xe(tf,"getAbisFromAllCalls");var p6=Xe(e=>{let{receipts:t,mainCallConfig:r,functionScopes:n}=e;if(!r)return{logs:[],groupedLogs:{}};let{main:i,otherContractsAbis:a}=tf(n);return Kd({receipts:t,mainAbi:i,externalAbis:a})},"getAllResultLogs"),rf=class{static{o(this,"InstructionSet")}static{Xe(this,"InstructionSet")}#e;constructor(...e){this.#e=e||[]}entries(){return this.#e}push(...e){this.#e.push(...e)}concat(e){return this.#e.concat(e)}extend(e){this.#e.push(...e)}toBytes(){return ce(this.#e.reduce((e,t)=>(e.push(t.to_bytes()),e),[]))}toHex(){return J(this.toBytes())}toString(){return`Program:
|
|
1326
|
-
${JSON.stringify(this.#e,null,2)}`}byteLength(){return this.toBytes().byteLength}},yG=Xe(e=>Kh+Zh({maxInputs:e}),"calculateScriptDataBaseOffset"),jpe=Ae+Ja+vs+Ae+Ae;function lE(e){let t=[...e.receipts],r,n;if(t.forEach(a=>{a.type===be.ScriptResult?r=a:(a.type===be.Return||a.type===be.ReturnData||a.type===be.Revert)&&(n=a)}),!r||!n)throw new I(x.SCRIPT_REVERTED,"Transaction reverted.");return{code:r.result,gasUsed:r.gasUsed,receipts:t,scriptResultReceipt:r,returnReceipt:n,callResult:e}}o(lE,"callResultToScriptResult");Xe(lE,"callResultToScriptResult");function nf(e){let{callResult:t,scriptResultDecoder:r,logs:n=[],groupedLogs:i={},abis:a}=e;try{let s=lE(t);return r(s)}catch(s){if(s.code===x.SCRIPT_REVERTED){let d=t?.dryRunStatus?.reason;throw J1({logs:n,groupedLogs:i,receipts:t.receipts,statusReason:d,abis:a})}throw s}}o(nf,"decodeCallResult");Xe(nf,"decodeCallResult");function fE(e){let{callResult:t,call:r,logs:n=[],groupedLogs:i={},abis:a}=e;return nf({callResult:t,scriptResultDecoder:Xe(s=>{if(s.returnReceipt.type===be.Revert)throw new I(x.SCRIPT_REVERTED,`Script Reverted. Logs: ${JSON.stringify(n)}`);if(s.returnReceipt.type!==be.Return&&s.returnReceipt.type!==be.ReturnData){let{type:u}=s.returnReceipt;throw new I(x.SCRIPT_REVERTED,`Script Return Type [${u}] Invalid. Logs: ${JSON.stringify({logs:n,groupedLogs:i,receipt:s.returnReceipt})}`)}let d;return s.returnReceipt.type===be.Return&&(d=s.returnReceipt.val),s.returnReceipt.type===be.ReturnData&&(d=r.func.decodeOutput(s.returnReceipt.data)[0]),d},"scriptResultDecoder"),logs:n,groupedLogs:i,abis:a})}o(fE,"callResultToInvocationResult");Xe(fE,"callResultToInvocationResult");var Ap=class mE{static{o(this,"_ScriptRequest")}static{Xe(this,"ScriptRequest")}bytes;scriptDataEncoder;scriptResultDecoder;constructor(t,r,n){this.bytes=q(t),this.scriptDataEncoder=r,this.scriptResultDecoder=n}static getScriptDataOffsetWithScriptBytes(t,r){return Zh({maxInputs:r})+Kh+t}getScriptDataOffset(t){return mE.getScriptDataOffsetWithScriptBytes(this.bytes.length,t)}encodeScriptData(t){let r=this.scriptDataEncoder(t);return ArrayBuffer.isView(r)?r:(this.bytes=q(r.script),r.data)}decodeCallResult(t,r,n,i){let a,s,d,u;return typeof t=="object"&&"callResult"in t?(a=t.callResult,s=t.logs??[],d=t.groupedLogs??{},u=t.abis):(a=t,s=r??[],d=n??{},u=i),nf({callResult:a,scriptResultDecoder:this.scriptResultDecoder,logs:s,groupedLogs:d,abis:u})}},hE={assetIdOffset:0,amountOffset:0,gasForwardedOffset:0,callDataOffset:0},wG=Le,gE=Xe(({callDataOffset:e,gasForwardedOffset:t,amountOffset:r,assetIdOffset:n})=>{let i=new rf(sn.movi(16,e),sn.movi(17,r),sn.lw(17,17,0),sn.movi(18,n));return t?i.push(sn.movi(19,t),sn.lw(19,19,0),sn.call(16,17,18,19)):i.push(sn.call(16,17,18,sn.RegId.cgas().to_u8())),i},"getSingleCallInstructions");function u6(e){if(!e.length)return new Uint8Array;let t=new rf;for(let r=0;r<e.length;r+=1)t.extend(gE(e[r]).entries());return t.push(sn.ret(1)),t.toBytes()}o(u6,"getInstructions");Xe(u6,"getInstructions");var vG=Xe(e=>e===be.Return||e===be.ReturnData,"isReturnType"),bG=Xe((e,t)=>e.find(({type:r,id:n,to:i})=>r===be.Call&&n===wG&&i===t),"getMainCallReceipt"),IG=Xe(e=>t=>{if(Un(t.code)!==0)throw new I(x.SCRIPT_REVERTED,"Transaction reverted.");let r=bG(t.receipts,e.toB256()),n=T(r?.is);return t.receipts.filter(({type:a})=>vG(a)).flatMap(a=>n.eq(T(a.is))?a.type===be.Return?[new le("u64").encode(a.val)]:a.type===be.ReturnData?[q(a.data)]:[new Uint8Array]:[])},"scriptResultDecoder"),EG=Xe(e=>{let{contractId:t,...r}=e;return nf({...r,scriptResultDecoder:IG(t)})},"decodeContractCallScriptResult"),TG=Xe(e=>e.reduce((t,r)=>{let n={...hE};return r.gas&&(n.gasForwardedOffset=1),t+gE(n).byteLength()},sn.Instruction.size()),"getCallInstructionsLength"),NG=Xe((e,t)=>new Ap(u6(new Array(e.length).fill(hE)),r=>{let n=r.length;if(n===0)return{data:new Uint8Array,script:new Uint8Array};let i=TG(r),a=(8-i%8)%8,s=i+a,d=yG(t.toNumber())+s,u=[],p=d,m=[];for(let E=0;E<n;E+=1){let B=r[E],L=p,D=L+Ae,Q=D+Ja,W=Q+vs+Ae+Ae,H=W+B.fnSelectorBytes.byteLength,K=q(B.data),Y=0;m.push(new le("u64").encode(B.amount||0)),m.push(new he().encode(B.assetId?.toString()||Le)),m.push(B.contractId.toBytes()),m.push(new le("u64").encode(W)),m.push(new le("u64").encode(H)),m.push(B.fnSelectorBytes),m.push(K),B.gas&&(m.push(new le("u64").encode(B.gas)),Y=H+K.byteLength);let X={amountOffset:L,assetIdOffset:D,gasForwardedOffset:Y,callDataOffset:Q};u.push(X),p=d+ce(m).byteLength}let g=u6(u);return{data:ce(m),script:g}},()=>[new Uint8Array]),"getContractCallScript");function af(e,t,r,n,i,a){let s,d,u,p,m,g;typeof e=="object"&&!Array.isArray(e)?(s=e.functionScopes,d=e.receipts,u=e.isMultiCall,p=e.logs??[],m=e.groupedLogs??{},g=e.abis):(s=e,d=t,u=r,p=n??[],m=i??{},g=a);let A=s[0]?.getCallConfig();if(s.length===1&&A&&"bytes"in A.program)return fE({callResult:{receipts:d},call:A,logs:p,groupedLogs:m,abis:g});let B=EG({callResult:{receipts:d},contractId:(A?.program).id,logs:p,groupedLogs:m,abis:g}).map((L,D)=>{let{func:Q}=s[D].getCallConfig();return Q.decodeOutput(L)?.[0]});return u?B:B?.[0]}o(af,"extractInvocationResult");Xe(af,"extractInvocationResult");var SG=Xe(async e=>{let{funcScope:t,isMultiCall:r,program:n,transactionResponse:i}=e,a=await i.waitForResult(),{receipts:s}=a,d=Array.isArray(t)?t:[t],u=d[0]?.getCallConfig(),{main:p,otherContractsAbis:m}=tf(d),g={main:p,otherContractsAbis:m},{logs:A,groupedLogs:E}=p6({receipts:s,mainCallConfig:u,functionScopes:d}),B=af(d,s,r,A,E,g),L=Qs(s);return{isMultiCall:r,functionScopes:d,value:B,program:n,transactionResult:a,transactionResponse:i,transactionId:i.id,logs:A,groupedLogs:E,gasUsed:L}},"buildFunctionResult"),CG=Xe(async e=>{let{funcScope:t,isMultiCall:r,program:n,transactionResponse:i}=e,a=await i.waitForPreConfirmation(),{receipts:s}=a,d=Array.isArray(t)?t:[t],u=d[0]?.getCallConfig(),p,m,g,A;return s&&({logs:p,groupedLogs:m}=p6({receipts:s,mainCallConfig:u,functionScopes:d}),A=af(d,s,r,p,m),g=Qs(s)),{isMultiCall:r,functionScopes:d,program:n,transactionResult:a,transactionResponse:i,transactionId:i.id,logs:p,groupedLogs:m,gasUsed:g,value:A}},"buildPreConfirmationFunctionResult"),s6=Xe(e=>{let{funcScopes:t,callResult:r,isMultiCall:n}=e,{receipts:i}=r,a=Array.isArray(t)?t:[t],s=a[0]?.getCallConfig(),{logs:d,groupedLogs:u}=p6({receipts:i,mainCallConfig:s,functionScopes:a}),p=af(a,i,n,d,u),m=Qs(i);return{functionScopes:a,callResult:r,isMultiCall:n,gasUsed:m,value:p}},"buildDryRunResult");function _E(e){let{program:t,args:r,forward:n,func:i,callParameters:a,externalAbis:s}=e.getCallConfig(),d=i.encodeArguments(r);return{contractId:t.id,fnSelectorBytes:i.selectorBytes,data:d,assetId:n?.assetId,amount:n?.amount,gas:a?.gasLimit,externalContractsAbis:s}}o(_E,"createContractCall");Xe(_E,"createContractCall");var AE=class{static{o(this,"BaseInvocationScope")}static{Xe(this,"BaseInvocationScope")}transactionRequest;program;functionInvocationScopes=[];txParameters;assembleTxParameters;requiredCoins=[];isMultiCall=!1;hasCallParamsGasLimit=!1;externalAbis={};addSignersCallback;constructor(e,t){this.program=e,this.isMultiCall=t,this.transactionRequest=new Li}get calls(){return this.functionInvocationScopes.map(e=>_E(e))}async updateScriptRequest(){let e=this.getProvider(),{consensusParameters:{txParameters:{maxInputs:t}}}=await e.getChain(),r=NG(this.functionInvocationScopes,t);this.transactionRequest.setScript(r,this.calls)}updateContractInputAndOutput(){this.calls.forEach(t=>{t.contractId&&this.transactionRequest.addContractInputAndOutput(t.contractId),t.externalContractsAbis&&Object.keys(t.externalContractsAbis).forEach(r=>this.transactionRequest.addContractInputAndOutput(new Te(r)))})}getRequiredCoins(){return this.calls.map(t=>({assetId:String(t.assetId),amount:T(t.amount||0)})).filter(({assetId:t,amount:r})=>t&&!T(r).isZero())}updateRequiredCoins(){let e=this.getRequiredCoins(),t=Xe((r,{assetId:n,amount:i})=>{let a=r.get(n)?.amount||T(0);return r.set(n,{assetId:String(n),amount:a.add(i)})},"reduceForwardCoins");this.requiredCoins=Array.from(e.reduce(t,new Map).values())}addCall(e){return this.addCalls([e]),this}addCalls(e){return this.functionInvocationScopes.push(...e),this.updateContractInputAndOutput(),this.updateRequiredCoins(),this}async prepareTransaction(){await pE.initWasm(),await this.updateScriptRequest(),this.updateRequiredCoins(),this.checkGasLimitTotal(),this.transactionRequest.type===Be.Script&&(this.transactionRequest.abis=tf(this.functionInvocationScopes))}checkGasLimitTotal(){let e=this.calls.reduce((t,r)=>t.add(r.gas||0),T(0));if(this.transactionRequest.gasLimit.eq(0))this.transactionRequest.gasLimit=e;else if(e.gt(this.transactionRequest.gasLimit))throw new I(x.TRANSACTION_ERROR,"Transaction's gasLimit must be equal to or greater than the combined forwarded gas of all calls.")}async getTransactionCost(){let e=pt(await this.getTransactionRequest());return(this.program.account??Xn.generate({provider:this.getProvider()})).getTransactionCost(e,{quantities:this.getRequiredCoins(),signatureCallback:this.addSignersCallback})}async fundWithRequiredCoins({skipAutoConsolidation:e}={}){let t=await this.getTransactionRequest();t=pt(t);let{feePayerAccount:r,accountCoinQuantities:n,...i}=this.assembleTxParameters??{};t.maxFee=T(0),t.gasLimit=T(0);let a=this.getProvider(),s=this.program.account??Xn.generate({provider:a}),d=await a.getBaseAssetId();if(r||(r=s),!n){let p=t.outputs.filter(m=>m.type===ve.Coin).map(({amount:m,assetId:g})=>({assetId:String(g),amount:T(m)}));n=fp(p,this.requiredCoins),n.length||n.push({assetId:d,amount:T(0)})}let u=Xe(async()=>{let{assembledRequest:p,gasPrice:m}=await a.assembleTx({request:t,feePayerAccount:r,accountCoinQuantities:n,...i});return await Go({gasPrice:m,provider:a,transactionRequest:p,setGasLimit:this.txParameters?.gasLimit,setMaxFee:this.txParameters?.maxFee}),p},"assembleTx");try{return await u()}catch(p){if(!await U1({error:p,account:s,skipAutoConsolidation:e}))throw p;return await u()}}async legacyFundWithRequiredCoins({skipAutoConsolidation:e}={}){let t=await this.getTransactionRequest();t=pt(t);let r=await this.getTransactionCost(),{gasUsed:n,missingContractIds:i,outputVariables:a,maxFee:s}=r;return this.setDefaultTxParams(t,n,s),i.forEach(d=>{t.addContractInputAndOutput(new Te(d))}),t.addVariableOutputs(a),await this.program.account?.fund(t,r,{skipAutoConsolidation:e}),this.addSignersCallback&&await this.addSignersCallback(t),t}txParams(e){this.txParameters=e;let t=this.transactionRequest;return t.tip=T(e.tip||t.tip),t.gasLimit=T(e.gasLimit||t.gasLimit),t.maxFee=e.maxFee?T(e.maxFee):t.maxFee,t.witnessLimit=e.witnessLimit?T(e.witnessLimit):t.witnessLimit,t.maturity=e.maturity||t.maturity,t.expiration=e.expiration||t.expiration,t.addVariableOutputs(this.txParameters?.variableOutputs||0),this}assembleTxParams(e){return this.assembleTxParameters=e,this}addContracts(e){return e.forEach(t=>{typeof t=="string"?this.transactionRequest.addContractInputAndOutput(new Te(t)):(this.transactionRequest.addContractInputAndOutput(t.id),this.externalAbis[t.id.toB256()]=t.interface.jsonAbi)}),this}addTransfer(e){let{amount:t,destination:r,assetId:n}=e;return this.transactionRequest=this.transactionRequest.addCoinOutput(new Te(r),t,n),this}addBatchTransfer(e){return e.forEach(({destination:t,amount:r,assetId:n})=>{this.transactionRequest=this.transactionRequest.addCoinOutput(new Te(t),r,n)}),this}addSigners(e){return this.addSignersCallback=t=>t.addAccountWitnesses(e),this}async getTransactionRequest(){return await this.prepareTransaction(),this.transactionRequest}fromRequest(e){return this.transactionRequest=e,this}async call(e){d6(this.program.account,"Wallet is required!");let t=await this.getTransactionRequest(),r=e?.skipAssembleTx,n=e?.skipAutoConsolidation;r||(this.addSignersCallback?t=await this.legacyFundWithRequiredCoins({skipAutoConsolidation:n}):t=await this.fundWithRequiredCoins({skipAutoConsolidation:n}));let i=await this.program.account.sendTransaction(t,{estimateTxDependencies:!1});return{transactionId:i.id,waitForResult:Xe(async()=>SG({funcScope:this.functionInvocationScopes,isMultiCall:this.isMultiCall,program:this.program,transactionResponse:i}),"waitForResult"),waitForPreConfirmation:Xe(async()=>CG({funcScope:this.functionInvocationScopes,isMultiCall:this.isMultiCall,program:this.program,transactionResponse:i}),"waitForPreConfirmation")}}async simulate(){if(d6(this.program.account,"Wallet is required!"),!("populateTransactionWitnessesSignature"in this.program.account))throw new I(x.ABI_MAIN_METHOD_MISSING,"An unlocked wallet is required to simulate a contract call.");let e=await this.fundWithRequiredCoins(),t=await this.program.account.simulateTransaction(e,{estimateTxDependencies:!1});return s6({funcScopes:this.functionInvocationScopes,callResult:t,isMultiCall:this.isMultiCall})}async dryRun(){let{receipts:e}=await this.getTransactionCost(),t={receipts:e};return s6({funcScopes:this.functionInvocationScopes,callResult:t,isMultiCall:this.isMultiCall})}async get(){let e=await this.getTransactionRequest();e=pt(e),e.maxFee=T(0),e.gasLimit=T(0),e.inputs=e.inputs.filter(p=>p.type!==De.Coin);let t=this.getProvider(),r=this.program.account??Xn.generate({provider:t}),n=await t.getBaseAssetId(),i=e.outputs.filter(p=>p.type===ve.Coin).map(({amount:p,assetId:m})=>({assetId:String(m),amount:T(p)})).concat(this.requiredCoins),a=r.generateFakeResources(i),s=a.find(p=>p.assetId===n),d=T("1000000000000000");if(s)s.amount=s.amount.add(d);else{let[p]=r.generateFakeResources([{assetId:n,amount:d}]);a.push(p)}e.addResources(a);let{receipts:u}=await t.assembleTx({request:e,feePayerAccount:r});return s6({funcScopes:this.functionInvocationScopes,callResult:{receipts:u},isMultiCall:this.isMultiCall})}getProvider(){return this.program.provider}setDefaultTxParams(e,t,r){let n=Jr(this.txParameters?.gasLimit)||this.hasCallParamsGasLimit,i=Jr(this.txParameters?.maxFee),{gasLimit:a,maxFee:s}=e;if(!n)e.gasLimit=t;else if(a.lt(t))throw new I(x.GAS_LIMIT_TOO_LOW,`Gas limit '${a}' is lower than the required: '${t}'.`);if(!i)e.maxFee=r;else if(r.gt(s))throw new I(x.MAX_FEE_TOO_LOW,`Max fee '${s}' is lower than the required: '${r}'.`)}},l6=class extends AE{static{o(this,"FunctionInvocationScope")}static{Xe(this,"FunctionInvocationScope")}func;callParameters;forward;args;constructor(e,t,r){super(e,!1),this.func=t,this.args=r||[],this.setArguments(...r),super.addCall(this)}getCallConfig(){return{func:this.func,program:this.program,callParameters:this.callParameters,txParameters:this.txParameters,forward:this.forward,args:this.args,externalAbis:this.externalAbis}}setArguments(...e){return this.args=e||[],this}callParams(e){if(!this.hasCallParamsGasLimit&&e?.gasLimit!==void 0&&(this.hasCallParamsGasLimit=!0),this.callParameters=e,e?.forward){if(!this.func.attributes.find(t=>t.name==="payable"))throw new I(x.TRANSACTION_ERROR,`The target function ${this.func.name} cannot accept forwarded funds as it's not marked as 'payable'.`);this.forward=Q1(e.forward)}return this.setArguments(...this.args),this.updateRequiredCoins(),this}},OG=class extends AE{static{o(this,"MultiCallInvocationScope")}static{Xe(this,"MultiCallInvocationScope")}constructor(e,t){super(e,!0),this.addCalls(t)}addCall(e){return super.addCalls([e])}addCalls(e){return super.addCalls(e)}},eu=class{static{o(this,"Contract")}static{Xe(this,"Contract")}id;provider;interface;account;functions={};constructor(e,t,r){this.interface=t instanceof Or?t:new Or(t),this.id=new Te(e),r&&"provider"in r?(this.provider=r.provider,this.account=r):(this.provider=r,this.account=null),Object.keys(this.interface.functions).forEach(n=>{let i=this.interface.getFunction(n);Object.defineProperty(this.functions,i.name,{value:this.buildFunction(i),writable:!1})})}buildFunction(e){return(()=>{let t=Xe((...r)=>new l6(this,e,r),"funcInvocationScopeCreator");return Object.defineProperty(t,"isReadOnly",{value:Xe(()=>e.isReadOnly(),"value"),writable:!1}),t})()}multiCall(e){return new OG(this,e)}getBalance(e){return this.provider.getContractBalance(this.id,e)}};var BG=Object.defineProperty,yp=o((e,t)=>BG(e,"name",{value:t,configurable:!0}),"__name"),RG=class extends l6{static{o(this,"ScriptInvocationScope")}static{yp(this,"ScriptInvocationScope")}scriptRequest;async updateScriptRequest(){this.scriptRequest||await this.buildScriptRequest(),this.transactionRequest.setScript(this.scriptRequest,this.args)}async buildScriptRequest(){let e=this.program.bytes;if(!await this.program.provider.getChain())throw new I(I.CODES.CHAIN_INFO_CACHE_EMPTY,"Provider chain info cache is empty. Please make sure to initialize the `Provider` properly by running `new Provider()`");this.scriptRequest=new Ap(e,r=>this.func.encodeArguments(r),()=>[])}},xG=class extends c6{static{o(this,"AbstractScript")}static{yp(this,"AbstractScript")}},kG=class yE extends xG{static{o(this,"_Script")}static{yp(this,"Script")}bytes;interface;account;script;provider;functions;constructor(t,r,n){super(),this.bytes=q(t),this.interface=new Or(r),this.provider=n.provider,this.account=n,this.functions={main:yp((...i)=>new RG(this,this.interface.getFunction("main"),i),"main")}}setConfigurableConstants(t){try{if(!Object.keys(this.interface.configurables).length)throw new I(I.CODES.INVALID_CONFIGURABLE_CONSTANTS,"The script does not have configurable constants to be set");Object.entries(t).forEach(([r,n])=>{if(!this.interface.configurables[r])throw new I(I.CODES.CONFIGURABLE_NOT_FOUND,`The script does not have a configurable constant named: '${r}'`);let{offset:i}=this.interface.configurables[r],a=this.interface.encodeConfigurable(r,n);this.bytes.set(a,i)})}catch(r){throw new I(I.CODES.INVALID_CONFIGURABLE_CONSTANTS,`Error setting configurable constants: ${r.message}.`)}return this}deploy(t){return ef({deployer:t,abi:this.interface.jsonAbi,bytecode:this.bytes,loaderInstanceCallback:yp((r,n)=>new yE(r,n,this.account),"loaderInstanceCallback")})}},wle=new Ap("0x24000000",()=>new Uint8Array(0),()=>{});var kt=xr(ls(),1);var DG=Object.defineProperty,ci=o((e,t)=>DG(e,"name",{value:t,configurable:!0}),"__name"),PG=ci(e=>{let{RegId:t,Instruction:r}=kt,n=12,i=e.length,a=ri,s=ce(e.map(u=>q(u))),d=new rf(kt.move_(16,t.pc().to_u8()),kt.addi(16,16,n*r.size()),kt.move_(22,t.sp().to_u8()),kt.movi(19,i),kt.bsiz(17,16),kt.ldc(16,0,17,1),kt.addi(16,16,a),kt.subi(19,19,1),kt.jnzb(19,t.zero().to_u8(),3),kt.sub(22,22,t.is().to_u8()),kt.divi(22,22,4),kt.jmp(22)).toBytes();return ce([d,s])},"getLoaderInstructions"),LG=ci((e,t)=>{let r=[];for(let n=0,i=0;n<e.length;n+=t,i++){let a=e.slice(n,n+t),s=a.length;s%Ae!==0&&(a=ce([a,new Uint8Array(t-a.length)]),s=a.length),r.push({id:i,size:s,bytecode:a})}return r},"getContractChunks"),FG=ci(e=>{let r=q(e),n=Rl(r,16384);return dp(n.map(i=>J(i)))},"getContractRoot"),VG=ci(e=>{let t=new ib;return e.forEach(({key:r,value:n})=>t.update(ct(r),n)),t.root},"getContractStorageRoot"),MG=ci((e,t,r)=>{let n=FG(q(e));return ct(ce(["0x4655454C",t,n,r]))},"getContractId"),wE=ci(e=>J(e.startsWith("0x")?e:`0x${e}`),"hexlifyWithPrefix"),vE=.95,bE=class IE{static{o(this,"_ContractFactory")}static{ci(this,"ContractFactory")}bytecode;interface;provider;account;storageSlots;constructor(t,r,n=null,i=[]){this.bytecode=q(t),r instanceof Or?this.interface=r:this.interface=new Or(r),n&&"provider"in n?(this.provider=n.provider,this.account=n):(this.provider=n,this.account=null),this.storageSlots=i}connect(t){return new IE(this.bytecode,this.interface,t)}createTransactionRequest(t){let r=(t?.storageSlots??[]).concat(this.storageSlots).map(({key:u,value:p})=>({key:wE(u),value:wE(p)})).filter((u,p,m)=>m.findIndex(g=>g.key===u.key)===p).sort(({key:u},{key:p})=>u.localeCompare(p)),n={salt:kr(32),...t??{},storageSlots:r};if(!this.provider)throw new I(x.MISSING_PROVIDER,"Cannot create transaction request without provider");let i=t?.bytecode||this.bytecode,a=n.stateRoot||VG(n.storageSlots),s=MG(i,n.salt,a),d=new M1({bytecodeWitnessIndex:0,witnesses:[i],...n});return d.addContractCreatedOutput(s,a),{contractId:s,transactionRequest:d}}async assembleTx(t,r={}){let n=this.getAccount(),{maxFee:i}=r;t.maxFee=T(0);let{gasPrice:a,assembledRequest:s}=await n.provider.assembleTx({request:t,feePayerAccount:n,accountCoinQuantities:[]});return t=await Go({gasPrice:a,provider:n.provider,transactionRequest:s,setMaxFee:i}),t}async deploy(t={}){let r=this.getAccount(),{consensusParameters:n}=await r.provider.getChain(),i=n.contractParameters.contractMaxSize.toNumber();return this.bytecode.length>i?this.deployAsBlobTx(t):this.deployAsCreateTx(t)}async deployAsCreateTx(t={}){let r=this.getAccount(),{consensusParameters:n}=await r.provider.getChain(),i=n.contractParameters.contractMaxSize.toNumber();if(this.bytecode.length>i)throw new I(x.CONTRACT_SIZE_EXCEEDS_LIMIT,"Contract bytecode is too large. Please use `deployAsBlobTx` instead.");let{contractId:a,transactionRequest:s}=await this.prepareDeploy(t),d=await r.sendTransaction(s);return{contractId:a,waitForResult:ci(async()=>{let m=await d.waitForResult();return{contract:new eu(a,this.interface,r),transactionResult:m}},"waitForResult"),waitForPreConfirmation:ci(async()=>{let m=await d.waitForPreConfirmation();return{contract:new eu(a,this.interface,r),transactionResult:m}},"waitForPreConfirmation"),waitForTransactionId:ci(()=>Promise.resolve(d.id),"waitForTransactionId")}}async deployAsBlobTx(t={chunkSizeMultiplier:vE}){let r=this.getAccount(),{configurableConstants:n,chunkSizeMultiplier:i}=t;n&&this.setConfigurableConstants(n);let a=await this.getMaxChunkSize(t,i),s=LG(q(this.bytecode),a).map(X=>{let j=this.blobTransactionRequest({...t,bytecode:X.bytecode});return{...X,transactionRequest:j,blobId:j.blobId}}),d=s.map(({blobId:X})=>X),u=PG(d),{contractId:p,transactionRequest:m}=this.createTransactionRequest({bytecode:u,...t}),g=[...new Set(d)],A=await r.provider.getBlobs(g),E=g.filter(X=>!A.includes(X)),B=T(0),L=await r.provider.getChain(),D=await r.provider.estimateGasPrice(10),Q=L.consensusParameters.feeParameters.gasPriceFactor;for(let{transactionRequest:X,blobId:j}of s){if(E.includes(j)){let te=X.calculateMinGas(L),ne=ao({gasPrice:D,gas:te,priceFactor:Q,tip:X.tip}).add(1);B=B.add(ne)}let ue=m.calculateMinGas(L),U=ao({gasPrice:D,gas:ue,priceFactor:Q,tip:m.tip}).add(1);B=B.add(U)}if(B.gt(await r.getBalance()))throw new I(x.FUNDS_TOO_LOW,"Insufficient balance to deploy contract.");let W,H=new Promise(X=>{W=X});return{waitForResult:ci(async()=>{let X=[];for(let{blobId:te,transactionRequest:ne}of s)if(!X.includes(te)&&E.includes(te)){let we=await this.assembleTx(ne,t),R;try{R=await(await r.sendTransaction(we)).waitForResult()}catch(l){if(l.message.indexOf(`BlobId is already taken ${te}`)>-1){X.push(te);continue}throw new I(x.TRANSACTION_FAILED,"Failed to deploy contract chunk")}if(!R.status||R.status!==X4.success)throw new I(x.TRANSACTION_FAILED,"Failed to deploy contract chunk");X.push(te)}await this.assembleTx(m,t),W(m.getTransactionId(await r.provider.getChainId()));let ue=await(await r.sendTransaction(m)).waitForResult();return{contract:new eu(p,this.interface,r),transactionResult:ue}},"waitForResult"),contractId:p,waitForTransactionId:ci(()=>H,"waitForTransactionId")}}setConfigurableConstants(t){try{if(!Object.keys(this.interface.configurables).length)throw new I(x.CONFIGURABLE_NOT_FOUND,"Contract does not have configurables to be set");Object.entries(t).forEach(([n,i])=>{if(!this.interface.configurables[n])throw new I(x.CONFIGURABLE_NOT_FOUND,`Contract does not have a configurable named: '${n}'`);let{offset:a}=this.interface.configurables[n],s=this.interface.encodeConfigurable(n,i),d=q(this.bytecode);d.set(s,a),this.bytecode=d})}catch(r){throw new I(x.INVALID_CONFIGURABLE_CONSTANTS,`Error setting configurable constants on contract: ${r.message}.`)}}getAccount(){if(!this.account)throw new I(x.ACCOUNT_REQUIRED,"Account not assigned to contract.");return this.account}async prepareDeploy(t){let{configurableConstants:r}=t;r&&this.setConfigurableConstants(r);let{contractId:n,transactionRequest:i}=this.createTransactionRequest(t);return await this.assembleTx(i,t),{contractId:n,transactionRequest:i}}blobTransactionRequest(t){let{bytecode:r}=t;return new mp({blobId:zr(r),witnessIndex:0,witnesses:[r],...t})}async getMaxChunkSize(t,r=vE){if(r<0||r>1)throw new I(x.INVALID_CHUNK_SIZE_MULTIPLIER,"Chunk size multiplier must be between 0 and 1");let n=this.getAccount(),{consensusParameters:i}=await n.provider.getChain(),a=i.contractParameters.contractMaxSize.toNumber(),s=i.txParameters.maxSize.toNumber(),d=64e3,u=s<a?s:a,p=u<d?u:d,m=this.blobTransactionRequest({...t,bytecode:kr(32)}).addResources(n.generateFakeResources([{assetId:await n.provider.getBaseAssetId(),amount:T(1)}])),g=(p-m.byteLength()-Ae)*r;return Math.round(g/Ae)*Ae}};var UG=Object.defineProperty,SE=o((e,t)=>UG(e,"name",{value:t,configurable:!0}),"__name"),EE={programType:"contract",specVersion:"1",encodingVersion:"1",concreteTypes:[{type:"()",concreteTypeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"},{type:"enum standards::src5::AccessError",concreteTypeId:"3f702ea3351c9c1ece2b84048006c8034a24cbc2bad2e740d0412b4172951d3d",metadataTypeId:1},{type:"enum standards::src5::State",concreteTypeId:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c",metadataTypeId:2},{type:"enum std::option::Option<struct std::contract_id::ContractId>",concreteTypeId:"0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",metadataTypeId:4,typeArguments:["29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54"]},{type:"enum sway_libs::ownership::errors::InitializationError",concreteTypeId:"1dfe7feadc1d9667a4351761230f948744068a090fe91b1bc6763a90ed5d3893",metadataTypeId:5},{type:"enum sway_libs::upgradability::errors::SetProxyOwnerError",concreteTypeId:"3c6e90ae504df6aad8b34a93ba77dc62623e00b777eecacfa034a8ac6e890c74",metadataTypeId:6},{type:"str",concreteTypeId:"8c25cb3686462e9a86d2883c5688a22fe738b0bbc85f458d2d2b5f3f667c6d5a"},{type:"struct std::contract_id::ContractId",concreteTypeId:"29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54",metadataTypeId:9},{type:"struct sway_libs::upgradability::events::ProxyOwnerSet",concreteTypeId:"96dd838b44f99d8ccae2a7948137ab6256c48ca4abc6168abc880de07fba7247",metadataTypeId:10},{type:"struct sway_libs::upgradability::events::ProxyTargetSet",concreteTypeId:"1ddc0adda1270a016c08ffd614f29f599b4725407c8954c8b960bdf651a9a6c8",metadataTypeId:11}],metadataTypes:[{type:"b256",metadataTypeId:0},{type:"enum standards::src5::AccessError",metadataTypeId:1,components:[{name:"NotOwner",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"enum standards::src5::State",metadataTypeId:2,components:[{name:"Uninitialized",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"},{name:"Initialized",typeId:3},{name:"Revoked",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"enum std::identity::Identity",metadataTypeId:3,components:[{name:"Address",typeId:8},{name:"ContractId",typeId:9}]},{type:"enum std::option::Option",metadataTypeId:4,components:[{name:"None",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"},{name:"Some",typeId:7}],typeParameters:[7]},{type:"enum sway_libs::ownership::errors::InitializationError",metadataTypeId:5,components:[{name:"CannotReinitialized",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"enum sway_libs::upgradability::errors::SetProxyOwnerError",metadataTypeId:6,components:[{name:"CannotUninitialize",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"generic T",metadataTypeId:7},{type:"struct std::address::Address",metadataTypeId:8,components:[{name:"bits",typeId:0}]},{type:"struct std::contract_id::ContractId",metadataTypeId:9,components:[{name:"bits",typeId:0}]},{type:"struct sway_libs::upgradability::events::ProxyOwnerSet",metadataTypeId:10,components:[{name:"new_proxy_owner",typeId:2}]},{type:"struct sway_libs::upgradability::events::ProxyTargetSet",metadataTypeId:11,components:[{name:"new_target",typeId:9}]}],functions:[{inputs:[],name:"proxy_target",output:"0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",attributes:[{name:"doc-comment",arguments:[" Returns the target contract of the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Returns"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * [Option<ContractId>] - The new proxy contract to which all fallback calls will be passed or `None`."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"storage",arguments:["read"]}]},{inputs:[{name:"new_target",concreteTypeId:"29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54"}],name:"set_proxy_target",output:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",attributes:[{name:"doc-comment",arguments:[" Change the target contract of the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Additional Information"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" This method can only be called by the `proxy_owner`."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Arguments"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * `new_target`: [ContractId] - The new proxy contract to which all fallback calls will be passed."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Reverts"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * When not called by `proxy_owner`."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"doc-comment",arguments:[" * Write: `1`"]},{name:"storage",arguments:["read","write"]}]},{inputs:[],name:"proxy_owner",output:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c",attributes:[{name:"doc-comment",arguments:[" Returns the owner of the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Returns"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * [State] - Represents the state of ownership for this contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"storage",arguments:["read"]}]},{inputs:[],name:"initialize_proxy",output:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",attributes:[{name:"doc-comment",arguments:[" Initializes the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Additional Information"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" This method sets the storage values using the values of the configurable constants `INITIAL_TARGET` and `INITIAL_OWNER`."]},{name:"doc-comment",arguments:[" This then allows methods that write to storage to be called."]},{name:"doc-comment",arguments:[" This method can only be called once."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Reverts"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * When `storage::SRC14.proxy_owner` is not [State::Uninitialized]."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Writes: `2`"]},{name:"storage",arguments:["write"]}]},{inputs:[{name:"new_proxy_owner",concreteTypeId:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c"}],name:"set_proxy_owner",output:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",attributes:[{name:"doc-comment",arguments:[" Changes proxy ownership to the passed State."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Additional Information"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" This method can be used to transfer ownership between Identities or to revoke ownership."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Arguments"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * `new_proxy_owner`: [State] - The new state of the proxy ownership."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Reverts"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * When the sender is not the current proxy owner."]},{name:"doc-comment",arguments:[" * When the new state of the proxy ownership is [State::Uninitialized]."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"doc-comment",arguments:[" * Writes: `1`"]},{name:"storage",arguments:["write"]}]}],loggedTypes:[{logId:"4571204900286667806",concreteTypeId:"3f702ea3351c9c1ece2b84048006c8034a24cbc2bad2e740d0412b4172951d3d"},{logId:"2151606668983994881",concreteTypeId:"1ddc0adda1270a016c08ffd614f29f599b4725407c8954c8b960bdf651a9a6c8"},{logId:"2161305517876418151",concreteTypeId:"1dfe7feadc1d9667a4351761230f948744068a090fe91b1bc6763a90ed5d3893"},{logId:"4354576968059844266",concreteTypeId:"3c6e90ae504df6aad8b34a93ba77dc62623e00b777eecacfa034a8ac6e890c74"},{logId:"10870989709723147660",concreteTypeId:"96dd838b44f99d8ccae2a7948137ab6256c48ca4abc6168abc880de07fba7247"},{logId:"10098701174489624218",concreteTypeId:"8c25cb3686462e9a86d2883c5688a22fe738b0bbc85f458d2d2b5f3f667c6d5a"}],messagesTypes:[],configurables:[{name:"INITIAL_TARGET",concreteTypeId:"0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",offset:13368},{name:"INITIAL_OWNER",concreteTypeId:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c",offset:13320}]},QG=[{key:"7bb458adc1d118713319a5baa00a2d049dd64d2916477d2688d76970c898cd55",value:"0000000000000000000000000000000000000000000000000000000000000000"},{key:"7bb458adc1d118713319a5baa00a2d049dd64d2916477d2688d76970c898cd56",value:"0000000000000000000000000000000000000000000000000000000000000000"},{key:"bb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea754",value:"0000000000000000000000000000000000000000000000000000000000000000"},{key:"bb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea755",value:"0000000000000000000000000000000000000000000000000000000000000000"}],TE=class extends eu{static{o(this,"Src14OwnedProxy")}static{SE(this,"Src14OwnedProxy")}static abi=EE;static storageSlots=QG;constructor(e,t){super(e,EE,t)}},NE=Sy("H4sIAAAAAAAAA9Vbe3Abx3lfgCAFvayz+TAFSjaUUjJkRwosUQ4ly9IhIATSEM2DSVpUGBhg64c0cSyIlVQ5tsccN001aSZlHcdlO06GrtOp6z4GAB+C7T7YR2bUiTtlZhxbTeMWmiatFAst60YZqm6j/r5v93DHw4GOJ84f0QznFne73+5+j9/32FVgISxOCOEV/K/Dn7o259GuXRO/JcSQ8c6CML4nwkZJF8HFnWLovZLXeK/kOyG89+JbGN9C+BZe+q2uEfRE4LIBGiv1VHThdi0i5gJdGTHa7TW0WNNY4JLmoFfXE4jPi3T5ep/q112j337Vr8WIF3PV373nAol5YfTls6OG8Id6m9E3+DG0tVB5F96/onG7b0akejWh9XaMpWNhYcSnL44exPv49JzLnNtoTtDMpMvaR0FvmxHPaaPd6B/rGDMSxRCP7WmaMxJ5I10Wt47qYg2etxnR/CJ/i7Tj29nuSr/42Tlux3yYLygC36+aMxiIzotTuuck+LeD+If9hoxEIQS6MdDX8DxgRAudNvrzNvql96Hvl/TFJdDfaaPfDbo9oL8az7tBf8hGf8GiXxTL0/cuKPpPg36Hjf4R0O1V678H9E9b9IuaRX+m9X3on1f0HwD9XTb6Z0A3Cfrr8LwX9Ccs+jOWnOIzkm+16c8p+juXvl/9f0Z0GnonHP19CeqfigmR6hGeVER4jb5Z7FH7a+jL32Atf2tEp84ELoUxV9XYQzQWOnVO6pRvzIi+AhugdTehPVtpV8/r/TyPTcxWdIv246CfIf3dHNGEES0GjXihRHSq9+z5slrHBOYLy3XkJ7nN6zg7brar17F6c0AXYjP+lr5fNWW+x/4nqsc1PK3mHLLmLGatOaddxtSxboHPsGHF6/7Zc6MDGJNs1o347CJ4/i/pcrgEvl/AvOcCl3Teb+CCk5b/tmq5zVyE3P4cNP4C4/8S40+7y63uklr7GUtuReKXktuMfxm5tSq5ST10lVvdu6bcoON3KB0PGokpjTAq8H1nf8/vME4lcoRlQann+TFux9rnHLTfgQ2QzuCbbw57PgJcDIZ660lOYab/PejIBez77aq1vyH3nfdjfDePjxaL3I5gzmh+Pn1Z22P0Cr+kuRnYOTuEdjfhMeQziXYoFKsXkq9OPVxxCnbrH+3C2Eg75Dnt5geO0V5TPeBNr+ZJxTTowNkh6EAwlKzXoaunIb//hA4sQJb/ZcSnFqUO0J6ctPyHXXRgHuNeBY3XoAN/Bj08X0MHjigd6LZ0oPCSKXfIbX0qnhtMJXL3dXh891q2MA0ZOmmt/JaiFcR48If1qZPb0haOuNjCtiW2kBTe1CDah9U+0oXiaAbjUy0C6/A1xjRxqktsT0VzhxojQge+ebHGwB28pkLRiAi/EX8lyHyMgY/xmUnwYBp8nEmX9VkjMW0ELpLukS059c/7lotMNJtMwqD1b6D17+DtRcgEOFRLJit+6JQJYgoN6wG+G/l0OVOAXKbAk87ARYll1bbtnXKRaxFzn8U68BSvYDywwU2u3neVLM7bbDtj2fb0Ym3b9mxStl3xN9W27X3PtO2vCHHzc34zXhKTgeikCMTHRSAxJgJ9JWH052CP5h6dcZgI8B4jAnGOWIv1HjGiuU6JD851iTbqC7sKh8o+yCOX5XZ02mr3+PTAD4V4htZxNSwmsK7fxvruXhS0zhXmOuUasb5ESaTB38AVzHc1aPZfofo/Ze3Lc5HHDGNfh0qw+6q1fZL40QjdOdUt7sZTx3M1/Li3MdJEfthzB2JKrHMB6/RChjch1jpjrhnjd5PfAu40utCOUkzY2BsUpw6KGxt7gkRb0kvkzmHMesR2uuRx2Dm2i2XZB5s08TESlLgWoXgyn8EaQ6HedoqhbwC9bPqyuA7vgzXohVkGhLtl4CbRonZ0Ghhs0TIiGvkO2D3Fl9inTvtsIswtcjvG89WDHzrmg83ivfKf/P1wE2SSgRzB96uGKZenlFwq+iblWJL40RMkDBEUN2u9u0Q6Aru4gtjoqubUA7u+ZphGAnKFrpKtMW/KhPM5ndtxxNrqvRZDPM5xCPhJ+A7d4yfpHeaC3mVc9M4+H3x/lX1ka9nHSSH+2GYfrZgXtrhUP9AnyrqXhO4ZogUYqQMjpX4A16EfKzEHYgCao4r+J1ievGfSDciN2tEZWtcEyzPZZMoqCFn5+H0XvWcbPMftSJfVtmxwwYUXdVWyw94CV/BnyanOaa/gm2b2Z9wq+8YC0VxlLObSbONN+91vG29YfAcNwjXob+CdXLV+98Fe+pEfDaAP4jHCeEefWwL9ZI+78AcdMwTZ5QbYWJhzM9gYYbJjzK2Krr4M3U0c//RDt7hPvVsfznu2JjuMwBWd9m3YcGv/B+CbZxm+fYh8rzsXOITx/ZBzdOHjMgbMXwQtituADYiTONajGCxvWHEb7LYqbhMPKfzvlvg/NcZtxv9Cd6Udz8MnuuUHvqwt1pHzRwuUE9A4Fz/oOy79YIH8oBmPIp6nfMvN54tBRf+IlQtMEQ6qXGAqo74Beym2yl2PmOYG+t3WA9w7KPxtPR1jW7pBuzsLbJ7K7O7xzcN3NJDfgO3BZxTO23zGdYQHsG/KNf1tsQ5diyHeTMA+D5IdYr0xxLDURvxsHwteE35hXe2ob+SGVSylfFQ+KOOoKRm7ESaTXQ8SxhmQOWR6VXfqnN3WupdiXJblz3FUuV6H7/Nh3SEzPgbGdIf6pqFPYdKnbhfa12x+2MLPYdCGL8Yawbcm4l9I62mnusTN6ll/s3z61qea5jAfeHRC534x/KZ+8ll/M56w35zpI7EmrLWDeEE1CenfIANT9g6575R6Aru1dFnlOFV9Q8ofS9/C+UqecAO8QJ6RyMs19LBvzr7Y63uB7IJ1BjqK71m8H8f7SV4b6xJ8bDRntRO5jLWOnMyfUD8A35vS5Wwzy/0wyZL9KzC64l+vKX6vs8lSt+Mm4T/+6vHXAH+0gv2gigWYZ3GSo0Zy1G24tK46nhLjLn7wNHSklbARa2wNleFT4oypreyDh3MNqUO5FbAZ8lF+LdksmpMxHT7PQ/4J77xtg4NiywCYvPEBPTCUFVryAT2dhO/W0R9xGPvDcmYlYvBVWP9qrL+V6UfY32e4jbwO/VspXlE+fdzmx8wYxM4jpe+kiz5h2W+uFXF6Hb3Dk/kGGWFfLKMw+NYaSkyT/mH+9jmFp9D/Cp6afLPbFvI1Sx6Yw+A1S50l2hSbEF61ks6m+nL1sGWN/A7yFr/Rq/vBY9QVKZ/B3rm21GXV8qTsjnz4PsVjs2H/PNktchCOSRx5xXa2jzTHyeFQClg1nA8D47YcBz4Bo6j+cx68HKY8H+8fOt5NeZFpu2RDs0XLhmaGpM06/XHdE7LOCrsxx/WofJ/G9SAOYgwlGzpLORRjOHKjuxzr/W/269H8ONa0g2p4JmZSXNAC3mLN7ci9QqgD6Oa3VDRfrzB3DfD3DNqUI9hy2akh7O3T+DuGuuWQGVdBz9eCb7rE5yL5FunH4lN+zD+i1i1tn8ZR/MZx91mKq8kPUCyHmtL0S2bu6tjPd5SPJblCR4qEm5r0sVMU33Ebaxamz6DaO35/Vu1hFdqP2b7V0TfKeRojPs7XtaSuI+6MEW2su5KfgietDppPKJoRtB930HzCheYnZT7suq+vK99MMlD58BTlHKrOkfM76J+20Yf/RV32skiCp1TXMWVxI+Regoz2jsQ+EYHeTaBWAd63YJ4Z5LCuddl/VjUuo9KXfDS1Y1vw3qIPmYVtMtuFvRVr7O0zam+qpk97m6Y4w9wb9rGEr19SfKV9ZbCvg1h7ybGvIvb1ceyrDt9O2/bVWmNfL6l9Bd33ZdG37ws6QLVaVR8iG5mi2HCJjQS6eK2eQBfXfr5CY1CDq9iZrG25+doKX6geq+I9qrHPEu+xlgbCINTV3Hy6937l08flfqjvzEVuR4gPs5W9uceagmurWPfDdMYBXsbB5wTbYWXdUxR78t4hkwUlo1a0R13wYFzZ/GnL5gtk89C7Qg7P+4xelddzjq/wS557vGTm31jXKkULOIrzoMvaR4EZ5C/8CjMqfRn3VIwI7CLd4pgW63tPrU/Fi9OaWhvFKXJvsYzM/3mfM7LOETlB9TiV5z/A8bYL3zg+MvdPeSTe3YQzBML8f8J4lcdW1VPvUzVdqj2a9k28NuuYbYgbsqhjHqc6Jn5vIL5K3PCg5kQ6ZWG3ev/oM+SrKvGRx4yPbPm8p1TxxxTj0t7gD+Fbw1bcD9/UJTI1cHOD+t2EdovJV9s3wXqP8yz6bsMkE6c2mO9UP9gJ8yxK80q54BnTwvjzq9hQ+rVIkORO+sfxKugYKh9Y41jHLer3BrQ/4lg/favYKNeQQEvOi2dMC8l5cQ5jxcYUb1AOpM6uqmLkAGHJMrRs8a06H6hNawXRknENZGXlFmY9omasW6lxmTEu5nghOh1UMY5bfGvPexdteW+nzHuR61p5r8opeQ+o/9TOe08q3bblvaRPZt57xJb3XqxhUwWXvDdXO+8VXHems1Rb3gvfUzPv3eeS99r0H3jzwfLecSvvzVPOgTOjwiL22WnLe7nu6ZL3EnaZeS/VGSnvrYwFvU5uSz1PO/LeTpX3Up1c1iIJt6y8d/GnyE3DP2FuGv4wc1PozuhPmpui75M/T7lpla2q/MXFLt1qjr73qzkGoiUxgjqqqunX2+uqhLXQQ8Za9b1Bfa/47JEuTx31AY16uS7hrJPZ68LIoaz9OGq07ZRjNCd9c5TrNsrntpGIF/VHrj0G8dTxbAIfyBdQzkE1I1lb70esSfkdxhEekm+C7TRQX+SEK+zfIXuq4aOG2UX7Ixqo+WrIXbV6/qbqm1Sz5n7JDrOfhj5ezFfH3xQ97hPrYvxFP8qBSX/pnopZJxizycsNkxEPLJFziDCZ6o9LbRc1AZsOgG7IRQ/sdHE/pRrrHTWM4PI1DJu9Uz5LfKT4IQnMg79ifGWsz827nXdDrgXyTWwbZR5Ddwh4jPO8GH1zCmMXuD/OlEF30rRj51nmSeF73XYW63IXIj+vvpmY7Acmr6yNyfn53T0dhDcW3vYhRxqi857YmDwPBy7E8/N3xnzjsv6/xH7NuokNL71WTT4NvBy24iclX4opvmCLmW6kNvqQjo8tjY8RE1BthfYWz1GM6a3lr8CbF1zOZo+RDgHD6O6BjI8SeaqPUB0I/g9nNHxuDJrV9Gaqz40R/w2QLtSTn2lQe6Fza2o7zq1zYfY7/QUaI8+a+/OoUwW3wj5vBTbehvkn5fzI/6rn/3b1/MDqyrk17jOUg3tA607Q2gtaiBNqnVuLAy68CdnWaJ2H96MuUw5uAd1bQBe5W+6MPMt2XeOPXdZI9T5zjROgtRO0OkBrF2jBZmqucaPLGtdRrGDTgSG5Fjf51/P5tn18OqWJdCroSaegN1ey0F3o5tWM0/fYdFfI8+Cl9ctWaz/QQaplRsxaJp+VGdymPGA4twq1TIrp11AdXIv59OZYM/sXrmXCj7QNDuiqlimolskx1KcI42JzqGsKbiebKXYIaoj/if+obV6P2uYNqG020jm6rbZJd1a4tsn+2HxPbVqTdX6J89ZKrdPct73+uMRPAQNCzrMu8PcA+atUMixSg2FPqjfstdmzXe9x11BHHdbAXb3wGtDSLJlV0fwSywz+DndE5F2IQzncxQuvBY3rsF/IP4fzMvjtqrimvk+dWfOZ3zL+x4zpbBjvteIMC+NxT4vxmvDTxHjcBXHDeO9tDoynOLgGxnu3qhxW9pcYz3dE3THe+zUXjKe43sT40gfE+JILxo8B48MK4zEHY3zJwnjwZ5nzefhI1IoRb8UXdmsxDZiawx0g5z5WrKZarPTtFK9TjV5bCb1sw3MV363j+jR/O8/9UDfHeuncGvEI67c6l8N5bDVebFe1Kds5HuxT3SujGo/7fTTRoPwY6tmV2M3tTF/FEuy/KI7gengYdxICB6lgnRTPoha8Q4d8dKFvge6nN8I29KwIRurEvYhF78Y7GW9U3VWwxxvFKswZ5lhdCx0GD/rhryyf8wvKz9yv2g7bk/dFlsqhoYPthM8ouIZR4jbH9nxWQDhBcTvdeeUzC2DYuhTOyimnQx95V1jyl843TJmNm++hf42UE9HdaIV5VNOzMC/ZpW8Br0IbB0RggDFP3kdEvUiLDQicZzTzfWfUAVDLaWL68EvAP5ozByxpAR7cqO5KkK2a/oDupgL/2EaoLiTfo61s0vyG8wK33KgB90QqOa6qL+H+oFVf2oy9bcKaPkL1JZVPtqraxQTnTYy9aC+5LwKZLn+2pGIkyBr662I737HbDseflNPLGgV8WNVZkh3bcFcLdBGrVmORb4fCLcRjzD+ZS+B+OOfV0v4kJsD+3M5YQOPv+F6KvLO3AxiwhzAglVi4U+sJ4mxqYa/WG55L9S/chXrbHPA8C6wJhgabxzDXDUbMCPHv2OYxo0sPc/45BOzsGRwzDuFeOsWe6CvnBoOXYuMlFQdiPO7IXxZtqs4J3nfNGd068A41mMqdzgLdtwe+bXa904la4OdULbIFtRO6B9MFvqk7V1V9v6l0hWogpq5U7kBDV7ZDV4LQlU32WiSwFHfWKjhj6oJNXnXynBFxskM33yS9xJrWgkeEj3TGD/mg3rSsfOpvN+WjZPQpyGifxGlVVyNb7kPewPUAxlnEjqBVuVvr3Lvfo7CW7sJDVoQFU6Sf8Hmw1XjhTKWdKJCv4bW6+07PBcddbr5H6ND/keq71Pg/BZW71HRfP9iLOOEeYEKftG/3u9Sof2ypvm+Zp9pEJ2jsxvg9GN/tdt8S6zDv0VIOp2Su7l5KmX8MMm+DzDfwPVqpS83QJdJNA7pUuQPm0GM+h7DO4/iOlTqDWwiD5nrQDCzVI+iJFbsu55P31/bJ/oWfpU+GbDln+qA+GePeruWTf1b/sqPHTj+WPjEy+vCD9N+CxC8/eCJtf/f49NCf/NW3Wo/vXP/7r06u2ub76pu9W1viT24589bR7LmJvx+UfY/9yqMPjjK9o48ePXF05JGjn31QkrHoyT4bv7vq7RduWeV5nf8J7/7s9hd3bXj+pmv8T4jXHnvm8eZ/3Py1F1vevVzY+uQj536t9cwfPn167vdK+wIrb/qDgQMjjzzyiyO/9OnY6Oix0T17BniR9xw70S+XL764+Zt3fP7A9t/N/+ZE57Nf/vrLvkvPvzZ7cNOb//qZYwfLl18+uv/V/5j8h4eu+8Ku/xk+uePbe3/06xf23ZVr+sG7/m8Uv9HxR0fvemvl2vu9D6f3bfzxUz/47sbnHn7u7V/9ja6rX/3i3kfH/9To/dHLkms7/1c+d7yuns+r50H5vF19335ePtvfkM8W9X3lEfn0qff1n1PPDvV8Vj7rJuXT88b/AzdExjYINgAA"),Kle=class CE extends bE{static{o(this,"_Src14OwnedProxyFactory")}static{SE(this,"Src14OwnedProxyFactory")}static bytecode=NE;constructor(t){super(NE,TE.abi,t,TE.storageSlots)}static deploy(t,r={}){return new CE(t).deploy(r)}};var GG=Object.defineProperty,qG=o((e,t)=>GG(e,"name",{value:t,configurable:!0}),"__name");function JG(e){return e}o(JG,"createConfig");qG(JG,"createConfig");BigInt.prototype.asBigDecimal=function(){return new Gt(this.toString())};BigInt.prototype.scaleDown=function(e){return f6(this,e)};Ma.prototype.asBigDecimal=function(){return new Gt(this.toString(10))};Ma.prototype.scaleDown=function(e){return f6(BigInt(this.toString(10)),e)};function f6(e,t){let r=new Gt(10).pow(Number(t));return e.asBigDecimal().dividedBy(r)}o(f6,"scaleDown");import("node:process").then(e=>e.stdout.write(""));var pi=null;try{pi=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function bt(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}o(bt,"Long");bt.prototype.__isLong__;Object.defineProperty(bt.prototype,"__isLong__",{value:!0});function gn(e){return(e&&e.__isLong__)===!0}o(gn,"isLong");function OE(e){var t=Math.clz32(e&-e);return e?31-t:t}o(OE,"ctz32");bt.isLong=gn;var BE={},RE={};function qs(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=RE[e],n)?n:(r=nt(e,0,!0),i&&(RE[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=BE[e],n)?n:(r=nt(e,e<0?-1:0,!1),i&&(BE[e]=r),r))}o(qs,"fromInt");bt.fromInt=qs;function li(e,t){if(isNaN(e))return t?oo:Fi;if(t){if(e<0)return oo;if(e>=PE)return VE}else{if(e<=-kE)return kn;if(e+1>=kE)return FE}return e<0?li(-e,t).neg():nt(e%ru|0,e/ru|0,t)}o(li,"fromNumber");bt.fromNumber=li;function nt(e,t,r){return new bt(e,t,r)}o(nt,"fromBits");bt.fromBits=nt;var of=Math.pow;function h6(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?oo:Fi;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return h6(e.substring(1),t,r).neg();for(var i=li(of(r,8)),a=Fi,s=0;s<e.length;s+=8){var d=Math.min(8,e.length-s),u=parseInt(e.substring(s,s+d),r);if(d<8){var p=li(of(r,d));a=a.mul(p).add(li(u))}else a=a.mul(i),a=a.add(li(u))}return a.unsigned=t,a}o(h6,"fromString");bt.fromString=h6;function Vi(e,t){return typeof e=="number"?li(e,t):typeof e=="string"?h6(e,t):nt(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}o(Vi,"fromValue");bt.fromValue=Vi;var xE=65536,zG=1<<24,ru=xE*xE,PE=ru*ru,kE=PE/2,DE=qs(zG),Fi=qs(0);bt.ZERO=Fi;var oo=qs(0,!0);bt.UZERO=oo;var tu=qs(1);bt.ONE=tu;var LE=qs(1,!0);bt.UONE=LE;var m6=qs(-1);bt.NEG_ONE=m6;var FE=nt(-1,2147483647,!1);bt.MAX_VALUE=FE;var VE=nt(-1,-1,!0);bt.MAX_UNSIGNED_VALUE=VE;var kn=nt(0,-2147483648,!1);bt.MIN_VALUE=kn;var oe=bt.prototype;oe.toInt=o(function(){return this.unsigned?this.low>>>0:this.low},"toInt");oe.toNumber=o(function(){return this.unsigned?(this.high>>>0)*ru+(this.low>>>0):this.high*ru+(this.low>>>0)},"toNumber");oe.toString=o(function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(kn)){var r=li(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=li(of(t,6),this.unsigned),s=this,d="";;){var u=s.div(a),p=s.sub(u.mul(a)).toInt()>>>0,m=p.toString(t);if(s=u,s.isZero())return m+d;for(;m.length<6;)m="0"+m;d=""+m+d}},"toString");oe.getHighBits=o(function(){return this.high},"getHighBits");oe.getHighBitsUnsigned=o(function(){return this.high>>>0},"getHighBitsUnsigned");oe.getLowBits=o(function(){return this.low},"getLowBits");oe.getLowBitsUnsigned=o(function(){return this.low>>>0},"getLowBitsUnsigned");oe.getNumBitsAbs=o(function(){if(this.isNegative())return this.eq(kn)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1},"getNumBitsAbs");oe.isZero=o(function(){return this.high===0&&this.low===0},"isZero");oe.eqz=oe.isZero;oe.isNegative=o(function(){return!this.unsigned&&this.high<0},"isNegative");oe.isPositive=o(function(){return this.unsigned||this.high>=0},"isPositive");oe.isOdd=o(function(){return(this.low&1)===1},"isOdd");oe.isEven=o(function(){return(this.low&1)===0},"isEven");oe.equals=o(function(t){return gn(t)||(t=Vi(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},"equals");oe.eq=oe.equals;oe.notEquals=o(function(t){return!this.eq(t)},"notEquals");oe.neq=oe.notEquals;oe.ne=oe.notEquals;oe.lessThan=o(function(t){return this.comp(t)<0},"lessThan");oe.lt=oe.lessThan;oe.lessThanOrEqual=o(function(t){return this.comp(t)<=0},"lessThanOrEqual");oe.lte=oe.lessThanOrEqual;oe.le=oe.lessThanOrEqual;oe.greaterThan=o(function(t){return this.comp(t)>0},"greaterThan");oe.gt=oe.greaterThan;oe.greaterThanOrEqual=o(function(t){return this.comp(t)>=0},"greaterThanOrEqual");oe.gte=oe.greaterThanOrEqual;oe.ge=oe.greaterThanOrEqual;oe.compare=o(function(t){if(gn(t)||(t=Vi(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},"compare");oe.comp=oe.compare;oe.negate=o(function(){return!this.unsigned&&this.eq(kn)?kn:this.not().add(tu)},"negate");oe.neg=oe.negate;oe.add=o(function(t){gn(t)||(t=Vi(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,s=t.high>>>16,d=t.high&65535,u=t.low>>>16,p=t.low&65535,m=0,g=0,A=0,E=0;return E+=a+p,A+=E>>>16,E&=65535,A+=i+u,g+=A>>>16,A&=65535,g+=n+d,m+=g>>>16,g&=65535,m+=r+s,m&=65535,nt(A<<16|E,m<<16|g,this.unsigned)},"add");oe.subtract=o(function(t){return gn(t)||(t=Vi(t)),this.add(t.neg())},"subtract");oe.sub=oe.subtract;oe.multiply=o(function(t){if(this.isZero())return this;if(gn(t)||(t=Vi(t)),pi){var r=pi.mul(this.low,this.high,t.low,t.high);return nt(r,pi.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?oo:Fi;if(this.eq(kn))return t.isOdd()?kn:Fi;if(t.eq(kn))return this.isOdd()?kn:Fi;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(DE)&&t.lt(DE))return li(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,s=this.low&65535,d=t.high>>>16,u=t.high&65535,p=t.low>>>16,m=t.low&65535,g=0,A=0,E=0,B=0;return B+=s*m,E+=B>>>16,B&=65535,E+=a*m,A+=E>>>16,E&=65535,E+=s*p,A+=E>>>16,E&=65535,A+=i*m,g+=A>>>16,A&=65535,A+=a*p,g+=A>>>16,A&=65535,A+=s*u,g+=A>>>16,A&=65535,g+=n*m+i*p+a*u+s*d,g&=65535,nt(E<<16|B,g<<16|A,this.unsigned)},"multiply");oe.mul=oe.multiply;oe.divide=o(function(t){if(gn(t)||(t=Vi(t)),t.isZero())throw Error("division by zero");if(pi){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?pi.div_u:pi.div_s)(this.low,this.high,t.low,t.high);return nt(r,pi.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?oo:Fi;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return oo;if(t.gt(this.shru(1)))return LE;a=oo}else{if(this.eq(kn)){if(t.eq(tu)||t.eq(m6))return kn;if(t.eq(kn))return tu;var s=this.shr(1);return n=s.div(t).shl(1),n.eq(Fi)?t.isNegative()?tu:m6:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(kn))return this.unsigned?oo:Fi;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=Fi}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var d=Math.ceil(Math.log(n)/Math.LN2),u=d<=48?1:of(2,d-48),p=li(n),m=p.mul(t);m.isNegative()||m.gt(i);)n-=u,p=li(n,this.unsigned),m=p.mul(t);p.isZero()&&(p=tu),a=a.add(p),i=i.sub(m)}return a},"divide");oe.div=oe.divide;oe.modulo=o(function(t){if(gn(t)||(t=Vi(t)),pi){var r=(this.unsigned?pi.rem_u:pi.rem_s)(this.low,this.high,t.low,t.high);return nt(r,pi.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},"modulo");oe.mod=oe.modulo;oe.rem=oe.modulo;oe.not=o(function(){return nt(~this.low,~this.high,this.unsigned)},"not");oe.countLeadingZeros=o(function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},"countLeadingZeros");oe.clz=oe.countLeadingZeros;oe.countTrailingZeros=o(function(){return this.low?OE(this.low):OE(this.high)+32},"countTrailingZeros");oe.ctz=oe.countTrailingZeros;oe.and=o(function(t){return gn(t)||(t=Vi(t)),nt(this.low&t.low,this.high&t.high,this.unsigned)},"and");oe.or=o(function(t){return gn(t)||(t=Vi(t)),nt(this.low|t.low,this.high|t.high,this.unsigned)},"or");oe.xor=o(function(t){return gn(t)||(t=Vi(t)),nt(this.low^t.low,this.high^t.high,this.unsigned)},"xor");oe.shiftLeft=o(function(t){return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?nt(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):nt(0,this.low<<t-32,this.unsigned)},"shiftLeft");oe.shl=oe.shiftLeft;oe.shiftRight=o(function(t){return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?nt(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):nt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},"shiftRight");oe.shr=oe.shiftRight;oe.shiftRightUnsigned=o(function(t){return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?nt(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?nt(this.high,0,this.unsigned):nt(this.high>>>t-32,0,this.unsigned)},"shiftRightUnsigned");oe.shru=oe.shiftRightUnsigned;oe.shr_u=oe.shiftRightUnsigned;oe.rotateLeft=o(function(t){var r;return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?nt(this.high,this.low,this.unsigned):t<32?(r=32-t,nt(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,nt(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))},"rotateLeft");oe.rotl=oe.rotateLeft;oe.rotateRight=o(function(t){var r;return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?nt(this.high,this.low,this.unsigned):t<32?(r=32-t,nt(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,nt(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))},"rotateRight");oe.rotr=oe.rotateRight;oe.toSigned=o(function(){return this.unsigned?nt(this.low,this.high,!1):this},"toSigned");oe.toUnsigned=o(function(){return this.unsigned?this:nt(this.low,this.high,!0)},"toUnsigned");oe.toBytes=o(function(t){return t?this.toBytesLE():this.toBytesBE()},"toBytes");oe.toBytesLE=o(function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},"toBytesLE");oe.toBytesBE=o(function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},"toBytesBE");bt.fromBytes=o(function(t,r,n){return n?bt.fromBytesLE(t,r):bt.fromBytesBE(t,r)},"fromBytes");bt.fromBytesLE=o(function(t,r){return new bt(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},"fromBytesLE");bt.fromBytesBE=o(function(t,r){return new bt(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},"fromBytesBE");var fi=bt;var b=xr(Js(),1);var sf=xr(Js(),1);function UE(){return{}}o(UE,"createBaseEmpty");var zs={encode(e,t=sf.default.Writer.create()){return t},decode(e,t){let r=e instanceof sf.default.Reader?e:sf.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=UE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return zs.fromPartial(e??{})},fromPartial(e){return UE()}};var Zn=xr(Js(),1);var Ws;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ws||(Ws={}));function WG(e){switch(e){case 0:case"NULL_VALUE":return Ws.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Ws.UNRECOGNIZED}}o(WG,"nullValueFromJSON");function HG(e){switch(e){case Ws.NULL_VALUE:return"NULL_VALUE";case Ws.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(HG,"nullValueToJSON");function g6(){return{fields:{}}}o(g6,"createBaseStruct");var ee={encode(e,t=Zn.default.Writer.create()){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&y6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=g6();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=y6.decode(r,r.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:GE(e.fields)?Object.entries(e.fields).reduce((t,[r,n])=>(t[r]=n,t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([n,i])=>{t.fields[n]=i}))}return t},create(e){return ee.fromPartial(e??{})},fromPartial(e){let t=g6();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=i),r),{}),t},wrap(e){let t=g6();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function QE(){return{key:"",value:void 0}}o(QE,"createBaseStruct_FieldsEntry");var y6={encode(e,t=Zn.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&so.encode(so.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=QE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=so.unwrap(so.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:nu(e.key)?globalThis.String(e.key):"",value:nu(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return y6.fromPartial(e??{})},fromPartial(e){let t=QE();return t.key=e.key??"",t.value=e.value??void 0,t}};function _6(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}o(_6,"createBaseValue");var so={encode(e,t=Zn.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&ee.encode(ee.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Ia.encode(Ia.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_6();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=r.int32();continue;case 2:if(a!==17)break;i.numberValue=r.double();continue;case 3:if(a!==26)break;i.stringValue=r.string();continue;case 4:if(a!==32)break;i.boolValue=r.bool();continue;case 5:if(a!==42)break;i.structValue=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.listValue=Ia.unwrap(Ia.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{nullValue:nu(e.nullValue)?WG(e.nullValue):void 0,numberValue:nu(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:nu(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:nu(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:GE(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=HG(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return so.fromPartial(e??{})},fromPartial(e){let t=_6();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=_6();if(e===null)t.nullValue=Ws.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function A6(){return{values:[]}}o(A6,"createBaseListValue");var Ia={encode(e,t=Zn.default.Writer.create()){for(let r of e.values)so.encode(so.wrap(r),t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=A6();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(so.unwrap(so.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return Ia.fromPartial(e??{})},fromPartial(e){let t=A6();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=A6();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function GE(e){return typeof e=="object"&&e!==null}o(GE,"isObject");function nu(e){return e!=null}o(nu,"isSet");var Hs=xr(Js(),1);function qE(){return{seconds:BigInt("0"),nanos:0}}o(qE,"createBaseTimestamp");var Ze={encode(e,t=Hs.default.Writer.create()){if(e.seconds!==BigInt("0")){if(BigInt.asIntN(64,e.seconds)!==e.seconds)throw new globalThis.Error("value provided for field message.seconds of type int64 too large");t.uint32(8).int64(e.seconds.toString())}return e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let r=e instanceof Hs.default.Reader?e:Hs.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=qE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.seconds=XG(r.int64());continue;case 2:if(a!==16)break;i.nanos=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{seconds:JE(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:JE(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==BigInt("0")&&(t.seconds=e.seconds.toString()),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t},create(e){return Ze.fromPartial(e??{})},fromPartial(e){let t=qE();return t.seconds=e.seconds??BigInt("0"),t.nanos=e.nanos??0,t}};function XG(e){return BigInt(e.toString())}o(XG,"longToBigint");Hs.default.util.Long!==fi&&(Hs.default.util.Long=fi,Hs.default.configure());function JE(e){return e!=null}o(JE,"isSet");var je=xr(Js(),1);var df=xr(Js(),1);df.default.util.Long!==fi&&(df.default.util.Long=fi,df.default.configure());var zE;(function(e){e[e.FREE=0]="FREE",e[e.DEV=1]="DEV",e[e.PRO=2]="PRO",e[e.ENTERPRISE=3]="ENTERPRISE",e[e.ANONYMOUS=16]="ANONYMOUS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(zE||(zE={}));var WE;(function(e){e[e.ORG_MEMBER=0]="ORG_MEMBER",e[e.ORG_ADMIN=1]="ORG_ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(WE||(WE={}));var HE;(function(e){e[e.AND=0]="AND",e[e.OR=1]="OR",e[e.THEN=2]="THEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(HE||(HE={}));var XE;(function(e){e[e.READ=0]="READ",e[e.WRITE=1]="WRITE",e[e.ADMIN=2]="ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(XE||(XE={}));var ZE;(function(e){e[e.CREDIT_CARD=0]="CREDIT_CARD",e[e.INVOICE_FIAT=1]="INVOICE_FIAT",e[e.INVOICE_CRYPTO=2]="INVOICE_CRYPTO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ZE||(ZE={}));var KE;(function(e){e[e.GENERAL=0]="GENERAL",e[e.PROCESSOR_UPLOAD_FAILED=101]="PROCESSOR_UPLOAD_FAILED",e[e.PROCESSOR_UPLOAD_SUCCESS=102]="PROCESSOR_UPLOAD_SUCCESS",e[e.PROCESSOR_OBSOLETED=103]="PROCESSOR_OBSOLETED",e[e.PROCESSOR_STOPPED=104]="PROCESSOR_STOPPED",e[e.PROCESSOR_ACTIVATED=105]="PROCESSOR_ACTIVATED",e[e.PROCESSOR_GENERAL=106]="PROCESSOR_GENERAL",e[e.PROCESSOR_ERROR=107]="PROCESSOR_ERROR",e[e.EXPORT_TASK_FAILED=201]="EXPORT_TASK_FAILED",e[e.EXPORT_TASK_SUCCESS=202]="EXPORT_TASK_SUCCESS",e[e.BILLING_INVOICE=301]="BILLING_INVOICE",e[e.BILLING_PAYMENT=302]="BILLING_PAYMENT",e[e.BILLING_SUBSCRIPTION=303]="BILLING_SUBSCRIPTION",e[e.BILLING_USAGE=304]="BILLING_USAGE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(KE||(KE={}));var $E;(function(e){e[e.MIN=0]="MIN",e[e.SUM=1]="SUM",e[e.MAX=2]="MAX",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($E||($E={}));var YE;(function(e){e[e.PENDING=0]="PENDING",e[e.SET_USERNAME=1]="SET_USERNAME",e[e.BANNED=9]="BANNED",e[e.ACTIVE=10]="ACTIVE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(YE||(YE={}));var jE;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(jE||(jE={}));var eT;(function(e){e[e.SENTIO=0]="SENTIO",e[e.SUBGRAPH=1]="SUBGRAPH",e[e.ACTION=2]="ACTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(eT||(eT={}));var tT;(function(e){e[e.AVG=0]="AVG",e[e.SUM=1]="SUM",e[e.MIN=2]="MIN",e[e.MAX=3]="MAX",e[e.COUNT=4]="COUNT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(tT||(tT={}));var rT;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.EXISTS=9]="EXISTS",e[e.NOT_EXISTS=10]="NOT_EXISTS",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.CONTAINS=11]="CONTAINS",e[e.NOT_CONTAINS=12]="NOT_CONTAINS",e[e.IN=15]="IN",e[e.NOT_IN=16]="NOT_IN",e[e.IN_COHORTS=13]="IN_COHORTS",e[e.NOT_IN_COHORTS=14]="NOT_IN_COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(rT||(rT={}));var nT;(function(e){e[e.EVENTS=0]="EVENTS",e[e.COHORTS=1]="COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(nT||(nT={}));var iT;(function(e){e[e.SUM=0]="SUM",e[e.CUMULATIVE_SUM=6]="CUMULATIVE_SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.CUMULATIVE_DISTINCT_COUNT=9]="CUMULATIVE_DISTINCT_COUNT",e[e.CUMULATIVE_COUNT=12]="CUMULATIVE_COUNT",e[e.LAST=7]="LAST",e[e.CUMULATIVE_LAST=10]="CUMULATIVE_LAST",e[e.FIRST=8]="FIRST",e[e.CUMULATIVE_FIRST=11]="CUMULATIVE_FIRST",e[e.PERCENTILE_25TH=20]="PERCENTILE_25TH",e[e.PERCENTILE_75TH=21]="PERCENTILE_75TH",e[e.PERCENTILE_90TH=22]="PERCENTILE_90TH",e[e.PERCENTILE_95TH=23]="PERCENTILE_95TH",e[e.PERCENTILE_99TH=24]="PERCENTILE_99TH",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(iT||(iT={}));var aT;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(aT||(aT={}));var oT;(function(e){e[e.SUM=0]="SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.LAST=6]="LAST",e[e.FIRST=7]="FIRST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(oT||(oT={}));var sT;(function(e){e[e.PROCESSOR=0]="PROCESSOR",e[e.UI=1]="UI",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(sT||(sT={}));var dT;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.EMAIL=1]="EMAIL",e[e.SLACK=2]="SLACK",e[e.TELEGRAM=3]="TELEGRAM",e[e.WEBHOOK=4]="WEBHOOK",e[e.DISCORD=5]="DISCORD",e[e.PAGERDUTY=6]="PAGERDUTY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(dT||(dT={}));var uT;(function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.LIST=3]="LIST",e[e.TIME=4]="TIME",e[e.MAP=5]="MAP",e[e.JSON=6]="JSON",e[e.TOKEN=7]="TOKEN",e[e.DYNAMIC=8]="DYNAMIC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(uT||(uT={}));var cT;(function(e){e[e.OnOrAfter=0]="OnOrAfter",e[e.On=1]="On",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(cT||(cT={}));var pT;(function(e){e[e.Disable=0]="Disable",e[e.FirstInTimeRange=1]="FirstInTimeRange",e[e.FirstInGlobal=2]="FirstInGlobal",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(pT||(pT={}));var lT;(function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(lT||(lT={}));var mt;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(mt||(mt={}));function ZG(e){switch(e){case 0:case"NULL_VALUE":return mt.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return mt.UNRECOGNIZED}}o(ZG,"richValue_NullValueFromJSON");function KG(e){switch(e){case mt.NULL_VALUE:return"NULL_VALUE";case mt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(KG,"richValue_NullValueToJSON");function fT(){return{symbol:void 0,address:void 0}}o(fT,"createBaseCoinID");var Nn={encode(e,t=je.default.Writer.create()){return e.symbol!==void 0&&t.uint32(10).string(e.symbol),e.address!==void 0&&iu.encode(e.address,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=fT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.symbol=r.string();continue;case 2:if(a!==18)break;i.address=iu.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{symbol:It(e.symbol)?globalThis.String(e.symbol):void 0,address:It(e.address)?iu.fromJSON(e.address):void 0}},toJSON(e){let t={};return e.symbol!==void 0&&(t.symbol=e.symbol),e.address!==void 0&&(t.address=iu.toJSON(e.address)),t},create(e){return Nn.fromPartial(e??{})},fromPartial(e){let t=fT();return t.symbol=e.symbol??void 0,t.address=e.address!==void 0&&e.address!==null?iu.fromPartial(e.address):void 0,t}};function mT(){return{address:"",chain:""}}o(mT,"createBaseCoinID_AddressIdentifier");var iu={encode(e,t=je.default.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.chain!==""&&t.uint32(18).string(e.chain),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=mT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=r.string();continue;case 2:if(a!==18)break;i.chain=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{address:It(e.address)?globalThis.String(e.address):"",chain:It(e.chain)?globalThis.String(e.chain):""}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.chain!==""&&(t.chain=e.chain),t},create(e){return iu.fromPartial(e??{})},fromPartial(e){let t=mT();return t.address=e.address??"",t.chain=e.chain??"",t}};function hT(){return{nullValue:void 0,intValue:void 0,int64Value:void 0,floatValue:void 0,bytesValue:void 0,boolValue:void 0,stringValue:void 0,timestampValue:void 0,bigintValue:void 0,bigdecimalValue:void 0,listValue:void 0,structValue:void 0,tokenValue:void 0}}o(hT,"createBaseRichValue");var zt={encode(e,t=je.default.Writer.create()){if(e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.intValue!==void 0&&t.uint32(16).int32(e.intValue),e.int64Value!==void 0){if(BigInt.asIntN(64,e.int64Value)!==e.int64Value)throw new globalThis.Error("value provided for field message.int64Value of type int64 too large");t.uint32(104).int64(e.int64Value.toString())}return e.floatValue!==void 0&&t.uint32(25).double(e.floatValue),e.bytesValue!==void 0&&t.uint32(34).bytes(e.bytesValue),e.boolValue!==void 0&&t.uint32(40).bool(e.boolValue),e.stringValue!==void 0&&t.uint32(50).string(e.stringValue),e.timestampValue!==void 0&&Ze.encode(TT(e.timestampValue),t.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&Kr.encode(e.bigintValue,t.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&mi.encode(e.bigdecimalValue,t.uint32(74).fork()).ldelim(),e.listValue!==void 0&&Kn.encode(e.listValue,t.uint32(82).fork()).ldelim(),e.structValue!==void 0&&et.encode(e.structValue,t.uint32(90).fork()).ldelim(),e.tokenValue!==void 0&&uo.encode(e.tokenValue,t.uint32(98).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=hT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=r.int32();continue;case 2:if(a!==16)break;i.intValue=r.int32();continue;case 13:if(a!==104)break;i.int64Value=$G(r.int64());continue;case 3:if(a!==25)break;i.floatValue=r.double();continue;case 4:if(a!==34)break;i.bytesValue=r.bytes();continue;case 5:if(a!==40)break;i.boolValue=r.bool();continue;case 6:if(a!==50)break;i.stringValue=r.string();continue;case 7:if(a!==58)break;i.timestampValue=v6(Ze.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.bigintValue=Kr.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.bigdecimalValue=mi.decode(r,r.uint32());continue;case 10:if(a!==82)break;i.listValue=Kn.decode(r,r.uint32());continue;case 11:if(a!==90)break;i.structValue=et.decode(r,r.uint32());continue;case 12:if(a!==98)break;i.tokenValue=uo.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{nullValue:It(e.nullValue)?ZG(e.nullValue):void 0,intValue:It(e.intValue)?globalThis.Number(e.intValue):void 0,int64Value:It(e.int64Value)?BigInt(e.int64Value):void 0,floatValue:It(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:It(e.bytesValue)?IT(e.bytesValue):void 0,boolValue:It(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:It(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:It(e.timestampValue)?NT(e.timestampValue):void 0,bigintValue:It(e.bigintValue)?Kr.fromJSON(e.bigintValue):void 0,bigdecimalValue:It(e.bigdecimalValue)?mi.fromJSON(e.bigdecimalValue):void 0,listValue:It(e.listValue)?Kn.fromJSON(e.listValue):void 0,structValue:It(e.structValue)?et.fromJSON(e.structValue):void 0,tokenValue:It(e.tokenValue)?uo.fromJSON(e.tokenValue):void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=KG(e.nullValue)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.int64Value!==void 0&&(t.int64Value=e.int64Value.toString()),e.floatValue!==void 0&&(t.floatValue=e.floatValue),e.bytesValue!==void 0&&(t.bytesValue=ET(e.bytesValue)),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.timestampValue!==void 0&&(t.timestampValue=e.timestampValue.toISOString()),e.bigintValue!==void 0&&(t.bigintValue=Kr.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(t.bigdecimalValue=mi.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(t.listValue=Kn.toJSON(e.listValue)),e.structValue!==void 0&&(t.structValue=et.toJSON(e.structValue)),e.tokenValue!==void 0&&(t.tokenValue=uo.toJSON(e.tokenValue)),t},create(e){return zt.fromPartial(e??{})},fromPartial(e){let t=hT();return t.nullValue=e.nullValue??void 0,t.intValue=e.intValue??void 0,t.int64Value=e.int64Value??void 0,t.floatValue=e.floatValue??void 0,t.bytesValue=e.bytesValue??void 0,t.boolValue=e.boolValue??void 0,t.stringValue=e.stringValue??void 0,t.timestampValue=e.timestampValue??void 0,t.bigintValue=e.bigintValue!==void 0&&e.bigintValue!==null?Kr.fromPartial(e.bigintValue):void 0,t.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?mi.fromPartial(e.bigdecimalValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?Kn.fromPartial(e.listValue):void 0,t.structValue=e.structValue!==void 0&&e.structValue!==null?et.fromPartial(e.structValue):void 0,t.tokenValue=e.tokenValue!==void 0&&e.tokenValue!==null?uo.fromPartial(e.tokenValue):void 0,t}};function gT(){return{fields:{}}}o(gT,"createBaseRichStruct");var et={encode(e,t=je.default.Writer.create()){return Object.entries(e.fields).forEach(([r,n])=>{w6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=gT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=w6.decode(r,r.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:YG(e.fields)?Object.entries(e.fields).reduce((t,[r,n])=>(t[r]=zt.fromJSON(n),t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([n,i])=>{t.fields[n]=zt.toJSON(i)}))}return t},create(e){return et.fromPartial(e??{})},fromPartial(e){let t=gT();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=zt.fromPartial(i)),r),{}),t}};function _T(){return{key:"",value:void 0}}o(_T,"createBaseRichStruct_FieldsEntry");var w6={encode(e,t=je.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&zt.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_T();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=zt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:It(e.key)?globalThis.String(e.key):"",value:It(e.value)?zt.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=zt.toJSON(e.value)),t},create(e){return w6.fromPartial(e??{})},fromPartial(e){let t=_T();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?zt.fromPartial(e.value):void 0,t}};function AT(){return{values:[]}}o(AT,"createBaseRichValueList");var Kn={encode(e,t=je.default.Writer.create()){for(let r of e.values)zt.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=AT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(zt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(t=>zt.fromJSON(t)):[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values.map(r=>zt.toJSON(r))),t},create(e){return Kn.fromPartial(e??{})},fromPartial(e){let t=AT();return t.values=e.values?.map(r=>zt.fromPartial(r))||[],t}};function yT(){return{entities:[]}}o(yT,"createBaseRichStructList");var qo={encode(e,t=je.default.Writer.create()){for(let r of e.entities)et.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=yT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(et.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>et.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(r=>et.toJSON(r))),t},create(e){return qo.fromPartial(e??{})},fromPartial(e){let t=yT();return t.entities=e.entities?.map(r=>et.fromPartial(r))||[],t}};function wT(){return{value:void 0,exp:0}}o(wT,"createBaseBigDecimal");var mi={encode(e,t=je.default.Writer.create()){return e.value!==void 0&&Kr.encode(e.value,t.uint32(10).fork()).ldelim(),e.exp!==0&&t.uint32(16).int32(e.exp),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=wT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=Kr.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.exp=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{value:It(e.value)?Kr.fromJSON(e.value):void 0,exp:It(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=Kr.toJSON(e.value)),e.exp!==0&&(t.exp=Math.round(e.exp)),t},create(e){return mi.fromPartial(e??{})},fromPartial(e){let t=wT();return t.value=e.value!==void 0&&e.value!==null?Kr.fromPartial(e.value):void 0,t.exp=e.exp??0,t}};function vT(){return{negative:!1,data:new Uint8Array(0)}}o(vT,"createBaseBigInteger");var Kr={encode(e,t=je.default.Writer.create()){return e.negative!==!1&&t.uint32(8).bool(e.negative),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=vT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.negative=r.bool();continue;case 2:if(a!==18)break;i.data=r.bytes();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{negative:It(e.negative)?globalThis.Boolean(e.negative):!1,data:It(e.data)?IT(e.data):new Uint8Array(0)}},toJSON(e){let t={};return e.negative!==!1&&(t.negative=e.negative),e.data.length!==0&&(t.data=ET(e.data)),t},create(e){return Kr.fromPartial(e??{})},fromPartial(e){let t=vT();return t.negative=e.negative??!1,t.data=e.data??new Uint8Array(0),t}};function bT(){return{token:void 0,amount:void 0,specifiedAt:void 0}}o(bT,"createBaseTokenAmount");var uo={encode(e,t=je.default.Writer.create()){return e.token!==void 0&&Nn.encode(e.token,t.uint32(10).fork()).ldelim(),e.amount!==void 0&&mi.encode(e.amount,t.uint32(18).fork()).ldelim(),e.specifiedAt!==void 0&&Ze.encode(TT(e.specifiedAt),t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=bT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.token=Nn.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.amount=mi.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.specifiedAt=v6(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{token:It(e.token)?Nn.fromJSON(e.token):void 0,amount:It(e.amount)?mi.fromJSON(e.amount):void 0,specifiedAt:It(e.specifiedAt)?NT(e.specifiedAt):void 0}},toJSON(e){let t={};return e.token!==void 0&&(t.token=Nn.toJSON(e.token)),e.amount!==void 0&&(t.amount=mi.toJSON(e.amount)),e.specifiedAt!==void 0&&(t.specifiedAt=e.specifiedAt.toISOString()),t},create(e){return uo.fromPartial(e??{})},fromPartial(e){let t=bT();return t.token=e.token!==void 0&&e.token!==null?Nn.fromPartial(e.token):void 0,t.amount=e.amount!==void 0&&e.amount!==null?mi.fromPartial(e.amount):void 0,t.specifiedAt=e.specifiedAt??void 0,t}};function IT(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let t=globalThis.atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}}o(IT,"bytesFromBase64");function ET(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let t=[];return e.forEach(r=>{t.push(globalThis.String.fromCharCode(r))}),globalThis.btoa(t.join(""))}}o(ET,"base64FromBytes");function TT(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}o(TT,"toTimestamp");function v6(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}o(v6,"fromTimestamp");function NT(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):v6(Ze.fromJSON(e))}o(NT,"fromJsonTimestamp");function $G(e){return BigInt(e.toString())}o($G,"longToBigint");je.default.util.Long!==fi&&(je.default.util.Long=fi,je.default.configure());function YG(e){return typeof e=="object"&&e!==null}o(YG,"isObject");function It(e){return e!=null}o(It,"isSet");var Wt;(function(e){e[e.UNKNOWN_TYPE=0]="UNKNOWN_TYPE",e[e.COUNTER=1]="COUNTER",e[e.GAUGE=2]="GAUGE",e[e.HISTOGRAM=3]="HISTOGRAM",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Wt||(Wt={}));function jG(e){switch(e){case 0:case"UNKNOWN_TYPE":return Wt.UNKNOWN_TYPE;case 1:case"COUNTER":return Wt.COUNTER;case 2:case"GAUGE":return Wt.GAUGE;case 3:case"HISTOGRAM":return Wt.HISTOGRAM;case-1:case"UNRECOGNIZED":default:return Wt.UNRECOGNIZED}}o(jG,"metricTypeFromJSON");function eq(e){switch(e){case Wt.UNKNOWN_TYPE:return"UNKNOWN_TYPE";case Wt.COUNTER:return"COUNTER";case Wt.GAUGE:return"GAUGE";case Wt.HISTOGRAM:return"HISTOGRAM";case Wt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(eq,"metricTypeToJSON");var Lr;(function(e){e[e.COUNT=0]="COUNT",e[e.SUM=1]="SUM",e[e.AVG=2]="AVG",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.LAST=5]="LAST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Lr||(Lr={}));function tq(e){switch(e){case 0:case"COUNT":return Lr.COUNT;case 1:case"SUM":return Lr.SUM;case 2:case"AVG":return Lr.AVG;case 3:case"MIN":return Lr.MIN;case 4:case"MAX":return Lr.MAX;case 5:case"LAST":return Lr.LAST;case-1:case"UNRECOGNIZED":default:return Lr.UNRECOGNIZED}}o(tq,"aggregationTypeFromJSON");function rq(e){switch(e){case Lr.COUNT:return"COUNT";case Lr.SUM:return"SUM";case Lr.AVG:return"AVG";case Lr.MIN:return"MIN";case Lr.MAX:return"MAX";case Lr.LAST:return"LAST";case Lr.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(rq,"aggregationTypeToJSON");var hi;(function(e){e[e.ADDRESS=0]="ADDRESS",e[e.OBJECT=1]="OBJECT",e[e.WRAPPED_OBJECT=2]="WRAPPED_OBJECT",e[e.TYPE=3]="TYPE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(hi||(hi={}));function nq(e){switch(e){case 0:case"ADDRESS":return hi.ADDRESS;case 1:case"OBJECT":return hi.OBJECT;case 2:case"WRAPPED_OBJECT":return hi.WRAPPED_OBJECT;case 3:case"TYPE":return hi.TYPE;case-1:case"UNRECOGNIZED":default:return hi.UNRECOGNIZED}}o(nq,"moveOwnerTypeFromJSON");function iq(e){switch(e){case hi.ADDRESS:return"ADDRESS";case hi.OBJECT:return"OBJECT";case hi.WRAPPED_OBJECT:return"WRAPPED_OBJECT";case hi.TYPE:return"TYPE";case hi.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(iq,"moveOwnerTypeToJSON");var Ea;(function(e){e[e.ERC20=0]="ERC20",e[e.ERC721=1]="ERC721",e[e.ERC1155=2]="ERC1155",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ea||(Ea={}));function aq(e){switch(e){case 0:case"ERC20":return Ea.ERC20;case 1:case"ERC721":return Ea.ERC721;case 2:case"ERC1155":return Ea.ERC1155;case-1:case"UNRECOGNIZED":default:return Ea.UNRECOGNIZED}}o(aq,"addressTypeFromJSON");function oq(e){switch(e){case Ea.ERC20:return"ERC20";case Ea.ERC721:return"ERC721";case Ea.ERC1155:return"ERC1155";case Ea.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(oq,"addressTypeToJSON");var Me;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.ETH_LOG=1]="ETH_LOG",e[e.ETH_BLOCK=2]="ETH_BLOCK",e[e.ETH_TRACE=5]="ETH_TRACE",e[e.ETH_TRANSACTION=11]="ETH_TRANSACTION",e[e.SOL_INSTRUCTION=4]="SOL_INSTRUCTION",e[e.APT_EVENT=6]="APT_EVENT",e[e.APT_CALL=7]="APT_CALL",e[e.APT_RESOURCE=8]="APT_RESOURCE",e[e.SUI_EVENT=3]="SUI_EVENT",e[e.SUI_CALL=9]="SUI_CALL",e[e.SUI_OBJECT=10]="SUI_OBJECT",e[e.SUI_OBJECT_CHANGE=12]="SUI_OBJECT_CHANGE",e[e.FUEL_CALL=13]="FUEL_CALL",e[e.FUEL_RECEIPT=19]="FUEL_RECEIPT",e[e.FUEL_TRANSACTION=20]="FUEL_TRANSACTION",e[e.FUEL_BLOCK=17]="FUEL_BLOCK",e[e.COSMOS_CALL=14]="COSMOS_CALL",e[e.STARKNET_EVENT=15]="STARKNET_EVENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Me||(Me={}));function PS(e){switch(e){case 0:case"UNKNOWN":return Me.UNKNOWN;case 1:case"ETH_LOG":return Me.ETH_LOG;case 2:case"ETH_BLOCK":return Me.ETH_BLOCK;case 5:case"ETH_TRACE":return Me.ETH_TRACE;case 11:case"ETH_TRANSACTION":return Me.ETH_TRANSACTION;case 4:case"SOL_INSTRUCTION":return Me.SOL_INSTRUCTION;case 6:case"APT_EVENT":return Me.APT_EVENT;case 7:case"APT_CALL":return Me.APT_CALL;case 8:case"APT_RESOURCE":return Me.APT_RESOURCE;case 3:case"SUI_EVENT":return Me.SUI_EVENT;case 9:case"SUI_CALL":return Me.SUI_CALL;case 10:case"SUI_OBJECT":return Me.SUI_OBJECT;case 12:case"SUI_OBJECT_CHANGE":return Me.SUI_OBJECT_CHANGE;case 13:case"FUEL_CALL":return Me.FUEL_CALL;case 19:case"FUEL_RECEIPT":return Me.FUEL_RECEIPT;case 20:case"FUEL_TRANSACTION":return Me.FUEL_TRANSACTION;case 17:case"FUEL_BLOCK":return Me.FUEL_BLOCK;case 14:case"COSMOS_CALL":return Me.COSMOS_CALL;case 15:case"STARKNET_EVENT":return Me.STARKNET_EVENT;case-1:case"UNRECOGNIZED":default:return Me.UNRECOGNIZED}}o(PS,"handlerTypeFromJSON");function LS(e){switch(e){case Me.UNKNOWN:return"UNKNOWN";case Me.ETH_LOG:return"ETH_LOG";case Me.ETH_BLOCK:return"ETH_BLOCK";case Me.ETH_TRACE:return"ETH_TRACE";case Me.ETH_TRANSACTION:return"ETH_TRANSACTION";case Me.SOL_INSTRUCTION:return"SOL_INSTRUCTION";case Me.APT_EVENT:return"APT_EVENT";case Me.APT_CALL:return"APT_CALL";case Me.APT_RESOURCE:return"APT_RESOURCE";case Me.SUI_EVENT:return"SUI_EVENT";case Me.SUI_CALL:return"SUI_CALL";case Me.SUI_OBJECT:return"SUI_OBJECT";case Me.SUI_OBJECT_CHANGE:return"SUI_OBJECT_CHANGE";case Me.FUEL_CALL:return"FUEL_CALL";case Me.FUEL_RECEIPT:return"FUEL_RECEIPT";case Me.FUEL_TRANSACTION:return"FUEL_TRANSACTION";case Me.FUEL_BLOCK:return"FUEL_BLOCK";case Me.COSMOS_CALL:return"COSMOS_CALL";case Me.STARKNET_EVENT:return"STARKNET_EVENT";case Me.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(LS,"handlerTypeToJSON");var dn;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.CRITICAL=4]="CRITICAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(dn||(dn={}));function sq(e){switch(e){case 0:case"DEBUG":return dn.DEBUG;case 1:case"INFO":return dn.INFO;case 2:case"WARNING":return dn.WARNING;case 3:case"ERROR":return dn.ERROR;case 4:case"CRITICAL":return dn.CRITICAL;case-1:case"UNRECOGNIZED":default:return dn.UNRECOGNIZED}}o(sq,"logLevelFromJSON");function dq(e){switch(e){case dn.DEBUG:return"DEBUG";case dn.INFO:return"INFO";case dn.WARNING:return"WARNING";case dn.ERROR:return"ERROR";case dn.CRITICAL:return"CRITICAL";case dn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(dq,"logLevelToJSON");var zo;(function(e){e[e.BY_LOG_INDEX=0]="BY_LOG_INDEX",e[e.BY_PROCESSOR_AND_LOG_INDEX=1]="BY_PROCESSOR_AND_LOG_INDEX",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(zo||(zo={}));function uq(e){switch(e){case 0:case"BY_LOG_INDEX":return zo.BY_LOG_INDEX;case 1:case"BY_PROCESSOR_AND_LOG_INDEX":return zo.BY_PROCESSOR_AND_LOG_INDEX;case-1:case"UNRECOGNIZED":default:return zo.UNRECOGNIZED}}o(uq,"executionConfig_HandlerOrderInsideTransactionFromJSON");function cq(e){switch(e){case zo.BY_LOG_INDEX:return"BY_LOG_INDEX";case zo.BY_PROCESSOR_AND_LOG_INDEX:return"BY_PROCESSOR_AND_LOG_INDEX";case zo.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(cq,"executionConfig_HandlerOrderInsideTransactionToJSON");var Wo;(function(e){e[e.AVG=0]="AVG",e[e.MEDIAN=1]="MEDIAN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Wo||(Wo={}));function K1e(e){switch(e){case 0:case"AVG":return Wo.AVG;case 1:case"MEDIAN":return Wo.MEDIAN;case-1:case"UNRECOGNIZED":default:return Wo.UNRECOGNIZED}}o(K1e,"totalPerEntityAggregation_TypeFromJSON");function $1e(e){switch(e){case Wo.AVG:return"AVG";case Wo.MEDIAN:return"MEDIAN";case Wo.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o($1e,"totalPerEntityAggregation_TypeToJSON");var $r;(function(e){e[e.STRING=0]="STRING",e[e.DOUBLE=1]="DOUBLE",e[e.BOOL=2]="BOOL",e[e.TIMESTAMP=3]="TIMESTAMP",e[e.BIG_INTEGER=4]="BIG_INTEGER",e[e.BIG_DECIMAL=5]="BIG_DECIMAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($r||($r={}));function pq(e){switch(e){case 0:case"STRING":return $r.STRING;case 1:case"DOUBLE":return $r.DOUBLE;case 2:case"BOOL":return $r.BOOL;case 3:case"TIMESTAMP":return $r.TIMESTAMP;case 4:case"BIG_INTEGER":return $r.BIG_INTEGER;case 5:case"BIG_DECIMAL":return $r.BIG_DECIMAL;case-1:case"UNRECOGNIZED":default:return $r.UNRECOGNIZED}}o(pq,"eventLogConfig_BasicFieldTypeFromJSON");function lq(e){switch(e){case $r.STRING:return"STRING";case $r.DOUBLE:return"DOUBLE";case $r.BOOL:return"BOOL";case $r.TIMESTAMP:return"TIMESTAMP";case $r.BIG_INTEGER:return"BIG_INTEGER";case $r.BIG_DECIMAL:return"BIG_DECIMAL";case $r.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(lq,"eventLogConfig_BasicFieldTypeToJSON");var gi;(function(e){e[e.BLOCK_NUMBER=0]="BLOCK_NUMBER",e[e.SEQ_MODE=1]="SEQ_MODE",e[e.UNIQUE_VALUE=2]="UNIQUE_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(gi||(gi={}));function fq(e){switch(e){case 0:case"BLOCK_NUMBER":return gi.BLOCK_NUMBER;case 1:case"SEQ_MODE":return gi.SEQ_MODE;case 2:case"UNIQUE_VALUE":return gi.UNIQUE_VALUE;case-1:case"UNRECOGNIZED":default:return gi.UNRECOGNIZED}}o(fq,"processStreamResponse_Partitions_Partition_SysValueFromJSON");function mq(e){switch(e){case gi.BLOCK_NUMBER:return"BLOCK_NUMBER";case gi.SEQ_MODE:return"SEQ_MODE";case gi.UNIQUE_VALUE:return"UNIQUE_VALUE";case gi.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(mq,"processStreamResponse_Partitions_Partition_SysValueToJSON");var Pn;(function(e){e[e.SET=0]="SET",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Pn||(Pn={}));function hq(e){switch(e){case 0:case"SET":return Pn.SET;case 1:case"ADD":return Pn.ADD;case 2:case"MULTIPLY":return Pn.MULTIPLY;case-1:case"UNRECOGNIZED":default:return Pn.UNRECOGNIZED}}o(hq,"entityUpdateData_OperatorFromJSON");function gq(e){switch(e){case Pn.SET:return"SET";case Pn.ADD:return"ADD";case Pn.MULTIPLY:return"MULTIPLY";case Pn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(gq,"entityUpdateData_OperatorToJSON");var Ue;(function(e){e[e.EQ=0]="EQ",e[e.NE=1]="NE",e[e.GT=2]="GT",e[e.GE=3]="GE",e[e.LT=4]="LT",e[e.LE=5]="LE",e[e.IN=6]="IN",e[e.NOT_IN=7]="NOT_IN",e[e.LIKE=8]="LIKE",e[e.NOT_LIKE=9]="NOT_LIKE",e[e.HAS_ALL=10]="HAS_ALL",e[e.HAS_ANY=11]="HAS_ANY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ue||(Ue={}));function _q(e){switch(e){case 0:case"EQ":return Ue.EQ;case 1:case"NE":return Ue.NE;case 2:case"GT":return Ue.GT;case 3:case"GE":return Ue.GE;case 4:case"LT":return Ue.LT;case 5:case"LE":return Ue.LE;case 6:case"IN":return Ue.IN;case 7:case"NOT_IN":return Ue.NOT_IN;case 8:case"LIKE":return Ue.LIKE;case 9:case"NOT_LIKE":return Ue.NOT_LIKE;case 10:case"HAS_ALL":return Ue.HAS_ALL;case 11:case"HAS_ANY":return Ue.HAS_ANY;case-1:case"UNRECOGNIZED":default:return Ue.UNRECOGNIZED}}o(_q,"dBRequest_DBOperatorFromJSON");function Aq(e){switch(e){case Ue.EQ:return"EQ";case Ue.NE:return"NE";case Ue.GT:return"GT";case Ue.GE:return"GE";case Ue.LT:return"LT";case Ue.LE:return"LE";case Ue.IN:return"IN";case Ue.NOT_IN:return"NOT_IN";case Ue.LIKE:return"LIKE";case Ue.NOT_LIKE:return"NOT_LIKE";case Ue.HAS_ALL:return"HAS_ALL";case Ue.HAS_ANY:return"HAS_ANY";case Ue.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(Aq,"dBRequest_DBOperatorToJSON");var Sn;(function(e){e[e.EVENT=0]="EVENT",e[e.GAUGE=1]="GAUGE",e[e.COUNTER=2]="COUNTER",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Sn||(Sn={}));function yq(e){switch(e){case 0:case"EVENT":return Sn.EVENT;case 1:case"GAUGE":return Sn.GAUGE;case 2:case"COUNTER":return Sn.COUNTER;case-1:case"UNRECOGNIZED":default:return Sn.UNRECOGNIZED}}o(yq,"timeseriesResult_TimeseriesTypeFromJSON");function wq(e){switch(e){case Sn.EVENT:return"EVENT";case Sn.GAUGE:return"GAUGE";case Sn.COUNTER:return"COUNTER";case Sn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(wq,"timeseriesResult_TimeseriesTypeToJSON");function ST(){return{name:"",version:""}}o(ST,"createBaseProjectConfig");var Ui={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.version!==""&&t.uint32(26).string(e.version),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ST();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 3:if(a!==26)break;i.version=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",version:S(e.version)?globalThis.String(e.version):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.version!==""&&(t.version=e.version),t},create(e){return Ui.fromPartial(e??{})},fromPartial(e){let t=ST();return t.name=e.name??"",t.version=e.version??"",t}};function CT(){return{sequential:!1,forceExactBlockTime:!1,handlerOrderInsideTransaction:0,processBindingTimeout:0,skipStartBlockValidation:!1,rpcRetryTimes:0,ethAbiDecoderConfig:void 0}}o(CT,"createBaseExecutionConfig");var Qi={encode(e,t=b.default.Writer.create()){return e.sequential!==!1&&t.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&t.uint32(16).bool(e.forceExactBlockTime),e.handlerOrderInsideTransaction!==0&&t.uint32(56).int32(e.handlerOrderInsideTransaction),e.processBindingTimeout!==0&&t.uint32(24).int32(e.processBindingTimeout),e.skipStartBlockValidation!==!1&&t.uint32(32).bool(e.skipStartBlockValidation),e.rpcRetryTimes!==0&&t.uint32(40).int32(e.rpcRetryTimes),e.ethAbiDecoderConfig!==void 0&&au.encode(e.ethAbiDecoderConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=CT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.sequential=r.bool();continue;case 2:if(a!==16)break;i.forceExactBlockTime=r.bool();continue;case 7:if(a!==56)break;i.handlerOrderInsideTransaction=r.int32();continue;case 3:if(a!==24)break;i.processBindingTimeout=r.int32();continue;case 4:if(a!==32)break;i.skipStartBlockValidation=r.bool();continue;case 5:if(a!==40)break;i.rpcRetryTimes=r.int32();continue;case 6:if(a!==50)break;i.ethAbiDecoderConfig=au.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{sequential:S(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:S(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,handlerOrderInsideTransaction:S(e.handlerOrderInsideTransaction)?uq(e.handlerOrderInsideTransaction):0,processBindingTimeout:S(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0,skipStartBlockValidation:S(e.skipStartBlockValidation)?globalThis.Boolean(e.skipStartBlockValidation):!1,rpcRetryTimes:S(e.rpcRetryTimes)?globalThis.Number(e.rpcRetryTimes):0,ethAbiDecoderConfig:S(e.ethAbiDecoderConfig)?au.fromJSON(e.ethAbiDecoderConfig):void 0}},toJSON(e){let t={};return e.sequential!==!1&&(t.sequential=e.sequential),e.forceExactBlockTime!==!1&&(t.forceExactBlockTime=e.forceExactBlockTime),e.handlerOrderInsideTransaction!==0&&(t.handlerOrderInsideTransaction=cq(e.handlerOrderInsideTransaction)),e.processBindingTimeout!==0&&(t.processBindingTimeout=Math.round(e.processBindingTimeout)),e.skipStartBlockValidation!==!1&&(t.skipStartBlockValidation=e.skipStartBlockValidation),e.rpcRetryTimes!==0&&(t.rpcRetryTimes=Math.round(e.rpcRetryTimes)),e.ethAbiDecoderConfig!==void 0&&(t.ethAbiDecoderConfig=au.toJSON(e.ethAbiDecoderConfig)),t},create(e){return Qi.fromPartial(e??{})},fromPartial(e){let t=CT();return t.sequential=e.sequential??!1,t.forceExactBlockTime=e.forceExactBlockTime??!1,t.handlerOrderInsideTransaction=e.handlerOrderInsideTransaction??0,t.processBindingTimeout=e.processBindingTimeout??0,t.skipStartBlockValidation=e.skipStartBlockValidation??!1,t.rpcRetryTimes=e.rpcRetryTimes??0,t.ethAbiDecoderConfig=e.ethAbiDecoderConfig!==void 0&&e.ethAbiDecoderConfig!==null?au.fromPartial(e.ethAbiDecoderConfig):void 0,t}};function OT(){return{enabled:!1,workerCount:void 0,skipWhenDecodeFailed:void 0}}o(OT,"createBaseExecutionConfig_DecoderWorkerConfig");var au={encode(e,t=b.default.Writer.create()){return e.enabled!==!1&&t.uint32(8).bool(e.enabled),e.workerCount!==void 0&&t.uint32(16).int32(e.workerCount),e.skipWhenDecodeFailed!==void 0&&t.uint32(24).bool(e.skipWhenDecodeFailed),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=OT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.enabled=r.bool();continue;case 2:if(a!==16)break;i.workerCount=r.int32();continue;case 3:if(a!==24)break;i.skipWhenDecodeFailed=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{enabled:S(e.enabled)?globalThis.Boolean(e.enabled):!1,workerCount:S(e.workerCount)?globalThis.Number(e.workerCount):void 0,skipWhenDecodeFailed:S(e.skipWhenDecodeFailed)?globalThis.Boolean(e.skipWhenDecodeFailed):void 0}},toJSON(e){let t={};return e.enabled!==!1&&(t.enabled=e.enabled),e.workerCount!==void 0&&(t.workerCount=Math.round(e.workerCount)),e.skipWhenDecodeFailed!==void 0&&(t.skipWhenDecodeFailed=e.skipWhenDecodeFailed),t},create(e){return au.fromPartial(e??{})},fromPartial(e){let t=OT();return t.enabled=e.enabled??!1,t.workerCount=e.workerCount??void 0,t.skipWhenDecodeFailed=e.skipWhenDecodeFailed??void 0,t}};function BT(){return{}}o(BT,"createBaseProcessConfigRequest");var N6={encode(e,t=b.default.Writer.create()){return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=BT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return N6.fromPartial(e??{})},fromPartial(e){return BT()}};function RT(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}o(RT,"createBaseProcessConfigResponse");var S6={encode(e,t=b.default.Writer.create()){e.config!==void 0&&Ui.encode(e.config,t.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&Qi.encode(e.executionConfig,t.uint32(74).fork()).ldelim();for(let r of e.contractConfigs)Gi.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.templateInstances)Xt.encode(r,t.uint32(26).fork()).ldelim();for(let r of e.accountConfigs)Wi.encode(r,t.uint32(34).fork()).ldelim();for(let r of e.metricConfigs)un.encode(r,t.uint32(42).fork()).ldelim();for(let r of e.exportConfigs)Ji.encode(r,t.uint32(58).fork()).ldelim();for(let r of e.eventLogConfigs)Dn.encode(r,t.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&qi.encode(e.dbSchema,t.uint32(82).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=RT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.config=Ui.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.executionConfig=Qi.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.contractConfigs.push(Gi.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.templateInstances.push(Xt.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push(Wi.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.metricConfigs.push(un.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.exportConfigs.push(Ji.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.eventLogConfigs.push(Dn.decode(r,r.uint32()));continue;case 10:if(a!==82)break;i.dbSchema=qi.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{config:S(e.config)?Ui.fromJSON(e.config):void 0,executionConfig:S(e.executionConfig)?Qi.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>Gi.fromJSON(t)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>Xt.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>Wi.fromJSON(t)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>un.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Ji.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>Dn.fromJSON(t)):[],dbSchema:S(e.dbSchema)?qi.fromJSON(e.dbSchema):void 0}},toJSON(e){let t={};return e.config!==void 0&&(t.config=Ui.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=Qi.toJSON(e.executionConfig)),e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(r=>Gi.toJSON(r))),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(r=>Xt.toJSON(r))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(r=>Wi.toJSON(r))),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(r=>un.toJSON(r))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(r=>Ji.toJSON(r))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(r=>Dn.toJSON(r))),e.dbSchema!==void 0&&(t.dbSchema=qi.toJSON(e.dbSchema)),t},create(e){return S6.fromPartial(e??{})},fromPartial(e){let t=RT();return t.config=e.config!==void 0&&e.config!==null?Ui.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?Qi.fromPartial(e.executionConfig):void 0,t.contractConfigs=e.contractConfigs?.map(r=>Gi.fromPartial(r))||[],t.templateInstances=e.templateInstances?.map(r=>Xt.fromPartial(r))||[],t.accountConfigs=e.accountConfigs?.map(r=>Wi.fromPartial(r))||[],t.metricConfigs=e.metricConfigs?.map(r=>un.fromPartial(r))||[],t.exportConfigs=e.exportConfigs?.map(r=>Ji.fromPartial(r))||[],t.eventLogConfigs=e.eventLogConfigs?.map(r=>Dn.fromPartial(r))||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?qi.fromPartial(e.dbSchema):void 0,t}};function xT(){return{contractConfigs:[],accountConfigs:[]}}o(xT,"createBaseConfigureHandlersResponse");var vq={encode(e,t=b.default.Writer.create()){for(let r of e.contractConfigs)Gi.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.accountConfigs)Wi.encode(r,t.uint32(34).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=xT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.contractConfigs.push(Gi.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push(Wi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>Gi.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>Wi.fromJSON(t)):[]}},toJSON(e){let t={};return e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(r=>Gi.toJSON(r))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(r=>Wi.toJSON(r))),t},create(e){return vq.fromPartial(e??{})},fromPartial(e){let t=xT();return t.contractConfigs=e.contractConfigs?.map(r=>Gi.fromPartial(r))||[],t.accountConfigs=e.accountConfigs?.map(r=>Wi.fromPartial(r))||[],t}};function kT(){return{contract:void 0,intervalConfigs:[],moveIntervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelTransactionConfigs:[],assetConfigs:[],fuelReceiptConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}o(kT,"createBaseContractConfig");var Gi={encode(e,t=b.default.Writer.create()){e.contract!==void 0&&Xi.encode(e.contract,t.uint32(10).fork()).ldelim();for(let r of e.intervalConfigs)Ht.encode(r,t.uint32(90).fork()).ldelim();for(let r of e.moveIntervalConfigs)Hi.encode(r,t.uint32(154).fork()).ldelim();for(let r of e.logConfigs)Zi.encode(r,t.uint32(26).fork()).ldelim();for(let r of e.traceConfigs)su.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.transactionConfig)du.encode(r,t.uint32(58).fork()).ldelim();for(let r of e.moveEventConfigs)yu.encode(r,t.uint32(74).fork()).ldelim();for(let r of e.moveCallConfigs)Ki.encode(r,t.uint32(82).fork()).ldelim();for(let r of e.moveResourceChangeConfigs)$i.encode(r,t.uint32(98).fork()).ldelim();for(let r of e.fuelTransactionConfigs)Nu.encode(r,t.uint32(162).fork()).ldelim();for(let r of e.assetConfigs)uu.encode(r,t.uint32(114).fork()).ldelim();for(let r of e.fuelReceiptConfigs)pu.encode(r,t.uint32(170).fork()).ldelim();for(let r of e.cosmosLogConfigs)mu.encode(r,t.uint32(130).fork()).ldelim();for(let r of e.starknetEventConfigs)Iu.encode(r,t.uint32(138).fork()).ldelim();if(e.instructionConfig!==void 0&&gu.encode(e.instructionConfig,t.uint32(50).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(32).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(40).uint64(e.endBlock.toString())}return e.processorType!==""&&t.uint32(66).string(e.processorType),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=kT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=Xi.decode(r,r.uint32());continue;case 11:if(a!==90)break;i.intervalConfigs.push(Ht.decode(r,r.uint32()));continue;case 19:if(a!==154)break;i.moveIntervalConfigs.push(Hi.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.logConfigs.push(Zi.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.traceConfigs.push(su.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.transactionConfig.push(du.decode(r,r.uint32()));continue;case 9:if(a!==74)break;i.moveEventConfigs.push(yu.decode(r,r.uint32()));continue;case 10:if(a!==82)break;i.moveCallConfigs.push(Ki.decode(r,r.uint32()));continue;case 12:if(a!==98)break;i.moveResourceChangeConfigs.push($i.decode(r,r.uint32()));continue;case 20:if(a!==162)break;i.fuelTransactionConfigs.push(Nu.decode(r,r.uint32()));continue;case 14:if(a!==114)break;i.assetConfigs.push(uu.decode(r,r.uint32()));continue;case 21:if(a!==170)break;i.fuelReceiptConfigs.push(pu.decode(r,r.uint32()));continue;case 16:if(a!==130)break;i.cosmosLogConfigs.push(mu.decode(r,r.uint32()));continue;case 17:if(a!==138)break;i.starknetEventConfigs.push(Iu.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.instructionConfig=gu.decode(r,r.uint32());continue;case 4:if(a!==32)break;i.startBlock=Fr(r.uint64());continue;case 5:if(a!==40)break;i.endBlock=Fr(r.uint64());continue;case 8:if(a!==66)break;i.processorType=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{contract:S(e.contract)?Xi.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>Ht.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Hi.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>Zi.fromJSON(t)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(t=>su.fromJSON(t)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(t=>du.fromJSON(t)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(t=>yu.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>Ki.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>$i.fromJSON(t)):[],fuelTransactionConfigs:globalThis.Array.isArray(e?.fuelTransactionConfigs)?e.fuelTransactionConfigs.map(t=>Nu.fromJSON(t)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(t=>uu.fromJSON(t)):[],fuelReceiptConfigs:globalThis.Array.isArray(e?.fuelReceiptConfigs)?e.fuelReceiptConfigs.map(t=>pu.fromJSON(t)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(t=>mu.fromJSON(t)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(t=>Iu.fromJSON(t)):[],instructionConfig:S(e.instructionConfig)?gu.fromJSON(e.instructionConfig):void 0,startBlock:S(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:S(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:S(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=Xi.toJSON(e.contract)),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(r=>Ht.toJSON(r))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(r=>Hi.toJSON(r))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(r=>Zi.toJSON(r))),e.traceConfigs?.length&&(t.traceConfigs=e.traceConfigs.map(r=>su.toJSON(r))),e.transactionConfig?.length&&(t.transactionConfig=e.transactionConfig.map(r=>du.toJSON(r))),e.moveEventConfigs?.length&&(t.moveEventConfigs=e.moveEventConfigs.map(r=>yu.toJSON(r))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(r=>Ki.toJSON(r))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(r=>$i.toJSON(r))),e.fuelTransactionConfigs?.length&&(t.fuelTransactionConfigs=e.fuelTransactionConfigs.map(r=>Nu.toJSON(r))),e.assetConfigs?.length&&(t.assetConfigs=e.assetConfigs.map(r=>uu.toJSON(r))),e.fuelReceiptConfigs?.length&&(t.fuelReceiptConfigs=e.fuelReceiptConfigs.map(r=>pu.toJSON(r))),e.cosmosLogConfigs?.length&&(t.cosmosLogConfigs=e.cosmosLogConfigs.map(r=>mu.toJSON(r))),e.starknetEventConfigs?.length&&(t.starknetEventConfigs=e.starknetEventConfigs.map(r=>Iu.toJSON(r))),e.instructionConfig!==void 0&&(t.instructionConfig=gu.toJSON(e.instructionConfig)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.processorType!==""&&(t.processorType=e.processorType),t},create(e){return Gi.fromPartial(e??{})},fromPartial(e){let t=kT();return t.contract=e.contract!==void 0&&e.contract!==null?Xi.fromPartial(e.contract):void 0,t.intervalConfigs=e.intervalConfigs?.map(r=>Ht.fromPartial(r))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(r=>Hi.fromPartial(r))||[],t.logConfigs=e.logConfigs?.map(r=>Zi.fromPartial(r))||[],t.traceConfigs=e.traceConfigs?.map(r=>su.fromPartial(r))||[],t.transactionConfig=e.transactionConfig?.map(r=>du.fromPartial(r))||[],t.moveEventConfigs=e.moveEventConfigs?.map(r=>yu.fromPartial(r))||[],t.moveCallConfigs=e.moveCallConfigs?.map(r=>Ki.fromPartial(r))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(r=>$i.fromPartial(r))||[],t.fuelTransactionConfigs=e.fuelTransactionConfigs?.map(r=>Nu.fromPartial(r))||[],t.assetConfigs=e.assetConfigs?.map(r=>uu.fromPartial(r))||[],t.fuelReceiptConfigs=e.fuelReceiptConfigs?.map(r=>pu.fromPartial(r))||[],t.cosmosLogConfigs=e.cosmosLogConfigs?.map(r=>mu.fromPartial(r))||[],t.starknetEventConfigs=e.starknetEventConfigs?.map(r=>Iu.fromPartial(r))||[],t.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?gu.fromPartial(e.instructionConfig):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.processorType=e.processorType??"",t}};function DT(){return{gqlSchema:""}}o(DT,"createBaseDataBaseSchema");var qi={encode(e,t=b.default.Writer.create()){return e.gqlSchema!==""&&t.uint32(10).string(e.gqlSchema),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=DT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gqlSchema=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{gqlSchema:S(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let t={};return e.gqlSchema!==""&&(t.gqlSchema=e.gqlSchema),t},create(e){return qi.fromPartial(e??{})},fromPartial(e){let t=DT();return t.gqlSchema=e.gqlSchema??"",t}};function PT(){return{}}o(PT,"createBaseTotalPerEntityAggregation");var bq={encode(e,t=b.default.Writer.create()){return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=PT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return bq.fromPartial(e??{})},fromPartial(e){return PT()}};function LT(){return{retentionEventName:"",days:0}}o(LT,"createBaseRetentionConfig");var Iq={encode(e,t=b.default.Writer.create()){return e.retentionEventName!==""&&t.uint32(18).string(e.retentionEventName),e.days!==0&&t.uint32(24).int32(e.days),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=LT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.retentionEventName=r.string();continue;case 3:if(a!==24)break;i.days=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{retentionEventName:S(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:S(e.days)?globalThis.Number(e.days):0}},toJSON(e){let t={};return e.retentionEventName!==""&&(t.retentionEventName=e.retentionEventName),e.days!==0&&(t.days=Math.round(e.days)),t},create(e){return Iq.fromPartial(e??{})},fromPartial(e){let t=LT();return t.retentionEventName=e.retentionEventName??"",t.days=e.days??0,t}};function FT(){return{name:"",channel:""}}o(FT,"createBaseExportConfig");var Ji={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.channel!==""&&t.uint32(18).string(e.channel),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=FT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==18)break;i.channel=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",channel:S(e.channel)?globalThis.String(e.channel):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.channel!==""&&(t.channel=e.channel),t},create(e){return Ji.fromPartial(e??{})},fromPartial(e){let t=FT();return t.name=e.name??"",t.channel=e.channel??"",t}};function VT(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}o(VT,"createBaseMetricConfig");var un={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.unit!==""&&t.uint32(18).string(e.unit),e.sparse!==!1&&t.uint32(32).bool(e.sparse),e.persistentBetweenVersion!==!1&&t.uint32(40).bool(e.persistentBetweenVersion),e.type!==0&&t.uint32(56).int32(e.type),e.aggregationConfig!==void 0&&ou.encode(e.aggregationConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=VT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 3:if(a!==26)break;i.description=r.string();continue;case 2:if(a!==18)break;i.unit=r.string();continue;case 4:if(a!==32)break;i.sparse=r.bool();continue;case 5:if(a!==40)break;i.persistentBetweenVersion=r.bool();continue;case 7:if(a!==56)break;i.type=r.int32();continue;case 6:if(a!==50)break;i.aggregationConfig=ou.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",description:S(e.description)?globalThis.String(e.description):"",unit:S(e.unit)?globalThis.String(e.unit):"",sparse:S(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:S(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:S(e.type)?jG(e.type):0,aggregationConfig:S(e.aggregationConfig)?ou.fromJSON(e.aggregationConfig):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.description!==""&&(t.description=e.description),e.unit!==""&&(t.unit=e.unit),e.sparse!==!1&&(t.sparse=e.sparse),e.persistentBetweenVersion!==!1&&(t.persistentBetweenVersion=e.persistentBetweenVersion),e.type!==0&&(t.type=eq(e.type)),e.aggregationConfig!==void 0&&(t.aggregationConfig=ou.toJSON(e.aggregationConfig)),t},create(e){return un.fromPartial(e??{})},fromPartial(e){let t=VT();return t.name=e.name??"",t.description=e.description??"",t.unit=e.unit??"",t.sparse=e.sparse??!1,t.persistentBetweenVersion=e.persistentBetweenVersion??!1,t.type=e.type??0,t.aggregationConfig=e.aggregationConfig!==void 0&&e.aggregationConfig!==null?ou.fromPartial(e.aggregationConfig):void 0,t}};function MT(){return{name:"",fields:[]}}o(MT,"createBaseEventLogConfig");var Dn={encode(e,t=b.default.Writer.create()){e.name!==""&&t.uint32(10).string(e.name);for(let r of e.fields)zi.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=MT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==18)break;i.fields.push(zi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>zi.fromJSON(t)):[]}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.fields?.length&&(t.fields=e.fields.map(r=>zi.toJSON(r))),t},create(e){return Dn.fromPartial(e??{})},fromPartial(e){let t=MT();return t.name=e.name??"",t.fields=e.fields?.map(r=>zi.fromPartial(r))||[],t}};function UT(){return{fields:[]}}o(UT,"createBaseEventLogConfig_StructFieldType");var Jo={encode(e,t=b.default.Writer.create()){for(let r of e.fields)zi.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=UT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.fields.push(zi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>zi.fromJSON(t)):[]}},toJSON(e){let t={};return e.fields?.length&&(t.fields=e.fields.map(r=>zi.toJSON(r))),t},create(e){return Jo.fromPartial(e??{})},fromPartial(e){let t=UT();return t.fields=e.fields?.map(r=>zi.fromPartial(r))||[],t}};function QT(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}o(QT,"createBaseEventLogConfig_Field");var zi={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.basicType!==void 0&&t.uint32(16).int32(e.basicType),e.coinType!==void 0&&Nn.encode(e.coinType,t.uint32(26).fork()).ldelim(),e.structType!==void 0&&Jo.encode(e.structType,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=QT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==16)break;i.basicType=r.int32();continue;case 3:if(a!==26)break;i.coinType=Nn.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.structType=Jo.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",basicType:S(e.basicType)?pq(e.basicType):void 0,coinType:S(e.coinType)?Nn.fromJSON(e.coinType):void 0,structType:S(e.structType)?Jo.fromJSON(e.structType):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.basicType!==void 0&&(t.basicType=lq(e.basicType)),e.coinType!==void 0&&(t.coinType=Nn.toJSON(e.coinType)),e.structType!==void 0&&(t.structType=Jo.toJSON(e.structType)),t},create(e){return zi.fromPartial(e??{})},fromPartial(e){let t=QT();return t.name=e.name??"",t.basicType=e.basicType??void 0,t.coinType=e.coinType!==void 0&&e.coinType!==null?Nn.fromPartial(e.coinType):void 0,t.structType=e.structType!==void 0&&e.structType!==null?Jo.fromPartial(e.structType):void 0,t}};function GT(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}o(GT,"createBaseAggregationConfig");var ou={encode(e,t=b.default.Writer.create()){t.uint32(10).fork();for(let r of e.intervalInMinutes)t.int32(r);t.ldelim(),t.uint32(18).fork();for(let r of e.types)t.int32(r);return t.ldelim(),e.discardOrigin!==!1&&t.uint32(24).bool(e.discardOrigin),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=GT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a===8){i.intervalInMinutes.push(r.int32());continue}if(a===10){let s=r.uint32()+r.pos;for(;r.pos<s;)i.intervalInMinutes.push(r.int32());continue}break;case 2:if(a===16){i.types.push(r.int32());continue}if(a===18){let s=r.uint32()+r.pos;for(;r.pos<s;)i.types.push(r.int32());continue}break;case 3:if(a!==24)break;i.discardOrigin=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{intervalInMinutes:globalThis.Array.isArray(e?.intervalInMinutes)?e.intervalInMinutes.map(t=>globalThis.Number(t)):[],types:globalThis.Array.isArray(e?.types)?e.types.map(t=>tq(t)):[],discardOrigin:S(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let t={};return e.intervalInMinutes?.length&&(t.intervalInMinutes=e.intervalInMinutes.map(r=>Math.round(r))),e.types?.length&&(t.types=e.types.map(r=>rq(r))),e.discardOrigin!==!1&&(t.discardOrigin=e.discardOrigin),t},create(e){return ou.fromPartial(e??{})},fromPartial(e){let t=GT();return t.intervalInMinutes=e.intervalInMinutes?.map(r=>r)||[],t.types=e.types?.map(r=>r)||[],t.discardOrigin=e.discardOrigin??!1,t}};function qT(){return{chainId:"",address:"",startBlock:BigInt("0"),endBlock:BigInt("0"),intervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],logConfigs:[]}}o(qT,"createBaseAccountConfig");var Wi={encode(e,t=b.default.Writer.create()){if(e.chainId!==""&&t.uint32(10).string(e.chainId),e.address!==""&&t.uint32(18).string(e.address),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(24).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(80).uint64(e.endBlock.toString())}for(let r of e.intervalConfigs)Ht.encode(r,t.uint32(34).fork()).ldelim();for(let r of e.moveIntervalConfigs)Hi.encode(r,t.uint32(58).fork()).ldelim();for(let r of e.moveCallConfigs)Ki.encode(r,t.uint32(66).fork()).ldelim();for(let r of e.moveResourceChangeConfigs)$i.encode(r,t.uint32(74).fork()).ldelim();for(let r of e.logConfigs)Zi.encode(r,t.uint32(50).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=qT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=r.string();continue;case 2:if(a!==18)break;i.address=r.string();continue;case 3:if(a!==24)break;i.startBlock=Fr(r.uint64());continue;case 10:if(a!==80)break;i.endBlock=Fr(r.uint64());continue;case 4:if(a!==34)break;i.intervalConfigs.push(Ht.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.moveIntervalConfigs.push(Hi.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.moveCallConfigs.push(Ki.decode(r,r.uint32()));continue;case 9:if(a!==74)break;i.moveResourceChangeConfigs.push($i.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.logConfigs.push(Zi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainId:S(e.chainId)?globalThis.String(e.chainId):"",address:S(e.address)?globalThis.String(e.address):"",startBlock:S(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:S(e.endBlock)?BigInt(e.endBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>Ht.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Hi.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>Ki.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>$i.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>Zi.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(r=>Ht.toJSON(r))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(r=>Hi.toJSON(r))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(r=>Ki.toJSON(r))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(r=>$i.toJSON(r))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(r=>Zi.toJSON(r))),t},create(e){return Wi.fromPartial(e??{})},fromPartial(e){let t=qT();return t.chainId=e.chainId??"",t.address=e.address??"",t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.intervalConfigs=e.intervalConfigs?.map(r=>Ht.fromPartial(r))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(r=>Hi.fromPartial(r))||[],t.moveCallConfigs=e.moveCallConfigs?.map(r=>Ki.fromPartial(r))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(r=>$i.fromPartial(r))||[],t.logConfigs=e.logConfigs?.map(r=>Zi.fromPartial(r))||[],t}};function JT(){return{recentInterval:0,backfillInterval:0}}o(JT,"createBaseHandleInterval");var Mi={encode(e,t=b.default.Writer.create()){return e.recentInterval!==0&&t.uint32(8).int32(e.recentInterval),e.backfillInterval!==0&&t.uint32(16).int32(e.backfillInterval),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=JT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.recentInterval=r.int32();continue;case 2:if(a!==16)break;i.backfillInterval=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{recentInterval:S(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:S(e.backfillInterval)?globalThis.Number(e.backfillInterval):0}},toJSON(e){let t={};return e.recentInterval!==0&&(t.recentInterval=Math.round(e.recentInterval)),e.backfillInterval!==0&&(t.backfillInterval=Math.round(e.backfillInterval)),t},create(e){return Mi.fromPartial(e??{})},fromPartial(e){let t=JT();return t.recentInterval=e.recentInterval??0,t.backfillInterval=e.backfillInterval??0,t}};function zT(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0,handlerName:""}}o(zT,"createBaseOnIntervalConfig");var Ht={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.minutes!==0&&t.uint32(16).int32(e.minutes),e.minutesInterval!==void 0&&Mi.encode(e.minutesInterval,t.uint32(34).fork()).ldelim(),e.slot!==0&&t.uint32(24).int32(e.slot),e.slotInterval!==void 0&&Mi.encode(e.slotInterval,t.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(50).fork()).ldelim(),e.handlerName!==""&&t.uint32(58).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=zT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue;case 2:if(a!==16)break;i.minutes=r.int32();continue;case 4:if(a!==34)break;i.minutesInterval=Mi.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.slot=r.int32();continue;case 5:if(a!==42)break;i.slotInterval=Mi.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:S(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:S(e.minutesInterval)?Mi.fromJSON(e.minutesInterval):void 0,slot:S(e.slot)?globalThis.Number(e.slot):0,slotInterval:S(e.slotInterval)?Mi.fromJSON(e.slotInterval):void 0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.minutes!==0&&(t.minutes=Math.round(e.minutes)),e.minutesInterval!==void 0&&(t.minutesInterval=Mi.toJSON(e.minutesInterval)),e.slot!==0&&(t.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(t.slotInterval=Mi.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Ht.fromPartial(e??{})},fromPartial(e){let t=zT();return t.handlerId=e.handlerId??0,t.minutes=e.minutes??0,t.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?Mi.fromPartial(e.minutesInterval):void 0,t.slot=e.slot??0,t.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?Mi.fromPartial(e.slotInterval):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function WT(){return{intervalConfig:void 0,type:""}}o(WT,"createBaseAptosOnIntervalConfig");var Eq={encode(e,t=b.default.Writer.create()){return e.intervalConfig!==void 0&&Ht.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=WT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=Ht.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.type=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:S(e.intervalConfig)?Ht.fromJSON(e.intervalConfig):void 0,type:S(e.type)?globalThis.String(e.type):""}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=Ht.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),t},create(e){return Eq.fromPartial(e??{})},fromPartial(e){let t=WT();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?Ht.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t}};function HT(){return{intervalConfig:void 0,type:"",ownerType:0,resourceFetchConfig:void 0,fetchConfig:void 0}}o(HT,"createBaseMoveOnIntervalConfig");var Hi={encode(e,t=b.default.Writer.create()){return e.intervalConfig!==void 0&&Ht.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),e.ownerType!==0&&t.uint32(24).int32(e.ownerType),e.resourceFetchConfig!==void 0&&Au.encode(e.resourceFetchConfig,t.uint32(34).fork()).ldelim(),e.fetchConfig!==void 0&&_n.encode(e.fetchConfig,t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=HT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=Ht.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.type=r.string();continue;case 3:if(a!==24)break;i.ownerType=r.int32();continue;case 4:if(a!==34)break;i.resourceFetchConfig=Au.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.fetchConfig=_n.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:S(e.intervalConfig)?Ht.fromJSON(e.intervalConfig):void 0,type:S(e.type)?globalThis.String(e.type):"",ownerType:S(e.ownerType)?nq(e.ownerType):0,resourceFetchConfig:S(e.resourceFetchConfig)?Au.fromJSON(e.resourceFetchConfig):void 0,fetchConfig:S(e.fetchConfig)?_n.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=Ht.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),e.ownerType!==0&&(t.ownerType=iq(e.ownerType)),e.resourceFetchConfig!==void 0&&(t.resourceFetchConfig=Au.toJSON(e.resourceFetchConfig)),e.fetchConfig!==void 0&&(t.fetchConfig=_n.toJSON(e.fetchConfig)),t},create(e){return Hi.fromPartial(e??{})},fromPartial(e){let t=HT();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?Ht.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t.ownerType=e.ownerType??0,t.resourceFetchConfig=e.resourceFetchConfig!==void 0&&e.resourceFetchConfig!==null?Au.fromPartial(e.resourceFetchConfig):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?_n.fromPartial(e.fetchConfig):void 0,t}};function XT(){return{name:"",chainId:"",address:"",abi:""}}o(XT,"createBaseContractInfo");var Xi={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.chainId!==""&&t.uint32(18).string(e.chainId),e.address!==""&&t.uint32(26).string(e.address),e.abi!==""&&t.uint32(34).string(e.abi),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=XT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==18)break;i.chainId=r.string();continue;case 3:if(a!==26)break;i.address=r.string();continue;case 4:if(a!==34)break;i.abi=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",chainId:S(e.chainId)?globalThis.String(e.chainId):"",address:S(e.address)?globalThis.String(e.address):"",abi:S(e.abi)?globalThis.String(e.abi):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.abi!==""&&(t.abi=e.abi),t},create(e){return Xi.fromPartial(e??{})},fromPartial(e){let t=XT();return t.name=e.name??"",t.chainId=e.chainId??"",t.address=e.address??"",t.abi=e.abi??"",t}};function ZT(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}o(ZT,"createBaseTemplateInstance");var Xt={encode(e,t=b.default.Writer.create()){if(e.contract!==void 0&&Xi.encode(e.contract,t.uint32(10).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(16).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(24).uint64(e.endBlock.toString())}return e.templateId!==0&&t.uint32(32).int32(e.templateId),e.baseLabels!==void 0&&ee.encode(ee.wrap(e.baseLabels),t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ZT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=Xi.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.startBlock=Fr(r.uint64());continue;case 3:if(a!==24)break;i.endBlock=Fr(r.uint64());continue;case 4:if(a!==32)break;i.templateId=r.int32();continue;case 5:if(a!==42)break;i.baseLabels=ee.unwrap(ee.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{contract:S(e.contract)?Xi.fromJSON(e.contract):void 0,startBlock:S(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:S(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:S(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:Nt(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=Xi.toJSON(e.contract)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.templateId!==0&&(t.templateId=Math.round(e.templateId)),e.baseLabels!==void 0&&(t.baseLabels=e.baseLabels),t},create(e){return Xt.fromPartial(e??{})},fromPartial(e){let t=ZT();return t.contract=e.contract!==void 0&&e.contract!==null?Xi.fromPartial(e.contract):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.templateId=e.templateId??0,t.baseLabels=e.baseLabels??void 0,t}};function KT(){return{chainIds:[],dbSchema:void 0,config:void 0,executionConfig:void 0,metricConfigs:[],exportConfigs:[],eventLogConfigs:[]}}o(KT,"createBaseInitResponse");var Tq={encode(e,t=b.default.Writer.create()){for(let r of e.chainIds)t.uint32(10).string(r);e.dbSchema!==void 0&&qi.encode(e.dbSchema,t.uint32(18).fork()).ldelim(),e.config!==void 0&&Ui.encode(e.config,t.uint32(26).fork()).ldelim(),e.executionConfig!==void 0&&Qi.encode(e.executionConfig,t.uint32(34).fork()).ldelim();for(let r of e.metricConfigs)un.encode(r,t.uint32(42).fork()).ldelim();for(let r of e.exportConfigs)Ji.encode(r,t.uint32(50).fork()).ldelim();for(let r of e.eventLogConfigs)Dn.encode(r,t.uint32(58).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=KT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainIds.push(r.string());continue;case 2:if(a!==18)break;i.dbSchema=qi.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.config=Ui.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.executionConfig=Qi.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.metricConfigs.push(un.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.exportConfigs.push(Ji.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.eventLogConfigs.push(Dn.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainIds:globalThis.Array.isArray(e?.chainIds)?e.chainIds.map(t=>globalThis.String(t)):[],dbSchema:S(e.dbSchema)?qi.fromJSON(e.dbSchema):void 0,config:S(e.config)?Ui.fromJSON(e.config):void 0,executionConfig:S(e.executionConfig)?Qi.fromJSON(e.executionConfig):void 0,metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>un.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Ji.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>Dn.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainIds?.length&&(t.chainIds=e.chainIds),e.dbSchema!==void 0&&(t.dbSchema=qi.toJSON(e.dbSchema)),e.config!==void 0&&(t.config=Ui.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=Qi.toJSON(e.executionConfig)),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(r=>un.toJSON(r))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(r=>Ji.toJSON(r))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(r=>Dn.toJSON(r))),t},create(e){return Tq.fromPartial(e??{})},fromPartial(e){let t=KT();return t.chainIds=e.chainIds?.map(r=>r)||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?qi.fromPartial(e.dbSchema):void 0,t.config=e.config!==void 0&&e.config!==null?Ui.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?Qi.fromPartial(e.executionConfig):void 0,t.metricConfigs=e.metricConfigs?.map(r=>un.fromPartial(r))||[],t.exportConfigs=e.exportConfigs?.map(r=>Ji.fromPartial(r))||[],t.eventLogConfigs=e.eventLogConfigs?.map(r=>Dn.fromPartial(r))||[],t}};function $T(){return{chainId:"",templateInstances:[]}}o($T,"createBaseUpdateTemplatesRequest");var FS={encode(e,t=b.default.Writer.create()){e.chainId!==""&&t.uint32(10).string(e.chainId);for(let r of e.templateInstances)Xt.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=$T();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=r.string();continue;case 2:if(a!==18)break;i.templateInstances.push(Xt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainId:S(e.chainId)?globalThis.String(e.chainId):"",templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>Xt.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(r=>Xt.toJSON(r))),t},create(e){return FS.fromPartial(e??{})},fromPartial(e){let t=$T();return t.chainId=e.chainId??"",t.templateInstances=e.templateInstances?.map(r=>Xt.fromPartial(r))||[],t}};function YT(){return{templateInstances:[]}}o(YT,"createBaseStartRequest");var C6={encode(e,t=b.default.Writer.create()){for(let r of e.templateInstances)Xt.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=YT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.templateInstances.push(Xt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>Xt.fromJSON(t)):[]}},toJSON(e){let t={};return e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(r=>Xt.toJSON(r))),t},create(e){return C6.fromPartial(e??{})},fromPartial(e){let t=YT();return t.templateInstances=e.templateInstances?.map(r=>Xt.fromPartial(r))||[],t}};function jT(){return{handlerId:0}}o(jT,"createBaseBlockHandlerConfig");var Nq={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=jT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return Nq.fromPartial(e??{})},fromPartial(e){let t=jT();return t.handlerId=e.handlerId??0,t}};function eN(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}o(eN,"createBaseEthFetchConfig");var Zt={encode(e,t=b.default.Writer.create()){return e.transaction!==!1&&t.uint32(8).bool(e.transaction),e.transactionReceipt!==!1&&t.uint32(16).bool(e.transactionReceipt),e.transactionReceiptLogs!==!1&&t.uint32(40).bool(e.transactionReceiptLogs),e.block!==!1&&t.uint32(24).bool(e.block),e.trace!==!1&&t.uint32(32).bool(e.trace),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=eN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.transaction=r.bool();continue;case 2:if(a!==16)break;i.transactionReceipt=r.bool();continue;case 5:if(a!==40)break;i.transactionReceiptLogs=r.bool();continue;case 3:if(a!==24)break;i.block=r.bool();continue;case 4:if(a!==32)break;i.trace=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:S(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:S(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:S(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:S(e.block)?globalThis.Boolean(e.block):!1,trace:S(e.trace)?globalThis.Boolean(e.trace):!1}},toJSON(e){let t={};return e.transaction!==!1&&(t.transaction=e.transaction),e.transactionReceipt!==!1&&(t.transactionReceipt=e.transactionReceipt),e.transactionReceiptLogs!==!1&&(t.transactionReceiptLogs=e.transactionReceiptLogs),e.block!==!1&&(t.block=e.block),e.trace!==!1&&(t.trace=e.trace),t},create(e){return Zt.fromPartial(e??{})},fromPartial(e){let t=eN();return t.transaction=e.transaction??!1,t.transactionReceipt=e.transactionReceipt??!1,t.transactionReceiptLogs=e.transactionReceiptLogs??!1,t.block=e.block??!1,t.trace=e.trace??!1,t}};function tN(){return{signature:"",handlerId:0,fetchConfig:void 0,handlerName:""}}o(tN,"createBaseTraceHandlerConfig");var su={encode(e,t=b.default.Writer.create()){return e.signature!==""&&t.uint32(10).string(e.signature),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=tN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.signature=r.string();continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{signature:S(e.signature)?globalThis.String(e.signature):"",handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.signature!==""&&(t.signature=e.signature),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return su.fromPartial(e??{})},fromPartial(e){let t=tN();return t.signature=e.signature??"",t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function rN(){return{handlerId:0,fetchConfig:void 0,handlerName:""}}o(rN,"createBaseTransactionHandlerConfig");var du={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=rN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return du.fromPartial(e??{})},fromPartial(e){let t=rN();return t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function nN(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}o(nN,"createBaseLogHandlerConfig");var Zi={encode(e,t=b.default.Writer.create()){for(let r of e.filters)hu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=nN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(hu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>hu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>hu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Zi.fromPartial(e??{})},fromPartial(e){let t=nN();return t.filters=e.filters?.map(r=>hu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function iN(){return{filters:[],handlerId:0,handlerName:""}}o(iN,"createBaseFuelAssetHandlerConfig");var uu={encode(e,t=b.default.Writer.create()){for(let r of e.filters)cu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=iN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(cu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>cu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>cu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return uu.fromPartial(e??{})},fromPartial(e){let t=iN();return t.filters=e.filters?.map(r=>cu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function aN(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}o(aN,"createBaseFuelAssetHandlerConfig_AssetFilter");var cu={encode(e,t=b.default.Writer.create()){return e.assetId!==void 0&&t.uint32(10).string(e.assetId),e.fromAddress!==void 0&&t.uint32(18).string(e.fromAddress),e.toAddress!==void 0&&t.uint32(26).string(e.toAddress),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=aN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.assetId=r.string();continue;case 2:if(a!==18)break;i.fromAddress=r.string();continue;case 3:if(a!==26)break;i.toAddress=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{assetId:S(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:S(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:S(e.toAddress)?globalThis.String(e.toAddress):void 0}},toJSON(e){let t={};return e.assetId!==void 0&&(t.assetId=e.assetId),e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),t},create(e){return cu.fromPartial(e??{})},fromPartial(e){let t=aN();return t.assetId=e.assetId??void 0,t.fromAddress=e.fromAddress??void 0,t.toAddress=e.toAddress??void 0,t}};function oN(){return{logIds:[],handlerId:0,handlerName:""}}o(oN,"createBaseFuelLogHandlerConfig");var Sq={encode(e,t=b.default.Writer.create()){for(let r of e.logIds)t.uint32(10).string(r);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=oN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(r.string());continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Sq.fromPartial(e??{})},fromPartial(e){let t=oN();return t.logIds=e.logIds?.map(r=>r)||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function sN(){return{log:void 0,transfer:void 0,handlerId:0,handlerName:""}}o(sN,"createBaseFuelReceiptHandlerConfig");var pu={encode(e,t=b.default.Writer.create()){return e.log!==void 0&&fu.encode(e.log,t.uint32(10).fork()).ldelim(),e.transfer!==void 0&&lu.encode(e.transfer,t.uint32(18).fork()).ldelim(),e.handlerId!==0&&t.uint32(24).int32(e.handlerId),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=sN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.log=fu.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.transfer=lu.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.handlerId=r.int32();continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{log:S(e.log)?fu.fromJSON(e.log):void 0,transfer:S(e.transfer)?lu.fromJSON(e.transfer):void 0,handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.log!==void 0&&(t.log=fu.toJSON(e.log)),e.transfer!==void 0&&(t.transfer=lu.toJSON(e.transfer)),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return pu.fromPartial(e??{})},fromPartial(e){let t=sN();return t.log=e.log!==void 0&&e.log!==null?fu.fromPartial(e.log):void 0,t.transfer=e.transfer!==void 0&&e.transfer!==null?lu.fromPartial(e.transfer):void 0,t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function dN(){return{assetId:"",from:"",to:""}}o(dN,"createBaseFuelReceiptHandlerConfig_Transfer");var lu={encode(e,t=b.default.Writer.create()){return e.assetId!==""&&t.uint32(34).string(e.assetId),e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=dN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.assetId=r.string();continue;case 1:if(a!==10)break;i.from=r.string();continue;case 2:if(a!==18)break;i.to=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{assetId:S(e.assetId)?globalThis.String(e.assetId):"",from:S(e.from)?globalThis.String(e.from):"",to:S(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.assetId!==""&&(t.assetId=e.assetId),e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return lu.fromPartial(e??{})},fromPartial(e){let t=dN();return t.assetId=e.assetId??"",t.from=e.from??"",t.to=e.to??"",t}};function uN(){return{logIds:[]}}o(uN,"createBaseFuelReceiptHandlerConfig_Log");var fu={encode(e,t=b.default.Writer.create()){for(let r of e.logIds)t.uint32(10).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=uN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),t},create(e){return fu.fromPartial(e??{})},fromPartial(e){let t=uN();return t.logIds=e.logIds?.map(r=>r)||[],t}};function cN(){return{logFilters:[],handlerId:0,handlerName:""}}o(cN,"createBaseCosmosLogHandlerConfig");var mu={encode(e,t=b.default.Writer.create()){for(let r of e.logFilters)t.uint32(10).string(r);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=cN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logFilters.push(r.string());continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(t=>globalThis.String(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.logFilters?.length&&(t.logFilters=e.logFilters),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return mu.fromPartial(e??{})},fromPartial(e){let t=cN();return t.logFilters=e.logFilters?.map(r=>r)||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function pN(){return{topics:[],address:void 0,addressType:void 0}}o(pN,"createBaseLogFilter");var hu={encode(e,t=b.default.Writer.create()){for(let r of e.topics)Su.encode(r,t.uint32(10).fork()).ldelim();return e.address!==void 0&&t.uint32(18).string(e.address),e.addressType!==void 0&&t.uint32(24).int32(e.addressType),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=pN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.topics.push(Su.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.address=r.string();continue;case 3:if(a!==24)break;i.addressType=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(t=>Su.fromJSON(t)):[],address:S(e.address)?globalThis.String(e.address):void 0,addressType:S(e.addressType)?aq(e.addressType):void 0}},toJSON(e){let t={};return e.topics?.length&&(t.topics=e.topics.map(r=>Su.toJSON(r))),e.address!==void 0&&(t.address=e.address),e.addressType!==void 0&&(t.addressType=oq(e.addressType)),t},create(e){return hu.fromPartial(e??{})},fromPartial(e){let t=pN();return t.topics=e.topics?.map(r=>Su.fromPartial(r))||[],t.address=e.address??void 0,t.addressType=e.addressType??void 0,t}};function lN(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}o(lN,"createBaseInstructionHandlerConfig");var gu={encode(e,t=b.default.Writer.create()){return e.innerInstruction!==!1&&t.uint32(8).bool(e.innerInstruction),e.parsedInstruction!==!1&&t.uint32(16).bool(e.parsedInstruction),e.rawDataInstruction!==!1&&t.uint32(24).bool(e.rawDataInstruction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=lN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.innerInstruction=r.bool();continue;case 2:if(a!==16)break;i.parsedInstruction=r.bool();continue;case 3:if(a!==24)break;i.rawDataInstruction=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{innerInstruction:S(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:S(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:S(e.rawDataInstruction)?globalThis.Boolean(e.rawDataInstruction):!1}},toJSON(e){let t={};return e.innerInstruction!==!1&&(t.innerInstruction=e.innerInstruction),e.parsedInstruction!==!1&&(t.parsedInstruction=e.parsedInstruction),e.rawDataInstruction!==!1&&(t.rawDataInstruction=e.rawDataInstruction),t},create(e){return gu.fromPartial(e??{})},fromPartial(e){let t=lN();return t.innerInstruction=e.innerInstruction??!1,t.parsedInstruction=e.parsedInstruction??!1,t.rawDataInstruction=e.rawDataInstruction??!1,t}};function fN(){return{moveTypePrefix:""}}o(fN,"createBaseResourceConfig");var _u={encode(e,t=b.default.Writer.create()){return e.moveTypePrefix!==""&&t.uint32(10).string(e.moveTypePrefix),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=fN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.moveTypePrefix=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{moveTypePrefix:S(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let t={};return e.moveTypePrefix!==""&&(t.moveTypePrefix=e.moveTypePrefix),t},create(e){return _u.fromPartial(e??{})},fromPartial(e){let t=fN();return t.moveTypePrefix=e.moveTypePrefix??"",t}};function mN(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0,supportMultisigFunc:void 0,includeFailedTransaction:void 0}}o(mN,"createBaseMoveFetchConfig");var _n={encode(e,t=b.default.Writer.create()){return e.resourceChanges!==!1&&t.uint32(8).bool(e.resourceChanges),e.allEvents!==!1&&t.uint32(16).bool(e.allEvents),e.inputs!==!1&&t.uint32(32).bool(e.inputs),e.resourceConfig!==void 0&&_u.encode(e.resourceConfig,t.uint32(26).fork()).ldelim(),e.supportMultisigFunc!==void 0&&t.uint32(40).bool(e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&t.uint32(48).bool(e.includeFailedTransaction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=mN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.resourceChanges=r.bool();continue;case 2:if(a!==16)break;i.allEvents=r.bool();continue;case 4:if(a!==32)break;i.inputs=r.bool();continue;case 3:if(a!==26)break;i.resourceConfig=_u.decode(r,r.uint32());continue;case 5:if(a!==40)break;i.supportMultisigFunc=r.bool();continue;case 6:if(a!==48)break;i.includeFailedTransaction=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{resourceChanges:S(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:S(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:S(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:S(e.resourceConfig)?_u.fromJSON(e.resourceConfig):void 0,supportMultisigFunc:S(e.supportMultisigFunc)?globalThis.Boolean(e.supportMultisigFunc):void 0,includeFailedTransaction:S(e.includeFailedTransaction)?globalThis.Boolean(e.includeFailedTransaction):void 0}},toJSON(e){let t={};return e.resourceChanges!==!1&&(t.resourceChanges=e.resourceChanges),e.allEvents!==!1&&(t.allEvents=e.allEvents),e.inputs!==!1&&(t.inputs=e.inputs),e.resourceConfig!==void 0&&(t.resourceConfig=_u.toJSON(e.resourceConfig)),e.supportMultisigFunc!==void 0&&(t.supportMultisigFunc=e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&(t.includeFailedTransaction=e.includeFailedTransaction),t},create(e){return _n.fromPartial(e??{})},fromPartial(e){let t=mN();return t.resourceChanges=e.resourceChanges??!1,t.allEvents=e.allEvents??!1,t.inputs=e.inputs??!1,t.resourceConfig=e.resourceConfig!==void 0&&e.resourceConfig!==null?_u.fromPartial(e.resourceConfig):void 0,t.supportMultisigFunc=e.supportMultisigFunc??void 0,t.includeFailedTransaction=e.includeFailedTransaction??void 0,t}};function hN(){return{owned:!1}}o(hN,"createBaseMoveAccountFetchConfig");var Au={encode(e,t=b.default.Writer.create()){return e.owned!==!1&&t.uint32(8).bool(e.owned),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=hN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.owned=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{owned:S(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let t={};return e.owned!==!1&&(t.owned=e.owned),t},create(e){return Au.fromPartial(e??{})},fromPartial(e){let t=hN();return t.owned=e.owned??!1,t}};function gN(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}o(gN,"createBaseMoveEventHandlerConfig");var yu={encode(e,t=b.default.Writer.create()){for(let r of e.filters)wu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&_n.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=gN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(wu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=_n.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>wu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?_n.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>wu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=_n.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return yu.fromPartial(e??{})},fromPartial(e){let t=gN();return t.filters=e.filters?.map(r=>wu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?_n.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function _N(){return{type:"",account:"",eventAccount:""}}o(_N,"createBaseMoveEventFilter");var wu={encode(e,t=b.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.account!==""&&t.uint32(18).string(e.account),e.eventAccount!==""&&t.uint32(26).string(e.eventAccount),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_N();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=r.string();continue;case 2:if(a!==18)break;i.account=r.string();continue;case 3:if(a!==26)break;i.eventAccount=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{type:S(e.type)?globalThis.String(e.type):"",account:S(e.account)?globalThis.String(e.account):"",eventAccount:S(e.eventAccount)?globalThis.String(e.eventAccount):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.account!==""&&(t.account=e.account),e.eventAccount!==""&&(t.eventAccount=e.eventAccount),t},create(e){return wu.fromPartial(e??{})},fromPartial(e){let t=_N();return t.type=e.type??"",t.account=e.account??"",t.eventAccount=e.eventAccount??"",t}};function AN(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}o(AN,"createBaseMoveCallHandlerConfig");var Ki={encode(e,t=b.default.Writer.create()){for(let r of e.filters)vu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&_n.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=AN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(vu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=_n.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>vu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?_n.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>vu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=_n.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Ki.fromPartial(e??{})},fromPartial(e){let t=AN();return t.filters=e.filters?.map(r=>vu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?_n.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function yN(){return{type:"",includeDeleted:!1,handlerId:0,handlerName:""}}o(yN,"createBaseMoveResourceChangeConfig");var $i={encode(e,t=b.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.includeDeleted!==!1&&t.uint32(32).bool(e.includeDeleted),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=yN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=r.string();continue;case 4:if(a!==32)break;i.includeDeleted=r.bool();continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{type:S(e.type)?globalThis.String(e.type):"",includeDeleted:S(e.includeDeleted)?globalThis.Boolean(e.includeDeleted):!1,handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.includeDeleted!==!1&&(t.includeDeleted=e.includeDeleted),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return $i.fromPartial(e??{})},fromPartial(e){let t=yN();return t.type=e.type??"",t.includeDeleted=e.includeDeleted??!1,t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function wN(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}o(wN,"createBaseMoveCallFilter");var vu={encode(e,t=b.default.Writer.create()){e.function!==""&&t.uint32(10).string(e.function);for(let r of e.typeArguments)t.uint32(18).string(r);return e.withTypeArguments!==!1&&t.uint32(24).bool(e.withTypeArguments),e.includeFailed!==!1&&t.uint32(32).bool(e.includeFailed),e.publicKeyPrefix!==""&&t.uint32(42).string(e.publicKeyPrefix),e.fromAndToAddress!==void 0&&bu.encode(e.fromAndToAddress,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=wN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=r.string();continue;case 2:if(a!==18)break;i.typeArguments.push(r.string());continue;case 3:if(a!==24)break;i.withTypeArguments=r.bool();continue;case 4:if(a!==32)break;i.includeFailed=r.bool();continue;case 5:if(a!==42)break;i.publicKeyPrefix=r.string();continue;case 6:if(a!==50)break;i.fromAndToAddress=bu.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{function:S(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(t=>globalThis.String(t)):[],withTypeArguments:S(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:S(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:S(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:S(e.fromAndToAddress)?bu.fromJSON(e.fromAndToAddress):void 0}},toJSON(e){let t={};return e.function!==""&&(t.function=e.function),e.typeArguments?.length&&(t.typeArguments=e.typeArguments),e.withTypeArguments!==!1&&(t.withTypeArguments=e.withTypeArguments),e.includeFailed!==!1&&(t.includeFailed=e.includeFailed),e.publicKeyPrefix!==""&&(t.publicKeyPrefix=e.publicKeyPrefix),e.fromAndToAddress!==void 0&&(t.fromAndToAddress=bu.toJSON(e.fromAndToAddress)),t},create(e){return vu.fromPartial(e??{})},fromPartial(e){let t=wN();return t.function=e.function??"",t.typeArguments=e.typeArguments?.map(r=>r)||[],t.withTypeArguments=e.withTypeArguments??!1,t.includeFailed=e.includeFailed??!1,t.publicKeyPrefix=e.publicKeyPrefix??"",t.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?bu.fromPartial(e.fromAndToAddress):void 0,t}};function vN(){return{from:"",to:""}}o(vN,"createBaseMoveCallFilter_FromAndToAddress");var bu={encode(e,t=b.default.Writer.create()){return e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=vN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.from=r.string();continue;case 2:if(a!==18)break;i.to=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{from:S(e.from)?globalThis.String(e.from):"",to:S(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return bu.fromPartial(e??{})},fromPartial(e){let t=vN();return t.from=e.from??"",t.to=e.to??"",t}};function bN(){return{filters:[],handlerId:0,handlerName:""}}o(bN,"createBaseStarknetEventHandlerConfig");var Iu={encode(e,t=b.default.Writer.create()){for(let r of e.filters)Eu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=bN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(Eu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Eu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>Eu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Iu.fromPartial(e??{})},fromPartial(e){let t=bN();return t.filters=e.filters?.map(r=>Eu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function IN(){return{address:"",keys:[]}}o(IN,"createBaseStarknetEventFilter");var Eu={encode(e,t=b.default.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(let r of e.keys)t.uint32(18).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=IN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=r.string();continue;case 2:if(a!==18)break;i.keys.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{address:S(e.address)?globalThis.String(e.address):"",keys:globalThis.Array.isArray(e?.keys)?e.keys.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.keys?.length&&(t.keys=e.keys),t},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let t=IN();return t.address=e.address??"",t.keys=e.keys?.map(r=>r)||[],t}};function EN(){return{function:"",includeFailed:!1}}o(EN,"createBaseFuelCallFilter");var Tu={encode(e,t=b.default.Writer.create()){return e.function!==""&&t.uint32(10).string(e.function),e.includeFailed!==!1&&t.uint32(16).bool(e.includeFailed),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=EN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=r.string();continue;case 2:if(a!==16)break;i.includeFailed=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{function:S(e.function)?globalThis.String(e.function):"",includeFailed:S(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1}},toJSON(e){let t={};return e.function!==""&&(t.function=e.function),e.includeFailed!==!1&&(t.includeFailed=e.includeFailed),t},create(e){return Tu.fromPartial(e??{})},fromPartial(e){let t=EN();return t.function=e.function??"",t.includeFailed=e.includeFailed??!1,t}};function TN(){return{filters:[],handlerId:0,handlerName:""}}o(TN,"createBaseFuelCallHandlerConfig");var Cq={encode(e,t=b.default.Writer.create()){for(let r of e.filters)Tu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=TN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(Tu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Tu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>Tu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Cq.fromPartial(e??{})},fromPartial(e){let t=TN();return t.filters=e.filters?.map(r=>Tu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function NN(){return{handlerId:0,handlerName:""}}o(NN,"createBaseFuelTransactionHandlerConfig");var Nu={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.handlerName!==""&&t.uint32(18).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=NN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue;case 2:if(a!==18)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Nu.fromPartial(e??{})},fromPartial(e){let t=NN();return t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function SN(){return{hashes:[]}}o(SN,"createBaseTopic");var Su={encode(e,t=b.default.Writer.create()){for(let r of e.hashes)t.uint32(10).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=SN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.hashes.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{hashes:globalThis.Array.isArray(e?.hashes)?e.hashes.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.hashes?.length&&(t.hashes=e.hashes),t},create(e){return Su.fromPartial(e??{})},fromPartial(e){let t=SN();return t.hashes=e.hashes?.map(r=>r)||[],t}};function CN(){return{bindings:[]}}o(CN,"createBaseProcessBindingsRequest");var VS={encode(e,t=b.default.Writer.create()){for(let r of e.bindings)yn.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=CN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(yn.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>yn.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(r=>yn.toJSON(r))),t},create(e){return VS.fromPartial(e??{})},fromPartial(e){let t=CN();return t.bindings=e.bindings?.map(r=>yn.fromPartial(r))||[],t}};function ON(){return{result:void 0}}o(ON,"createBaseProcessBindingResponse");var MS={encode(e,t=b.default.Writer.create()){return e.result!==void 0&&Yr.encode(e.result,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ON();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=Yr.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{result:S(e.result)?Yr.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.result!==void 0&&(t.result=Yr.toJSON(e.result)),t},create(e){return MS.fromPartial(e??{})},fromPartial(e){let t=ON();return t.result=e.result!==void 0&&e.result!==null?Yr.fromPartial(e.result):void 0,t}};function BN(){return{processId:0,binding:void 0,dbResult:void 0,start:void 0}}o(BN,"createBaseProcessStreamRequest");var O6={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.binding!==void 0&&yn.encode(e.binding,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&ji.encode(e.dbResult,t.uint32(26).fork()).ldelim(),e.start!==void 0&&t.uint32(32).bool(e.start),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=BN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.binding=yn.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.dbResult=ji.decode(r,r.uint32());continue;case 4:if(a!==32)break;i.start=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,binding:S(e.binding)?yn.fromJSON(e.binding):void 0,dbResult:S(e.dbResult)?ji.fromJSON(e.dbResult):void 0,start:S(e.start)?globalThis.Boolean(e.start):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.binding!==void 0&&(t.binding=yn.toJSON(e.binding)),e.dbResult!==void 0&&(t.dbResult=ji.toJSON(e.dbResult)),e.start!==void 0&&(t.start=e.start),t},create(e){return O6.fromPartial(e??{})},fromPartial(e){let t=BN();return t.processId=e.processId??0,t.binding=e.binding!==void 0&&e.binding!==null?yn.fromPartial(e.binding):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?ji.fromPartial(e.dbResult):void 0,t.start=e.start??void 0,t}};function RN(){return{processId:0,dbRequest:void 0,result:void 0,partitions:void 0}}o(RN,"createBaseProcessStreamResponse");var US={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&An.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),e.result!==void 0&&Yr.encode(e.result,t.uint32(26).fork()).ldelim(),e.partitions!==void 0&&Yi.encode(e.partitions,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=RN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.dbRequest=An.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.result=Yr.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.partitions=Yi.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,dbRequest:S(e.dbRequest)?An.fromJSON(e.dbRequest):void 0,result:S(e.result)?Yr.fromJSON(e.result):void 0,partitions:S(e.partitions)?Yi.fromJSON(e.partitions):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=An.toJSON(e.dbRequest)),e.result!==void 0&&(t.result=Yr.toJSON(e.result)),e.partitions!==void 0&&(t.partitions=Yi.toJSON(e.partitions)),t},create(e){return US.fromPartial(e??{})},fromPartial(e){let t=RN();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?An.fromPartial(e.dbRequest):void 0,t.result=e.result!==void 0&&e.result!==null?Yr.fromPartial(e.result):void 0,t.partitions=e.partitions!==void 0&&e.partitions!==null?Yi.fromPartial(e.partitions):void 0,t}};function xN(){return{partitions:{}}}o(xN,"createBaseProcessStreamResponse_Partitions");var Yi={encode(e,t=b.default.Writer.create()){return Object.entries(e.partitions).forEach(([r,n])=>{b6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=xN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=b6.decode(r,r.uint32());s.value!==void 0&&(i.partitions[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{partitions:Nt(e.partitions)?Object.entries(e.partitions).reduce((t,[r,n])=>(t[globalThis.Number(r)]=co.fromJSON(n),t),{}):{}}},toJSON(e){let t={};if(e.partitions){let r=Object.entries(e.partitions);r.length>0&&(t.partitions={},r.forEach(([n,i])=>{t.partitions[n]=co.toJSON(i)}))}return t},create(e){return Yi.fromPartial(e??{})},fromPartial(e){let t=xN();return t.partitions=Object.entries(e.partitions??{}).reduce((r,[n,i])=>(i!==void 0&&(r[globalThis.Number(n)]=co.fromPartial(i)),r),{}),t}};function kN(){return{userValue:void 0,sysValue:void 0}}o(kN,"createBaseProcessStreamResponse_Partitions_Partition");var co={encode(e,t=b.default.Writer.create()){return e.userValue!==void 0&&t.uint32(10).string(e.userValue),e.sysValue!==void 0&&t.uint32(16).int32(e.sysValue),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=kN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.userValue=r.string();continue;case 2:if(a!==16)break;i.sysValue=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{userValue:S(e.userValue)?globalThis.String(e.userValue):void 0,sysValue:S(e.sysValue)?fq(e.sysValue):void 0}},toJSON(e){let t={};return e.userValue!==void 0&&(t.userValue=e.userValue),e.sysValue!==void 0&&(t.sysValue=mq(e.sysValue)),t},create(e){return co.fromPartial(e??{})},fromPartial(e){let t=kN();return t.userValue=e.userValue??void 0,t.sysValue=e.sysValue??void 0,t}};function DN(){return{key:0,value:void 0}}o(DN,"createBaseProcessStreamResponse_Partitions_PartitionsEntry");var b6={encode(e,t=b.default.Writer.create()){return e.key!==0&&t.uint32(8).int32(e.key),e.value!==void 0&&co.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=DN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.key=r.int32();continue;case 2:if(a!==18)break;i.value=co.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.Number(e.key):0,value:S(e.value)?co.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==0&&(t.key=Math.round(e.key)),e.value!==void 0&&(t.value=co.toJSON(e.value)),t},create(e){return b6.fromPartial(e??{})},fromPartial(e){let t=DN();return t.key=e.key??0,t.value=e.value!==void 0&&e.value!==null?co.fromPartial(e.value):void 0,t}};function PN(){return{processId:0,partitions:void 0,dbRequest:void 0,tsRequest:void 0,tplRequest:void 0,result:void 0}}o(PN,"createBaseProcessStreamResponseV3");var QS={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.partitions!==void 0&&Yi.encode(e.partitions,t.uint32(18).fork()).ldelim(),e.dbRequest!==void 0&&An.encode(e.dbRequest,t.uint32(26).fork()).ldelim(),e.tsRequest!==void 0&&ku.encode(e.tsRequest,t.uint32(34).fork()).ldelim(),e.tplRequest!==void 0&&xu.encode(e.tplRequest,t.uint32(42).fork()).ldelim(),e.result!==void 0&&Yr.encode(e.result,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=PN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.partitions=Yi.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.dbRequest=An.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.tsRequest=ku.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.tplRequest=xu.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.result=Yr.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,partitions:S(e.partitions)?Yi.fromJSON(e.partitions):void 0,dbRequest:S(e.dbRequest)?An.fromJSON(e.dbRequest):void 0,tsRequest:S(e.tsRequest)?ku.fromJSON(e.tsRequest):void 0,tplRequest:S(e.tplRequest)?xu.fromJSON(e.tplRequest):void 0,result:S(e.result)?Yr.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.partitions!==void 0&&(t.partitions=Yi.toJSON(e.partitions)),e.dbRequest!==void 0&&(t.dbRequest=An.toJSON(e.dbRequest)),e.tsRequest!==void 0&&(t.tsRequest=ku.toJSON(e.tsRequest)),e.tplRequest!==void 0&&(t.tplRequest=xu.toJSON(e.tplRequest)),e.result!==void 0&&(t.result=Yr.toJSON(e.result)),t},create(e){return QS.fromPartial(e??{})},fromPartial(e){let t=PN();return t.processId=e.processId??0,t.partitions=e.partitions!==void 0&&e.partitions!==null?Yi.fromPartial(e.partitions):void 0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?An.fromPartial(e.dbRequest):void 0,t.tsRequest=e.tsRequest!==void 0&&e.tsRequest!==null?ku.fromPartial(e.tsRequest):void 0,t.tplRequest=e.tplRequest!==void 0&&e.tplRequest!==null?xu.fromPartial(e.tplRequest):void 0,t.result=e.result!==void 0&&e.result!==null?Yr.fromPartial(e.result):void 0,t}};function LN(){return{processId:0,bindings:void 0,dbResult:void 0}}o(LN,"createBasePreprocessStreamRequest");var GS={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.bindings!==void 0&&Cu.encode(e.bindings,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&ji.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=LN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.bindings=Cu.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.dbResult=ji.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,bindings:S(e.bindings)?Cu.fromJSON(e.bindings):void 0,dbResult:S(e.dbResult)?ji.fromJSON(e.dbResult):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.bindings!==void 0&&(t.bindings=Cu.toJSON(e.bindings)),e.dbResult!==void 0&&(t.dbResult=ji.toJSON(e.dbResult)),t},create(e){return GS.fromPartial(e??{})},fromPartial(e){let t=LN();return t.processId=e.processId??0,t.bindings=e.bindings!==void 0&&e.bindings!==null?Cu.fromPartial(e.bindings):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?ji.fromPartial(e.dbResult):void 0,t}};function FN(){return{bindings:[]}}o(FN,"createBasePreprocessStreamRequest_DataBindings");var Cu={encode(e,t=b.default.Writer.create()){for(let r of e.bindings)yn.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=FN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(yn.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>yn.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(r=>yn.toJSON(r))),t},create(e){return Cu.fromPartial(e??{})},fromPartial(e){let t=FN();return t.bindings=e.bindings?.map(r=>yn.fromPartial(r))||[],t}};function VN(){return{processId:0,dbRequest:void 0}}o(VN,"createBasePreprocessStreamResponse");var qS={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&An.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=VN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.dbRequest=An.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,dbRequest:S(e.dbRequest)?An.fromJSON(e.dbRequest):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=An.toJSON(e.dbRequest)),t},create(e){return qS.fromPartial(e??{})},fromPartial(e){let t=VN();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?An.fromPartial(e.dbRequest):void 0,t}};function MN(){return{opId:BigInt("0"),data:void 0,list:void 0,error:void 0,entities:void 0,entityList:void 0,nextCursor:void 0}}o(MN,"createBaseDBResponse");var ji={encode(e,t=b.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");t.uint32(8).uint64(e.opId.toString())}return e.data!==void 0&&ee.encode(ee.wrap(e.data),t.uint32(18).fork()).ldelim(),e.list!==void 0&&Ia.encode(Ia.wrap(e.list),t.uint32(34).fork()).ldelim(),e.error!==void 0&&t.uint32(26).string(e.error),e.entities!==void 0&&qo.encode(e.entities,t.uint32(50).fork()).ldelim(),e.entityList!==void 0&&Bu.encode(e.entityList,t.uint32(58).fork()).ldelim(),e.nextCursor!==void 0&&t.uint32(42).string(e.nextCursor),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=MN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Fr(r.uint64());continue;case 2:if(a!==18)break;i.data=ee.unwrap(ee.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.list=Ia.unwrap(Ia.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.error=r.string();continue;case 6:if(a!==50)break;i.entities=qo.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.entityList=Bu.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.nextCursor=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{opId:S(e.opId)?BigInt(e.opId):BigInt("0"),data:Nt(e.data)?e.data:void 0,list:globalThis.Array.isArray(e.list)?[...e.list]:void 0,error:S(e.error)?globalThis.String(e.error):void 0,entities:S(e.entities)?qo.fromJSON(e.entities):void 0,entityList:S(e.entityList)?Bu.fromJSON(e.entityList):void 0,nextCursor:S(e.nextCursor)?globalThis.String(e.nextCursor):void 0}},toJSON(e){let t={};return e.opId!==BigInt("0")&&(t.opId=e.opId.toString()),e.data!==void 0&&(t.data=e.data),e.list!==void 0&&(t.list=e.list),e.error!==void 0&&(t.error=e.error),e.entities!==void 0&&(t.entities=qo.toJSON(e.entities)),e.entityList!==void 0&&(t.entityList=Bu.toJSON(e.entityList)),e.nextCursor!==void 0&&(t.nextCursor=e.nextCursor),t},create(e){return ji.fromPartial(e??{})},fromPartial(e){let t=MN();return t.opId=e.opId??BigInt("0"),t.data=e.data??void 0,t.list=e.list??void 0,t.error=e.error??void 0,t.entities=e.entities!==void 0&&e.entities!==null?qo.fromPartial(e.entities):void 0,t.entityList=e.entityList!==void 0&&e.entityList!==null?Bu.fromPartial(e.entityList):void 0,t.nextCursor=e.nextCursor??void 0,t}};function UN(){return{entity:"",genBlockNumber:BigInt("0"),genBlockChain:"",genBlockTime:void 0,data:void 0}}o(UN,"createBaseEntity");var Ou={encode(e,t=b.default.Writer.create()){if(e.entity!==""&&t.uint32(10).string(e.entity),e.genBlockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.genBlockNumber)!==e.genBlockNumber)throw new globalThis.Error("value provided for field message.genBlockNumber of type uint64 too large");t.uint32(16).uint64(e.genBlockNumber.toString())}return e.genBlockChain!==""&&t.uint32(26).string(e.genBlockChain),e.genBlockTime!==void 0&&Ze.encode($n(e.genBlockTime),t.uint32(34).fork()).ldelim(),e.data!==void 0&&et.encode(e.data,t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=UN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=r.string();continue;case 2:if(a!==16)break;i.genBlockNumber=Fr(r.uint64());continue;case 3:if(a!==26)break;i.genBlockChain=r.string();continue;case 4:if(a!==34)break;i.genBlockTime=Ln(Ze.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.data=et.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:S(e.entity)?globalThis.String(e.entity):"",genBlockNumber:S(e.genBlockNumber)?BigInt(e.genBlockNumber):BigInt("0"),genBlockChain:S(e.genBlockChain)?globalThis.String(e.genBlockChain):"",genBlockTime:S(e.genBlockTime)?Yn(e.genBlockTime):void 0,data:S(e.data)?et.fromJSON(e.data):void 0}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.genBlockNumber!==BigInt("0")&&(t.genBlockNumber=e.genBlockNumber.toString()),e.genBlockChain!==""&&(t.genBlockChain=e.genBlockChain),e.genBlockTime!==void 0&&(t.genBlockTime=e.genBlockTime.toISOString()),e.data!==void 0&&(t.data=et.toJSON(e.data)),t},create(e){return Ou.fromPartial(e??{})},fromPartial(e){let t=UN();return t.entity=e.entity??"",t.genBlockNumber=e.genBlockNumber??BigInt("0"),t.genBlockChain=e.genBlockChain??"",t.genBlockTime=e.genBlockTime??void 0,t.data=e.data!==void 0&&e.data!==null?et.fromPartial(e.data):void 0,t}};function QN(){return{entities:[]}}o(QN,"createBaseEntityList");var Bu={encode(e,t=b.default.Writer.create()){for(let r of e.entities)Ou.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=QN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(Ou.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>Ou.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(r=>Ou.toJSON(r))),t},create(e){return Bu.fromPartial(e??{})},fromPartial(e){let t=QN();return t.entities=e.entities?.map(r=>Ou.fromPartial(r))||[],t}};function GN(){return{fields:{}}}o(GN,"createBaseEntityUpdateData");var Ru={encode(e,t=b.default.Writer.create()){return Object.entries(e.fields).forEach(([r,n])=>{I6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=GN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=I6.decode(r,r.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:Nt(e.fields)?Object.entries(e.fields).reduce((t,[r,n])=>(t[r]=po.fromJSON(n),t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([n,i])=>{t.fields[n]=po.toJSON(i)}))}return t},create(e){return Ru.fromPartial(e??{})},fromPartial(e){let t=GN();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=po.fromPartial(i)),r),{}),t}};function qN(){return{value:void 0,op:0}}o(qN,"createBaseEntityUpdateData_FieldValue");var po={encode(e,t=b.default.Writer.create()){return e.value!==void 0&&zt.encode(e.value,t.uint32(10).fork()).ldelim(),e.op!==0&&t.uint32(16).int32(e.op),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=qN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=zt.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.op=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{value:S(e.value)?zt.fromJSON(e.value):void 0,op:S(e.op)?hq(e.op):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=zt.toJSON(e.value)),e.op!==0&&(t.op=gq(e.op)),t},create(e){return po.fromPartial(e??{})},fromPartial(e){let t=qN();return t.value=e.value!==void 0&&e.value!==null?zt.fromPartial(e.value):void 0,t.op=e.op??0,t}};function JN(){return{key:"",value:void 0}}o(JN,"createBaseEntityUpdateData_FieldsEntry");var I6={encode(e,t=b.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&po.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=JN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=po.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.String(e.key):"",value:S(e.value)?po.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=po.toJSON(e.value)),t},create(e){return I6.fromPartial(e??{})},fromPartial(e){let t=JN();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?po.fromPartial(e.value):void 0,t}};function zN(){return{templates:[]}}o(zN,"createBaseTPLRequest");var xu={encode(e,t=b.default.Writer.create()){for(let r of e.templates)Xt.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=zN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.templates.push(Xt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{templates:globalThis.Array.isArray(e?.templates)?e.templates.map(t=>Xt.fromJSON(t)):[]}},toJSON(e){let t={};return e.templates?.length&&(t.templates=e.templates.map(r=>Xt.toJSON(r))),t},create(e){return xu.fromPartial(e??{})},fromPartial(e){let t=zN();return t.templates=e.templates?.map(r=>Xt.fromPartial(r))||[],t}};function WN(){return{data:[]}}o(WN,"createBaseTSRequest");var ku={encode(e,t=b.default.Writer.create()){for(let r of e.data)ea.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=WN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.data.push(ea.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{data:globalThis.Array.isArray(e?.data)?e.data.map(t=>ea.fromJSON(t)):[]}},toJSON(e){let t={};return e.data?.length&&(t.data=e.data.map(r=>ea.toJSON(r))),t},create(e){return ku.fromPartial(e??{})},fromPartial(e){let t=WN();return t.data=e.data?.map(r=>ea.fromPartial(r))||[],t}};function HN(){return{opId:BigInt("0"),get:void 0,upsert:void 0,update:void 0,delete:void 0,list:void 0}}o(HN,"createBaseDBRequest");var An={encode(e,t=b.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");t.uint32(8).uint64(e.opId.toString())}return e.get!==void 0&&Du.encode(e.get,t.uint32(18).fork()).ldelim(),e.upsert!==void 0&&Lu.encode(e.upsert,t.uint32(26).fork()).ldelim(),e.update!==void 0&&Fu.encode(e.update,t.uint32(50).fork()).ldelim(),e.delete!==void 0&&Vu.encode(e.delete,t.uint32(34).fork()).ldelim(),e.list!==void 0&&Pu.encode(e.list,t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=HN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Fr(r.uint64());continue;case 2:if(a!==18)break;i.get=Du.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.upsert=Lu.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.update=Fu.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.delete=Vu.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.list=Pu.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{opId:S(e.opId)?BigInt(e.opId):BigInt("0"),get:S(e.get)?Du.fromJSON(e.get):void 0,upsert:S(e.upsert)?Lu.fromJSON(e.upsert):void 0,update:S(e.update)?Fu.fromJSON(e.update):void 0,delete:S(e.delete)?Vu.fromJSON(e.delete):void 0,list:S(e.list)?Pu.fromJSON(e.list):void 0}},toJSON(e){let t={};return e.opId!==BigInt("0")&&(t.opId=e.opId.toString()),e.get!==void 0&&(t.get=Du.toJSON(e.get)),e.upsert!==void 0&&(t.upsert=Lu.toJSON(e.upsert)),e.update!==void 0&&(t.update=Fu.toJSON(e.update)),e.delete!==void 0&&(t.delete=Vu.toJSON(e.delete)),e.list!==void 0&&(t.list=Pu.toJSON(e.list)),t},create(e){return An.fromPartial(e??{})},fromPartial(e){let t=HN();return t.opId=e.opId??BigInt("0"),t.get=e.get!==void 0&&e.get!==null?Du.fromPartial(e.get):void 0,t.upsert=e.upsert!==void 0&&e.upsert!==null?Lu.fromPartial(e.upsert):void 0,t.update=e.update!==void 0&&e.update!==null?Fu.fromPartial(e.update):void 0,t.delete=e.delete!==void 0&&e.delete!==null?Vu.fromPartial(e.delete):void 0,t.list=e.list!==void 0&&e.list!==null?Pu.fromPartial(e.list):void 0,t}};function XN(){return{entity:"",id:""}}o(XN,"createBaseDBRequest_DBGet");var Du={encode(e,t=b.default.Writer.create()){return e.entity!==""&&t.uint32(10).string(e.entity),e.id!==""&&t.uint32(18).string(e.id),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=XN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=r.string();continue;case 2:if(a!==18)break;i.id=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:S(e.entity)?globalThis.String(e.entity):"",id:S(e.id)?globalThis.String(e.id):""}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.id!==""&&(t.id=e.id),t},create(e){return Du.fromPartial(e??{})},fromPartial(e){let t=XN();return t.entity=e.entity??"",t.id=e.id??"",t}};function ZN(){return{entity:"",filters:[],cursor:"",pageSize:void 0}}o(ZN,"createBaseDBRequest_DBList");var Pu={encode(e,t=b.default.Writer.create()){e.entity!==""&&t.uint32(10).string(e.entity);for(let r of e.filters)Mu.encode(r,t.uint32(34).fork()).ldelim();return e.cursor!==""&&t.uint32(42).string(e.cursor),e.pageSize!==void 0&&t.uint32(48).uint32(e.pageSize),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ZN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=r.string();continue;case 4:if(a!==34)break;i.filters.push(Mu.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.cursor=r.string();continue;case 6:if(a!==48)break;i.pageSize=r.uint32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:S(e.entity)?globalThis.String(e.entity):"",filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Mu.fromJSON(t)):[],cursor:S(e.cursor)?globalThis.String(e.cursor):"",pageSize:S(e.pageSize)?globalThis.Number(e.pageSize):void 0}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.filters?.length&&(t.filters=e.filters.map(r=>Mu.toJSON(r))),e.cursor!==""&&(t.cursor=e.cursor),e.pageSize!==void 0&&(t.pageSize=Math.round(e.pageSize)),t},create(e){return Pu.fromPartial(e??{})},fromPartial(e){let t=ZN();return t.entity=e.entity??"",t.filters=e.filters?.map(r=>Mu.fromPartial(r))||[],t.cursor=e.cursor??"",t.pageSize=e.pageSize??void 0,t}};function KN(){return{entity:[],id:[],data:[],entityData:[]}}o(KN,"createBaseDBRequest_DBUpsert");var Lu={encode(e,t=b.default.Writer.create()){for(let r of e.entity)t.uint32(10).string(r);for(let r of e.id)t.uint32(18).string(r);for(let r of e.data)ee.encode(ee.wrap(r),t.uint32(26).fork()).ldelim();for(let r of e.entityData)et.encode(r,t.uint32(34).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=KN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(r.string());continue;case 2:if(a!==18)break;i.id.push(r.string());continue;case 3:if(a!==26)break;i.data.push(ee.unwrap(ee.decode(r,r.uint32())));continue;case 4:if(a!==34)break;i.entityData.push(et.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[],data:globalThis.Array.isArray(e?.data)?[...e.data]:[],entityData:globalThis.Array.isArray(e?.entityData)?e.entityData.map(t=>et.fromJSON(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),e.data?.length&&(t.data=e.data),e.entityData?.length&&(t.entityData=e.entityData.map(r=>et.toJSON(r))),t},create(e){return Lu.fromPartial(e??{})},fromPartial(e){let t=KN();return t.entity=e.entity?.map(r=>r)||[],t.id=e.id?.map(r=>r)||[],t.data=e.data?.map(r=>r)||[],t.entityData=e.entityData?.map(r=>et.fromPartial(r))||[],t}};function $N(){return{entity:[],id:[],entityData:[]}}o($N,"createBaseDBRequest_DBUpdate");var Fu={encode(e,t=b.default.Writer.create()){for(let r of e.entity)t.uint32(10).string(r);for(let r of e.id)t.uint32(18).string(r);for(let r of e.entityData)Ru.encode(r,t.uint32(26).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=$N();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(r.string());continue;case 2:if(a!==18)break;i.id.push(r.string());continue;case 3:if(a!==26)break;i.entityData.push(Ru.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[],entityData:globalThis.Array.isArray(e?.entityData)?e.entityData.map(t=>Ru.fromJSON(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),e.entityData?.length&&(t.entityData=e.entityData.map(r=>Ru.toJSON(r))),t},create(e){return Fu.fromPartial(e??{})},fromPartial(e){let t=$N();return t.entity=e.entity?.map(r=>r)||[],t.id=e.id?.map(r=>r)||[],t.entityData=e.entityData?.map(r=>Ru.fromPartial(r))||[],t}};function YN(){return{entity:[],id:[]}}o(YN,"createBaseDBRequest_DBDelete");var Vu={encode(e,t=b.default.Writer.create()){for(let r of e.entity)t.uint32(10).string(r);for(let r of e.id)t.uint32(18).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=YN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(r.string());continue;case 2:if(a!==18)break;i.id.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),t},create(e){return Vu.fromPartial(e??{})},fromPartial(e){let t=YN();return t.entity=e.entity?.map(r=>r)||[],t.id=e.id?.map(r=>r)||[],t}};function jN(){return{field:"",op:0,value:void 0}}o(jN,"createBaseDBRequest_DBFilter");var Mu={encode(e,t=b.default.Writer.create()){return e.field!==""&&t.uint32(10).string(e.field),e.op!==0&&t.uint32(16).int32(e.op),e.value!==void 0&&Kn.encode(e.value,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=jN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.field=r.string();continue;case 2:if(a!==16)break;i.op=r.int32();continue;case 3:if(a!==26)break;i.value=Kn.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{field:S(e.field)?globalThis.String(e.field):"",op:S(e.op)?_q(e.op):0,value:S(e.value)?Kn.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.field!==""&&(t.field=e.field),e.op!==0&&(t.op=Aq(e.op)),e.value!==void 0&&(t.value=Kn.toJSON(e.value)),t},create(e){return Mu.fromPartial(e??{})},fromPartial(e){let t=jN();return t.field=e.field??"",t.op=e.op??0,t.value=e.value!==void 0&&e.value!==null?Kn.fromPartial(e.value):void 0,t}};function eS(){return{ethLog:void 0,ethBlock:void 0,ethTransaction:void 0,ethTrace:void 0,solInstruction:void 0,aptEvent:void 0,aptCall:void 0,aptResource:void 0,suiEvent:void 0,suiCall:void 0,suiObject:void 0,suiObjectChange:void 0,fuelLog:void 0,fuelTransaction:void 0,fuelBlock:void 0,cosmosCall:void 0,starknetEvents:void 0}}o(eS,"createBaseData");var Uu={encode(e,t=b.default.Writer.create()){return e.ethLog!==void 0&&Qu.encode(e.ethLog,t.uint32(18).fork()).ldelim(),e.ethBlock!==void 0&&Gu.encode(e.ethBlock,t.uint32(26).fork()).ldelim(),e.ethTransaction!==void 0&&qu.encode(e.ethTransaction,t.uint32(34).fork()).ldelim(),e.ethTrace!==void 0&&Ju.encode(e.ethTrace,t.uint32(42).fork()).ldelim(),e.solInstruction!==void 0&&zu.encode(e.solInstruction,t.uint32(50).fork()).ldelim(),e.aptEvent!==void 0&&Wu.encode(e.aptEvent,t.uint32(58).fork()).ldelim(),e.aptCall!==void 0&&Hu.encode(e.aptCall,t.uint32(66).fork()).ldelim(),e.aptResource!==void 0&&Xu.encode(e.aptResource,t.uint32(74).fork()).ldelim(),e.suiEvent!==void 0&&Zu.encode(e.suiEvent,t.uint32(82).fork()).ldelim(),e.suiCall!==void 0&&Ku.encode(e.suiCall,t.uint32(90).fork()).ldelim(),e.suiObject!==void 0&&$u.encode(e.suiObject,t.uint32(98).fork()).ldelim(),e.suiObjectChange!==void 0&&Yu.encode(e.suiObjectChange,t.uint32(106).fork()).ldelim(),e.fuelLog!==void 0&&ju.encode(e.fuelLog,t.uint32(162).fork()).ldelim(),e.fuelTransaction!==void 0&&ec.encode(e.fuelTransaction,t.uint32(170).fork()).ldelim(),e.fuelBlock!==void 0&&tc.encode(e.fuelBlock,t.uint32(146).fork()).ldelim(),e.cosmosCall!==void 0&&rc.encode(e.cosmosCall,t.uint32(122).fork()).ldelim(),e.starknetEvents!==void 0&&nc.encode(e.starknetEvents,t.uint32(130).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=eS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.ethLog=Qu.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.ethBlock=Gu.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.ethTransaction=qu.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.ethTrace=Ju.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.solInstruction=zu.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.aptEvent=Wu.decode(r,r.uint32());continue;case 8:if(a!==66)break;i.aptCall=Hu.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.aptResource=Xu.decode(r,r.uint32());continue;case 10:if(a!==82)break;i.suiEvent=Zu.decode(r,r.uint32());continue;case 11:if(a!==90)break;i.suiCall=Ku.decode(r,r.uint32());continue;case 12:if(a!==98)break;i.suiObject=$u.decode(r,r.uint32());continue;case 13:if(a!==106)break;i.suiObjectChange=Yu.decode(r,r.uint32());continue;case 20:if(a!==162)break;i.fuelLog=ju.decode(r,r.uint32());continue;case 21:if(a!==170)break;i.fuelTransaction=ec.decode(r,r.uint32());continue;case 18:if(a!==146)break;i.fuelBlock=tc.decode(r,r.uint32());continue;case 15:if(a!==122)break;i.cosmosCall=rc.decode(r,r.uint32());continue;case 16:if(a!==130)break;i.starknetEvents=nc.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{ethLog:S(e.ethLog)?Qu.fromJSON(e.ethLog):void 0,ethBlock:S(e.ethBlock)?Gu.fromJSON(e.ethBlock):void 0,ethTransaction:S(e.ethTransaction)?qu.fromJSON(e.ethTransaction):void 0,ethTrace:S(e.ethTrace)?Ju.fromJSON(e.ethTrace):void 0,solInstruction:S(e.solInstruction)?zu.fromJSON(e.solInstruction):void 0,aptEvent:S(e.aptEvent)?Wu.fromJSON(e.aptEvent):void 0,aptCall:S(e.aptCall)?Hu.fromJSON(e.aptCall):void 0,aptResource:S(e.aptResource)?Xu.fromJSON(e.aptResource):void 0,suiEvent:S(e.suiEvent)?Zu.fromJSON(e.suiEvent):void 0,suiCall:S(e.suiCall)?Ku.fromJSON(e.suiCall):void 0,suiObject:S(e.suiObject)?$u.fromJSON(e.suiObject):void 0,suiObjectChange:S(e.suiObjectChange)?Yu.fromJSON(e.suiObjectChange):void 0,fuelLog:S(e.fuelLog)?ju.fromJSON(e.fuelLog):void 0,fuelTransaction:S(e.fuelTransaction)?ec.fromJSON(e.fuelTransaction):void 0,fuelBlock:S(e.fuelBlock)?tc.fromJSON(e.fuelBlock):void 0,cosmosCall:S(e.cosmosCall)?rc.fromJSON(e.cosmosCall):void 0,starknetEvents:S(e.starknetEvents)?nc.fromJSON(e.starknetEvents):void 0}},toJSON(e){let t={};return e.ethLog!==void 0&&(t.ethLog=Qu.toJSON(e.ethLog)),e.ethBlock!==void 0&&(t.ethBlock=Gu.toJSON(e.ethBlock)),e.ethTransaction!==void 0&&(t.ethTransaction=qu.toJSON(e.ethTransaction)),e.ethTrace!==void 0&&(t.ethTrace=Ju.toJSON(e.ethTrace)),e.solInstruction!==void 0&&(t.solInstruction=zu.toJSON(e.solInstruction)),e.aptEvent!==void 0&&(t.aptEvent=Wu.toJSON(e.aptEvent)),e.aptCall!==void 0&&(t.aptCall=Hu.toJSON(e.aptCall)),e.aptResource!==void 0&&(t.aptResource=Xu.toJSON(e.aptResource)),e.suiEvent!==void 0&&(t.suiEvent=Zu.toJSON(e.suiEvent)),e.suiCall!==void 0&&(t.suiCall=Ku.toJSON(e.suiCall)),e.suiObject!==void 0&&(t.suiObject=$u.toJSON(e.suiObject)),e.suiObjectChange!==void 0&&(t.suiObjectChange=Yu.toJSON(e.suiObjectChange)),e.fuelLog!==void 0&&(t.fuelLog=ju.toJSON(e.fuelLog)),e.fuelTransaction!==void 0&&(t.fuelTransaction=ec.toJSON(e.fuelTransaction)),e.fuelBlock!==void 0&&(t.fuelBlock=tc.toJSON(e.fuelBlock)),e.cosmosCall!==void 0&&(t.cosmosCall=rc.toJSON(e.cosmosCall)),e.starknetEvents!==void 0&&(t.starknetEvents=nc.toJSON(e.starknetEvents)),t},create(e){return Uu.fromPartial(e??{})},fromPartial(e){let t=eS();return t.ethLog=e.ethLog!==void 0&&e.ethLog!==null?Qu.fromPartial(e.ethLog):void 0,t.ethBlock=e.ethBlock!==void 0&&e.ethBlock!==null?Gu.fromPartial(e.ethBlock):void 0,t.ethTransaction=e.ethTransaction!==void 0&&e.ethTransaction!==null?qu.fromPartial(e.ethTransaction):void 0,t.ethTrace=e.ethTrace!==void 0&&e.ethTrace!==null?Ju.fromPartial(e.ethTrace):void 0,t.solInstruction=e.solInstruction!==void 0&&e.solInstruction!==null?zu.fromPartial(e.solInstruction):void 0,t.aptEvent=e.aptEvent!==void 0&&e.aptEvent!==null?Wu.fromPartial(e.aptEvent):void 0,t.aptCall=e.aptCall!==void 0&&e.aptCall!==null?Hu.fromPartial(e.aptCall):void 0,t.aptResource=e.aptResource!==void 0&&e.aptResource!==null?Xu.fromPartial(e.aptResource):void 0,t.suiEvent=e.suiEvent!==void 0&&e.suiEvent!==null?Zu.fromPartial(e.suiEvent):void 0,t.suiCall=e.suiCall!==void 0&&e.suiCall!==null?Ku.fromPartial(e.suiCall):void 0,t.suiObject=e.suiObject!==void 0&&e.suiObject!==null?$u.fromPartial(e.suiObject):void 0,t.suiObjectChange=e.suiObjectChange!==void 0&&e.suiObjectChange!==null?Yu.fromPartial(e.suiObjectChange):void 0,t.fuelLog=e.fuelLog!==void 0&&e.fuelLog!==null?ju.fromPartial(e.fuelLog):void 0,t.fuelTransaction=e.fuelTransaction!==void 0&&e.fuelTransaction!==null?ec.fromPartial(e.fuelTransaction):void 0,t.fuelBlock=e.fuelBlock!==void 0&&e.fuelBlock!==null?tc.fromPartial(e.fuelBlock):void 0,t.cosmosCall=e.cosmosCall!==void 0&&e.cosmosCall!==null?rc.fromPartial(e.cosmosCall):void 0,t.starknetEvents=e.starknetEvents!==void 0&&e.starknetEvents!==null?nc.fromPartial(e.starknetEvents):void 0,t}};function tS(){return{log:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0,rawLog:"",rawTransaction:void 0,rawTransactionReceipt:void 0,rawBlock:void 0}}o(tS,"createBaseData_EthLog");var Qu={encode(e,t=b.default.Writer.create()){return e.log!==void 0&&ee.encode(ee.wrap(e.log),t.uint32(26).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(34).fork()).ldelim(),e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&ee.encode(ee.wrap(e.transactionReceipt),t.uint32(42).fork()).ldelim(),e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(50).fork()).ldelim(),e.rawLog!==""&&t.uint32(58).string(e.rawLog),e.rawTransaction!==void 0&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=tS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 3:if(a!==26)break;i.log=ee.unwrap(ee.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.transactionReceipt=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.rawLog=r.string();continue;case 8:if(a!==66)break;i.rawTransaction=r.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=r.string();continue;case 10:if(a!==82)break;i.rawBlock=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{log:Nt(e.log)?e.log:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,transaction:Nt(e.transaction)?e.transaction:void 0,transactionReceipt:Nt(e.transactionReceipt)?e.transactionReceipt:void 0,block:Nt(e.block)?e.block:void 0,rawLog:S(e.rawLog)?globalThis.String(e.rawLog):"",rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):void 0,rawTransactionReceipt:S(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):void 0}},toJSON(e){let t={};return e.log!==void 0&&(t.log=e.log),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(t.transaction=e.transaction),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.rawLog!==""&&(t.rawLog=e.rawLog),e.rawTransaction!==void 0&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),t},create(e){return Qu.fromPartial(e??{})},fromPartial(e){let t=tS();return t.log=e.log??void 0,t.timestamp=e.timestamp??void 0,t.transaction=e.transaction??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.rawLog=e.rawLog??"",t.rawTransaction=e.rawTransaction??void 0,t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t}};function rS(){return{block:void 0,rawBlock:""}}o(rS,"createBaseData_EthBlock");var Gu={encode(e,t=b.default.Writer.create()){return e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(18).fork()).ldelim(),e.rawBlock!==""&&t.uint32(10).string(e.rawBlock),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=rS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 1:if(a!==10)break;i.rawBlock=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{block:Nt(e.block)?e.block:void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):""}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.rawBlock!==""&&(t.rawBlock=e.rawBlock),t},create(e){return Gu.fromPartial(e??{})},fromPartial(e){let t=rS();return t.block=e.block??void 0,t.rawBlock=e.rawBlock??"",t}};function nS(){return{transaction:void 0,timestamp:void 0,transactionReceipt:void 0,block:void 0,trace:void 0,rawTransaction:"",rawTransactionReceipt:void 0,rawBlock:void 0,rawTrace:void 0}}o(nS,"createBaseData_EthTransaction");var qu={encode(e,t=b.default.Writer.create()){return e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(42).fork()).ldelim(),e.transactionReceipt!==void 0&&ee.encode(ee.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(50).fork()).ldelim(),e.trace!==void 0&&ee.encode(ee.wrap(e.trace),t.uint32(58).fork()).ldelim(),e.rawTransaction!==""&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),e.rawTrace!==void 0&&t.uint32(90).string(e.rawTrace),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=nS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.trace=ee.unwrap(ee.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.rawTransaction=r.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=r.string();continue;case 10:if(a!==82)break;i.rawBlock=r.string();continue;case 11:if(a!==90)break;i.rawTrace=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,transactionReceipt:Nt(e.transactionReceipt)?e.transactionReceipt:void 0,block:Nt(e.block)?e.block:void 0,trace:Nt(e.trace)?e.trace:void 0,rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):"",rawTransactionReceipt:S(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):void 0,rawTrace:S(e.rawTrace)?globalThis.String(e.rawTrace):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.trace!==void 0&&(t.trace=e.trace),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),e.rawTrace!==void 0&&(t.rawTrace=e.rawTrace),t},create(e){return qu.fromPartial(e??{})},fromPartial(e){let t=nS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.trace=e.trace??void 0,t.rawTransaction=e.rawTransaction??"",t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t.rawTrace=e.rawTrace??void 0,t}};function iS(){return{trace:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0,rawTrace:"",rawTransaction:void 0,rawTransactionReceipt:void 0,rawBlock:void 0}}o(iS,"createBaseData_EthTrace");var Ju={encode(e,t=b.default.Writer.create()){return e.trace!==void 0&&ee.encode(ee.wrap(e.trace),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(42).fork()).ldelim(),e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&ee.encode(ee.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(50).fork()).ldelim(),e.rawTrace!==""&&t.uint32(58).string(e.rawTrace),e.rawTransaction!==void 0&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=iS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.trace=ee.unwrap(ee.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.rawTrace=r.string();continue;case 8:if(a!==66)break;i.rawTransaction=r.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=r.string();continue;case 10:if(a!==82)break;i.rawBlock=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{trace:Nt(e.trace)?e.trace:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,transaction:Nt(e.transaction)?e.transaction:void 0,transactionReceipt:Nt(e.transactionReceipt)?e.transactionReceipt:void 0,block:Nt(e.block)?e.block:void 0,rawTrace:S(e.rawTrace)?globalThis.String(e.rawTrace):"",rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):void 0,rawTransactionReceipt:S(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):void 0}},toJSON(e){let t={};return e.trace!==void 0&&(t.trace=e.trace),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(t.transaction=e.transaction),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.rawTrace!==""&&(t.rawTrace=e.rawTrace),e.rawTransaction!==void 0&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),t},create(e){return Ju.fromPartial(e??{})},fromPartial(e){let t=iS();return t.trace=e.trace??void 0,t.timestamp=e.timestamp??void 0,t.transaction=e.transaction??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.rawTrace=e.rawTrace??"",t.rawTransaction=e.rawTransaction??void 0,t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t}};function aS(){return{instructionData:"",slot:BigInt("0"),programAccountId:"",accounts:[],parsed:void 0,rawParsed:void 0}}o(aS,"createBaseData_SolInstruction");var zu={encode(e,t=b.default.Writer.create()){if(e.instructionData!==""&&t.uint32(10).string(e.instructionData),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(16).uint64(e.slot.toString())}e.programAccountId!==""&&t.uint32(26).string(e.programAccountId);for(let r of e.accounts)t.uint32(42).string(r);return e.parsed!==void 0&&ee.encode(ee.wrap(e.parsed),t.uint32(34).fork()).ldelim(),e.rawParsed!==void 0&&t.uint32(58).string(e.rawParsed),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=aS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.instructionData=r.string();continue;case 2:if(a!==16)break;i.slot=Fr(r.uint64());continue;case 3:if(a!==26)break;i.programAccountId=r.string();continue;case 5:if(a!==42)break;i.accounts.push(r.string());continue;case 4:if(a!==34)break;i.parsed=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.rawParsed=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{instructionData:S(e.instructionData)?globalThis.String(e.instructionData):"",slot:S(e.slot)?BigInt(e.slot):BigInt("0"),programAccountId:S(e.programAccountId)?globalThis.String(e.programAccountId):"",accounts:globalThis.Array.isArray(e?.accounts)?e.accounts.map(t=>globalThis.String(t)):[],parsed:Nt(e.parsed)?e.parsed:void 0,rawParsed:S(e.rawParsed)?globalThis.String(e.rawParsed):void 0}},toJSON(e){let t={};return e.instructionData!==""&&(t.instructionData=e.instructionData),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),e.programAccountId!==""&&(t.programAccountId=e.programAccountId),e.accounts?.length&&(t.accounts=e.accounts),e.parsed!==void 0&&(t.parsed=e.parsed),e.rawParsed!==void 0&&(t.rawParsed=e.rawParsed),t},create(e){return zu.fromPartial(e??{})},fromPartial(e){let t=aS();return t.instructionData=e.instructionData??"",t.slot=e.slot??BigInt("0"),t.programAccountId=e.programAccountId??"",t.accounts=e.accounts?.map(r=>r)||[],t.parsed=e.parsed??void 0,t.rawParsed=e.rawParsed??void 0,t}};function oS(){return{rawEvent:"",eventIndex:0,rawTransaction:""}}o(oS,"createBaseData_AptEvent");var Wu={encode(e,t=b.default.Writer.create()){return e.rawEvent!==""&&t.uint32(10).string(e.rawEvent),e.eventIndex!==0&&t.uint32(32).int32(e.eventIndex),e.rawTransaction!==""&&t.uint32(26).string(e.rawTransaction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=oS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.rawEvent=r.string();continue;case 4:if(a!==32)break;i.eventIndex=r.int32();continue;case 3:if(a!==26)break;i.rawTransaction=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawEvent:S(e.rawEvent)?globalThis.String(e.rawEvent):"",eventIndex:S(e.eventIndex)?globalThis.Number(e.eventIndex):0,rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let t={};return e.rawEvent!==""&&(t.rawEvent=e.rawEvent),e.eventIndex!==0&&(t.eventIndex=Math.round(e.eventIndex)),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),t},create(e){return Wu.fromPartial(e??{})},fromPartial(e){let t=oS();return t.rawEvent=e.rawEvent??"",t.eventIndex=e.eventIndex??0,t.rawTransaction=e.rawTransaction??"",t}};function sS(){return{rawTransaction:""}}o(sS,"createBaseData_AptCall");var Hu={encode(e,t=b.default.Writer.create()){return e.rawTransaction!==""&&t.uint32(26).string(e.rawTransaction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=sS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 3:if(a!==26)break;i.rawTransaction=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let t={};return e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),t},create(e){return Hu.fromPartial(e??{})},fromPartial(e){let t=sS();return t.rawTransaction=e.rawTransaction??"",t}};function dS(){return{version:BigInt("0"),timestampMicros:BigInt("0"),rawResources:[]}}o(dS,"createBaseData_AptResource");var Xu={encode(e,t=b.default.Writer.create()){if(e.version!==BigInt("0")){if(BigInt.asIntN(64,e.version)!==e.version)throw new globalThis.Error("value provided for field message.version of type int64 too large");t.uint32(16).int64(e.version.toString())}if(e.timestampMicros!==BigInt("0")){if(BigInt.asIntN(64,e.timestampMicros)!==e.timestampMicros)throw new globalThis.Error("value provided for field message.timestampMicros of type int64 too large");t.uint32(40).int64(e.timestampMicros.toString())}for(let r of e.rawResources)t.uint32(50).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=dS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==16)break;i.version=Fr(r.int64());continue;case 5:if(a!==40)break;i.timestampMicros=Fr(r.int64());continue;case 6:if(a!==50)break;i.rawResources.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{version:S(e.version)?BigInt(e.version):BigInt("0"),timestampMicros:S(e.timestampMicros)?BigInt(e.timestampMicros):BigInt("0"),rawResources:globalThis.Array.isArray(e?.rawResources)?e.rawResources.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.version!==BigInt("0")&&(t.version=e.version.toString()),e.timestampMicros!==BigInt("0")&&(t.timestampMicros=e.timestampMicros.toString()),e.rawResources?.length&&(t.rawResources=e.rawResources),t},create(e){return Xu.fromPartial(e??{})},fromPartial(e){let t=dS();return t.version=e.version??BigInt("0"),t.timestampMicros=e.timestampMicros??BigInt("0"),t.rawResources=e.rawResources?.map(r=>r)||[],t}};function uS(){return{rawEvent:"",rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}o(uS,"createBaseData_SuiEvent");var Zu={encode(e,t=b.default.Writer.create()){if(e.rawEvent!==""&&t.uint32(34).string(e.rawEvent),e.rawTransaction!==""&&t.uint32(42).string(e.rawTransaction),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=uS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.rawEvent=r.string();continue;case 5:if(a!==42)break;i.rawTransaction=r.string();continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawEvent:S(e.rawEvent)?globalThis.String(e.rawEvent):"",rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawEvent!==""&&(t.rawEvent=e.rawEvent),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Zu.fromPartial(e??{})},fromPartial(e){let t=uS();return t.rawEvent=e.rawEvent??"",t.rawTransaction=e.rawTransaction??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function cS(){return{rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}o(cS,"createBaseData_SuiCall");var Ku={encode(e,t=b.default.Writer.create()){if(e.rawTransaction!==""&&t.uint32(34).string(e.rawTransaction),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=cS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.rawTransaction=r.string();continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Ku.fromPartial(e??{})},fromPartial(e){let t=cS();return t.rawTransaction=e.rawTransaction??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function pS(){return{rawObjects:[],rawSelf:void 0,objectId:"",objectVersion:BigInt("0"),objectDigest:"",timestamp:void 0,slot:BigInt("0")}}o(pS,"createBaseData_SuiObject");var $u={encode(e,t=b.default.Writer.create()){for(let r of e.rawObjects)t.uint32(82).string(r);if(e.rawSelf!==void 0&&t.uint32(74).string(e.rawSelf),e.objectId!==""&&t.uint32(42).string(e.objectId),e.objectVersion!==BigInt("0")){if(BigInt.asUintN(64,e.objectVersion)!==e.objectVersion)throw new globalThis.Error("value provided for field message.objectVersion of type uint64 too large");t.uint32(48).uint64(e.objectVersion.toString())}if(e.objectDigest!==""&&t.uint32(58).string(e.objectDigest),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=pS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 10:if(a!==82)break;i.rawObjects.push(r.string());continue;case 9:if(a!==74)break;i.rawSelf=r.string();continue;case 5:if(a!==42)break;i.objectId=r.string();continue;case 6:if(a!==48)break;i.objectVersion=Fr(r.uint64());continue;case 7:if(a!==58)break;i.objectDigest=r.string();continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawObjects:globalThis.Array.isArray(e?.rawObjects)?e.rawObjects.map(t=>globalThis.String(t)):[],rawSelf:S(e.rawSelf)?globalThis.String(e.rawSelf):void 0,objectId:S(e.objectId)?globalThis.String(e.objectId):"",objectVersion:S(e.objectVersion)?BigInt(e.objectVersion):BigInt("0"),objectDigest:S(e.objectDigest)?globalThis.String(e.objectDigest):"",timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawObjects?.length&&(t.rawObjects=e.rawObjects),e.rawSelf!==void 0&&(t.rawSelf=e.rawSelf),e.objectId!==""&&(t.objectId=e.objectId),e.objectVersion!==BigInt("0")&&(t.objectVersion=e.objectVersion.toString()),e.objectDigest!==""&&(t.objectDigest=e.objectDigest),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return $u.fromPartial(e??{})},fromPartial(e){let t=pS();return t.rawObjects=e.rawObjects?.map(r=>r)||[],t.rawSelf=e.rawSelf??void 0,t.objectId=e.objectId??"",t.objectVersion=e.objectVersion??BigInt("0"),t.objectDigest=e.objectDigest??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function lS(){return{rawChanges:[],timestamp:void 0,txDigest:"",slot:BigInt("0")}}o(lS,"createBaseData_SuiObjectChange");var Yu={encode(e,t=b.default.Writer.create()){for(let r of e.rawChanges)t.uint32(42).string(r);if(e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.txDigest!==""&&t.uint32(34).string(e.txDigest),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=lS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 5:if(a!==42)break;i.rawChanges.push(r.string());continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.txDigest=r.string();continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawChanges:globalThis.Array.isArray(e?.rawChanges)?e.rawChanges.map(t=>globalThis.String(t)):[],timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,txDigest:S(e.txDigest)?globalThis.String(e.txDigest):"",slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawChanges?.length&&(t.rawChanges=e.rawChanges),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.txDigest!==""&&(t.txDigest=e.txDigest),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Yu.fromPartial(e??{})},fromPartial(e){let t=lS();return t.rawChanges=e.rawChanges?.map(r=>r)||[],t.timestamp=e.timestamp??void 0,t.txDigest=e.txDigest??"",t.slot=e.slot??BigInt("0"),t}};function fS(){return{transaction:void 0,timestamp:void 0,receiptIndex:BigInt("0")}}o(fS,"createBaseData_FuelReceipt");var ju={encode(e,t=b.default.Writer.create()){if(e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.receiptIndex!==BigInt("0")){if(BigInt.asIntN(64,e.receiptIndex)!==e.receiptIndex)throw new globalThis.Error("value provided for field message.receiptIndex of type int64 too large");t.uint32(24).int64(e.receiptIndex.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=fS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.receiptIndex=Fr(r.int64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,receiptIndex:S(e.receiptIndex)?BigInt(e.receiptIndex):BigInt("0")}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.receiptIndex!==BigInt("0")&&(t.receiptIndex=e.receiptIndex.toString()),t},create(e){return ju.fromPartial(e??{})},fromPartial(e){let t=fS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.receiptIndex=e.receiptIndex??BigInt("0"),t}};function mS(){return{transaction:void 0,timestamp:void 0}}o(mS,"createBaseData_FuelTransaction");var ec={encode(e,t=b.default.Writer.create()){return e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=mS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return ec.fromPartial(e??{})},fromPartial(e){let t=mS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function hS(){return{block:void 0,timestamp:void 0}}o(hS,"createBaseData_FuelBlock");var tc={encode(e,t=b.default.Writer.create()){return e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=hS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{block:Nt(e.block)?e.block:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return tc.fromPartial(e??{})},fromPartial(e){let t=hS();return t.block=e.block??void 0,t.timestamp=e.timestamp??void 0,t}};function gS(){return{transaction:void 0,timestamp:void 0}}o(gS,"createBaseData_CosmosCall");var rc={encode(e,t=b.default.Writer.create()){return e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=gS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return rc.fromPartial(e??{})},fromPartial(e){let t=gS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function _S(){return{result:void 0,timestamp:void 0}}o(_S,"createBaseData_StarknetEvent");var nc={encode(e,t=b.default.Writer.create()){return e.result!==void 0&&ee.encode(ee.wrap(e.result),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_S();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{result:Nt(e.result)?e.result:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.result!==void 0&&(t.result=e.result),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return nc.fromPartial(e??{})},fromPartial(e){let t=_S();return t.result=e.result??void 0,t.timestamp=e.timestamp??void 0,t}};function AS(){return{data:void 0,handlerType:0,handlerIds:[],chainId:""}}o(AS,"createBaseDataBinding");var yn={encode(e,t=b.default.Writer.create()){e.data!==void 0&&Uu.encode(e.data,t.uint32(10).fork()).ldelim(),e.handlerType!==0&&t.uint32(24).int32(e.handlerType),t.uint32(34).fork();for(let r of e.handlerIds)t.int32(r);return t.ldelim(),e.chainId!==""&&t.uint32(42).string(e.chainId),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=AS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.data=Uu.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.handlerType=r.int32();continue;case 4:if(a===32){i.handlerIds.push(r.int32());continue}if(a===34){let s=r.uint32()+r.pos;for(;r.pos<s;)i.handlerIds.push(r.int32());continue}break;case 5:if(a!==42)break;i.chainId=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{data:S(e.data)?Uu.fromJSON(e.data):void 0,handlerType:S(e.handlerType)?PS(e.handlerType):0,handlerIds:globalThis.Array.isArray(e?.handlerIds)?e.handlerIds.map(t=>globalThis.Number(t)):[],chainId:S(e.chainId)?globalThis.String(e.chainId):""}},toJSON(e){let t={};return e.data!==void 0&&(t.data=Uu.toJSON(e.data)),e.handlerType!==0&&(t.handlerType=LS(e.handlerType)),e.handlerIds?.length&&(t.handlerIds=e.handlerIds.map(r=>Math.round(r))),e.chainId!==""&&(t.chainId=e.chainId),t},create(e){return yn.fromPartial(e??{})},fromPartial(e){let t=AS();return t.data=e.data!==void 0&&e.data!==null?Uu.fromPartial(e.data):void 0,t.handlerType=e.handlerType??0,t.handlerIds=e.handlerIds?.map(r=>r)||[],t.chainId=e.chainId??"",t}};function yS(){return{configUpdated:!1,error:void 0}}o(yS,"createBaseStateResult");var ic={encode(e,t=b.default.Writer.create()){return e.configUpdated!==!1&&t.uint32(8).bool(e.configUpdated),e.error!==void 0&&t.uint32(18).string(e.error),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=yS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.configUpdated=r.bool();continue;case 2:if(a!==18)break;i.error=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{configUpdated:S(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:S(e.error)?globalThis.String(e.error):void 0}},toJSON(e){let t={};return e.configUpdated!==!1&&(t.configUpdated=e.configUpdated),e.error!==void 0&&(t.error=e.error),t},create(e){return ic.fromPartial(e??{})},fromPartial(e){let t=yS();return t.configUpdated=e.configUpdated??!1,t.error=e.error??void 0,t}};function wS(){return{gauges:[],counters:[],events:[],exports:[],states:void 0,timeseriesResult:[]}}o(wS,"createBaseProcessResult");var Yr={encode(e,t=b.default.Writer.create()){for(let r of e.gauges)sc.encode(r,t.uint32(10).fork()).ldelim();for(let r of e.counters)dc.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.events)uc.encode(r,t.uint32(34).fork()).ldelim();for(let r of e.exports)cc.encode(r,t.uint32(42).fork()).ldelim();e.states!==void 0&&ic.encode(e.states,t.uint32(50).fork()).ldelim();for(let r of e.timeseriesResult)ea.encode(r,t.uint32(58).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=wS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gauges.push(sc.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.counters.push(dc.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.events.push(uc.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.exports.push(cc.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.states=ic.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.timeseriesResult.push(ea.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(t=>sc.fromJSON(t)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(t=>dc.fromJSON(t)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(t=>uc.fromJSON(t)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(t=>cc.fromJSON(t)):[],states:S(e.states)?ic.fromJSON(e.states):void 0,timeseriesResult:globalThis.Array.isArray(e?.timeseriesResult)?e.timeseriesResult.map(t=>ea.fromJSON(t)):[]}},toJSON(e){let t={};return e.gauges?.length&&(t.gauges=e.gauges.map(r=>sc.toJSON(r))),e.counters?.length&&(t.counters=e.counters.map(r=>dc.toJSON(r))),e.events?.length&&(t.events=e.events.map(r=>uc.toJSON(r))),e.exports?.length&&(t.exports=e.exports.map(r=>cc.toJSON(r))),e.states!==void 0&&(t.states=ic.toJSON(e.states)),e.timeseriesResult?.length&&(t.timeseriesResult=e.timeseriesResult.map(r=>ea.toJSON(r))),t},create(e){return Yr.fromPartial(e??{})},fromPartial(e){let t=wS();return t.gauges=e.gauges?.map(r=>sc.fromPartial(r))||[],t.counters=e.counters?.map(r=>dc.fromPartial(r))||[],t.events=e.events?.map(r=>uc.fromPartial(r))||[],t.exports=e.exports?.map(r=>cc.fromPartial(r))||[],t.states=e.states!==void 0&&e.states!==null?ic.fromPartial(e.states):void 0,t.timeseriesResult=e.timeseriesResult?.map(r=>ea.fromPartial(r))||[],t}};function vS(){return{context:void 0,calldata:""}}o(vS,"createBaseEthCallParam");var ac={encode(e,t=b.default.Writer.create()){return e.context!==void 0&&oc.encode(e.context,t.uint32(10).fork()).ldelim(),e.calldata!==""&&t.uint32(18).string(e.calldata),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=vS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.context=oc.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.calldata=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{context:S(e.context)?oc.fromJSON(e.context):void 0,calldata:S(e.calldata)?globalThis.String(e.calldata):""}},toJSON(e){let t={};return e.context!==void 0&&(t.context=oc.toJSON(e.context)),e.calldata!==""&&(t.calldata=e.calldata),t},create(e){return ac.fromPartial(e??{})},fromPartial(e){let t=vS();return t.context=e.context!==void 0&&e.context!==null?oc.fromPartial(e.context):void 0,t.calldata=e.calldata??"",t}};function bS(){return{chainId:"",address:"",blockTag:""}}o(bS,"createBaseEthCallContext");var oc={encode(e,t=b.default.Writer.create()){return e.chainId!==""&&t.uint32(10).string(e.chainId),e.address!==""&&t.uint32(18).string(e.address),e.blockTag!==""&&t.uint32(26).string(e.blockTag),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=bS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=r.string();continue;case 2:if(a!==18)break;i.address=r.string();continue;case 3:if(a!==26)break;i.blockTag=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainId:S(e.chainId)?globalThis.String(e.chainId):"",address:S(e.address)?globalThis.String(e.address):"",blockTag:S(e.blockTag)?globalThis.String(e.blockTag):""}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.blockTag!==""&&(t.blockTag=e.blockTag),t},create(e){return oc.fromPartial(e??{})},fromPartial(e){let t=bS();return t.chainId=e.chainId??"",t.address=e.address??"",t.blockTag=e.blockTag??"",t}};function IS(){return{ethCallParams:[]}}o(IS,"createBasePreprocessResult");var Oq={encode(e,t=b.default.Writer.create()){for(let r of e.ethCallParams)ac.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=IS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.ethCallParams.push(ac.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{ethCallParams:globalThis.Array.isArray(e?.ethCallParams)?e.ethCallParams.map(t=>ac.fromJSON(t)):[]}},toJSON(e){let t={};return e.ethCallParams?.length&&(t.ethCallParams=e.ethCallParams.map(r=>ac.toJSON(r))),t},create(e){return Oq.fromPartial(e??{})},fromPartial(e){let t=IS();return t.ethCallParams=e.ethCallParams?.map(r=>ac.fromPartial(r))||[],t}};function ES(){return{ethCallResults:{}}}o(ES,"createBasePreparedData");var Bq={encode(e,t=b.default.Writer.create()){return Object.entries(e.ethCallResults).forEach(([r,n])=>{E6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ES();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=E6.decode(r,r.uint32());s.value!==void 0&&(i.ethCallResults[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{ethCallResults:Nt(e.ethCallResults)?Object.entries(e.ethCallResults).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{}}},toJSON(e){let t={};if(e.ethCallResults){let r=Object.entries(e.ethCallResults);r.length>0&&(t.ethCallResults={},r.forEach(([n,i])=>{t.ethCallResults[n]=i}))}return t},create(e){return Bq.fromPartial(e??{})},fromPartial(e){let t=ES();return t.ethCallResults=Object.entries(e.ethCallResults??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=globalThis.String(i)),r),{}),t}};function TS(){return{key:"",value:""}}o(TS,"createBasePreparedData_EthCallResultsEntry");var E6={encode(e,t=b.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=TS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.String(e.key):"",value:S(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return E6.fromPartial(e??{})},fromPartial(e){let t=TS();return t.key=e.key??"",t.value=e.value??"",t}};function NS(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}o(NS,"createBaseRecordMetaData");var Et={encode(e,t=b.default.Writer.create()){if(e.address!==""&&t.uint32(10).string(e.address),e.contractName!==""&&t.uint32(74).string(e.contractName),e.blockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.blockNumber)!==e.blockNumber)throw new globalThis.Error("value provided for field message.blockNumber of type uint64 too large");t.uint32(16).uint64(e.blockNumber.toString())}return e.transactionHash!==""&&t.uint32(50).string(e.transactionHash),e.chainId!==""&&t.uint32(42).string(e.chainId),e.transactionIndex!==0&&t.uint32(24).int32(e.transactionIndex),e.logIndex!==0&&t.uint32(32).int32(e.logIndex),e.name!==""&&t.uint32(82).string(e.name),Object.entries(e.labels).forEach(([r,n])=>{T6.encode({key:r,value:n},t.uint32(58).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=NS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=r.string();continue;case 9:if(a!==74)break;i.contractName=r.string();continue;case 2:if(a!==16)break;i.blockNumber=Fr(r.uint64());continue;case 6:if(a!==50)break;i.transactionHash=r.string();continue;case 5:if(a!==42)break;i.chainId=r.string();continue;case 3:if(a!==24)break;i.transactionIndex=r.int32();continue;case 4:if(a!==32)break;i.logIndex=r.int32();continue;case 10:if(a!==82)break;i.name=r.string();continue;case 7:if(a!==58)break;let s=T6.decode(r,r.uint32());s.value!==void 0&&(i.labels[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{address:S(e.address)?globalThis.String(e.address):"",contractName:S(e.contractName)?globalThis.String(e.contractName):"",blockNumber:S(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:S(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:S(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:S(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:S(e.logIndex)?globalThis.Number(e.logIndex):0,name:S(e.name)?globalThis.String(e.name):"",labels:Nt(e.labels)?Object.entries(e.labels).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{}}},toJSON(e){let t={};if(e.address!==""&&(t.address=e.address),e.contractName!==""&&(t.contractName=e.contractName),e.blockNumber!==BigInt("0")&&(t.blockNumber=e.blockNumber.toString()),e.transactionHash!==""&&(t.transactionHash=e.transactionHash),e.chainId!==""&&(t.chainId=e.chainId),e.transactionIndex!==0&&(t.transactionIndex=Math.round(e.transactionIndex)),e.logIndex!==0&&(t.logIndex=Math.round(e.logIndex)),e.name!==""&&(t.name=e.name),e.labels){let r=Object.entries(e.labels);r.length>0&&(t.labels={},r.forEach(([n,i])=>{t.labels[n]=i}))}return t},create(e){return Et.fromPartial(e??{})},fromPartial(e){let t=NS();return t.address=e.address??"",t.contractName=e.contractName??"",t.blockNumber=e.blockNumber??BigInt("0"),t.transactionHash=e.transactionHash??"",t.chainId=e.chainId??"",t.transactionIndex=e.transactionIndex??0,t.logIndex=e.logIndex??0,t.name=e.name??"",t.labels=Object.entries(e.labels??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=globalThis.String(i)),r),{}),t}};function SS(){return{key:"",value:""}}o(SS,"createBaseRecordMetaData_LabelsEntry");var T6={encode(e,t=b.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=SS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.String(e.key):"",value:S(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return T6.fromPartial(e??{})},fromPartial(e){let t=SS();return t.key=e.key??"",t.value=e.value??"",t}};function CS(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}o(CS,"createBaseMetricValue");var jr={encode(e,t=b.default.Writer.create()){return e.bigDecimal!==void 0&&t.uint32(10).string(e.bigDecimal),e.doubleValue!==void 0&&t.uint32(17).double(e.doubleValue),e.bigInteger!==void 0&&Kr.encode(e.bigInteger,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=CS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bigDecimal=r.string();continue;case 2:if(a!==17)break;i.doubleValue=r.double();continue;case 3:if(a!==26)break;i.bigInteger=Kr.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{bigDecimal:S(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:S(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:S(e.bigInteger)?Kr.fromJSON(e.bigInteger):void 0}},toJSON(e){let t={};return e.bigDecimal!==void 0&&(t.bigDecimal=e.bigDecimal),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.bigInteger!==void 0&&(t.bigInteger=Kr.toJSON(e.bigInteger)),t},create(e){return jr.fromPartial(e??{})},fromPartial(e){let t=CS();return t.bigDecimal=e.bigDecimal??void 0,t.doubleValue=e.doubleValue??void 0,t.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?Kr.fromPartial(e.bigInteger):void 0,t}};function OS(){return{from:0}}o(OS,"createBaseRuntimeInfo");var Tt={encode(e,t=b.default.Writer.create()){return e.from!==0&&t.uint32(8).int32(e.from),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=OS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.from=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{from:S(e.from)?PS(e.from):0}},toJSON(e){let t={};return e.from!==0&&(t.from=LS(e.from)),t},create(e){return Tt.fromPartial(e??{})},fromPartial(e){let t=OS();return t.from=e.from??0,t}};function BS(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}o(BS,"createBaseGaugeResult");var sc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&jr.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=BS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.metricValue=jr.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,metricValue:S(e.metricValue)?jr.fromJSON(e.metricValue):void 0,runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=jr.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return sc.fromPartial(e??{})},fromPartial(e){let t=BS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?jr.fromPartial(e.metricValue):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}};function RS(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}o(RS,"createBaseCounterResult");var dc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&jr.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.add!==!1&&t.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=RS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.metricValue=jr.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.add=r.bool();continue;case 4:if(a!==34)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,metricValue:S(e.metricValue)?jr.fromJSON(e.metricValue):void 0,add:S(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=jr.toJSON(e.metricValue)),e.add!==!1&&(t.add=e.add),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return dc.fromPartial(e??{})},fromPartial(e){let t=RS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?jr.fromPartial(e.metricValue):void 0,t.add=e.add??!1,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}};function xS(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,attributes2:void 0,noMetric:!1}}o(xS,"createBaseEventTrackingResult");var uc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&t.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&ee.encode(ee.wrap(e.attributes),t.uint32(50).fork()).ldelim(),e.severity!==0&&t.uint32(56).int32(e.severity),e.message!==""&&t.uint32(66).string(e.message),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(42).fork()).ldelim(),e.attributes2!==void 0&&et.encode(e.attributes2,t.uint32(74).fork()).ldelim(),e.noMetric!==!1&&t.uint32(24).bool(e.noMetric),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=xS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.distinctEntityId=r.string();continue;case 6:if(a!==50)break;i.attributes=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==56)break;i.severity=r.int32();continue;case 8:if(a!==66)break;i.message=r.string();continue;case 5:if(a!==42)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.attributes2=et.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.noMetric=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,distinctEntityId:S(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:Nt(e.attributes)?e.attributes:void 0,severity:S(e.severity)?sq(e.severity):0,message:S(e.message)?globalThis.String(e.message):"",runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0,attributes2:S(e.attributes2)?et.fromJSON(e.attributes2):void 0,noMetric:S(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.distinctEntityId!==""&&(t.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(t.attributes=e.attributes),e.severity!==0&&(t.severity=dq(e.severity)),e.message!==""&&(t.message=e.message),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),e.attributes2!==void 0&&(t.attributes2=et.toJSON(e.attributes2)),e.noMetric!==!1&&(t.noMetric=e.noMetric),t},create(e){return uc.fromPartial(e??{})},fromPartial(e){let t=xS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.distinctEntityId=e.distinctEntityId??"",t.attributes=e.attributes??void 0,t.severity=e.severity??0,t.message=e.message??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t.attributes2=e.attributes2!==void 0&&e.attributes2!==null?et.fromPartial(e.attributes2):void 0,t.noMetric=e.noMetric??!1,t}};function kS(){return{metadata:void 0,type:0,data:void 0,runtimeInfo:void 0}}o(kS,"createBaseTimeseriesResult");var ea={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.type!==0&&t.uint32(16).int32(e.type),e.data!==void 0&&et.encode(e.data,t.uint32(26).fork()).ldelim(),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=kS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.type=r.int32();continue;case 3:if(a!==26)break;i.data=et.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,type:S(e.type)?yq(e.type):0,data:S(e.data)?et.fromJSON(e.data):void 0,runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.type!==0&&(t.type=wq(e.type)),e.data!==void 0&&(t.data=et.toJSON(e.data)),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return ea.fromPartial(e??{})},fromPartial(e){let t=kS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.type=e.type??0,t.data=e.data!==void 0&&e.data!==null?et.fromPartial(e.data):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}};function DS(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}o(DS,"createBaseExportResult");var cc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.payload!==""&&t.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=DS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.payload=r.string();continue;case 3:if(a!==26)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,payload:S(e.payload)?globalThis.String(e.payload):"",runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.payload!==""&&(t.payload=e.payload),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return cc.fromPartial(e??{})},fromPartial(e){let t=DS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.payload=e.payload??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}},Y1e={name:"Processor",fullName:"processor.Processor",methods:{start:{name:"Start",requestType:C6,requestStream:!1,responseType:zs,responseStream:!1,options:{}},stop:{name:"Stop",requestType:zs,requestStream:!1,responseType:zs,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:N6,requestStream:!1,responseType:S6,responseStream:!1,options:{}},processBindings:{name:"ProcessBindings",requestType:VS,requestStream:!1,responseType:MS,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:O6,requestStream:!0,responseType:US,responseStream:!0,options:{}},preprocessBindingsStream:{name:"PreprocessBindingsStream",requestType:GS,requestStream:!0,responseType:qS,responseStream:!0,options:{}}}},j1e={name:"ProcessorV3",fullName:"processor.ProcessorV3",methods:{start:{name:"Start",requestType:C6,requestStream:!1,responseType:zs,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:N6,requestStream:!1,responseType:S6,responseStream:!1,options:{}},updateTemplates:{name:"UpdateTemplates",requestType:FS,requestStream:!1,responseType:zs,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:O6,requestStream:!0,responseType:QS,responseStream:!0,options:{}}}};function $n(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}o($n,"toTimestamp");function Ln(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}o(Ln,"fromTimestamp");function Yn(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):Ln(Ze.fromJSON(e))}o(Yn,"fromJsonTimestamp");function Fr(e){return BigInt(e.toString())}o(Fr,"longToBigint");b.default.util.Long!==fi&&(b.default.util.Long=fi,b.default.configure());function Nt(e){return typeof e=="object"&&e!==null}o(Nt,"isObject");function S(e){return e!=null}o(S,"isSet");function wp(e){if(typeof e=="number"){if(Number.isNaN(e))throw new Error("Cannot record NaN value");if(!Number.isFinite(e))throw new Error("Cannot record infinite value");return Number.isInteger(e)&&!Number.isSafeInteger(e)?jr.fromPartial({bigInteger:Ta(e)}):jr.fromPartial({doubleValue:Number(e)})}if(typeof e=="bigint")return jr.fromPartial({bigInteger:Ta(e)});if(typeof e=="string")return jr.fromPartial({bigDecimal:e});if(e.isInteger())return jr.fromPartial({bigInteger:JS(e)});if(e.isNaN())throw new Error("Cannot record NaN value");if(!e.isFinite())throw new Error("Cannot record infinite value");return jr.fromPartial({bigDecimal:e.toString()})}o(wp,"toMetricValue");function JS(e){let t=e.isNegative();return t&&(e=e.abs()),zS(e.toString(16),t)}o(JS,"bigDecimalToBigInteger");function uf(e){let t=e<0;return t&&(e=-e),zS(e.toString(16),t)}o(uf,"intToBigInteger");function Ta(e){return typeof e=="number"||typeof e=="bigint"?uf(e):typeof e=="string"?uf(BigInt(e)):e instanceof Gt?JS(e):uf(e)}o(Ta,"toBigInteger");function zS(e,t){e.length%2===1&&(e="0"+e);let r=Buffer.from(e,"hex");return{negative:t,data:new Uint8Array(r)}}o(zS,"hexToBigInteger");function Na(e){let t=(e.c||[]).map((n,i)=>i==0?n.toString():n.toString().padStart(14,"0")).join(""),r=-(t.length-(e.e??0)-1);return{value:Ta(BigInt(t)*BigInt(e.s??1)),exp:r}}o(Na,"toBigDecimal");function B6(e,t,r){let n=wp(e),i={fields:{value:{}}};for(let a in t)t[a]==null?i.fields[a]={nullValue:mt.NULL_VALUE}:i.fields[a]={stringValue:t[a]};if(n.bigInteger!=null)n.bigInteger.negative=r?!n.bigInteger.negative:n.bigInteger.negative,i.fields.value.bigintValue=n.bigInteger;else if(n.bigDecimal!=null){let a=new Gt(n.bigDecimal);r&&(a=a.negated()),i.fields.value.bigdecimalValue=Na(a)}else n.doubleValue!=null?i.fields.value.floatValue=r?-n.doubleValue:n.doubleValue:i.fields.value.nullValue=mt.NULL_VALUE;return i}o(B6,"toTimeSeriesData");import("node:process").then(e=>e.stdout.write(""));var WS=":sto_bi",Rq=":sto_bd";function xq(e){return e.slice(0,128).replace(/[^_a-zA-Z0-9]/g,"_")}o(xq,"normalizeName");function R6(e){return e==="labels"?"labels_":xq(e)}o(R6,"normalizeKey");function kq(e){return e.length>1024?(console.warn(`${e} is exceed max length for value storage, will be truncate to 1024 characters`),e.slice(0,1024)):e}o(kq,"normalizeValue");function x6(e){if(Object.keys(e).length===0)return e;let t={};for(let r in e)e[r]!==void 0?t[R6(r)]=kq(e[r]):console.warn(`key: ${r} has empty value in attributes`);return t}o(x6,"normalizeLabels");function HS(e,t,r){let n;switch(typeof e){case"string":return e.slice(0,t);case"bigint":return e.toString()+WS;case"number":return e;case"function":return null;case"symbol":return null}if(Array.isArray(e))return console.warn(`Array type inside log/event payload is not currently supported and will be ignored. Path: ${r??""}`),null;if(e===Object(e)){if(e instanceof Date)return e.toISOString();if(e instanceof Gt)return e.isNaN()||!e.isFinite()?(console.error("can't submit NaN or Infinity value, will store as 0"),0):e.toString()+Rq;if(Ma.isBN(e))return e.toString(10)+WS;if(e instanceof Promise)return console.error("Cannot submit promise"),null;n={};for(let[a,s]of Object.entries(e)){let d=HS(s,t,`${r??""}.${a}`);d!=null&&(n[a]=d)}}else n=e;return n}o(HS,"normalizeObject");function XS(e){return HS(e,1e3)}o(XS,"normalizeAttribute");function ZS(e){if(e==null)return{nullValue:mt.NULL_VALUE};switch(typeof e){case"string":return{stringValue:e};case"bigint":let t=BigInt(e);return{bigintValue:Ta(t)};case"number":if(isNaN(e)||!isFinite(e))throw new Error("can't submit NaN or Infinity value");if(Number.isSafeInteger(e))return{int64Value:BigInt(e)};if(Number.isInteger(e))throw new Error("This value is outside of safe integer range, please use BigDecimal or BigInt instead");return{floatValue:e};case"function":return{nullValue:mt.UNRECOGNIZED};case"symbol":return{stringValue:String(e)};case"boolean":return{boolValue:e};default:if(e instanceof Uint8Array)return{bytesValue:e};if(e instanceof Date)return{timestampValue:e};if(e instanceof Gt)return{bigdecimalValue:Na(e)};if(Ma.isBN(e)){let r=new Gt(e.toString());if(r.isNaN()||!r.isFinite())throw new Error("can't submit NaN or Infinity value");return{bigdecimalValue:Na(r)}}if(Array.isArray(e))return{listValue:{values:e.map(r=>ZS(r))}};if(e instanceof Promise)return console.error("Cannot submit promise"),{nullValue:mt.UNRECOGNIZED};if(typeof e=="object"){let r=Dq(e);return r?{tokenValue:r}:{structValue:cf(e)}}return console.warn("Cannot submit unsupported type "+typeof e),{nullValue:mt.UNRECOGNIZED}}}o(ZS,"normalizeToRichValue");function cf(...e){let t={fields:{}};for(let r of e)for(let[n,i]of Object.entries(r))try{t.fields[n]=ZS(i)}catch(a){throw new Error("error when converting data for key '"+n+"': "+a.message)}return t}o(cf,"normalizeToRichStruct");function Dq(e){let t=uo.create();for(let r of Object.getOwnPropertyNames(e))switch(r){case"token":let n=Pq(e.token);if(!n)return;t.token=n;break;case"amount":if(e.amount instanceof Gt)t.amount=Na(e);else if(typeof e.amount=="string"||typeof e.amount=="number")t.amount=Na(new Gt(e.amount));else return;break;case"specifiedAt":if(e.specifiedAt instanceof Date)t.specifiedAt=e.specifiedAt;else return;break;default:return}return t.amount&&t.token?t:void 0}o(Dq,"toTokenAmount");function Pq(e){let t=Nn.create();if(typeof e.symbol=="string")return t.symbol=e.symbol;if(e.hasOwnProperty("address"))t.address={address:e.address.address,chain:e.address.chain};else return;return t}o(Pq,"toCoinID");import("node:process").then(e=>e.stdout.write(""));import{MapStateStorage as Nj,processMetrics as ix}from"@sentio/runtime";var is=xr(v5(),1);import{ListStateStorage as Tj}from"@sentio/runtime";var ns=xr(v5(),1);import{GraphQLObjectType as yj,isListType as wj,isNonNullType as vj}from"graphql";var bj=["BigInt","BigDecimal","Timestamp","JSON","Bytes","ID","Int8"],Ij=(0,ns.buildASTSchema)((0,ns.parse)(`
|
|
1326
|
+
${JSON.stringify(this.#e,null,2)}`}byteLength(){return this.toBytes().byteLength}},yG=Xe(e=>Kh+Zh({maxInputs:e}),"calculateScriptDataBaseOffset"),jpe=Ae+Ja+vs+Ae+Ae;function lE(e){let t=[...e.receipts],r,n;if(t.forEach(a=>{a.type===be.ScriptResult?r=a:(a.type===be.Return||a.type===be.ReturnData||a.type===be.Revert)&&(n=a)}),!r||!n)throw new I(x.SCRIPT_REVERTED,"Transaction reverted.");return{code:r.result,gasUsed:r.gasUsed,receipts:t,scriptResultReceipt:r,returnReceipt:n,callResult:e}}o(lE,"callResultToScriptResult");Xe(lE,"callResultToScriptResult");function nf(e){let{callResult:t,scriptResultDecoder:r,logs:n=[],groupedLogs:i={},abis:a}=e;try{let s=lE(t);return r(s)}catch(s){if(s.code===x.SCRIPT_REVERTED){let d=t?.dryRunStatus?.reason;throw J1({logs:n,groupedLogs:i,receipts:t.receipts,statusReason:d,abis:a})}throw s}}o(nf,"decodeCallResult");Xe(nf,"decodeCallResult");function fE(e){let{callResult:t,call:r,logs:n=[],groupedLogs:i={},abis:a}=e;return nf({callResult:t,scriptResultDecoder:Xe(s=>{if(s.returnReceipt.type===be.Revert)throw new I(x.SCRIPT_REVERTED,`Script Reverted. Logs: ${JSON.stringify(n)}`);if(s.returnReceipt.type!==be.Return&&s.returnReceipt.type!==be.ReturnData){let{type:u}=s.returnReceipt;throw new I(x.SCRIPT_REVERTED,`Script Return Type [${u}] Invalid. Logs: ${JSON.stringify({logs:n,groupedLogs:i,receipt:s.returnReceipt})}`)}let d;return s.returnReceipt.type===be.Return&&(d=s.returnReceipt.val),s.returnReceipt.type===be.ReturnData&&(d=r.func.decodeOutput(s.returnReceipt.data)[0]),d},"scriptResultDecoder"),logs:n,groupedLogs:i,abis:a})}o(fE,"callResultToInvocationResult");Xe(fE,"callResultToInvocationResult");var Ap=class mE{static{o(this,"_ScriptRequest")}static{Xe(this,"ScriptRequest")}bytes;scriptDataEncoder;scriptResultDecoder;constructor(t,r,n){this.bytes=q(t),this.scriptDataEncoder=r,this.scriptResultDecoder=n}static getScriptDataOffsetWithScriptBytes(t,r){return Zh({maxInputs:r})+Kh+t}getScriptDataOffset(t){return mE.getScriptDataOffsetWithScriptBytes(this.bytes.length,t)}encodeScriptData(t){let r=this.scriptDataEncoder(t);return ArrayBuffer.isView(r)?r:(this.bytes=q(r.script),r.data)}decodeCallResult(t,r,n,i){let a,s,d,u;return typeof t=="object"&&"callResult"in t?(a=t.callResult,s=t.logs??[],d=t.groupedLogs??{},u=t.abis):(a=t,s=r??[],d=n??{},u=i),nf({callResult:a,scriptResultDecoder:this.scriptResultDecoder,logs:s,groupedLogs:d,abis:u})}},hE={assetIdOffset:0,amountOffset:0,gasForwardedOffset:0,callDataOffset:0},wG=Le,gE=Xe(({callDataOffset:e,gasForwardedOffset:t,amountOffset:r,assetIdOffset:n})=>{let i=new rf(sn.movi(16,e),sn.movi(17,r),sn.lw(17,17,0),sn.movi(18,n));return t?i.push(sn.movi(19,t),sn.lw(19,19,0),sn.call(16,17,18,19)):i.push(sn.call(16,17,18,sn.RegId.cgas().to_u8())),i},"getSingleCallInstructions");function u6(e){if(!e.length)return new Uint8Array;let t=new rf;for(let r=0;r<e.length;r+=1)t.extend(gE(e[r]).entries());return t.push(sn.ret(1)),t.toBytes()}o(u6,"getInstructions");Xe(u6,"getInstructions");var vG=Xe(e=>e===be.Return||e===be.ReturnData,"isReturnType"),bG=Xe((e,t)=>e.find(({type:r,id:n,to:i})=>r===be.Call&&n===wG&&i===t),"getMainCallReceipt"),IG=Xe(e=>t=>{if(Un(t.code)!==0)throw new I(x.SCRIPT_REVERTED,"Transaction reverted.");let r=bG(t.receipts,e.toB256()),n=T(r?.is);return t.receipts.filter(({type:a})=>vG(a)).flatMap(a=>n.eq(T(a.is))?a.type===be.Return?[new le("u64").encode(a.val)]:a.type===be.ReturnData?[q(a.data)]:[new Uint8Array]:[])},"scriptResultDecoder"),EG=Xe(e=>{let{contractId:t,...r}=e;return nf({...r,scriptResultDecoder:IG(t)})},"decodeContractCallScriptResult"),TG=Xe(e=>e.reduce((t,r)=>{let n={...hE};return r.gas&&(n.gasForwardedOffset=1),t+gE(n).byteLength()},sn.Instruction.size()),"getCallInstructionsLength"),NG=Xe((e,t)=>new Ap(u6(new Array(e.length).fill(hE)),r=>{let n=r.length;if(n===0)return{data:new Uint8Array,script:new Uint8Array};let i=TG(r),a=(8-i%8)%8,s=i+a,d=yG(t.toNumber())+s,u=[],p=d,m=[];for(let E=0;E<n;E+=1){let B=r[E],L=p,D=L+Ae,Q=D+Ja,W=Q+vs+Ae+Ae,H=W+B.fnSelectorBytes.byteLength,K=q(B.data),Y=0;m.push(new le("u64").encode(B.amount||0)),m.push(new he().encode(B.assetId?.toString()||Le)),m.push(B.contractId.toBytes()),m.push(new le("u64").encode(W)),m.push(new le("u64").encode(H)),m.push(B.fnSelectorBytes),m.push(K),B.gas&&(m.push(new le("u64").encode(B.gas)),Y=H+K.byteLength);let X={amountOffset:L,assetIdOffset:D,gasForwardedOffset:Y,callDataOffset:Q};u.push(X),p=d+ce(m).byteLength}let g=u6(u);return{data:ce(m),script:g}},()=>[new Uint8Array]),"getContractCallScript");function af(e,t,r,n,i,a){let s,d,u,p,m,g;typeof e=="object"&&!Array.isArray(e)?(s=e.functionScopes,d=e.receipts,u=e.isMultiCall,p=e.logs??[],m=e.groupedLogs??{},g=e.abis):(s=e,d=t,u=r,p=n??[],m=i??{},g=a);let A=s[0]?.getCallConfig();if(s.length===1&&A&&"bytes"in A.program)return fE({callResult:{receipts:d},call:A,logs:p,groupedLogs:m,abis:g});let B=EG({callResult:{receipts:d},contractId:(A?.program).id,logs:p,groupedLogs:m,abis:g}).map((L,D)=>{let{func:Q}=s[D].getCallConfig();return Q.decodeOutput(L)?.[0]});return u?B:B?.[0]}o(af,"extractInvocationResult");Xe(af,"extractInvocationResult");var SG=Xe(async e=>{let{funcScope:t,isMultiCall:r,program:n,transactionResponse:i}=e,a=await i.waitForResult(),{receipts:s}=a,d=Array.isArray(t)?t:[t],u=d[0]?.getCallConfig(),{main:p,otherContractsAbis:m}=tf(d),g={main:p,otherContractsAbis:m},{logs:A,groupedLogs:E}=p6({receipts:s,mainCallConfig:u,functionScopes:d}),B=af(d,s,r,A,E,g),L=Qs(s);return{isMultiCall:r,functionScopes:d,value:B,program:n,transactionResult:a,transactionResponse:i,transactionId:i.id,logs:A,groupedLogs:E,gasUsed:L}},"buildFunctionResult"),CG=Xe(async e=>{let{funcScope:t,isMultiCall:r,program:n,transactionResponse:i}=e,a=await i.waitForPreConfirmation(),{receipts:s}=a,d=Array.isArray(t)?t:[t],u=d[0]?.getCallConfig(),p,m,g,A;return s&&({logs:p,groupedLogs:m}=p6({receipts:s,mainCallConfig:u,functionScopes:d}),A=af(d,s,r,p,m),g=Qs(s)),{isMultiCall:r,functionScopes:d,program:n,transactionResult:a,transactionResponse:i,transactionId:i.id,logs:p,groupedLogs:m,gasUsed:g,value:A}},"buildPreConfirmationFunctionResult"),s6=Xe(e=>{let{funcScopes:t,callResult:r,isMultiCall:n}=e,{receipts:i}=r,a=Array.isArray(t)?t:[t],s=a[0]?.getCallConfig(),{logs:d,groupedLogs:u}=p6({receipts:i,mainCallConfig:s,functionScopes:a}),p=af(a,i,n,d,u),m=Qs(i);return{functionScopes:a,callResult:r,isMultiCall:n,gasUsed:m,value:p}},"buildDryRunResult");function _E(e){let{program:t,args:r,forward:n,func:i,callParameters:a,externalAbis:s}=e.getCallConfig(),d=i.encodeArguments(r);return{contractId:t.id,fnSelectorBytes:i.selectorBytes,data:d,assetId:n?.assetId,amount:n?.amount,gas:a?.gasLimit,externalContractsAbis:s}}o(_E,"createContractCall");Xe(_E,"createContractCall");var AE=class{static{o(this,"BaseInvocationScope")}static{Xe(this,"BaseInvocationScope")}transactionRequest;program;functionInvocationScopes=[];txParameters;assembleTxParameters;requiredCoins=[];isMultiCall=!1;hasCallParamsGasLimit=!1;externalAbis={};addSignersCallback;constructor(e,t){this.program=e,this.isMultiCall=t,this.transactionRequest=new Li}get calls(){return this.functionInvocationScopes.map(e=>_E(e))}async updateScriptRequest(){let e=this.getProvider(),{consensusParameters:{txParameters:{maxInputs:t}}}=await e.getChain(),r=NG(this.functionInvocationScopes,t);this.transactionRequest.setScript(r,this.calls)}updateContractInputAndOutput(){this.calls.forEach(t=>{t.contractId&&this.transactionRequest.addContractInputAndOutput(t.contractId),t.externalContractsAbis&&Object.keys(t.externalContractsAbis).forEach(r=>this.transactionRequest.addContractInputAndOutput(new Te(r)))})}getRequiredCoins(){return this.calls.map(t=>({assetId:String(t.assetId),amount:T(t.amount||0)})).filter(({assetId:t,amount:r})=>t&&!T(r).isZero())}updateRequiredCoins(){let e=this.getRequiredCoins(),t=Xe((r,{assetId:n,amount:i})=>{let a=r.get(n)?.amount||T(0);return r.set(n,{assetId:String(n),amount:a.add(i)})},"reduceForwardCoins");this.requiredCoins=Array.from(e.reduce(t,new Map).values())}addCall(e){return this.addCalls([e]),this}addCalls(e){return this.functionInvocationScopes.push(...e),this.updateContractInputAndOutput(),this.updateRequiredCoins(),this}async prepareTransaction(){await pE.initWasm(),await this.updateScriptRequest(),this.updateRequiredCoins(),this.checkGasLimitTotal(),this.transactionRequest.type===Be.Script&&(this.transactionRequest.abis=tf(this.functionInvocationScopes))}checkGasLimitTotal(){let e=this.calls.reduce((t,r)=>t.add(r.gas||0),T(0));if(this.transactionRequest.gasLimit.eq(0))this.transactionRequest.gasLimit=e;else if(e.gt(this.transactionRequest.gasLimit))throw new I(x.TRANSACTION_ERROR,"Transaction's gasLimit must be equal to or greater than the combined forwarded gas of all calls.")}async getTransactionCost(){let e=pt(await this.getTransactionRequest());return(this.program.account??Xn.generate({provider:this.getProvider()})).getTransactionCost(e,{quantities:this.getRequiredCoins(),signatureCallback:this.addSignersCallback})}async fundWithRequiredCoins({skipAutoConsolidation:e}={}){let t=await this.getTransactionRequest();t=pt(t);let{feePayerAccount:r,accountCoinQuantities:n,...i}=this.assembleTxParameters??{};t.maxFee=T(0),t.gasLimit=T(0);let a=this.getProvider(),s=this.program.account??Xn.generate({provider:a}),d=await a.getBaseAssetId();if(r||(r=s),!n){let p=t.outputs.filter(m=>m.type===ve.Coin).map(({amount:m,assetId:g})=>({assetId:String(g),amount:T(m)}));n=fp(p,this.requiredCoins),n.length||n.push({assetId:d,amount:T(0)})}let u=Xe(async()=>{let{assembledRequest:p,gasPrice:m}=await a.assembleTx({request:t,feePayerAccount:r,accountCoinQuantities:n,...i});return await Go({gasPrice:m,provider:a,transactionRequest:p,setGasLimit:this.txParameters?.gasLimit,setMaxFee:this.txParameters?.maxFee}),p},"assembleTx");try{return await u()}catch(p){if(!await U1({error:p,account:s,skipAutoConsolidation:e}))throw p;return await u()}}async legacyFundWithRequiredCoins({skipAutoConsolidation:e}={}){let t=await this.getTransactionRequest();t=pt(t);let r=await this.getTransactionCost(),{gasUsed:n,missingContractIds:i,outputVariables:a,maxFee:s}=r;return this.setDefaultTxParams(t,n,s),i.forEach(d=>{t.addContractInputAndOutput(new Te(d))}),t.addVariableOutputs(a),await this.program.account?.fund(t,r,{skipAutoConsolidation:e}),this.addSignersCallback&&await this.addSignersCallback(t),t}txParams(e){this.txParameters=e;let t=this.transactionRequest;return t.tip=T(e.tip||t.tip),t.gasLimit=T(e.gasLimit||t.gasLimit),t.maxFee=e.maxFee?T(e.maxFee):t.maxFee,t.witnessLimit=e.witnessLimit?T(e.witnessLimit):t.witnessLimit,t.maturity=e.maturity||t.maturity,t.expiration=e.expiration||t.expiration,t.addVariableOutputs(this.txParameters?.variableOutputs||0),this}assembleTxParams(e){return this.assembleTxParameters=e,this}addContracts(e){return e.forEach(t=>{typeof t=="string"?this.transactionRequest.addContractInputAndOutput(new Te(t)):(this.transactionRequest.addContractInputAndOutput(t.id),this.externalAbis[t.id.toB256()]=t.interface.jsonAbi)}),this}addTransfer(e){let{amount:t,destination:r,assetId:n}=e;return this.transactionRequest=this.transactionRequest.addCoinOutput(new Te(r),t,n),this}addBatchTransfer(e){return e.forEach(({destination:t,amount:r,assetId:n})=>{this.transactionRequest=this.transactionRequest.addCoinOutput(new Te(t),r,n)}),this}addSigners(e){return this.addSignersCallback=t=>t.addAccountWitnesses(e),this}async getTransactionRequest(){return await this.prepareTransaction(),this.transactionRequest}fromRequest(e){return this.transactionRequest=e,this}async call(e){d6(this.program.account,"Wallet is required!");let t=await this.getTransactionRequest(),r=e?.skipAssembleTx,n=e?.skipAutoConsolidation;r||(this.addSignersCallback?t=await this.legacyFundWithRequiredCoins({skipAutoConsolidation:n}):t=await this.fundWithRequiredCoins({skipAutoConsolidation:n}));let i=await this.program.account.sendTransaction(t,{estimateTxDependencies:!1});return{transactionId:i.id,waitForResult:Xe(async()=>SG({funcScope:this.functionInvocationScopes,isMultiCall:this.isMultiCall,program:this.program,transactionResponse:i}),"waitForResult"),waitForPreConfirmation:Xe(async()=>CG({funcScope:this.functionInvocationScopes,isMultiCall:this.isMultiCall,program:this.program,transactionResponse:i}),"waitForPreConfirmation")}}async simulate(){if(d6(this.program.account,"Wallet is required!"),!("populateTransactionWitnessesSignature"in this.program.account))throw new I(x.ABI_MAIN_METHOD_MISSING,"An unlocked wallet is required to simulate a contract call.");let e=await this.fundWithRequiredCoins(),t=await this.program.account.simulateTransaction(e,{estimateTxDependencies:!1});return s6({funcScopes:this.functionInvocationScopes,callResult:t,isMultiCall:this.isMultiCall})}async dryRun(){let{receipts:e}=await this.getTransactionCost(),t={receipts:e};return s6({funcScopes:this.functionInvocationScopes,callResult:t,isMultiCall:this.isMultiCall})}async get(){let e=await this.getTransactionRequest();e=pt(e),e.maxFee=T(0),e.gasLimit=T(0),e.inputs=e.inputs.filter(p=>p.type!==De.Coin);let t=this.getProvider(),r=this.program.account??Xn.generate({provider:t}),n=await t.getBaseAssetId(),i=e.outputs.filter(p=>p.type===ve.Coin).map(({amount:p,assetId:m})=>({assetId:String(m),amount:T(p)})).concat(this.requiredCoins),a=r.generateFakeResources(i),s=a.find(p=>p.assetId===n),d=T("1000000000000000");if(s)s.amount=s.amount.add(d);else{let[p]=r.generateFakeResources([{assetId:n,amount:d}]);a.push(p)}e.addResources(a);let{receipts:u}=await t.assembleTx({request:e,feePayerAccount:r});return s6({funcScopes:this.functionInvocationScopes,callResult:{receipts:u},isMultiCall:this.isMultiCall})}getProvider(){return this.program.provider}setDefaultTxParams(e,t,r){let n=Jr(this.txParameters?.gasLimit)||this.hasCallParamsGasLimit,i=Jr(this.txParameters?.maxFee),{gasLimit:a,maxFee:s}=e;if(!n)e.gasLimit=t;else if(a.lt(t))throw new I(x.GAS_LIMIT_TOO_LOW,`Gas limit '${a}' is lower than the required: '${t}'.`);if(!i)e.maxFee=r;else if(r.gt(s))throw new I(x.MAX_FEE_TOO_LOW,`Max fee '${s}' is lower than the required: '${r}'.`)}},l6=class extends AE{static{o(this,"FunctionInvocationScope")}static{Xe(this,"FunctionInvocationScope")}func;callParameters;forward;args;constructor(e,t,r){super(e,!1),this.func=t,this.args=r||[],this.setArguments(...r),super.addCall(this)}getCallConfig(){return{func:this.func,program:this.program,callParameters:this.callParameters,txParameters:this.txParameters,forward:this.forward,args:this.args,externalAbis:this.externalAbis}}setArguments(...e){return this.args=e||[],this}callParams(e){if(!this.hasCallParamsGasLimit&&e?.gasLimit!==void 0&&(this.hasCallParamsGasLimit=!0),this.callParameters=e,e?.forward){if(!this.func.attributes.find(t=>t.name==="payable"))throw new I(x.TRANSACTION_ERROR,`The target function ${this.func.name} cannot accept forwarded funds as it's not marked as 'payable'.`);this.forward=Q1(e.forward)}return this.setArguments(...this.args),this.updateRequiredCoins(),this}},OG=class extends AE{static{o(this,"MultiCallInvocationScope")}static{Xe(this,"MultiCallInvocationScope")}constructor(e,t){super(e,!0),this.addCalls(t)}addCall(e){return super.addCalls([e])}addCalls(e){return super.addCalls(e)}},eu=class{static{o(this,"Contract")}static{Xe(this,"Contract")}id;provider;interface;account;functions={};constructor(e,t,r){this.interface=t instanceof Or?t:new Or(t),this.id=new Te(e),r&&"provider"in r?(this.provider=r.provider,this.account=r):(this.provider=r,this.account=null),Object.keys(this.interface.functions).forEach(n=>{let i=this.interface.getFunction(n);Object.defineProperty(this.functions,i.name,{value:this.buildFunction(i),writable:!1})})}buildFunction(e){return(()=>{let t=Xe((...r)=>new l6(this,e,r),"funcInvocationScopeCreator");return Object.defineProperty(t,"isReadOnly",{value:Xe(()=>e.isReadOnly(),"value"),writable:!1}),t})()}multiCall(e){return new OG(this,e)}getBalance(e){return this.provider.getContractBalance(this.id,e)}};var BG=Object.defineProperty,yp=o((e,t)=>BG(e,"name",{value:t,configurable:!0}),"__name"),RG=class extends l6{static{o(this,"ScriptInvocationScope")}static{yp(this,"ScriptInvocationScope")}scriptRequest;async updateScriptRequest(){this.scriptRequest||await this.buildScriptRequest(),this.transactionRequest.setScript(this.scriptRequest,this.args)}async buildScriptRequest(){let e=this.program.bytes;if(!await this.program.provider.getChain())throw new I(I.CODES.CHAIN_INFO_CACHE_EMPTY,"Provider chain info cache is empty. Please make sure to initialize the `Provider` properly by running `new Provider()`");this.scriptRequest=new Ap(e,r=>this.func.encodeArguments(r),()=>[])}},xG=class extends c6{static{o(this,"AbstractScript")}static{yp(this,"AbstractScript")}},kG=class yE extends xG{static{o(this,"_Script")}static{yp(this,"Script")}bytes;interface;account;script;provider;functions;constructor(t,r,n){super(),this.bytes=q(t),this.interface=new Or(r),this.provider=n.provider,this.account=n,this.functions={main:yp((...i)=>new RG(this,this.interface.getFunction("main"),i),"main")}}setConfigurableConstants(t){try{if(!Object.keys(this.interface.configurables).length)throw new I(I.CODES.INVALID_CONFIGURABLE_CONSTANTS,"The script does not have configurable constants to be set");Object.entries(t).forEach(([r,n])=>{if(!this.interface.configurables[r])throw new I(I.CODES.CONFIGURABLE_NOT_FOUND,`The script does not have a configurable constant named: '${r}'`);let{offset:i}=this.interface.configurables[r],a=this.interface.encodeConfigurable(r,n);this.bytes.set(a,i)})}catch(r){throw new I(I.CODES.INVALID_CONFIGURABLE_CONSTANTS,`Error setting configurable constants: ${r.message}.`)}return this}deploy(t){return ef({deployer:t,abi:this.interface.jsonAbi,bytecode:this.bytes,loaderInstanceCallback:yp((r,n)=>new yE(r,n,this.account),"loaderInstanceCallback")})}},wle=new Ap("0x24000000",()=>new Uint8Array(0),()=>{});var kt=xr(ls(),1);var DG=Object.defineProperty,ci=o((e,t)=>DG(e,"name",{value:t,configurable:!0}),"__name"),PG=ci(e=>{let{RegId:t,Instruction:r}=kt,n=12,i=e.length,a=ri,s=ce(e.map(u=>q(u))),d=new rf(kt.move_(16,t.pc().to_u8()),kt.addi(16,16,n*r.size()),kt.move_(22,t.sp().to_u8()),kt.movi(19,i),kt.bsiz(17,16),kt.ldc(16,0,17,1),kt.addi(16,16,a),kt.subi(19,19,1),kt.jnzb(19,t.zero().to_u8(),3),kt.sub(22,22,t.is().to_u8()),kt.divi(22,22,4),kt.jmp(22)).toBytes();return ce([d,s])},"getLoaderInstructions"),LG=ci((e,t)=>{let r=[];for(let n=0,i=0;n<e.length;n+=t,i++){let a=e.slice(n,n+t),s=a.length;s%Ae!==0&&(a=ce([a,new Uint8Array(t-a.length)]),s=a.length),r.push({id:i,size:s,bytecode:a})}return r},"getContractChunks"),FG=ci(e=>{let r=q(e),n=Rl(r,16384);return dp(n.map(i=>J(i)))},"getContractRoot"),VG=ci(e=>{let t=new ib;return e.forEach(({key:r,value:n})=>t.update(ct(r),n)),t.root},"getContractStorageRoot"),MG=ci((e,t,r)=>{let n=FG(q(e));return ct(ce(["0x4655454C",t,n,r]))},"getContractId"),wE=ci(e=>J(e.startsWith("0x")?e:`0x${e}`),"hexlifyWithPrefix"),vE=.95,bE=class IE{static{o(this,"_ContractFactory")}static{ci(this,"ContractFactory")}bytecode;interface;provider;account;storageSlots;constructor(t,r,n=null,i=[]){this.bytecode=q(t),r instanceof Or?this.interface=r:this.interface=new Or(r),n&&"provider"in n?(this.provider=n.provider,this.account=n):(this.provider=n,this.account=null),this.storageSlots=i}connect(t){return new IE(this.bytecode,this.interface,t)}createTransactionRequest(t){let r=(t?.storageSlots??[]).concat(this.storageSlots).map(({key:u,value:p})=>({key:wE(u),value:wE(p)})).filter((u,p,m)=>m.findIndex(g=>g.key===u.key)===p).sort(({key:u},{key:p})=>u.localeCompare(p)),n={salt:kr(32),...t??{},storageSlots:r};if(!this.provider)throw new I(x.MISSING_PROVIDER,"Cannot create transaction request without provider");let i=t?.bytecode||this.bytecode,a=n.stateRoot||VG(n.storageSlots),s=MG(i,n.salt,a),d=new M1({bytecodeWitnessIndex:0,witnesses:[i],...n});return d.addContractCreatedOutput(s,a),{contractId:s,transactionRequest:d}}async assembleTx(t,r={}){let n=this.getAccount(),{maxFee:i}=r;t.maxFee=T(0);let{gasPrice:a,assembledRequest:s}=await n.provider.assembleTx({request:t,feePayerAccount:n,accountCoinQuantities:[]});return t=await Go({gasPrice:a,provider:n.provider,transactionRequest:s,setMaxFee:i}),t}async deploy(t={}){let r=this.getAccount(),{consensusParameters:n}=await r.provider.getChain(),i=n.contractParameters.contractMaxSize.toNumber();return this.bytecode.length>i?this.deployAsBlobTx(t):this.deployAsCreateTx(t)}async deployAsCreateTx(t={}){let r=this.getAccount(),{consensusParameters:n}=await r.provider.getChain(),i=n.contractParameters.contractMaxSize.toNumber();if(this.bytecode.length>i)throw new I(x.CONTRACT_SIZE_EXCEEDS_LIMIT,"Contract bytecode is too large. Please use `deployAsBlobTx` instead.");let{contractId:a,transactionRequest:s}=await this.prepareDeploy(t),d=await r.sendTransaction(s);return{contractId:a,waitForResult:ci(async()=>{let m=await d.waitForResult();return{contract:new eu(a,this.interface,r),transactionResult:m}},"waitForResult"),waitForPreConfirmation:ci(async()=>{let m=await d.waitForPreConfirmation();return{contract:new eu(a,this.interface,r),transactionResult:m}},"waitForPreConfirmation"),waitForTransactionId:ci(()=>Promise.resolve(d.id),"waitForTransactionId")}}async deployAsBlobTx(t={chunkSizeMultiplier:vE}){let r=this.getAccount(),{configurableConstants:n,chunkSizeMultiplier:i}=t;n&&this.setConfigurableConstants(n);let a=await this.getMaxChunkSize(t,i),s=LG(q(this.bytecode),a).map(X=>{let j=this.blobTransactionRequest({...t,bytecode:X.bytecode});return{...X,transactionRequest:j,blobId:j.blobId}}),d=s.map(({blobId:X})=>X),u=PG(d),{contractId:p,transactionRequest:m}=this.createTransactionRequest({bytecode:u,...t}),g=[...new Set(d)],A=await r.provider.getBlobs(g),E=g.filter(X=>!A.includes(X)),B=T(0),L=await r.provider.getChain(),D=await r.provider.estimateGasPrice(10),Q=L.consensusParameters.feeParameters.gasPriceFactor;for(let{transactionRequest:X,blobId:j}of s){if(E.includes(j)){let te=X.calculateMinGas(L),ne=ao({gasPrice:D,gas:te,priceFactor:Q,tip:X.tip}).add(1);B=B.add(ne)}let ue=m.calculateMinGas(L),U=ao({gasPrice:D,gas:ue,priceFactor:Q,tip:m.tip}).add(1);B=B.add(U)}if(B.gt(await r.getBalance()))throw new I(x.FUNDS_TOO_LOW,"Insufficient balance to deploy contract.");let W,H=new Promise(X=>{W=X});return{waitForResult:ci(async()=>{let X=[];for(let{blobId:te,transactionRequest:ne}of s)if(!X.includes(te)&&E.includes(te)){let we=await this.assembleTx(ne,t),R;try{R=await(await r.sendTransaction(we)).waitForResult()}catch(l){if(l.message.indexOf(`BlobId is already taken ${te}`)>-1){X.push(te);continue}throw new I(x.TRANSACTION_FAILED,"Failed to deploy contract chunk")}if(!R.status||R.status!==X4.success)throw new I(x.TRANSACTION_FAILED,"Failed to deploy contract chunk");X.push(te)}await this.assembleTx(m,t),W(m.getTransactionId(await r.provider.getChainId()));let ue=await(await r.sendTransaction(m)).waitForResult();return{contract:new eu(p,this.interface,r),transactionResult:ue}},"waitForResult"),contractId:p,waitForTransactionId:ci(()=>H,"waitForTransactionId")}}setConfigurableConstants(t){try{if(!Object.keys(this.interface.configurables).length)throw new I(x.CONFIGURABLE_NOT_FOUND,"Contract does not have configurables to be set");Object.entries(t).forEach(([n,i])=>{if(!this.interface.configurables[n])throw new I(x.CONFIGURABLE_NOT_FOUND,`Contract does not have a configurable named: '${n}'`);let{offset:a}=this.interface.configurables[n],s=this.interface.encodeConfigurable(n,i),d=q(this.bytecode);d.set(s,a),this.bytecode=d})}catch(r){throw new I(x.INVALID_CONFIGURABLE_CONSTANTS,`Error setting configurable constants on contract: ${r.message}.`)}}getAccount(){if(!this.account)throw new I(x.ACCOUNT_REQUIRED,"Account not assigned to contract.");return this.account}async prepareDeploy(t){let{configurableConstants:r}=t;r&&this.setConfigurableConstants(r);let{contractId:n,transactionRequest:i}=this.createTransactionRequest(t);return await this.assembleTx(i,t),{contractId:n,transactionRequest:i}}blobTransactionRequest(t){let{bytecode:r}=t;return new mp({blobId:zr(r),witnessIndex:0,witnesses:[r],...t})}async getMaxChunkSize(t,r=vE){if(r<0||r>1)throw new I(x.INVALID_CHUNK_SIZE_MULTIPLIER,"Chunk size multiplier must be between 0 and 1");let n=this.getAccount(),{consensusParameters:i}=await n.provider.getChain(),a=i.contractParameters.contractMaxSize.toNumber(),s=i.txParameters.maxSize.toNumber(),d=64e3,u=s<a?s:a,p=u<d?u:d,m=this.blobTransactionRequest({...t,bytecode:kr(32)}).addResources(n.generateFakeResources([{assetId:await n.provider.getBaseAssetId(),amount:T(1)}])),g=(p-m.byteLength()-Ae)*r;return Math.round(g/Ae)*Ae}};var UG=Object.defineProperty,SE=o((e,t)=>UG(e,"name",{value:t,configurable:!0}),"__name"),EE={programType:"contract",specVersion:"1",encodingVersion:"1",concreteTypes:[{type:"()",concreteTypeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"},{type:"enum standards::src5::AccessError",concreteTypeId:"3f702ea3351c9c1ece2b84048006c8034a24cbc2bad2e740d0412b4172951d3d",metadataTypeId:1},{type:"enum standards::src5::State",concreteTypeId:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c",metadataTypeId:2},{type:"enum std::option::Option<struct std::contract_id::ContractId>",concreteTypeId:"0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",metadataTypeId:4,typeArguments:["29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54"]},{type:"enum sway_libs::ownership::errors::InitializationError",concreteTypeId:"1dfe7feadc1d9667a4351761230f948744068a090fe91b1bc6763a90ed5d3893",metadataTypeId:5},{type:"enum sway_libs::upgradability::errors::SetProxyOwnerError",concreteTypeId:"3c6e90ae504df6aad8b34a93ba77dc62623e00b777eecacfa034a8ac6e890c74",metadataTypeId:6},{type:"str",concreteTypeId:"8c25cb3686462e9a86d2883c5688a22fe738b0bbc85f458d2d2b5f3f667c6d5a"},{type:"struct std::contract_id::ContractId",concreteTypeId:"29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54",metadataTypeId:9},{type:"struct sway_libs::upgradability::events::ProxyOwnerSet",concreteTypeId:"96dd838b44f99d8ccae2a7948137ab6256c48ca4abc6168abc880de07fba7247",metadataTypeId:10},{type:"struct sway_libs::upgradability::events::ProxyTargetSet",concreteTypeId:"1ddc0adda1270a016c08ffd614f29f599b4725407c8954c8b960bdf651a9a6c8",metadataTypeId:11}],metadataTypes:[{type:"b256",metadataTypeId:0},{type:"enum standards::src5::AccessError",metadataTypeId:1,components:[{name:"NotOwner",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"enum standards::src5::State",metadataTypeId:2,components:[{name:"Uninitialized",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"},{name:"Initialized",typeId:3},{name:"Revoked",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"enum std::identity::Identity",metadataTypeId:3,components:[{name:"Address",typeId:8},{name:"ContractId",typeId:9}]},{type:"enum std::option::Option",metadataTypeId:4,components:[{name:"None",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"},{name:"Some",typeId:7}],typeParameters:[7]},{type:"enum sway_libs::ownership::errors::InitializationError",metadataTypeId:5,components:[{name:"CannotReinitialized",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"enum sway_libs::upgradability::errors::SetProxyOwnerError",metadataTypeId:6,components:[{name:"CannotUninitialize",typeId:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"}]},{type:"generic T",metadataTypeId:7},{type:"struct std::address::Address",metadataTypeId:8,components:[{name:"bits",typeId:0}]},{type:"struct std::contract_id::ContractId",metadataTypeId:9,components:[{name:"bits",typeId:0}]},{type:"struct sway_libs::upgradability::events::ProxyOwnerSet",metadataTypeId:10,components:[{name:"new_proxy_owner",typeId:2}]},{type:"struct sway_libs::upgradability::events::ProxyTargetSet",metadataTypeId:11,components:[{name:"new_target",typeId:9}]}],functions:[{inputs:[],name:"proxy_target",output:"0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",attributes:[{name:"doc-comment",arguments:[" Returns the target contract of the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Returns"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * [Option<ContractId>] - The new proxy contract to which all fallback calls will be passed or `None`."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"storage",arguments:["read"]}]},{inputs:[{name:"new_target",concreteTypeId:"29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54"}],name:"set_proxy_target",output:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",attributes:[{name:"doc-comment",arguments:[" Change the target contract of the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Additional Information"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" This method can only be called by the `proxy_owner`."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Arguments"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * `new_target`: [ContractId] - The new proxy contract to which all fallback calls will be passed."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Reverts"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * When not called by `proxy_owner`."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"doc-comment",arguments:[" * Write: `1`"]},{name:"storage",arguments:["read","write"]}]},{inputs:[],name:"proxy_owner",output:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c",attributes:[{name:"doc-comment",arguments:[" Returns the owner of the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Returns"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * [State] - Represents the state of ownership for this contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"storage",arguments:["read"]}]},{inputs:[],name:"initialize_proxy",output:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",attributes:[{name:"doc-comment",arguments:[" Initializes the proxy contract."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Additional Information"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" This method sets the storage values using the values of the configurable constants `INITIAL_TARGET` and `INITIAL_OWNER`."]},{name:"doc-comment",arguments:[" This then allows methods that write to storage to be called."]},{name:"doc-comment",arguments:[" This method can only be called once."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Reverts"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * When `storage::SRC14.proxy_owner` is not [State::Uninitialized]."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Writes: `2`"]},{name:"storage",arguments:["write"]}]},{inputs:[{name:"new_proxy_owner",concreteTypeId:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c"}],name:"set_proxy_owner",output:"2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",attributes:[{name:"doc-comment",arguments:[" Changes proxy ownership to the passed State."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Additional Information"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" This method can be used to transfer ownership between Identities or to revoke ownership."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Arguments"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * `new_proxy_owner`: [State] - The new state of the proxy ownership."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Reverts"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * When the sender is not the current proxy owner."]},{name:"doc-comment",arguments:[" * When the new state of the proxy ownership is [State::Uninitialized]."]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" # Number of Storage Accesses"]},{name:"doc-comment",arguments:[""]},{name:"doc-comment",arguments:[" * Reads: `1`"]},{name:"doc-comment",arguments:[" * Writes: `1`"]},{name:"storage",arguments:["write"]}]}],loggedTypes:[{logId:"4571204900286667806",concreteTypeId:"3f702ea3351c9c1ece2b84048006c8034a24cbc2bad2e740d0412b4172951d3d"},{logId:"2151606668983994881",concreteTypeId:"1ddc0adda1270a016c08ffd614f29f599b4725407c8954c8b960bdf651a9a6c8"},{logId:"2161305517876418151",concreteTypeId:"1dfe7feadc1d9667a4351761230f948744068a090fe91b1bc6763a90ed5d3893"},{logId:"4354576968059844266",concreteTypeId:"3c6e90ae504df6aad8b34a93ba77dc62623e00b777eecacfa034a8ac6e890c74"},{logId:"10870989709723147660",concreteTypeId:"96dd838b44f99d8ccae2a7948137ab6256c48ca4abc6168abc880de07fba7247"},{logId:"10098701174489624218",concreteTypeId:"8c25cb3686462e9a86d2883c5688a22fe738b0bbc85f458d2d2b5f3f667c6d5a"}],messagesTypes:[],configurables:[{name:"INITIAL_TARGET",concreteTypeId:"0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",offset:13368},{name:"INITIAL_OWNER",concreteTypeId:"192bc7098e2fe60635a9918afb563e4e5419d386da2bdbf0d716b4bc8549802c",offset:13320}]},QG=[{key:"7bb458adc1d118713319a5baa00a2d049dd64d2916477d2688d76970c898cd55",value:"0000000000000000000000000000000000000000000000000000000000000000"},{key:"7bb458adc1d118713319a5baa00a2d049dd64d2916477d2688d76970c898cd56",value:"0000000000000000000000000000000000000000000000000000000000000000"},{key:"bb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea754",value:"0000000000000000000000000000000000000000000000000000000000000000"},{key:"bb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea755",value:"0000000000000000000000000000000000000000000000000000000000000000"}],TE=class extends eu{static{o(this,"Src14OwnedProxy")}static{SE(this,"Src14OwnedProxy")}static abi=EE;static storageSlots=QG;constructor(e,t){super(e,EE,t)}},NE=Sy("H4sIAAAAAAAAA9Vbe3Abx3lfgCAFvayz+TAFSjaUUjJkRwosUQ4ly9IhIATSEM2DSVpUGBhg64c0cSyIlVQ5tsccN001aSZlHcdlO06GrtOp6z4GAB+C7T7YR2bUiTtlZhxbTeMWmiatFAst60YZqm6j/r5v93DHw4GOJ84f0QznFne73+5+j9/32FVgISxOCOEV/K/Dn7o259GuXRO/JcSQ8c6CML4nwkZJF8HFnWLovZLXeK/kOyG89+JbGN9C+BZe+q2uEfRE4LIBGiv1VHThdi0i5gJdGTHa7TW0WNNY4JLmoFfXE4jPi3T5ep/q112j337Vr8WIF3PV373nAol5YfTls6OG8Id6m9E3+DG0tVB5F96/onG7b0akejWh9XaMpWNhYcSnL44exPv49JzLnNtoTtDMpMvaR0FvmxHPaaPd6B/rGDMSxRCP7WmaMxJ5I10Wt47qYg2etxnR/CJ/i7Tj29nuSr/42Tlux3yYLygC36+aMxiIzotTuuck+LeD+If9hoxEIQS6MdDX8DxgRAudNvrzNvql96Hvl/TFJdDfaaPfDbo9oL8az7tBf8hGf8GiXxTL0/cuKPpPg36Hjf4R0O1V678H9E9b9IuaRX+m9X3on1f0HwD9XTb6Z0A3Cfrr8LwX9Ccs+jOWnOIzkm+16c8p+juXvl/9f0Z0GnonHP19CeqfigmR6hGeVER4jb5Z7FH7a+jL32Atf2tEp84ELoUxV9XYQzQWOnVO6pRvzIi+AhugdTehPVtpV8/r/TyPTcxWdIv246CfIf3dHNGEES0GjXihRHSq9+z5slrHBOYLy3XkJ7nN6zg7brar17F6c0AXYjP+lr5fNWW+x/4nqsc1PK3mHLLmLGatOaddxtSxboHPsGHF6/7Zc6MDGJNs1o347CJ4/i/pcrgEvl/AvOcCl3Teb+CCk5b/tmq5zVyE3P4cNP4C4/8S40+7y63uklr7GUtuReKXktuMfxm5tSq5ST10lVvdu6bcoON3KB0PGokpjTAq8H1nf8/vME4lcoRlQann+TFux9rnHLTfgQ2QzuCbbw57PgJcDIZ660lOYab/PejIBez77aq1vyH3nfdjfDePjxaL3I5gzmh+Pn1Z22P0Cr+kuRnYOTuEdjfhMeQziXYoFKsXkq9OPVxxCnbrH+3C2Eg75Dnt5geO0V5TPeBNr+ZJxTTowNkh6EAwlKzXoaunIb//hA4sQJb/ZcSnFqUO0J6ctPyHXXRgHuNeBY3XoAN/Bj08X0MHjigd6LZ0oPCSKXfIbX0qnhtMJXL3dXh891q2MA0ZOmmt/JaiFcR48If1qZPb0haOuNjCtiW2kBTe1CDah9U+0oXiaAbjUy0C6/A1xjRxqktsT0VzhxojQge+ebHGwB28pkLRiAi/EX8lyHyMgY/xmUnwYBp8nEmX9VkjMW0ELpLukS059c/7lotMNJtMwqD1b6D17+DtRcgEOFRLJit+6JQJYgoN6wG+G/l0OVOAXKbAk87ARYll1bbtnXKRaxFzn8U68BSvYDywwU2u3neVLM7bbDtj2fb0Ym3b9mxStl3xN9W27X3PtO2vCHHzc34zXhKTgeikCMTHRSAxJgJ9JWH052CP5h6dcZgI8B4jAnGOWIv1HjGiuU6JD851iTbqC7sKh8o+yCOX5XZ02mr3+PTAD4V4htZxNSwmsK7fxvruXhS0zhXmOuUasb5ESaTB38AVzHc1aPZfofo/Ze3Lc5HHDGNfh0qw+6q1fZL40QjdOdUt7sZTx3M1/Li3MdJEfthzB2JKrHMB6/RChjch1jpjrhnjd5PfAu40utCOUkzY2BsUpw6KGxt7gkRb0kvkzmHMesR2uuRx2Dm2i2XZB5s08TESlLgWoXgyn8EaQ6HedoqhbwC9bPqyuA7vgzXohVkGhLtl4CbRonZ0Ghhs0TIiGvkO2D3Fl9inTvtsIswtcjvG89WDHzrmg83ivfKf/P1wE2SSgRzB96uGKZenlFwq+iblWJL40RMkDBEUN2u9u0Q6Aru4gtjoqubUA7u+ZphGAnKFrpKtMW/KhPM5ndtxxNrqvRZDPM5xCPhJ+A7d4yfpHeaC3mVc9M4+H3x/lX1ka9nHSSH+2GYfrZgXtrhUP9AnyrqXhO4ZogUYqQMjpX4A16EfKzEHYgCao4r+J1ievGfSDciN2tEZWtcEyzPZZMoqCFn5+H0XvWcbPMftSJfVtmxwwYUXdVWyw94CV/BnyanOaa/gm2b2Z9wq+8YC0VxlLObSbONN+91vG29YfAcNwjXob+CdXLV+98Fe+pEfDaAP4jHCeEefWwL9ZI+78AcdMwTZ5QbYWJhzM9gYYbJjzK2Krr4M3U0c//RDt7hPvVsfznu2JjuMwBWd9m3YcGv/B+CbZxm+fYh8rzsXOITx/ZBzdOHjMgbMXwQtituADYiTONajGCxvWHEb7LYqbhMPKfzvlvg/NcZtxv9Cd6Udz8MnuuUHvqwt1pHzRwuUE9A4Fz/oOy79YIH8oBmPIp6nfMvN54tBRf+IlQtMEQ6qXGAqo74Beym2yl2PmOYG+t3WA9w7KPxtPR1jW7pBuzsLbJ7K7O7xzcN3NJDfgO3BZxTO23zGdYQHsG/KNf1tsQ5diyHeTMA+D5IdYr0xxLDURvxsHwteE35hXe2ob+SGVSylfFQ+KOOoKRm7ESaTXQ8SxhmQOWR6VXfqnN3WupdiXJblz3FUuV6H7/Nh3SEzPgbGdIf6pqFPYdKnbhfa12x+2MLPYdCGL8Yawbcm4l9I62mnusTN6ll/s3z61qea5jAfeHRC534x/KZ+8ll/M56w35zpI7EmrLWDeEE1CenfIANT9g6575R6Aru1dFnlOFV9Q8ofS9/C+UqecAO8QJ6RyMs19LBvzr7Y63uB7IJ1BjqK71m8H8f7SV4b6xJ8bDRntRO5jLWOnMyfUD8A35vS5Wwzy/0wyZL9KzC64l+vKX6vs8lSt+Mm4T/+6vHXAH+0gv2gigWYZ3GSo0Zy1G24tK46nhLjLn7wNHSklbARa2wNleFT4oypreyDh3MNqUO5FbAZ8lF+LdksmpMxHT7PQ/4J77xtg4NiywCYvPEBPTCUFVryAT2dhO/W0R9xGPvDcmYlYvBVWP9qrL+V6UfY32e4jbwO/VspXlE+fdzmx8wYxM4jpe+kiz5h2W+uFXF6Hb3Dk/kGGWFfLKMw+NYaSkyT/mH+9jmFp9D/Cp6afLPbFvI1Sx6Yw+A1S50l2hSbEF61ks6m+nL1sGWN/A7yFr/Rq/vBY9QVKZ/B3rm21GXV8qTsjnz4PsVjs2H/PNktchCOSRx5xXa2jzTHyeFQClg1nA8D47YcBz4Bo6j+cx68HKY8H+8fOt5NeZFpu2RDs0XLhmaGpM06/XHdE7LOCrsxx/WofJ/G9SAOYgwlGzpLORRjOHKjuxzr/W/269H8ONa0g2p4JmZSXNAC3mLN7ci9QqgD6Oa3VDRfrzB3DfD3DNqUI9hy2akh7O3T+DuGuuWQGVdBz9eCb7rE5yL5FunH4lN+zD+i1i1tn8ZR/MZx91mKq8kPUCyHmtL0S2bu6tjPd5SPJblCR4qEm5r0sVMU33Ebaxamz6DaO35/Vu1hFdqP2b7V0TfKeRojPs7XtaSuI+6MEW2su5KfgietDppPKJoRtB930HzCheYnZT7suq+vK99MMlD58BTlHKrOkfM76J+20Yf/RV32skiCp1TXMWVxI+Regoz2jsQ+EYHeTaBWAd63YJ4Z5LCuddl/VjUuo9KXfDS1Y1vw3qIPmYVtMtuFvRVr7O0zam+qpk97m6Y4w9wb9rGEr19SfKV9ZbCvg1h7ybGvIvb1ceyrDt9O2/bVWmNfL6l9Bd33ZdG37ws6QLVaVR8iG5mi2HCJjQS6eK2eQBfXfr5CY1CDq9iZrG25+doKX6geq+I9qrHPEu+xlgbCINTV3Hy6937l08flfqjvzEVuR4gPs5W9uceagmurWPfDdMYBXsbB5wTbYWXdUxR78t4hkwUlo1a0R13wYFzZ/GnL5gtk89C7Qg7P+4xelddzjq/wS557vGTm31jXKkULOIrzoMvaR4EZ5C/8CjMqfRn3VIwI7CLd4pgW63tPrU/Fi9OaWhvFKXJvsYzM/3mfM7LOETlB9TiV5z/A8bYL3zg+MvdPeSTe3YQzBML8f8J4lcdW1VPvUzVdqj2a9k28NuuYbYgbsqhjHqc6Jn5vIL5K3PCg5kQ6ZWG3ev/oM+SrKvGRx4yPbPm8p1TxxxTj0t7gD+Fbw1bcD9/UJTI1cHOD+t2EdovJV9s3wXqP8yz6bsMkE6c2mO9UP9gJ8yxK80q54BnTwvjzq9hQ+rVIkORO+sfxKugYKh9Y41jHLer3BrQ/4lg/favYKNeQQEvOi2dMC8l5cQ5jxcYUb1AOpM6uqmLkAGHJMrRs8a06H6hNawXRknENZGXlFmY9omasW6lxmTEu5nghOh1UMY5bfGvPexdteW+nzHuR61p5r8opeQ+o/9TOe08q3bblvaRPZt57xJb3XqxhUwWXvDdXO+8VXHems1Rb3gvfUzPv3eeS99r0H3jzwfLecSvvzVPOgTOjwiL22WnLe7nu6ZL3EnaZeS/VGSnvrYwFvU5uSz1PO/LeTpX3Up1c1iIJt6y8d/GnyE3DP2FuGv4wc1PozuhPmpui75M/T7lpla2q/MXFLt1qjr73qzkGoiUxgjqqqunX2+uqhLXQQ8Za9b1Bfa/47JEuTx31AY16uS7hrJPZ68LIoaz9OGq07ZRjNCd9c5TrNsrntpGIF/VHrj0G8dTxbAIfyBdQzkE1I1lb70esSfkdxhEekm+C7TRQX+SEK+zfIXuq4aOG2UX7Ixqo+WrIXbV6/qbqm1Sz5n7JDrOfhj5ezFfH3xQ97hPrYvxFP8qBSX/pnopZJxizycsNkxEPLJFziDCZ6o9LbRc1AZsOgG7IRQ/sdHE/pRrrHTWM4PI1DJu9Uz5LfKT4IQnMg79ifGWsz827nXdDrgXyTWwbZR5Ddwh4jPO8GH1zCmMXuD/OlEF30rRj51nmSeF73XYW63IXIj+vvpmY7Acmr6yNyfn53T0dhDcW3vYhRxqi857YmDwPBy7E8/N3xnzjsv6/xH7NuokNL71WTT4NvBy24iclX4opvmCLmW6kNvqQjo8tjY8RE1BthfYWz1GM6a3lr8CbF1zOZo+RDgHD6O6BjI8SeaqPUB0I/g9nNHxuDJrV9Gaqz40R/w2QLtSTn2lQe6Fza2o7zq1zYfY7/QUaI8+a+/OoUwW3wj5vBTbehvkn5fzI/6rn/3b1/MDqyrk17jOUg3tA607Q2gtaiBNqnVuLAy68CdnWaJ2H96MuUw5uAd1bQBe5W+6MPMt2XeOPXdZI9T5zjROgtRO0OkBrF2jBZmqucaPLGtdRrGDTgSG5Fjf51/P5tn18OqWJdCroSaegN1ey0F3o5tWM0/fYdFfI8+Cl9ctWaz/QQaplRsxaJp+VGdymPGA4twq1TIrp11AdXIv59OZYM/sXrmXCj7QNDuiqlimolskx1KcI42JzqGsKbiebKXYIaoj/if+obV6P2uYNqG020jm6rbZJd1a4tsn+2HxPbVqTdX6J89ZKrdPct73+uMRPAQNCzrMu8PcA+atUMixSg2FPqjfstdmzXe9x11BHHdbAXb3wGtDSLJlV0fwSywz+DndE5F2IQzncxQuvBY3rsF/IP4fzMvjtqrimvk+dWfOZ3zL+x4zpbBjvteIMC+NxT4vxmvDTxHjcBXHDeO9tDoynOLgGxnu3qhxW9pcYz3dE3THe+zUXjKe43sT40gfE+JILxo8B48MK4zEHY3zJwnjwZ5nzefhI1IoRb8UXdmsxDZiawx0g5z5WrKZarPTtFK9TjV5bCb1sw3MV363j+jR/O8/9UDfHeuncGvEI67c6l8N5bDVebFe1Kds5HuxT3SujGo/7fTTRoPwY6tmV2M3tTF/FEuy/KI7gengYdxICB6lgnRTPoha8Q4d8dKFvge6nN8I29KwIRurEvYhF78Y7GW9U3VWwxxvFKswZ5lhdCx0GD/rhryyf8wvKz9yv2g7bk/dFlsqhoYPthM8ouIZR4jbH9nxWQDhBcTvdeeUzC2DYuhTOyimnQx95V1jyl843TJmNm++hf42UE9HdaIV5VNOzMC/ZpW8Br0IbB0RggDFP3kdEvUiLDQicZzTzfWfUAVDLaWL68EvAP5ozByxpAR7cqO5KkK2a/oDupgL/2EaoLiTfo61s0vyG8wK33KgB90QqOa6qL+H+oFVf2oy9bcKaPkL1JZVPtqraxQTnTYy9aC+5LwKZLn+2pGIkyBr662I737HbDseflNPLGgV8WNVZkh3bcFcLdBGrVmORb4fCLcRjzD+ZS+B+OOfV0v4kJsD+3M5YQOPv+F6KvLO3AxiwhzAglVi4U+sJ4mxqYa/WG55L9S/chXrbHPA8C6wJhgabxzDXDUbMCPHv2OYxo0sPc/45BOzsGRwzDuFeOsWe6CvnBoOXYuMlFQdiPO7IXxZtqs4J3nfNGd068A41mMqdzgLdtwe+bXa904la4OdULbIFtRO6B9MFvqk7V1V9v6l0hWogpq5U7kBDV7ZDV4LQlU32WiSwFHfWKjhj6oJNXnXynBFxskM33yS9xJrWgkeEj3TGD/mg3rSsfOpvN+WjZPQpyGifxGlVVyNb7kPewPUAxlnEjqBVuVvr3Lvfo7CW7sJDVoQFU6Sf8Hmw1XjhTKWdKJCv4bW6+07PBcddbr5H6ND/keq71Pg/BZW71HRfP9iLOOEeYEKftG/3u9Sof2ypvm+Zp9pEJ2jsxvg9GN/tdt8S6zDv0VIOp2Su7l5KmX8MMm+DzDfwPVqpS83QJdJNA7pUuQPm0GM+h7DO4/iOlTqDWwiD5nrQDCzVI+iJFbsu55P31/bJ/oWfpU+GbDln+qA+GePeruWTf1b/sqPHTj+WPjEy+vCD9N+CxC8/eCJtf/f49NCf/NW3Wo/vXP/7r06u2ub76pu9W1viT24589bR7LmJvx+UfY/9yqMPjjK9o48ePXF05JGjn31QkrHoyT4bv7vq7RduWeV5nf8J7/7s9hd3bXj+pmv8T4jXHnvm8eZ/3Py1F1vevVzY+uQj536t9cwfPn167vdK+wIrb/qDgQMjjzzyiyO/9OnY6Oix0T17BniR9xw70S+XL764+Zt3fP7A9t/N/+ZE57Nf/vrLvkvPvzZ7cNOb//qZYwfLl18+uv/V/5j8h4eu+8Ku/xk+uePbe3/06xf23ZVr+sG7/m8Uv9HxR0fvemvl2vu9D6f3bfzxUz/47sbnHn7u7V/9ja6rX/3i3kfH/9To/dHLkms7/1c+d7yuns+r50H5vF19335ePtvfkM8W9X3lEfn0qff1n1PPDvV8Vj7rJuXT88b/AzdExjYINgAA"),Kle=class CE extends bE{static{o(this,"_Src14OwnedProxyFactory")}static{SE(this,"Src14OwnedProxyFactory")}static bytecode=NE;constructor(t){super(NE,TE.abi,t,TE.storageSlots)}static deploy(t,r={}){return new CE(t).deploy(r)}};var GG=Object.defineProperty,qG=o((e,t)=>GG(e,"name",{value:t,configurable:!0}),"__name");function JG(e){return e}o(JG,"createConfig");qG(JG,"createConfig");BigInt.prototype.asBigDecimal=function(){return new Gt(this.toString())};BigInt.prototype.scaleDown=function(e){return f6(this,e)};Ma.prototype.asBigDecimal=function(){return new Gt(this.toString(10))};Ma.prototype.scaleDown=function(e){return f6(BigInt(this.toString(10)),e)};function f6(e,t){let r=new Gt(10).pow(Number(t));return e.asBigDecimal().dividedBy(r)}o(f6,"scaleDown");import("node:process").then(e=>e.stdout.write(""));var pi=null;try{pi=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function bt(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}o(bt,"Long");bt.prototype.__isLong__;Object.defineProperty(bt.prototype,"__isLong__",{value:!0});function gn(e){return(e&&e.__isLong__)===!0}o(gn,"isLong");function OE(e){var t=Math.clz32(e&-e);return e?31-t:t}o(OE,"ctz32");bt.isLong=gn;var BE={},RE={};function qs(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=RE[e],n)?n:(r=nt(e,0,!0),i&&(RE[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=BE[e],n)?n:(r=nt(e,e<0?-1:0,!1),i&&(BE[e]=r),r))}o(qs,"fromInt");bt.fromInt=qs;function li(e,t){if(isNaN(e))return t?oo:Fi;if(t){if(e<0)return oo;if(e>=PE)return VE}else{if(e<=-kE)return kn;if(e+1>=kE)return FE}return e<0?li(-e,t).neg():nt(e%ru|0,e/ru|0,t)}o(li,"fromNumber");bt.fromNumber=li;function nt(e,t,r){return new bt(e,t,r)}o(nt,"fromBits");bt.fromBits=nt;var of=Math.pow;function h6(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?oo:Fi;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return h6(e.substring(1),t,r).neg();for(var i=li(of(r,8)),a=Fi,s=0;s<e.length;s+=8){var d=Math.min(8,e.length-s),u=parseInt(e.substring(s,s+d),r);if(d<8){var p=li(of(r,d));a=a.mul(p).add(li(u))}else a=a.mul(i),a=a.add(li(u))}return a.unsigned=t,a}o(h6,"fromString");bt.fromString=h6;function Vi(e,t){return typeof e=="number"?li(e,t):typeof e=="string"?h6(e,t):nt(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}o(Vi,"fromValue");bt.fromValue=Vi;var xE=65536,zG=1<<24,ru=xE*xE,PE=ru*ru,kE=PE/2,DE=qs(zG),Fi=qs(0);bt.ZERO=Fi;var oo=qs(0,!0);bt.UZERO=oo;var tu=qs(1);bt.ONE=tu;var LE=qs(1,!0);bt.UONE=LE;var m6=qs(-1);bt.NEG_ONE=m6;var FE=nt(-1,2147483647,!1);bt.MAX_VALUE=FE;var VE=nt(-1,-1,!0);bt.MAX_UNSIGNED_VALUE=VE;var kn=nt(0,-2147483648,!1);bt.MIN_VALUE=kn;var oe=bt.prototype;oe.toInt=o(function(){return this.unsigned?this.low>>>0:this.low},"toInt");oe.toNumber=o(function(){return this.unsigned?(this.high>>>0)*ru+(this.low>>>0):this.high*ru+(this.low>>>0)},"toNumber");oe.toString=o(function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(kn)){var r=li(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=li(of(t,6),this.unsigned),s=this,d="";;){var u=s.div(a),p=s.sub(u.mul(a)).toInt()>>>0,m=p.toString(t);if(s=u,s.isZero())return m+d;for(;m.length<6;)m="0"+m;d=""+m+d}},"toString");oe.getHighBits=o(function(){return this.high},"getHighBits");oe.getHighBitsUnsigned=o(function(){return this.high>>>0},"getHighBitsUnsigned");oe.getLowBits=o(function(){return this.low},"getLowBits");oe.getLowBitsUnsigned=o(function(){return this.low>>>0},"getLowBitsUnsigned");oe.getNumBitsAbs=o(function(){if(this.isNegative())return this.eq(kn)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1},"getNumBitsAbs");oe.isZero=o(function(){return this.high===0&&this.low===0},"isZero");oe.eqz=oe.isZero;oe.isNegative=o(function(){return!this.unsigned&&this.high<0},"isNegative");oe.isPositive=o(function(){return this.unsigned||this.high>=0},"isPositive");oe.isOdd=o(function(){return(this.low&1)===1},"isOdd");oe.isEven=o(function(){return(this.low&1)===0},"isEven");oe.equals=o(function(t){return gn(t)||(t=Vi(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},"equals");oe.eq=oe.equals;oe.notEquals=o(function(t){return!this.eq(t)},"notEquals");oe.neq=oe.notEquals;oe.ne=oe.notEquals;oe.lessThan=o(function(t){return this.comp(t)<0},"lessThan");oe.lt=oe.lessThan;oe.lessThanOrEqual=o(function(t){return this.comp(t)<=0},"lessThanOrEqual");oe.lte=oe.lessThanOrEqual;oe.le=oe.lessThanOrEqual;oe.greaterThan=o(function(t){return this.comp(t)>0},"greaterThan");oe.gt=oe.greaterThan;oe.greaterThanOrEqual=o(function(t){return this.comp(t)>=0},"greaterThanOrEqual");oe.gte=oe.greaterThanOrEqual;oe.ge=oe.greaterThanOrEqual;oe.compare=o(function(t){if(gn(t)||(t=Vi(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},"compare");oe.comp=oe.compare;oe.negate=o(function(){return!this.unsigned&&this.eq(kn)?kn:this.not().add(tu)},"negate");oe.neg=oe.negate;oe.add=o(function(t){gn(t)||(t=Vi(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,s=t.high>>>16,d=t.high&65535,u=t.low>>>16,p=t.low&65535,m=0,g=0,A=0,E=0;return E+=a+p,A+=E>>>16,E&=65535,A+=i+u,g+=A>>>16,A&=65535,g+=n+d,m+=g>>>16,g&=65535,m+=r+s,m&=65535,nt(A<<16|E,m<<16|g,this.unsigned)},"add");oe.subtract=o(function(t){return gn(t)||(t=Vi(t)),this.add(t.neg())},"subtract");oe.sub=oe.subtract;oe.multiply=o(function(t){if(this.isZero())return this;if(gn(t)||(t=Vi(t)),pi){var r=pi.mul(this.low,this.high,t.low,t.high);return nt(r,pi.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?oo:Fi;if(this.eq(kn))return t.isOdd()?kn:Fi;if(t.eq(kn))return this.isOdd()?kn:Fi;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(DE)&&t.lt(DE))return li(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,s=this.low&65535,d=t.high>>>16,u=t.high&65535,p=t.low>>>16,m=t.low&65535,g=0,A=0,E=0,B=0;return B+=s*m,E+=B>>>16,B&=65535,E+=a*m,A+=E>>>16,E&=65535,E+=s*p,A+=E>>>16,E&=65535,A+=i*m,g+=A>>>16,A&=65535,A+=a*p,g+=A>>>16,A&=65535,A+=s*u,g+=A>>>16,A&=65535,g+=n*m+i*p+a*u+s*d,g&=65535,nt(E<<16|B,g<<16|A,this.unsigned)},"multiply");oe.mul=oe.multiply;oe.divide=o(function(t){if(gn(t)||(t=Vi(t)),t.isZero())throw Error("division by zero");if(pi){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?pi.div_u:pi.div_s)(this.low,this.high,t.low,t.high);return nt(r,pi.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?oo:Fi;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return oo;if(t.gt(this.shru(1)))return LE;a=oo}else{if(this.eq(kn)){if(t.eq(tu)||t.eq(m6))return kn;if(t.eq(kn))return tu;var s=this.shr(1);return n=s.div(t).shl(1),n.eq(Fi)?t.isNegative()?tu:m6:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(kn))return this.unsigned?oo:Fi;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=Fi}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var d=Math.ceil(Math.log(n)/Math.LN2),u=d<=48?1:of(2,d-48),p=li(n),m=p.mul(t);m.isNegative()||m.gt(i);)n-=u,p=li(n,this.unsigned),m=p.mul(t);p.isZero()&&(p=tu),a=a.add(p),i=i.sub(m)}return a},"divide");oe.div=oe.divide;oe.modulo=o(function(t){if(gn(t)||(t=Vi(t)),pi){var r=(this.unsigned?pi.rem_u:pi.rem_s)(this.low,this.high,t.low,t.high);return nt(r,pi.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},"modulo");oe.mod=oe.modulo;oe.rem=oe.modulo;oe.not=o(function(){return nt(~this.low,~this.high,this.unsigned)},"not");oe.countLeadingZeros=o(function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},"countLeadingZeros");oe.clz=oe.countLeadingZeros;oe.countTrailingZeros=o(function(){return this.low?OE(this.low):OE(this.high)+32},"countTrailingZeros");oe.ctz=oe.countTrailingZeros;oe.and=o(function(t){return gn(t)||(t=Vi(t)),nt(this.low&t.low,this.high&t.high,this.unsigned)},"and");oe.or=o(function(t){return gn(t)||(t=Vi(t)),nt(this.low|t.low,this.high|t.high,this.unsigned)},"or");oe.xor=o(function(t){return gn(t)||(t=Vi(t)),nt(this.low^t.low,this.high^t.high,this.unsigned)},"xor");oe.shiftLeft=o(function(t){return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?nt(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):nt(0,this.low<<t-32,this.unsigned)},"shiftLeft");oe.shl=oe.shiftLeft;oe.shiftRight=o(function(t){return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?nt(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):nt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},"shiftRight");oe.shr=oe.shiftRight;oe.shiftRightUnsigned=o(function(t){return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?nt(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?nt(this.high,0,this.unsigned):nt(this.high>>>t-32,0,this.unsigned)},"shiftRightUnsigned");oe.shru=oe.shiftRightUnsigned;oe.shr_u=oe.shiftRightUnsigned;oe.rotateLeft=o(function(t){var r;return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?nt(this.high,this.low,this.unsigned):t<32?(r=32-t,nt(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,nt(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))},"rotateLeft");oe.rotl=oe.rotateLeft;oe.rotateRight=o(function(t){var r;return gn(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?nt(this.high,this.low,this.unsigned):t<32?(r=32-t,nt(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,nt(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))},"rotateRight");oe.rotr=oe.rotateRight;oe.toSigned=o(function(){return this.unsigned?nt(this.low,this.high,!1):this},"toSigned");oe.toUnsigned=o(function(){return this.unsigned?this:nt(this.low,this.high,!0)},"toUnsigned");oe.toBytes=o(function(t){return t?this.toBytesLE():this.toBytesBE()},"toBytes");oe.toBytesLE=o(function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},"toBytesLE");oe.toBytesBE=o(function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},"toBytesBE");bt.fromBytes=o(function(t,r,n){return n?bt.fromBytesLE(t,r):bt.fromBytesBE(t,r)},"fromBytes");bt.fromBytesLE=o(function(t,r){return new bt(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},"fromBytesLE");bt.fromBytesBE=o(function(t,r){return new bt(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},"fromBytesBE");var fi=bt;var b=xr(Js(),1);var sf=xr(Js(),1);function UE(){return{}}o(UE,"createBaseEmpty");var zs={encode(e,t=sf.default.Writer.create()){return t},decode(e,t){let r=e instanceof sf.default.Reader?e:sf.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=UE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return zs.fromPartial(e??{})},fromPartial(e){return UE()}};var Zn=xr(Js(),1);var Ws;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ws||(Ws={}));function WG(e){switch(e){case 0:case"NULL_VALUE":return Ws.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Ws.UNRECOGNIZED}}o(WG,"nullValueFromJSON");function HG(e){switch(e){case Ws.NULL_VALUE:return"NULL_VALUE";case Ws.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(HG,"nullValueToJSON");function g6(){return{fields:{}}}o(g6,"createBaseStruct");var ee={encode(e,t=Zn.default.Writer.create()){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&y6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=g6();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=y6.decode(r,r.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:GE(e.fields)?Object.entries(e.fields).reduce((t,[r,n])=>(t[r]=n,t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([n,i])=>{t.fields[n]=i}))}return t},create(e){return ee.fromPartial(e??{})},fromPartial(e){let t=g6();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=i),r),{}),t},wrap(e){let t=g6();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function QE(){return{key:"",value:void 0}}o(QE,"createBaseStruct_FieldsEntry");var y6={encode(e,t=Zn.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&so.encode(so.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=QE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=so.unwrap(so.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:nu(e.key)?globalThis.String(e.key):"",value:nu(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return y6.fromPartial(e??{})},fromPartial(e){let t=QE();return t.key=e.key??"",t.value=e.value??void 0,t}};function _6(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}o(_6,"createBaseValue");var so={encode(e,t=Zn.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&ee.encode(ee.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Ia.encode(Ia.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_6();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=r.int32();continue;case 2:if(a!==17)break;i.numberValue=r.double();continue;case 3:if(a!==26)break;i.stringValue=r.string();continue;case 4:if(a!==32)break;i.boolValue=r.bool();continue;case 5:if(a!==42)break;i.structValue=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.listValue=Ia.unwrap(Ia.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{nullValue:nu(e.nullValue)?WG(e.nullValue):void 0,numberValue:nu(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:nu(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:nu(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:GE(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=HG(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return so.fromPartial(e??{})},fromPartial(e){let t=_6();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=_6();if(e===null)t.nullValue=Ws.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function A6(){return{values:[]}}o(A6,"createBaseListValue");var Ia={encode(e,t=Zn.default.Writer.create()){for(let r of e.values)so.encode(so.wrap(r),t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof Zn.default.Reader?e:Zn.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=A6();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(so.unwrap(so.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return Ia.fromPartial(e??{})},fromPartial(e){let t=A6();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=A6();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function GE(e){return typeof e=="object"&&e!==null}o(GE,"isObject");function nu(e){return e!=null}o(nu,"isSet");var Hs=xr(Js(),1);function qE(){return{seconds:BigInt("0"),nanos:0}}o(qE,"createBaseTimestamp");var Ze={encode(e,t=Hs.default.Writer.create()){if(e.seconds!==BigInt("0")){if(BigInt.asIntN(64,e.seconds)!==e.seconds)throw new globalThis.Error("value provided for field message.seconds of type int64 too large");t.uint32(8).int64(e.seconds.toString())}return e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let r=e instanceof Hs.default.Reader?e:Hs.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=qE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.seconds=XG(r.int64());continue;case 2:if(a!==16)break;i.nanos=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{seconds:JE(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:JE(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==BigInt("0")&&(t.seconds=e.seconds.toString()),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t},create(e){return Ze.fromPartial(e??{})},fromPartial(e){let t=qE();return t.seconds=e.seconds??BigInt("0"),t.nanos=e.nanos??0,t}};function XG(e){return BigInt(e.toString())}o(XG,"longToBigint");Hs.default.util.Long!==fi&&(Hs.default.util.Long=fi,Hs.default.configure());function JE(e){return e!=null}o(JE,"isSet");var je=xr(Js(),1);var df=xr(Js(),1);df.default.util.Long!==fi&&(df.default.util.Long=fi,df.default.configure());var zE;(function(e){e[e.FREE=0]="FREE",e[e.DEV=1]="DEV",e[e.PRO=2]="PRO",e[e.ENTERPRISE=3]="ENTERPRISE",e[e.ANONYMOUS=16]="ANONYMOUS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(zE||(zE={}));var WE;(function(e){e[e.ORG_MEMBER=0]="ORG_MEMBER",e[e.ORG_ADMIN=1]="ORG_ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(WE||(WE={}));var HE;(function(e){e[e.AND=0]="AND",e[e.OR=1]="OR",e[e.THEN=2]="THEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(HE||(HE={}));var XE;(function(e){e[e.READ=0]="READ",e[e.WRITE=1]="WRITE",e[e.ADMIN=2]="ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(XE||(XE={}));var ZE;(function(e){e[e.CREDIT_CARD=0]="CREDIT_CARD",e[e.INVOICE_FIAT=1]="INVOICE_FIAT",e[e.INVOICE_CRYPTO=2]="INVOICE_CRYPTO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ZE||(ZE={}));var KE;(function(e){e[e.GENERAL=0]="GENERAL",e[e.PROCESSOR_UPLOAD_FAILED=101]="PROCESSOR_UPLOAD_FAILED",e[e.PROCESSOR_UPLOAD_SUCCESS=102]="PROCESSOR_UPLOAD_SUCCESS",e[e.PROCESSOR_OBSOLETED=103]="PROCESSOR_OBSOLETED",e[e.PROCESSOR_STOPPED=104]="PROCESSOR_STOPPED",e[e.PROCESSOR_ACTIVATED=105]="PROCESSOR_ACTIVATED",e[e.PROCESSOR_GENERAL=106]="PROCESSOR_GENERAL",e[e.PROCESSOR_ERROR=107]="PROCESSOR_ERROR",e[e.EXPORT_TASK_FAILED=201]="EXPORT_TASK_FAILED",e[e.EXPORT_TASK_SUCCESS=202]="EXPORT_TASK_SUCCESS",e[e.BILLING_INVOICE=301]="BILLING_INVOICE",e[e.BILLING_PAYMENT=302]="BILLING_PAYMENT",e[e.BILLING_SUBSCRIPTION=303]="BILLING_SUBSCRIPTION",e[e.BILLING_USAGE=304]="BILLING_USAGE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(KE||(KE={}));var $E;(function(e){e[e.MIN=0]="MIN",e[e.SUM=1]="SUM",e[e.MAX=2]="MAX",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($E||($E={}));var YE;(function(e){e[e.PENDING=0]="PENDING",e[e.SET_USERNAME=1]="SET_USERNAME",e[e.BANNED=9]="BANNED",e[e.ACTIVE=10]="ACTIVE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(YE||(YE={}));var jE;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(jE||(jE={}));var eT;(function(e){e[e.SENTIO=0]="SENTIO",e[e.SUBGRAPH=1]="SUBGRAPH",e[e.ACTION=2]="ACTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(eT||(eT={}));var tT;(function(e){e[e.AVG=0]="AVG",e[e.SUM=1]="SUM",e[e.MIN=2]="MIN",e[e.MAX=3]="MAX",e[e.COUNT=4]="COUNT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(tT||(tT={}));var rT;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.EXISTS=9]="EXISTS",e[e.NOT_EXISTS=10]="NOT_EXISTS",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.CONTAINS=11]="CONTAINS",e[e.NOT_CONTAINS=12]="NOT_CONTAINS",e[e.IN=15]="IN",e[e.NOT_IN=16]="NOT_IN",e[e.IN_COHORTS=13]="IN_COHORTS",e[e.NOT_IN_COHORTS=14]="NOT_IN_COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(rT||(rT={}));var nT;(function(e){e[e.EVENTS=0]="EVENTS",e[e.COHORTS=1]="COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(nT||(nT={}));var iT;(function(e){e[e.SUM=0]="SUM",e[e.CUMULATIVE_SUM=6]="CUMULATIVE_SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.CUMULATIVE_DISTINCT_COUNT=9]="CUMULATIVE_DISTINCT_COUNT",e[e.CUMULATIVE_COUNT=12]="CUMULATIVE_COUNT",e[e.LAST=7]="LAST",e[e.CUMULATIVE_LAST=10]="CUMULATIVE_LAST",e[e.FIRST=8]="FIRST",e[e.CUMULATIVE_FIRST=11]="CUMULATIVE_FIRST",e[e.PERCENTILE_25TH=20]="PERCENTILE_25TH",e[e.PERCENTILE_75TH=21]="PERCENTILE_75TH",e[e.PERCENTILE_90TH=22]="PERCENTILE_90TH",e[e.PERCENTILE_95TH=23]="PERCENTILE_95TH",e[e.PERCENTILE_99TH=24]="PERCENTILE_99TH",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(iT||(iT={}));var aT;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(aT||(aT={}));var oT;(function(e){e[e.SUM=0]="SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.LAST=6]="LAST",e[e.FIRST=7]="FIRST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(oT||(oT={}));var sT;(function(e){e[e.PROCESSOR=0]="PROCESSOR",e[e.UI=1]="UI",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(sT||(sT={}));var dT;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.EMAIL=1]="EMAIL",e[e.SLACK=2]="SLACK",e[e.TELEGRAM=3]="TELEGRAM",e[e.WEBHOOK=4]="WEBHOOK",e[e.DISCORD=5]="DISCORD",e[e.PAGERDUTY=6]="PAGERDUTY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(dT||(dT={}));var uT;(function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.LIST=3]="LIST",e[e.TIME=4]="TIME",e[e.MAP=5]="MAP",e[e.JSON=6]="JSON",e[e.TOKEN=7]="TOKEN",e[e.DYNAMIC=8]="DYNAMIC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(uT||(uT={}));var cT;(function(e){e[e.OnOrAfter=0]="OnOrAfter",e[e.On=1]="On",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(cT||(cT={}));var pT;(function(e){e[e.Disable=0]="Disable",e[e.FirstInTimeRange=1]="FirstInTimeRange",e[e.FirstInGlobal=2]="FirstInGlobal",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(pT||(pT={}));var lT;(function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(lT||(lT={}));var mt;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(mt||(mt={}));function ZG(e){switch(e){case 0:case"NULL_VALUE":return mt.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return mt.UNRECOGNIZED}}o(ZG,"richValue_NullValueFromJSON");function KG(e){switch(e){case mt.NULL_VALUE:return"NULL_VALUE";case mt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(KG,"richValue_NullValueToJSON");function fT(){return{symbol:void 0,address:void 0}}o(fT,"createBaseCoinID");var Nn={encode(e,t=je.default.Writer.create()){return e.symbol!==void 0&&t.uint32(10).string(e.symbol),e.address!==void 0&&iu.encode(e.address,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=fT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.symbol=r.string();continue;case 2:if(a!==18)break;i.address=iu.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{symbol:It(e.symbol)?globalThis.String(e.symbol):void 0,address:It(e.address)?iu.fromJSON(e.address):void 0}},toJSON(e){let t={};return e.symbol!==void 0&&(t.symbol=e.symbol),e.address!==void 0&&(t.address=iu.toJSON(e.address)),t},create(e){return Nn.fromPartial(e??{})},fromPartial(e){let t=fT();return t.symbol=e.symbol??void 0,t.address=e.address!==void 0&&e.address!==null?iu.fromPartial(e.address):void 0,t}};function mT(){return{address:"",chain:""}}o(mT,"createBaseCoinID_AddressIdentifier");var iu={encode(e,t=je.default.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.chain!==""&&t.uint32(18).string(e.chain),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=mT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=r.string();continue;case 2:if(a!==18)break;i.chain=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{address:It(e.address)?globalThis.String(e.address):"",chain:It(e.chain)?globalThis.String(e.chain):""}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.chain!==""&&(t.chain=e.chain),t},create(e){return iu.fromPartial(e??{})},fromPartial(e){let t=mT();return t.address=e.address??"",t.chain=e.chain??"",t}};function hT(){return{nullValue:void 0,intValue:void 0,int64Value:void 0,floatValue:void 0,bytesValue:void 0,boolValue:void 0,stringValue:void 0,timestampValue:void 0,bigintValue:void 0,bigdecimalValue:void 0,listValue:void 0,structValue:void 0,tokenValue:void 0}}o(hT,"createBaseRichValue");var zt={encode(e,t=je.default.Writer.create()){if(e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.intValue!==void 0&&t.uint32(16).int32(e.intValue),e.int64Value!==void 0){if(BigInt.asIntN(64,e.int64Value)!==e.int64Value)throw new globalThis.Error("value provided for field message.int64Value of type int64 too large");t.uint32(104).int64(e.int64Value.toString())}return e.floatValue!==void 0&&t.uint32(25).double(e.floatValue),e.bytesValue!==void 0&&t.uint32(34).bytes(e.bytesValue),e.boolValue!==void 0&&t.uint32(40).bool(e.boolValue),e.stringValue!==void 0&&t.uint32(50).string(e.stringValue),e.timestampValue!==void 0&&Ze.encode(TT(e.timestampValue),t.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&Kr.encode(e.bigintValue,t.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&mi.encode(e.bigdecimalValue,t.uint32(74).fork()).ldelim(),e.listValue!==void 0&&Kn.encode(e.listValue,t.uint32(82).fork()).ldelim(),e.structValue!==void 0&&et.encode(e.structValue,t.uint32(90).fork()).ldelim(),e.tokenValue!==void 0&&uo.encode(e.tokenValue,t.uint32(98).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=hT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=r.int32();continue;case 2:if(a!==16)break;i.intValue=r.int32();continue;case 13:if(a!==104)break;i.int64Value=$G(r.int64());continue;case 3:if(a!==25)break;i.floatValue=r.double();continue;case 4:if(a!==34)break;i.bytesValue=r.bytes();continue;case 5:if(a!==40)break;i.boolValue=r.bool();continue;case 6:if(a!==50)break;i.stringValue=r.string();continue;case 7:if(a!==58)break;i.timestampValue=v6(Ze.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.bigintValue=Kr.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.bigdecimalValue=mi.decode(r,r.uint32());continue;case 10:if(a!==82)break;i.listValue=Kn.decode(r,r.uint32());continue;case 11:if(a!==90)break;i.structValue=et.decode(r,r.uint32());continue;case 12:if(a!==98)break;i.tokenValue=uo.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{nullValue:It(e.nullValue)?ZG(e.nullValue):void 0,intValue:It(e.intValue)?globalThis.Number(e.intValue):void 0,int64Value:It(e.int64Value)?BigInt(e.int64Value):void 0,floatValue:It(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:It(e.bytesValue)?IT(e.bytesValue):void 0,boolValue:It(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:It(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:It(e.timestampValue)?NT(e.timestampValue):void 0,bigintValue:It(e.bigintValue)?Kr.fromJSON(e.bigintValue):void 0,bigdecimalValue:It(e.bigdecimalValue)?mi.fromJSON(e.bigdecimalValue):void 0,listValue:It(e.listValue)?Kn.fromJSON(e.listValue):void 0,structValue:It(e.structValue)?et.fromJSON(e.structValue):void 0,tokenValue:It(e.tokenValue)?uo.fromJSON(e.tokenValue):void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=KG(e.nullValue)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.int64Value!==void 0&&(t.int64Value=e.int64Value.toString()),e.floatValue!==void 0&&(t.floatValue=e.floatValue),e.bytesValue!==void 0&&(t.bytesValue=ET(e.bytesValue)),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.timestampValue!==void 0&&(t.timestampValue=e.timestampValue.toISOString()),e.bigintValue!==void 0&&(t.bigintValue=Kr.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(t.bigdecimalValue=mi.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(t.listValue=Kn.toJSON(e.listValue)),e.structValue!==void 0&&(t.structValue=et.toJSON(e.structValue)),e.tokenValue!==void 0&&(t.tokenValue=uo.toJSON(e.tokenValue)),t},create(e){return zt.fromPartial(e??{})},fromPartial(e){let t=hT();return t.nullValue=e.nullValue??void 0,t.intValue=e.intValue??void 0,t.int64Value=e.int64Value??void 0,t.floatValue=e.floatValue??void 0,t.bytesValue=e.bytesValue??void 0,t.boolValue=e.boolValue??void 0,t.stringValue=e.stringValue??void 0,t.timestampValue=e.timestampValue??void 0,t.bigintValue=e.bigintValue!==void 0&&e.bigintValue!==null?Kr.fromPartial(e.bigintValue):void 0,t.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?mi.fromPartial(e.bigdecimalValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?Kn.fromPartial(e.listValue):void 0,t.structValue=e.structValue!==void 0&&e.structValue!==null?et.fromPartial(e.structValue):void 0,t.tokenValue=e.tokenValue!==void 0&&e.tokenValue!==null?uo.fromPartial(e.tokenValue):void 0,t}};function gT(){return{fields:{}}}o(gT,"createBaseRichStruct");var et={encode(e,t=je.default.Writer.create()){return Object.entries(e.fields).forEach(([r,n])=>{w6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=gT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=w6.decode(r,r.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:YG(e.fields)?Object.entries(e.fields).reduce((t,[r,n])=>(t[r]=zt.fromJSON(n),t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([n,i])=>{t.fields[n]=zt.toJSON(i)}))}return t},create(e){return et.fromPartial(e??{})},fromPartial(e){let t=gT();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=zt.fromPartial(i)),r),{}),t}};function _T(){return{key:"",value:void 0}}o(_T,"createBaseRichStruct_FieldsEntry");var w6={encode(e,t=je.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&zt.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_T();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=zt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:It(e.key)?globalThis.String(e.key):"",value:It(e.value)?zt.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=zt.toJSON(e.value)),t},create(e){return w6.fromPartial(e??{})},fromPartial(e){let t=_T();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?zt.fromPartial(e.value):void 0,t}};function AT(){return{values:[]}}o(AT,"createBaseRichValueList");var Kn={encode(e,t=je.default.Writer.create()){for(let r of e.values)zt.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=AT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(zt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(t=>zt.fromJSON(t)):[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values.map(r=>zt.toJSON(r))),t},create(e){return Kn.fromPartial(e??{})},fromPartial(e){let t=AT();return t.values=e.values?.map(r=>zt.fromPartial(r))||[],t}};function yT(){return{entities:[]}}o(yT,"createBaseRichStructList");var qo={encode(e,t=je.default.Writer.create()){for(let r of e.entities)et.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=yT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(et.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>et.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(r=>et.toJSON(r))),t},create(e){return qo.fromPartial(e??{})},fromPartial(e){let t=yT();return t.entities=e.entities?.map(r=>et.fromPartial(r))||[],t}};function wT(){return{value:void 0,exp:0}}o(wT,"createBaseBigDecimal");var mi={encode(e,t=je.default.Writer.create()){return e.value!==void 0&&Kr.encode(e.value,t.uint32(10).fork()).ldelim(),e.exp!==0&&t.uint32(16).int32(e.exp),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=wT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=Kr.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.exp=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{value:It(e.value)?Kr.fromJSON(e.value):void 0,exp:It(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=Kr.toJSON(e.value)),e.exp!==0&&(t.exp=Math.round(e.exp)),t},create(e){return mi.fromPartial(e??{})},fromPartial(e){let t=wT();return t.value=e.value!==void 0&&e.value!==null?Kr.fromPartial(e.value):void 0,t.exp=e.exp??0,t}};function vT(){return{negative:!1,data:new Uint8Array(0)}}o(vT,"createBaseBigInteger");var Kr={encode(e,t=je.default.Writer.create()){return e.negative!==!1&&t.uint32(8).bool(e.negative),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=vT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.negative=r.bool();continue;case 2:if(a!==18)break;i.data=r.bytes();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{negative:It(e.negative)?globalThis.Boolean(e.negative):!1,data:It(e.data)?IT(e.data):new Uint8Array(0)}},toJSON(e){let t={};return e.negative!==!1&&(t.negative=e.negative),e.data.length!==0&&(t.data=ET(e.data)),t},create(e){return Kr.fromPartial(e??{})},fromPartial(e){let t=vT();return t.negative=e.negative??!1,t.data=e.data??new Uint8Array(0),t}};function bT(){return{token:void 0,amount:void 0,specifiedAt:void 0}}o(bT,"createBaseTokenAmount");var uo={encode(e,t=je.default.Writer.create()){return e.token!==void 0&&Nn.encode(e.token,t.uint32(10).fork()).ldelim(),e.amount!==void 0&&mi.encode(e.amount,t.uint32(18).fork()).ldelim(),e.specifiedAt!==void 0&&Ze.encode(TT(e.specifiedAt),t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof je.default.Reader?e:je.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=bT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.token=Nn.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.amount=mi.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.specifiedAt=v6(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{token:It(e.token)?Nn.fromJSON(e.token):void 0,amount:It(e.amount)?mi.fromJSON(e.amount):void 0,specifiedAt:It(e.specifiedAt)?NT(e.specifiedAt):void 0}},toJSON(e){let t={};return e.token!==void 0&&(t.token=Nn.toJSON(e.token)),e.amount!==void 0&&(t.amount=mi.toJSON(e.amount)),e.specifiedAt!==void 0&&(t.specifiedAt=e.specifiedAt.toISOString()),t},create(e){return uo.fromPartial(e??{})},fromPartial(e){let t=bT();return t.token=e.token!==void 0&&e.token!==null?Nn.fromPartial(e.token):void 0,t.amount=e.amount!==void 0&&e.amount!==null?mi.fromPartial(e.amount):void 0,t.specifiedAt=e.specifiedAt??void 0,t}};function IT(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let t=globalThis.atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}}o(IT,"bytesFromBase64");function ET(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let t=[];return e.forEach(r=>{t.push(globalThis.String.fromCharCode(r))}),globalThis.btoa(t.join(""))}}o(ET,"base64FromBytes");function TT(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}o(TT,"toTimestamp");function v6(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}o(v6,"fromTimestamp");function NT(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):v6(Ze.fromJSON(e))}o(NT,"fromJsonTimestamp");function $G(e){return BigInt(e.toString())}o($G,"longToBigint");je.default.util.Long!==fi&&(je.default.util.Long=fi,je.default.configure());function YG(e){return typeof e=="object"&&e!==null}o(YG,"isObject");function It(e){return e!=null}o(It,"isSet");var Wt;(function(e){e[e.UNKNOWN_TYPE=0]="UNKNOWN_TYPE",e[e.COUNTER=1]="COUNTER",e[e.GAUGE=2]="GAUGE",e[e.HISTOGRAM=3]="HISTOGRAM",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Wt||(Wt={}));function jG(e){switch(e){case 0:case"UNKNOWN_TYPE":return Wt.UNKNOWN_TYPE;case 1:case"COUNTER":return Wt.COUNTER;case 2:case"GAUGE":return Wt.GAUGE;case 3:case"HISTOGRAM":return Wt.HISTOGRAM;case-1:case"UNRECOGNIZED":default:return Wt.UNRECOGNIZED}}o(jG,"metricTypeFromJSON");function eq(e){switch(e){case Wt.UNKNOWN_TYPE:return"UNKNOWN_TYPE";case Wt.COUNTER:return"COUNTER";case Wt.GAUGE:return"GAUGE";case Wt.HISTOGRAM:return"HISTOGRAM";case Wt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(eq,"metricTypeToJSON");var Lr;(function(e){e[e.COUNT=0]="COUNT",e[e.SUM=1]="SUM",e[e.AVG=2]="AVG",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.LAST=5]="LAST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Lr||(Lr={}));function tq(e){switch(e){case 0:case"COUNT":return Lr.COUNT;case 1:case"SUM":return Lr.SUM;case 2:case"AVG":return Lr.AVG;case 3:case"MIN":return Lr.MIN;case 4:case"MAX":return Lr.MAX;case 5:case"LAST":return Lr.LAST;case-1:case"UNRECOGNIZED":default:return Lr.UNRECOGNIZED}}o(tq,"aggregationTypeFromJSON");function rq(e){switch(e){case Lr.COUNT:return"COUNT";case Lr.SUM:return"SUM";case Lr.AVG:return"AVG";case Lr.MIN:return"MIN";case Lr.MAX:return"MAX";case Lr.LAST:return"LAST";case Lr.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(rq,"aggregationTypeToJSON");var hi;(function(e){e[e.ADDRESS=0]="ADDRESS",e[e.OBJECT=1]="OBJECT",e[e.WRAPPED_OBJECT=2]="WRAPPED_OBJECT",e[e.TYPE=3]="TYPE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(hi||(hi={}));function nq(e){switch(e){case 0:case"ADDRESS":return hi.ADDRESS;case 1:case"OBJECT":return hi.OBJECT;case 2:case"WRAPPED_OBJECT":return hi.WRAPPED_OBJECT;case 3:case"TYPE":return hi.TYPE;case-1:case"UNRECOGNIZED":default:return hi.UNRECOGNIZED}}o(nq,"moveOwnerTypeFromJSON");function iq(e){switch(e){case hi.ADDRESS:return"ADDRESS";case hi.OBJECT:return"OBJECT";case hi.WRAPPED_OBJECT:return"WRAPPED_OBJECT";case hi.TYPE:return"TYPE";case hi.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(iq,"moveOwnerTypeToJSON");var Ea;(function(e){e[e.ERC20=0]="ERC20",e[e.ERC721=1]="ERC721",e[e.ERC1155=2]="ERC1155",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ea||(Ea={}));function aq(e){switch(e){case 0:case"ERC20":return Ea.ERC20;case 1:case"ERC721":return Ea.ERC721;case 2:case"ERC1155":return Ea.ERC1155;case-1:case"UNRECOGNIZED":default:return Ea.UNRECOGNIZED}}o(aq,"addressTypeFromJSON");function oq(e){switch(e){case Ea.ERC20:return"ERC20";case Ea.ERC721:return"ERC721";case Ea.ERC1155:return"ERC1155";case Ea.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(oq,"addressTypeToJSON");var Me;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.ETH_LOG=1]="ETH_LOG",e[e.ETH_BLOCK=2]="ETH_BLOCK",e[e.ETH_TRACE=5]="ETH_TRACE",e[e.ETH_TRANSACTION=11]="ETH_TRANSACTION",e[e.SOL_INSTRUCTION=4]="SOL_INSTRUCTION",e[e.APT_EVENT=6]="APT_EVENT",e[e.APT_CALL=7]="APT_CALL",e[e.APT_RESOURCE=8]="APT_RESOURCE",e[e.SUI_EVENT=3]="SUI_EVENT",e[e.SUI_CALL=9]="SUI_CALL",e[e.SUI_OBJECT=10]="SUI_OBJECT",e[e.SUI_OBJECT_CHANGE=12]="SUI_OBJECT_CHANGE",e[e.FUEL_CALL=13]="FUEL_CALL",e[e.FUEL_RECEIPT=19]="FUEL_RECEIPT",e[e.FUEL_TRANSACTION=20]="FUEL_TRANSACTION",e[e.FUEL_BLOCK=17]="FUEL_BLOCK",e[e.COSMOS_CALL=14]="COSMOS_CALL",e[e.STARKNET_EVENT=15]="STARKNET_EVENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Me||(Me={}));function PS(e){switch(e){case 0:case"UNKNOWN":return Me.UNKNOWN;case 1:case"ETH_LOG":return Me.ETH_LOG;case 2:case"ETH_BLOCK":return Me.ETH_BLOCK;case 5:case"ETH_TRACE":return Me.ETH_TRACE;case 11:case"ETH_TRANSACTION":return Me.ETH_TRANSACTION;case 4:case"SOL_INSTRUCTION":return Me.SOL_INSTRUCTION;case 6:case"APT_EVENT":return Me.APT_EVENT;case 7:case"APT_CALL":return Me.APT_CALL;case 8:case"APT_RESOURCE":return Me.APT_RESOURCE;case 3:case"SUI_EVENT":return Me.SUI_EVENT;case 9:case"SUI_CALL":return Me.SUI_CALL;case 10:case"SUI_OBJECT":return Me.SUI_OBJECT;case 12:case"SUI_OBJECT_CHANGE":return Me.SUI_OBJECT_CHANGE;case 13:case"FUEL_CALL":return Me.FUEL_CALL;case 19:case"FUEL_RECEIPT":return Me.FUEL_RECEIPT;case 20:case"FUEL_TRANSACTION":return Me.FUEL_TRANSACTION;case 17:case"FUEL_BLOCK":return Me.FUEL_BLOCK;case 14:case"COSMOS_CALL":return Me.COSMOS_CALL;case 15:case"STARKNET_EVENT":return Me.STARKNET_EVENT;case-1:case"UNRECOGNIZED":default:return Me.UNRECOGNIZED}}o(PS,"handlerTypeFromJSON");function LS(e){switch(e){case Me.UNKNOWN:return"UNKNOWN";case Me.ETH_LOG:return"ETH_LOG";case Me.ETH_BLOCK:return"ETH_BLOCK";case Me.ETH_TRACE:return"ETH_TRACE";case Me.ETH_TRANSACTION:return"ETH_TRANSACTION";case Me.SOL_INSTRUCTION:return"SOL_INSTRUCTION";case Me.APT_EVENT:return"APT_EVENT";case Me.APT_CALL:return"APT_CALL";case Me.APT_RESOURCE:return"APT_RESOURCE";case Me.SUI_EVENT:return"SUI_EVENT";case Me.SUI_CALL:return"SUI_CALL";case Me.SUI_OBJECT:return"SUI_OBJECT";case Me.SUI_OBJECT_CHANGE:return"SUI_OBJECT_CHANGE";case Me.FUEL_CALL:return"FUEL_CALL";case Me.FUEL_RECEIPT:return"FUEL_RECEIPT";case Me.FUEL_TRANSACTION:return"FUEL_TRANSACTION";case Me.FUEL_BLOCK:return"FUEL_BLOCK";case Me.COSMOS_CALL:return"COSMOS_CALL";case Me.STARKNET_EVENT:return"STARKNET_EVENT";case Me.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(LS,"handlerTypeToJSON");var dn;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.CRITICAL=4]="CRITICAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(dn||(dn={}));function sq(e){switch(e){case 0:case"DEBUG":return dn.DEBUG;case 1:case"INFO":return dn.INFO;case 2:case"WARNING":return dn.WARNING;case 3:case"ERROR":return dn.ERROR;case 4:case"CRITICAL":return dn.CRITICAL;case-1:case"UNRECOGNIZED":default:return dn.UNRECOGNIZED}}o(sq,"logLevelFromJSON");function dq(e){switch(e){case dn.DEBUG:return"DEBUG";case dn.INFO:return"INFO";case dn.WARNING:return"WARNING";case dn.ERROR:return"ERROR";case dn.CRITICAL:return"CRITICAL";case dn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(dq,"logLevelToJSON");var zo;(function(e){e[e.BY_LOG_INDEX=0]="BY_LOG_INDEX",e[e.BY_PROCESSOR_AND_LOG_INDEX=1]="BY_PROCESSOR_AND_LOG_INDEX",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(zo||(zo={}));function uq(e){switch(e){case 0:case"BY_LOG_INDEX":return zo.BY_LOG_INDEX;case 1:case"BY_PROCESSOR_AND_LOG_INDEX":return zo.BY_PROCESSOR_AND_LOG_INDEX;case-1:case"UNRECOGNIZED":default:return zo.UNRECOGNIZED}}o(uq,"executionConfig_HandlerOrderInsideTransactionFromJSON");function cq(e){switch(e){case zo.BY_LOG_INDEX:return"BY_LOG_INDEX";case zo.BY_PROCESSOR_AND_LOG_INDEX:return"BY_PROCESSOR_AND_LOG_INDEX";case zo.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(cq,"executionConfig_HandlerOrderInsideTransactionToJSON");var Wo;(function(e){e[e.AVG=0]="AVG",e[e.MEDIAN=1]="MEDIAN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Wo||(Wo={}));function K1e(e){switch(e){case 0:case"AVG":return Wo.AVG;case 1:case"MEDIAN":return Wo.MEDIAN;case-1:case"UNRECOGNIZED":default:return Wo.UNRECOGNIZED}}o(K1e,"totalPerEntityAggregation_TypeFromJSON");function $1e(e){switch(e){case Wo.AVG:return"AVG";case Wo.MEDIAN:return"MEDIAN";case Wo.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o($1e,"totalPerEntityAggregation_TypeToJSON");var $r;(function(e){e[e.STRING=0]="STRING",e[e.DOUBLE=1]="DOUBLE",e[e.BOOL=2]="BOOL",e[e.TIMESTAMP=3]="TIMESTAMP",e[e.BIG_INTEGER=4]="BIG_INTEGER",e[e.BIG_DECIMAL=5]="BIG_DECIMAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($r||($r={}));function pq(e){switch(e){case 0:case"STRING":return $r.STRING;case 1:case"DOUBLE":return $r.DOUBLE;case 2:case"BOOL":return $r.BOOL;case 3:case"TIMESTAMP":return $r.TIMESTAMP;case 4:case"BIG_INTEGER":return $r.BIG_INTEGER;case 5:case"BIG_DECIMAL":return $r.BIG_DECIMAL;case-1:case"UNRECOGNIZED":default:return $r.UNRECOGNIZED}}o(pq,"eventLogConfig_BasicFieldTypeFromJSON");function lq(e){switch(e){case $r.STRING:return"STRING";case $r.DOUBLE:return"DOUBLE";case $r.BOOL:return"BOOL";case $r.TIMESTAMP:return"TIMESTAMP";case $r.BIG_INTEGER:return"BIG_INTEGER";case $r.BIG_DECIMAL:return"BIG_DECIMAL";case $r.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(lq,"eventLogConfig_BasicFieldTypeToJSON");var gi;(function(e){e[e.BLOCK_NUMBER=0]="BLOCK_NUMBER",e[e.SEQ_MODE=1]="SEQ_MODE",e[e.UNIQUE_VALUE=2]="UNIQUE_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(gi||(gi={}));function fq(e){switch(e){case 0:case"BLOCK_NUMBER":return gi.BLOCK_NUMBER;case 1:case"SEQ_MODE":return gi.SEQ_MODE;case 2:case"UNIQUE_VALUE":return gi.UNIQUE_VALUE;case-1:case"UNRECOGNIZED":default:return gi.UNRECOGNIZED}}o(fq,"processStreamResponse_Partitions_Partition_SysValueFromJSON");function mq(e){switch(e){case gi.BLOCK_NUMBER:return"BLOCK_NUMBER";case gi.SEQ_MODE:return"SEQ_MODE";case gi.UNIQUE_VALUE:return"UNIQUE_VALUE";case gi.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(mq,"processStreamResponse_Partitions_Partition_SysValueToJSON");var Pn;(function(e){e[e.SET=0]="SET",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Pn||(Pn={}));function hq(e){switch(e){case 0:case"SET":return Pn.SET;case 1:case"ADD":return Pn.ADD;case 2:case"MULTIPLY":return Pn.MULTIPLY;case-1:case"UNRECOGNIZED":default:return Pn.UNRECOGNIZED}}o(hq,"entityUpdateData_OperatorFromJSON");function gq(e){switch(e){case Pn.SET:return"SET";case Pn.ADD:return"ADD";case Pn.MULTIPLY:return"MULTIPLY";case Pn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(gq,"entityUpdateData_OperatorToJSON");var Ue;(function(e){e[e.EQ=0]="EQ",e[e.NE=1]="NE",e[e.GT=2]="GT",e[e.GE=3]="GE",e[e.LT=4]="LT",e[e.LE=5]="LE",e[e.IN=6]="IN",e[e.NOT_IN=7]="NOT_IN",e[e.LIKE=8]="LIKE",e[e.NOT_LIKE=9]="NOT_LIKE",e[e.HAS_ALL=10]="HAS_ALL",e[e.HAS_ANY=11]="HAS_ANY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ue||(Ue={}));function _q(e){switch(e){case 0:case"EQ":return Ue.EQ;case 1:case"NE":return Ue.NE;case 2:case"GT":return Ue.GT;case 3:case"GE":return Ue.GE;case 4:case"LT":return Ue.LT;case 5:case"LE":return Ue.LE;case 6:case"IN":return Ue.IN;case 7:case"NOT_IN":return Ue.NOT_IN;case 8:case"LIKE":return Ue.LIKE;case 9:case"NOT_LIKE":return Ue.NOT_LIKE;case 10:case"HAS_ALL":return Ue.HAS_ALL;case 11:case"HAS_ANY":return Ue.HAS_ANY;case-1:case"UNRECOGNIZED":default:return Ue.UNRECOGNIZED}}o(_q,"dBRequest_DBOperatorFromJSON");function Aq(e){switch(e){case Ue.EQ:return"EQ";case Ue.NE:return"NE";case Ue.GT:return"GT";case Ue.GE:return"GE";case Ue.LT:return"LT";case Ue.LE:return"LE";case Ue.IN:return"IN";case Ue.NOT_IN:return"NOT_IN";case Ue.LIKE:return"LIKE";case Ue.NOT_LIKE:return"NOT_LIKE";case Ue.HAS_ALL:return"HAS_ALL";case Ue.HAS_ANY:return"HAS_ANY";case Ue.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(Aq,"dBRequest_DBOperatorToJSON");var Sn;(function(e){e[e.EVENT=0]="EVENT",e[e.GAUGE=1]="GAUGE",e[e.COUNTER=2]="COUNTER",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Sn||(Sn={}));function yq(e){switch(e){case 0:case"EVENT":return Sn.EVENT;case 1:case"GAUGE":return Sn.GAUGE;case 2:case"COUNTER":return Sn.COUNTER;case-1:case"UNRECOGNIZED":default:return Sn.UNRECOGNIZED}}o(yq,"timeseriesResult_TimeseriesTypeFromJSON");function wq(e){switch(e){case Sn.EVENT:return"EVENT";case Sn.GAUGE:return"GAUGE";case Sn.COUNTER:return"COUNTER";case Sn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}o(wq,"timeseriesResult_TimeseriesTypeToJSON");function ST(){return{name:"",version:""}}o(ST,"createBaseProjectConfig");var Ui={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.version!==""&&t.uint32(26).string(e.version),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ST();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 3:if(a!==26)break;i.version=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",version:S(e.version)?globalThis.String(e.version):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.version!==""&&(t.version=e.version),t},create(e){return Ui.fromPartial(e??{})},fromPartial(e){let t=ST();return t.name=e.name??"",t.version=e.version??"",t}};function CT(){return{sequential:!1,forceExactBlockTime:!1,handlerOrderInsideTransaction:0,processBindingTimeout:0,skipStartBlockValidation:!1,rpcRetryTimes:0,ethAbiDecoderConfig:void 0}}o(CT,"createBaseExecutionConfig");var Qi={encode(e,t=b.default.Writer.create()){return e.sequential!==!1&&t.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&t.uint32(16).bool(e.forceExactBlockTime),e.handlerOrderInsideTransaction!==0&&t.uint32(56).int32(e.handlerOrderInsideTransaction),e.processBindingTimeout!==0&&t.uint32(24).int32(e.processBindingTimeout),e.skipStartBlockValidation!==!1&&t.uint32(32).bool(e.skipStartBlockValidation),e.rpcRetryTimes!==0&&t.uint32(40).int32(e.rpcRetryTimes),e.ethAbiDecoderConfig!==void 0&&au.encode(e.ethAbiDecoderConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=CT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.sequential=r.bool();continue;case 2:if(a!==16)break;i.forceExactBlockTime=r.bool();continue;case 7:if(a!==56)break;i.handlerOrderInsideTransaction=r.int32();continue;case 3:if(a!==24)break;i.processBindingTimeout=r.int32();continue;case 4:if(a!==32)break;i.skipStartBlockValidation=r.bool();continue;case 5:if(a!==40)break;i.rpcRetryTimes=r.int32();continue;case 6:if(a!==50)break;i.ethAbiDecoderConfig=au.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{sequential:S(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:S(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,handlerOrderInsideTransaction:S(e.handlerOrderInsideTransaction)?uq(e.handlerOrderInsideTransaction):0,processBindingTimeout:S(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0,skipStartBlockValidation:S(e.skipStartBlockValidation)?globalThis.Boolean(e.skipStartBlockValidation):!1,rpcRetryTimes:S(e.rpcRetryTimes)?globalThis.Number(e.rpcRetryTimes):0,ethAbiDecoderConfig:S(e.ethAbiDecoderConfig)?au.fromJSON(e.ethAbiDecoderConfig):void 0}},toJSON(e){let t={};return e.sequential!==!1&&(t.sequential=e.sequential),e.forceExactBlockTime!==!1&&(t.forceExactBlockTime=e.forceExactBlockTime),e.handlerOrderInsideTransaction!==0&&(t.handlerOrderInsideTransaction=cq(e.handlerOrderInsideTransaction)),e.processBindingTimeout!==0&&(t.processBindingTimeout=Math.round(e.processBindingTimeout)),e.skipStartBlockValidation!==!1&&(t.skipStartBlockValidation=e.skipStartBlockValidation),e.rpcRetryTimes!==0&&(t.rpcRetryTimes=Math.round(e.rpcRetryTimes)),e.ethAbiDecoderConfig!==void 0&&(t.ethAbiDecoderConfig=au.toJSON(e.ethAbiDecoderConfig)),t},create(e){return Qi.fromPartial(e??{})},fromPartial(e){let t=CT();return t.sequential=e.sequential??!1,t.forceExactBlockTime=e.forceExactBlockTime??!1,t.handlerOrderInsideTransaction=e.handlerOrderInsideTransaction??0,t.processBindingTimeout=e.processBindingTimeout??0,t.skipStartBlockValidation=e.skipStartBlockValidation??!1,t.rpcRetryTimes=e.rpcRetryTimes??0,t.ethAbiDecoderConfig=e.ethAbiDecoderConfig!==void 0&&e.ethAbiDecoderConfig!==null?au.fromPartial(e.ethAbiDecoderConfig):void 0,t}};function OT(){return{enabled:!1,workerCount:void 0,skipWhenDecodeFailed:void 0}}o(OT,"createBaseExecutionConfig_DecoderWorkerConfig");var au={encode(e,t=b.default.Writer.create()){return e.enabled!==!1&&t.uint32(8).bool(e.enabled),e.workerCount!==void 0&&t.uint32(16).int32(e.workerCount),e.skipWhenDecodeFailed!==void 0&&t.uint32(24).bool(e.skipWhenDecodeFailed),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=OT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.enabled=r.bool();continue;case 2:if(a!==16)break;i.workerCount=r.int32();continue;case 3:if(a!==24)break;i.skipWhenDecodeFailed=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{enabled:S(e.enabled)?globalThis.Boolean(e.enabled):!1,workerCount:S(e.workerCount)?globalThis.Number(e.workerCount):void 0,skipWhenDecodeFailed:S(e.skipWhenDecodeFailed)?globalThis.Boolean(e.skipWhenDecodeFailed):void 0}},toJSON(e){let t={};return e.enabled!==!1&&(t.enabled=e.enabled),e.workerCount!==void 0&&(t.workerCount=Math.round(e.workerCount)),e.skipWhenDecodeFailed!==void 0&&(t.skipWhenDecodeFailed=e.skipWhenDecodeFailed),t},create(e){return au.fromPartial(e??{})},fromPartial(e){let t=OT();return t.enabled=e.enabled??!1,t.workerCount=e.workerCount??void 0,t.skipWhenDecodeFailed=e.skipWhenDecodeFailed??void 0,t}};function BT(){return{}}o(BT,"createBaseProcessConfigRequest");var N6={encode(e,t=b.default.Writer.create()){return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=BT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return N6.fromPartial(e??{})},fromPartial(e){return BT()}};function RT(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}o(RT,"createBaseProcessConfigResponse");var S6={encode(e,t=b.default.Writer.create()){e.config!==void 0&&Ui.encode(e.config,t.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&Qi.encode(e.executionConfig,t.uint32(74).fork()).ldelim();for(let r of e.contractConfigs)Gi.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.templateInstances)Xt.encode(r,t.uint32(26).fork()).ldelim();for(let r of e.accountConfigs)Wi.encode(r,t.uint32(34).fork()).ldelim();for(let r of e.metricConfigs)un.encode(r,t.uint32(42).fork()).ldelim();for(let r of e.exportConfigs)Ji.encode(r,t.uint32(58).fork()).ldelim();for(let r of e.eventLogConfigs)Dn.encode(r,t.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&qi.encode(e.dbSchema,t.uint32(82).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=RT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.config=Ui.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.executionConfig=Qi.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.contractConfigs.push(Gi.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.templateInstances.push(Xt.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push(Wi.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.metricConfigs.push(un.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.exportConfigs.push(Ji.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.eventLogConfigs.push(Dn.decode(r,r.uint32()));continue;case 10:if(a!==82)break;i.dbSchema=qi.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{config:S(e.config)?Ui.fromJSON(e.config):void 0,executionConfig:S(e.executionConfig)?Qi.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>Gi.fromJSON(t)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>Xt.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>Wi.fromJSON(t)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>un.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Ji.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>Dn.fromJSON(t)):[],dbSchema:S(e.dbSchema)?qi.fromJSON(e.dbSchema):void 0}},toJSON(e){let t={};return e.config!==void 0&&(t.config=Ui.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=Qi.toJSON(e.executionConfig)),e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(r=>Gi.toJSON(r))),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(r=>Xt.toJSON(r))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(r=>Wi.toJSON(r))),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(r=>un.toJSON(r))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(r=>Ji.toJSON(r))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(r=>Dn.toJSON(r))),e.dbSchema!==void 0&&(t.dbSchema=qi.toJSON(e.dbSchema)),t},create(e){return S6.fromPartial(e??{})},fromPartial(e){let t=RT();return t.config=e.config!==void 0&&e.config!==null?Ui.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?Qi.fromPartial(e.executionConfig):void 0,t.contractConfigs=e.contractConfigs?.map(r=>Gi.fromPartial(r))||[],t.templateInstances=e.templateInstances?.map(r=>Xt.fromPartial(r))||[],t.accountConfigs=e.accountConfigs?.map(r=>Wi.fromPartial(r))||[],t.metricConfigs=e.metricConfigs?.map(r=>un.fromPartial(r))||[],t.exportConfigs=e.exportConfigs?.map(r=>Ji.fromPartial(r))||[],t.eventLogConfigs=e.eventLogConfigs?.map(r=>Dn.fromPartial(r))||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?qi.fromPartial(e.dbSchema):void 0,t}};function xT(){return{contractConfigs:[],accountConfigs:[]}}o(xT,"createBaseConfigureHandlersResponse");var vq={encode(e,t=b.default.Writer.create()){for(let r of e.contractConfigs)Gi.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.accountConfigs)Wi.encode(r,t.uint32(34).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=xT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.contractConfigs.push(Gi.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push(Wi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>Gi.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>Wi.fromJSON(t)):[]}},toJSON(e){let t={};return e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(r=>Gi.toJSON(r))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(r=>Wi.toJSON(r))),t},create(e){return vq.fromPartial(e??{})},fromPartial(e){let t=xT();return t.contractConfigs=e.contractConfigs?.map(r=>Gi.fromPartial(r))||[],t.accountConfigs=e.accountConfigs?.map(r=>Wi.fromPartial(r))||[],t}};function kT(){return{contract:void 0,intervalConfigs:[],moveIntervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelTransactionConfigs:[],assetConfigs:[],fuelReceiptConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}o(kT,"createBaseContractConfig");var Gi={encode(e,t=b.default.Writer.create()){e.contract!==void 0&&Xi.encode(e.contract,t.uint32(10).fork()).ldelim();for(let r of e.intervalConfigs)Ht.encode(r,t.uint32(90).fork()).ldelim();for(let r of e.moveIntervalConfigs)Hi.encode(r,t.uint32(154).fork()).ldelim();for(let r of e.logConfigs)Zi.encode(r,t.uint32(26).fork()).ldelim();for(let r of e.traceConfigs)su.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.transactionConfig)du.encode(r,t.uint32(58).fork()).ldelim();for(let r of e.moveEventConfigs)yu.encode(r,t.uint32(74).fork()).ldelim();for(let r of e.moveCallConfigs)Ki.encode(r,t.uint32(82).fork()).ldelim();for(let r of e.moveResourceChangeConfigs)$i.encode(r,t.uint32(98).fork()).ldelim();for(let r of e.fuelTransactionConfigs)Nu.encode(r,t.uint32(162).fork()).ldelim();for(let r of e.assetConfigs)uu.encode(r,t.uint32(114).fork()).ldelim();for(let r of e.fuelReceiptConfigs)pu.encode(r,t.uint32(170).fork()).ldelim();for(let r of e.cosmosLogConfigs)mu.encode(r,t.uint32(130).fork()).ldelim();for(let r of e.starknetEventConfigs)Iu.encode(r,t.uint32(138).fork()).ldelim();if(e.instructionConfig!==void 0&&gu.encode(e.instructionConfig,t.uint32(50).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(32).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(40).uint64(e.endBlock.toString())}return e.processorType!==""&&t.uint32(66).string(e.processorType),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=kT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=Xi.decode(r,r.uint32());continue;case 11:if(a!==90)break;i.intervalConfigs.push(Ht.decode(r,r.uint32()));continue;case 19:if(a!==154)break;i.moveIntervalConfigs.push(Hi.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.logConfigs.push(Zi.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.traceConfigs.push(su.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.transactionConfig.push(du.decode(r,r.uint32()));continue;case 9:if(a!==74)break;i.moveEventConfigs.push(yu.decode(r,r.uint32()));continue;case 10:if(a!==82)break;i.moveCallConfigs.push(Ki.decode(r,r.uint32()));continue;case 12:if(a!==98)break;i.moveResourceChangeConfigs.push($i.decode(r,r.uint32()));continue;case 20:if(a!==162)break;i.fuelTransactionConfigs.push(Nu.decode(r,r.uint32()));continue;case 14:if(a!==114)break;i.assetConfigs.push(uu.decode(r,r.uint32()));continue;case 21:if(a!==170)break;i.fuelReceiptConfigs.push(pu.decode(r,r.uint32()));continue;case 16:if(a!==130)break;i.cosmosLogConfigs.push(mu.decode(r,r.uint32()));continue;case 17:if(a!==138)break;i.starknetEventConfigs.push(Iu.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.instructionConfig=gu.decode(r,r.uint32());continue;case 4:if(a!==32)break;i.startBlock=Fr(r.uint64());continue;case 5:if(a!==40)break;i.endBlock=Fr(r.uint64());continue;case 8:if(a!==66)break;i.processorType=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{contract:S(e.contract)?Xi.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>Ht.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Hi.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>Zi.fromJSON(t)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(t=>su.fromJSON(t)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(t=>du.fromJSON(t)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(t=>yu.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>Ki.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>$i.fromJSON(t)):[],fuelTransactionConfigs:globalThis.Array.isArray(e?.fuelTransactionConfigs)?e.fuelTransactionConfigs.map(t=>Nu.fromJSON(t)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(t=>uu.fromJSON(t)):[],fuelReceiptConfigs:globalThis.Array.isArray(e?.fuelReceiptConfigs)?e.fuelReceiptConfigs.map(t=>pu.fromJSON(t)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(t=>mu.fromJSON(t)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(t=>Iu.fromJSON(t)):[],instructionConfig:S(e.instructionConfig)?gu.fromJSON(e.instructionConfig):void 0,startBlock:S(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:S(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:S(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=Xi.toJSON(e.contract)),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(r=>Ht.toJSON(r))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(r=>Hi.toJSON(r))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(r=>Zi.toJSON(r))),e.traceConfigs?.length&&(t.traceConfigs=e.traceConfigs.map(r=>su.toJSON(r))),e.transactionConfig?.length&&(t.transactionConfig=e.transactionConfig.map(r=>du.toJSON(r))),e.moveEventConfigs?.length&&(t.moveEventConfigs=e.moveEventConfigs.map(r=>yu.toJSON(r))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(r=>Ki.toJSON(r))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(r=>$i.toJSON(r))),e.fuelTransactionConfigs?.length&&(t.fuelTransactionConfigs=e.fuelTransactionConfigs.map(r=>Nu.toJSON(r))),e.assetConfigs?.length&&(t.assetConfigs=e.assetConfigs.map(r=>uu.toJSON(r))),e.fuelReceiptConfigs?.length&&(t.fuelReceiptConfigs=e.fuelReceiptConfigs.map(r=>pu.toJSON(r))),e.cosmosLogConfigs?.length&&(t.cosmosLogConfigs=e.cosmosLogConfigs.map(r=>mu.toJSON(r))),e.starknetEventConfigs?.length&&(t.starknetEventConfigs=e.starknetEventConfigs.map(r=>Iu.toJSON(r))),e.instructionConfig!==void 0&&(t.instructionConfig=gu.toJSON(e.instructionConfig)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.processorType!==""&&(t.processorType=e.processorType),t},create(e){return Gi.fromPartial(e??{})},fromPartial(e){let t=kT();return t.contract=e.contract!==void 0&&e.contract!==null?Xi.fromPartial(e.contract):void 0,t.intervalConfigs=e.intervalConfigs?.map(r=>Ht.fromPartial(r))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(r=>Hi.fromPartial(r))||[],t.logConfigs=e.logConfigs?.map(r=>Zi.fromPartial(r))||[],t.traceConfigs=e.traceConfigs?.map(r=>su.fromPartial(r))||[],t.transactionConfig=e.transactionConfig?.map(r=>du.fromPartial(r))||[],t.moveEventConfigs=e.moveEventConfigs?.map(r=>yu.fromPartial(r))||[],t.moveCallConfigs=e.moveCallConfigs?.map(r=>Ki.fromPartial(r))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(r=>$i.fromPartial(r))||[],t.fuelTransactionConfigs=e.fuelTransactionConfigs?.map(r=>Nu.fromPartial(r))||[],t.assetConfigs=e.assetConfigs?.map(r=>uu.fromPartial(r))||[],t.fuelReceiptConfigs=e.fuelReceiptConfigs?.map(r=>pu.fromPartial(r))||[],t.cosmosLogConfigs=e.cosmosLogConfigs?.map(r=>mu.fromPartial(r))||[],t.starknetEventConfigs=e.starknetEventConfigs?.map(r=>Iu.fromPartial(r))||[],t.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?gu.fromPartial(e.instructionConfig):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.processorType=e.processorType??"",t}};function DT(){return{gqlSchema:""}}o(DT,"createBaseDataBaseSchema");var qi={encode(e,t=b.default.Writer.create()){return e.gqlSchema!==""&&t.uint32(10).string(e.gqlSchema),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=DT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gqlSchema=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{gqlSchema:S(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let t={};return e.gqlSchema!==""&&(t.gqlSchema=e.gqlSchema),t},create(e){return qi.fromPartial(e??{})},fromPartial(e){let t=DT();return t.gqlSchema=e.gqlSchema??"",t}};function PT(){return{}}o(PT,"createBaseTotalPerEntityAggregation");var bq={encode(e,t=b.default.Writer.create()){return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=PT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return bq.fromPartial(e??{})},fromPartial(e){return PT()}};function LT(){return{retentionEventName:"",days:0}}o(LT,"createBaseRetentionConfig");var Iq={encode(e,t=b.default.Writer.create()){return e.retentionEventName!==""&&t.uint32(18).string(e.retentionEventName),e.days!==0&&t.uint32(24).int32(e.days),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=LT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.retentionEventName=r.string();continue;case 3:if(a!==24)break;i.days=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{retentionEventName:S(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:S(e.days)?globalThis.Number(e.days):0}},toJSON(e){let t={};return e.retentionEventName!==""&&(t.retentionEventName=e.retentionEventName),e.days!==0&&(t.days=Math.round(e.days)),t},create(e){return Iq.fromPartial(e??{})},fromPartial(e){let t=LT();return t.retentionEventName=e.retentionEventName??"",t.days=e.days??0,t}};function FT(){return{name:"",channel:""}}o(FT,"createBaseExportConfig");var Ji={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.channel!==""&&t.uint32(18).string(e.channel),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=FT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==18)break;i.channel=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",channel:S(e.channel)?globalThis.String(e.channel):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.channel!==""&&(t.channel=e.channel),t},create(e){return Ji.fromPartial(e??{})},fromPartial(e){let t=FT();return t.name=e.name??"",t.channel=e.channel??"",t}};function VT(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}o(VT,"createBaseMetricConfig");var un={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.unit!==""&&t.uint32(18).string(e.unit),e.sparse!==!1&&t.uint32(32).bool(e.sparse),e.persistentBetweenVersion!==!1&&t.uint32(40).bool(e.persistentBetweenVersion),e.type!==0&&t.uint32(56).int32(e.type),e.aggregationConfig!==void 0&&ou.encode(e.aggregationConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=VT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 3:if(a!==26)break;i.description=r.string();continue;case 2:if(a!==18)break;i.unit=r.string();continue;case 4:if(a!==32)break;i.sparse=r.bool();continue;case 5:if(a!==40)break;i.persistentBetweenVersion=r.bool();continue;case 7:if(a!==56)break;i.type=r.int32();continue;case 6:if(a!==50)break;i.aggregationConfig=ou.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",description:S(e.description)?globalThis.String(e.description):"",unit:S(e.unit)?globalThis.String(e.unit):"",sparse:S(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:S(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:S(e.type)?jG(e.type):0,aggregationConfig:S(e.aggregationConfig)?ou.fromJSON(e.aggregationConfig):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.description!==""&&(t.description=e.description),e.unit!==""&&(t.unit=e.unit),e.sparse!==!1&&(t.sparse=e.sparse),e.persistentBetweenVersion!==!1&&(t.persistentBetweenVersion=e.persistentBetweenVersion),e.type!==0&&(t.type=eq(e.type)),e.aggregationConfig!==void 0&&(t.aggregationConfig=ou.toJSON(e.aggregationConfig)),t},create(e){return un.fromPartial(e??{})},fromPartial(e){let t=VT();return t.name=e.name??"",t.description=e.description??"",t.unit=e.unit??"",t.sparse=e.sparse??!1,t.persistentBetweenVersion=e.persistentBetweenVersion??!1,t.type=e.type??0,t.aggregationConfig=e.aggregationConfig!==void 0&&e.aggregationConfig!==null?ou.fromPartial(e.aggregationConfig):void 0,t}};function MT(){return{name:"",fields:[]}}o(MT,"createBaseEventLogConfig");var Dn={encode(e,t=b.default.Writer.create()){e.name!==""&&t.uint32(10).string(e.name);for(let r of e.fields)zi.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=MT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==18)break;i.fields.push(zi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>zi.fromJSON(t)):[]}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.fields?.length&&(t.fields=e.fields.map(r=>zi.toJSON(r))),t},create(e){return Dn.fromPartial(e??{})},fromPartial(e){let t=MT();return t.name=e.name??"",t.fields=e.fields?.map(r=>zi.fromPartial(r))||[],t}};function UT(){return{fields:[]}}o(UT,"createBaseEventLogConfig_StructFieldType");var Jo={encode(e,t=b.default.Writer.create()){for(let r of e.fields)zi.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=UT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.fields.push(zi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>zi.fromJSON(t)):[]}},toJSON(e){let t={};return e.fields?.length&&(t.fields=e.fields.map(r=>zi.toJSON(r))),t},create(e){return Jo.fromPartial(e??{})},fromPartial(e){let t=UT();return t.fields=e.fields?.map(r=>zi.fromPartial(r))||[],t}};function QT(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}o(QT,"createBaseEventLogConfig_Field");var zi={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.basicType!==void 0&&t.uint32(16).int32(e.basicType),e.coinType!==void 0&&Nn.encode(e.coinType,t.uint32(26).fork()).ldelim(),e.structType!==void 0&&Jo.encode(e.structType,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=QT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==16)break;i.basicType=r.int32();continue;case 3:if(a!==26)break;i.coinType=Nn.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.structType=Jo.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",basicType:S(e.basicType)?pq(e.basicType):void 0,coinType:S(e.coinType)?Nn.fromJSON(e.coinType):void 0,structType:S(e.structType)?Jo.fromJSON(e.structType):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.basicType!==void 0&&(t.basicType=lq(e.basicType)),e.coinType!==void 0&&(t.coinType=Nn.toJSON(e.coinType)),e.structType!==void 0&&(t.structType=Jo.toJSON(e.structType)),t},create(e){return zi.fromPartial(e??{})},fromPartial(e){let t=QT();return t.name=e.name??"",t.basicType=e.basicType??void 0,t.coinType=e.coinType!==void 0&&e.coinType!==null?Nn.fromPartial(e.coinType):void 0,t.structType=e.structType!==void 0&&e.structType!==null?Jo.fromPartial(e.structType):void 0,t}};function GT(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}o(GT,"createBaseAggregationConfig");var ou={encode(e,t=b.default.Writer.create()){t.uint32(10).fork();for(let r of e.intervalInMinutes)t.int32(r);t.ldelim(),t.uint32(18).fork();for(let r of e.types)t.int32(r);return t.ldelim(),e.discardOrigin!==!1&&t.uint32(24).bool(e.discardOrigin),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=GT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a===8){i.intervalInMinutes.push(r.int32());continue}if(a===10){let s=r.uint32()+r.pos;for(;r.pos<s;)i.intervalInMinutes.push(r.int32());continue}break;case 2:if(a===16){i.types.push(r.int32());continue}if(a===18){let s=r.uint32()+r.pos;for(;r.pos<s;)i.types.push(r.int32());continue}break;case 3:if(a!==24)break;i.discardOrigin=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{intervalInMinutes:globalThis.Array.isArray(e?.intervalInMinutes)?e.intervalInMinutes.map(t=>globalThis.Number(t)):[],types:globalThis.Array.isArray(e?.types)?e.types.map(t=>tq(t)):[],discardOrigin:S(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let t={};return e.intervalInMinutes?.length&&(t.intervalInMinutes=e.intervalInMinutes.map(r=>Math.round(r))),e.types?.length&&(t.types=e.types.map(r=>rq(r))),e.discardOrigin!==!1&&(t.discardOrigin=e.discardOrigin),t},create(e){return ou.fromPartial(e??{})},fromPartial(e){let t=GT();return t.intervalInMinutes=e.intervalInMinutes?.map(r=>r)||[],t.types=e.types?.map(r=>r)||[],t.discardOrigin=e.discardOrigin??!1,t}};function qT(){return{chainId:"",address:"",startBlock:BigInt("0"),endBlock:BigInt("0"),intervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],logConfigs:[]}}o(qT,"createBaseAccountConfig");var Wi={encode(e,t=b.default.Writer.create()){if(e.chainId!==""&&t.uint32(10).string(e.chainId),e.address!==""&&t.uint32(18).string(e.address),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(24).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(80).uint64(e.endBlock.toString())}for(let r of e.intervalConfigs)Ht.encode(r,t.uint32(34).fork()).ldelim();for(let r of e.moveIntervalConfigs)Hi.encode(r,t.uint32(58).fork()).ldelim();for(let r of e.moveCallConfigs)Ki.encode(r,t.uint32(66).fork()).ldelim();for(let r of e.moveResourceChangeConfigs)$i.encode(r,t.uint32(74).fork()).ldelim();for(let r of e.logConfigs)Zi.encode(r,t.uint32(50).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=qT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=r.string();continue;case 2:if(a!==18)break;i.address=r.string();continue;case 3:if(a!==24)break;i.startBlock=Fr(r.uint64());continue;case 10:if(a!==80)break;i.endBlock=Fr(r.uint64());continue;case 4:if(a!==34)break;i.intervalConfigs.push(Ht.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.moveIntervalConfigs.push(Hi.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.moveCallConfigs.push(Ki.decode(r,r.uint32()));continue;case 9:if(a!==74)break;i.moveResourceChangeConfigs.push($i.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.logConfigs.push(Zi.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainId:S(e.chainId)?globalThis.String(e.chainId):"",address:S(e.address)?globalThis.String(e.address):"",startBlock:S(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:S(e.endBlock)?BigInt(e.endBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>Ht.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Hi.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>Ki.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>$i.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>Zi.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(r=>Ht.toJSON(r))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(r=>Hi.toJSON(r))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(r=>Ki.toJSON(r))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(r=>$i.toJSON(r))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(r=>Zi.toJSON(r))),t},create(e){return Wi.fromPartial(e??{})},fromPartial(e){let t=qT();return t.chainId=e.chainId??"",t.address=e.address??"",t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.intervalConfigs=e.intervalConfigs?.map(r=>Ht.fromPartial(r))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(r=>Hi.fromPartial(r))||[],t.moveCallConfigs=e.moveCallConfigs?.map(r=>Ki.fromPartial(r))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(r=>$i.fromPartial(r))||[],t.logConfigs=e.logConfigs?.map(r=>Zi.fromPartial(r))||[],t}};function JT(){return{recentInterval:0,backfillInterval:0}}o(JT,"createBaseHandleInterval");var Mi={encode(e,t=b.default.Writer.create()){return e.recentInterval!==0&&t.uint32(8).int32(e.recentInterval),e.backfillInterval!==0&&t.uint32(16).int32(e.backfillInterval),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=JT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.recentInterval=r.int32();continue;case 2:if(a!==16)break;i.backfillInterval=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{recentInterval:S(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:S(e.backfillInterval)?globalThis.Number(e.backfillInterval):0}},toJSON(e){let t={};return e.recentInterval!==0&&(t.recentInterval=Math.round(e.recentInterval)),e.backfillInterval!==0&&(t.backfillInterval=Math.round(e.backfillInterval)),t},create(e){return Mi.fromPartial(e??{})},fromPartial(e){let t=JT();return t.recentInterval=e.recentInterval??0,t.backfillInterval=e.backfillInterval??0,t}};function zT(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0,handlerName:""}}o(zT,"createBaseOnIntervalConfig");var Ht={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.minutes!==0&&t.uint32(16).int32(e.minutes),e.minutesInterval!==void 0&&Mi.encode(e.minutesInterval,t.uint32(34).fork()).ldelim(),e.slot!==0&&t.uint32(24).int32(e.slot),e.slotInterval!==void 0&&Mi.encode(e.slotInterval,t.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(50).fork()).ldelim(),e.handlerName!==""&&t.uint32(58).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=zT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue;case 2:if(a!==16)break;i.minutes=r.int32();continue;case 4:if(a!==34)break;i.minutesInterval=Mi.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.slot=r.int32();continue;case 5:if(a!==42)break;i.slotInterval=Mi.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:S(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:S(e.minutesInterval)?Mi.fromJSON(e.minutesInterval):void 0,slot:S(e.slot)?globalThis.Number(e.slot):0,slotInterval:S(e.slotInterval)?Mi.fromJSON(e.slotInterval):void 0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.minutes!==0&&(t.minutes=Math.round(e.minutes)),e.minutesInterval!==void 0&&(t.minutesInterval=Mi.toJSON(e.minutesInterval)),e.slot!==0&&(t.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(t.slotInterval=Mi.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Ht.fromPartial(e??{})},fromPartial(e){let t=zT();return t.handlerId=e.handlerId??0,t.minutes=e.minutes??0,t.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?Mi.fromPartial(e.minutesInterval):void 0,t.slot=e.slot??0,t.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?Mi.fromPartial(e.slotInterval):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function WT(){return{intervalConfig:void 0,type:""}}o(WT,"createBaseAptosOnIntervalConfig");var Eq={encode(e,t=b.default.Writer.create()){return e.intervalConfig!==void 0&&Ht.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=WT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=Ht.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.type=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:S(e.intervalConfig)?Ht.fromJSON(e.intervalConfig):void 0,type:S(e.type)?globalThis.String(e.type):""}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=Ht.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),t},create(e){return Eq.fromPartial(e??{})},fromPartial(e){let t=WT();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?Ht.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t}};function HT(){return{intervalConfig:void 0,type:"",ownerType:0,resourceFetchConfig:void 0,fetchConfig:void 0}}o(HT,"createBaseMoveOnIntervalConfig");var Hi={encode(e,t=b.default.Writer.create()){return e.intervalConfig!==void 0&&Ht.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),e.ownerType!==0&&t.uint32(24).int32(e.ownerType),e.resourceFetchConfig!==void 0&&Au.encode(e.resourceFetchConfig,t.uint32(34).fork()).ldelim(),e.fetchConfig!==void 0&&_n.encode(e.fetchConfig,t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=HT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=Ht.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.type=r.string();continue;case 3:if(a!==24)break;i.ownerType=r.int32();continue;case 4:if(a!==34)break;i.resourceFetchConfig=Au.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.fetchConfig=_n.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:S(e.intervalConfig)?Ht.fromJSON(e.intervalConfig):void 0,type:S(e.type)?globalThis.String(e.type):"",ownerType:S(e.ownerType)?nq(e.ownerType):0,resourceFetchConfig:S(e.resourceFetchConfig)?Au.fromJSON(e.resourceFetchConfig):void 0,fetchConfig:S(e.fetchConfig)?_n.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=Ht.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),e.ownerType!==0&&(t.ownerType=iq(e.ownerType)),e.resourceFetchConfig!==void 0&&(t.resourceFetchConfig=Au.toJSON(e.resourceFetchConfig)),e.fetchConfig!==void 0&&(t.fetchConfig=_n.toJSON(e.fetchConfig)),t},create(e){return Hi.fromPartial(e??{})},fromPartial(e){let t=HT();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?Ht.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t.ownerType=e.ownerType??0,t.resourceFetchConfig=e.resourceFetchConfig!==void 0&&e.resourceFetchConfig!==null?Au.fromPartial(e.resourceFetchConfig):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?_n.fromPartial(e.fetchConfig):void 0,t}};function XT(){return{name:"",chainId:"",address:"",abi:""}}o(XT,"createBaseContractInfo");var Xi={encode(e,t=b.default.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.chainId!==""&&t.uint32(18).string(e.chainId),e.address!==""&&t.uint32(26).string(e.address),e.abi!==""&&t.uint32(34).string(e.abi),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=XT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=r.string();continue;case 2:if(a!==18)break;i.chainId=r.string();continue;case 3:if(a!==26)break;i.address=r.string();continue;case 4:if(a!==34)break;i.abi=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{name:S(e.name)?globalThis.String(e.name):"",chainId:S(e.chainId)?globalThis.String(e.chainId):"",address:S(e.address)?globalThis.String(e.address):"",abi:S(e.abi)?globalThis.String(e.abi):""}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.abi!==""&&(t.abi=e.abi),t},create(e){return Xi.fromPartial(e??{})},fromPartial(e){let t=XT();return t.name=e.name??"",t.chainId=e.chainId??"",t.address=e.address??"",t.abi=e.abi??"",t}};function ZT(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}o(ZT,"createBaseTemplateInstance");var Xt={encode(e,t=b.default.Writer.create()){if(e.contract!==void 0&&Xi.encode(e.contract,t.uint32(10).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");t.uint32(16).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");t.uint32(24).uint64(e.endBlock.toString())}return e.templateId!==0&&t.uint32(32).int32(e.templateId),e.baseLabels!==void 0&&ee.encode(ee.wrap(e.baseLabels),t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ZT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=Xi.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.startBlock=Fr(r.uint64());continue;case 3:if(a!==24)break;i.endBlock=Fr(r.uint64());continue;case 4:if(a!==32)break;i.templateId=r.int32();continue;case 5:if(a!==42)break;i.baseLabels=ee.unwrap(ee.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{contract:S(e.contract)?Xi.fromJSON(e.contract):void 0,startBlock:S(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:S(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:S(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:Nt(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=Xi.toJSON(e.contract)),e.startBlock!==BigInt("0")&&(t.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(t.endBlock=e.endBlock.toString()),e.templateId!==0&&(t.templateId=Math.round(e.templateId)),e.baseLabels!==void 0&&(t.baseLabels=e.baseLabels),t},create(e){return Xt.fromPartial(e??{})},fromPartial(e){let t=ZT();return t.contract=e.contract!==void 0&&e.contract!==null?Xi.fromPartial(e.contract):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.templateId=e.templateId??0,t.baseLabels=e.baseLabels??void 0,t}};function KT(){return{chainIds:[],dbSchema:void 0,config:void 0,executionConfig:void 0,metricConfigs:[],exportConfigs:[],eventLogConfigs:[]}}o(KT,"createBaseInitResponse");var Tq={encode(e,t=b.default.Writer.create()){for(let r of e.chainIds)t.uint32(10).string(r);e.dbSchema!==void 0&&qi.encode(e.dbSchema,t.uint32(18).fork()).ldelim(),e.config!==void 0&&Ui.encode(e.config,t.uint32(26).fork()).ldelim(),e.executionConfig!==void 0&&Qi.encode(e.executionConfig,t.uint32(34).fork()).ldelim();for(let r of e.metricConfigs)un.encode(r,t.uint32(42).fork()).ldelim();for(let r of e.exportConfigs)Ji.encode(r,t.uint32(50).fork()).ldelim();for(let r of e.eventLogConfigs)Dn.encode(r,t.uint32(58).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=KT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainIds.push(r.string());continue;case 2:if(a!==18)break;i.dbSchema=qi.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.config=Ui.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.executionConfig=Qi.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.metricConfigs.push(un.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.exportConfigs.push(Ji.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.eventLogConfigs.push(Dn.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainIds:globalThis.Array.isArray(e?.chainIds)?e.chainIds.map(t=>globalThis.String(t)):[],dbSchema:S(e.dbSchema)?qi.fromJSON(e.dbSchema):void 0,config:S(e.config)?Ui.fromJSON(e.config):void 0,executionConfig:S(e.executionConfig)?Qi.fromJSON(e.executionConfig):void 0,metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>un.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Ji.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>Dn.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainIds?.length&&(t.chainIds=e.chainIds),e.dbSchema!==void 0&&(t.dbSchema=qi.toJSON(e.dbSchema)),e.config!==void 0&&(t.config=Ui.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=Qi.toJSON(e.executionConfig)),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(r=>un.toJSON(r))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(r=>Ji.toJSON(r))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(r=>Dn.toJSON(r))),t},create(e){return Tq.fromPartial(e??{})},fromPartial(e){let t=KT();return t.chainIds=e.chainIds?.map(r=>r)||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?qi.fromPartial(e.dbSchema):void 0,t.config=e.config!==void 0&&e.config!==null?Ui.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?Qi.fromPartial(e.executionConfig):void 0,t.metricConfigs=e.metricConfigs?.map(r=>un.fromPartial(r))||[],t.exportConfigs=e.exportConfigs?.map(r=>Ji.fromPartial(r))||[],t.eventLogConfigs=e.eventLogConfigs?.map(r=>Dn.fromPartial(r))||[],t}};function $T(){return{chainId:"",templateInstances:[]}}o($T,"createBaseUpdateTemplatesRequest");var FS={encode(e,t=b.default.Writer.create()){e.chainId!==""&&t.uint32(10).string(e.chainId);for(let r of e.templateInstances)Xt.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=$T();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=r.string();continue;case 2:if(a!==18)break;i.templateInstances.push(Xt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainId:S(e.chainId)?globalThis.String(e.chainId):"",templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>Xt.fromJSON(t)):[]}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(r=>Xt.toJSON(r))),t},create(e){return FS.fromPartial(e??{})},fromPartial(e){let t=$T();return t.chainId=e.chainId??"",t.templateInstances=e.templateInstances?.map(r=>Xt.fromPartial(r))||[],t}};function YT(){return{templateInstances:[]}}o(YT,"createBaseStartRequest");var C6={encode(e,t=b.default.Writer.create()){for(let r of e.templateInstances)Xt.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=YT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.templateInstances.push(Xt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>Xt.fromJSON(t)):[]}},toJSON(e){let t={};return e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(r=>Xt.toJSON(r))),t},create(e){return C6.fromPartial(e??{})},fromPartial(e){let t=YT();return t.templateInstances=e.templateInstances?.map(r=>Xt.fromPartial(r))||[],t}};function jT(){return{handlerId:0}}o(jT,"createBaseBlockHandlerConfig");var Nq={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=jT();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return Nq.fromPartial(e??{})},fromPartial(e){let t=jT();return t.handlerId=e.handlerId??0,t}};function eN(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}o(eN,"createBaseEthFetchConfig");var Zt={encode(e,t=b.default.Writer.create()){return e.transaction!==!1&&t.uint32(8).bool(e.transaction),e.transactionReceipt!==!1&&t.uint32(16).bool(e.transactionReceipt),e.transactionReceiptLogs!==!1&&t.uint32(40).bool(e.transactionReceiptLogs),e.block!==!1&&t.uint32(24).bool(e.block),e.trace!==!1&&t.uint32(32).bool(e.trace),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=eN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.transaction=r.bool();continue;case 2:if(a!==16)break;i.transactionReceipt=r.bool();continue;case 5:if(a!==40)break;i.transactionReceiptLogs=r.bool();continue;case 3:if(a!==24)break;i.block=r.bool();continue;case 4:if(a!==32)break;i.trace=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:S(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:S(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:S(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:S(e.block)?globalThis.Boolean(e.block):!1,trace:S(e.trace)?globalThis.Boolean(e.trace):!1}},toJSON(e){let t={};return e.transaction!==!1&&(t.transaction=e.transaction),e.transactionReceipt!==!1&&(t.transactionReceipt=e.transactionReceipt),e.transactionReceiptLogs!==!1&&(t.transactionReceiptLogs=e.transactionReceiptLogs),e.block!==!1&&(t.block=e.block),e.trace!==!1&&(t.trace=e.trace),t},create(e){return Zt.fromPartial(e??{})},fromPartial(e){let t=eN();return t.transaction=e.transaction??!1,t.transactionReceipt=e.transactionReceipt??!1,t.transactionReceiptLogs=e.transactionReceiptLogs??!1,t.block=e.block??!1,t.trace=e.trace??!1,t}};function tN(){return{signature:"",handlerId:0,fetchConfig:void 0,handlerName:""}}o(tN,"createBaseTraceHandlerConfig");var su={encode(e,t=b.default.Writer.create()){return e.signature!==""&&t.uint32(10).string(e.signature),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=tN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.signature=r.string();continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{signature:S(e.signature)?globalThis.String(e.signature):"",handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.signature!==""&&(t.signature=e.signature),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return su.fromPartial(e??{})},fromPartial(e){let t=tN();return t.signature=e.signature??"",t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function rN(){return{handlerId:0,fetchConfig:void 0,handlerName:""}}o(rN,"createBaseTransactionHandlerConfig");var du={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=rN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return du.fromPartial(e??{})},fromPartial(e){let t=rN();return t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function nN(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}o(nN,"createBaseLogHandlerConfig");var Zi={encode(e,t=b.default.Writer.create()){for(let r of e.filters)hu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&Zt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=nN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(hu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=Zt.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>hu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?Zt.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>hu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=Zt.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Zi.fromPartial(e??{})},fromPartial(e){let t=nN();return t.filters=e.filters?.map(r=>hu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?Zt.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function iN(){return{filters:[],handlerId:0,handlerName:""}}o(iN,"createBaseFuelAssetHandlerConfig");var uu={encode(e,t=b.default.Writer.create()){for(let r of e.filters)cu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=iN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(cu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>cu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>cu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return uu.fromPartial(e??{})},fromPartial(e){let t=iN();return t.filters=e.filters?.map(r=>cu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function aN(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}o(aN,"createBaseFuelAssetHandlerConfig_AssetFilter");var cu={encode(e,t=b.default.Writer.create()){return e.assetId!==void 0&&t.uint32(10).string(e.assetId),e.fromAddress!==void 0&&t.uint32(18).string(e.fromAddress),e.toAddress!==void 0&&t.uint32(26).string(e.toAddress),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=aN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.assetId=r.string();continue;case 2:if(a!==18)break;i.fromAddress=r.string();continue;case 3:if(a!==26)break;i.toAddress=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{assetId:S(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:S(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:S(e.toAddress)?globalThis.String(e.toAddress):void 0}},toJSON(e){let t={};return e.assetId!==void 0&&(t.assetId=e.assetId),e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),t},create(e){return cu.fromPartial(e??{})},fromPartial(e){let t=aN();return t.assetId=e.assetId??void 0,t.fromAddress=e.fromAddress??void 0,t.toAddress=e.toAddress??void 0,t}};function oN(){return{logIds:[],handlerId:0,handlerName:""}}o(oN,"createBaseFuelLogHandlerConfig");var Sq={encode(e,t=b.default.Writer.create()){for(let r of e.logIds)t.uint32(10).string(r);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=oN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(r.string());continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Sq.fromPartial(e??{})},fromPartial(e){let t=oN();return t.logIds=e.logIds?.map(r=>r)||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function sN(){return{log:void 0,transfer:void 0,handlerId:0,handlerName:""}}o(sN,"createBaseFuelReceiptHandlerConfig");var pu={encode(e,t=b.default.Writer.create()){return e.log!==void 0&&fu.encode(e.log,t.uint32(10).fork()).ldelim(),e.transfer!==void 0&&lu.encode(e.transfer,t.uint32(18).fork()).ldelim(),e.handlerId!==0&&t.uint32(24).int32(e.handlerId),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=sN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.log=fu.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.transfer=lu.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.handlerId=r.int32();continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{log:S(e.log)?fu.fromJSON(e.log):void 0,transfer:S(e.transfer)?lu.fromJSON(e.transfer):void 0,handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.log!==void 0&&(t.log=fu.toJSON(e.log)),e.transfer!==void 0&&(t.transfer=lu.toJSON(e.transfer)),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return pu.fromPartial(e??{})},fromPartial(e){let t=sN();return t.log=e.log!==void 0&&e.log!==null?fu.fromPartial(e.log):void 0,t.transfer=e.transfer!==void 0&&e.transfer!==null?lu.fromPartial(e.transfer):void 0,t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function dN(){return{assetId:"",from:"",to:""}}o(dN,"createBaseFuelReceiptHandlerConfig_Transfer");var lu={encode(e,t=b.default.Writer.create()){return e.assetId!==""&&t.uint32(34).string(e.assetId),e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=dN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.assetId=r.string();continue;case 1:if(a!==10)break;i.from=r.string();continue;case 2:if(a!==18)break;i.to=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{assetId:S(e.assetId)?globalThis.String(e.assetId):"",from:S(e.from)?globalThis.String(e.from):"",to:S(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.assetId!==""&&(t.assetId=e.assetId),e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return lu.fromPartial(e??{})},fromPartial(e){let t=dN();return t.assetId=e.assetId??"",t.from=e.from??"",t.to=e.to??"",t}};function uN(){return{logIds:[]}}o(uN,"createBaseFuelReceiptHandlerConfig_Log");var fu={encode(e,t=b.default.Writer.create()){for(let r of e.logIds)t.uint32(10).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=uN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),t},create(e){return fu.fromPartial(e??{})},fromPartial(e){let t=uN();return t.logIds=e.logIds?.map(r=>r)||[],t}};function cN(){return{logFilters:[],handlerId:0,handlerName:""}}o(cN,"createBaseCosmosLogHandlerConfig");var mu={encode(e,t=b.default.Writer.create()){for(let r of e.logFilters)t.uint32(10).string(r);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=cN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logFilters.push(r.string());continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(t=>globalThis.String(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.logFilters?.length&&(t.logFilters=e.logFilters),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return mu.fromPartial(e??{})},fromPartial(e){let t=cN();return t.logFilters=e.logFilters?.map(r=>r)||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function pN(){return{topics:[],address:void 0,addressType:void 0}}o(pN,"createBaseLogFilter");var hu={encode(e,t=b.default.Writer.create()){for(let r of e.topics)Su.encode(r,t.uint32(10).fork()).ldelim();return e.address!==void 0&&t.uint32(18).string(e.address),e.addressType!==void 0&&t.uint32(24).int32(e.addressType),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=pN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.topics.push(Su.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.address=r.string();continue;case 3:if(a!==24)break;i.addressType=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(t=>Su.fromJSON(t)):[],address:S(e.address)?globalThis.String(e.address):void 0,addressType:S(e.addressType)?aq(e.addressType):void 0}},toJSON(e){let t={};return e.topics?.length&&(t.topics=e.topics.map(r=>Su.toJSON(r))),e.address!==void 0&&(t.address=e.address),e.addressType!==void 0&&(t.addressType=oq(e.addressType)),t},create(e){return hu.fromPartial(e??{})},fromPartial(e){let t=pN();return t.topics=e.topics?.map(r=>Su.fromPartial(r))||[],t.address=e.address??void 0,t.addressType=e.addressType??void 0,t}};function lN(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}o(lN,"createBaseInstructionHandlerConfig");var gu={encode(e,t=b.default.Writer.create()){return e.innerInstruction!==!1&&t.uint32(8).bool(e.innerInstruction),e.parsedInstruction!==!1&&t.uint32(16).bool(e.parsedInstruction),e.rawDataInstruction!==!1&&t.uint32(24).bool(e.rawDataInstruction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=lN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.innerInstruction=r.bool();continue;case 2:if(a!==16)break;i.parsedInstruction=r.bool();continue;case 3:if(a!==24)break;i.rawDataInstruction=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{innerInstruction:S(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:S(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:S(e.rawDataInstruction)?globalThis.Boolean(e.rawDataInstruction):!1}},toJSON(e){let t={};return e.innerInstruction!==!1&&(t.innerInstruction=e.innerInstruction),e.parsedInstruction!==!1&&(t.parsedInstruction=e.parsedInstruction),e.rawDataInstruction!==!1&&(t.rawDataInstruction=e.rawDataInstruction),t},create(e){return gu.fromPartial(e??{})},fromPartial(e){let t=lN();return t.innerInstruction=e.innerInstruction??!1,t.parsedInstruction=e.parsedInstruction??!1,t.rawDataInstruction=e.rawDataInstruction??!1,t}};function fN(){return{moveTypePrefix:""}}o(fN,"createBaseResourceConfig");var _u={encode(e,t=b.default.Writer.create()){return e.moveTypePrefix!==""&&t.uint32(10).string(e.moveTypePrefix),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=fN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.moveTypePrefix=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{moveTypePrefix:S(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let t={};return e.moveTypePrefix!==""&&(t.moveTypePrefix=e.moveTypePrefix),t},create(e){return _u.fromPartial(e??{})},fromPartial(e){let t=fN();return t.moveTypePrefix=e.moveTypePrefix??"",t}};function mN(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0,supportMultisigFunc:void 0,includeFailedTransaction:void 0}}o(mN,"createBaseMoveFetchConfig");var _n={encode(e,t=b.default.Writer.create()){return e.resourceChanges!==!1&&t.uint32(8).bool(e.resourceChanges),e.allEvents!==!1&&t.uint32(16).bool(e.allEvents),e.inputs!==!1&&t.uint32(32).bool(e.inputs),e.resourceConfig!==void 0&&_u.encode(e.resourceConfig,t.uint32(26).fork()).ldelim(),e.supportMultisigFunc!==void 0&&t.uint32(40).bool(e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&t.uint32(48).bool(e.includeFailedTransaction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=mN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.resourceChanges=r.bool();continue;case 2:if(a!==16)break;i.allEvents=r.bool();continue;case 4:if(a!==32)break;i.inputs=r.bool();continue;case 3:if(a!==26)break;i.resourceConfig=_u.decode(r,r.uint32());continue;case 5:if(a!==40)break;i.supportMultisigFunc=r.bool();continue;case 6:if(a!==48)break;i.includeFailedTransaction=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{resourceChanges:S(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:S(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:S(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:S(e.resourceConfig)?_u.fromJSON(e.resourceConfig):void 0,supportMultisigFunc:S(e.supportMultisigFunc)?globalThis.Boolean(e.supportMultisigFunc):void 0,includeFailedTransaction:S(e.includeFailedTransaction)?globalThis.Boolean(e.includeFailedTransaction):void 0}},toJSON(e){let t={};return e.resourceChanges!==!1&&(t.resourceChanges=e.resourceChanges),e.allEvents!==!1&&(t.allEvents=e.allEvents),e.inputs!==!1&&(t.inputs=e.inputs),e.resourceConfig!==void 0&&(t.resourceConfig=_u.toJSON(e.resourceConfig)),e.supportMultisigFunc!==void 0&&(t.supportMultisigFunc=e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&(t.includeFailedTransaction=e.includeFailedTransaction),t},create(e){return _n.fromPartial(e??{})},fromPartial(e){let t=mN();return t.resourceChanges=e.resourceChanges??!1,t.allEvents=e.allEvents??!1,t.inputs=e.inputs??!1,t.resourceConfig=e.resourceConfig!==void 0&&e.resourceConfig!==null?_u.fromPartial(e.resourceConfig):void 0,t.supportMultisigFunc=e.supportMultisigFunc??void 0,t.includeFailedTransaction=e.includeFailedTransaction??void 0,t}};function hN(){return{owned:!1}}o(hN,"createBaseMoveAccountFetchConfig");var Au={encode(e,t=b.default.Writer.create()){return e.owned!==!1&&t.uint32(8).bool(e.owned),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=hN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.owned=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{owned:S(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let t={};return e.owned!==!1&&(t.owned=e.owned),t},create(e){return Au.fromPartial(e??{})},fromPartial(e){let t=hN();return t.owned=e.owned??!1,t}};function gN(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}o(gN,"createBaseMoveEventHandlerConfig");var yu={encode(e,t=b.default.Writer.create()){for(let r of e.filters)wu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&_n.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=gN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(wu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=_n.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>wu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?_n.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>wu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=_n.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return yu.fromPartial(e??{})},fromPartial(e){let t=gN();return t.filters=e.filters?.map(r=>wu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?_n.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function _N(){return{type:"",account:"",eventAccount:""}}o(_N,"createBaseMoveEventFilter");var wu={encode(e,t=b.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.account!==""&&t.uint32(18).string(e.account),e.eventAccount!==""&&t.uint32(26).string(e.eventAccount),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_N();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=r.string();continue;case 2:if(a!==18)break;i.account=r.string();continue;case 3:if(a!==26)break;i.eventAccount=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{type:S(e.type)?globalThis.String(e.type):"",account:S(e.account)?globalThis.String(e.account):"",eventAccount:S(e.eventAccount)?globalThis.String(e.eventAccount):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.account!==""&&(t.account=e.account),e.eventAccount!==""&&(t.eventAccount=e.eventAccount),t},create(e){return wu.fromPartial(e??{})},fromPartial(e){let t=_N();return t.type=e.type??"",t.account=e.account??"",t.eventAccount=e.eventAccount??"",t}};function AN(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}o(AN,"createBaseMoveCallHandlerConfig");var Ki={encode(e,t=b.default.Writer.create()){for(let r of e.filters)vu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&_n.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),e.handlerName!==""&&t.uint32(34).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=AN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(vu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.fetchConfig=_n.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>vu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:S(e.fetchConfig)?_n.fromJSON(e.fetchConfig):void 0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>vu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=_n.toJSON(e.fetchConfig)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Ki.fromPartial(e??{})},fromPartial(e){let t=AN();return t.filters=e.filters?.map(r=>vu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?_n.fromPartial(e.fetchConfig):void 0,t.handlerName=e.handlerName??"",t}};function yN(){return{type:"",types:[],includeDeleted:!1,handlerId:0,handlerName:""}}o(yN,"createBaseMoveResourceChangeConfig");var $i={encode(e,t=b.default.Writer.create()){e.type!==""&&t.uint32(10).string(e.type);for(let r of e.types)t.uint32(42).string(r);return e.includeDeleted!==!1&&t.uint32(32).bool(e.includeDeleted),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=yN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=r.string();continue;case 5:if(a!==42)break;i.types.push(r.string());continue;case 4:if(a!==32)break;i.includeDeleted=r.bool();continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{type:S(e.type)?globalThis.String(e.type):"",types:globalThis.Array.isArray(e?.types)?e.types.map(t=>globalThis.String(t)):[],includeDeleted:S(e.includeDeleted)?globalThis.Boolean(e.includeDeleted):!1,handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.types?.length&&(t.types=e.types),e.includeDeleted!==!1&&(t.includeDeleted=e.includeDeleted),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return $i.fromPartial(e??{})},fromPartial(e){let t=yN();return t.type=e.type??"",t.types=e.types?.map(r=>r)||[],t.includeDeleted=e.includeDeleted??!1,t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function wN(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}o(wN,"createBaseMoveCallFilter");var vu={encode(e,t=b.default.Writer.create()){e.function!==""&&t.uint32(10).string(e.function);for(let r of e.typeArguments)t.uint32(18).string(r);return e.withTypeArguments!==!1&&t.uint32(24).bool(e.withTypeArguments),e.includeFailed!==!1&&t.uint32(32).bool(e.includeFailed),e.publicKeyPrefix!==""&&t.uint32(42).string(e.publicKeyPrefix),e.fromAndToAddress!==void 0&&bu.encode(e.fromAndToAddress,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=wN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=r.string();continue;case 2:if(a!==18)break;i.typeArguments.push(r.string());continue;case 3:if(a!==24)break;i.withTypeArguments=r.bool();continue;case 4:if(a!==32)break;i.includeFailed=r.bool();continue;case 5:if(a!==42)break;i.publicKeyPrefix=r.string();continue;case 6:if(a!==50)break;i.fromAndToAddress=bu.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{function:S(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(t=>globalThis.String(t)):[],withTypeArguments:S(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:S(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:S(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:S(e.fromAndToAddress)?bu.fromJSON(e.fromAndToAddress):void 0}},toJSON(e){let t={};return e.function!==""&&(t.function=e.function),e.typeArguments?.length&&(t.typeArguments=e.typeArguments),e.withTypeArguments!==!1&&(t.withTypeArguments=e.withTypeArguments),e.includeFailed!==!1&&(t.includeFailed=e.includeFailed),e.publicKeyPrefix!==""&&(t.publicKeyPrefix=e.publicKeyPrefix),e.fromAndToAddress!==void 0&&(t.fromAndToAddress=bu.toJSON(e.fromAndToAddress)),t},create(e){return vu.fromPartial(e??{})},fromPartial(e){let t=wN();return t.function=e.function??"",t.typeArguments=e.typeArguments?.map(r=>r)||[],t.withTypeArguments=e.withTypeArguments??!1,t.includeFailed=e.includeFailed??!1,t.publicKeyPrefix=e.publicKeyPrefix??"",t.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?bu.fromPartial(e.fromAndToAddress):void 0,t}};function vN(){return{from:"",to:""}}o(vN,"createBaseMoveCallFilter_FromAndToAddress");var bu={encode(e,t=b.default.Writer.create()){return e.from!==""&&t.uint32(10).string(e.from),e.to!==""&&t.uint32(18).string(e.to),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=vN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.from=r.string();continue;case 2:if(a!==18)break;i.to=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{from:S(e.from)?globalThis.String(e.from):"",to:S(e.to)?globalThis.String(e.to):""}},toJSON(e){let t={};return e.from!==""&&(t.from=e.from),e.to!==""&&(t.to=e.to),t},create(e){return bu.fromPartial(e??{})},fromPartial(e){let t=vN();return t.from=e.from??"",t.to=e.to??"",t}};function bN(){return{filters:[],handlerId:0,handlerName:""}}o(bN,"createBaseStarknetEventHandlerConfig");var Iu={encode(e,t=b.default.Writer.create()){for(let r of e.filters)Eu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=bN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(Eu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Eu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>Eu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Iu.fromPartial(e??{})},fromPartial(e){let t=bN();return t.filters=e.filters?.map(r=>Eu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function IN(){return{address:"",keys:[]}}o(IN,"createBaseStarknetEventFilter");var Eu={encode(e,t=b.default.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(let r of e.keys)t.uint32(18).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=IN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=r.string();continue;case 2:if(a!==18)break;i.keys.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{address:S(e.address)?globalThis.String(e.address):"",keys:globalThis.Array.isArray(e?.keys)?e.keys.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.address!==""&&(t.address=e.address),e.keys?.length&&(t.keys=e.keys),t},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let t=IN();return t.address=e.address??"",t.keys=e.keys?.map(r=>r)||[],t}};function EN(){return{function:"",includeFailed:!1}}o(EN,"createBaseFuelCallFilter");var Tu={encode(e,t=b.default.Writer.create()){return e.function!==""&&t.uint32(10).string(e.function),e.includeFailed!==!1&&t.uint32(16).bool(e.includeFailed),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=EN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=r.string();continue;case 2:if(a!==16)break;i.includeFailed=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{function:S(e.function)?globalThis.String(e.function):"",includeFailed:S(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1}},toJSON(e){let t={};return e.function!==""&&(t.function=e.function),e.includeFailed!==!1&&(t.includeFailed=e.includeFailed),t},create(e){return Tu.fromPartial(e??{})},fromPartial(e){let t=EN();return t.function=e.function??"",t.includeFailed=e.includeFailed??!1,t}};function TN(){return{filters:[],handlerId:0,handlerName:""}}o(TN,"createBaseFuelCallHandlerConfig");var Cq={encode(e,t=b.default.Writer.create()){for(let r of e.filters)Tu.encode(r,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.handlerName!==""&&t.uint32(26).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=TN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(Tu.decode(r,r.uint32()));continue;case 2:if(a!==16)break;i.handlerId=r.int32();continue;case 3:if(a!==26)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Tu.fromJSON(t)):[],handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(r=>Tu.toJSON(r))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Cq.fromPartial(e??{})},fromPartial(e){let t=TN();return t.filters=e.filters?.map(r=>Tu.fromPartial(r))||[],t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function NN(){return{handlerId:0,handlerName:""}}o(NN,"createBaseFuelTransactionHandlerConfig");var Nu={encode(e,t=b.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.handlerName!==""&&t.uint32(18).string(e.handlerName),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=NN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=r.int32();continue;case 2:if(a!==18)break;i.handlerName=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{handlerId:S(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:S(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(t.handlerName=e.handlerName),t},create(e){return Nu.fromPartial(e??{})},fromPartial(e){let t=NN();return t.handlerId=e.handlerId??0,t.handlerName=e.handlerName??"",t}};function SN(){return{hashes:[]}}o(SN,"createBaseTopic");var Su={encode(e,t=b.default.Writer.create()){for(let r of e.hashes)t.uint32(10).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=SN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.hashes.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{hashes:globalThis.Array.isArray(e?.hashes)?e.hashes.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.hashes?.length&&(t.hashes=e.hashes),t},create(e){return Su.fromPartial(e??{})},fromPartial(e){let t=SN();return t.hashes=e.hashes?.map(r=>r)||[],t}};function CN(){return{bindings:[]}}o(CN,"createBaseProcessBindingsRequest");var VS={encode(e,t=b.default.Writer.create()){for(let r of e.bindings)yn.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=CN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(yn.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>yn.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(r=>yn.toJSON(r))),t},create(e){return VS.fromPartial(e??{})},fromPartial(e){let t=CN();return t.bindings=e.bindings?.map(r=>yn.fromPartial(r))||[],t}};function ON(){return{result:void 0}}o(ON,"createBaseProcessBindingResponse");var MS={encode(e,t=b.default.Writer.create()){return e.result!==void 0&&Yr.encode(e.result,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ON();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=Yr.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{result:S(e.result)?Yr.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.result!==void 0&&(t.result=Yr.toJSON(e.result)),t},create(e){return MS.fromPartial(e??{})},fromPartial(e){let t=ON();return t.result=e.result!==void 0&&e.result!==null?Yr.fromPartial(e.result):void 0,t}};function BN(){return{processId:0,binding:void 0,dbResult:void 0,start:void 0}}o(BN,"createBaseProcessStreamRequest");var O6={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.binding!==void 0&&yn.encode(e.binding,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&ji.encode(e.dbResult,t.uint32(26).fork()).ldelim(),e.start!==void 0&&t.uint32(32).bool(e.start),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=BN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.binding=yn.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.dbResult=ji.decode(r,r.uint32());continue;case 4:if(a!==32)break;i.start=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,binding:S(e.binding)?yn.fromJSON(e.binding):void 0,dbResult:S(e.dbResult)?ji.fromJSON(e.dbResult):void 0,start:S(e.start)?globalThis.Boolean(e.start):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.binding!==void 0&&(t.binding=yn.toJSON(e.binding)),e.dbResult!==void 0&&(t.dbResult=ji.toJSON(e.dbResult)),e.start!==void 0&&(t.start=e.start),t},create(e){return O6.fromPartial(e??{})},fromPartial(e){let t=BN();return t.processId=e.processId??0,t.binding=e.binding!==void 0&&e.binding!==null?yn.fromPartial(e.binding):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?ji.fromPartial(e.dbResult):void 0,t.start=e.start??void 0,t}};function RN(){return{processId:0,dbRequest:void 0,result:void 0,partitions:void 0}}o(RN,"createBaseProcessStreamResponse");var US={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&An.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),e.result!==void 0&&Yr.encode(e.result,t.uint32(26).fork()).ldelim(),e.partitions!==void 0&&Yi.encode(e.partitions,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=RN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.dbRequest=An.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.result=Yr.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.partitions=Yi.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,dbRequest:S(e.dbRequest)?An.fromJSON(e.dbRequest):void 0,result:S(e.result)?Yr.fromJSON(e.result):void 0,partitions:S(e.partitions)?Yi.fromJSON(e.partitions):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=An.toJSON(e.dbRequest)),e.result!==void 0&&(t.result=Yr.toJSON(e.result)),e.partitions!==void 0&&(t.partitions=Yi.toJSON(e.partitions)),t},create(e){return US.fromPartial(e??{})},fromPartial(e){let t=RN();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?An.fromPartial(e.dbRequest):void 0,t.result=e.result!==void 0&&e.result!==null?Yr.fromPartial(e.result):void 0,t.partitions=e.partitions!==void 0&&e.partitions!==null?Yi.fromPartial(e.partitions):void 0,t}};function xN(){return{partitions:{}}}o(xN,"createBaseProcessStreamResponse_Partitions");var Yi={encode(e,t=b.default.Writer.create()){return Object.entries(e.partitions).forEach(([r,n])=>{b6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=xN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=b6.decode(r,r.uint32());s.value!==void 0&&(i.partitions[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{partitions:Nt(e.partitions)?Object.entries(e.partitions).reduce((t,[r,n])=>(t[globalThis.Number(r)]=co.fromJSON(n),t),{}):{}}},toJSON(e){let t={};if(e.partitions){let r=Object.entries(e.partitions);r.length>0&&(t.partitions={},r.forEach(([n,i])=>{t.partitions[n]=co.toJSON(i)}))}return t},create(e){return Yi.fromPartial(e??{})},fromPartial(e){let t=xN();return t.partitions=Object.entries(e.partitions??{}).reduce((r,[n,i])=>(i!==void 0&&(r[globalThis.Number(n)]=co.fromPartial(i)),r),{}),t}};function kN(){return{userValue:void 0,sysValue:void 0}}o(kN,"createBaseProcessStreamResponse_Partitions_Partition");var co={encode(e,t=b.default.Writer.create()){return e.userValue!==void 0&&t.uint32(10).string(e.userValue),e.sysValue!==void 0&&t.uint32(16).int32(e.sysValue),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=kN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.userValue=r.string();continue;case 2:if(a!==16)break;i.sysValue=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{userValue:S(e.userValue)?globalThis.String(e.userValue):void 0,sysValue:S(e.sysValue)?fq(e.sysValue):void 0}},toJSON(e){let t={};return e.userValue!==void 0&&(t.userValue=e.userValue),e.sysValue!==void 0&&(t.sysValue=mq(e.sysValue)),t},create(e){return co.fromPartial(e??{})},fromPartial(e){let t=kN();return t.userValue=e.userValue??void 0,t.sysValue=e.sysValue??void 0,t}};function DN(){return{key:0,value:void 0}}o(DN,"createBaseProcessStreamResponse_Partitions_PartitionsEntry");var b6={encode(e,t=b.default.Writer.create()){return e.key!==0&&t.uint32(8).int32(e.key),e.value!==void 0&&co.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=DN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.key=r.int32();continue;case 2:if(a!==18)break;i.value=co.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.Number(e.key):0,value:S(e.value)?co.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==0&&(t.key=Math.round(e.key)),e.value!==void 0&&(t.value=co.toJSON(e.value)),t},create(e){return b6.fromPartial(e??{})},fromPartial(e){let t=DN();return t.key=e.key??0,t.value=e.value!==void 0&&e.value!==null?co.fromPartial(e.value):void 0,t}};function PN(){return{processId:0,partitions:void 0,dbRequest:void 0,tsRequest:void 0,tplRequest:void 0,result:void 0}}o(PN,"createBaseProcessStreamResponseV3");var QS={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.partitions!==void 0&&Yi.encode(e.partitions,t.uint32(18).fork()).ldelim(),e.dbRequest!==void 0&&An.encode(e.dbRequest,t.uint32(26).fork()).ldelim(),e.tsRequest!==void 0&&ku.encode(e.tsRequest,t.uint32(34).fork()).ldelim(),e.tplRequest!==void 0&&xu.encode(e.tplRequest,t.uint32(42).fork()).ldelim(),e.result!==void 0&&Yr.encode(e.result,t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=PN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.partitions=Yi.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.dbRequest=An.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.tsRequest=ku.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.tplRequest=xu.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.result=Yr.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,partitions:S(e.partitions)?Yi.fromJSON(e.partitions):void 0,dbRequest:S(e.dbRequest)?An.fromJSON(e.dbRequest):void 0,tsRequest:S(e.tsRequest)?ku.fromJSON(e.tsRequest):void 0,tplRequest:S(e.tplRequest)?xu.fromJSON(e.tplRequest):void 0,result:S(e.result)?Yr.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.partitions!==void 0&&(t.partitions=Yi.toJSON(e.partitions)),e.dbRequest!==void 0&&(t.dbRequest=An.toJSON(e.dbRequest)),e.tsRequest!==void 0&&(t.tsRequest=ku.toJSON(e.tsRequest)),e.tplRequest!==void 0&&(t.tplRequest=xu.toJSON(e.tplRequest)),e.result!==void 0&&(t.result=Yr.toJSON(e.result)),t},create(e){return QS.fromPartial(e??{})},fromPartial(e){let t=PN();return t.processId=e.processId??0,t.partitions=e.partitions!==void 0&&e.partitions!==null?Yi.fromPartial(e.partitions):void 0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?An.fromPartial(e.dbRequest):void 0,t.tsRequest=e.tsRequest!==void 0&&e.tsRequest!==null?ku.fromPartial(e.tsRequest):void 0,t.tplRequest=e.tplRequest!==void 0&&e.tplRequest!==null?xu.fromPartial(e.tplRequest):void 0,t.result=e.result!==void 0&&e.result!==null?Yr.fromPartial(e.result):void 0,t}};function LN(){return{processId:0,bindings:void 0,dbResult:void 0}}o(LN,"createBasePreprocessStreamRequest");var GS={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.bindings!==void 0&&Cu.encode(e.bindings,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&ji.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=LN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.bindings=Cu.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.dbResult=ji.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,bindings:S(e.bindings)?Cu.fromJSON(e.bindings):void 0,dbResult:S(e.dbResult)?ji.fromJSON(e.dbResult):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.bindings!==void 0&&(t.bindings=Cu.toJSON(e.bindings)),e.dbResult!==void 0&&(t.dbResult=ji.toJSON(e.dbResult)),t},create(e){return GS.fromPartial(e??{})},fromPartial(e){let t=LN();return t.processId=e.processId??0,t.bindings=e.bindings!==void 0&&e.bindings!==null?Cu.fromPartial(e.bindings):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?ji.fromPartial(e.dbResult):void 0,t}};function FN(){return{bindings:[]}}o(FN,"createBasePreprocessStreamRequest_DataBindings");var Cu={encode(e,t=b.default.Writer.create()){for(let r of e.bindings)yn.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=FN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(yn.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>yn.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(r=>yn.toJSON(r))),t},create(e){return Cu.fromPartial(e??{})},fromPartial(e){let t=FN();return t.bindings=e.bindings?.map(r=>yn.fromPartial(r))||[],t}};function VN(){return{processId:0,dbRequest:void 0}}o(VN,"createBasePreprocessStreamResponse");var qS={encode(e,t=b.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&An.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=VN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=r.int32();continue;case 2:if(a!==18)break;i.dbRequest=An.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{processId:S(e.processId)?globalThis.Number(e.processId):0,dbRequest:S(e.dbRequest)?An.fromJSON(e.dbRequest):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=An.toJSON(e.dbRequest)),t},create(e){return qS.fromPartial(e??{})},fromPartial(e){let t=VN();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?An.fromPartial(e.dbRequest):void 0,t}};function MN(){return{opId:BigInt("0"),data:void 0,list:void 0,error:void 0,entities:void 0,entityList:void 0,nextCursor:void 0}}o(MN,"createBaseDBResponse");var ji={encode(e,t=b.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");t.uint32(8).uint64(e.opId.toString())}return e.data!==void 0&&ee.encode(ee.wrap(e.data),t.uint32(18).fork()).ldelim(),e.list!==void 0&&Ia.encode(Ia.wrap(e.list),t.uint32(34).fork()).ldelim(),e.error!==void 0&&t.uint32(26).string(e.error),e.entities!==void 0&&qo.encode(e.entities,t.uint32(50).fork()).ldelim(),e.entityList!==void 0&&Bu.encode(e.entityList,t.uint32(58).fork()).ldelim(),e.nextCursor!==void 0&&t.uint32(42).string(e.nextCursor),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=MN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Fr(r.uint64());continue;case 2:if(a!==18)break;i.data=ee.unwrap(ee.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.list=Ia.unwrap(Ia.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.error=r.string();continue;case 6:if(a!==50)break;i.entities=qo.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.entityList=Bu.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.nextCursor=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{opId:S(e.opId)?BigInt(e.opId):BigInt("0"),data:Nt(e.data)?e.data:void 0,list:globalThis.Array.isArray(e.list)?[...e.list]:void 0,error:S(e.error)?globalThis.String(e.error):void 0,entities:S(e.entities)?qo.fromJSON(e.entities):void 0,entityList:S(e.entityList)?Bu.fromJSON(e.entityList):void 0,nextCursor:S(e.nextCursor)?globalThis.String(e.nextCursor):void 0}},toJSON(e){let t={};return e.opId!==BigInt("0")&&(t.opId=e.opId.toString()),e.data!==void 0&&(t.data=e.data),e.list!==void 0&&(t.list=e.list),e.error!==void 0&&(t.error=e.error),e.entities!==void 0&&(t.entities=qo.toJSON(e.entities)),e.entityList!==void 0&&(t.entityList=Bu.toJSON(e.entityList)),e.nextCursor!==void 0&&(t.nextCursor=e.nextCursor),t},create(e){return ji.fromPartial(e??{})},fromPartial(e){let t=MN();return t.opId=e.opId??BigInt("0"),t.data=e.data??void 0,t.list=e.list??void 0,t.error=e.error??void 0,t.entities=e.entities!==void 0&&e.entities!==null?qo.fromPartial(e.entities):void 0,t.entityList=e.entityList!==void 0&&e.entityList!==null?Bu.fromPartial(e.entityList):void 0,t.nextCursor=e.nextCursor??void 0,t}};function UN(){return{entity:"",genBlockNumber:BigInt("0"),genBlockChain:"",genBlockTime:void 0,data:void 0}}o(UN,"createBaseEntity");var Ou={encode(e,t=b.default.Writer.create()){if(e.entity!==""&&t.uint32(10).string(e.entity),e.genBlockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.genBlockNumber)!==e.genBlockNumber)throw new globalThis.Error("value provided for field message.genBlockNumber of type uint64 too large");t.uint32(16).uint64(e.genBlockNumber.toString())}return e.genBlockChain!==""&&t.uint32(26).string(e.genBlockChain),e.genBlockTime!==void 0&&Ze.encode($n(e.genBlockTime),t.uint32(34).fork()).ldelim(),e.data!==void 0&&et.encode(e.data,t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=UN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=r.string();continue;case 2:if(a!==16)break;i.genBlockNumber=Fr(r.uint64());continue;case 3:if(a!==26)break;i.genBlockChain=r.string();continue;case 4:if(a!==34)break;i.genBlockTime=Ln(Ze.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.data=et.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:S(e.entity)?globalThis.String(e.entity):"",genBlockNumber:S(e.genBlockNumber)?BigInt(e.genBlockNumber):BigInt("0"),genBlockChain:S(e.genBlockChain)?globalThis.String(e.genBlockChain):"",genBlockTime:S(e.genBlockTime)?Yn(e.genBlockTime):void 0,data:S(e.data)?et.fromJSON(e.data):void 0}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.genBlockNumber!==BigInt("0")&&(t.genBlockNumber=e.genBlockNumber.toString()),e.genBlockChain!==""&&(t.genBlockChain=e.genBlockChain),e.genBlockTime!==void 0&&(t.genBlockTime=e.genBlockTime.toISOString()),e.data!==void 0&&(t.data=et.toJSON(e.data)),t},create(e){return Ou.fromPartial(e??{})},fromPartial(e){let t=UN();return t.entity=e.entity??"",t.genBlockNumber=e.genBlockNumber??BigInt("0"),t.genBlockChain=e.genBlockChain??"",t.genBlockTime=e.genBlockTime??void 0,t.data=e.data!==void 0&&e.data!==null?et.fromPartial(e.data):void 0,t}};function QN(){return{entities:[]}}o(QN,"createBaseEntityList");var Bu={encode(e,t=b.default.Writer.create()){for(let r of e.entities)Ou.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=QN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(Ou.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>Ou.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(r=>Ou.toJSON(r))),t},create(e){return Bu.fromPartial(e??{})},fromPartial(e){let t=QN();return t.entities=e.entities?.map(r=>Ou.fromPartial(r))||[],t}};function GN(){return{fields:{}}}o(GN,"createBaseEntityUpdateData");var Ru={encode(e,t=b.default.Writer.create()){return Object.entries(e.fields).forEach(([r,n])=>{I6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=GN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=I6.decode(r,r.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{fields:Nt(e.fields)?Object.entries(e.fields).reduce((t,[r,n])=>(t[r]=po.fromJSON(n),t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([n,i])=>{t.fields[n]=po.toJSON(i)}))}return t},create(e){return Ru.fromPartial(e??{})},fromPartial(e){let t=GN();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=po.fromPartial(i)),r),{}),t}};function qN(){return{value:void 0,op:0}}o(qN,"createBaseEntityUpdateData_FieldValue");var po={encode(e,t=b.default.Writer.create()){return e.value!==void 0&&zt.encode(e.value,t.uint32(10).fork()).ldelim(),e.op!==0&&t.uint32(16).int32(e.op),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=qN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=zt.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.op=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{value:S(e.value)?zt.fromJSON(e.value):void 0,op:S(e.op)?hq(e.op):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=zt.toJSON(e.value)),e.op!==0&&(t.op=gq(e.op)),t},create(e){return po.fromPartial(e??{})},fromPartial(e){let t=qN();return t.value=e.value!==void 0&&e.value!==null?zt.fromPartial(e.value):void 0,t.op=e.op??0,t}};function JN(){return{key:"",value:void 0}}o(JN,"createBaseEntityUpdateData_FieldsEntry");var I6={encode(e,t=b.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&po.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=JN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=po.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.String(e.key):"",value:S(e.value)?po.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=po.toJSON(e.value)),t},create(e){return I6.fromPartial(e??{})},fromPartial(e){let t=JN();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?po.fromPartial(e.value):void 0,t}};function zN(){return{templates:[]}}o(zN,"createBaseTPLRequest");var xu={encode(e,t=b.default.Writer.create()){for(let r of e.templates)Xt.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=zN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.templates.push(Xt.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{templates:globalThis.Array.isArray(e?.templates)?e.templates.map(t=>Xt.fromJSON(t)):[]}},toJSON(e){let t={};return e.templates?.length&&(t.templates=e.templates.map(r=>Xt.toJSON(r))),t},create(e){return xu.fromPartial(e??{})},fromPartial(e){let t=zN();return t.templates=e.templates?.map(r=>Xt.fromPartial(r))||[],t}};function WN(){return{data:[]}}o(WN,"createBaseTSRequest");var ku={encode(e,t=b.default.Writer.create()){for(let r of e.data)ea.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=WN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.data.push(ea.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{data:globalThis.Array.isArray(e?.data)?e.data.map(t=>ea.fromJSON(t)):[]}},toJSON(e){let t={};return e.data?.length&&(t.data=e.data.map(r=>ea.toJSON(r))),t},create(e){return ku.fromPartial(e??{})},fromPartial(e){let t=WN();return t.data=e.data?.map(r=>ea.fromPartial(r))||[],t}};function HN(){return{opId:BigInt("0"),get:void 0,upsert:void 0,update:void 0,delete:void 0,list:void 0}}o(HN,"createBaseDBRequest");var An={encode(e,t=b.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");t.uint32(8).uint64(e.opId.toString())}return e.get!==void 0&&Du.encode(e.get,t.uint32(18).fork()).ldelim(),e.upsert!==void 0&&Lu.encode(e.upsert,t.uint32(26).fork()).ldelim(),e.update!==void 0&&Fu.encode(e.update,t.uint32(50).fork()).ldelim(),e.delete!==void 0&&Vu.encode(e.delete,t.uint32(34).fork()).ldelim(),e.list!==void 0&&Pu.encode(e.list,t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=HN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Fr(r.uint64());continue;case 2:if(a!==18)break;i.get=Du.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.upsert=Lu.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.update=Fu.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.delete=Vu.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.list=Pu.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{opId:S(e.opId)?BigInt(e.opId):BigInt("0"),get:S(e.get)?Du.fromJSON(e.get):void 0,upsert:S(e.upsert)?Lu.fromJSON(e.upsert):void 0,update:S(e.update)?Fu.fromJSON(e.update):void 0,delete:S(e.delete)?Vu.fromJSON(e.delete):void 0,list:S(e.list)?Pu.fromJSON(e.list):void 0}},toJSON(e){let t={};return e.opId!==BigInt("0")&&(t.opId=e.opId.toString()),e.get!==void 0&&(t.get=Du.toJSON(e.get)),e.upsert!==void 0&&(t.upsert=Lu.toJSON(e.upsert)),e.update!==void 0&&(t.update=Fu.toJSON(e.update)),e.delete!==void 0&&(t.delete=Vu.toJSON(e.delete)),e.list!==void 0&&(t.list=Pu.toJSON(e.list)),t},create(e){return An.fromPartial(e??{})},fromPartial(e){let t=HN();return t.opId=e.opId??BigInt("0"),t.get=e.get!==void 0&&e.get!==null?Du.fromPartial(e.get):void 0,t.upsert=e.upsert!==void 0&&e.upsert!==null?Lu.fromPartial(e.upsert):void 0,t.update=e.update!==void 0&&e.update!==null?Fu.fromPartial(e.update):void 0,t.delete=e.delete!==void 0&&e.delete!==null?Vu.fromPartial(e.delete):void 0,t.list=e.list!==void 0&&e.list!==null?Pu.fromPartial(e.list):void 0,t}};function XN(){return{entity:"",id:""}}o(XN,"createBaseDBRequest_DBGet");var Du={encode(e,t=b.default.Writer.create()){return e.entity!==""&&t.uint32(10).string(e.entity),e.id!==""&&t.uint32(18).string(e.id),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=XN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=r.string();continue;case 2:if(a!==18)break;i.id=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:S(e.entity)?globalThis.String(e.entity):"",id:S(e.id)?globalThis.String(e.id):""}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.id!==""&&(t.id=e.id),t},create(e){return Du.fromPartial(e??{})},fromPartial(e){let t=XN();return t.entity=e.entity??"",t.id=e.id??"",t}};function ZN(){return{entity:"",filters:[],cursor:"",pageSize:void 0}}o(ZN,"createBaseDBRequest_DBList");var Pu={encode(e,t=b.default.Writer.create()){e.entity!==""&&t.uint32(10).string(e.entity);for(let r of e.filters)Mu.encode(r,t.uint32(34).fork()).ldelim();return e.cursor!==""&&t.uint32(42).string(e.cursor),e.pageSize!==void 0&&t.uint32(48).uint32(e.pageSize),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ZN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=r.string();continue;case 4:if(a!==34)break;i.filters.push(Mu.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.cursor=r.string();continue;case 6:if(a!==48)break;i.pageSize=r.uint32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:S(e.entity)?globalThis.String(e.entity):"",filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Mu.fromJSON(t)):[],cursor:S(e.cursor)?globalThis.String(e.cursor):"",pageSize:S(e.pageSize)?globalThis.Number(e.pageSize):void 0}},toJSON(e){let t={};return e.entity!==""&&(t.entity=e.entity),e.filters?.length&&(t.filters=e.filters.map(r=>Mu.toJSON(r))),e.cursor!==""&&(t.cursor=e.cursor),e.pageSize!==void 0&&(t.pageSize=Math.round(e.pageSize)),t},create(e){return Pu.fromPartial(e??{})},fromPartial(e){let t=ZN();return t.entity=e.entity??"",t.filters=e.filters?.map(r=>Mu.fromPartial(r))||[],t.cursor=e.cursor??"",t.pageSize=e.pageSize??void 0,t}};function KN(){return{entity:[],id:[],data:[],entityData:[]}}o(KN,"createBaseDBRequest_DBUpsert");var Lu={encode(e,t=b.default.Writer.create()){for(let r of e.entity)t.uint32(10).string(r);for(let r of e.id)t.uint32(18).string(r);for(let r of e.data)ee.encode(ee.wrap(r),t.uint32(26).fork()).ldelim();for(let r of e.entityData)et.encode(r,t.uint32(34).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=KN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(r.string());continue;case 2:if(a!==18)break;i.id.push(r.string());continue;case 3:if(a!==26)break;i.data.push(ee.unwrap(ee.decode(r,r.uint32())));continue;case 4:if(a!==34)break;i.entityData.push(et.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[],data:globalThis.Array.isArray(e?.data)?[...e.data]:[],entityData:globalThis.Array.isArray(e?.entityData)?e.entityData.map(t=>et.fromJSON(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),e.data?.length&&(t.data=e.data),e.entityData?.length&&(t.entityData=e.entityData.map(r=>et.toJSON(r))),t},create(e){return Lu.fromPartial(e??{})},fromPartial(e){let t=KN();return t.entity=e.entity?.map(r=>r)||[],t.id=e.id?.map(r=>r)||[],t.data=e.data?.map(r=>r)||[],t.entityData=e.entityData?.map(r=>et.fromPartial(r))||[],t}};function $N(){return{entity:[],id:[],entityData:[]}}o($N,"createBaseDBRequest_DBUpdate");var Fu={encode(e,t=b.default.Writer.create()){for(let r of e.entity)t.uint32(10).string(r);for(let r of e.id)t.uint32(18).string(r);for(let r of e.entityData)Ru.encode(r,t.uint32(26).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=$N();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(r.string());continue;case 2:if(a!==18)break;i.id.push(r.string());continue;case 3:if(a!==26)break;i.entityData.push(Ru.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[],entityData:globalThis.Array.isArray(e?.entityData)?e.entityData.map(t=>Ru.fromJSON(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),e.entityData?.length&&(t.entityData=e.entityData.map(r=>Ru.toJSON(r))),t},create(e){return Fu.fromPartial(e??{})},fromPartial(e){let t=$N();return t.entity=e.entity?.map(r=>r)||[],t.id=e.id?.map(r=>r)||[],t.entityData=e.entityData?.map(r=>Ru.fromPartial(r))||[],t}};function YN(){return{entity:[],id:[]}}o(YN,"createBaseDBRequest_DBDelete");var Vu={encode(e,t=b.default.Writer.create()){for(let r of e.entity)t.uint32(10).string(r);for(let r of e.id)t.uint32(18).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=YN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(r.string());continue;case 2:if(a!==18)break;i.id.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(t=>globalThis.String(t)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.entity?.length&&(t.entity=e.entity),e.id?.length&&(t.id=e.id),t},create(e){return Vu.fromPartial(e??{})},fromPartial(e){let t=YN();return t.entity=e.entity?.map(r=>r)||[],t.id=e.id?.map(r=>r)||[],t}};function jN(){return{field:"",op:0,value:void 0}}o(jN,"createBaseDBRequest_DBFilter");var Mu={encode(e,t=b.default.Writer.create()){return e.field!==""&&t.uint32(10).string(e.field),e.op!==0&&t.uint32(16).int32(e.op),e.value!==void 0&&Kn.encode(e.value,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=jN();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.field=r.string();continue;case 2:if(a!==16)break;i.op=r.int32();continue;case 3:if(a!==26)break;i.value=Kn.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{field:S(e.field)?globalThis.String(e.field):"",op:S(e.op)?_q(e.op):0,value:S(e.value)?Kn.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.field!==""&&(t.field=e.field),e.op!==0&&(t.op=Aq(e.op)),e.value!==void 0&&(t.value=Kn.toJSON(e.value)),t},create(e){return Mu.fromPartial(e??{})},fromPartial(e){let t=jN();return t.field=e.field??"",t.op=e.op??0,t.value=e.value!==void 0&&e.value!==null?Kn.fromPartial(e.value):void 0,t}};function eS(){return{ethLog:void 0,ethBlock:void 0,ethTransaction:void 0,ethTrace:void 0,solInstruction:void 0,aptEvent:void 0,aptCall:void 0,aptResource:void 0,suiEvent:void 0,suiCall:void 0,suiObject:void 0,suiObjectChange:void 0,fuelLog:void 0,fuelTransaction:void 0,fuelBlock:void 0,cosmosCall:void 0,starknetEvents:void 0}}o(eS,"createBaseData");var Uu={encode(e,t=b.default.Writer.create()){return e.ethLog!==void 0&&Qu.encode(e.ethLog,t.uint32(18).fork()).ldelim(),e.ethBlock!==void 0&&Gu.encode(e.ethBlock,t.uint32(26).fork()).ldelim(),e.ethTransaction!==void 0&&qu.encode(e.ethTransaction,t.uint32(34).fork()).ldelim(),e.ethTrace!==void 0&&Ju.encode(e.ethTrace,t.uint32(42).fork()).ldelim(),e.solInstruction!==void 0&&zu.encode(e.solInstruction,t.uint32(50).fork()).ldelim(),e.aptEvent!==void 0&&Wu.encode(e.aptEvent,t.uint32(58).fork()).ldelim(),e.aptCall!==void 0&&Hu.encode(e.aptCall,t.uint32(66).fork()).ldelim(),e.aptResource!==void 0&&Xu.encode(e.aptResource,t.uint32(74).fork()).ldelim(),e.suiEvent!==void 0&&Zu.encode(e.suiEvent,t.uint32(82).fork()).ldelim(),e.suiCall!==void 0&&Ku.encode(e.suiCall,t.uint32(90).fork()).ldelim(),e.suiObject!==void 0&&$u.encode(e.suiObject,t.uint32(98).fork()).ldelim(),e.suiObjectChange!==void 0&&Yu.encode(e.suiObjectChange,t.uint32(106).fork()).ldelim(),e.fuelLog!==void 0&&ju.encode(e.fuelLog,t.uint32(162).fork()).ldelim(),e.fuelTransaction!==void 0&&ec.encode(e.fuelTransaction,t.uint32(170).fork()).ldelim(),e.fuelBlock!==void 0&&tc.encode(e.fuelBlock,t.uint32(146).fork()).ldelim(),e.cosmosCall!==void 0&&rc.encode(e.cosmosCall,t.uint32(122).fork()).ldelim(),e.starknetEvents!==void 0&&nc.encode(e.starknetEvents,t.uint32(130).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=eS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.ethLog=Qu.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.ethBlock=Gu.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.ethTransaction=qu.decode(r,r.uint32());continue;case 5:if(a!==42)break;i.ethTrace=Ju.decode(r,r.uint32());continue;case 6:if(a!==50)break;i.solInstruction=zu.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.aptEvent=Wu.decode(r,r.uint32());continue;case 8:if(a!==66)break;i.aptCall=Hu.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.aptResource=Xu.decode(r,r.uint32());continue;case 10:if(a!==82)break;i.suiEvent=Zu.decode(r,r.uint32());continue;case 11:if(a!==90)break;i.suiCall=Ku.decode(r,r.uint32());continue;case 12:if(a!==98)break;i.suiObject=$u.decode(r,r.uint32());continue;case 13:if(a!==106)break;i.suiObjectChange=Yu.decode(r,r.uint32());continue;case 20:if(a!==162)break;i.fuelLog=ju.decode(r,r.uint32());continue;case 21:if(a!==170)break;i.fuelTransaction=ec.decode(r,r.uint32());continue;case 18:if(a!==146)break;i.fuelBlock=tc.decode(r,r.uint32());continue;case 15:if(a!==122)break;i.cosmosCall=rc.decode(r,r.uint32());continue;case 16:if(a!==130)break;i.starknetEvents=nc.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{ethLog:S(e.ethLog)?Qu.fromJSON(e.ethLog):void 0,ethBlock:S(e.ethBlock)?Gu.fromJSON(e.ethBlock):void 0,ethTransaction:S(e.ethTransaction)?qu.fromJSON(e.ethTransaction):void 0,ethTrace:S(e.ethTrace)?Ju.fromJSON(e.ethTrace):void 0,solInstruction:S(e.solInstruction)?zu.fromJSON(e.solInstruction):void 0,aptEvent:S(e.aptEvent)?Wu.fromJSON(e.aptEvent):void 0,aptCall:S(e.aptCall)?Hu.fromJSON(e.aptCall):void 0,aptResource:S(e.aptResource)?Xu.fromJSON(e.aptResource):void 0,suiEvent:S(e.suiEvent)?Zu.fromJSON(e.suiEvent):void 0,suiCall:S(e.suiCall)?Ku.fromJSON(e.suiCall):void 0,suiObject:S(e.suiObject)?$u.fromJSON(e.suiObject):void 0,suiObjectChange:S(e.suiObjectChange)?Yu.fromJSON(e.suiObjectChange):void 0,fuelLog:S(e.fuelLog)?ju.fromJSON(e.fuelLog):void 0,fuelTransaction:S(e.fuelTransaction)?ec.fromJSON(e.fuelTransaction):void 0,fuelBlock:S(e.fuelBlock)?tc.fromJSON(e.fuelBlock):void 0,cosmosCall:S(e.cosmosCall)?rc.fromJSON(e.cosmosCall):void 0,starknetEvents:S(e.starknetEvents)?nc.fromJSON(e.starknetEvents):void 0}},toJSON(e){let t={};return e.ethLog!==void 0&&(t.ethLog=Qu.toJSON(e.ethLog)),e.ethBlock!==void 0&&(t.ethBlock=Gu.toJSON(e.ethBlock)),e.ethTransaction!==void 0&&(t.ethTransaction=qu.toJSON(e.ethTransaction)),e.ethTrace!==void 0&&(t.ethTrace=Ju.toJSON(e.ethTrace)),e.solInstruction!==void 0&&(t.solInstruction=zu.toJSON(e.solInstruction)),e.aptEvent!==void 0&&(t.aptEvent=Wu.toJSON(e.aptEvent)),e.aptCall!==void 0&&(t.aptCall=Hu.toJSON(e.aptCall)),e.aptResource!==void 0&&(t.aptResource=Xu.toJSON(e.aptResource)),e.suiEvent!==void 0&&(t.suiEvent=Zu.toJSON(e.suiEvent)),e.suiCall!==void 0&&(t.suiCall=Ku.toJSON(e.suiCall)),e.suiObject!==void 0&&(t.suiObject=$u.toJSON(e.suiObject)),e.suiObjectChange!==void 0&&(t.suiObjectChange=Yu.toJSON(e.suiObjectChange)),e.fuelLog!==void 0&&(t.fuelLog=ju.toJSON(e.fuelLog)),e.fuelTransaction!==void 0&&(t.fuelTransaction=ec.toJSON(e.fuelTransaction)),e.fuelBlock!==void 0&&(t.fuelBlock=tc.toJSON(e.fuelBlock)),e.cosmosCall!==void 0&&(t.cosmosCall=rc.toJSON(e.cosmosCall)),e.starknetEvents!==void 0&&(t.starknetEvents=nc.toJSON(e.starknetEvents)),t},create(e){return Uu.fromPartial(e??{})},fromPartial(e){let t=eS();return t.ethLog=e.ethLog!==void 0&&e.ethLog!==null?Qu.fromPartial(e.ethLog):void 0,t.ethBlock=e.ethBlock!==void 0&&e.ethBlock!==null?Gu.fromPartial(e.ethBlock):void 0,t.ethTransaction=e.ethTransaction!==void 0&&e.ethTransaction!==null?qu.fromPartial(e.ethTransaction):void 0,t.ethTrace=e.ethTrace!==void 0&&e.ethTrace!==null?Ju.fromPartial(e.ethTrace):void 0,t.solInstruction=e.solInstruction!==void 0&&e.solInstruction!==null?zu.fromPartial(e.solInstruction):void 0,t.aptEvent=e.aptEvent!==void 0&&e.aptEvent!==null?Wu.fromPartial(e.aptEvent):void 0,t.aptCall=e.aptCall!==void 0&&e.aptCall!==null?Hu.fromPartial(e.aptCall):void 0,t.aptResource=e.aptResource!==void 0&&e.aptResource!==null?Xu.fromPartial(e.aptResource):void 0,t.suiEvent=e.suiEvent!==void 0&&e.suiEvent!==null?Zu.fromPartial(e.suiEvent):void 0,t.suiCall=e.suiCall!==void 0&&e.suiCall!==null?Ku.fromPartial(e.suiCall):void 0,t.suiObject=e.suiObject!==void 0&&e.suiObject!==null?$u.fromPartial(e.suiObject):void 0,t.suiObjectChange=e.suiObjectChange!==void 0&&e.suiObjectChange!==null?Yu.fromPartial(e.suiObjectChange):void 0,t.fuelLog=e.fuelLog!==void 0&&e.fuelLog!==null?ju.fromPartial(e.fuelLog):void 0,t.fuelTransaction=e.fuelTransaction!==void 0&&e.fuelTransaction!==null?ec.fromPartial(e.fuelTransaction):void 0,t.fuelBlock=e.fuelBlock!==void 0&&e.fuelBlock!==null?tc.fromPartial(e.fuelBlock):void 0,t.cosmosCall=e.cosmosCall!==void 0&&e.cosmosCall!==null?rc.fromPartial(e.cosmosCall):void 0,t.starknetEvents=e.starknetEvents!==void 0&&e.starknetEvents!==null?nc.fromPartial(e.starknetEvents):void 0,t}};function tS(){return{log:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0,rawLog:"",rawTransaction:void 0,rawTransactionReceipt:void 0,rawBlock:void 0}}o(tS,"createBaseData_EthLog");var Qu={encode(e,t=b.default.Writer.create()){return e.log!==void 0&&ee.encode(ee.wrap(e.log),t.uint32(26).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(34).fork()).ldelim(),e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&ee.encode(ee.wrap(e.transactionReceipt),t.uint32(42).fork()).ldelim(),e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(50).fork()).ldelim(),e.rawLog!==""&&t.uint32(58).string(e.rawLog),e.rawTransaction!==void 0&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=tS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 3:if(a!==26)break;i.log=ee.unwrap(ee.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.transactionReceipt=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.rawLog=r.string();continue;case 8:if(a!==66)break;i.rawTransaction=r.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=r.string();continue;case 10:if(a!==82)break;i.rawBlock=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{log:Nt(e.log)?e.log:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,transaction:Nt(e.transaction)?e.transaction:void 0,transactionReceipt:Nt(e.transactionReceipt)?e.transactionReceipt:void 0,block:Nt(e.block)?e.block:void 0,rawLog:S(e.rawLog)?globalThis.String(e.rawLog):"",rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):void 0,rawTransactionReceipt:S(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):void 0}},toJSON(e){let t={};return e.log!==void 0&&(t.log=e.log),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(t.transaction=e.transaction),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.rawLog!==""&&(t.rawLog=e.rawLog),e.rawTransaction!==void 0&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),t},create(e){return Qu.fromPartial(e??{})},fromPartial(e){let t=tS();return t.log=e.log??void 0,t.timestamp=e.timestamp??void 0,t.transaction=e.transaction??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.rawLog=e.rawLog??"",t.rawTransaction=e.rawTransaction??void 0,t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t}};function rS(){return{block:void 0,rawBlock:""}}o(rS,"createBaseData_EthBlock");var Gu={encode(e,t=b.default.Writer.create()){return e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(18).fork()).ldelim(),e.rawBlock!==""&&t.uint32(10).string(e.rawBlock),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=rS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==18)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 1:if(a!==10)break;i.rawBlock=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{block:Nt(e.block)?e.block:void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):""}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.rawBlock!==""&&(t.rawBlock=e.rawBlock),t},create(e){return Gu.fromPartial(e??{})},fromPartial(e){let t=rS();return t.block=e.block??void 0,t.rawBlock=e.rawBlock??"",t}};function nS(){return{transaction:void 0,timestamp:void 0,transactionReceipt:void 0,block:void 0,trace:void 0,rawTransaction:"",rawTransactionReceipt:void 0,rawBlock:void 0,rawTrace:void 0}}o(nS,"createBaseData_EthTransaction");var qu={encode(e,t=b.default.Writer.create()){return e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(42).fork()).ldelim(),e.transactionReceipt!==void 0&&ee.encode(ee.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(50).fork()).ldelim(),e.trace!==void 0&&ee.encode(ee.wrap(e.trace),t.uint32(58).fork()).ldelim(),e.rawTransaction!==""&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),e.rawTrace!==void 0&&t.uint32(90).string(e.rawTrace),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=nS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.trace=ee.unwrap(ee.decode(r,r.uint32()));continue;case 8:if(a!==66)break;i.rawTransaction=r.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=r.string();continue;case 10:if(a!==82)break;i.rawBlock=r.string();continue;case 11:if(a!==90)break;i.rawTrace=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,transactionReceipt:Nt(e.transactionReceipt)?e.transactionReceipt:void 0,block:Nt(e.block)?e.block:void 0,trace:Nt(e.trace)?e.trace:void 0,rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):"",rawTransactionReceipt:S(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):void 0,rawTrace:S(e.rawTrace)?globalThis.String(e.rawTrace):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.trace!==void 0&&(t.trace=e.trace),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),e.rawTrace!==void 0&&(t.rawTrace=e.rawTrace),t},create(e){return qu.fromPartial(e??{})},fromPartial(e){let t=nS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.trace=e.trace??void 0,t.rawTransaction=e.rawTransaction??"",t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t.rawTrace=e.rawTrace??void 0,t}};function iS(){return{trace:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0,rawTrace:"",rawTransaction:void 0,rawTransactionReceipt:void 0,rawBlock:void 0}}o(iS,"createBaseData_EthTrace");var Ju={encode(e,t=b.default.Writer.create()){return e.trace!==void 0&&ee.encode(ee.wrap(e.trace),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(42).fork()).ldelim(),e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&ee.encode(ee.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(50).fork()).ldelim(),e.rawTrace!==""&&t.uint32(58).string(e.rawTrace),e.rawTransaction!==void 0&&t.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&t.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&t.uint32(82).string(e.rawBlock),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=iS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.trace=ee.unwrap(ee.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=ee.unwrap(ee.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.rawTrace=r.string();continue;case 8:if(a!==66)break;i.rawTransaction=r.string();continue;case 9:if(a!==74)break;i.rawTransactionReceipt=r.string();continue;case 10:if(a!==82)break;i.rawBlock=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{trace:Nt(e.trace)?e.trace:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,transaction:Nt(e.transaction)?e.transaction:void 0,transactionReceipt:Nt(e.transactionReceipt)?e.transactionReceipt:void 0,block:Nt(e.block)?e.block:void 0,rawTrace:S(e.rawTrace)?globalThis.String(e.rawTrace):"",rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):void 0,rawTransactionReceipt:S(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:S(e.rawBlock)?globalThis.String(e.rawBlock):void 0}},toJSON(e){let t={};return e.trace!==void 0&&(t.trace=e.trace),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(t.transaction=e.transaction),e.transactionReceipt!==void 0&&(t.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(t.block=e.block),e.rawTrace!==""&&(t.rawTrace=e.rawTrace),e.rawTransaction!==void 0&&(t.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(t.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(t.rawBlock=e.rawBlock),t},create(e){return Ju.fromPartial(e??{})},fromPartial(e){let t=iS();return t.trace=e.trace??void 0,t.timestamp=e.timestamp??void 0,t.transaction=e.transaction??void 0,t.transactionReceipt=e.transactionReceipt??void 0,t.block=e.block??void 0,t.rawTrace=e.rawTrace??"",t.rawTransaction=e.rawTransaction??void 0,t.rawTransactionReceipt=e.rawTransactionReceipt??void 0,t.rawBlock=e.rawBlock??void 0,t}};function aS(){return{instructionData:"",slot:BigInt("0"),programAccountId:"",accounts:[],parsed:void 0,rawParsed:void 0}}o(aS,"createBaseData_SolInstruction");var zu={encode(e,t=b.default.Writer.create()){if(e.instructionData!==""&&t.uint32(10).string(e.instructionData),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(16).uint64(e.slot.toString())}e.programAccountId!==""&&t.uint32(26).string(e.programAccountId);for(let r of e.accounts)t.uint32(42).string(r);return e.parsed!==void 0&&ee.encode(ee.wrap(e.parsed),t.uint32(34).fork()).ldelim(),e.rawParsed!==void 0&&t.uint32(58).string(e.rawParsed),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=aS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.instructionData=r.string();continue;case 2:if(a!==16)break;i.slot=Fr(r.uint64());continue;case 3:if(a!==26)break;i.programAccountId=r.string();continue;case 5:if(a!==42)break;i.accounts.push(r.string());continue;case 4:if(a!==34)break;i.parsed=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==58)break;i.rawParsed=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{instructionData:S(e.instructionData)?globalThis.String(e.instructionData):"",slot:S(e.slot)?BigInt(e.slot):BigInt("0"),programAccountId:S(e.programAccountId)?globalThis.String(e.programAccountId):"",accounts:globalThis.Array.isArray(e?.accounts)?e.accounts.map(t=>globalThis.String(t)):[],parsed:Nt(e.parsed)?e.parsed:void 0,rawParsed:S(e.rawParsed)?globalThis.String(e.rawParsed):void 0}},toJSON(e){let t={};return e.instructionData!==""&&(t.instructionData=e.instructionData),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),e.programAccountId!==""&&(t.programAccountId=e.programAccountId),e.accounts?.length&&(t.accounts=e.accounts),e.parsed!==void 0&&(t.parsed=e.parsed),e.rawParsed!==void 0&&(t.rawParsed=e.rawParsed),t},create(e){return zu.fromPartial(e??{})},fromPartial(e){let t=aS();return t.instructionData=e.instructionData??"",t.slot=e.slot??BigInt("0"),t.programAccountId=e.programAccountId??"",t.accounts=e.accounts?.map(r=>r)||[],t.parsed=e.parsed??void 0,t.rawParsed=e.rawParsed??void 0,t}};function oS(){return{rawEvent:"",eventIndex:0,rawTransaction:""}}o(oS,"createBaseData_AptEvent");var Wu={encode(e,t=b.default.Writer.create()){return e.rawEvent!==""&&t.uint32(10).string(e.rawEvent),e.eventIndex!==0&&t.uint32(32).int32(e.eventIndex),e.rawTransaction!==""&&t.uint32(26).string(e.rawTransaction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=oS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.rawEvent=r.string();continue;case 4:if(a!==32)break;i.eventIndex=r.int32();continue;case 3:if(a!==26)break;i.rawTransaction=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawEvent:S(e.rawEvent)?globalThis.String(e.rawEvent):"",eventIndex:S(e.eventIndex)?globalThis.Number(e.eventIndex):0,rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let t={};return e.rawEvent!==""&&(t.rawEvent=e.rawEvent),e.eventIndex!==0&&(t.eventIndex=Math.round(e.eventIndex)),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),t},create(e){return Wu.fromPartial(e??{})},fromPartial(e){let t=oS();return t.rawEvent=e.rawEvent??"",t.eventIndex=e.eventIndex??0,t.rawTransaction=e.rawTransaction??"",t}};function sS(){return{rawTransaction:""}}o(sS,"createBaseData_AptCall");var Hu={encode(e,t=b.default.Writer.create()){return e.rawTransaction!==""&&t.uint32(26).string(e.rawTransaction),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=sS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 3:if(a!==26)break;i.rawTransaction=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let t={};return e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),t},create(e){return Hu.fromPartial(e??{})},fromPartial(e){let t=sS();return t.rawTransaction=e.rawTransaction??"",t}};function dS(){return{version:BigInt("0"),timestampMicros:BigInt("0"),rawResources:[]}}o(dS,"createBaseData_AptResource");var Xu={encode(e,t=b.default.Writer.create()){if(e.version!==BigInt("0")){if(BigInt.asIntN(64,e.version)!==e.version)throw new globalThis.Error("value provided for field message.version of type int64 too large");t.uint32(16).int64(e.version.toString())}if(e.timestampMicros!==BigInt("0")){if(BigInt.asIntN(64,e.timestampMicros)!==e.timestampMicros)throw new globalThis.Error("value provided for field message.timestampMicros of type int64 too large");t.uint32(40).int64(e.timestampMicros.toString())}for(let r of e.rawResources)t.uint32(50).string(r);return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=dS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 2:if(a!==16)break;i.version=Fr(r.int64());continue;case 5:if(a!==40)break;i.timestampMicros=Fr(r.int64());continue;case 6:if(a!==50)break;i.rawResources.push(r.string());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{version:S(e.version)?BigInt(e.version):BigInt("0"),timestampMicros:S(e.timestampMicros)?BigInt(e.timestampMicros):BigInt("0"),rawResources:globalThis.Array.isArray(e?.rawResources)?e.rawResources.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.version!==BigInt("0")&&(t.version=e.version.toString()),e.timestampMicros!==BigInt("0")&&(t.timestampMicros=e.timestampMicros.toString()),e.rawResources?.length&&(t.rawResources=e.rawResources),t},create(e){return Xu.fromPartial(e??{})},fromPartial(e){let t=dS();return t.version=e.version??BigInt("0"),t.timestampMicros=e.timestampMicros??BigInt("0"),t.rawResources=e.rawResources?.map(r=>r)||[],t}};function uS(){return{rawEvent:"",rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}o(uS,"createBaseData_SuiEvent");var Zu={encode(e,t=b.default.Writer.create()){if(e.rawEvent!==""&&t.uint32(34).string(e.rawEvent),e.rawTransaction!==""&&t.uint32(42).string(e.rawTransaction),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=uS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.rawEvent=r.string();continue;case 5:if(a!==42)break;i.rawTransaction=r.string();continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawEvent:S(e.rawEvent)?globalThis.String(e.rawEvent):"",rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawEvent!==""&&(t.rawEvent=e.rawEvent),e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Zu.fromPartial(e??{})},fromPartial(e){let t=uS();return t.rawEvent=e.rawEvent??"",t.rawTransaction=e.rawTransaction??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function cS(){return{rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}o(cS,"createBaseData_SuiCall");var Ku={encode(e,t=b.default.Writer.create()){if(e.rawTransaction!==""&&t.uint32(34).string(e.rawTransaction),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=cS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 4:if(a!==34)break;i.rawTransaction=r.string();continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawTransaction:S(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawTransaction!==""&&(t.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Ku.fromPartial(e??{})},fromPartial(e){let t=cS();return t.rawTransaction=e.rawTransaction??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function pS(){return{rawObjects:[],rawSelf:void 0,objectId:"",objectVersion:BigInt("0"),objectDigest:"",timestamp:void 0,slot:BigInt("0")}}o(pS,"createBaseData_SuiObject");var $u={encode(e,t=b.default.Writer.create()){for(let r of e.rawObjects)t.uint32(82).string(r);if(e.rawSelf!==void 0&&t.uint32(74).string(e.rawSelf),e.objectId!==""&&t.uint32(42).string(e.objectId),e.objectVersion!==BigInt("0")){if(BigInt.asUintN(64,e.objectVersion)!==e.objectVersion)throw new globalThis.Error("value provided for field message.objectVersion of type uint64 too large");t.uint32(48).uint64(e.objectVersion.toString())}if(e.objectDigest!==""&&t.uint32(58).string(e.objectDigest),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=pS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 10:if(a!==82)break;i.rawObjects.push(r.string());continue;case 9:if(a!==74)break;i.rawSelf=r.string();continue;case 5:if(a!==42)break;i.objectId=r.string();continue;case 6:if(a!==48)break;i.objectVersion=Fr(r.uint64());continue;case 7:if(a!==58)break;i.objectDigest=r.string();continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawObjects:globalThis.Array.isArray(e?.rawObjects)?e.rawObjects.map(t=>globalThis.String(t)):[],rawSelf:S(e.rawSelf)?globalThis.String(e.rawSelf):void 0,objectId:S(e.objectId)?globalThis.String(e.objectId):"",objectVersion:S(e.objectVersion)?BigInt(e.objectVersion):BigInt("0"),objectDigest:S(e.objectDigest)?globalThis.String(e.objectDigest):"",timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawObjects?.length&&(t.rawObjects=e.rawObjects),e.rawSelf!==void 0&&(t.rawSelf=e.rawSelf),e.objectId!==""&&(t.objectId=e.objectId),e.objectVersion!==BigInt("0")&&(t.objectVersion=e.objectVersion.toString()),e.objectDigest!==""&&(t.objectDigest=e.objectDigest),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return $u.fromPartial(e??{})},fromPartial(e){let t=pS();return t.rawObjects=e.rawObjects?.map(r=>r)||[],t.rawSelf=e.rawSelf??void 0,t.objectId=e.objectId??"",t.objectVersion=e.objectVersion??BigInt("0"),t.objectDigest=e.objectDigest??"",t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function lS(){return{rawChanges:[],timestamp:void 0,txDigest:"",slot:BigInt("0")}}o(lS,"createBaseData_SuiObjectChange");var Yu={encode(e,t=b.default.Writer.create()){for(let r of e.rawChanges)t.uint32(42).string(r);if(e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.txDigest!==""&&t.uint32(34).string(e.txDigest),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");t.uint32(24).uint64(e.slot.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=lS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 5:if(a!==42)break;i.rawChanges.push(r.string());continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.txDigest=r.string();continue;case 3:if(a!==24)break;i.slot=Fr(r.uint64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{rawChanges:globalThis.Array.isArray(e?.rawChanges)?e.rawChanges.map(t=>globalThis.String(t)):[],timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,txDigest:S(e.txDigest)?globalThis.String(e.txDigest):"",slot:S(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.rawChanges?.length&&(t.rawChanges=e.rawChanges),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.txDigest!==""&&(t.txDigest=e.txDigest),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Yu.fromPartial(e??{})},fromPartial(e){let t=lS();return t.rawChanges=e.rawChanges?.map(r=>r)||[],t.timestamp=e.timestamp??void 0,t.txDigest=e.txDigest??"",t.slot=e.slot??BigInt("0"),t}};function fS(){return{transaction:void 0,timestamp:void 0,receiptIndex:BigInt("0")}}o(fS,"createBaseData_FuelReceipt");var ju={encode(e,t=b.default.Writer.create()){if(e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),e.receiptIndex!==BigInt("0")){if(BigInt.asIntN(64,e.receiptIndex)!==e.receiptIndex)throw new globalThis.Error("value provided for field message.receiptIndex of type int64 too large");t.uint32(24).int64(e.receiptIndex.toString())}return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=fS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue;case 3:if(a!==24)break;i.receiptIndex=Fr(r.int64());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0,receiptIndex:S(e.receiptIndex)?BigInt(e.receiptIndex):BigInt("0")}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.receiptIndex!==BigInt("0")&&(t.receiptIndex=e.receiptIndex.toString()),t},create(e){return ju.fromPartial(e??{})},fromPartial(e){let t=fS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.receiptIndex=e.receiptIndex??BigInt("0"),t}};function mS(){return{transaction:void 0,timestamp:void 0}}o(mS,"createBaseData_FuelTransaction");var ec={encode(e,t=b.default.Writer.create()){return e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=mS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return ec.fromPartial(e??{})},fromPartial(e){let t=mS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function hS(){return{block:void 0,timestamp:void 0}}o(hS,"createBaseData_FuelBlock");var tc={encode(e,t=b.default.Writer.create()){return e.block!==void 0&&ee.encode(ee.wrap(e.block),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=hS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.block=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{block:Nt(e.block)?e.block:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return tc.fromPartial(e??{})},fromPartial(e){let t=hS();return t.block=e.block??void 0,t.timestamp=e.timestamp??void 0,t}};function gS(){return{transaction:void 0,timestamp:void 0}}o(gS,"createBaseData_CosmosCall");var rc={encode(e,t=b.default.Writer.create()){return e.transaction!==void 0&&ee.encode(ee.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=gS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{transaction:Nt(e.transaction)?e.transaction:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return rc.fromPartial(e??{})},fromPartial(e){let t=gS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function _S(){return{result:void 0,timestamp:void 0}}o(_S,"createBaseData_StarknetEvent");var nc={encode(e,t=b.default.Writer.create()){return e.result!==void 0&&ee.encode(ee.wrap(e.result),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Ze.encode($n(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=_S();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=ee.unwrap(ee.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Ln(Ze.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{result:Nt(e.result)?e.result:void 0,timestamp:S(e.timestamp)?Yn(e.timestamp):void 0}},toJSON(e){let t={};return e.result!==void 0&&(t.result=e.result),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},create(e){return nc.fromPartial(e??{})},fromPartial(e){let t=_S();return t.result=e.result??void 0,t.timestamp=e.timestamp??void 0,t}};function AS(){return{data:void 0,handlerType:0,handlerIds:[],chainId:""}}o(AS,"createBaseDataBinding");var yn={encode(e,t=b.default.Writer.create()){e.data!==void 0&&Uu.encode(e.data,t.uint32(10).fork()).ldelim(),e.handlerType!==0&&t.uint32(24).int32(e.handlerType),t.uint32(34).fork();for(let r of e.handlerIds)t.int32(r);return t.ldelim(),e.chainId!==""&&t.uint32(42).string(e.chainId),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=AS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.data=Uu.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.handlerType=r.int32();continue;case 4:if(a===32){i.handlerIds.push(r.int32());continue}if(a===34){let s=r.uint32()+r.pos;for(;r.pos<s;)i.handlerIds.push(r.int32());continue}break;case 5:if(a!==42)break;i.chainId=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{data:S(e.data)?Uu.fromJSON(e.data):void 0,handlerType:S(e.handlerType)?PS(e.handlerType):0,handlerIds:globalThis.Array.isArray(e?.handlerIds)?e.handlerIds.map(t=>globalThis.Number(t)):[],chainId:S(e.chainId)?globalThis.String(e.chainId):""}},toJSON(e){let t={};return e.data!==void 0&&(t.data=Uu.toJSON(e.data)),e.handlerType!==0&&(t.handlerType=LS(e.handlerType)),e.handlerIds?.length&&(t.handlerIds=e.handlerIds.map(r=>Math.round(r))),e.chainId!==""&&(t.chainId=e.chainId),t},create(e){return yn.fromPartial(e??{})},fromPartial(e){let t=AS();return t.data=e.data!==void 0&&e.data!==null?Uu.fromPartial(e.data):void 0,t.handlerType=e.handlerType??0,t.handlerIds=e.handlerIds?.map(r=>r)||[],t.chainId=e.chainId??"",t}};function yS(){return{configUpdated:!1,error:void 0}}o(yS,"createBaseStateResult");var ic={encode(e,t=b.default.Writer.create()){return e.configUpdated!==!1&&t.uint32(8).bool(e.configUpdated),e.error!==void 0&&t.uint32(18).string(e.error),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=yS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.configUpdated=r.bool();continue;case 2:if(a!==18)break;i.error=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{configUpdated:S(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:S(e.error)?globalThis.String(e.error):void 0}},toJSON(e){let t={};return e.configUpdated!==!1&&(t.configUpdated=e.configUpdated),e.error!==void 0&&(t.error=e.error),t},create(e){return ic.fromPartial(e??{})},fromPartial(e){let t=yS();return t.configUpdated=e.configUpdated??!1,t.error=e.error??void 0,t}};function wS(){return{gauges:[],counters:[],events:[],exports:[],states:void 0,timeseriesResult:[]}}o(wS,"createBaseProcessResult");var Yr={encode(e,t=b.default.Writer.create()){for(let r of e.gauges)sc.encode(r,t.uint32(10).fork()).ldelim();for(let r of e.counters)dc.encode(r,t.uint32(18).fork()).ldelim();for(let r of e.events)uc.encode(r,t.uint32(34).fork()).ldelim();for(let r of e.exports)cc.encode(r,t.uint32(42).fork()).ldelim();e.states!==void 0&&ic.encode(e.states,t.uint32(50).fork()).ldelim();for(let r of e.timeseriesResult)ea.encode(r,t.uint32(58).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=wS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gauges.push(sc.decode(r,r.uint32()));continue;case 2:if(a!==18)break;i.counters.push(dc.decode(r,r.uint32()));continue;case 4:if(a!==34)break;i.events.push(uc.decode(r,r.uint32()));continue;case 5:if(a!==42)break;i.exports.push(cc.decode(r,r.uint32()));continue;case 6:if(a!==50)break;i.states=ic.decode(r,r.uint32());continue;case 7:if(a!==58)break;i.timeseriesResult.push(ea.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(t=>sc.fromJSON(t)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(t=>dc.fromJSON(t)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(t=>uc.fromJSON(t)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(t=>cc.fromJSON(t)):[],states:S(e.states)?ic.fromJSON(e.states):void 0,timeseriesResult:globalThis.Array.isArray(e?.timeseriesResult)?e.timeseriesResult.map(t=>ea.fromJSON(t)):[]}},toJSON(e){let t={};return e.gauges?.length&&(t.gauges=e.gauges.map(r=>sc.toJSON(r))),e.counters?.length&&(t.counters=e.counters.map(r=>dc.toJSON(r))),e.events?.length&&(t.events=e.events.map(r=>uc.toJSON(r))),e.exports?.length&&(t.exports=e.exports.map(r=>cc.toJSON(r))),e.states!==void 0&&(t.states=ic.toJSON(e.states)),e.timeseriesResult?.length&&(t.timeseriesResult=e.timeseriesResult.map(r=>ea.toJSON(r))),t},create(e){return Yr.fromPartial(e??{})},fromPartial(e){let t=wS();return t.gauges=e.gauges?.map(r=>sc.fromPartial(r))||[],t.counters=e.counters?.map(r=>dc.fromPartial(r))||[],t.events=e.events?.map(r=>uc.fromPartial(r))||[],t.exports=e.exports?.map(r=>cc.fromPartial(r))||[],t.states=e.states!==void 0&&e.states!==null?ic.fromPartial(e.states):void 0,t.timeseriesResult=e.timeseriesResult?.map(r=>ea.fromPartial(r))||[],t}};function vS(){return{context:void 0,calldata:""}}o(vS,"createBaseEthCallParam");var ac={encode(e,t=b.default.Writer.create()){return e.context!==void 0&&oc.encode(e.context,t.uint32(10).fork()).ldelim(),e.calldata!==""&&t.uint32(18).string(e.calldata),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=vS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.context=oc.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.calldata=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{context:S(e.context)?oc.fromJSON(e.context):void 0,calldata:S(e.calldata)?globalThis.String(e.calldata):""}},toJSON(e){let t={};return e.context!==void 0&&(t.context=oc.toJSON(e.context)),e.calldata!==""&&(t.calldata=e.calldata),t},create(e){return ac.fromPartial(e??{})},fromPartial(e){let t=vS();return t.context=e.context!==void 0&&e.context!==null?oc.fromPartial(e.context):void 0,t.calldata=e.calldata??"",t}};function bS(){return{chainId:"",address:"",blockTag:""}}o(bS,"createBaseEthCallContext");var oc={encode(e,t=b.default.Writer.create()){return e.chainId!==""&&t.uint32(10).string(e.chainId),e.address!==""&&t.uint32(18).string(e.address),e.blockTag!==""&&t.uint32(26).string(e.blockTag),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=bS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=r.string();continue;case 2:if(a!==18)break;i.address=r.string();continue;case 3:if(a!==26)break;i.blockTag=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{chainId:S(e.chainId)?globalThis.String(e.chainId):"",address:S(e.address)?globalThis.String(e.address):"",blockTag:S(e.blockTag)?globalThis.String(e.blockTag):""}},toJSON(e){let t={};return e.chainId!==""&&(t.chainId=e.chainId),e.address!==""&&(t.address=e.address),e.blockTag!==""&&(t.blockTag=e.blockTag),t},create(e){return oc.fromPartial(e??{})},fromPartial(e){let t=bS();return t.chainId=e.chainId??"",t.address=e.address??"",t.blockTag=e.blockTag??"",t}};function IS(){return{ethCallParams:[]}}o(IS,"createBasePreprocessResult");var Oq={encode(e,t=b.default.Writer.create()){for(let r of e.ethCallParams)ac.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=IS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.ethCallParams.push(ac.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{ethCallParams:globalThis.Array.isArray(e?.ethCallParams)?e.ethCallParams.map(t=>ac.fromJSON(t)):[]}},toJSON(e){let t={};return e.ethCallParams?.length&&(t.ethCallParams=e.ethCallParams.map(r=>ac.toJSON(r))),t},create(e){return Oq.fromPartial(e??{})},fromPartial(e){let t=IS();return t.ethCallParams=e.ethCallParams?.map(r=>ac.fromPartial(r))||[],t}};function ES(){return{ethCallResults:{}}}o(ES,"createBasePreparedData");var Bq={encode(e,t=b.default.Writer.create()){return Object.entries(e.ethCallResults).forEach(([r,n])=>{E6.encode({key:r,value:n},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=ES();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=E6.decode(r,r.uint32());s.value!==void 0&&(i.ethCallResults[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{ethCallResults:Nt(e.ethCallResults)?Object.entries(e.ethCallResults).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{}}},toJSON(e){let t={};if(e.ethCallResults){let r=Object.entries(e.ethCallResults);r.length>0&&(t.ethCallResults={},r.forEach(([n,i])=>{t.ethCallResults[n]=i}))}return t},create(e){return Bq.fromPartial(e??{})},fromPartial(e){let t=ES();return t.ethCallResults=Object.entries(e.ethCallResults??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=globalThis.String(i)),r),{}),t}};function TS(){return{key:"",value:""}}o(TS,"createBasePreparedData_EthCallResultsEntry");var E6={encode(e,t=b.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=TS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.String(e.key):"",value:S(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return E6.fromPartial(e??{})},fromPartial(e){let t=TS();return t.key=e.key??"",t.value=e.value??"",t}};function NS(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}o(NS,"createBaseRecordMetaData");var Et={encode(e,t=b.default.Writer.create()){if(e.address!==""&&t.uint32(10).string(e.address),e.contractName!==""&&t.uint32(74).string(e.contractName),e.blockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.blockNumber)!==e.blockNumber)throw new globalThis.Error("value provided for field message.blockNumber of type uint64 too large");t.uint32(16).uint64(e.blockNumber.toString())}return e.transactionHash!==""&&t.uint32(50).string(e.transactionHash),e.chainId!==""&&t.uint32(42).string(e.chainId),e.transactionIndex!==0&&t.uint32(24).int32(e.transactionIndex),e.logIndex!==0&&t.uint32(32).int32(e.logIndex),e.name!==""&&t.uint32(82).string(e.name),Object.entries(e.labels).forEach(([r,n])=>{T6.encode({key:r,value:n},t.uint32(58).fork()).ldelim()}),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=NS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=r.string();continue;case 9:if(a!==74)break;i.contractName=r.string();continue;case 2:if(a!==16)break;i.blockNumber=Fr(r.uint64());continue;case 6:if(a!==50)break;i.transactionHash=r.string();continue;case 5:if(a!==42)break;i.chainId=r.string();continue;case 3:if(a!==24)break;i.transactionIndex=r.int32();continue;case 4:if(a!==32)break;i.logIndex=r.int32();continue;case 10:if(a!==82)break;i.name=r.string();continue;case 7:if(a!==58)break;let s=T6.decode(r,r.uint32());s.value!==void 0&&(i.labels[s.key]=s.value);continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{address:S(e.address)?globalThis.String(e.address):"",contractName:S(e.contractName)?globalThis.String(e.contractName):"",blockNumber:S(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:S(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:S(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:S(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:S(e.logIndex)?globalThis.Number(e.logIndex):0,name:S(e.name)?globalThis.String(e.name):"",labels:Nt(e.labels)?Object.entries(e.labels).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{}}},toJSON(e){let t={};if(e.address!==""&&(t.address=e.address),e.contractName!==""&&(t.contractName=e.contractName),e.blockNumber!==BigInt("0")&&(t.blockNumber=e.blockNumber.toString()),e.transactionHash!==""&&(t.transactionHash=e.transactionHash),e.chainId!==""&&(t.chainId=e.chainId),e.transactionIndex!==0&&(t.transactionIndex=Math.round(e.transactionIndex)),e.logIndex!==0&&(t.logIndex=Math.round(e.logIndex)),e.name!==""&&(t.name=e.name),e.labels){let r=Object.entries(e.labels);r.length>0&&(t.labels={},r.forEach(([n,i])=>{t.labels[n]=i}))}return t},create(e){return Et.fromPartial(e??{})},fromPartial(e){let t=NS();return t.address=e.address??"",t.contractName=e.contractName??"",t.blockNumber=e.blockNumber??BigInt("0"),t.transactionHash=e.transactionHash??"",t.chainId=e.chainId??"",t.transactionIndex=e.transactionIndex??0,t.logIndex=e.logIndex??0,t.name=e.name??"",t.labels=Object.entries(e.labels??{}).reduce((r,[n,i])=>(i!==void 0&&(r[n]=globalThis.String(i)),r),{}),t}};function SS(){return{key:"",value:""}}o(SS,"createBaseRecordMetaData_LabelsEntry");var T6={encode(e,t=b.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=SS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=r.string();continue;case 2:if(a!==18)break;i.value=r.string();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{key:S(e.key)?globalThis.String(e.key):"",value:S(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return T6.fromPartial(e??{})},fromPartial(e){let t=SS();return t.key=e.key??"",t.value=e.value??"",t}};function CS(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}o(CS,"createBaseMetricValue");var jr={encode(e,t=b.default.Writer.create()){return e.bigDecimal!==void 0&&t.uint32(10).string(e.bigDecimal),e.doubleValue!==void 0&&t.uint32(17).double(e.doubleValue),e.bigInteger!==void 0&&Kr.encode(e.bigInteger,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=CS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bigDecimal=r.string();continue;case 2:if(a!==17)break;i.doubleValue=r.double();continue;case 3:if(a!==26)break;i.bigInteger=Kr.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{bigDecimal:S(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:S(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:S(e.bigInteger)?Kr.fromJSON(e.bigInteger):void 0}},toJSON(e){let t={};return e.bigDecimal!==void 0&&(t.bigDecimal=e.bigDecimal),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.bigInteger!==void 0&&(t.bigInteger=Kr.toJSON(e.bigInteger)),t},create(e){return jr.fromPartial(e??{})},fromPartial(e){let t=CS();return t.bigDecimal=e.bigDecimal??void 0,t.doubleValue=e.doubleValue??void 0,t.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?Kr.fromPartial(e.bigInteger):void 0,t}};function OS(){return{from:0}}o(OS,"createBaseRuntimeInfo");var Tt={encode(e,t=b.default.Writer.create()){return e.from!==0&&t.uint32(8).int32(e.from),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=OS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;i.from=r.int32();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{from:S(e.from)?PS(e.from):0}},toJSON(e){let t={};return e.from!==0&&(t.from=LS(e.from)),t},create(e){return Tt.fromPartial(e??{})},fromPartial(e){let t=OS();return t.from=e.from??0,t}};function BS(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}o(BS,"createBaseGaugeResult");var sc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&jr.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=BS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.metricValue=jr.decode(r,r.uint32());continue;case 3:if(a!==26)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,metricValue:S(e.metricValue)?jr.fromJSON(e.metricValue):void 0,runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=jr.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return sc.fromPartial(e??{})},fromPartial(e){let t=BS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?jr.fromPartial(e.metricValue):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}};function RS(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}o(RS,"createBaseCounterResult");var dc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&jr.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.add!==!1&&t.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=RS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.metricValue=jr.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.add=r.bool();continue;case 4:if(a!==34)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,metricValue:S(e.metricValue)?jr.fromJSON(e.metricValue):void 0,add:S(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=jr.toJSON(e.metricValue)),e.add!==!1&&(t.add=e.add),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return dc.fromPartial(e??{})},fromPartial(e){let t=RS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?jr.fromPartial(e.metricValue):void 0,t.add=e.add??!1,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}};function xS(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,attributes2:void 0,noMetric:!1}}o(xS,"createBaseEventTrackingResult");var uc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&t.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&ee.encode(ee.wrap(e.attributes),t.uint32(50).fork()).ldelim(),e.severity!==0&&t.uint32(56).int32(e.severity),e.message!==""&&t.uint32(66).string(e.message),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(42).fork()).ldelim(),e.attributes2!==void 0&&et.encode(e.attributes2,t.uint32(74).fork()).ldelim(),e.noMetric!==!1&&t.uint32(24).bool(e.noMetric),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=xS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.distinctEntityId=r.string();continue;case 6:if(a!==50)break;i.attributes=ee.unwrap(ee.decode(r,r.uint32()));continue;case 7:if(a!==56)break;i.severity=r.int32();continue;case 8:if(a!==66)break;i.message=r.string();continue;case 5:if(a!==42)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue;case 9:if(a!==74)break;i.attributes2=et.decode(r,r.uint32());continue;case 3:if(a!==24)break;i.noMetric=r.bool();continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,distinctEntityId:S(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:Nt(e.attributes)?e.attributes:void 0,severity:S(e.severity)?sq(e.severity):0,message:S(e.message)?globalThis.String(e.message):"",runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0,attributes2:S(e.attributes2)?et.fromJSON(e.attributes2):void 0,noMetric:S(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.distinctEntityId!==""&&(t.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(t.attributes=e.attributes),e.severity!==0&&(t.severity=dq(e.severity)),e.message!==""&&(t.message=e.message),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),e.attributes2!==void 0&&(t.attributes2=et.toJSON(e.attributes2)),e.noMetric!==!1&&(t.noMetric=e.noMetric),t},create(e){return uc.fromPartial(e??{})},fromPartial(e){let t=xS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.distinctEntityId=e.distinctEntityId??"",t.attributes=e.attributes??void 0,t.severity=e.severity??0,t.message=e.message??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t.attributes2=e.attributes2!==void 0&&e.attributes2!==null?et.fromPartial(e.attributes2):void 0,t.noMetric=e.noMetric??!1,t}};function kS(){return{metadata:void 0,type:0,data:void 0,runtimeInfo:void 0}}o(kS,"createBaseTimeseriesResult");var ea={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.type!==0&&t.uint32(16).int32(e.type),e.data!==void 0&&et.encode(e.data,t.uint32(26).fork()).ldelim(),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=kS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==16)break;i.type=r.int32();continue;case 3:if(a!==26)break;i.data=et.decode(r,r.uint32());continue;case 4:if(a!==34)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,type:S(e.type)?yq(e.type):0,data:S(e.data)?et.fromJSON(e.data):void 0,runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.type!==0&&(t.type=wq(e.type)),e.data!==void 0&&(t.data=et.toJSON(e.data)),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return ea.fromPartial(e??{})},fromPartial(e){let t=kS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.type=e.type??0,t.data=e.data!==void 0&&e.data!==null?et.fromPartial(e.data):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}};function DS(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}o(DS,"createBaseExportResult");var cc={encode(e,t=b.default.Writer.create()){return e.metadata!==void 0&&Et.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.payload!==""&&t.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&Tt.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let r=e instanceof b.default.Reader?e:b.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,i=DS();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=Et.decode(r,r.uint32());continue;case 2:if(a!==18)break;i.payload=r.string();continue;case 3:if(a!==26)break;i.runtimeInfo=Tt.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skipType(a&7)}return i},fromJSON(e){return{metadata:S(e.metadata)?Et.fromJSON(e.metadata):void 0,payload:S(e.payload)?globalThis.String(e.payload):"",runtimeInfo:S(e.runtimeInfo)?Tt.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=Et.toJSON(e.metadata)),e.payload!==""&&(t.payload=e.payload),e.runtimeInfo!==void 0&&(t.runtimeInfo=Tt.toJSON(e.runtimeInfo)),t},create(e){return cc.fromPartial(e??{})},fromPartial(e){let t=DS();return t.metadata=e.metadata!==void 0&&e.metadata!==null?Et.fromPartial(e.metadata):void 0,t.payload=e.payload??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?Tt.fromPartial(e.runtimeInfo):void 0,t}},Y1e={name:"Processor",fullName:"processor.Processor",methods:{start:{name:"Start",requestType:C6,requestStream:!1,responseType:zs,responseStream:!1,options:{}},stop:{name:"Stop",requestType:zs,requestStream:!1,responseType:zs,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:N6,requestStream:!1,responseType:S6,responseStream:!1,options:{}},processBindings:{name:"ProcessBindings",requestType:VS,requestStream:!1,responseType:MS,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:O6,requestStream:!0,responseType:US,responseStream:!0,options:{}},preprocessBindingsStream:{name:"PreprocessBindingsStream",requestType:GS,requestStream:!0,responseType:qS,responseStream:!0,options:{}}}},j1e={name:"ProcessorV3",fullName:"processor.ProcessorV3",methods:{start:{name:"Start",requestType:C6,requestStream:!1,responseType:zs,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:N6,requestStream:!1,responseType:S6,responseStream:!1,options:{}},updateTemplates:{name:"UpdateTemplates",requestType:FS,requestStream:!1,responseType:zs,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:O6,requestStream:!0,responseType:QS,responseStream:!0,options:{}}}};function $n(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}o($n,"toTimestamp");function Ln(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}o(Ln,"fromTimestamp");function Yn(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):Ln(Ze.fromJSON(e))}o(Yn,"fromJsonTimestamp");function Fr(e){return BigInt(e.toString())}o(Fr,"longToBigint");b.default.util.Long!==fi&&(b.default.util.Long=fi,b.default.configure());function Nt(e){return typeof e=="object"&&e!==null}o(Nt,"isObject");function S(e){return e!=null}o(S,"isSet");function wp(e){if(typeof e=="number"){if(Number.isNaN(e))throw new Error("Cannot record NaN value");if(!Number.isFinite(e))throw new Error("Cannot record infinite value");return Number.isInteger(e)&&!Number.isSafeInteger(e)?jr.fromPartial({bigInteger:Ta(e)}):jr.fromPartial({doubleValue:Number(e)})}if(typeof e=="bigint")return jr.fromPartial({bigInteger:Ta(e)});if(typeof e=="string")return jr.fromPartial({bigDecimal:e});if(e.isInteger())return jr.fromPartial({bigInteger:JS(e)});if(e.isNaN())throw new Error("Cannot record NaN value");if(!e.isFinite())throw new Error("Cannot record infinite value");return jr.fromPartial({bigDecimal:e.toString()})}o(wp,"toMetricValue");function JS(e){let t=e.isNegative();return t&&(e=e.abs()),zS(e.toString(16),t)}o(JS,"bigDecimalToBigInteger");function uf(e){let t=e<0;return t&&(e=-e),zS(e.toString(16),t)}o(uf,"intToBigInteger");function Ta(e){return typeof e=="number"||typeof e=="bigint"?uf(e):typeof e=="string"?uf(BigInt(e)):e instanceof Gt?JS(e):uf(e)}o(Ta,"toBigInteger");function zS(e,t){e.length%2===1&&(e="0"+e);let r=Buffer.from(e,"hex");return{negative:t,data:new Uint8Array(r)}}o(zS,"hexToBigInteger");function Na(e){let t=(e.c||[]).map((n,i)=>i==0?n.toString():n.toString().padStart(14,"0")).join(""),r=-(t.length-(e.e??0)-1);return{value:Ta(BigInt(t)*BigInt(e.s??1)),exp:r}}o(Na,"toBigDecimal");function B6(e,t,r){let n=wp(e),i={fields:{value:{}}};for(let a in t)t[a]==null?i.fields[a]={nullValue:mt.NULL_VALUE}:i.fields[a]={stringValue:t[a]};if(n.bigInteger!=null)n.bigInteger.negative=r?!n.bigInteger.negative:n.bigInteger.negative,i.fields.value.bigintValue=n.bigInteger;else if(n.bigDecimal!=null){let a=new Gt(n.bigDecimal);r&&(a=a.negated()),i.fields.value.bigdecimalValue=Na(a)}else n.doubleValue!=null?i.fields.value.floatValue=r?-n.doubleValue:n.doubleValue:i.fields.value.nullValue=mt.NULL_VALUE;return i}o(B6,"toTimeSeriesData");import("node:process").then(e=>e.stdout.write(""));var WS=":sto_bi",Rq=":sto_bd";function xq(e){return e.slice(0,128).replace(/[^_a-zA-Z0-9]/g,"_")}o(xq,"normalizeName");function R6(e){return e==="labels"?"labels_":xq(e)}o(R6,"normalizeKey");function kq(e){return e.length>1024?(console.warn(`${e} is exceed max length for value storage, will be truncate to 1024 characters`),e.slice(0,1024)):e}o(kq,"normalizeValue");function x6(e){if(Object.keys(e).length===0)return e;let t={};for(let r in e)e[r]!==void 0?t[R6(r)]=kq(e[r]):console.warn(`key: ${r} has empty value in attributes`);return t}o(x6,"normalizeLabels");function HS(e,t,r){let n;switch(typeof e){case"string":return e.slice(0,t);case"bigint":return e.toString()+WS;case"number":return e;case"function":return null;case"symbol":return null}if(Array.isArray(e))return console.warn(`Array type inside log/event payload is not currently supported and will be ignored. Path: ${r??""}`),null;if(e===Object(e)){if(e instanceof Date)return e.toISOString();if(e instanceof Gt)return e.isNaN()||!e.isFinite()?(console.error("can't submit NaN or Infinity value, will store as 0"),0):e.toString()+Rq;if(Ma.isBN(e))return e.toString(10)+WS;if(e instanceof Promise)return console.error("Cannot submit promise"),null;n={};for(let[a,s]of Object.entries(e)){let d=HS(s,t,`${r??""}.${a}`);d!=null&&(n[a]=d)}}else n=e;return n}o(HS,"normalizeObject");function XS(e){return HS(e,1e3)}o(XS,"normalizeAttribute");function ZS(e){if(e==null)return{nullValue:mt.NULL_VALUE};switch(typeof e){case"string":return{stringValue:e};case"bigint":let t=BigInt(e);return{bigintValue:Ta(t)};case"number":if(isNaN(e)||!isFinite(e))throw new Error("can't submit NaN or Infinity value");if(Number.isSafeInteger(e))return{int64Value:BigInt(e)};if(Number.isInteger(e))throw new Error("This value is outside of safe integer range, please use BigDecimal or BigInt instead");return{floatValue:e};case"function":return{nullValue:mt.UNRECOGNIZED};case"symbol":return{stringValue:String(e)};case"boolean":return{boolValue:e};default:if(e instanceof Uint8Array)return{bytesValue:e};if(e instanceof Date)return{timestampValue:e};if(e instanceof Gt)return{bigdecimalValue:Na(e)};if(Ma.isBN(e)){let r=new Gt(e.toString());if(r.isNaN()||!r.isFinite())throw new Error("can't submit NaN or Infinity value");return{bigdecimalValue:Na(r)}}if(Array.isArray(e))return{listValue:{values:e.map(r=>ZS(r))}};if(e instanceof Promise)return console.error("Cannot submit promise"),{nullValue:mt.UNRECOGNIZED};if(typeof e=="object"){let r=Dq(e);return r?{tokenValue:r}:{structValue:cf(e)}}return console.warn("Cannot submit unsupported type "+typeof e),{nullValue:mt.UNRECOGNIZED}}}o(ZS,"normalizeToRichValue");function cf(...e){let t={fields:{}};for(let r of e)for(let[n,i]of Object.entries(r))try{t.fields[n]=ZS(i)}catch(a){throw new Error("error when converting data for key '"+n+"': "+a.message)}return t}o(cf,"normalizeToRichStruct");function Dq(e){let t=uo.create();for(let r of Object.getOwnPropertyNames(e))switch(r){case"token":let n=Pq(e.token);if(!n)return;t.token=n;break;case"amount":if(e.amount instanceof Gt)t.amount=Na(e);else if(typeof e.amount=="string"||typeof e.amount=="number")t.amount=Na(new Gt(e.amount));else return;break;case"specifiedAt":if(e.specifiedAt instanceof Date)t.specifiedAt=e.specifiedAt;else return;break;default:return}return t.amount&&t.token?t:void 0}o(Dq,"toTokenAmount");function Pq(e){let t=Nn.create();if(typeof e.symbol=="string")return t.symbol=e.symbol;if(e.hasOwnProperty("address"))t.address={address:e.address.address,chain:e.address.chain};else return;return t}o(Pq,"toCoinID");import("node:process").then(e=>e.stdout.write(""));import{MapStateStorage as Nj,processMetrics as ix}from"@sentio/runtime";var is=xr(v5(),1);import{ListStateStorage as Tj}from"@sentio/runtime";var ns=xr(v5(),1);import{GraphQLObjectType as yj,isListType as wj,isNonNullType as vj}from"graphql";var bj=["BigInt","BigDecimal","Timestamp","JSON","Bytes","ID","Int8"],Ij=(0,ns.buildASTSchema)((0,ns.parse)(`
|
|
1327
1327
|
directive @entity(immutable: Boolean! = false, sparse: Boolean! = false, timeseries: Boolean! = false) on OBJECT
|
|
1328
1328
|
directive @query on INTERFACE
|
|
1329
1329
|
directive @derivedFrom(field: String!) on FIELD_DEFINITION
|
|
@@ -1385,4 +1385,4 @@ long/index.js:
|
|
|
1385
1385
|
* SPDX-License-Identifier: Apache-2.0
|
|
1386
1386
|
*)
|
|
1387
1387
|
*/
|
|
1388
|
-
//# sourceMappingURL=chunk-
|
|
1388
|
+
//# sourceMappingURL=chunk-4CH3FO2Y.js.map
|