@sentio/sdk-bundle 2.40.1 → 2.40.2-rc.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/index.js +1 -1
- package/lib/aptos/ext/index.js +1 -1
- package/lib/aptos/index.js +1 -1
- package/lib/{chunk-ZWCC54OT.js → chunk-236CXVAU.js} +2 -2
- package/lib/{chunk-XTC2E4AO.js → chunk-67Q7JDY5.js} +2 -2
- package/lib/{chunk-3IB7FRIE.js → chunk-B6DSXCXO.js} +2 -2
- package/lib/{chunk-HELFAXL6.js → chunk-B7UU4A52.js} +2 -2
- package/lib/{chunk-H7ZR6VGN.js → chunk-BDAM4BUL.js} +2 -2
- package/lib/{chunk-2RODPLMC.js → chunk-BHTD45PS.js} +2 -2
- package/lib/{chunk-WE2PMDMA.js → chunk-CWQPNAA5.js} +2 -2
- package/lib/{chunk-XLELUGXD.js → chunk-DBVGD2AU.js} +2 -2
- package/lib/{chunk-YHQGT7O6.js → chunk-DMMZTRC2.js} +2 -2
- package/lib/{chunk-YHQGT7O6.js.map → chunk-DMMZTRC2.js.map} +1 -1
- package/lib/{chunk-WUR2RJAO.js → chunk-H2PJPZYK.js} +2 -2
- package/lib/{chunk-KE6RLS3Z.js → chunk-HKYLCDWI.js} +2 -2
- package/lib/{chunk-UTEB5KGL.js → chunk-JVZ2INPU.js} +2 -2
- package/lib/{chunk-ODHBL2TZ.js → chunk-Q4MA2PYL.js} +2 -2
- package/lib/{chunk-5DQVHP7X.js → chunk-SCJ4XFXC.js} +2 -2
- package/lib/{chunk-IAZMXFUZ.js → chunk-WC47RQG6.js} +2 -2
- package/lib/{chunk-Q6CR7BHA.js → chunk-XB2I2AX5.js} +2 -2
- package/lib/{chunk-TFITL2GB.js → chunk-YTJ4GRE5.js} +2 -2
- package/lib/core/index.js +1 -1
- package/lib/core/normalization.d.ts.map +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/codegen/index.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/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/src/core/normalization.ts +4 -0
- /package/lib/{chunk-ZWCC54OT.js.map → chunk-236CXVAU.js.map} +0 -0
- /package/lib/{chunk-XTC2E4AO.js.map → chunk-67Q7JDY5.js.map} +0 -0
- /package/lib/{chunk-3IB7FRIE.js.map → chunk-B6DSXCXO.js.map} +0 -0
- /package/lib/{chunk-HELFAXL6.js.map → chunk-B7UU4A52.js.map} +0 -0
- /package/lib/{chunk-H7ZR6VGN.js.map → chunk-BDAM4BUL.js.map} +0 -0
- /package/lib/{chunk-2RODPLMC.js.map → chunk-BHTD45PS.js.map} +0 -0
- /package/lib/{chunk-WE2PMDMA.js.map → chunk-CWQPNAA5.js.map} +0 -0
- /package/lib/{chunk-XLELUGXD.js.map → chunk-DBVGD2AU.js.map} +0 -0
- /package/lib/{chunk-WUR2RJAO.js.map → chunk-H2PJPZYK.js.map} +0 -0
- /package/lib/{chunk-KE6RLS3Z.js.map → chunk-HKYLCDWI.js.map} +0 -0
- /package/lib/{chunk-UTEB5KGL.js.map → chunk-JVZ2INPU.js.map} +0 -0
- /package/lib/{chunk-ODHBL2TZ.js.map → chunk-Q4MA2PYL.js.map} +0 -0
- /package/lib/{chunk-5DQVHP7X.js.map → chunk-SCJ4XFXC.js.map} +0 -0
- /package/lib/{chunk-IAZMXFUZ.js.map → chunk-WC47RQG6.js.map} +0 -0
- /package/lib/{chunk-Q6CR7BHA.js.map → chunk-XB2I2AX5.js.map} +0 -0
- /package/lib/{chunk-TFITL2GB.js.map → chunk-YTJ4GRE5.js.map} +0 -0
|
@@ -826,7 +826,7 @@ Things may not work as expected.
|
|
|
826
826
|
Supported fuel-core version: ${r}.`)}createOperations(){let e=Cr.getFetchFn(this.options),t=new KE.GraphQLClient(this.url,{fetch:(r,i)=>e(r,i,this.options),responseMiddleware:r=>{if("response"in r){let i=r.response;if(Array.isArray(i?.errors))throw new b(b.CODES.INVALID_REQUEST,i.errors.map(a=>a.message).join(`
|
|
827
827
|
|
|
828
828
|
`))}}});return AL((r,i)=>r.definitions.find(o=>o.kind==="OperationDefinition")?.operation==="subscription"?new iC({url:this.url,query:r,fetchFn:(o,c)=>e(o,c,this.options),variables:i}):t.request(r,i))}async getVersion(){let{nodeInfo:{nodeVersion:e}}=await this.operations.getVersion();return e}async getBlockNumber(){let{chain:e}=await this.operations.getChain();return v(e.latestBlock.height,10)}async fetchNode(){let{nodeInfo:e}=await this.operations.getNodeInfo(),t={maxDepth:v(e.maxDepth),maxTx:v(e.maxTx),nodeVersion:e.nodeVersion,utxoValidation:e.utxoValidation,vmBacktrace:e.vmBacktrace};return Cr.nodeInfoCache[this.url]=t,t}async fetchChain(){let{chain:e}=await this.operations.getChain(),t=g4(e);return Cr.chainInfoCache[this.url]=t,t}getChainId(){let{consensusParameters:{chainId:e}}=this.getChain();return e.toNumber()}getBaseAssetId(){let{consensusParameters:{baseAssetId:e}}=this.getChain();return e}async sendTransaction(e,{estimateTxDependencies:t=!0,awaitExecution:n=!1}={}){let r=Cn(e);Sg(this,Rg,_C).call(this,r.inputs),t&&await this.estimateTxDependencies(r);let i=O(r.toTransactionBytes()),a;if(r.type===Oe.Script&&(a=r.abis),n){let o=this.operations.submitAndAwait({encodedTransaction:i});for await(let{submitAndAwait:d}of o){if(d.type==="SqueezedOutStatus")throw new b(I.TRANSACTION_SQUEEZED_OUT,`Transaction Squeezed Out with reason: ${d.reason}`);if(d.type!=="SubmittedStatus")break}let c=r.getTransactionId(this.getChainId()),u=new Wl(c,this,a);return await u.fetch(),u}let{submit:{id:s}}=await this.operations.submit({encodedTransaction:i});return new Wl(s,this,a)}async dryRun(e,{utxoValidation:t,estimateTxDependencies:n=!0}={}){let r=Cn(e);if(n)return this.estimateTxDependencies(r);let i=O(r.toTransactionBytes()),{dryRun:a}=await this.operations.dryRun({encodedTransactions:i,utxoValidation:t||!1}),[{receipts:s,status:o}]=a;return{receipts:s.map(Ts),dryRunStatus:o}}async estimatePredicates(e){if(!!!e.inputs.find(a=>"predicate"in a&&a.predicate&&!Kv(R(a.predicate),R("0x"))&&new Hr(a.predicateGasUsed).isZero()))return e;let n=O(e.toTransactionBytes()),r=await this.operations.estimatePredicates({encodedTransaction:n}),{estimatePredicates:{inputs:i}}=r;return i&&i.forEach((a,s)=>{"predicateGasUsed"in a&&v(a.predicateGasUsed).gt(0)&&(e.inputs[s].predicateGasUsed=a.predicateGasUsed)}),e}async estimateTxDependencies(e){if(e.type===Oe.Create)return{receipts:[],outputVariables:0,missingContractIds:[]};let t=[],n=[],r=0,i;for(let a=0;a<VE;a++){let{dryRun:[{receipts:s,status:o}]}=await this.operations.dryRun({encodedTransactions:[O(e.toTransactionBytes())],utxoValidation:!1});t=s.map(Ts),i=o;let{missingOutputVariables:c,missingOutputContractIds:u}=qE(t);if(c.length!==0||u.length!==0){r+=c.length,e.addVariableOutputs(c.length),u.forEach(({contractId:h})=>{e.addContractInputAndOutput(ee.fromString(h)),n.push(h)});let{maxFee:f}=await this.estimateTxGasAndFee({transactionRequest:e});e.maxFee=f}else break}return{receipts:t,outputVariables:r,missingContractIds:n,dryRunStatus:i}}async estimateMultipleTxDependencies(e){let t=e.map(()=>({receipts:[],outputVariables:0,missingContractIds:[],dryRunStatus:void 0})),n=zt(e),r=new Map;n.forEach((s,o)=>{s.type===Oe.Script&&r.set(o,O(s.toTransactionBytes()))});let i=Array.from(r.keys()),a=0;for(;i.length>0&&a<VE;){let s=i.map(u=>r.get(u)),o=await this.operations.dryRun({encodedTransactions:s,utxoValidation:!1}),c=[];for(let u=0;u<o.dryRun.length;u++){let d=i[u],{receipts:f,status:h}=o.dryRun[u],A=t[d];A.receipts=f.map(Ts),A.dryRunStatus=h;let{missingOutputVariables:w,missingOutputContractIds:C}=qE(A.receipts),x=w.length>0||C.length>0,S=n[d];if(x&&S?.type===Oe.Script){A.outputVariables+=w.length,S.addVariableOutputs(w.length),C.forEach(({contractId:F})=>{S.addContractInputAndOutput(ee.fromString(F)),A.missingContractIds.push(F)});let{maxFee:N}=await this.estimateTxGasAndFee({transactionRequest:S});S.maxFee=N,r.set(d,O(S.toTransactionBytes())),c.push(d)}}i=c,a+=1}return t}async dryRunMultipleTransactions(e,{utxoValidation:t,estimateTxDependencies:n=!0}={}){if(n)return this.estimateMultipleTxDependencies(e);let r=e.map(s=>O(s.toTransactionBytes())),{dryRun:i}=await this.operations.dryRun({encodedTransactions:r,utxoValidation:t||!1});return i.map(({receipts:s,status:o})=>({receipts:s.map(Ts),dryRunStatus:o}))}async estimateTxGasAndFee(e){let{transactionRequest:t}=e,{gasPrice:n}=e,r=this.getChain(),{gasPriceFactor:i,maxGasPerTx:a}=this.getGasConfig(),s=t.calculateMinGas(r);n||(n=await this.estimateGasPrice(10));let o=xg({gasPrice:v(n),gas:s,priceFactor:i,tip:t.tip}).add(1),c=v(0);t.type===Oe.Script&&(c=t.gasLimit,t.gasLimit.eq(0)&&(t.gasLimit=s,t.gasLimit=a.sub(t.calculateMaxGas(r,s)),c=t.gasLimit));let u=t.calculateMaxGas(r,s),d=xg({gasPrice:v(n),gas:u,priceFactor:i,tip:t.tip}).add(1);return{minGas:s,minFee:o,maxGas:u,maxFee:d,gasPrice:n,gasLimit:c}}async simulate(e,{estimateTxDependencies:t=!0}={}){let n=Cn(e);if(t)return this.estimateTxDependencies(n);let r=[O(n.toTransactionBytes())],{dryRun:i}=await this.operations.dryRun({encodedTransactions:r,utxoValidation:!0});return{receipts:i.map(s=>{let{id:o,receipts:c,status:u}=s,d=c.map(Ts);return{id:o,receipts:d,status:u}})[0].receipts}}async getTransactionCost(e,{resourcesOwner:t,signatureCallback:n,quantitiesToContract:r=[]}={}){let i=zt(Cn(e)),a=i.type===Oe.Script,s=this.getBaseAssetId(),o=i.maxFee.eq(0),c=i.getCoinOutputsQuantities(),u=m4(c,r);i.fundWithFakeUtxos(u,s,t?.address),a&&(i.gasLimit=v(0)),t&&"populateTransactionPredicateData"in t&&t.populateTransactionPredicateData(i);let d=zt(i),f=0;if(n&&a){let K=d.witnesses.length;await n(d),f=d.witnesses.length-K}await this.estimatePredicates(d),i.updatePredicateGasUsed(d.inputs);let{maxFee:h,maxGas:A,minFee:w,minGas:C,gasPrice:x,gasLimit:S}=await this.estimateTxGasAndFee({transactionRequest:d}),N=[],F,M=[],X=0,H=v(0);if(i.maxFee=h,a){if(i.gasLimit=S,n&&await n(i),{receipts:N,missingContractIds:M,outputVariables:X,dryRunStatus:F}=await this.estimateTxDependencies(i),F&&"reason"in F)throw this.extractDryRunError(i,N,F);H=aC(N),i.gasLimit=H,{maxFee:h,maxGas:A,minFee:w,minGas:C,gasPrice:x}=await this.estimateTxGasAndFee({transactionRequest:i,gasPrice:x})}return{requiredQuantities:u,receipts:N,gasUsed:H,gasPrice:x,minGas:C,maxGas:A,minFee:w,maxFee:h,outputVariables:X,missingContractIds:M,addedSignatures:f,estimatedPredicates:i.inputs,dryRunStatus:F,updateMaxFee:o}}async getResourcesForTransaction(e,t,n=[]){let r=ee.fromAddressOrString(e),i=Cn(zt(t)),a=await this.getTransactionCost(i,{quantitiesToContract:n});i.addResources(await this.getResourcesToSpend(r,a.requiredQuantities));let{requiredQuantities:s,...o}=await this.getTransactionCost(i,{quantitiesToContract:n});return{resources:await this.getResourcesToSpend(r,s),requiredQuantities:s,...o}}async getCoins(e,t,n){let r=ee.fromAddressOrString(e);return(await this.operations.getCoins({first:10,...n,filter:{owner:r.toB256(),assetId:t&&O(t)}})).coins.edges.map(s=>s.node).map(s=>({id:s.utxoId,assetId:s.assetId,amount:v(s.amount),owner:ee.fromAddressOrString(s.owner),blockCreated:v(s.blockCreated),txCreatedIdx:v(s.txCreatedIdx)}))}async getResourcesToSpend(e,t,n){let r=ee.fromAddressOrString(e),i={messages:n?.messages?.map(c=>O(c))||[],utxos:n?.utxos?.map(c=>O(c))||[]};if(this.cache){let c=new Set(i.utxos.concat(this.cache?.getActiveData().map(u=>O(u))));i.utxos=Array.from(c)}let a={owner:r.toB256(),queryPerAsset:t.map(Xl).map(({assetId:c,amount:u,max:d})=>({assetId:O(c),amount:u.toString(10),max:d?d.toString(10):void 0})),excludedIds:i};return(await this.operations.getCoinsToSpend(a)).coinsToSpend.flat().map(c=>{switch(c.type){case"MessageCoin":return{amount:v(c.amount),assetId:c.assetId,daHeight:v(c.daHeight),sender:ee.fromAddressOrString(c.sender),recipient:ee.fromAddressOrString(c.recipient),nonce:c.nonce};case"Coin":return{id:c.utxoId,amount:v(c.amount),assetId:c.assetId,owner:ee.fromAddressOrString(c.owner),blockCreated:v(c.blockCreated),txCreatedIdx:v(c.txCreatedIdx)};default:return null}}).filter(c=>!!c)}async getBlock(e){let t;typeof e=="number"?t={height:v(e).toString(10)}:e==="latest"?t={height:(await this.getBlockNumber()).toString(10)}:e.length===66?t={blockId:e}:t={blockId:v(e).toString(10)};let{block:n}=await this.operations.getBlock(t);return n?{id:n.id,height:v(n.height),time:n.header.time,transactionIds:n.transactions.map(r=>r.id)}:null}async getBlocks(e){let{blocks:t}=await this.operations.getBlocks(e);return t.edges.map(({node:r})=>({id:r.id,height:v(r.height),time:r.header.time,transactionIds:r.transactions.map(i=>i.id)}))}async getBlockWithTransactions(e){let t;typeof e=="number"?t={blockHeight:v(e).toString(10)}:e==="latest"?t={blockHeight:(await this.getBlockNumber()).toString()}:t={blockId:e};let{block:n}=await this.operations.getBlockWithTransactions(t);return n?{id:n.id,height:v(n.height,10),time:n.header.time,transactionIds:n.transactions.map(r=>r.id),transactions:n.transactions.map(r=>new pn().decode(R(r.rawPayload),0)?.[0])}:null}async getTransaction(e){let{transaction:t}=await this.operations.getTransaction({transactionId:e});return t?new pn().decode(R(t.rawPayload),0)?.[0]:null}async getTransactions(e){let{transactions:{edges:t,pageInfo:n}}=await this.operations.getTransactions(e),r=new pn;return{transactions:t.map(({node:{rawPayload:a}})=>r.decode(R(a),0)[0]),pageInfo:n}}async getContract(e){let{contract:t}=await this.operations.getContract({contractId:e});return t||null}async getContractBalance(e,t){let{contractBalance:n}=await this.operations.getContractBalance({contract:ee.fromAddressOrString(e).toB256(),asset:O(t)});return v(n.amount,10)}async getBalance(e,t){let{balance:n}=await this.operations.getBalance({owner:ee.fromAddressOrString(e).toB256(),assetId:O(t)});return v(n.amount,10)}async getBalances(e,t){return(await this.operations.getBalances({first:10,...t,filter:{owner:ee.fromAddressOrString(e).toB256()}})).balances.edges.map(i=>i.node).map(i=>({assetId:i.assetId,amount:v(i.amount)}))}async getMessages(e,t){return(await this.operations.getMessages({first:10,...t,owner:ee.fromAddressOrString(e).toB256()})).messages.edges.map(i=>i.node).map(i=>({messageId:ls.getMessageId({sender:i.sender,recipient:i.recipient,nonce:i.nonce,amount:v(i.amount),data:i.data}),sender:ee.fromAddressOrString(i.sender),recipient:ee.fromAddressOrString(i.recipient),nonce:i.nonce,amount:v(i.amount),data:ls.decodeData(i.data),daHeight:v(i.daHeight)}))}async getMessageProof(e,t,n,r){let i={transactionId:e,nonce:t};if(n&&r)throw new b(I.INVALID_INPUT_PARAMETERS,"commitBlockId and commitBlockHeight cannot be used together");n&&(i={...i,commitBlockId:n}),r&&(i={...i,commitBlockHeight:r.toNumber().toString()});let a=await this.operations.getMessageProof(i);if(!a.messageProof)return null;let{messageProof:s,messageBlockHeader:o,commitBlockHeader:c,blockProof:u,sender:d,recipient:f,amount:h,data:A}=a.messageProof;return{messageProof:{proofIndex:v(s.proofIndex),proofSet:s.proofSet},blockProof:{proofIndex:v(u.proofIndex),proofSet:u.proofSet},messageBlockHeader:{id:o.id,daHeight:v(o.daHeight),transactionsCount:Number(o.transactionsCount),transactionsRoot:o.transactionsRoot,height:v(o.height),prevRoot:o.prevRoot,time:o.time,applicationHash:o.applicationHash,messageReceiptCount:Number(o.messageReceiptCount),messageOutboxRoot:o.messageOutboxRoot,consensusParametersVersion:Number(o.consensusParametersVersion),eventInboxRoot:o.eventInboxRoot,stateTransitionBytecodeVersion:Number(o.stateTransitionBytecodeVersion)},commitBlockHeader:{id:c.id,daHeight:v(c.daHeight),transactionsCount:Number(c.transactionsCount),transactionsRoot:c.transactionsRoot,height:v(c.height),prevRoot:c.prevRoot,time:c.time,applicationHash:c.applicationHash,messageReceiptCount:Number(c.messageReceiptCount),messageOutboxRoot:c.messageOutboxRoot,consensusParametersVersion:Number(c.consensusParametersVersion),eventInboxRoot:c.eventInboxRoot,stateTransitionBytecodeVersion:Number(c.stateTransitionBytecodeVersion)},sender:ee.fromAddressOrString(d),recipient:ee.fromAddressOrString(f),nonce:t,amount:v(h),data:A}}async getLatestGasPrice(){let{latestGasPrice:e}=await this.operations.getLatestGasPrice();return v(e.gasPrice)}async estimateGasPrice(e){let{estimateGasPrice:t}=await this.operations.estimateGasPrice({blockHorizon:String(e)});return v(t.gasPrice)}async getMessageStatus(e){return(await this.operations.getMessageStatus({nonce:e})).messageStatus}async produceBlocks(e,t){let{produceBlocks:n}=await this.operations.produceBlocks({blocksToProduce:v(e).toString(10),startTimestamp:t?pl.fromUnixMilliseconds(t).toTai64():void 0});return v(n)}async getTransactionResponse(e){return new Wl(e,this)}async getMessageByNonce(e){let{message:t}=await this.operations.getMessageByNonce({nonce:e});return t||null}async getRelayedTransactionStatus(e){let{relayedTransactionStatus:t}=await this.operations.getRelayedTransactionStatus({relayedTransactionId:e});return t||null}extractDryRunError(e,t,n){let r=n,i=[];return e.abis&&(i=jl(t,e.abis.main,e.abis.otherContractsAbis)),$l({logs:i,receipts:t,statusReason:r.reason})}},Zl=Cr;Rg=new WeakSet;_C=function(e){this.cache&&e.forEach(t=>{t.type===he.Coin&&this.cache?.set(t.id)})};Ye(Zl,"chainInfoCache",{});Ye(Zl,"nodeInfoCache",{});var zl={eth:{sepolia:11155111,foundry:31337},fuel:{devnet:0,testnet:0}};var _4="/",A4=/^\/|\/$/g,y4=(e="")=>e.replace(A4,"");function v4(e,...t){let n=e!=null,r=e?.[0]==="/"&&e.length>1,i=[e,...t].filter(Boolean).map(y4);return r&&n&&i.unshift(""),i.join(_4)}function w4(e,t="./"){return e.map(n=>({...n,icon:v4(t,n.icon)}))}var b4="https://cdn.fuel.network/assets/",E4=[{name:"Ethereum",symbol:"ETH",icon:"eth.svg",networks:[{type:"ethereum",chainId:zl.eth.sepolia,decimals:18},{type:"ethereum",chainId:zl.eth.foundry,decimals:18},{type:"fuel",chainId:zl.fuel.devnet,decimals:9,assetId:"0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"},{type:"fuel",chainId:zl.fuel.testnet,decimals:9,assetId:"0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"}]}],$$=w4(E4,b4),C4=e=>{let{assetId:t,amountToTransfer:n,hexlifiedContractId:r}=e,a=new q("u64").encode(new Hr(n).toNumber());return Uint8Array.from([...R(r),...a,...R(t)])},I4=async e=>{let t=C4(e);await Vt.initWasm();let n=Vt.gtf(16,0,Vt.GTFArgs.ScriptData),r=Vt.addi(17,16,32),i=Vt.lw(18,17,0),a=Vt.addi(19,17,8),s=Vt.tr(16,18,19),o=Vt.ret(1);return{script:Uint8Array.from([...n.to_bytes(),...r.to_bytes(),...i.to_bytes(),...a.to_bytes(),...s.to_bytes(),...o.to_bytes()]),scriptData:t}},S4=2,qg=class extends yl{address;_provider;_connector;constructor(e,t,n){super(),this._provider=t,this._connector=n,this.address=ee.fromDynamicInput(e)}get provider(){if(!this._provider)throw new b(I.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){return this.provider.getResourcesToSpend(this.address,e,t)}async getCoins(e){let t=[],r;for(;;){let i=await this.provider.getCoins(this.address,e,{first:9999,after:r});if(t.push(...i),!(i.length>=9999))break;throw new b(I.NOT_SUPPORTED,"Wallets containing more than 9999 coins exceed the current supported limit.")}return t}async getMessages(){let e=[],n;for(;;){let r=await this.provider.getMessages(this.address,{first:9999,after:n});if(e.push(...r),!(r.length>=9999))break;throw new b(I.NOT_SUPPORTED,"Wallets containing more than 9999 messages exceed the current supported limit.")}return e}async getBalance(e){let t=e??this.provider.getBaseAssetId();return await this.provider.getBalance(this.address,t)}async getBalances(){let e=[],n;for(;;){let r=await this.provider.getBalances(this.address,{first:9999,after:n});if(e.push(...r),!(r.length>=9999))break;throw new b(I.NOT_SUPPORTED,"Wallets containing more than 9999 balances exceed the current supported limit.")}return e}async fund(e,t){let{addedSignatures:n,estimatedPredicates:r,requiredQuantities:i,updateMaxFee:a}=t,s=e.maxFee,o=this.provider.getBaseAssetId(),c=i.find(x=>x.assetId===o)?.amount||v(0),u=gF({amount:v(s),assetId:o,coinQuantities:i}),d={};u.forEach(({amount:x,assetId:S})=>{d[S]={required:x,owned:v(0)}}),e.inputs.filter(ou).forEach(x=>{let N=uu(x)?String(x.assetId):o;d[N]&&(d[N].owned=d[N].owned.add(x.amount))});let f=[];Object.entries(d).forEach(([x,{owned:S,required:N}])=>{S.lt(N)&&f.push({assetId:x,amount:N.sub(S)})});let h=f.length>0,A=0;for(;h&&A<S4;){let x=await this.getResourcesToSpend(f,PL(e.inputs,this.address));e.addResources(x),e.updatePredicateGasUsed(r);let S=zt(e);if(n&&Array.from({length:n}).forEach(()=>S.addEmptyWitness()),!a)break;let{maxFee:N}=await this.provider.estimateTxGasAndFee({transactionRequest:S}),F=OL(e.inputs,o,o),M=c.add(N);F.gt(M)?h=!1:f=[{amount:M.sub(F),assetId:o}],A+=1}e.updatePredicateGasUsed(r);let w=zt(e);if(n&&Array.from({length:n}).forEach(()=>w.addEmptyWitness()),!a)return e;let{maxFee:C}=await this.provider.estimateTxGasAndFee({transactionRequest:w});return e.maxFee=C,e}async createTransfer(e,t,n,r={}){let i=new Ii(r);return i=this.addTransfer(i,{destination:e,amount:t,assetId:n}),i=await this.estimateAndFundTransaction(i,r),i}async transfer(e,t,n,r={}){let i=await this.createTransfer(e,t,n,r);return this.sendTransaction(i,{estimateTxDependencies:!1})}async batchTransfer(e,t={}){let n=new Ii(t);return n=this.addBatchTransfer(n,e),n=await this.estimateAndFundTransaction(n,t),this.sendTransaction(n,{estimateTxDependencies:!1})}addTransfer(e,t){let{destination:n,amount:r,assetId:i}=t;return this.validateTransferAmount(r),e.addCoinOutput(ee.fromAddressOrString(n),r,i??this.provider.getBaseAssetId()),e}addBatchTransfer(e,t){let n=this.provider.getBaseAssetId();return t.forEach(({destination:r,amount:i,assetId:a})=>{this.addTransfer(e,{destination:r,amount:i,assetId:a??n})}),e}async transferToContract(e,t,n,r={}){if(v(t).lte(0))throw new b(I.INVALID_TRANSFER_AMOUNT,"Transfer amount must be a positive number.");let i=ee.fromAddressOrString(e),a=n??this.provider.getBaseAssetId(),{script:s,scriptData:o}=await I4({hexlifiedContractId:i.toB256(),amountToTransfer:v(t),assetId:a}),c=new Ii({...r,script:s,scriptData:o});c.addContractInputAndOutput(i);let u=await this.provider.getTransactionCost(c,{resourcesOwner:this,quantitiesToContract:[{amount:v(t),assetId:String(a)}]});return c=this.validateGasLimitAndMaxFee({transactionRequest:c,gasUsed:u.gasUsed,maxFee:u.maxFee,txParams:r}),await this.fund(c,u),this.sendTransaction(c)}async withdrawToBaseLayer(e,t,n={}){let r=ee.fromAddressOrString(e),i=R("0x".concat(r.toHexString().substring(2).padStart(64,"0"))),a=R("0x".concat(v(t).toHex().substring(2).padStart(16,"0"))),o={script:new Uint8Array([...R(LL.bytes),...i,...a]),...n},c=this.provider.getBaseAssetId(),u=new Ii(o),d=[{amount:v(t),assetId:c}],f=await this.provider.getTransactionCost(u,{quantitiesToContract:d});return u=this.validateGasLimitAndMaxFee({transactionRequest:u,gasUsed:f.gasUsed,maxFee:f.maxFee,txParams:n}),await this.fund(u,f),this.sendTransaction(u)}async signMessage(e){if(!this._connector)throw new b(I.MISSING_CONNECTOR,"A connector is required to sign messages.");return this._connector.signMessage(this.address.toString(),e)}async signTransaction(e){if(!this._connector)throw new b(I.MISSING_CONNECTOR,"A connector is required to sign transactions.");return this._connector.signTransaction(this.address.toString(),e)}async sendTransaction(e,{estimateTxDependencies:t=!0,awaitExecution:n}={}){if(this._connector)return this.provider.getTransactionResponse(await this._connector.sendTransaction(this.address.toString(),e));let r=Cn(e);return t&&await this.provider.estimateTxDependencies(r),this.provider.sendTransaction(r,{awaitExecution:n,estimateTxDependencies:!1})}async simulateTransaction(e,{estimateTxDependencies:t=!0}={}){let n=Cn(e);return t&&await this.provider.estimateTxDependencies(n),this.provider.simulate(n,{estimateTxDependencies:!1})}generateFakeResources(e){return e.map(t=>({id:O(Tt(fa)),owner:this.address,blockCreated:v(1),txCreatedIdx:v(1),...t}))}validateTransferAmount(e){if(v(e).lte(0))throw new b(I.INVALID_TRANSFER_AMOUNT,"Transfer amount must be a positive number.")}async estimateAndFundTransaction(e,t){let n=e,r=await this.provider.getTransactionCost(n,{resourcesOwner:this});return n=this.validateGasLimitAndMaxFee({transactionRequest:n,gasUsed:r.gasUsed,maxFee:r.maxFee,txParams:t}),n=await this.fund(n,r),n}validateGasLimitAndMaxFee({gasUsed:e,maxFee:t,transactionRequest:n,txParams:{gasLimit:r,maxFee:i}}){let a=Cn(n);if(!yr(r))a.gasLimit=e;else if(e.gt(r))throw new b(I.GAS_LIMIT_TOO_LOW,`Gas limit '${r}' is lower than the required: '${e}'.`);if(!yr(i))a.maxFee=t;else if(t.gt(i))throw new b(I.MAX_FEE_TOO_LOW,`Max fee '${i}' is lower than the required: '${t}'.`);return a}},ks=class{address;publicKey;compressedPublicKey;privateKey;constructor(e){typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e=`0x${e}`);let t=$t(e,32);this.privateKey=O(t),this.publicKey=O(fi.getPublicKey(t,!1).slice(1)),this.compressedPublicKey=O(fi.getPublicKey(t,!0)),this.address=ee.fromPublicKey(this.publicKey)}sign(e){let t=fi.sign(R(e),R(this.privateKey)),n=$t(`0x${t.r.toString(16)}`,32),r=$t(`0x${t.s.toString(16)}`,32);return r[0]|=(t.recovery||0)<<7,O(Y([n,r]))}addPoint(e){let t=fi.ProjectivePoint.fromHex(R(this.compressedPublicKey)),n=fi.ProjectivePoint.fromHex(R(e));return`0x${t.add(n).toHex(!0)}`}static recoverPublicKey(e,t){let n=R(t),r=n.slice(0,32),i=n.slice(32,64),a=(i[0]&128)>>7;i[0]&=127;let o=new fi.Signature(BigInt(O(r)),BigInt(O(i))).addRecoveryBit(a).recoverPublicKey(R(e)).toRawBytes(!1).slice(1);return O(o)}static recoverAddress(e,t){return ee.fromPublicKey(ks.recoverPublicKey(e,t))}static generatePrivateKey(e){return e?dn(Y([Tt(32),R(e)])):Tt(32)}static extendPublicKey(e){let t=fi.ProjectivePoint.fromHex(R(e));return O(t.toRawBytes(!1).slice(1))}},GE=13,WE=8,HE=1,bg=32,x4=16,ZE=e=>/^0x/.test(e)?e.slice(2):e;async function T4(e,t,n){let r=Wn(ZE(e),"hex"),i=ee.fromAddressOrString(t),a=Tt(bg),s=Gf({password:Wn(n),salt:a,dklen:bg,n:2**GE,r:WE,p:HE}),o=Tt(x4),c=await Aw(r,s,o),u=Uint8Array.from([...s.subarray(16,32),...c]),d=Wf(u),f=es(d,"hex"),h={id:Ag(),version:3,address:ZE(i.toHexString()),crypto:{cipher:"aes-128-ctr",mac:f,cipherparams:{iv:es(o,"hex")},ciphertext:es(c,"hex"),kdf:"scrypt",kdfparams:{dklen:bg,n:2**GE,p:HE,r:WE,salt:es(a,"hex")}}};return JSON.stringify(h)}async function N4(e,t){let n=JSON.parse(e),{crypto:{mac:r,ciphertext:i,cipherparams:{iv:a},kdfparams:{dklen:s,n:o,r:c,p:u,salt:d}}}=n,f=Wn(i,"hex"),h=Wn(a,"hex"),A=Wn(d,"hex"),w=Wn(t),C=Gf({password:w,salt:A,n:o,p:u,r:c,dklen:s}),x=Uint8Array.from([...C.subarray(16,32),...f]),S=Wf(x),N=es(S,"hex");if(r!==N)throw new b(I.INVALID_PASSWORD,"Failed to decrypt the keystore wallet, the provided password is incorrect.");let F=await _w(f,C,h);return O(F)}var AC=class extends qg{signer;constructor(e,t){let n=new ks(e);super(n.address,t),this.signer=()=>n}get privateKey(){return this.signer().privateKey}get publicKey(){return this.signer().publicKey}async signMessage(e){let t=await this.signer().sign(bw(e));return O(t)}async signTransaction(e){let t=Cn(e),n=this.provider.getChainId(),r=t.getTransactionId(n),i=await this.signer().sign(r);return O(i)}async populateTransactionWitnessesSignature(e){let t=Cn(e),n=await this.signTransaction(t);return t.updateWitnessByOwner(this.address,n),t}async sendTransaction(e,{estimateTxDependencies:t=!1,awaitExecution:n}={}){let r=Cn(e);return t&&await this.provider.estimateTxDependencies(r),this.provider.sendTransaction(await this.populateTransactionWitnessesSignature(r),{awaitExecution:n,estimateTxDependencies:!1})}async simulateTransaction(e,{estimateTxDependencies:t=!0}={}){let n=Cn(e);return t&&await this.provider.estimateTxDependencies(n),this.provider.dryRun(await this.populateTransactionWitnessesSignature(n),{utxoValidation:!0,estimateTxDependencies:!1})}async encrypt(e){return T4(this.privateKey,this.address,e)}};Ye(AC,"defaultPath","m/44'/1179993420'/0'/0/0");var Vl=["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 R4(e){return(1<<e)-1}function yC(e){return(1<<e)-1<<8-e}function Eg(e){return Array.isArray(e)?e:e.split(/\s+/)}function k4(e){return Array.isArray(e)?e.join(" "):e}function B4(e){let t=[0],n=11;for(let a=0;a<e.length;a+=1)n>8?(t[t.length-1]<<=8,t[t.length-1]|=e[a],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=e[a]>>8-n,t.push(e[a]&R4(8-n)),n+=3);let r=e.length/4,i=R(We(e))[0]&yC(r);return t[t.length-1]<<=r,t[t.length-1]|=i>>8-r,t}function O4(e,t){let n=Math.ceil(11*e.length/8),r=R(new Uint8Array(n)),i=0;for(let u=0;u<e.length;u+=1){let d=t.indexOf(e[u].normalize("NFKD"));if(d===-1)throw new b(I.INVALID_MNEMONIC,`Invalid mnemonic: the word '${e[u]}' is not found in the provided wordlist.`);for(let f=0;f<11;f+=1)d&1<<10-f&&(r[i>>3]|=1<<7-i%8),i+=1}let a=32*e.length/3,s=e.length/3,o=yC(s);if((R(We(r.slice(0,a/8)))[0]&o)!==(r[r.length-1]&o))throw new b(I.INVALID_CHECKSUM,"Checksum validation failed for the provided mnemonic.");return r.slice(0,a/8)}var P4=vr("Bitcoin seed"),D4="0x0488ade4",M4="0x04358394",XE=[12,15,18,21,24];function YE(e){if(e.length!==2048)throw new b(I.INVALID_WORD_LIST,`Expected word list length of 2048, but got ${e.length}.`)}function F4(e){if(e.length%4!==0||e.length<16||e.length>32)throw new b(I.INVALID_ENTROPY,`Entropy should be between 16 and 32 bytes and a multiple of 4, but got ${e.length} bytes.`)}function Cg(e){if(!XE.includes(e.length)){let t=`Invalid mnemonic size. Expected one of [${XE.join(", ")}] words, but got ${e.length}.`;throw new b(I.INVALID_MNEMONIC,t)}}var wi=class{wordlist;constructor(e=Vl){this.wordlist=e,YE(this.wordlist)}mnemonicToEntropy(e){return wi.mnemonicToEntropy(e,this.wordlist)}entropyToMnemonic(e){return wi.entropyToMnemonic(e,this.wordlist)}static mnemonicToEntropy(e,t=Vl){let n=Eg(e);return Cg(n),O(O4(n,t))}static entropyToMnemonic(e,t=Vl){let n=R(e);return YE(t),F4(n),B4(n).map(r=>t[r]).join(" ")}static mnemonicToSeed(e,t=""){Cg(Eg(e));let n=vr(k4(e)),r=vr(`mnemonic${t}`);return yw(n,r,2048,64,"sha512")}static mnemonicToMasterKeys(e,t=""){let n=wi.mnemonicToSeed(e,t);return wi.masterKeysFromSeed(n)}static isMnemonicValid(e){let t=Eg(e),n=0;try{Cg(t)}catch{return!1}for(;n<t.length;){if(wi.binarySearch(t[n])===!1)return!1;n+=1}return!0}static binarySearch(e){let t=Vl,n=0,r=t.length-1;for(;n<=r;){let i=Math.floor((n+r)/2);if(t[i]===e)return!0;e<t[i]?r=i-1:n=i+1}return!1}static masterKeysFromSeed(e){let t=R(e);if(t.length<16||t.length>64)throw new b(I.INVALID_SEED,`Seed length should be between 16 and 64 bytes, but received ${t.length} bytes.`);return R(gl("sha512",P4,t))}static seedToExtendedKey(e,t=!1){let n=wi.masterKeysFromSeed(e),r=R(t?M4:D4),i="0x00",a="0x00000000",s="0x00000000",o=n.slice(32),c=n.slice(0,32),u=Y([r,i,a,s,o,Y(["0x00",c])]),d=Zc(We(We(u)),0,4);return fl(Y([u,d]))}static generate(e=32,t=""){let n=t?We(Y([Tt(e),R(t)])):Tt(e);return wi.entropyToMnemonic(n)}},Jg=wi,vC=2147483648,wC=O("0x0488ade4"),zg=O("0x0488b21e"),bC=O("0x04358394"),Vg=O("0x043587cf");function $E(e){return fl(Y([e,Zc(We(We(e)),0,4)]))}function L4(e=!1,t=!1){return e?t?Vg:zg:t?bC:wC}function Q4(e){return[zg,Vg].includes(O(e.slice(0,4)))}function U4(e){return[wC,bC,zg,Vg].includes(O(e.slice(0,4)))}function q4(e,t=0){let n=e.split("/");if(n.length===0||n[0]==="m"&&t!==0)throw new b(I.HD_WALLET_ERROR,`invalid path - ${e}`);return n[0]==="m"&&n.shift(),n.map(r=>~r.indexOf("'")?parseInt(r,10)+vC:parseInt(r,10))}var Ns=class{depth=0;index=0;fingerprint=O("0x00000000");parentFingerprint=O("0x00000000");privateKey;publicKey;chainCode;constructor(e){if(e.privateKey){let t=new ks(e.privateKey);this.publicKey=O(t.compressedPublicKey),this.privateKey=O(e.privateKey)}else{if(!e.publicKey)throw new b(I.HD_WALLET_ERROR,"Both public and private Key cannot be missing. At least one should be provided.");this.publicKey=O(e.publicKey)}this.parentFingerprint=e.parentFingerprint||this.parentFingerprint,this.fingerprint=Zc(vw(We(this.publicKey)),0,4),this.depth=e.depth||this.depth,this.index=e.index||this.index,this.chainCode=e.chainCode}get extendedKey(){return this.toExtendedKey()}deriveIndex(e){let t=this.privateKey&&R(this.privateKey),n=R(this.publicKey),r=R(this.chainCode),i=new Uint8Array(37);if(e&vC){if(!t)throw new b(I.HD_WALLET_ERROR,"Cannot derive a hardened index without a private Key.");i.set(t,1)}else i.set(R(this.publicKey));i.set($t(e,4),33);let a=R(gl("sha512",r,i)),s=a.slice(0,32),o=a.slice(32);if(t){let d="0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",f=v(s).add(t).mod(d).toBytes(32);return new Ns({privateKey:f,chainCode:o,index:e,depth:this.depth+1,parentFingerprint:this.fingerprint})}let u=new ks(O(s)).addPoint(n);return new Ns({publicKey:u,chainCode:o,index:e,depth:this.depth+1,parentFingerprint:this.fingerprint})}derivePath(e){return q4(e,this.depth).reduce((n,r)=>n.deriveIndex(r),this)}toExtendedKey(e=!1,t=!1){if(this.depth>=256)throw new b(I.HD_WALLET_ERROR,`Exceeded max depth of 255. Current depth: ${this.depth}.`);let n=L4(this.privateKey==null||e,t),r=O(Uint8Array.from([this.depth])),i=this.parentFingerprint,a=Ya(this.index,4),s=this.chainCode,o=this.privateKey!=null&&!e?Y(["0x00",this.privateKey]):this.publicKey,c=R(Y([n,r,i,a,s,o]));return $E(c)}static fromSeed(e){let t=Jg.masterKeysFromSeed(e);return new Ns({chainCode:R(t.slice(32)),privateKey:R(t.slice(0,32))})}static fromExtendedKey(e){let t=O($t(Zv(e))),n=R(t),r=$E(n.slice(0,78))===e;if(n.length!==82||!U4(n))throw new b(I.HD_WALLET_ERROR,"Provided key is not a valid extended key.");if(!r)throw new b(I.HD_WALLET_ERROR,"Provided key has an invalid checksum.");let i=n[4],a=O(n.slice(5,9)),s=parseInt(O(n.slice(9,13)).substring(2),16),o=O(n.slice(13,45)),c=n.slice(45,78);if(i===0&&a!=="0x00000000"||i===0&&s!==0)throw new b(I.HD_WALLET_ERROR,"Inconsistency detected: Depth is zero but fingerprint/index is non-zero.");if(Q4(n)){if(c[0]!==3)throw new b(I.HD_WALLET_ERROR,"Invalid public extended key.");return new Ns({publicKey:c,chainCode:o,index:s,depth:i,parentFingerprint:a})}if(c[0]!==0)throw new b(I.HD_WALLET_ERROR,"Invalid private extended key.");return new Ns({privateKey:c.slice(1),chainCode:o,index:s,depth:i,parentFingerprint:a})}},Ig=Ns,EC=class extends qg{unlock(e){return new nn(e,this._provider)}},nn=class extends AC{lock(){return this.signer=()=>new ks("0x00"),new EC(this.address,this._provider)}static generate(e){let t=ks.generatePrivateKey(e?.entropy);return new nn(t,e?.provider)}static fromSeed(e,t,n){let i=Ig.fromSeed(e).derivePath(t||nn.defaultPath);return new nn(i.privateKey,n)}static fromMnemonic(e,t,n,r){let i=Jg.mnemonicToSeed(e,n),s=Ig.fromSeed(i).derivePath(t||nn.defaultPath);return new nn(s.privateKey,r)}static fromExtendedKey(e,t){let n=Ig.fromExtendedKey(e);return new nn(n.privateKey,t)}static async fromEncryptedJson(e,t,n){let r=await N4(e,t);return new nn(r,n)}},rn=class{static fromAddress(e,t){return new EC(e,t)}static fromPrivateKey(e,t){return new nn(e,t)}};Ye(rn,"generate",nn.generate);Ye(rn,"fromSeed",nn.fromSeed);Ye(rn,"fromMnemonic",nn.fromMnemonic);Ye(rn,"fromExtendedKey",nn.fromExtendedKey);Ye(rn,"fromEncryptedJson",nn.fromEncryptedJson);var z4=class{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()}},va,CC=class{constructor(e){Ei(this,va,void 0),Ye(this,"pathKey","{}"),Ye(this,"rootPath",`m/44'/1179993420'/${this.pathKey}'/0/0`),Ye(this,"numberOfAccounts",0),Zn(this,va,e.secret||Jg.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:Ge(this,va),rootPath:this.rootPath,numberOfAccounts:this.numberOfAccounts}}getAccounts(){let e=[],t=0;do{let n=rn.fromMnemonic(Ge(this,va),this.getDerivePath(t));e.push({publicKey:n.publicKey,address:n.address}),t+=1}while(t<this.numberOfAccounts);return e}addAccount(){this.numberOfAccounts+=1;let e=rn.fromMnemonic(Ge(this,va),this.getDerivePath(this.numberOfAccounts-1));return{publicKey:e.publicKey,address:e.address}}exportAccount(e){let t=0,n=ee.fromAddressOrString(e);do{let r=rn.fromMnemonic(Ge(this,va),this.getDerivePath(t));if(r.address.equals(n))return r.privateKey;t+=1}while(t<this.numberOfAccounts);throw new b(I.WALLET_MANAGER_ERROR,`Account with address '${e}' not found in derived wallets.`)}getWallet(e){let t=this.exportAccount(e);return rn.fromPrivateKey(t)}};va=new WeakMap;Ye(CC,"type","mnemonic");var bi,IC=class{constructor(e={}){Ei(this,bi,[]),e.secret?Zn(this,bi,[e.secret]):Zn(this,bi,e.accounts||[rn.generate().privateKey])}serialize(){return{accounts:Ge(this,bi)}}getPublicAccount(e){let t=rn.fromPrivateKey(e);return{address:t.address,publicKey:t.publicKey}}getAccounts(){return Ge(this,bi).map(e=>this.getPublicAccount(e))}addAccount(){let e=rn.generate();return Ge(this,bi).push(e.privateKey),this.getPublicAccount(e.privateKey)}exportAccount(e){let t=ee.fromAddressOrString(e),n=Ge(this,bi).find(r=>rn.fromPrivateKey(r).address.equals(t));if(!n)throw new b(I.WALLET_MANAGER_ERROR,`No private key found for address '${e}'.`);return n}getWallet(e){let t=this.exportAccount(e);return rn.fromPrivateKey(t)}};bi=new WeakMap;Ye(IC,"type","privateKey");var Xr={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 Yr(e,t){if(!e)throw new b(I.WALLET_MANAGER_ERROR,t)}var tn,wa,Ir,kg,SC,Bg,xC,TC=class extends J4{constructor(e){super(),Ei(this,kg),Ei(this,Bg),Ye(this,"storage",new z4),Ye(this,"STORAGE_KEY","WalletManager"),Ei(this,tn,[]),Ei(this,wa,""),Ei(this,Ir,!0),this.storage=e?.storage||this.storage}get isLocked(){return Ge(this,Ir)}exportVault(e){Yr(!Ge(this,Ir),Xr.wallet_not_unlocked);let t=Ge(this,tn).find((n,r)=>r===e);return Yr(t,Xr.vault_not_found),t.vault.serialize()}getVaults(){return Ge(this,tn).map((e,t)=>({title:e.title,type:e.type,vaultId:t}))}getAccounts(){return Ge(this,tn).flatMap((e,t)=>e.vault.getAccounts().map(n=>({...n,vaultId:t})))}getWallet(e){let t=ee.fromAddressOrString(e),n=Ge(this,tn).find(r=>r.vault.getAccounts().find(i=>i.address.equals(t)));return Yr(n,Xr.address_not_found),n.vault.getWallet(t)}exportPrivateKey(e){let t=ee.fromAddressOrString(e);Yr(!Ge(this,Ir),Xr.wallet_not_unlocked);let n=Ge(this,tn).find(r=>r.vault.getAccounts().find(i=>i.address.equals(t)));return Yr(n,Xr.address_not_found),n.vault.exportAccount(t)}async addAccount(e){await this.loadState();let t=Ge(this,tn)[e?.vaultId||0];await Yr(t,Xr.vault_not_found);let n=t.vault.addAccount();return await this.saveState(),n}async removeVault(e){Ge(this,tn).splice(e,1),await this.saveState()}async addVault(e){await this.loadState();let t=this.getVaultClass(e.type),n=new t(e);Zn(this,tn,Ge(this,tn).concat({title:e.title,type:e.type,vault:n})),await this.saveState()}lock(){Zn(this,Ir,!0),Zn(this,tn,[]),Zn(this,wa,""),this.emit("lock")}async unlock(e){Zn(this,wa,e),Zn(this,Ir,!1);try{await this.loadState(),this.emit("unlock")}catch(t){throw await this.lock(),t}}async updatePassphrase(e,t){let n=Ge(this,Ir);await this.unlock(e),Zn(this,wa,t),await this.saveState(),await this.loadState(),n&&await this.lock()}async loadState(){await Yr(!Ge(this,Ir),Xr.wallet_not_unlocked);let e=await this.storage.getItem(this.STORAGE_KEY);if(e){let t=await mw(Ge(this,wa),JSON.parse(e));Zn(this,tn,Sg(this,Bg,xC).call(this,t.vaults))}}async saveState(){await Yr(!Ge(this,Ir),Xr.wallet_not_unlocked);let e=await gw(Ge(this,wa),{vaults:Sg(this,kg,SC).call(this,Ge(this,tn))});await this.storage.setItem(this.STORAGE_KEY,JSON.stringify(e)),this.emit("update")}getVaultClass(e){let t=TC.Vaults.find(n=>n.type===e);return Yr(t,Xr.invalid_vault_type),t}},V4=TC;tn=new WeakMap;wa=new WeakMap;Ir=new WeakMap;kg=new WeakSet;SC=function(e){return e.map(({title:t,type:n,vault:r})=>({title:t,type:n,data:r.serialize()}))};Bg=new WeakSet;xC=function(e){return e.map(({title:t,type:n,data:r})=>{let i=this.getVaultClass(n);return{title:t,type:n,vault:new i(r)}})};Ye(V4,"Vaults",[CC,IC]);var G4=class{constructor(e){throw new b(I.NOT_IMPLEMENTED,"Not implemented.")}serialize(){throw new b(I.NOT_IMPLEMENTED,"Not implemented.")}getAccounts(){throw new b(I.NOT_IMPLEMENTED,"Not implemented.")}addAccount(){throw new b(I.NOT_IMPLEMENTED,"Not implemented.")}exportAccount(e){throw new b(I.NOT_IMPLEMENTED,"Not implemented.")}getWallet(e){throw new b(I.NOT_IMPLEMENTED,"Not implemented.")}};Ye(G4,"type");var NC=(e=>(e.ping="ping",e.version="version",e.connect="connect",e.disconnect="disconnect",e.isConnected="isConnected",e.accounts="accounts",e.currentAccount="currentAccount",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))(NC||{}),Gg=(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))(Gg||{}),H4="FuelConnector",Z4=class{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()}},X4=class extends W4{name="";metadata={};connected=!1;installed=!1;events=Gg;async ping(){throw new Error("Method not implemented.")}async version(){throw new Error("Method not implemented.")}async isConnected(){throw new Error("Method not implemented.")}async accounts(){throw new Error("Method not implemented.")}async connect(){throw new Error("Method not implemented.")}async disconnect(){throw new Error("Method not implemented.")}async signMessage(e,t){throw new Error("Method not implemented.")}async signTransaction(e,t){throw new Error("Method not implemented.")}async sendTransaction(e,t){throw new Error("Method not implemented.")}async currentAccount(){throw new Error("Method not implemented.")}async addAssets(e){throw new Error("Method not implemented.")}async addAsset(e){throw new Error("Method not implemented.")}async assets(){throw new Error("Method not implemented.")}async addNetwork(e){throw new Error("Method not implemented.")}async selectNetwork(e){throw new Error("Method not implemented.")}async networks(){throw new Error("Method not implemented.")}async currentNetwork(){throw new Error("Method not implemented.")}async addABI(e,t){throw new Error("Method not implemented.")}async getABI(e){throw new Error("Method not implemented.")}async hasABI(e){throw new Error("Method not implemented.")}on(e,t){return super.on(e,t),this}};function Y4(e,{cache:t,cacheTime:n,key:r}){return async(...i)=>{if(t[r]&&t[r]?.value)return t[r]?.value;clearTimeout(t[r]?.timeout);let a=await e(...i);return t[r]={timeout:Number(setTimeout(()=>{t[r]=null},n)),value:a},a}}function $4(){let e={};return e.promise=new Promise((t,n)=>{e.reject=n,e.resolve=t}),e}async function Gl(e,t=1050){let n=new Promise((r,i)=>{setTimeout(()=>{i(new Error("Promise timed out"))},t)});return Promise.race([n,e])}var K4=2e3,j4=5e3,{warn:eQ}=console,su=class extends X4{_storage=null;_connectors=[];_targetObject=null;_unsubscribes=[];_targetUnsubscribe;_pingCache={};_currentConnector;constructor(e=su.defaultConfig){super(),this.setMaxListeners(1e3),this._connectors=e.connectors??[],this._targetObject=this.getTargetObject(e.targetObject),this._storage=e.storage===void 0?this.getStorage():e.storage,this.setupMethods(),this.setDefaultConnector(),this._targetUnsubscribe=this.setupConnectorListener()}getTargetObject(e){return e||(typeof window<"u"?window:typeof document<"u"?document:null)}getStorage(){if(typeof window<"u")return new Z4(window.localStorage)}async setDefaultConnector(){let e=await this._storage?.getItem(su.STORAGE_KEY)||this._connectors[0]?.name;if(e)return this.selectConnector(e,{emitEvents:!1})}setupConnectorEvents(e){if(!this._currentConnector)return;let t=this._currentConnector;this._unsubscribes.map(n=>n()),this._unsubscribes=e.map(n=>{let r=(...i)=>this.emit(n,...i);return t.on(n,r),()=>t.off(n,r)})}async callMethod(e,...t){let n=await this.hasConnector();if(await this.pingConnector(),!this._currentConnector||!n)throw new Error(`No connector selected for calling ${e}. Use hasConnector before executing other methods.`);if(typeof this._currentConnector[e]=="function")return this._currentConnector[e](...t)}setupMethods(){Object.values(NC).forEach(e=>{this[e]=async(...t)=>this.callMethod(e,...t)})}async fetchConnectorStatus(e){let t=Date.now(),[n,r]=await Promise.allSettled([Gl(e.isConnected()),Gl(this.pingConnector(e))]);return t<(e._latestUpdate||0)||(e._latestUpdate=Date.now(),e.installed=r.status==="fulfilled"&&r.value,e.connected=n.status==="fulfilled"&&n.value),{installed:e.installed,connected:e.connected}}async fetchConnectorsStatus(){return Promise.all(this._connectors.map(async e=>this.fetchConnectorStatus(e)))}async pingConnector(e){let t=e||this._currentConnector;if(!t)return!1;try{return await Y4(async()=>Gl(t.ping()),{key:t.name,cache:this._pingCache,cacheTime:j4})()}catch{throw new Error("Current connector is not available.")}}setupConnectorListener=()=>{let{_targetObject:e}=this,t=H4;if(e?.on)return e.on(t,this.addConnector),()=>{e.off?.(t,this.addConnector)};if(e?.addEventListener){let n=r=>{this.addConnector(r.detail)};return e.addEventListener(t,n),()=>{e.removeEventListener?.(t,n)}}return()=>{}};addConnector=async e=>{this.getConnector(e)||this._connectors.push(e),await this.fetchConnectorStatus(e),this.emit(this.events.connectors,this._connectors),this._currentConnector||await this.selectConnector(e.name,{emitEvents:!1})};triggerConnectorEvents=async()=>{let[e,t,n]=await Promise.all([this.isConnected(),this.networks(),this.currentNetwork()]);if(this.emit(this.events.connection,e),this.emit(this.events.networks,t),this.emit(this.events.currentNetwork,n),e){let[r,i]=await Promise.all([this.accounts(),this.currentAccount()]);this.emit(this.events.accounts,r),this.emit(this.events.currentAccount,i)}};getConnector=e=>this._connectors.find(t=>{let n=typeof e=="string"?e:e.name;return t.name===n||t===e})||null;async connectors(){return await this.fetchConnectorsStatus(),this._connectors}async selectConnector(e,t={emitEvents:!0}){let n=this.getConnector(e);if(!n)return!1;if(this._currentConnector?.name===e)return!0;let{installed:r}=await this.fetchConnectorStatus(n);return r?(this._currentConnector=n,this.emit(this.events.currentConnector,n),this.setupConnectorEvents(Object.values(Gg)),await this._storage?.setItem(su.STORAGE_KEY,n.name),t.emitEvents&&this.triggerConnectorEvents(),!0):!1}currentConnector(){return this._currentConnector}async hasConnector(){if(this._currentConnector)return!0;let e=$4();return this.once(this.events.currentConnector,()=>{e.resolve(!0)}),Gl(e.promise,K4).then(()=>!0).catch(()=>!1)}async hasWallet(){return this.hasConnector()}async getProvider(e){return eQ("getProvider is deprecated and is going to be removed in the future, use getWallet instead."),this._getProvider(e)}async _getProvider(e){let t;if(e&&"getTransactionResponse"in e)t=e;else if(e&&"chainId"in e&&"url"in e)t=await Zl.create(e.url);else{if(e)throw new b(I.INVALID_PROVIDER,"Provider is not valid.");{let n=await this.currentNetwork();t=await Zl.create(n.url)}}return t}async getWallet(e,t){let n=await this._getProvider(t);return new qg(e,n,this)}unsubscribe(){this._unsubscribes.map(e=>e()),this._targetUnsubscribe(),this.removeAllListeners()}async clean(){await this._storage?.removeItem(su.STORAGE_KEY)}async destroy(){this.unsubscribe(),await this.clean()}},RC=su;Ye(RC,"STORAGE_KEY","fuel-current-connector");Ye(RC,"defaultConfig",{});var PC=Vn(Ul(),1);var kt=Vn(Ul(),1);function kC(e,t){if(!e)throw new b(I.TRANSACTION_ERROR,t)}function OC(e){return e.reduce((t,n,r)=>{let{program:i,externalAbis:a}=n.getCallConfig();return r===0?(t.main=i.interface.jsonAbi,t.otherContractsAbis={}):t.otherContractsAbis[i.id.toB256()]=i.interface.jsonAbi,t.otherContractsAbis={...t.otherContractsAbis,...a},t},{})}var DC=class{#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 Y(this.#e.reduce((e,t)=>(e.push(t.to_bytes()),e),[]))}toHex(){return O(this.toBytes())}toString(){return`Program:
|
|
829
|
-
${JSON.stringify(this.#e,null,2)}`}byteLength(){return this.toBytes().byteLength}},tQ=e=>$f+Yf({maxInputs:e}),Fj=ie+pa+Al+ie+ie;function nQ(e){let t=[...e.receipts],n,r;if(t.forEach(a=>{a.type===ne.ScriptResult?n=a:(a.type===ne.Return||a.type===ne.ReturnData||a.type===ne.Revert)&&(r=a)}),!n||!r)throw new b(I.SCRIPT_REVERTED,"Transaction reverted.");return{code:n.result,gasUsed:n.gasUsed,receipts:t,scriptResultReceipt:n,returnReceipt:r,callResult:e}}function Wg(e,t,n=[]){try{let r=nQ(e);return t(r)}catch(r){if(r.code===I.SCRIPT_REVERTED){let i=e?.dryRunStatus?.reason;throw $l({logs:n,receipts:e.receipts,statusReason:i})}throw r}}function rQ(e,t,n){return Wg(e,r=>{if(r.returnReceipt.type===ne.Revert)throw new b(I.SCRIPT_REVERTED,`Script Reverted. Logs: ${JSON.stringify(n)}`);if(r.returnReceipt.type!==ne.Return&&r.returnReceipt.type!==ne.ReturnData){let{type:a}=r.returnReceipt;throw new b(I.SCRIPT_REVERTED,`Script Return Type [${a}] Invalid. Logs: ${JSON.stringify({logs:n,receipt:r.returnReceipt})}`)}let i;return r.returnReceipt.type===ne.Return&&(i=r.returnReceipt.val),r.returnReceipt.type===ne.ReturnData&&(i=t.func.decodeOutput(r.returnReceipt.data)[0]),i},n)}var du=class{bytes;scriptDataEncoder;scriptResultDecoder;constructor(e,t,n){this.bytes=R(e),this.scriptDataEncoder=t,this.scriptResultDecoder=n}static getScriptDataOffsetWithScriptBytes(e,t){return Yf({maxInputs:t})+$f+e}getScriptDataOffset(e){return du.getScriptDataOffsetWithScriptBytes(this.bytes.length,e)}encodeScriptData(e){let t=this.scriptDataEncoder(e);return ArrayBuffer.isView(t)?t:(this.bytes=R(t.script),t.data)}decodeCallResult(e,t=[]){return Wg(e,this.scriptResultDecoder,t)}},MC={assetIdOffset:0,amountOffset:0,gasForwardedOffset:0,callDataOffset:0},iQ=Ie,FC=({callDataOffset:e,gasForwardedOffset:t,amountOffset:n,assetIdOffset:r})=>{let i=new DC(kt.movi(16,e),kt.movi(17,n),kt.lw(17,17,0),kt.movi(18,r));return t?i.push(kt.movi(19,t),kt.lw(19,19,0),kt.call(16,17,18,19)):i.push(kt.call(16,17,18,kt.RegId.cgas().to_u8())),i};function BC(e){if(!e.length)return new Uint8Array;let t=new DC;for(let n=0;n<e.length;n+=1)t.extend(FC(e[n]).entries());return t.push(kt.ret(1)),t.toBytes()}var aQ=e=>e===ne.Return||e===ne.ReturnData,sQ=(e,t)=>e.find(({type:n,from:r,to:i})=>n===ne.Call&&r===iQ&&i===t),oQ=e=>t=>{if(bn(t.code)!==0)throw new b(I.SCRIPT_REVERTED,"Transaction reverted.");let n=sQ(t.receipts,e.toB256()),r=v(n?.is);return t.receipts.filter(({type:a})=>aQ(a)).flatMap(a=>r.eq(v(a.is))?a.type===ne.Return?[new q("u64").encode(a.val)]:a.type===ne.ReturnData?[R(a.data)]:[new Uint8Array]:[])},cQ=(e,t,n=[])=>Wg(e,oQ(t),n),uQ=e=>e.reduce((t,n)=>{let r={...MC};return n.gas&&(r.gasForwardedOffset=1),t+FC(r).byteLength()},kt.Instruction.size()),lQ=(e,t)=>new du(BC(new Array(e.length).fill(MC)),n=>{let r=n.length;if(r===0)return{data:new Uint8Array,script:new Uint8Array};let i=uQ(n),a=(8-i%8)%8,s=i+a,o=tQ(t.toNumber())+s,c=[],u=o,d=[];for(let A=0;A<r;A+=1){let w=n[A],C=u,x=C+ie,S=x+pa,N=S+Al+ie+ie,F=N+w.fnSelectorBytes.byteLength,M=R(w.data),X=0;d.push(new q("u64").encode(w.amount||0)),d.push(new G().encode(w.assetId?.toString()||Ie)),d.push(w.contractId.toBytes()),d.push(new q("u64").encode(N)),d.push(new q("u64").encode(F)),d.push(w.fnSelectorBytes),d.push(M),w.gas&&(d.push(new q("u64").encode(w.gas)),X=F+M.byteLength);let H={amountOffset:C,assetIdOffset:x,gasForwardedOffset:X,callDataOffset:S};c.push(H),u=o+Y(d).byteLength}let f=BC(c);return{data:Y(d),script:f}},()=>[new Uint8Array]);function dQ(e){return e.receipts.find(n=>n.type===ne.ScriptResult)?.gasUsed||v(0)}var LC=class{functionScopes;isMultiCall;gasUsed;value;constructor(e,t,n){this.functionScopes=Array.isArray(e)?e:[e],this.isMultiCall=n,this.value=this.getDecodedValue(t),this.gasUsed=dQ(t)}getFirstCallConfig(){if(this.functionScopes[0])return this.functionScopes[0].getCallConfig()}getAbiFromAllCalls(){return OC(this.functionScopes)}getDecodedValue(e){let t=this.getDecodedLogs(e.receipts),n=this.getFirstCallConfig();if(this.functionScopes.length===1&&n&&"bytes"in n.program)return rQ(e,n,t);let i=cQ(e,(n?.program).id,t).map((a,s)=>{let{func:o}=this.functionScopes[s].getCallConfig();return o.decodeOutput(a)?.[0]});return this.isMultiCall?i:i?.[0]}getDecodedLogs(e){if(!this.getFirstCallConfig())return[];let{main:n,otherContractsAbis:r}=this.getAbiFromAllCalls();return jl(e,n,r)}},QC=class extends LC{transactionId;transactionResponse;transactionResult;program;logs;constructor(e,t,n,r,i){super(e,n,i),this.transactionResponse=t,this.transactionResult=n,this.transactionId=this.transactionResponse.id,this.program=r,this.logs=this.getDecodedLogs(n.receipts)}static async build(e,t,n,r){let i=await t.waitForResult();return new QC(e,t,i,r,n)}},ed=class extends LC{callResult;constructor(e,t,n){super(e,t,n),this.callResult=t}static async build(e,t,n){return await new ed(e,t,n)}};function pQ(e){let{program:t,args:n,forward:r,func:i,callParameters:a,externalAbis:s}=e.getCallConfig(),o=i.encodeArguments(n);return{contractId:t.id,fnSelectorBytes:i.selectorBytes,data:o,assetId:r?.assetId,amount:r?.amount,gas:a?.gasLimit,externalContractsAbis:s}}var UC=class{transactionRequest;program;functionInvocationScopes=[];txParameters;requiredCoins=[];isMultiCall=!1;hasCallParamsGasLimit=!1;externalAbis={};addSignersCallback;constructor(e,t){this.program=e,this.isMultiCall=t,this.transactionRequest=new Ii}get calls(){if(!this.getProvider().getChain())throw new b(b.CODES.CHAIN_INFO_CACHE_EMPTY,"Provider chain info cache is empty. Please make sure to initialize the `Provider` properly by running `await Provider.create()``");return this.functionInvocationScopes.map(n=>pQ(n))}updateScriptRequest(){let e=this.getProvider(),{consensusParameters:{txParameters:{maxInputs:t}}}=e.getChain(),n=lQ(this.functionInvocationScopes,t);this.transactionRequest.setScript(n,this.calls)}updateContractInputAndOutput(){this.calls.forEach(t=>{t.contractId&&this.transactionRequest.addContractInputAndOutput(t.contractId),t.externalContractsAbis&&Object.keys(t.externalContractsAbis).forEach(n=>this.transactionRequest.addContractInputAndOutput(ee.fromB256(n)))})}getRequiredCoins(){return this.calls.map(t=>({assetId:String(t.assetId),amount:v(t.amount||0)})).filter(({assetId:t,amount:n})=>t&&!v(n).isZero())}updateRequiredCoins(){let e=this.getRequiredCoins(),t=(n,{assetId:r,amount:i})=>{let a=n.get(r)?.amount||v(0);return n.set(r,{assetId:String(r),amount:a.add(i)})};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 PC.initWasm(),this.updateScriptRequest(),this.updateRequiredCoins(),this.checkGasLimitTotal(),this.transactionRequest.type===Oe.Script&&(this.transactionRequest.abis=OC(this.functionInvocationScopes))}checkGasLimitTotal(){let e=this.calls.reduce((t,n)=>t.add(n.gas||0),v(0));if(this.transactionRequest.gasLimit.eq(0))this.transactionRequest.gasLimit=e;else if(e.gt(this.transactionRequest.gasLimit))throw new b(I.TRANSACTION_ERROR,"Transaction's gasLimit must be equal to or greater than the combined forwarded gas of all calls.")}async getTransactionCost(){let e=this.getProvider(),t=await this.getTransactionRequest();return await e.getTransactionCost(t,{resourcesOwner:this.program.account,quantitiesToContract:this.getRequiredCoins(),signatureCallback:this.addSignersCallback})}async fundWithRequiredCoins(){let e=await this.getTransactionRequest();e=zt(e);let t=await this.getTransactionCost(),{gasUsed:n,missingContractIds:r,outputVariables:i,maxFee:a}=t;return this.setDefaultTxParams(e,n,a),e.inputs=e.inputs.filter(s=>s.type!==he.Coin),r.forEach(s=>{e.addContractInputAndOutput(ee.fromString(s))}),e.addVariableOutputs(i),await this.program.account?.fund(e,t),this.addSignersCallback&&await this.addSignersCallback(e),e}txParams(e){this.txParameters=e;let t=this.transactionRequest;return t.tip=v(e.tip||t.tip),t.gasLimit=v(e.gasLimit||t.gasLimit),t.maxFee=e.maxFee?v(e.maxFee):t.maxFee,t.witnessLimit=e.witnessLimit?v(e.witnessLimit):t.witnessLimit,t.maturity=e.maturity||t.maturity,t.addVariableOutputs(this.txParameters?.variableOutputs||0),this}addContracts(e){return e.forEach(t=>{this.transactionRequest.addContractInputAndOutput(t.id),this.externalAbis[t.id.toB256()]=t.interface.jsonAbi}),this}addTransfer(e){let{amount:t,destination:n,assetId:r}=e,i=this.getProvider().getBaseAssetId();return this.transactionRequest=this.transactionRequest.addCoinOutput(ee.fromAddressOrString(n),t,r||i),this}addBatchTransfer(e){let t=this.getProvider().getBaseAssetId();return e.forEach(({destination:n,amount:r,assetId:i})=>{this.transactionRequest=this.transactionRequest.addCoinOutput(ee.fromAddressOrString(n),r,i||t)}),this}addSigners(e){return this.addSignersCallback=async t=>t.addAccountWitnesses(e),this}async getTransactionRequest(){return await this.prepareTransaction(),this.transactionRequest}async call(){kC(this.program.account,"Wallet is required!");let e=await this.fundWithRequiredCoins(),t=await this.program.account.sendTransaction(e,{awaitExecution:!0,estimateTxDependencies:!1});return QC.build(this.functionInvocationScopes,t,this.isMultiCall,this.program)}async simulate(){if(kC(this.program.account,"Wallet is required!"),!("populateTransactionWitnessesSignature"in this.program.account))throw new b(I.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 ed.build(this.functionInvocationScopes,t,this.isMultiCall)}async dryRun(){let{receipts:e}=await this.getTransactionCost(),t={receipts:e};return ed.build(this.functionInvocationScopes,t,this.isMultiCall)}async get(){let{receipts:e}=await this.getTransactionCost(),t={receipts:e};return ed.build(this.functionInvocationScopes,t,this.isMultiCall)}getProvider(){return this.program.provider}async getTransactionId(e){let t=e??await this.getProvider().getChainId();return(await this.getTransactionRequest()).getTransactionId(t)}setDefaultTxParams(e,t,n){let r=yr(this.txParameters?.gasLimit)||this.hasCallParamsGasLimit,i=yr(this.txParameters?.maxFee),{gasLimit:a,maxFee:s}=e;if(!r)e.gasLimit=t;else if(a.lt(t))throw new b(I.GAS_LIMIT_TOO_LOW,`Gas limit '${a}' is lower than the required: '${t}'.`);if(!i)e.maxFee=n;else if(n.gt(s))throw new b(I.MAX_FEE_TOO_LOW,`Max fee '${s}' is lower than the required: '${n}'.`)}},qC=class extends UC{func;callParameters;forward;args;constructor(e,t,n){super(e,!1),this.func=t,this.args=n||[],this.setArguments(...n),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 b(I.TRANSACTION_ERROR,`The target function ${this.func.name} cannot accept forwarded funds as it's not marked as 'payable'.`);this.forward=Xl(e.forward)}return this.setArguments(...this.args),this.updateRequiredCoins(),this}},fQ=class extends UC{constructor(e,t){super(e,!0),this.addCalls(t)}addCall(e){return super.addCalls([e])}addCalls(e){return super.addCalls(e)}},hQ=class{id;provider;interface;account;functions={};constructor(e,t,n){this.interface=t instanceof En?t:new En(t),this.id=ee.fromAddressOrString(e),n&&"provider"in n?(this.provider=n.provider,this.account=n):(this.provider=n,this.account=null),Object.keys(this.interface.functions).forEach(r=>{let i=this.interface.getFunction(r);Object.defineProperty(this.functions,i.name,{value:this.buildFunction(i),writable:!1})})}buildFunction(e){return(()=>{let t=(...n)=>new qC(this,e,n);return Object.defineProperty(t,"isReadOnly",{value:()=>e.isReadOnly(),writable:!1}),t})()}multiCall(e){return new fQ(this,e)}getBalance(e){return this.provider.getContractBalance(this.id,e)}};var oee=new du("0x24000000",()=>new Uint8Array(0),()=>{});var mQ=Object.defineProperty,gQ=(e,t)=>{for(var n in t)mQ(e,n,{get:t[n],enumerable:!0})},_Q={};gQ(_Q,{getContractId:()=>yQ,getContractRoot:()=>JC,getContractStorageRoot:()=>AQ,hexlifyWithPrefix:()=>vQ});var JC=e=>{let n=R(e),r=Ff(n,16384);return wg(r.map(i=>O(i)))},AQ=e=>{let t=new UE;return e.forEach(({key:n,value:r})=>t.update(We(n),r)),t.root},yQ=(e,t,n)=>{let r=JC(R(e));return We(Y(["0x4655454C",t,r,n]))},vQ=e=>O(e.startsWith("0x")?e:`0x${e}`);var zC="http://127.0.0.1:4000/v1/graphql";var vee=typeof process<"u"&&process?.env?.FUEL_NETWORK_URL||zC;BigInt.prototype.asBigDecimal=function(){return new Mt(this.toString())};BigInt.prototype.scaleDown=function(e){return Hg(this,e)};Hr.prototype.asBigDecimal=function(){return new Mt(this.toString(10))};Hr.prototype.scaleDown=function(e){return Hg(BigInt(this.toString(10)),e)};function Hg(e,t){let n=new Mt(10).pow(Number(t));return e.asBigDecimal().dividedBy(n)}var In=null;try{In=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 Je(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}Je.prototype.__isLong__;Object.defineProperty(Je.prototype,"__isLong__",{value:!0});function Ft(e){return(e&&e.__isLong__)===!0}function VC(e){var t=Math.clz32(e&-e);return e?31-t:t}Je.isLong=Ft;var GC={},WC={};function ba(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=WC[e],r)?r:(n=Re(e,0,!0),i&&(WC[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=GC[e],r)?r:(n=Re(e,e<0?-1:0,!1),i&&(GC[e]=n),n))}Je.fromInt=ba;function Sn(e,t){if(isNaN(e))return t?$r:Xn;if(t){if(e<0)return $r;if(e>=YC)return jC}else{if(e<=-ZC)return an;if(e+1>=ZC)return KC}return e<0?Sn(-e,t).neg():Re(e%Os|0,e/Os|0,t)}Je.fromNumber=Sn;function Re(e,t,n){return new Je(e,t,n)}Je.fromBits=Re;var td=Math.pow;function Xg(e,t,n){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(n=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?$r:Xn;if(n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return Xg(e.substring(1),t,n).neg();for(var i=Sn(td(n,8)),a=Xn,s=0;s<e.length;s+=8){var o=Math.min(8,e.length-s),c=parseInt(e.substring(s,s+o),n);if(o<8){var u=Sn(td(n,o));a=a.mul(u).add(Sn(c))}else a=a.mul(i),a=a.add(Sn(c))}return a.unsigned=t,a}Je.fromString=Xg;function Yn(e,t){return typeof e=="number"?Sn(e,t):typeof e=="string"?Xg(e,t):Re(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Je.fromValue=Yn;var HC=65536,wQ=1<<24,Os=HC*HC,YC=Os*Os,ZC=YC/2,XC=ba(wQ),Xn=ba(0);Je.ZERO=Xn;var $r=ba(0,!0);Je.UZERO=$r;var Bs=ba(1);Je.ONE=Bs;var $C=ba(1,!0);Je.UONE=$C;var Zg=ba(-1);Je.NEG_ONE=Zg;var KC=Re(-1,2147483647,!1);Je.MAX_VALUE=KC;var jC=Re(-1,-1,!0);Je.MAX_UNSIGNED_VALUE=jC;var an=Re(0,-2147483648,!1);Je.MIN_VALUE=an;var U=Je.prototype;U.toInt=function(){return this.unsigned?this.low>>>0:this.low};U.toNumber=function(){return this.unsigned?(this.high>>>0)*Os+(this.low>>>0):this.high*Os+(this.low>>>0)};U.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(an)){var n=Sn(t),r=this.div(n),i=r.mul(n).sub(this);return r.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=Sn(td(t,6),this.unsigned),s=this,o="";;){var c=s.div(a),u=s.sub(c.mul(a)).toInt()>>>0,d=u.toString(t);if(s=c,s.isZero())return d+o;for(;d.length<6;)d="0"+d;o=""+d+o}};U.getHighBits=function(){return this.high};U.getHighBitsUnsigned=function(){return this.high>>>0};U.getLowBits=function(){return this.low};U.getLowBitsUnsigned=function(){return this.low>>>0};U.getNumBitsAbs=function(){if(this.isNegative())return this.eq(an)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,n=31;n>0&&!(t&1<<n);n--);return this.high!=0?n+33:n+1};U.isZero=function(){return this.high===0&&this.low===0};U.eqz=U.isZero;U.isNegative=function(){return!this.unsigned&&this.high<0};U.isPositive=function(){return this.unsigned||this.high>=0};U.isOdd=function(){return(this.low&1)===1};U.isEven=function(){return(this.low&1)===0};U.equals=function(t){return Ft(t)||(t=Yn(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};U.eq=U.equals;U.notEquals=function(t){return!this.eq(t)};U.neq=U.notEquals;U.ne=U.notEquals;U.lessThan=function(t){return this.comp(t)<0};U.lt=U.lessThan;U.lessThanOrEqual=function(t){return this.comp(t)<=0};U.lte=U.lessThanOrEqual;U.le=U.lessThanOrEqual;U.greaterThan=function(t){return this.comp(t)>0};U.gt=U.greaterThan;U.greaterThanOrEqual=function(t){return this.comp(t)>=0};U.gte=U.greaterThanOrEqual;U.ge=U.greaterThanOrEqual;U.compare=function(t){if(Ft(t)||(t=Yn(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?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};U.comp=U.compare;U.negate=function(){return!this.unsigned&&this.eq(an)?an:this.not().add(Bs)};U.neg=U.negate;U.add=function(t){Ft(t)||(t=Yn(t));var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,a=this.low&65535,s=t.high>>>16,o=t.high&65535,c=t.low>>>16,u=t.low&65535,d=0,f=0,h=0,A=0;return A+=a+u,h+=A>>>16,A&=65535,h+=i+c,f+=h>>>16,h&=65535,f+=r+o,d+=f>>>16,f&=65535,d+=n+s,d&=65535,Re(h<<16|A,d<<16|f,this.unsigned)};U.subtract=function(t){return Ft(t)||(t=Yn(t)),this.add(t.neg())};U.sub=U.subtract;U.multiply=function(t){if(this.isZero())return this;if(Ft(t)||(t=Yn(t)),In){var n=In.mul(this.low,this.high,t.low,t.high);return Re(n,In.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?$r:Xn;if(this.eq(an))return t.isOdd()?an:Xn;if(t.eq(an))return this.isOdd()?an:Xn;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(XC)&&t.lt(XC))return Sn(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=this.high&65535,a=this.low>>>16,s=this.low&65535,o=t.high>>>16,c=t.high&65535,u=t.low>>>16,d=t.low&65535,f=0,h=0,A=0,w=0;return w+=s*d,A+=w>>>16,w&=65535,A+=a*d,h+=A>>>16,A&=65535,A+=s*u,h+=A>>>16,A&=65535,h+=i*d,f+=h>>>16,h&=65535,h+=a*u,f+=h>>>16,h&=65535,h+=s*c,f+=h>>>16,h&=65535,f+=r*d+i*u+a*c+s*o,f&=65535,Re(A<<16|w,f<<16|h,this.unsigned)};U.mul=U.multiply;U.divide=function(t){if(Ft(t)||(t=Yn(t)),t.isZero())throw Error("division by zero");if(In){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var n=(this.unsigned?In.div_u:In.div_s)(this.low,this.high,t.low,t.high);return Re(n,In.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?$r:Xn;var r,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return $r;if(t.gt(this.shru(1)))return $C;a=$r}else{if(this.eq(an)){if(t.eq(Bs)||t.eq(Zg))return an;if(t.eq(an))return Bs;var s=this.shr(1);return r=s.div(t).shl(1),r.eq(Xn)?t.isNegative()?Bs:Zg:(i=this.sub(t.mul(r)),a=r.add(i.div(t)),a)}else if(t.eq(an))return this.unsigned?$r:Xn;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=Xn}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),c=o<=48?1:td(2,o-48),u=Sn(r),d=u.mul(t);d.isNegative()||d.gt(i);)r-=c,u=Sn(r,this.unsigned),d=u.mul(t);u.isZero()&&(u=Bs),a=a.add(u),i=i.sub(d)}return a};U.div=U.divide;U.modulo=function(t){if(Ft(t)||(t=Yn(t)),In){var n=(this.unsigned?In.rem_u:In.rem_s)(this.low,this.high,t.low,t.high);return Re(n,In.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};U.mod=U.modulo;U.rem=U.modulo;U.not=function(){return Re(~this.low,~this.high,this.unsigned)};U.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};U.clz=U.countLeadingZeros;U.countTrailingZeros=function(){return this.low?VC(this.low):VC(this.high)+32};U.ctz=U.countTrailingZeros;U.and=function(t){return Ft(t)||(t=Yn(t)),Re(this.low&t.low,this.high&t.high,this.unsigned)};U.or=function(t){return Ft(t)||(t=Yn(t)),Re(this.low|t.low,this.high|t.high,this.unsigned)};U.xor=function(t){return Ft(t)||(t=Yn(t)),Re(this.low^t.low,this.high^t.high,this.unsigned)};U.shiftLeft=function(t){return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Re(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Re(0,this.low<<t-32,this.unsigned)};U.shl=U.shiftLeft;U.shiftRight=function(t){return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Re(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Re(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};U.shr=U.shiftRight;U.shiftRightUnsigned=function(t){return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Re(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Re(this.high,0,this.unsigned):Re(this.high>>>t-32,0,this.unsigned)};U.shru=U.shiftRightUnsigned;U.shr_u=U.shiftRightUnsigned;U.rotateLeft=function(t){var n;return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Re(this.high,this.low,this.unsigned):t<32?(n=32-t,Re(this.low<<t|this.high>>>n,this.high<<t|this.low>>>n,this.unsigned)):(t-=32,n=32-t,Re(this.high<<t|this.low>>>n,this.low<<t|this.high>>>n,this.unsigned))};U.rotl=U.rotateLeft;U.rotateRight=function(t){var n;return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Re(this.high,this.low,this.unsigned):t<32?(n=32-t,Re(this.high<<n|this.low>>>t,this.low<<n|this.high>>>t,this.unsigned)):(t-=32,n=32-t,Re(this.low<<n|this.high>>>t,this.high<<n|this.low>>>t,this.unsigned))};U.rotr=U.rotateRight;U.toSigned=function(){return this.unsigned?Re(this.low,this.high,!1):this};U.toUnsigned=function(){return this.unsigned?this:Re(this.low,this.high,!0)};U.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};U.toBytesLE=function(){var t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};U.toBytesBE=function(){var t=this.high,n=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};Je.fromBytes=function(t,n,r){return r?Je.fromBytesLE(t,n):Je.fromBytesBE(t,n)};Je.fromBytesLE=function(t,n){return new Je(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)};Je.fromBytesBE=function(t,n){return new Je(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)};var Kr=Je;var g=Vn(Ds(),1);var cd=Vn(Ds(),1);function G0(){return{}}var mu={encode(e,t=cd.default.Writer.create()){return t},decode(e,t){let n=e instanceof cd.default.Reader?e:cd.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=G0();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return mu.fromPartial(e??{})},fromPartial(e){return G0()}};var hn=Vn(Ds(),1),Ia;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ia||(Ia={}));function kQ(e){switch(e){case 0:case"NULL_VALUE":return Ia.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Ia.UNRECOGNIZED}}function BQ(e){switch(e){case Ia.NULL_VALUE:return"NULL_VALUE";case Ia.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function p_(){return{fields:{}}}var B={encode(e,t=hn.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{r!==void 0&&m_.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=p_();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=m_.decode(n,n.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:H0(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=r,t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=i}))}return t},create(e){return B.fromPartial(e??{})},fromPartial(e){let t=p_();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=i),n),{}),t},wrap(e){let t=p_();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function W0(){return{key:"",value:void 0}}var m_={encode(e,t=hn.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&jr.encode(jr.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=W0();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=jr.unwrap(jr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:Ms(e.key)?globalThis.String(e.key):"",value:Ms(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 m_.fromPartial(e??{})},fromPartial(e){let t=W0();return t.key=e.key??"",t.value=e.value??void 0,t}};function f_(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var jr={encode(e,t=hn.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&&B.encode(B.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Tr.encode(Tr.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=f_();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==17)break;i.numberValue=n.double();continue;case 3:if(a!==26)break;i.stringValue=n.string();continue;case 4:if(a!==32)break;i.boolValue=n.bool();continue;case 5:if(a!==42)break;i.structValue=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.listValue=Tr.unwrap(Tr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:Ms(e.nullValue)?kQ(e.nullValue):void 0,numberValue:Ms(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:Ms(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:Ms(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:H0(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=BQ(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 jr.fromPartial(e??{})},fromPartial(e){let t=f_();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=f_();if(e===null)t.nullValue=Ia.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 h_(){return{values:[]}}var Tr={encode(e,t=hn.default.Writer.create()){for(let n of e.values)jr.encode(jr.wrap(n),t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=h_();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(jr.unwrap(jr.decode(n,n.uint32())));continue}if((a&7)===4||a===0)break;n.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 Tr.fromPartial(e??{})},fromPartial(e){let t=h_();return t.values=e.values?.map(n=>n)||[],t},wrap(e){let t=h_();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function H0(e){return typeof e=="object"&&e!==null}function Ms(e){return e!=null}var Sa=Vn(Ds(),1);function Z0(){return{seconds:BigInt("0"),nanos:0}}var Fe={encode(e,t=Sa.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 n=e instanceof Sa.default.Reader?e:Sa.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Z0();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.seconds=OQ(n.int64());continue;case 2:if(a!==16)break;i.nanos=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{seconds:X0(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:X0(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 Fe.fromPartial(e??{})},fromPartial(e){let t=Z0();return t.seconds=e.seconds??BigInt("0"),t.nanos=e.nanos??0,t}};function OQ(e){return BigInt(e.toString())}Sa.default.util.Long!==Kr&&(Sa.default.util.Long=Kr,Sa.default.configure());function X0(e){return e!=null}var Be=Vn(Ds(),1);var Y0;(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"})(Y0||(Y0={}));var $0;(function(e){e[e.ORG_MEMBER=0]="ORG_MEMBER",e[e.ORG_ADMIN=1]="ORG_ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($0||($0={}));var K0;(function(e){e[e.AND=0]="AND",e[e.OR=1]="OR",e[e.THEN=2]="THEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(K0||(K0={}));var j0;(function(e){e[e.READ=0]="READ",e[e.WRITE=1]="WRITE",e[e.ADMIN=2]="ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(j0||(j0={}));var eI;(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.UNRECOGNIZED=-1]="UNRECOGNIZED"})(eI||(eI={}));var tI;(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"})(tI||(tI={}));var nI;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(nI||(nI={}));var rI;(function(e){e[e.SENTIO=0]="SENTIO",e[e.SUBGRAPH=1]="SUBGRAPH",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(rI||(rI={}));var iI;(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"})(iI||(iI={}));var aI;(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_COHORTS=13]="IN_COHORTS",e[e.NOT_IN_COHORTS=14]="NOT_IN_COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(aI||(aI={}));var sI;(function(e){e[e.EVENTS=0]="EVENTS",e[e.COHORTS=1]="COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(sI||(sI={}));var oI;(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"})(oI||(oI={}));var cI;(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"})(cI||(cI={}));var uI;(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"})(uI||(uI={}));var lI;(function(e){e[e.PROCESSOR=0]="PROCESSOR",e[e.UI=1]="UI",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(lI||(lI={}));var dI;(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"})(dI||(dI={}));var pI;(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.UNRECOGNIZED=-1]="UNRECOGNIZED"})(pI||(pI={}));var fI;(function(e){e[e.OnOrAfter=0]="OnOrAfter",e[e.On=1]="On",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(fI||(fI={}));var hI;(function(e){e[e.Disable=0]="Disable",e[e.FirstInTimeRange=1]="FirstInTimeRange",e[e.FirstInGlobal=2]="FirstInGlobal",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(hI||(hI={}));var mI;(function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(mI||(mI={}));var gI;(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.UNRECOGNIZED=-1]="UNRECOGNIZED"})(gI||(gI={}));var dt;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(dt||(dt={}));function PQ(e){switch(e){case 0:case"NULL_VALUE":return dt.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return dt.UNRECOGNIZED}}function DQ(e){switch(e){case dt.NULL_VALUE:return"NULL_VALUE";case dt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function _I(){return{symbol:void 0,address:void 0}}var Ti={encode(e,t=Be.default.Writer.create()){return e.symbol!==void 0&&t.uint32(10).string(e.symbol),e.address!==void 0&&Fs.encode(e.address,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_I();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.symbol=n.string();continue;case 2:if(a!==18)break;i.address=Fs.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{symbol:ot(e.symbol)?globalThis.String(e.symbol):void 0,address:ot(e.address)?Fs.fromJSON(e.address):void 0}},toJSON(e){let t={};return e.symbol!==void 0&&(t.symbol=e.symbol),e.address!==void 0&&(t.address=Fs.toJSON(e.address)),t},create(e){return Ti.fromPartial(e??{})},fromPartial(e){let t=_I();return t.symbol=e.symbol??void 0,t.address=e.address!==void 0&&e.address!==null?Fs.fromPartial(e.address):void 0,t}};function AI(){return{address:"",chain:""}}var Fs={encode(e,t=Be.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 n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=AI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.chain=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:ot(e.address)?globalThis.String(e.address):"",chain:ot(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 Fs.fromPartial(e??{})},fromPartial(e){let t=AI();return t.address=e.address??"",t.chain=e.chain??"",t}};function yI(){return{nullValue:void 0,intValue: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}}var Gt={encode(e,t=Be.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.intValue!==void 0&&t.uint32(16).int32(e.intValue),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&&Fe.encode(MQ(e.timestampValue),t.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&yt.encode(e.bigintValue,t.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&Ls.encode(e.bigdecimalValue,t.uint32(74).fork()).ldelim(),e.listValue!==void 0&&Tn.encode(e.listValue,t.uint32(82).fork()).ldelim(),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=yI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==16)break;i.intValue=n.int32();continue;case 3:if(a!==25)break;i.floatValue=n.double();continue;case 4:if(a!==34)break;i.bytesValue=n.bytes();continue;case 5:if(a!==40)break;i.boolValue=n.bool();continue;case 6:if(a!==50)break;i.stringValue=n.string();continue;case 7:if(a!==58)break;i.timestampValue=TI(Fe.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.bigintValue=yt.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.bigdecimalValue=Ls.decode(n,n.uint32());continue;case 10:if(a!==82)break;i.listValue=Tn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:ot(e.nullValue)?PQ(e.nullValue):void 0,intValue:ot(e.intValue)?globalThis.Number(e.intValue):void 0,floatValue:ot(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:ot(e.bytesValue)?SI(e.bytesValue):void 0,boolValue:ot(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:ot(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:ot(e.timestampValue)?FQ(e.timestampValue):void 0,bigintValue:ot(e.bigintValue)?yt.fromJSON(e.bigintValue):void 0,bigdecimalValue:ot(e.bigdecimalValue)?Ls.fromJSON(e.bigdecimalValue):void 0,listValue:ot(e.listValue)?Tn.fromJSON(e.listValue):void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=DQ(e.nullValue)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.floatValue!==void 0&&(t.floatValue=e.floatValue),e.bytesValue!==void 0&&(t.bytesValue=xI(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=yt.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(t.bigdecimalValue=Ls.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(t.listValue=Tn.toJSON(e.listValue)),t},create(e){return Gt.fromPartial(e??{})},fromPartial(e){let t=yI();return t.nullValue=e.nullValue??void 0,t.intValue=e.intValue??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?yt.fromPartial(e.bigintValue):void 0,t.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?Ls.fromPartial(e.bigdecimalValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?Tn.fromPartial(e.listValue):void 0,t}};function vI(){return{fields:{}}}var At={encode(e,t=Be.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{g_.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=vI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=g_.decode(n,n.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:LQ(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=Gt.fromJSON(r),t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=Gt.toJSON(i)}))}return t},create(e){return At.fromPartial(e??{})},fromPartial(e){let t=vI();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=Gt.fromPartial(i)),n),{}),t}};function wI(){return{key:"",value:void 0}}var g_={encode(e,t=Be.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Gt.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=wI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=Gt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:ot(e.key)?globalThis.String(e.key):"",value:ot(e.value)?Gt.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=Gt.toJSON(e.value)),t},create(e){return g_.fromPartial(e??{})},fromPartial(e){let t=wI();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?Gt.fromPartial(e.value):void 0,t}};function bI(){return{values:[]}}var Tn={encode(e,t=Be.default.Writer.create()){for(let n of e.values)Gt.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=bI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(Gt.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(t=>Gt.fromJSON(t)):[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values.map(n=>Gt.toJSON(n))),t},create(e){return Tn.fromPartial(e??{})},fromPartial(e){let t=bI();return t.values=e.values?.map(n=>Gt.fromPartial(n))||[],t}};function EI(){return{entities:[]}}var Ni={encode(e,t=Be.default.Writer.create()){for(let n of e.entities)At.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=EI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(At.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>At.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(n=>At.toJSON(n))),t},create(e){return Ni.fromPartial(e??{})},fromPartial(e){let t=EI();return t.entities=e.entities?.map(n=>At.fromPartial(n))||[],t}};function CI(){return{value:void 0,exp:0}}var Ls={encode(e,t=Be.default.Writer.create()){return e.value!==void 0&&yt.encode(e.value,t.uint32(10).fork()).ldelim(),e.exp!==0&&t.uint32(16).int32(e.exp),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=CI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=yt.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.exp=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{value:ot(e.value)?yt.fromJSON(e.value):void 0,exp:ot(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=yt.toJSON(e.value)),e.exp!==0&&(t.exp=Math.round(e.exp)),t},create(e){return Ls.fromPartial(e??{})},fromPartial(e){let t=CI();return t.value=e.value!==void 0&&e.value!==null?yt.fromPartial(e.value):void 0,t.exp=e.exp??0,t}};function II(){return{negative:!1,data:new Uint8Array(0)}}var yt={encode(e,t=Be.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 n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=II();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.negative=n.bool();continue;case 2:if(a!==18)break;i.data=n.bytes();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{negative:ot(e.negative)?globalThis.Boolean(e.negative):!1,data:ot(e.data)?SI(e.data):new Uint8Array(0)}},toJSON(e){let t={};return e.negative!==!1&&(t.negative=e.negative),e.data.length!==0&&(t.data=xI(e.data)),t},create(e){return yt.fromPartial(e??{})},fromPartial(e){let t=II();return t.negative=e.negative??!1,t.data=e.data??new Uint8Array(0),t}};function SI(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let t=globalThis.atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}}function xI(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let t=[];return e.forEach(n=>{t.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(t.join(""))}}function MQ(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function TI(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function FQ(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):TI(Fe.fromJSON(e))}Be.default.util.Long!==Kr&&(Be.default.util.Long=Kr,Be.default.configure());function LQ(e){return typeof e=="object"&&e!==null}function ot(e){return e!=null}var bt;(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"})(bt||(bt={}));function QQ(e){switch(e){case 0:case"UNKNOWN_TYPE":return bt.UNKNOWN_TYPE;case 1:case"COUNTER":return bt.COUNTER;case 2:case"GAUGE":return bt.GAUGE;case 3:case"HISTOGRAM":return bt.HISTOGRAM;case-1:case"UNRECOGNIZED":default:return bt.UNRECOGNIZED}}function UQ(e){switch(e){case bt.UNKNOWN_TYPE:return"UNKNOWN_TYPE";case bt.COUNTER:return"COUNTER";case bt.GAUGE:return"GAUGE";case bt.HISTOGRAM:return"HISTOGRAM";case bt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var pt;(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"})(pt||(pt={}));function qQ(e){switch(e){case 0:case"COUNT":return pt.COUNT;case 1:case"SUM":return pt.SUM;case 2:case"AVG":return pt.AVG;case 3:case"MIN":return pt.MIN;case 4:case"MAX":return pt.MAX;case 5:case"LAST":return pt.LAST;case-1:case"UNRECOGNIZED":default:return pt.UNRECOGNIZED}}function JQ(e){switch(e){case pt.COUNT:return"COUNT";case pt.SUM:return"SUM";case pt.AVG:return"AVG";case pt.MIN:return"MIN";case pt.MAX:return"MAX";case pt.LAST:return"LAST";case pt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var Rr;(function(e){e[e.ADDRESS=0]="ADDRESS",e[e.OBJECT=1]="OBJECT",e[e.WRAPPED_OBJECT=2]="WRAPPED_OBJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Rr||(Rr={}));function zQ(e){switch(e){case 0:case"ADDRESS":return Rr.ADDRESS;case 1:case"OBJECT":return Rr.OBJECT;case 2:case"WRAPPED_OBJECT":return Rr.WRAPPED_OBJECT;case-1:case"UNRECOGNIZED":default:return Rr.UNRECOGNIZED}}function VQ(e){switch(e){case Rr.ADDRESS:return"ADDRESS";case Rr.OBJECT:return"OBJECT";case Rr.WRAPPED_OBJECT:return"WRAPPED_OBJECT";case Rr.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var kr;(function(e){e[e.ERC20=0]="ERC20",e[e.ERC721=1]="ERC721",e[e.ERC1155=2]="ERC1155",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(kr||(kr={}));function GQ(e){switch(e){case 0:case"ERC20":return kr.ERC20;case 1:case"ERC721":return kr.ERC721;case 2:case"ERC1155":return kr.ERC1155;case-1:case"UNRECOGNIZED":default:return kr.UNRECOGNIZED}}function WQ(e){switch(e){case kr.ERC20:return"ERC20";case kr.ERC721:return"ERC721";case kr.ERC1155:return"ERC1155";case kr.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var ge;(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.COSMOS_CALL=14]="COSMOS_CALL",e[e.STARKNET_EVENT=15]="STARKNET_EVENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ge||(ge={}));function _x(e){switch(e){case 0:case"UNKNOWN":return ge.UNKNOWN;case 1:case"ETH_LOG":return ge.ETH_LOG;case 2:case"ETH_BLOCK":return ge.ETH_BLOCK;case 5:case"ETH_TRACE":return ge.ETH_TRACE;case 11:case"ETH_TRANSACTION":return ge.ETH_TRANSACTION;case 4:case"SOL_INSTRUCTION":return ge.SOL_INSTRUCTION;case 6:case"APT_EVENT":return ge.APT_EVENT;case 7:case"APT_CALL":return ge.APT_CALL;case 8:case"APT_RESOURCE":return ge.APT_RESOURCE;case 3:case"SUI_EVENT":return ge.SUI_EVENT;case 9:case"SUI_CALL":return ge.SUI_CALL;case 10:case"SUI_OBJECT":return ge.SUI_OBJECT;case 12:case"SUI_OBJECT_CHANGE":return ge.SUI_OBJECT_CHANGE;case 13:case"FUEL_CALL":return ge.FUEL_CALL;case 14:case"COSMOS_CALL":return ge.COSMOS_CALL;case 15:case"STARKNET_EVENT":return ge.STARKNET_EVENT;case-1:case"UNRECOGNIZED":default:return ge.UNRECOGNIZED}}function Ax(e){switch(e){case ge.UNKNOWN:return"UNKNOWN";case ge.ETH_LOG:return"ETH_LOG";case ge.ETH_BLOCK:return"ETH_BLOCK";case ge.ETH_TRACE:return"ETH_TRACE";case ge.ETH_TRANSACTION:return"ETH_TRANSACTION";case ge.SOL_INSTRUCTION:return"SOL_INSTRUCTION";case ge.APT_EVENT:return"APT_EVENT";case ge.APT_CALL:return"APT_CALL";case ge.APT_RESOURCE:return"APT_RESOURCE";case ge.SUI_EVENT:return"SUI_EVENT";case ge.SUI_CALL:return"SUI_CALL";case ge.SUI_OBJECT:return"SUI_OBJECT";case ge.SUI_OBJECT_CHANGE:return"SUI_OBJECT_CHANGE";case ge.FUEL_CALL:return"FUEL_CALL";case ge.COSMOS_CALL:return"COSMOS_CALL";case ge.STARKNET_EVENT:return"STARKNET_EVENT";case ge.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var wt;(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"})(wt||(wt={}));function HQ(e){switch(e){case 0:case"DEBUG":return wt.DEBUG;case 1:case"INFO":return wt.INFO;case 2:case"WARNING":return wt.WARNING;case 3:case"ERROR":return wt.ERROR;case 4:case"CRITICAL":return wt.CRITICAL;case-1:case"UNRECOGNIZED":default:return wt.UNRECOGNIZED}}function ZQ(e){switch(e){case wt.DEBUG:return"DEBUG";case wt.INFO:return"INFO";case wt.WARNING:return"WARNING";case wt.ERROR:return"ERROR";case wt.CRITICAL:return"CRITICAL";case wt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var ki;(function(e){e[e.AVG=0]="AVG",e[e.MEDIAN=1]="MEDIAN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ki||(ki={}));function bte(e){switch(e){case 0:case"AVG":return ki.AVG;case 1:case"MEDIAN":return ki.MEDIAN;case-1:case"UNRECOGNIZED":default:return ki.UNRECOGNIZED}}function Ete(e){switch(e){case ki.AVG:return"AVG";case ki.MEDIAN:return"MEDIAN";case ki.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var vt;(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"})(vt||(vt={}));function XQ(e){switch(e){case 0:case"STRING":return vt.STRING;case 1:case"DOUBLE":return vt.DOUBLE;case 2:case"BOOL":return vt.BOOL;case 3:case"TIMESTAMP":return vt.TIMESTAMP;case 4:case"BIG_INTEGER":return vt.BIG_INTEGER;case 5:case"BIG_DECIMAL":return vt.BIG_DECIMAL;case-1:case"UNRECOGNIZED":default:return vt.UNRECOGNIZED}}function YQ(e){switch(e){case vt.STRING:return"STRING";case vt.DOUBLE:return"DOUBLE";case vt.BOOL:return"BOOL";case vt.TIMESTAMP:return"TIMESTAMP";case vt.BIG_INTEGER:return"BIG_INTEGER";case vt.BIG_DECIMAL:return"BIG_DECIMAL";case vt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var de;(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"})(de||(de={}));function $Q(e){switch(e){case 0:case"EQ":return de.EQ;case 1:case"NE":return de.NE;case 2:case"GT":return de.GT;case 3:case"GE":return de.GE;case 4:case"LT":return de.LT;case 5:case"LE":return de.LE;case 6:case"IN":return de.IN;case 7:case"NOT_IN":return de.NOT_IN;case 8:case"LIKE":return de.LIKE;case 9:case"NOT_LIKE":return de.NOT_LIKE;case 10:case"HAS_ALL":return de.HAS_ALL;case 11:case"HAS_ANY":return de.HAS_ANY;case-1:case"UNRECOGNIZED":default:return de.UNRECOGNIZED}}function KQ(e){switch(e){case de.EQ:return"EQ";case de.NE:return"NE";case de.GT:return"GT";case de.GE:return"GE";case de.LT:return"LT";case de.LE:return"LE";case de.IN:return"IN";case de.NOT_IN:return"NOT_IN";case de.LIKE:return"LIKE";case de.NOT_LIKE:return"NOT_LIKE";case de.HAS_ALL:return"HAS_ALL";case de.HAS_ANY:return"HAS_ANY";case de.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function NI(){return{name:"",version:""}}var Qs={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=NI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.version=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",version:E(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 Qs.fromPartial(e??{})},fromPartial(e){let t=NI();return t.name=e.name??"",t.version=e.version??"",t}};function RI(){return{sequential:!1,forceExactBlockTime:!1,processBindingTimeout:0}}var Us={encode(e,t=g.default.Writer.create()){return e.sequential!==!1&&t.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&t.uint32(16).bool(e.forceExactBlockTime),e.processBindingTimeout!==0&&t.uint32(24).int32(e.processBindingTimeout),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=RI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.sequential=n.bool();continue;case 2:if(a!==16)break;i.forceExactBlockTime=n.bool();continue;case 3:if(a!==24)break;i.processBindingTimeout=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{sequential:E(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:E(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,processBindingTimeout:E(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0}},toJSON(e){let t={};return e.sequential!==!1&&(t.sequential=e.sequential),e.forceExactBlockTime!==!1&&(t.forceExactBlockTime=e.forceExactBlockTime),e.processBindingTimeout!==0&&(t.processBindingTimeout=Math.round(e.processBindingTimeout)),t},create(e){return Us.fromPartial(e??{})},fromPartial(e){let t=RI();return t.sequential=e.sequential??!1,t.forceExactBlockTime=e.forceExactBlockTime??!1,t.processBindingTimeout=e.processBindingTimeout??0,t}};function kI(){return{}}var yx={encode(e,t=g.default.Writer.create()){return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=kI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return yx.fromPartial(e??{})},fromPartial(e){return kI()}};function BI(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],eventTrackingConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}var vx={encode(e,t=g.default.Writer.create()){e.config!==void 0&&Qs.encode(e.config,t.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&Us.encode(e.executionConfig,t.uint32(74).fork()).ldelim();for(let n of e.contractConfigs)qs.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.templateInstances)rr.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.accountConfigs)Zs.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.metricConfigs)Nr.encode(n,t.uint32(42).fork()).ldelim();for(let n of e.eventTrackingConfigs)Gs.encode(n,t.uint32(50).fork()).ldelim();for(let n of e.exportConfigs)Ws.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.eventLogConfigs)ei.encode(n,t.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&Js.encode(e.dbSchema,t.uint32(82).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=BI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.config=Qs.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.executionConfig=Us.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.contractConfigs.push(qs.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.templateInstances.push(rr.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push(Zs.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.metricConfigs.push(Nr.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.eventTrackingConfigs.push(Gs.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.exportConfigs.push(Ws.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.eventLogConfigs.push(ei.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.dbSchema=Js.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{config:E(e.config)?Qs.fromJSON(e.config):void 0,executionConfig:E(e.executionConfig)?Us.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>qs.fromJSON(t)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>rr.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>Zs.fromJSON(t)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>Nr.fromJSON(t)):[],eventTrackingConfigs:globalThis.Array.isArray(e?.eventTrackingConfigs)?e.eventTrackingConfigs.map(t=>Gs.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Ws.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>ei.fromJSON(t)):[],dbSchema:E(e.dbSchema)?Js.fromJSON(e.dbSchema):void 0}},toJSON(e){let t={};return e.config!==void 0&&(t.config=Qs.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=Us.toJSON(e.executionConfig)),e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(n=>qs.toJSON(n))),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(n=>rr.toJSON(n))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(n=>Zs.toJSON(n))),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(n=>Nr.toJSON(n))),e.eventTrackingConfigs?.length&&(t.eventTrackingConfigs=e.eventTrackingConfigs.map(n=>Gs.toJSON(n))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(n=>Ws.toJSON(n))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(n=>ei.toJSON(n))),e.dbSchema!==void 0&&(t.dbSchema=Js.toJSON(e.dbSchema)),t},create(e){return vx.fromPartial(e??{})},fromPartial(e){let t=BI();return t.config=e.config!==void 0&&e.config!==null?Qs.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?Us.fromPartial(e.executionConfig):void 0,t.contractConfigs=e.contractConfigs?.map(n=>qs.fromPartial(n))||[],t.templateInstances=e.templateInstances?.map(n=>rr.fromPartial(n))||[],t.accountConfigs=e.accountConfigs?.map(n=>Zs.fromPartial(n))||[],t.metricConfigs=e.metricConfigs?.map(n=>Nr.fromPartial(n))||[],t.eventTrackingConfigs=e.eventTrackingConfigs?.map(n=>Gs.fromPartial(n))||[],t.exportConfigs=e.exportConfigs?.map(n=>Ws.fromPartial(n))||[],t.eventLogConfigs=e.eventLogConfigs?.map(n=>ei.fromPartial(n))||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?Js.fromPartial(e.dbSchema):void 0,t}};function OI(){return{contract:void 0,intervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelCallConfigs:[],assetConfigs:[],fuelLogConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}var qs={encode(e,t=g.default.Writer.create()){e.contract!==void 0&&nr.encode(e.contract,t.uint32(10).fork()).ldelim();for(let n of e.intervalConfigs)tt.encode(n,t.uint32(90).fork()).ldelim();for(let n of e.logConfigs)ir.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.traceConfigs)Ys.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.transactionConfig)$s.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveEventConfigs)so.encode(n,t.uint32(74).fork()).ldelim();for(let n of e.moveCallConfigs)sr.encode(n,t.uint32(82).fork()).ldelim();for(let n of e.moveResourceChangeConfigs)co.encode(n,t.uint32(98).fork()).ldelim();for(let n of e.fuelCallConfigs)mo.encode(n,t.uint32(106).fork()).ldelim();for(let n of e.assetConfigs)Ks.encode(n,t.uint32(114).fork()).ldelim();for(let n of e.fuelLogConfigs)eo.encode(n,t.uint32(122).fork()).ldelim();for(let n of e.cosmosLogConfigs)to.encode(n,t.uint32(130).fork()).ldelim();for(let n of e.starknetEventConfigs)po.encode(n,t.uint32(138).fork()).ldelim();if(e.instructionConfig!==void 0&&ro.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=OI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=nr.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.intervalConfigs.push(tt.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.logConfigs.push(ir.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.traceConfigs.push(Ys.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.transactionConfig.push($s.decode(n,n.uint32()));continue;case 9:if(a!==74)break;i.moveEventConfigs.push(so.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.moveCallConfigs.push(sr.decode(n,n.uint32()));continue;case 12:if(a!==98)break;i.moveResourceChangeConfigs.push(co.decode(n,n.uint32()));continue;case 13:if(a!==106)break;i.fuelCallConfigs.push(mo.decode(n,n.uint32()));continue;case 14:if(a!==114)break;i.assetConfigs.push(Ks.decode(n,n.uint32()));continue;case 15:if(a!==122)break;i.fuelLogConfigs.push(eo.decode(n,n.uint32()));continue;case 16:if(a!==130)break;i.cosmosLogConfigs.push(to.decode(n,n.uint32()));continue;case 17:if(a!==138)break;i.starknetEventConfigs.push(po.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.instructionConfig=ro.decode(n,n.uint32());continue;case 4:if(a!==32)break;i.startBlock=Qt(n.uint64());continue;case 5:if(a!==40)break;i.endBlock=Qt(n.uint64());continue;case 8:if(a!==66)break;i.processorType=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:E(e.contract)?nr.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>tt.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>ir.fromJSON(t)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(t=>Ys.fromJSON(t)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(t=>$s.fromJSON(t)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(t=>so.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>sr.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>co.fromJSON(t)):[],fuelCallConfigs:globalThis.Array.isArray(e?.fuelCallConfigs)?e.fuelCallConfigs.map(t=>mo.fromJSON(t)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(t=>Ks.fromJSON(t)):[],fuelLogConfigs:globalThis.Array.isArray(e?.fuelLogConfigs)?e.fuelLogConfigs.map(t=>eo.fromJSON(t)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(t=>to.fromJSON(t)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(t=>po.fromJSON(t)):[],instructionConfig:E(e.instructionConfig)?ro.fromJSON(e.instructionConfig):void 0,startBlock:E(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:E(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:E(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=nr.toJSON(e.contract)),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>tt.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>ir.toJSON(n))),e.traceConfigs?.length&&(t.traceConfigs=e.traceConfigs.map(n=>Ys.toJSON(n))),e.transactionConfig?.length&&(t.transactionConfig=e.transactionConfig.map(n=>$s.toJSON(n))),e.moveEventConfigs?.length&&(t.moveEventConfigs=e.moveEventConfigs.map(n=>so.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>sr.toJSON(n))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(n=>co.toJSON(n))),e.fuelCallConfigs?.length&&(t.fuelCallConfigs=e.fuelCallConfigs.map(n=>mo.toJSON(n))),e.assetConfigs?.length&&(t.assetConfigs=e.assetConfigs.map(n=>Ks.toJSON(n))),e.fuelLogConfigs?.length&&(t.fuelLogConfigs=e.fuelLogConfigs.map(n=>eo.toJSON(n))),e.cosmosLogConfigs?.length&&(t.cosmosLogConfigs=e.cosmosLogConfigs.map(n=>to.toJSON(n))),e.starknetEventConfigs?.length&&(t.starknetEventConfigs=e.starknetEventConfigs.map(n=>po.toJSON(n))),e.instructionConfig!==void 0&&(t.instructionConfig=ro.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 qs.fromPartial(e??{})},fromPartial(e){let t=OI();return t.contract=e.contract!==void 0&&e.contract!==null?nr.fromPartial(e.contract):void 0,t.intervalConfigs=e.intervalConfigs?.map(n=>tt.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>ir.fromPartial(n))||[],t.traceConfigs=e.traceConfigs?.map(n=>Ys.fromPartial(n))||[],t.transactionConfig=e.transactionConfig?.map(n=>$s.fromPartial(n))||[],t.moveEventConfigs=e.moveEventConfigs?.map(n=>so.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>sr.fromPartial(n))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(n=>co.fromPartial(n))||[],t.fuelCallConfigs=e.fuelCallConfigs?.map(n=>mo.fromPartial(n))||[],t.assetConfigs=e.assetConfigs?.map(n=>Ks.fromPartial(n))||[],t.fuelLogConfigs=e.fuelLogConfigs?.map(n=>eo.fromPartial(n))||[],t.cosmosLogConfigs=e.cosmosLogConfigs?.map(n=>to.fromPartial(n))||[],t.starknetEventConfigs=e.starknetEventConfigs?.map(n=>po.fromPartial(n))||[],t.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?ro.fromPartial(e.instructionConfig):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.processorType=e.processorType??"",t}};function PI(){return{gqlSchema:""}}var Js={encode(e,t=g.default.Writer.create()){return e.gqlSchema!==""&&t.uint32(10).string(e.gqlSchema),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=PI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gqlSchema=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gqlSchema:E(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let t={};return e.gqlSchema!==""&&(t.gqlSchema=e.gqlSchema),t},create(e){return Js.fromPartial(e??{})},fromPartial(e){let t=PI();return t.gqlSchema=e.gqlSchema??"",t}};function DI(){return{}}var zs={encode(e,t=g.default.Writer.create()){return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=DI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return zs.fromPartial(e??{})},fromPartial(e){return DI()}};function MI(){return{retentionEventName:"",days:0}}var Vs={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=MI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.retentionEventName=n.string();continue;case 3:if(a!==24)break;i.days=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{retentionEventName:E(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:E(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 Vs.fromPartial(e??{})},fromPartial(e){let t=MI();return t.retentionEventName=e.retentionEventName??"",t.days=e.days??0,t}};function FI(){return{eventName:"",totalByDay:!1,unique:!1,totalPerEntity:void 0,distinctAggregationByDays:[],retentionConfig:void 0}}var Gs={encode(e,t=g.default.Writer.create()){e.eventName!==""&&t.uint32(10).string(e.eventName),e.totalByDay!==!1&&t.uint32(16).bool(e.totalByDay),e.unique!==!1&&t.uint32(24).bool(e.unique),e.totalPerEntity!==void 0&&zs.encode(e.totalPerEntity,t.uint32(34).fork()).ldelim(),t.uint32(42).fork();for(let n of e.distinctAggregationByDays)t.int32(n);return t.ldelim(),e.retentionConfig!==void 0&&Vs.encode(e.retentionConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=FI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.eventName=n.string();continue;case 2:if(a!==16)break;i.totalByDay=n.bool();continue;case 3:if(a!==24)break;i.unique=n.bool();continue;case 4:if(a!==34)break;i.totalPerEntity=zs.decode(n,n.uint32());continue;case 5:if(a===40){i.distinctAggregationByDays.push(n.int32());continue}if(a===42){let s=n.uint32()+n.pos;for(;n.pos<s;)i.distinctAggregationByDays.push(n.int32());continue}break;case 6:if(a!==50)break;i.retentionConfig=Vs.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{eventName:E(e.eventName)?globalThis.String(e.eventName):"",totalByDay:E(e.totalByDay)?globalThis.Boolean(e.totalByDay):!1,unique:E(e.unique)?globalThis.Boolean(e.unique):!1,totalPerEntity:E(e.totalPerEntity)?zs.fromJSON(e.totalPerEntity):void 0,distinctAggregationByDays:globalThis.Array.isArray(e?.distinctAggregationByDays)?e.distinctAggregationByDays.map(t=>globalThis.Number(t)):[],retentionConfig:E(e.retentionConfig)?Vs.fromJSON(e.retentionConfig):void 0}},toJSON(e){let t={};return e.eventName!==""&&(t.eventName=e.eventName),e.totalByDay!==!1&&(t.totalByDay=e.totalByDay),e.unique!==!1&&(t.unique=e.unique),e.totalPerEntity!==void 0&&(t.totalPerEntity=zs.toJSON(e.totalPerEntity)),e.distinctAggregationByDays?.length&&(t.distinctAggregationByDays=e.distinctAggregationByDays.map(n=>Math.round(n))),e.retentionConfig!==void 0&&(t.retentionConfig=Vs.toJSON(e.retentionConfig)),t},create(e){return Gs.fromPartial(e??{})},fromPartial(e){let t=FI();return t.eventName=e.eventName??"",t.totalByDay=e.totalByDay??!1,t.unique=e.unique??!1,t.totalPerEntity=e.totalPerEntity!==void 0&&e.totalPerEntity!==null?zs.fromPartial(e.totalPerEntity):void 0,t.distinctAggregationByDays=e.distinctAggregationByDays?.map(n=>n)||[],t.retentionConfig=e.retentionConfig!==void 0&&e.retentionConfig!==null?Vs.fromPartial(e.retentionConfig):void 0,t}};function LI(){return{name:"",channel:""}}var Ws={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=LI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.channel=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",channel:E(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 Ws.fromPartial(e??{})},fromPartial(e){let t=LI();return t.name=e.name??"",t.channel=e.channel??"",t}};function QI(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}var Nr={encode(e,t=g.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&&Hs.encode(e.aggregationConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.description=n.string();continue;case 2:if(a!==18)break;i.unit=n.string();continue;case 4:if(a!==32)break;i.sparse=n.bool();continue;case 5:if(a!==40)break;i.persistentBetweenVersion=n.bool();continue;case 7:if(a!==56)break;i.type=n.int32();continue;case 6:if(a!==50)break;i.aggregationConfig=Hs.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",description:E(e.description)?globalThis.String(e.description):"",unit:E(e.unit)?globalThis.String(e.unit):"",sparse:E(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:E(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:E(e.type)?QQ(e.type):0,aggregationConfig:E(e.aggregationConfig)?Hs.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=UQ(e.type)),e.aggregationConfig!==void 0&&(t.aggregationConfig=Hs.toJSON(e.aggregationConfig)),t},create(e){return Nr.fromPartial(e??{})},fromPartial(e){let t=QI();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?Hs.fromPartial(e.aggregationConfig):void 0,t}};function UI(){return{name:"",fields:[]}}var ei={encode(e,t=g.default.Writer.create()){e.name!==""&&t.uint32(10).string(e.name);for(let n of e.fields)tr.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=UI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.fields.push(tr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>tr.fromJSON(t)):[]}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.fields?.length&&(t.fields=e.fields.map(n=>tr.toJSON(n))),t},create(e){return ei.fromPartial(e??{})},fromPartial(e){let t=UI();return t.name=e.name??"",t.fields=e.fields?.map(n=>tr.fromPartial(n))||[],t}};function qI(){return{fields:[]}}var Ri={encode(e,t=g.default.Writer.create()){for(let n of e.fields)tr.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.fields.push(tr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>tr.fromJSON(t)):[]}},toJSON(e){let t={};return e.fields?.length&&(t.fields=e.fields.map(n=>tr.toJSON(n))),t},create(e){return Ri.fromPartial(e??{})},fromPartial(e){let t=qI();return t.fields=e.fields?.map(n=>tr.fromPartial(n))||[],t}};function JI(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}var tr={encode(e,t=g.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&&Ti.encode(e.coinType,t.uint32(26).fork()).ldelim(),e.structType!==void 0&&Ri.encode(e.structType,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=JI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==16)break;i.basicType=n.int32();continue;case 3:if(a!==26)break;i.coinType=Ti.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.structType=Ri.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",basicType:E(e.basicType)?XQ(e.basicType):void 0,coinType:E(e.coinType)?Ti.fromJSON(e.coinType):void 0,structType:E(e.structType)?Ri.fromJSON(e.structType):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.basicType!==void 0&&(t.basicType=YQ(e.basicType)),e.coinType!==void 0&&(t.coinType=Ti.toJSON(e.coinType)),e.structType!==void 0&&(t.structType=Ri.toJSON(e.structType)),t},create(e){return tr.fromPartial(e??{})},fromPartial(e){let t=JI();return t.name=e.name??"",t.basicType=e.basicType??void 0,t.coinType=e.coinType!==void 0&&e.coinType!==null?Ti.fromPartial(e.coinType):void 0,t.structType=e.structType!==void 0&&e.structType!==null?Ri.fromPartial(e.structType):void 0,t}};function zI(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}var Hs={encode(e,t=g.default.Writer.create()){t.uint32(10).fork();for(let n of e.intervalInMinutes)t.int32(n);t.ldelim(),t.uint32(18).fork();for(let n of e.types)t.int32(n);return t.ldelim(),e.discardOrigin!==!1&&t.uint32(24).bool(e.discardOrigin),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a===8){i.intervalInMinutes.push(n.int32());continue}if(a===10){let s=n.uint32()+n.pos;for(;n.pos<s;)i.intervalInMinutes.push(n.int32());continue}break;case 2:if(a===16){i.types.push(n.int32());continue}if(a===18){let s=n.uint32()+n.pos;for(;n.pos<s;)i.types.push(n.int32());continue}break;case 3:if(a!==24)break;i.discardOrigin=n.bool();continue}if((a&7)===4||a===0)break;n.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=>qQ(t)):[],discardOrigin:E(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let t={};return e.intervalInMinutes?.length&&(t.intervalInMinutes=e.intervalInMinutes.map(n=>Math.round(n))),e.types?.length&&(t.types=e.types.map(n=>JQ(n))),e.discardOrigin!==!1&&(t.discardOrigin=e.discardOrigin),t},create(e){return Hs.fromPartial(e??{})},fromPartial(e){let t=zI();return t.intervalInMinutes=e.intervalInMinutes?.map(n=>n)||[],t.types=e.types?.map(n=>n)||[],t.discardOrigin=e.discardOrigin??!1,t}};function VI(){return{chainId:"",address:"",startBlock:BigInt("0"),intervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],logConfigs:[]}}var Zs={encode(e,t=g.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())}for(let n of e.intervalConfigs)tt.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.moveIntervalConfigs)Xs.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveCallConfigs)sr.encode(n,t.uint32(66).fork()).ldelim();for(let n of e.logConfigs)ir.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=VI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=n.string();continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.startBlock=Qt(n.uint64());continue;case 4:if(a!==34)break;i.intervalConfigs.push(tt.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.moveIntervalConfigs.push(Xs.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.moveCallConfigs.push(sr.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.logConfigs.push(ir.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{chainId:E(e.chainId)?globalThis.String(e.chainId):"",address:E(e.address)?globalThis.String(e.address):"",startBlock:E(e.startBlock)?BigInt(e.startBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>tt.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Xs.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>sr.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>ir.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.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>tt.toJSON(n))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(n=>Xs.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>sr.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>ir.toJSON(n))),t},create(e){return Zs.fromPartial(e??{})},fromPartial(e){let t=VI();return t.chainId=e.chainId??"",t.address=e.address??"",t.startBlock=e.startBlock??BigInt("0"),t.intervalConfigs=e.intervalConfigs?.map(n=>tt.fromPartial(n))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(n=>Xs.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>sr.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>ir.fromPartial(n))||[],t}};function GI(){return{recentInterval:0,backfillInterval:0}}var er={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.recentInterval=n.int32();continue;case 2:if(a!==16)break;i.backfillInterval=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{recentInterval:E(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:E(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 er.fromPartial(e??{})},fromPartial(e){let t=GI();return t.recentInterval=e.recentInterval??0,t.backfillInterval=e.backfillInterval??0,t}};function WI(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0}}var tt={encode(e,t=g.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&&er.encode(e.minutesInterval,t.uint32(34).fork()).ldelim(),e.slot!==0&&t.uint32(24).int32(e.slot),e.slotInterval!==void 0&&er.encode(e.slotInterval,t.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&nt.encode(e.fetchConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 2:if(a!==16)break;i.minutes=n.int32();continue;case 4:if(a!==34)break;i.minutesInterval=er.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.slot=n.int32();continue;case 5:if(a!==42)break;i.slotInterval=er.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:E(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:E(e.minutesInterval)?er.fromJSON(e.minutesInterval):void 0,slot:E(e.slot)?globalThis.Number(e.slot):0,slotInterval:E(e.slotInterval)?er.fromJSON(e.slotInterval):void 0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},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=er.toJSON(e.minutesInterval)),e.slot!==0&&(t.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(t.slotInterval=er.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(t.fetchConfig=nt.toJSON(e.fetchConfig)),t},create(e){return tt.fromPartial(e??{})},fromPartial(e){let t=WI();return t.handlerId=e.handlerId??0,t.minutes=e.minutes??0,t.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?er.fromPartial(e.minutesInterval):void 0,t.slot=e.slot??0,t.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?er.fromPartial(e.slotInterval):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function HI(){return{intervalConfig:void 0,type:""}}var jQ={encode(e,t=g.default.Writer.create()){return e.intervalConfig!==void 0&&tt.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=HI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=tt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.type=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:E(e.intervalConfig)?tt.fromJSON(e.intervalConfig):void 0,type:E(e.type)?globalThis.String(e.type):""}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=tt.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),t},create(e){return jQ.fromPartial(e??{})},fromPartial(e){let t=HI();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?tt.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t}};function ZI(){return{intervalConfig:void 0,type:"",ownerType:0,fetchConfig:void 0}}var Xs={encode(e,t=g.default.Writer.create()){return e.intervalConfig!==void 0&&tt.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.fetchConfig!==void 0&&ao.encode(e.fetchConfig,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=tt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.type=n.string();continue;case 3:if(a!==24)break;i.ownerType=n.int32();continue;case 4:if(a!==34)break;i.fetchConfig=ao.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:E(e.intervalConfig)?tt.fromJSON(e.intervalConfig):void 0,type:E(e.type)?globalThis.String(e.type):"",ownerType:E(e.ownerType)?zQ(e.ownerType):0,fetchConfig:E(e.fetchConfig)?ao.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=tt.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),e.ownerType!==0&&(t.ownerType=VQ(e.ownerType)),e.fetchConfig!==void 0&&(t.fetchConfig=ao.toJSON(e.fetchConfig)),t},create(e){return Xs.fromPartial(e??{})},fromPartial(e){let t=ZI();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?tt.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t.ownerType=e.ownerType??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ao.fromPartial(e.fetchConfig):void 0,t}};function XI(){return{name:"",chainId:"",address:"",abi:""}}var nr={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.chainId=n.string();continue;case 3:if(a!==26)break;i.address=n.string();continue;case 4:if(a!==34)break;i.abi=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",chainId:E(e.chainId)?globalThis.String(e.chainId):"",address:E(e.address)?globalThis.String(e.address):"",abi:E(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 nr.fromPartial(e??{})},fromPartial(e){let t=XI();return t.name=e.name??"",t.chainId=e.chainId??"",t.address=e.address??"",t.abi=e.abi??"",t}};function YI(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}var rr={encode(e,t=g.default.Writer.create()){if(e.contract!==void 0&&nr.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&&B.encode(B.wrap(e.baseLabels),t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=YI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=nr.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.startBlock=Qt(n.uint64());continue;case 3:if(a!==24)break;i.endBlock=Qt(n.uint64());continue;case 4:if(a!==32)break;i.templateId=n.int32();continue;case 5:if(a!==42)break;i.baseLabels=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:E(e.contract)?nr.fromJSON(e.contract):void 0,startBlock:E(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:E(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:E(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:Qe(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=nr.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 rr.fromPartial(e??{})},fromPartial(e){let t=YI();return t.contract=e.contract!==void 0&&e.contract!==null?nr.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 $I(){return{templateInstances:[]}}var wx={encode(e,t=g.default.Writer.create()){for(let n of e.templateInstances)rr.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$I();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.templateInstances.push(rr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>rr.fromJSON(t)):[]}},toJSON(e){let t={};return e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(n=>rr.toJSON(n))),t},create(e){return wx.fromPartial(e??{})},fromPartial(e){let t=$I();return t.templateInstances=e.templateInstances?.map(n=>rr.fromPartial(n))||[],t}};function KI(){return{handlerId:0}}var eU={encode(e,t=g.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:E(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 eU.fromPartial(e??{})},fromPartial(e){let t=KI();return t.handlerId=e.handlerId??0,t}};function jI(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}var nt={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=jI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.transaction=n.bool();continue;case 2:if(a!==16)break;i.transactionReceipt=n.bool();continue;case 5:if(a!==40)break;i.transactionReceiptLogs=n.bool();continue;case 3:if(a!==24)break;i.block=n.bool();continue;case 4:if(a!==32)break;i.trace=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:E(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:E(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:E(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:E(e.block)?globalThis.Boolean(e.block):!1,trace:E(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 nt.fromPartial(e??{})},fromPartial(e){let t=jI();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 eS(){return{signature:"",handlerId:0,fetchConfig:void 0}}var Ys={encode(e,t=g.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&&nt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=eS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.signature=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{signature:E(e.signature)?globalThis.String(e.signature):"",handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},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=nt.toJSON(e.fetchConfig)),t},create(e){return Ys.fromPartial(e??{})},fromPartial(e){let t=eS();return t.signature=e.signature??"",t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function tS(){return{handlerId:0,fetchConfig:void 0}}var $s={encode(e,t=g.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&nt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=nt.toJSON(e.fetchConfig)),t},create(e){return $s.fromPartial(e??{})},fromPartial(e){let t=tS();return t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function nS(){return{filters:[],handlerId:0,fetchConfig:void 0}}var ir={encode(e,t=g.default.Writer.create()){for(let n of e.filters)no.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&nt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(no.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>no.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>no.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=nt.toJSON(e.fetchConfig)),t},create(e){return ir.fromPartial(e??{})},fromPartial(e){let t=nS();return t.filters=e.filters?.map(n=>no.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function rS(){return{filters:[],handlerId:0}}var Ks={encode(e,t=g.default.Writer.create()){for(let n of e.filters)js.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(js.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>js.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>js.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return Ks.fromPartial(e??{})},fromPartial(e){let t=rS();return t.filters=e.filters?.map(n=>js.fromPartial(n))||[],t.handlerId=e.handlerId??0,t}};function iS(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}var js={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=iS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.assetId=n.string();continue;case 2:if(a!==18)break;i.fromAddress=n.string();continue;case 3:if(a!==26)break;i.toAddress=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{assetId:E(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:E(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:E(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 js.fromPartial(e??{})},fromPartial(e){let t=iS();return t.assetId=e.assetId??void 0,t.fromAddress=e.fromAddress??void 0,t.toAddress=e.toAddress??void 0,t}};function aS(){return{logIds:[],handlerId:0}}var eo={encode(e,t=g.default.Writer.create()){for(let n of e.logIds)t.uint32(10).string(n);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=aS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(n.string());continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return eo.fromPartial(e??{})},fromPartial(e){let t=aS();return t.logIds=e.logIds?.map(n=>n)||[],t.handlerId=e.handlerId??0,t}};function sS(){return{logFilters:[],handlerId:0}}var to={encode(e,t=g.default.Writer.create()){for(let n of e.logFilters)t.uint32(10).string(n);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logFilters.push(n.string());continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(t=>globalThis.String(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.logFilters?.length&&(t.logFilters=e.logFilters),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return to.fromPartial(e??{})},fromPartial(e){let t=sS();return t.logFilters=e.logFilters?.map(n=>n)||[],t.handlerId=e.handlerId??0,t}};function oS(){return{topics:[],address:void 0,addressType:void 0}}var no={encode(e,t=g.default.Writer.create()){for(let n of e.topics)go.encode(n,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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=oS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.topics.push(go.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.addressType=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(t=>go.fromJSON(t)):[],address:E(e.address)?globalThis.String(e.address):void 0,addressType:E(e.addressType)?GQ(e.addressType):void 0}},toJSON(e){let t={};return e.topics?.length&&(t.topics=e.topics.map(n=>go.toJSON(n))),e.address!==void 0&&(t.address=e.address),e.addressType!==void 0&&(t.addressType=WQ(e.addressType)),t},create(e){return no.fromPartial(e??{})},fromPartial(e){let t=oS();return t.topics=e.topics?.map(n=>go.fromPartial(n))||[],t.address=e.address??void 0,t.addressType=e.addressType??void 0,t}};function cS(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}var ro={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.innerInstruction=n.bool();continue;case 2:if(a!==16)break;i.parsedInstruction=n.bool();continue;case 3:if(a!==24)break;i.rawDataInstruction=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{innerInstruction:E(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:E(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:E(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 ro.fromPartial(e??{})},fromPartial(e){let t=cS();return t.innerInstruction=e.innerInstruction??!1,t.parsedInstruction=e.parsedInstruction??!1,t.rawDataInstruction=e.rawDataInstruction??!1,t}};function uS(){return{moveTypePrefix:""}}var io={encode(e,t=g.default.Writer.create()){return e.moveTypePrefix!==""&&t.uint32(10).string(e.moveTypePrefix),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=uS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.moveTypePrefix=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{moveTypePrefix:E(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let t={};return e.moveTypePrefix!==""&&(t.moveTypePrefix=e.moveTypePrefix),t},create(e){return io.fromPartial(e??{})},fromPartial(e){let t=uS();return t.moveTypePrefix=e.moveTypePrefix??"",t}};function lS(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0}}var ar={encode(e,t=g.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&&io.encode(e.resourceConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=lS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.resourceChanges=n.bool();continue;case 2:if(a!==16)break;i.allEvents=n.bool();continue;case 4:if(a!==32)break;i.inputs=n.bool();continue;case 3:if(a!==26)break;i.resourceConfig=io.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{resourceChanges:E(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:E(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:E(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:E(e.resourceConfig)?io.fromJSON(e.resourceConfig):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=io.toJSON(e.resourceConfig)),t},create(e){return ar.fromPartial(e??{})},fromPartial(e){let t=lS();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?io.fromPartial(e.resourceConfig):void 0,t}};function dS(){return{owned:!1}}var ao={encode(e,t=g.default.Writer.create()){return e.owned!==!1&&t.uint32(8).bool(e.owned),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.owned=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{owned:E(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let t={};return e.owned!==!1&&(t.owned=e.owned),t},create(e){return ao.fromPartial(e??{})},fromPartial(e){let t=dS();return t.owned=e.owned??!1,t}};function pS(){return{filters:[],handlerId:0,fetchConfig:void 0}}var so={encode(e,t=g.default.Writer.create()){for(let n of e.filters)oo.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&ar.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=pS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(oo.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=ar.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>oo.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?ar.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>oo.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=ar.toJSON(e.fetchConfig)),t},create(e){return so.fromPartial(e??{})},fromPartial(e){let t=pS();return t.filters=e.filters?.map(n=>oo.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ar.fromPartial(e.fetchConfig):void 0,t}};function fS(){return{type:"",account:""}}var oo={encode(e,t=g.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.account!==""&&t.uint32(18).string(e.account),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==18)break;i.account=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:E(e.type)?globalThis.String(e.type):"",account:E(e.account)?globalThis.String(e.account):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.account!==""&&(t.account=e.account),t},create(e){return oo.fromPartial(e??{})},fromPartial(e){let t=fS();return t.type=e.type??"",t.account=e.account??"",t}};function hS(){return{filters:[],handlerId:0,fetchConfig:void 0}}var sr={encode(e,t=g.default.Writer.create()){for(let n of e.filters)uo.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&ar.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(uo.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=ar.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>uo.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?ar.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>uo.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=ar.toJSON(e.fetchConfig)),t},create(e){return sr.fromPartial(e??{})},fromPartial(e){let t=hS();return t.filters=e.filters?.map(n=>uo.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ar.fromPartial(e.fetchConfig):void 0,t}};function mS(){return{type:"",handlerId:0}}var co={encode(e,t=g.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:E(e.type)?globalThis.String(e.type):"",handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return co.fromPartial(e??{})},fromPartial(e){let t=mS();return t.type=e.type??"",t.handlerId=e.handlerId??0,t}};function gS(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}var uo={encode(e,t=g.default.Writer.create()){e.function!==""&&t.uint32(10).string(e.function);for(let n of e.typeArguments)t.uint32(18).string(n);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&&lo.encode(e.fromAndToAddress,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=n.string();continue;case 2:if(a!==18)break;i.typeArguments.push(n.string());continue;case 3:if(a!==24)break;i.withTypeArguments=n.bool();continue;case 4:if(a!==32)break;i.includeFailed=n.bool();continue;case 5:if(a!==42)break;i.publicKeyPrefix=n.string();continue;case 6:if(a!==50)break;i.fromAndToAddress=lo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{function:E(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(t=>globalThis.String(t)):[],withTypeArguments:E(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:E(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:E(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:E(e.fromAndToAddress)?lo.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=lo.toJSON(e.fromAndToAddress)),t},create(e){return uo.fromPartial(e??{})},fromPartial(e){let t=gS();return t.function=e.function??"",t.typeArguments=e.typeArguments?.map(n=>n)||[],t.withTypeArguments=e.withTypeArguments??!1,t.includeFailed=e.includeFailed??!1,t.publicKeyPrefix=e.publicKeyPrefix??"",t.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?lo.fromPartial(e.fromAndToAddress):void 0,t}};function _S(){return{from:"",to:""}}var lo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_S();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.from=n.string();continue;case 2:if(a!==18)break;i.to=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:E(e.from)?globalThis.String(e.from):"",to:E(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 lo.fromPartial(e??{})},fromPartial(e){let t=_S();return t.from=e.from??"",t.to=e.to??"",t}};function AS(){return{filters:[],handlerId:0}}var po={encode(e,t=g.default.Writer.create()){for(let n of e.filters)fo.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=AS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(fo.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>fo.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>fo.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return po.fromPartial(e??{})},fromPartial(e){let t=AS();return t.filters=e.filters?.map(n=>fo.fromPartial(n))||[],t.handlerId=e.handlerId??0,t}};function yS(){return{address:"",keys:[]}}var fo={encode(e,t=g.default.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(let n of e.keys)t.uint32(18).string(n);return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=yS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.keys.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:E(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 fo.fromPartial(e??{})},fromPartial(e){let t=yS();return t.address=e.address??"",t.keys=e.keys?.map(n=>n)||[],t}};function vS(){return{function:"",includeFailed:!1}}var ho={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=vS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=n.string();continue;case 2:if(a!==16)break;i.includeFailed=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{function:E(e.function)?globalThis.String(e.function):"",includeFailed:E(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 ho.fromPartial(e??{})},fromPartial(e){let t=vS();return t.function=e.function??"",t.includeFailed=e.includeFailed??!1,t}};function wS(){return{filters:[],handlerId:0}}var mo={encode(e,t=g.default.Writer.create()){for(let n of e.filters)ho.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=wS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(ho.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>ho.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>ho.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return mo.fromPartial(e??{})},fromPartial(e){let t=wS();return t.filters=e.filters?.map(n=>ho.fromPartial(n))||[],t.handlerId=e.handlerId??0,t}};function bS(){return{hashes:[]}}var go={encode(e,t=g.default.Writer.create()){for(let n of e.hashes)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=bS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.hashes.push(n.string());continue}if((a&7)===4||a===0)break;n.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 go.fromPartial(e??{})},fromPartial(e){let t=bS();return t.hashes=e.hashes?.map(n=>n)||[],t}};function ES(){return{bindings:[]}}var bx={encode(e,t=g.default.Writer.create()){for(let n of e.bindings)Lt.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ES();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(Lt.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>Lt.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(n=>Lt.toJSON(n))),t},create(e){return bx.fromPartial(e??{})},fromPartial(e){let t=ES();return t.bindings=e.bindings?.map(n=>Lt.fromPartial(n))||[],t}};function CS(){return{result:void 0}}var Ex={encode(e,t=g.default.Writer.create()){return e.result!==void 0&&mn.encode(e.result,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=CS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=mn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{result:E(e.result)?mn.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.result!==void 0&&(t.result=mn.toJSON(e.result)),t},create(e){return Ex.fromPartial(e??{})},fromPartial(e){let t=CS();return t.result=e.result!==void 0&&e.result!==null?mn.fromPartial(e.result):void 0,t}};function IS(){return{processId:0,binding:void 0,dbResult:void 0}}var Cx={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.binding!==void 0&&Lt.encode(e.binding,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&or.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=IS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.binding=Lt.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.dbResult=or.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,binding:E(e.binding)?Lt.fromJSON(e.binding):void 0,dbResult:E(e.dbResult)?or.fromJSON(e.dbResult):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.binding!==void 0&&(t.binding=Lt.toJSON(e.binding)),e.dbResult!==void 0&&(t.dbResult=or.toJSON(e.dbResult)),t},create(e){return Cx.fromPartial(e??{})},fromPartial(e){let t=IS();return t.processId=e.processId??0,t.binding=e.binding!==void 0&&e.binding!==null?Lt.fromPartial(e.binding):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?or.fromPartial(e.dbResult):void 0,t}};function SS(){return{processId:0,dbRequest:void 0,result:void 0}}var Ix={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&cr.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),e.result!==void 0&&mn.encode(e.result,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=SS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.dbRequest=cr.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.result=mn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,dbRequest:E(e.dbRequest)?cr.fromJSON(e.dbRequest):void 0,result:E(e.result)?mn.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=cr.toJSON(e.dbRequest)),e.result!==void 0&&(t.result=mn.toJSON(e.result)),t},create(e){return Ix.fromPartial(e??{})},fromPartial(e){let t=SS();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?cr.fromPartial(e.dbRequest):void 0,t.result=e.result!==void 0&&e.result!==null?mn.fromPartial(e.result):void 0,t}};function xS(){return{processId:0,bindings:void 0,dbResult:void 0}}var Sx={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.bindings!==void 0&&_o.encode(e.bindings,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&or.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=xS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.bindings=_o.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.dbResult=or.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,bindings:E(e.bindings)?_o.fromJSON(e.bindings):void 0,dbResult:E(e.dbResult)?or.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=_o.toJSON(e.bindings)),e.dbResult!==void 0&&(t.dbResult=or.toJSON(e.dbResult)),t},create(e){return Sx.fromPartial(e??{})},fromPartial(e){let t=xS();return t.processId=e.processId??0,t.bindings=e.bindings!==void 0&&e.bindings!==null?_o.fromPartial(e.bindings):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?or.fromPartial(e.dbResult):void 0,t}};function TS(){return{bindings:[]}}var _o={encode(e,t=g.default.Writer.create()){for(let n of e.bindings)Lt.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=TS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(Lt.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>Lt.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(n=>Lt.toJSON(n))),t},create(e){return _o.fromPartial(e??{})},fromPartial(e){let t=TS();return t.bindings=e.bindings?.map(n=>Lt.fromPartial(n))||[],t}};function NS(){return{processId:0,dbRequest:void 0}}var xx={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&cr.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=NS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.dbRequest=cr.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,dbRequest:E(e.dbRequest)?cr.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=cr.toJSON(e.dbRequest)),t},create(e){return xx.fromPartial(e??{})},fromPartial(e){let t=NS();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?cr.fromPartial(e.dbRequest):void 0,t}};function RS(){return{opId:BigInt("0"),data:void 0,list:void 0,error:void 0,entities:void 0,entityList:void 0,nextCursor:void 0}}var or={encode(e,t=g.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&&B.encode(B.wrap(e.data),t.uint32(18).fork()).ldelim(),e.list!==void 0&&Tr.encode(Tr.wrap(e.list),t.uint32(34).fork()).ldelim(),e.error!==void 0&&t.uint32(26).string(e.error),e.entities!==void 0&&Ni.encode(e.entities,t.uint32(50).fork()).ldelim(),e.entityList!==void 0&&yo.encode(e.entityList,t.uint32(58).fork()).ldelim(),e.nextCursor!==void 0&&t.uint32(42).string(e.nextCursor),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=RS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Qt(n.uint64());continue;case 2:if(a!==18)break;i.data=B.unwrap(B.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.list=Tr.unwrap(Tr.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.error=n.string();continue;case 6:if(a!==50)break;i.entities=Ni.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.entityList=yo.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.nextCursor=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{opId:E(e.opId)?BigInt(e.opId):BigInt("0"),data:Qe(e.data)?e.data:void 0,list:globalThis.Array.isArray(e.list)?[...e.list]:void 0,error:E(e.error)?globalThis.String(e.error):void 0,entities:E(e.entities)?Ni.fromJSON(e.entities):void 0,entityList:E(e.entityList)?yo.fromJSON(e.entityList):void 0,nextCursor:E(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=Ni.toJSON(e.entities)),e.entityList!==void 0&&(t.entityList=yo.toJSON(e.entityList)),e.nextCursor!==void 0&&(t.nextCursor=e.nextCursor),t},create(e){return or.fromPartial(e??{})},fromPartial(e){let t=RS();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?Ni.fromPartial(e.entities):void 0,t.entityList=e.entityList!==void 0&&e.entityList!==null?yo.fromPartial(e.entityList):void 0,t.nextCursor=e.nextCursor??void 0,t}};function kS(){return{entity:"",genBlockNumber:BigInt("0"),genBlockChain:"",genBlockTime:void 0,data:void 0}}var Ao={encode(e,t=g.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&&Fe.encode(ur(e.genBlockTime),t.uint32(34).fork()).ldelim(),e.data!==void 0&&At.encode(e.data,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 2:if(a!==16)break;i.genBlockNumber=Qt(n.uint64());continue;case 3:if(a!==26)break;i.genBlockChain=n.string();continue;case 4:if(a!==34)break;i.genBlockTime=Nn(Fe.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.data=At.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:E(e.entity)?globalThis.String(e.entity):"",genBlockNumber:E(e.genBlockNumber)?BigInt(e.genBlockNumber):BigInt("0"),genBlockChain:E(e.genBlockChain)?globalThis.String(e.genBlockChain):"",genBlockTime:E(e.genBlockTime)?lr(e.genBlockTime):void 0,data:E(e.data)?At.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=At.toJSON(e.data)),t},create(e){return Ao.fromPartial(e??{})},fromPartial(e){let t=kS();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?At.fromPartial(e.data):void 0,t}};function BS(){return{entities:[]}}var yo={encode(e,t=g.default.Writer.create()){for(let n of e.entities)Ao.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=BS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(Ao.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>Ao.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(n=>Ao.toJSON(n))),t},create(e){return yo.fromPartial(e??{})},fromPartial(e){let t=BS();return t.entities=e.entities?.map(n=>Ao.fromPartial(n))||[],t}};function OS(){return{opId:BigInt("0"),get:void 0,upsert:void 0,delete:void 0,list:void 0}}var cr={encode(e,t=g.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&&vo.encode(e.get,t.uint32(18).fork()).ldelim(),e.upsert!==void 0&&bo.encode(e.upsert,t.uint32(26).fork()).ldelim(),e.delete!==void 0&&Eo.encode(e.delete,t.uint32(34).fork()).ldelim(),e.list!==void 0&&wo.encode(e.list,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=OS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Qt(n.uint64());continue;case 2:if(a!==18)break;i.get=vo.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.upsert=bo.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.delete=Eo.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.list=wo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{opId:E(e.opId)?BigInt(e.opId):BigInt("0"),get:E(e.get)?vo.fromJSON(e.get):void 0,upsert:E(e.upsert)?bo.fromJSON(e.upsert):void 0,delete:E(e.delete)?Eo.fromJSON(e.delete):void 0,list:E(e.list)?wo.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=vo.toJSON(e.get)),e.upsert!==void 0&&(t.upsert=bo.toJSON(e.upsert)),e.delete!==void 0&&(t.delete=Eo.toJSON(e.delete)),e.list!==void 0&&(t.list=wo.toJSON(e.list)),t},create(e){return cr.fromPartial(e??{})},fromPartial(e){let t=OS();return t.opId=e.opId??BigInt("0"),t.get=e.get!==void 0&&e.get!==null?vo.fromPartial(e.get):void 0,t.upsert=e.upsert!==void 0&&e.upsert!==null?bo.fromPartial(e.upsert):void 0,t.delete=e.delete!==void 0&&e.delete!==null?Eo.fromPartial(e.delete):void 0,t.list=e.list!==void 0&&e.list!==null?wo.fromPartial(e.list):void 0,t}};function PS(){return{entity:"",id:""}}var vo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=PS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 2:if(a!==18)break;i.id=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:E(e.entity)?globalThis.String(e.entity):"",id:E(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 vo.fromPartial(e??{})},fromPartial(e){let t=PS();return t.entity=e.entity??"",t.id=e.id??"",t}};function DS(){return{entity:"",filters:[],cursor:"",pageSize:void 0}}var wo={encode(e,t=g.default.Writer.create()){e.entity!==""&&t.uint32(10).string(e.entity);for(let n of e.filters)Co.encode(n,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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 4:if(a!==34)break;i.filters.push(Co.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.cursor=n.string();continue;case 6:if(a!==48)break;i.pageSize=n.uint32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:E(e.entity)?globalThis.String(e.entity):"",filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Co.fromJSON(t)):[],cursor:E(e.cursor)?globalThis.String(e.cursor):"",pageSize:E(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(n=>Co.toJSON(n))),e.cursor!==""&&(t.cursor=e.cursor),e.pageSize!==void 0&&(t.pageSize=Math.round(e.pageSize)),t},create(e){return wo.fromPartial(e??{})},fromPartial(e){let t=DS();return t.entity=e.entity??"",t.filters=e.filters?.map(n=>Co.fromPartial(n))||[],t.cursor=e.cursor??"",t.pageSize=e.pageSize??void 0,t}};function MS(){return{entity:[],id:[],data:[],entityData:[]}}var bo={encode(e,t=g.default.Writer.create()){for(let n of e.entity)t.uint32(10).string(n);for(let n of e.id)t.uint32(18).string(n);for(let n of e.data)B.encode(B.wrap(n),t.uint32(26).fork()).ldelim();for(let n of e.entityData)At.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(n.string());continue;case 2:if(a!==18)break;i.id.push(n.string());continue;case 3:if(a!==26)break;i.data.push(B.unwrap(B.decode(n,n.uint32())));continue;case 4:if(a!==34)break;i.entityData.push(At.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.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=>At.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(n=>At.toJSON(n))),t},create(e){return bo.fromPartial(e??{})},fromPartial(e){let t=MS();return t.entity=e.entity?.map(n=>n)||[],t.id=e.id?.map(n=>n)||[],t.data=e.data?.map(n=>n)||[],t.entityData=e.entityData?.map(n=>At.fromPartial(n))||[],t}};function FS(){return{entity:[],id:[]}}var Eo={encode(e,t=g.default.Writer.create()){for(let n of e.entity)t.uint32(10).string(n);for(let n of e.id)t.uint32(18).string(n);return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(n.string());continue;case 2:if(a!==18)break;i.id.push(n.string());continue}if((a&7)===4||a===0)break;n.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 Eo.fromPartial(e??{})},fromPartial(e){let t=FS();return t.entity=e.entity?.map(n=>n)||[],t.id=e.id?.map(n=>n)||[],t}};function LS(){return{field:"",op:0,value:void 0}}var Co={encode(e,t=g.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&&Tn.encode(e.value,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.field=n.string();continue;case 2:if(a!==16)break;i.op=n.int32();continue;case 3:if(a!==26)break;i.value=Tn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{field:E(e.field)?globalThis.String(e.field):"",op:E(e.op)?$Q(e.op):0,value:E(e.value)?Tn.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.field!==""&&(t.field=e.field),e.op!==0&&(t.op=KQ(e.op)),e.value!==void 0&&(t.value=Tn.toJSON(e.value)),t},create(e){return Co.fromPartial(e??{})},fromPartial(e){let t=LS();return t.field=e.field??"",t.op=e.op??0,t.value=e.value!==void 0&&e.value!==null?Tn.fromPartial(e.value):void 0,t}};function QS(){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,fuelCall:void 0,cosmosCall:void 0,starknetEvents:void 0}}var Io={encode(e,t=g.default.Writer.create()){return e.ethLog!==void 0&&So.encode(e.ethLog,t.uint32(18).fork()).ldelim(),e.ethBlock!==void 0&&xo.encode(e.ethBlock,t.uint32(26).fork()).ldelim(),e.ethTransaction!==void 0&&To.encode(e.ethTransaction,t.uint32(34).fork()).ldelim(),e.ethTrace!==void 0&&No.encode(e.ethTrace,t.uint32(42).fork()).ldelim(),e.solInstruction!==void 0&&Ro.encode(e.solInstruction,t.uint32(50).fork()).ldelim(),e.aptEvent!==void 0&&ko.encode(e.aptEvent,t.uint32(58).fork()).ldelim(),e.aptCall!==void 0&&Bo.encode(e.aptCall,t.uint32(66).fork()).ldelim(),e.aptResource!==void 0&&Oo.encode(e.aptResource,t.uint32(74).fork()).ldelim(),e.suiEvent!==void 0&&Po.encode(e.suiEvent,t.uint32(82).fork()).ldelim(),e.suiCall!==void 0&&Do.encode(e.suiCall,t.uint32(90).fork()).ldelim(),e.suiObject!==void 0&&Mo.encode(e.suiObject,t.uint32(98).fork()).ldelim(),e.suiObjectChange!==void 0&&Fo.encode(e.suiObjectChange,t.uint32(106).fork()).ldelim(),e.fuelCall!==void 0&&Lo.encode(e.fuelCall,t.uint32(114).fork()).ldelim(),e.cosmosCall!==void 0&&Qo.encode(e.cosmosCall,t.uint32(122).fork()).ldelim(),e.starknetEvents!==void 0&&Uo.encode(e.starknetEvents,t.uint32(130).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.ethLog=So.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.ethBlock=xo.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.ethTransaction=To.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.ethTrace=No.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.solInstruction=Ro.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.aptEvent=ko.decode(n,n.uint32());continue;case 8:if(a!==66)break;i.aptCall=Bo.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.aptResource=Oo.decode(n,n.uint32());continue;case 10:if(a!==82)break;i.suiEvent=Po.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.suiCall=Do.decode(n,n.uint32());continue;case 12:if(a!==98)break;i.suiObject=Mo.decode(n,n.uint32());continue;case 13:if(a!==106)break;i.suiObjectChange=Fo.decode(n,n.uint32());continue;case 14:if(a!==114)break;i.fuelCall=Lo.decode(n,n.uint32());continue;case 15:if(a!==122)break;i.cosmosCall=Qo.decode(n,n.uint32());continue;case 16:if(a!==130)break;i.starknetEvents=Uo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethLog:E(e.ethLog)?So.fromJSON(e.ethLog):void 0,ethBlock:E(e.ethBlock)?xo.fromJSON(e.ethBlock):void 0,ethTransaction:E(e.ethTransaction)?To.fromJSON(e.ethTransaction):void 0,ethTrace:E(e.ethTrace)?No.fromJSON(e.ethTrace):void 0,solInstruction:E(e.solInstruction)?Ro.fromJSON(e.solInstruction):void 0,aptEvent:E(e.aptEvent)?ko.fromJSON(e.aptEvent):void 0,aptCall:E(e.aptCall)?Bo.fromJSON(e.aptCall):void 0,aptResource:E(e.aptResource)?Oo.fromJSON(e.aptResource):void 0,suiEvent:E(e.suiEvent)?Po.fromJSON(e.suiEvent):void 0,suiCall:E(e.suiCall)?Do.fromJSON(e.suiCall):void 0,suiObject:E(e.suiObject)?Mo.fromJSON(e.suiObject):void 0,suiObjectChange:E(e.suiObjectChange)?Fo.fromJSON(e.suiObjectChange):void 0,fuelCall:E(e.fuelCall)?Lo.fromJSON(e.fuelCall):void 0,cosmosCall:E(e.cosmosCall)?Qo.fromJSON(e.cosmosCall):void 0,starknetEvents:E(e.starknetEvents)?Uo.fromJSON(e.starknetEvents):void 0}},toJSON(e){let t={};return e.ethLog!==void 0&&(t.ethLog=So.toJSON(e.ethLog)),e.ethBlock!==void 0&&(t.ethBlock=xo.toJSON(e.ethBlock)),e.ethTransaction!==void 0&&(t.ethTransaction=To.toJSON(e.ethTransaction)),e.ethTrace!==void 0&&(t.ethTrace=No.toJSON(e.ethTrace)),e.solInstruction!==void 0&&(t.solInstruction=Ro.toJSON(e.solInstruction)),e.aptEvent!==void 0&&(t.aptEvent=ko.toJSON(e.aptEvent)),e.aptCall!==void 0&&(t.aptCall=Bo.toJSON(e.aptCall)),e.aptResource!==void 0&&(t.aptResource=Oo.toJSON(e.aptResource)),e.suiEvent!==void 0&&(t.suiEvent=Po.toJSON(e.suiEvent)),e.suiCall!==void 0&&(t.suiCall=Do.toJSON(e.suiCall)),e.suiObject!==void 0&&(t.suiObject=Mo.toJSON(e.suiObject)),e.suiObjectChange!==void 0&&(t.suiObjectChange=Fo.toJSON(e.suiObjectChange)),e.fuelCall!==void 0&&(t.fuelCall=Lo.toJSON(e.fuelCall)),e.cosmosCall!==void 0&&(t.cosmosCall=Qo.toJSON(e.cosmosCall)),e.starknetEvents!==void 0&&(t.starknetEvents=Uo.toJSON(e.starknetEvents)),t},create(e){return Io.fromPartial(e??{})},fromPartial(e){let t=QS();return t.ethLog=e.ethLog!==void 0&&e.ethLog!==null?So.fromPartial(e.ethLog):void 0,t.ethBlock=e.ethBlock!==void 0&&e.ethBlock!==null?xo.fromPartial(e.ethBlock):void 0,t.ethTransaction=e.ethTransaction!==void 0&&e.ethTransaction!==null?To.fromPartial(e.ethTransaction):void 0,t.ethTrace=e.ethTrace!==void 0&&e.ethTrace!==null?No.fromPartial(e.ethTrace):void 0,t.solInstruction=e.solInstruction!==void 0&&e.solInstruction!==null?Ro.fromPartial(e.solInstruction):void 0,t.aptEvent=e.aptEvent!==void 0&&e.aptEvent!==null?ko.fromPartial(e.aptEvent):void 0,t.aptCall=e.aptCall!==void 0&&e.aptCall!==null?Bo.fromPartial(e.aptCall):void 0,t.aptResource=e.aptResource!==void 0&&e.aptResource!==null?Oo.fromPartial(e.aptResource):void 0,t.suiEvent=e.suiEvent!==void 0&&e.suiEvent!==null?Po.fromPartial(e.suiEvent):void 0,t.suiCall=e.suiCall!==void 0&&e.suiCall!==null?Do.fromPartial(e.suiCall):void 0,t.suiObject=e.suiObject!==void 0&&e.suiObject!==null?Mo.fromPartial(e.suiObject):void 0,t.suiObjectChange=e.suiObjectChange!==void 0&&e.suiObjectChange!==null?Fo.fromPartial(e.suiObjectChange):void 0,t.fuelCall=e.fuelCall!==void 0&&e.fuelCall!==null?Lo.fromPartial(e.fuelCall):void 0,t.cosmosCall=e.cosmosCall!==void 0&&e.cosmosCall!==null?Qo.fromPartial(e.cosmosCall):void 0,t.starknetEvents=e.starknetEvents!==void 0&&e.starknetEvents!==null?Uo.fromPartial(e.starknetEvents):void 0,t}};function US(){return{log:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0}}var So={encode(e,t=g.default.Writer.create()){return e.log!==void 0&&B.encode(B.wrap(e.log),t.uint32(26).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(34).fork()).ldelim(),e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&B.encode(B.wrap(e.transactionReceipt),t.uint32(42).fork()).ldelim(),e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 3:if(a!==26)break;i.log=B.unwrap(B.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.transactionReceipt=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{log:Qe(e.log)?e.log:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,transaction:Qe(e.transaction)?e.transaction:void 0,transactionReceipt:Qe(e.transactionReceipt)?e.transactionReceipt:void 0,block:Qe(e.block)?e.block: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),t},create(e){return So.fromPartial(e??{})},fromPartial(e){let t=US();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}};function qS(){return{block:void 0}}var xo={encode(e,t=g.default.Writer.create()){return e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{block:Qe(e.block)?e.block:void 0}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),t},create(e){return xo.fromPartial(e??{})},fromPartial(e){let t=qS();return t.block=e.block??void 0,t}};function JS(){return{transaction:void 0,timestamp:void 0,transactionReceipt:void 0,block:void 0,trace:void 0}}var To={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(42).fork()).ldelim(),e.transactionReceipt!==void 0&&B.encode(B.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(50).fork()).ldelim(),e.trace!==void 0&&B.encode(B.wrap(e.trace),t.uint32(58).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=JS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.trace=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,transactionReceipt:Qe(e.transactionReceipt)?e.transactionReceipt:void 0,block:Qe(e.block)?e.block:void 0,trace:Qe(e.trace)?e.trace: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),t},create(e){return To.fromPartial(e??{})},fromPartial(e){let t=JS();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}};function zS(){return{trace:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0}}var No={encode(e,t=g.default.Writer.create()){return e.trace!==void 0&&B.encode(B.wrap(e.trace),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(42).fork()).ldelim(),e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&B.encode(B.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.trace=B.unwrap(B.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{trace:Qe(e.trace)?e.trace:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,transaction:Qe(e.transaction)?e.transaction:void 0,transactionReceipt:Qe(e.transactionReceipt)?e.transactionReceipt:void 0,block:Qe(e.block)?e.block: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),t},create(e){return No.fromPartial(e??{})},fromPartial(e){let t=zS();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}};function VS(){return{instructionData:"",slot:BigInt("0"),programAccountId:"",accounts:[],parsed:void 0}}var Ro={encode(e,t=g.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 n of e.accounts)t.uint32(42).string(n);return e.parsed!==void 0&&B.encode(B.wrap(e.parsed),t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.instructionData=n.string();continue;case 2:if(a!==16)break;i.slot=Qt(n.uint64());continue;case 3:if(a!==26)break;i.programAccountId=n.string();continue;case 5:if(a!==42)break;i.accounts.push(n.string());continue;case 4:if(a!==34)break;i.parsed=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{instructionData:E(e.instructionData)?globalThis.String(e.instructionData):"",slot:E(e.slot)?BigInt(e.slot):BigInt("0"),programAccountId:E(e.programAccountId)?globalThis.String(e.programAccountId):"",accounts:globalThis.Array.isArray(e?.accounts)?e.accounts.map(t=>globalThis.String(t)):[],parsed:Qe(e.parsed)?e.parsed: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),t},create(e){return Ro.fromPartial(e??{})},fromPartial(e){let t=VS();return t.instructionData=e.instructionData??"",t.slot=e.slot??BigInt("0"),t.programAccountId=e.programAccountId??"",t.accounts=e.accounts?.map(n=>n)||[],t.parsed=e.parsed??void 0,t}};function GS(){return{transaction:void 0}}var ko={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),t},create(e){return ko.fromPartial(e??{})},fromPartial(e){let t=GS();return t.transaction=e.transaction??void 0,t}};function WS(){return{transaction:void 0}}var Bo={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),t},create(e){return Bo.fromPartial(e??{})},fromPartial(e){let t=WS();return t.transaction=e.transaction??void 0,t}};function HS(){return{resources:[],version:BigInt("0"),timestampMicros:BigInt("0")}}var Oo={encode(e,t=g.default.Writer.create()){for(let n of e.resources)B.encode(B.wrap(n),t.uint32(34).fork()).ldelim();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())}return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=HS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.resources.push(B.unwrap(B.decode(n,n.uint32())));continue;case 2:if(a!==16)break;i.version=Qt(n.int64());continue;case 5:if(a!==40)break;i.timestampMicros=Qt(n.int64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{resources:globalThis.Array.isArray(e?.resources)?[...e.resources]:[],version:E(e.version)?BigInt(e.version):BigInt("0"),timestampMicros:E(e.timestampMicros)?BigInt(e.timestampMicros):BigInt("0")}},toJSON(e){let t={};return e.resources?.length&&(t.resources=e.resources),e.version!==BigInt("0")&&(t.version=e.version.toString()),e.timestampMicros!==BigInt("0")&&(t.timestampMicros=e.timestampMicros.toString()),t},create(e){return Oo.fromPartial(e??{})},fromPartial(e){let t=HS();return t.resources=e.resources?.map(n=>n)||[],t.version=e.version??BigInt("0"),t.timestampMicros=e.timestampMicros??BigInt("0"),t}};function ZS(){return{transaction:void 0,timestamp:void 0,slot:BigInt("0")}}var Po={encode(e,t=g.default.Writer.create()){if(e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,slot:E(e.slot)?BigInt(e.slot):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.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Po.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function XS(){return{transaction:void 0,timestamp:void 0,slot:BigInt("0")}}var Do={encode(e,t=g.default.Writer.create()){if(e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,slot:E(e.slot)?BigInt(e.slot):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.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Do.fromPartial(e??{})},fromPartial(e){let t=XS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function YS(){return{objects:[],self:void 0,timestamp:void 0,slot:BigInt("0")}}var Mo={encode(e,t=g.default.Writer.create()){for(let n of e.objects)B.encode(B.wrap(n),t.uint32(10).fork()).ldelim();if(e.self!==void 0&&B.encode(B.wrap(e.self),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.objects.push(B.unwrap(B.decode(n,n.uint32())));continue;case 4:if(a!==34)break;i.self=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{objects:globalThis.Array.isArray(e?.objects)?[...e.objects]:[],self:Qe(e.self)?e.self:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,slot:E(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.objects?.length&&(t.objects=e.objects),e.self!==void 0&&(t.self=e.self),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Mo.fromPartial(e??{})},fromPartial(e){let t=YS();return t.objects=e.objects?.map(n=>n)||[],t.self=e.self??void 0,t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function $S(){return{changes:[],timestamp:void 0,txDigest:"",slot:BigInt("0")}}var Fo={encode(e,t=g.default.Writer.create()){for(let n of e.changes)B.encode(B.wrap(n),t.uint32(10).fork()).ldelim();if(e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$S();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.changes.push(B.unwrap(B.decode(n,n.uint32())));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.txDigest=n.string();continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{changes:globalThis.Array.isArray(e?.changes)?[...e.changes]:[],timestamp:E(e.timestamp)?lr(e.timestamp):void 0,txDigest:E(e.txDigest)?globalThis.String(e.txDigest):"",slot:E(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.changes?.length&&(t.changes=e.changes),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 Fo.fromPartial(e??{})},fromPartial(e){let t=$S();return t.changes=e.changes?.map(n=>n)||[],t.timestamp=e.timestamp??void 0,t.txDigest=e.txDigest??"",t.slot=e.slot??BigInt("0"),t}};function KS(){return{transaction:void 0,timestamp:void 0}}var Lo={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(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 Lo.fromPartial(e??{})},fromPartial(e){let t=KS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function jS(){return{transaction:void 0,timestamp:void 0}}var Qo={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(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 Qo.fromPartial(e??{})},fromPartial(e){let t=jS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function ex(){return{result:void 0,timestamp:void 0}}var Uo={encode(e,t=g.default.Writer.create()){return e.result!==void 0&&B.encode(B.wrap(e.result),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ex();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{result:Qe(e.result)?e.result:void 0,timestamp:E(e.timestamp)?lr(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 Uo.fromPartial(e??{})},fromPartial(e){let t=ex();return t.result=e.result??void 0,t.timestamp=e.timestamp??void 0,t}};function tx(){return{data:void 0,handlerType:0,handlerIds:[]}}var Lt={encode(e,t=g.default.Writer.create()){e.data!==void 0&&Io.encode(e.data,t.uint32(10).fork()).ldelim(),e.handlerType!==0&&t.uint32(24).int32(e.handlerType),t.uint32(34).fork();for(let n of e.handlerIds)t.int32(n);return t.ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.data=Io.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.handlerType=n.int32();continue;case 4:if(a===32){i.handlerIds.push(n.int32());continue}if(a===34){let s=n.uint32()+n.pos;for(;n.pos<s;)i.handlerIds.push(n.int32());continue}break}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{data:E(e.data)?Io.fromJSON(e.data):void 0,handlerType:E(e.handlerType)?_x(e.handlerType):0,handlerIds:globalThis.Array.isArray(e?.handlerIds)?e.handlerIds.map(t=>globalThis.Number(t)):[]}},toJSON(e){let t={};return e.data!==void 0&&(t.data=Io.toJSON(e.data)),e.handlerType!==0&&(t.handlerType=Ax(e.handlerType)),e.handlerIds?.length&&(t.handlerIds=e.handlerIds.map(n=>Math.round(n))),t},create(e){return Lt.fromPartial(e??{})},fromPartial(e){let t=tx();return t.data=e.data!==void 0&&e.data!==null?Io.fromPartial(e.data):void 0,t.handlerType=e.handlerType??0,t.handlerIds=e.handlerIds?.map(n=>n)||[],t}};function nx(){return{configUpdated:!1,error:void 0}}var qo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.configUpdated=n.bool();continue;case 2:if(a!==18)break;i.error=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{configUpdated:E(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:E(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 qo.fromPartial(e??{})},fromPartial(e){let t=nx();return t.configUpdated=e.configUpdated??!1,t.error=e.error??void 0,t}};function rx(){return{gauges:[],counters:[],events:[],exports:[],states:void 0}}var mn={encode(e,t=g.default.Writer.create()){for(let n of e.gauges)Vo.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.counters)Go.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.events)Wo.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.exports)Ho.encode(n,t.uint32(42).fork()).ldelim();return e.states!==void 0&&qo.encode(e.states,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gauges.push(Vo.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.counters.push(Go.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.events.push(Wo.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.exports.push(Ho.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.states=qo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(t=>Vo.fromJSON(t)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(t=>Go.fromJSON(t)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(t=>Wo.fromJSON(t)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(t=>Ho.fromJSON(t)):[],states:E(e.states)?qo.fromJSON(e.states):void 0}},toJSON(e){let t={};return e.gauges?.length&&(t.gauges=e.gauges.map(n=>Vo.toJSON(n))),e.counters?.length&&(t.counters=e.counters.map(n=>Go.toJSON(n))),e.events?.length&&(t.events=e.events.map(n=>Wo.toJSON(n))),e.exports?.length&&(t.exports=e.exports.map(n=>Ho.toJSON(n))),e.states!==void 0&&(t.states=qo.toJSON(e.states)),t},create(e){return mn.fromPartial(e??{})},fromPartial(e){let t=rx();return t.gauges=e.gauges?.map(n=>Vo.fromPartial(n))||[],t.counters=e.counters?.map(n=>Go.fromPartial(n))||[],t.events=e.events?.map(n=>Wo.fromPartial(n))||[],t.exports=e.exports?.map(n=>Ho.fromPartial(n))||[],t.states=e.states!==void 0&&e.states!==null?qo.fromPartial(e.states):void 0,t}};function ix(){return{context:void 0,calldata:""}}var Jo={encode(e,t=g.default.Writer.create()){return e.context!==void 0&&zo.encode(e.context,t.uint32(10).fork()).ldelim(),e.calldata!==""&&t.uint32(18).string(e.calldata),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ix();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.context=zo.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.calldata=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{context:E(e.context)?zo.fromJSON(e.context):void 0,calldata:E(e.calldata)?globalThis.String(e.calldata):""}},toJSON(e){let t={};return e.context!==void 0&&(t.context=zo.toJSON(e.context)),e.calldata!==""&&(t.calldata=e.calldata),t},create(e){return Jo.fromPartial(e??{})},fromPartial(e){let t=ix();return t.context=e.context!==void 0&&e.context!==null?zo.fromPartial(e.context):void 0,t.calldata=e.calldata??"",t}};function ax(){return{chainId:"",address:"",blockTag:""}}var zo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ax();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=n.string();continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==26)break;i.blockTag=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{chainId:E(e.chainId)?globalThis.String(e.chainId):"",address:E(e.address)?globalThis.String(e.address):"",blockTag:E(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 zo.fromPartial(e??{})},fromPartial(e){let t=ax();return t.chainId=e.chainId??"",t.address=e.address??"",t.blockTag=e.blockTag??"",t}};function sx(){return{ethCallParams:[]}}var tU={encode(e,t=g.default.Writer.create()){for(let n of e.ethCallParams)Jo.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.ethCallParams.push(Jo.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethCallParams:globalThis.Array.isArray(e?.ethCallParams)?e.ethCallParams.map(t=>Jo.fromJSON(t)):[]}},toJSON(e){let t={};return e.ethCallParams?.length&&(t.ethCallParams=e.ethCallParams.map(n=>Jo.toJSON(n))),t},create(e){return tU.fromPartial(e??{})},fromPartial(e){let t=sx();return t.ethCallParams=e.ethCallParams?.map(n=>Jo.fromPartial(n))||[],t}};function ox(){return{ethCallResults:{}}}var nU={encode(e,t=g.default.Writer.create()){return Object.entries(e.ethCallResults).forEach(([n,r])=>{__.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ox();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=__.decode(n,n.uint32());s.value!==void 0&&(i.ethCallResults[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethCallResults:Qe(e.ethCallResults)?Object.entries(e.ethCallResults).reduce((t,[n,r])=>(t[n]=String(r),t),{}):{}}},toJSON(e){let t={};if(e.ethCallResults){let n=Object.entries(e.ethCallResults);n.length>0&&(t.ethCallResults={},n.forEach(([r,i])=>{t.ethCallResults[r]=i}))}return t},create(e){return nU.fromPartial(e??{})},fromPartial(e){let t=ox();return t.ethCallResults=Object.entries(e.ethCallResults??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=globalThis.String(i)),n),{}),t}};function cx(){return{key:"",value:""}}var __={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:E(e.key)?globalThis.String(e.key):"",value:E(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 __.fromPartial(e??{})},fromPartial(e){let t=cx();return t.key=e.key??"",t.value=e.value??"",t}};function ux(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}var rt={encode(e,t=g.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(([n,r])=>{A_.encode({key:n,value:r},t.uint32(58).fork()).ldelim()}),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ux();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 9:if(a!==74)break;i.contractName=n.string();continue;case 2:if(a!==16)break;i.blockNumber=Qt(n.uint64());continue;case 6:if(a!==50)break;i.transactionHash=n.string();continue;case 5:if(a!==42)break;i.chainId=n.string();continue;case 3:if(a!==24)break;i.transactionIndex=n.int32();continue;case 4:if(a!==32)break;i.logIndex=n.int32();continue;case 10:if(a!==82)break;i.name=n.string();continue;case 7:if(a!==58)break;let s=A_.decode(n,n.uint32());s.value!==void 0&&(i.labels[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:E(e.address)?globalThis.String(e.address):"",contractName:E(e.contractName)?globalThis.String(e.contractName):"",blockNumber:E(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:E(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:E(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:E(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:E(e.logIndex)?globalThis.Number(e.logIndex):0,name:E(e.name)?globalThis.String(e.name):"",labels:Qe(e.labels)?Object.entries(e.labels).reduce((t,[n,r])=>(t[n]=String(r),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 n=Object.entries(e.labels);n.length>0&&(t.labels={},n.forEach(([r,i])=>{t.labels[r]=i}))}return t},create(e){return rt.fromPartial(e??{})},fromPartial(e){let t=ux();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((n,[r,i])=>(i!==void 0&&(n[r]=globalThis.String(i)),n),{}),t}};function lx(){return{key:"",value:""}}var A_={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=lx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:E(e.key)?globalThis.String(e.key):"",value:E(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 A_.fromPartial(e??{})},fromPartial(e){let t=lx();return t.key=e.key??"",t.value=e.value??"",t}};function dx(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}var Et={encode(e,t=g.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&&yt.encode(e.bigInteger,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bigDecimal=n.string();continue;case 2:if(a!==17)break;i.doubleValue=n.double();continue;case 3:if(a!==26)break;i.bigInteger=yt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bigDecimal:E(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:E(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:E(e.bigInteger)?yt.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=yt.toJSON(e.bigInteger)),t},create(e){return Et.fromPartial(e??{})},fromPartial(e){let t=dx();return t.bigDecimal=e.bigDecimal??void 0,t.doubleValue=e.doubleValue??void 0,t.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?yt.fromPartial(e.bigInteger):void 0,t}};function px(){return{from:0}}var it={encode(e,t=g.default.Writer.create()){return e.from!==0&&t.uint32(8).int32(e.from),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=px();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.from=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:E(e.from)?_x(e.from):0}},toJSON(e){let t={};return e.from!==0&&(t.from=Ax(e.from)),t},create(e){return it.fromPartial(e??{})},fromPartial(e){let t=px();return t.from=e.from??0,t}};function fx(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}var Vo={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&Et.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=Et.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,metricValue:E(e.metricValue)?Et.fromJSON(e.metricValue):void 0,runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=Et.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Vo.fromPartial(e??{})},fromPartial(e){let t=fx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?Et.fromPartial(e.metricValue):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}};function hx(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}var Go={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&Et.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.add!==!1&&t.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=Et.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.add=n.bool();continue;case 4:if(a!==34)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,metricValue:E(e.metricValue)?Et.fromJSON(e.metricValue):void 0,add:E(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=Et.toJSON(e.metricValue)),e.add!==!1&&(t.add=e.add),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Go.fromPartial(e??{})},fromPartial(e){let t=hx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?Et.fromPartial(e.metricValue):void 0,t.add=e.add??!1,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}};function mx(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,noMetric:!1}}var Wo={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&t.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&B.encode(B.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&&it.encode(e.runtimeInfo,t.uint32(42).fork()).ldelim(),e.noMetric!==!1&&t.uint32(24).bool(e.noMetric),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.distinctEntityId=n.string();continue;case 6:if(a!==50)break;i.attributes=B.unwrap(B.decode(n,n.uint32()));continue;case 7:if(a!==56)break;i.severity=n.int32();continue;case 8:if(a!==66)break;i.message=n.string();continue;case 5:if(a!==42)break;i.runtimeInfo=it.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.noMetric=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,distinctEntityId:E(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:Qe(e.attributes)?e.attributes:void 0,severity:E(e.severity)?HQ(e.severity):0,message:E(e.message)?globalThis.String(e.message):"",runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0,noMetric:E(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.distinctEntityId!==""&&(t.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(t.attributes=e.attributes),e.severity!==0&&(t.severity=ZQ(e.severity)),e.message!==""&&(t.message=e.message),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),e.noMetric!==!1&&(t.noMetric=e.noMetric),t},create(e){return Wo.fromPartial(e??{})},fromPartial(e){let t=mx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.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?it.fromPartial(e.runtimeInfo):void 0,t.noMetric=e.noMetric??!1,t}};function gx(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}var Ho={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.payload!==""&&t.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.payload=n.string();continue;case 3:if(a!==26)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,payload:E(e.payload)?globalThis.String(e.payload):"",runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.payload!==""&&(t.payload=e.payload),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Ho.fromPartial(e??{})},fromPartial(e){let t=gx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.payload=e.payload??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}},Cte={name:"Processor",fullName:"processor.Processor",methods:{start:{name:"Start",requestType:wx,requestStream:!1,responseType:mu,responseStream:!1,options:{}},stop:{name:"Stop",requestType:mu,requestStream:!1,responseType:mu,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:yx,requestStream:!1,responseType:vx,responseStream:!1,options:{}},processBindings:{name:"ProcessBindings",requestType:bx,requestStream:!1,responseType:Ex,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:Cx,requestStream:!0,responseType:Ix,responseStream:!0,options:{}},preprocessBindingsStream:{name:"PreprocessBindingsStream",requestType:Sx,requestStream:!0,responseType:xx,responseStream:!0,options:{}}}};function ur(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function Nn(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function lr(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):Nn(Fe.fromJSON(e))}function Qt(e){return BigInt(e.toString())}g.default.util.Long!==Kr&&(g.default.util.Long=Kr,g.default.configure());function Qe(e){return typeof e=="object"&&e!==null}function E(e){return e!=null}var Tx=":sto_bi",rU=":sto_bd";function iU(e){return e.slice(0,128).replace(/[^_a-zA-Z0-9]/g,"_")}function y_(e){return e==="labels"?"labels_":iU(e)}function aU(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}function v_(e){let t={};for(let n in e)e[n]!==void 0?t[y_(n)]=aU(e[n]):console.warn(`key: ${n} has empty value in attributes`);return t}function Nx(e,t,n){let r;switch(typeof e){case"string":return e.slice(0,t);case"bigint":return e.toString()+Tx;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: ${n??""}`),null;if(e===Object(e)){if(e instanceof Date)return e.toISOString();if(e instanceof Mt)return e.isNaN()||!e.isFinite()?(console.error("can't submit NaN or Infinity value, will store as 0"),0):e.toString()+rU;if(Hr.isBN(e))return e.toString(10)+Tx;if(e instanceof Promise)return console.error("Cannot submit promise"),null;r={};for(let[a,s]of Object.entries(e)){let o=Nx(s,t,`${n??""}.${a}`);o!=null&&(r[a]=o)}}else r=e;return r}function ud(e){return Nx(e,1e3)}import{MapStateStorage as oU}from"@sentio/runtime";import{ListStateStorage as sU}from"@sentio/runtime";var w_=class extends sU{},Bi=w_;Yt(Bi,"INSTANCE",new w_);var Oi=class{static register(t){Bi.INSTANCE.addValue(t)}static findEntity(t){for(let n of Bi.INSTANCE.getValues())if(n.entities[t])return n.entities[t]}};var b_=class extends oU{},Zo=b_;Yt(Zo,"INSTANCE",new b_);var ld=class{ctx;constructor(t){this.ctx=t}emit(t,n){Bx(t),kx(this.ctx,t,n)}},Wte=vt;function Rx(e){let t=[];for(let[n,r]of Object.entries(e)){let i,a,s;typeof r=="number"?i=r:r.address||r.symbol?a=r:s=Ri.create({fields:Rx(r)}),t.push({name:n,basicType:i,coinType:a,structType:s})}return t}var dd=class{eventName;config;constructor(t,n){this.eventName=t,this.config=n}static register(t,n){Bx(t);let r=ei.create();n?.fields&&(r=ei.create({name:t,fields:Rx(n.fields)}));let i=new dd(t,r);return Zo.INSTANCE.getOrSetValue(t,i)}emit(t,n){kx(t,this.eventName,n)}};function kx(e,t,n){let{distinctId:r,severity:i,message:a,...s}=n,o={metadata:e.getMetaData(t,{}),severity:i||wt.INFO,message:a||"",distinctEntityId:r||"",attributes:{...v_(e.baseLabels),...ud(s)},runtimeInfo:void 0,noMetric:!0};e.update({events:[o]})}function Bx(e){if(Oi.findEntity(e))throw new Error(`Event name ${e} is already used in the database schema`)}function fd(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)?Et.fromPartial({bigInteger:E_(e)}):Et.fromPartial({doubleValue:Number(e)})}if(typeof e=="bigint")return Et.fromPartial({bigInteger:E_(e)});if(typeof e=="string")return Et.fromPartial({bigDecimal:e});if(e.isInteger())return Et.fromPartial({bigInteger:Ox(e)});if(e.isNaN())throw new Error("Cannot record NaN value");if(!e.isFinite())throw new Error("Cannot record infinite value");return Et.fromPartial({bigDecimal:e.toString()})}function Ox(e){let t=e.isNegative();return t&&(e=e.abs()),Px(e.toString(16),t)}function pd(e){let t=e<0;return t&&(e=-e),Px(e.toString(16),t)}function E_(e){return typeof e=="number"||typeof e=="bigint"?pd(e):typeof e=="string"?pd(BigInt(e)):e instanceof Mt?Ox(e):pd(e)}function Px(e,t){e.length%2===1&&(e="0"+e);let n=Buffer.from(e,"hex");return{negative:t,data:new Uint8Array(n)}}var Pi=class{name;constructor(t){this.name=y_(t)}};import{MapStateStorage as cU}from"@sentio/runtime";var C_=class{unit;description;sparse;aggregationConfig};var hd=class extends Pi{config;constructor(t,n,r){super(n),this.config=Nr.fromPartial({...r,name:this.name,type:t});let i=this.config.aggregationConfig;i&&i.intervalInMinutes.length&&(i.intervalInMinutes.length>1&&console.error("current only support one intervalInMinutes, only first interval will be used for",n),i.intervalInMinutes[0]>0&&i.types.length===0&&(i.types=[pt.SUM,pt.COUNT]))}},I_=class extends cU{getOrRegisterMetric(t,n,r){let i=this.getOrRegister(),a=i.get(n);if(a&&a.config.type!==t)throw Error(`redefine ${n} of metric type ${t} that is previously ${a.config.type}`);return a||(t===bt.COUNTER?a=Ta._create(n,r):a=Na._create(n,r)),i.set(n,a),a}},xa=I_;Yt(xa,"INSTANCE",new I_);var Ta=class extends hd{static register(t,n){return xa.INSTANCE.getOrRegisterMetric(bt.COUNTER,t,n)}static _create(t,n){return new Ta(t,n)}constructor(t,n){super(bt.COUNTER,t,Nr.fromPartial({...n,aggregationConfig:{intervalInMinutes:n?.resolutionConfig?[n?.resolutionConfig?.intervalInMinutes]:[]}}))}add(t,n,r={}){this.record(t,n,r,!0)}sub(t,n,r={}){this.record(t,n,r,!1)}record(t,n,r,i){t.update({counters:[{metadata:t.getMetaData(this.name,r),metricValue:fd(n),add:i,runtimeInfo:void 0}]})}},md=class{ctx;counter;constructor(t,n){this.counter=Ta._create(t),this.ctx=n}add(t,n={}){this.counter.add(this.ctx,t,n)}sub(t,n={}){this.counter.sub(this.ctx,t,n)}},Na=class extends hd{static register(t,n){return xa.INSTANCE.getOrRegisterMetric(bt.GAUGE,t,n)}static _create(t,n){return new Na(t,n)}constructor(t,n){super(bt.GAUGE,t,Nr.fromPartial({...n}))}record(t,n,r={}){t.update({gauges:[{metadata:t.getMetaData(this.config.name,r),metricValue:fd(n),runtimeInfo:void 0}]})}},gd=class{gauge;ctx;constructor(t,n){this.gauge=Na._create(t),this.ctx=n}record(t,n={}){this.gauge.record(this.ctx,t,n)}},gu=class{ctx;constructor(t){this.ctx=t}Counter(t){return new md(t,this.ctx)}Gauge(t){return new gd(t,this.ctx)}};var Wc=Vn(q2(),1);import{mergeProcessResults as B5,PluginManager as O5}from"@sentio/runtime";var J2=new Error("Value is required but received null or undefined");function Aae(e){let{from:t,to:n,...r}=e;return{from:i=>{if(i==null)throw J2;return t(i)},to:i=>{if(i==null||i.nullValue)throw J2;return n(i)},...r,required:!0}}function yae(e){return{from:t=>({listValue:{values:t.map(e.from)}}),to:t=>t.listValue?.values.map(e.to)||[],isArray:!0,isRelation:e.isRelation,relationName:e.relationName}}function vae(e){return{from:t=>t==null?{nullValue:dt.NULL_VALUE}:{stringValue:e[t]},to(t){return t.stringValue}}}function wae(e){return{from:t=>typeof t=="string"?{stringValue:t}:t instanceof Uint8Array?{stringValue:`0x${Buffer.from(t).toString("hex")}`}:typeof t=="object"?{stringValue:t.id.toString()}:{nullValue:dt.NULL_VALUE},to(t){return t.stringValue},isRelation:!0,relationName:e}}var w5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{stringValue:e},to(e){return e.stringValue}},b5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{intValue:Math.floor(e)},to(e){return e.intValue}},E5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{floatValue:e},to(e){return e.floatValue}},C5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{boolValue:e},to(e){return e.boolValue}},I5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{timestampValue:e},to(e){return e.timestampValue}},z2={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{bytesValue:e},to(e){return e.bytesValue}},S5={from(e){return typeof e=="string"?{stringValue:e}:e instanceof Uint8Array?{stringValue:`0x${Buffer.from(e).toString("hex")}`}:{nullValue:dt.NULL_VALUE}},to(e){if(e.stringValue)return e.stringValue;if(e.bytesValue)return`0x${Buffer.from(e.bytesValue).toString("hex")}`}},x5={from:e=>{if(e==null)return{nullValue:dt.NULL_VALUE};let t=(e.c||[]).join(""),n=-(t.length-(e.e??0)-1);return{bigdecimalValue:{value:Tf(BigInt(t)),exp:n}}},to(e){let t=e.bigdecimalValue;if(t){let n=V2(t.value.data),r=new Mt(n.toString());return t.exp<0?r=r.dividedBy(new Mt(10).pow(-t.exp)):r=r.multipliedBy(new Mt(10).pow(t.exp)),r.multipliedBy(t.value?.negative?-1:1)}}},T5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{bigintValue:Tf(e)},to(e){if(e.bigintValue){let t=V2(e.bigintValue?.data);return e.bigintValue.negative&&(t=-t),t}}};function V2(e){let t=BigInt(0);for(let n=0;n<e.length;n++)t=t*BigInt(256)+BigInt(e[n]);return t}function Tf(e){let t=e<0;t&&(e=-e);let n=e.toString(16);n.length%2===1&&(n="0"+n);let r=Buffer.from(n,"hex");return{negative:t,data:new Uint8Array(r)}}var bae={BigDecimal:x5,BigInt:T5,String:w5,Boolean:C5,Uint8Array:z2,ID:S5,Bytes:z2,Int:b5,Float:E5,Timestamp:I5};import{PluginManager as N5}from"@sentio/runtime";var Nf=class{cache=new Map;getKey(t,n){return`${t}-${n}`}has(t,n){return this.cache.has(this.getKey(t,n))}get(t,n){return this.cache.get(this.getKey(t,n))}set(t){let n=t.data?.fields.id.stringValue;if(n){let r=this.getKey(t.entity,n),i=t.data?.fields||{};if(this.cache.has(r)){let a=this.cache.get(r)?.data?.fields||{};i=Object.assign(a,i)}this.cache.set(r,{...t,data:{fields:i}})}}delete(t,n){n&&this.cache.delete(this.getKey(t,n))}};function Rf(e){if(e==null)throw new Error("can't figure out entityName from undefined");if(typeof e=="string")return e;if(typeof e=="function")return e.entityName;if(typeof e=="object")return e.constructor.entityName;throw new Error(`can't figure out entityName from ${typeof e}`)}var cl=class{constructor(t){this.context=t}cache=new Nf;async get(t,n){let r=Rf(t),i=this.cache.get(r,n);if(i)return Promise.resolve(this.newEntity(t,i));let s=await this.context.sendRequest({get:{entity:r,id:n.toString()}});if(s.entityList?.entities[0]){let o=s.entityList?.entities[0];return this.newEntity(t,o)}}async delete(t,n){let r={entity:[],id:[]},i=Rf(t);if(n)if(Array.isArray(n))for(let a of n)r.entity.push(i),r.id.push(a.toString()),this.cache.delete(i,a.toString());else r.entity.push(i),r.id.push(n),this.cache.delete(i,n);else{let a=Array.isArray(t)?t:[t];for(let s of a)r.entity.push(i),r.id.push(s.id.toString()),this.cache.delete(i,n)}await this.context.sendRequest({delete:r})}async upsert(t){let n=Array.isArray(t)?t:[t],r={upsert:{entity:n.map(a=>Rf(a)),id:n.map(a=>a.id.toString()),entityData:n.map(a=>a._data)}};return this.context.sendRequest(r).then(a=>{r.upsert?.entity.forEach((s,o)=>{this.cache.set({entity:s,data:r.upsert?.entityData[o],genBlockChain:"",genBlockTime:void 0,genBlockNumber:0n})})})}async*listIterator(t,n){let r;for(;;){let i=await this.listRequest(t,n||[],r);for(let a of i.entityList?.entities||[])yield this.newEntity(t,a);if(!i.nextCursor)break;r=i.nextCursor}}async*listBatched(t,n,r=100){let i;for(;;){let a=await this.listRequest(t,n||[],i,r);if(yield(a.entityList?.entities||[]).map(o=>this.newEntity(t,o)),!a.nextCursor)break;i=a.nextCursor}}async listRequest(t,n,r,i){let a=await this.context.sendRequest({list:{entity:Rf(t),cursor:r,pageSize:i,filters:n?.map(s=>({field:s.field,op:R5[s.op],value:{values:Array.isArray(s.value)?s.value.map(o=>Uv(o)):[Uv(s.value)]}}))||[]}},3600);return a.entityList?.entities?.forEach(s=>{this.cache.set(s)}),a}async list(t,n,r){if(r){let i=await this.listRequest(t,n||[],r.cursor,r.pageSize);return r.cursor=i.nextCursor,i.entityList?.entities.map(a=>this.newEntity(t,a))||[]}return this.fromAsync(this.listIterator(t,n??[]))}async fromAsync(t){let n=[];for await(let r of t)n.push(r);return n}newEntity(t,n){if(typeof t=="string"){let i=Oi.findEntity(t);if(!i&&(i=Oi.findEntity(n.entity),!i))throw new Error(`Entity ${t} not found`);t=i}let r=new t({});return r._data=n.data,r}},R5={"=":de.EQ,"!=":de.NE,"<":de.LT,"<=":de.LE,">":de.GT,">=":de.GE,in:de.IN,"not in":de.NOT_IN,like:de.LIKE,"not like":de.NOT_LIKE,"has all":de.HAS_ALL,"has any":de.HAS_ANY};function Uv(e){return e==null?{nullValue:0}:typeof e=="boolean"?{boolValue:e}:typeof e=="string"?{stringValue:e}:typeof e=="number"?{floatValue:e}:typeof e=="bigint"?{bigintValue:Tf(e)}:e instanceof Mt?k5(e):e instanceof Date?{timestampValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{listValue:{values:e.map(t=>Uv(t))}}:{nullValue:0}}function k5(e){return{bigdecimalValue:void 0}}function Bae(){let e=N5.INSTANCE.dbContextLocalStorage.getStore();if(e)return new cl(e)}var qv=class{meter;eventLogger;_store;baseLabels;active;_res={counters:[],events:[],exports:[],gauges:[],states:{configUpdated:!1}};update(t){if(this.active)this._res=B5([this._res,mn.fromPartial(t)]);else throw new Wc.ServerError(Wc.Status.INTERNAL,"context not active, possible async function invoke without await")}constructor(t){this.meter=new gu(this),this.eventLogger=new ld(this),this.baseLabels=t||{},this.active=!0,this.initStore()}stopAndGetResult(){if(this.active)return this.active=!1,this._res;throw new Wc.ServerError(Wc.Status.INTERNAL,"Can't get result from same context twice")}getMetaData(t,n){return{...this.baseLabels,...this.getMetaDataInternal(t,n)}}get store(){return this._store==null&&console.warn("Store is not set, please initialize the processor with your database schema first."),this._store}initStore(){let t=O5.INSTANCE.dbContextLocalStorage.getStore();t&&(this._store=new cl(t))}};import{MapStateStorage as P5}from"@sentio/runtime";var Jv=class extends P5{},Hc=Jv;Yt(Hc,"INSTANCE",new Jv);var ul=class extends Pi{static register(t,n){let r=new ul(t,n);return Hc.INSTANCE.getOrSetValue(t,r)}channel;constructor(t,n){super(t),this.channel=n}emit(t,n){let r={metadata:t.getMetaData(this.name,{}),payload:JSON.stringify(n),runtimeInfo:void 0};t.update({exports:[r]})}};import{MapStateStorage as D5}from"@sentio/runtime";var Vv=class extends D5{},Za=Vv;Yt(Za,"INSTANCE",new Vv);var Bf=class extends Pi{static register(t,n){let r=new Bf(t,{...Bf.DEFAULT_OPTIONS,...n});return Za.INSTANCE.getOrSetValue(t,r)}options;constructor(t,n){super(t),this.options=n}trackEvent(t,n){let{distinctId:r,message:i,severity:a,...s}=n,o={message:i||"",severity:a||wt.INFO,metadata:t.getMetaData(this.name,{}),distinctEntityId:r||"",attributes:ud(s),runtimeInfo:void 0,noMetric:!1};t.update({events:[o]})}},kf=Bf;Yt(kf,"DEFAULT_OPTIONS",{totalByDay:!0,unique:!0});var Of=class extends kf{static register(t,n){t?t=["user",t].join("_"):t="user";let r=new Of(t,{...Of.DEFAULT_OPTIONS,...n});return Za.INSTANCE.getOrSetValue(t,r)}},zv=Of;Yt(zv,"DEFAULT_OPTIONS",{totalByDay:!0,unique:!0,distinctByDays:[1,7,30]});import{Plugin as F5,PluginManager as L5}from"@sentio/runtime";import{ListStateStorage as M5}from"@sentio/runtime";var Gv=class extends M5{},ll=Gv;Yt(ll,"INSTANCE",new Gv);var Pf=class extends F5{name="CorePlugin";async configure(t){t.templateInstances=[...ll.INSTANCE.getValues()];for(let n of xa.INSTANCE.getValues())t.metricConfigs.push({...n.config});for(let n of Zo.INSTANCE.getValues())t.eventLogConfigs.push({...n.config});for(let n of Za.INSTANCE.getValues())t.eventTrackingConfigs.push({distinctAggregationByDays:n.options.distinctByDays||[],eventName:n.name,retentionConfig:void 0,totalByDay:n.options.totalByDay||!1,totalPerEntity:void 0,unique:n.options.unique||!1});for(let n of Hc.INSTANCE.getValues())t.exportConfigs.push({name:n.name,channel:n.channel});Bi.INSTANCE.getValues().length>0&&(t.dbSchema={gqlSchema:Bi.INSTANCE.getValues().map(n=>n.source).join(`
|
|
829
|
+
${JSON.stringify(this.#e,null,2)}`}byteLength(){return this.toBytes().byteLength}},tQ=e=>$f+Yf({maxInputs:e}),Fj=ie+pa+Al+ie+ie;function nQ(e){let t=[...e.receipts],n,r;if(t.forEach(a=>{a.type===ne.ScriptResult?n=a:(a.type===ne.Return||a.type===ne.ReturnData||a.type===ne.Revert)&&(r=a)}),!n||!r)throw new b(I.SCRIPT_REVERTED,"Transaction reverted.");return{code:n.result,gasUsed:n.gasUsed,receipts:t,scriptResultReceipt:n,returnReceipt:r,callResult:e}}function Wg(e,t,n=[]){try{let r=nQ(e);return t(r)}catch(r){if(r.code===I.SCRIPT_REVERTED){let i=e?.dryRunStatus?.reason;throw $l({logs:n,receipts:e.receipts,statusReason:i})}throw r}}function rQ(e,t,n){return Wg(e,r=>{if(r.returnReceipt.type===ne.Revert)throw new b(I.SCRIPT_REVERTED,`Script Reverted. Logs: ${JSON.stringify(n)}`);if(r.returnReceipt.type!==ne.Return&&r.returnReceipt.type!==ne.ReturnData){let{type:a}=r.returnReceipt;throw new b(I.SCRIPT_REVERTED,`Script Return Type [${a}] Invalid. Logs: ${JSON.stringify({logs:n,receipt:r.returnReceipt})}`)}let i;return r.returnReceipt.type===ne.Return&&(i=r.returnReceipt.val),r.returnReceipt.type===ne.ReturnData&&(i=t.func.decodeOutput(r.returnReceipt.data)[0]),i},n)}var du=class{bytes;scriptDataEncoder;scriptResultDecoder;constructor(e,t,n){this.bytes=R(e),this.scriptDataEncoder=t,this.scriptResultDecoder=n}static getScriptDataOffsetWithScriptBytes(e,t){return Yf({maxInputs:t})+$f+e}getScriptDataOffset(e){return du.getScriptDataOffsetWithScriptBytes(this.bytes.length,e)}encodeScriptData(e){let t=this.scriptDataEncoder(e);return ArrayBuffer.isView(t)?t:(this.bytes=R(t.script),t.data)}decodeCallResult(e,t=[]){return Wg(e,this.scriptResultDecoder,t)}},MC={assetIdOffset:0,amountOffset:0,gasForwardedOffset:0,callDataOffset:0},iQ=Ie,FC=({callDataOffset:e,gasForwardedOffset:t,amountOffset:n,assetIdOffset:r})=>{let i=new DC(kt.movi(16,e),kt.movi(17,n),kt.lw(17,17,0),kt.movi(18,r));return t?i.push(kt.movi(19,t),kt.lw(19,19,0),kt.call(16,17,18,19)):i.push(kt.call(16,17,18,kt.RegId.cgas().to_u8())),i};function BC(e){if(!e.length)return new Uint8Array;let t=new DC;for(let n=0;n<e.length;n+=1)t.extend(FC(e[n]).entries());return t.push(kt.ret(1)),t.toBytes()}var aQ=e=>e===ne.Return||e===ne.ReturnData,sQ=(e,t)=>e.find(({type:n,from:r,to:i})=>n===ne.Call&&r===iQ&&i===t),oQ=e=>t=>{if(bn(t.code)!==0)throw new b(I.SCRIPT_REVERTED,"Transaction reverted.");let n=sQ(t.receipts,e.toB256()),r=v(n?.is);return t.receipts.filter(({type:a})=>aQ(a)).flatMap(a=>r.eq(v(a.is))?a.type===ne.Return?[new q("u64").encode(a.val)]:a.type===ne.ReturnData?[R(a.data)]:[new Uint8Array]:[])},cQ=(e,t,n=[])=>Wg(e,oQ(t),n),uQ=e=>e.reduce((t,n)=>{let r={...MC};return n.gas&&(r.gasForwardedOffset=1),t+FC(r).byteLength()},kt.Instruction.size()),lQ=(e,t)=>new du(BC(new Array(e.length).fill(MC)),n=>{let r=n.length;if(r===0)return{data:new Uint8Array,script:new Uint8Array};let i=uQ(n),a=(8-i%8)%8,s=i+a,o=tQ(t.toNumber())+s,c=[],u=o,d=[];for(let A=0;A<r;A+=1){let w=n[A],C=u,x=C+ie,S=x+pa,N=S+Al+ie+ie,F=N+w.fnSelectorBytes.byteLength,M=R(w.data),X=0;d.push(new q("u64").encode(w.amount||0)),d.push(new G().encode(w.assetId?.toString()||Ie)),d.push(w.contractId.toBytes()),d.push(new q("u64").encode(N)),d.push(new q("u64").encode(F)),d.push(w.fnSelectorBytes),d.push(M),w.gas&&(d.push(new q("u64").encode(w.gas)),X=F+M.byteLength);let H={amountOffset:C,assetIdOffset:x,gasForwardedOffset:X,callDataOffset:S};c.push(H),u=o+Y(d).byteLength}let f=BC(c);return{data:Y(d),script:f}},()=>[new Uint8Array]);function dQ(e){return e.receipts.find(n=>n.type===ne.ScriptResult)?.gasUsed||v(0)}var LC=class{functionScopes;isMultiCall;gasUsed;value;constructor(e,t,n){this.functionScopes=Array.isArray(e)?e:[e],this.isMultiCall=n,this.value=this.getDecodedValue(t),this.gasUsed=dQ(t)}getFirstCallConfig(){if(this.functionScopes[0])return this.functionScopes[0].getCallConfig()}getAbiFromAllCalls(){return OC(this.functionScopes)}getDecodedValue(e){let t=this.getDecodedLogs(e.receipts),n=this.getFirstCallConfig();if(this.functionScopes.length===1&&n&&"bytes"in n.program)return rQ(e,n,t);let i=cQ(e,(n?.program).id,t).map((a,s)=>{let{func:o}=this.functionScopes[s].getCallConfig();return o.decodeOutput(a)?.[0]});return this.isMultiCall?i:i?.[0]}getDecodedLogs(e){if(!this.getFirstCallConfig())return[];let{main:n,otherContractsAbis:r}=this.getAbiFromAllCalls();return jl(e,n,r)}},QC=class extends LC{transactionId;transactionResponse;transactionResult;program;logs;constructor(e,t,n,r,i){super(e,n,i),this.transactionResponse=t,this.transactionResult=n,this.transactionId=this.transactionResponse.id,this.program=r,this.logs=this.getDecodedLogs(n.receipts)}static async build(e,t,n,r){let i=await t.waitForResult();return new QC(e,t,i,r,n)}},ed=class extends LC{callResult;constructor(e,t,n){super(e,t,n),this.callResult=t}static async build(e,t,n){return await new ed(e,t,n)}};function pQ(e){let{program:t,args:n,forward:r,func:i,callParameters:a,externalAbis:s}=e.getCallConfig(),o=i.encodeArguments(n);return{contractId:t.id,fnSelectorBytes:i.selectorBytes,data:o,assetId:r?.assetId,amount:r?.amount,gas:a?.gasLimit,externalContractsAbis:s}}var UC=class{transactionRequest;program;functionInvocationScopes=[];txParameters;requiredCoins=[];isMultiCall=!1;hasCallParamsGasLimit=!1;externalAbis={};addSignersCallback;constructor(e,t){this.program=e,this.isMultiCall=t,this.transactionRequest=new Ii}get calls(){if(!this.getProvider().getChain())throw new b(b.CODES.CHAIN_INFO_CACHE_EMPTY,"Provider chain info cache is empty. Please make sure to initialize the `Provider` properly by running `await Provider.create()``");return this.functionInvocationScopes.map(n=>pQ(n))}updateScriptRequest(){let e=this.getProvider(),{consensusParameters:{txParameters:{maxInputs:t}}}=e.getChain(),n=lQ(this.functionInvocationScopes,t);this.transactionRequest.setScript(n,this.calls)}updateContractInputAndOutput(){this.calls.forEach(t=>{t.contractId&&this.transactionRequest.addContractInputAndOutput(t.contractId),t.externalContractsAbis&&Object.keys(t.externalContractsAbis).forEach(n=>this.transactionRequest.addContractInputAndOutput(ee.fromB256(n)))})}getRequiredCoins(){return this.calls.map(t=>({assetId:String(t.assetId),amount:v(t.amount||0)})).filter(({assetId:t,amount:n})=>t&&!v(n).isZero())}updateRequiredCoins(){let e=this.getRequiredCoins(),t=(n,{assetId:r,amount:i})=>{let a=n.get(r)?.amount||v(0);return n.set(r,{assetId:String(r),amount:a.add(i)})};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 PC.initWasm(),this.updateScriptRequest(),this.updateRequiredCoins(),this.checkGasLimitTotal(),this.transactionRequest.type===Oe.Script&&(this.transactionRequest.abis=OC(this.functionInvocationScopes))}checkGasLimitTotal(){let e=this.calls.reduce((t,n)=>t.add(n.gas||0),v(0));if(this.transactionRequest.gasLimit.eq(0))this.transactionRequest.gasLimit=e;else if(e.gt(this.transactionRequest.gasLimit))throw new b(I.TRANSACTION_ERROR,"Transaction's gasLimit must be equal to or greater than the combined forwarded gas of all calls.")}async getTransactionCost(){let e=this.getProvider(),t=await this.getTransactionRequest();return await e.getTransactionCost(t,{resourcesOwner:this.program.account,quantitiesToContract:this.getRequiredCoins(),signatureCallback:this.addSignersCallback})}async fundWithRequiredCoins(){let e=await this.getTransactionRequest();e=zt(e);let t=await this.getTransactionCost(),{gasUsed:n,missingContractIds:r,outputVariables:i,maxFee:a}=t;return this.setDefaultTxParams(e,n,a),e.inputs=e.inputs.filter(s=>s.type!==he.Coin),r.forEach(s=>{e.addContractInputAndOutput(ee.fromString(s))}),e.addVariableOutputs(i),await this.program.account?.fund(e,t),this.addSignersCallback&&await this.addSignersCallback(e),e}txParams(e){this.txParameters=e;let t=this.transactionRequest;return t.tip=v(e.tip||t.tip),t.gasLimit=v(e.gasLimit||t.gasLimit),t.maxFee=e.maxFee?v(e.maxFee):t.maxFee,t.witnessLimit=e.witnessLimit?v(e.witnessLimit):t.witnessLimit,t.maturity=e.maturity||t.maturity,t.addVariableOutputs(this.txParameters?.variableOutputs||0),this}addContracts(e){return e.forEach(t=>{this.transactionRequest.addContractInputAndOutput(t.id),this.externalAbis[t.id.toB256()]=t.interface.jsonAbi}),this}addTransfer(e){let{amount:t,destination:n,assetId:r}=e,i=this.getProvider().getBaseAssetId();return this.transactionRequest=this.transactionRequest.addCoinOutput(ee.fromAddressOrString(n),t,r||i),this}addBatchTransfer(e){let t=this.getProvider().getBaseAssetId();return e.forEach(({destination:n,amount:r,assetId:i})=>{this.transactionRequest=this.transactionRequest.addCoinOutput(ee.fromAddressOrString(n),r,i||t)}),this}addSigners(e){return this.addSignersCallback=async t=>t.addAccountWitnesses(e),this}async getTransactionRequest(){return await this.prepareTransaction(),this.transactionRequest}async call(){kC(this.program.account,"Wallet is required!");let e=await this.fundWithRequiredCoins(),t=await this.program.account.sendTransaction(e,{awaitExecution:!0,estimateTxDependencies:!1});return QC.build(this.functionInvocationScopes,t,this.isMultiCall,this.program)}async simulate(){if(kC(this.program.account,"Wallet is required!"),!("populateTransactionWitnessesSignature"in this.program.account))throw new b(I.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 ed.build(this.functionInvocationScopes,t,this.isMultiCall)}async dryRun(){let{receipts:e}=await this.getTransactionCost(),t={receipts:e};return ed.build(this.functionInvocationScopes,t,this.isMultiCall)}async get(){let{receipts:e}=await this.getTransactionCost(),t={receipts:e};return ed.build(this.functionInvocationScopes,t,this.isMultiCall)}getProvider(){return this.program.provider}async getTransactionId(e){let t=e??await this.getProvider().getChainId();return(await this.getTransactionRequest()).getTransactionId(t)}setDefaultTxParams(e,t,n){let r=yr(this.txParameters?.gasLimit)||this.hasCallParamsGasLimit,i=yr(this.txParameters?.maxFee),{gasLimit:a,maxFee:s}=e;if(!r)e.gasLimit=t;else if(a.lt(t))throw new b(I.GAS_LIMIT_TOO_LOW,`Gas limit '${a}' is lower than the required: '${t}'.`);if(!i)e.maxFee=n;else if(n.gt(s))throw new b(I.MAX_FEE_TOO_LOW,`Max fee '${s}' is lower than the required: '${n}'.`)}},qC=class extends UC{func;callParameters;forward;args;constructor(e,t,n){super(e,!1),this.func=t,this.args=n||[],this.setArguments(...n),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 b(I.TRANSACTION_ERROR,`The target function ${this.func.name} cannot accept forwarded funds as it's not marked as 'payable'.`);this.forward=Xl(e.forward)}return this.setArguments(...this.args),this.updateRequiredCoins(),this}},fQ=class extends UC{constructor(e,t){super(e,!0),this.addCalls(t)}addCall(e){return super.addCalls([e])}addCalls(e){return super.addCalls(e)}},hQ=class{id;provider;interface;account;functions={};constructor(e,t,n){this.interface=t instanceof En?t:new En(t),this.id=ee.fromAddressOrString(e),n&&"provider"in n?(this.provider=n.provider,this.account=n):(this.provider=n,this.account=null),Object.keys(this.interface.functions).forEach(r=>{let i=this.interface.getFunction(r);Object.defineProperty(this.functions,i.name,{value:this.buildFunction(i),writable:!1})})}buildFunction(e){return(()=>{let t=(...n)=>new qC(this,e,n);return Object.defineProperty(t,"isReadOnly",{value:()=>e.isReadOnly(),writable:!1}),t})()}multiCall(e){return new fQ(this,e)}getBalance(e){return this.provider.getContractBalance(this.id,e)}};var oee=new du("0x24000000",()=>new Uint8Array(0),()=>{});var mQ=Object.defineProperty,gQ=(e,t)=>{for(var n in t)mQ(e,n,{get:t[n],enumerable:!0})},_Q={};gQ(_Q,{getContractId:()=>yQ,getContractRoot:()=>JC,getContractStorageRoot:()=>AQ,hexlifyWithPrefix:()=>vQ});var JC=e=>{let n=R(e),r=Ff(n,16384);return wg(r.map(i=>O(i)))},AQ=e=>{let t=new UE;return e.forEach(({key:n,value:r})=>t.update(We(n),r)),t.root},yQ=(e,t,n)=>{let r=JC(R(e));return We(Y(["0x4655454C",t,r,n]))},vQ=e=>O(e.startsWith("0x")?e:`0x${e}`);var zC="http://127.0.0.1:4000/v1/graphql";var vee=typeof process<"u"&&process?.env?.FUEL_NETWORK_URL||zC;BigInt.prototype.asBigDecimal=function(){return new Mt(this.toString())};BigInt.prototype.scaleDown=function(e){return Hg(this,e)};Hr.prototype.asBigDecimal=function(){return new Mt(this.toString(10))};Hr.prototype.scaleDown=function(e){return Hg(BigInt(this.toString(10)),e)};function Hg(e,t){let n=new Mt(10).pow(Number(t));return e.asBigDecimal().dividedBy(n)}var In=null;try{In=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 Je(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}Je.prototype.__isLong__;Object.defineProperty(Je.prototype,"__isLong__",{value:!0});function Ft(e){return(e&&e.__isLong__)===!0}function VC(e){var t=Math.clz32(e&-e);return e?31-t:t}Je.isLong=Ft;var GC={},WC={};function ba(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=WC[e],r)?r:(n=Re(e,0,!0),i&&(WC[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=GC[e],r)?r:(n=Re(e,e<0?-1:0,!1),i&&(GC[e]=n),n))}Je.fromInt=ba;function Sn(e,t){if(isNaN(e))return t?$r:Xn;if(t){if(e<0)return $r;if(e>=YC)return jC}else{if(e<=-ZC)return an;if(e+1>=ZC)return KC}return e<0?Sn(-e,t).neg():Re(e%Os|0,e/Os|0,t)}Je.fromNumber=Sn;function Re(e,t,n){return new Je(e,t,n)}Je.fromBits=Re;var td=Math.pow;function Xg(e,t,n){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(n=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?$r:Xn;if(n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return Xg(e.substring(1),t,n).neg();for(var i=Sn(td(n,8)),a=Xn,s=0;s<e.length;s+=8){var o=Math.min(8,e.length-s),c=parseInt(e.substring(s,s+o),n);if(o<8){var u=Sn(td(n,o));a=a.mul(u).add(Sn(c))}else a=a.mul(i),a=a.add(Sn(c))}return a.unsigned=t,a}Je.fromString=Xg;function Yn(e,t){return typeof e=="number"?Sn(e,t):typeof e=="string"?Xg(e,t):Re(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Je.fromValue=Yn;var HC=65536,wQ=1<<24,Os=HC*HC,YC=Os*Os,ZC=YC/2,XC=ba(wQ),Xn=ba(0);Je.ZERO=Xn;var $r=ba(0,!0);Je.UZERO=$r;var Bs=ba(1);Je.ONE=Bs;var $C=ba(1,!0);Je.UONE=$C;var Zg=ba(-1);Je.NEG_ONE=Zg;var KC=Re(-1,2147483647,!1);Je.MAX_VALUE=KC;var jC=Re(-1,-1,!0);Je.MAX_UNSIGNED_VALUE=jC;var an=Re(0,-2147483648,!1);Je.MIN_VALUE=an;var U=Je.prototype;U.toInt=function(){return this.unsigned?this.low>>>0:this.low};U.toNumber=function(){return this.unsigned?(this.high>>>0)*Os+(this.low>>>0):this.high*Os+(this.low>>>0)};U.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(an)){var n=Sn(t),r=this.div(n),i=r.mul(n).sub(this);return r.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=Sn(td(t,6),this.unsigned),s=this,o="";;){var c=s.div(a),u=s.sub(c.mul(a)).toInt()>>>0,d=u.toString(t);if(s=c,s.isZero())return d+o;for(;d.length<6;)d="0"+d;o=""+d+o}};U.getHighBits=function(){return this.high};U.getHighBitsUnsigned=function(){return this.high>>>0};U.getLowBits=function(){return this.low};U.getLowBitsUnsigned=function(){return this.low>>>0};U.getNumBitsAbs=function(){if(this.isNegative())return this.eq(an)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,n=31;n>0&&!(t&1<<n);n--);return this.high!=0?n+33:n+1};U.isZero=function(){return this.high===0&&this.low===0};U.eqz=U.isZero;U.isNegative=function(){return!this.unsigned&&this.high<0};U.isPositive=function(){return this.unsigned||this.high>=0};U.isOdd=function(){return(this.low&1)===1};U.isEven=function(){return(this.low&1)===0};U.equals=function(t){return Ft(t)||(t=Yn(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};U.eq=U.equals;U.notEquals=function(t){return!this.eq(t)};U.neq=U.notEquals;U.ne=U.notEquals;U.lessThan=function(t){return this.comp(t)<0};U.lt=U.lessThan;U.lessThanOrEqual=function(t){return this.comp(t)<=0};U.lte=U.lessThanOrEqual;U.le=U.lessThanOrEqual;U.greaterThan=function(t){return this.comp(t)>0};U.gt=U.greaterThan;U.greaterThanOrEqual=function(t){return this.comp(t)>=0};U.gte=U.greaterThanOrEqual;U.ge=U.greaterThanOrEqual;U.compare=function(t){if(Ft(t)||(t=Yn(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?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};U.comp=U.compare;U.negate=function(){return!this.unsigned&&this.eq(an)?an:this.not().add(Bs)};U.neg=U.negate;U.add=function(t){Ft(t)||(t=Yn(t));var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,a=this.low&65535,s=t.high>>>16,o=t.high&65535,c=t.low>>>16,u=t.low&65535,d=0,f=0,h=0,A=0;return A+=a+u,h+=A>>>16,A&=65535,h+=i+c,f+=h>>>16,h&=65535,f+=r+o,d+=f>>>16,f&=65535,d+=n+s,d&=65535,Re(h<<16|A,d<<16|f,this.unsigned)};U.subtract=function(t){return Ft(t)||(t=Yn(t)),this.add(t.neg())};U.sub=U.subtract;U.multiply=function(t){if(this.isZero())return this;if(Ft(t)||(t=Yn(t)),In){var n=In.mul(this.low,this.high,t.low,t.high);return Re(n,In.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?$r:Xn;if(this.eq(an))return t.isOdd()?an:Xn;if(t.eq(an))return this.isOdd()?an:Xn;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(XC)&&t.lt(XC))return Sn(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=this.high&65535,a=this.low>>>16,s=this.low&65535,o=t.high>>>16,c=t.high&65535,u=t.low>>>16,d=t.low&65535,f=0,h=0,A=0,w=0;return w+=s*d,A+=w>>>16,w&=65535,A+=a*d,h+=A>>>16,A&=65535,A+=s*u,h+=A>>>16,A&=65535,h+=i*d,f+=h>>>16,h&=65535,h+=a*u,f+=h>>>16,h&=65535,h+=s*c,f+=h>>>16,h&=65535,f+=r*d+i*u+a*c+s*o,f&=65535,Re(A<<16|w,f<<16|h,this.unsigned)};U.mul=U.multiply;U.divide=function(t){if(Ft(t)||(t=Yn(t)),t.isZero())throw Error("division by zero");if(In){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var n=(this.unsigned?In.div_u:In.div_s)(this.low,this.high,t.low,t.high);return Re(n,In.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?$r:Xn;var r,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return $r;if(t.gt(this.shru(1)))return $C;a=$r}else{if(this.eq(an)){if(t.eq(Bs)||t.eq(Zg))return an;if(t.eq(an))return Bs;var s=this.shr(1);return r=s.div(t).shl(1),r.eq(Xn)?t.isNegative()?Bs:Zg:(i=this.sub(t.mul(r)),a=r.add(i.div(t)),a)}else if(t.eq(an))return this.unsigned?$r:Xn;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=Xn}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),c=o<=48?1:td(2,o-48),u=Sn(r),d=u.mul(t);d.isNegative()||d.gt(i);)r-=c,u=Sn(r,this.unsigned),d=u.mul(t);u.isZero()&&(u=Bs),a=a.add(u),i=i.sub(d)}return a};U.div=U.divide;U.modulo=function(t){if(Ft(t)||(t=Yn(t)),In){var n=(this.unsigned?In.rem_u:In.rem_s)(this.low,this.high,t.low,t.high);return Re(n,In.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};U.mod=U.modulo;U.rem=U.modulo;U.not=function(){return Re(~this.low,~this.high,this.unsigned)};U.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};U.clz=U.countLeadingZeros;U.countTrailingZeros=function(){return this.low?VC(this.low):VC(this.high)+32};U.ctz=U.countTrailingZeros;U.and=function(t){return Ft(t)||(t=Yn(t)),Re(this.low&t.low,this.high&t.high,this.unsigned)};U.or=function(t){return Ft(t)||(t=Yn(t)),Re(this.low|t.low,this.high|t.high,this.unsigned)};U.xor=function(t){return Ft(t)||(t=Yn(t)),Re(this.low^t.low,this.high^t.high,this.unsigned)};U.shiftLeft=function(t){return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Re(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Re(0,this.low<<t-32,this.unsigned)};U.shl=U.shiftLeft;U.shiftRight=function(t){return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Re(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Re(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};U.shr=U.shiftRight;U.shiftRightUnsigned=function(t){return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Re(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Re(this.high,0,this.unsigned):Re(this.high>>>t-32,0,this.unsigned)};U.shru=U.shiftRightUnsigned;U.shr_u=U.shiftRightUnsigned;U.rotateLeft=function(t){var n;return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Re(this.high,this.low,this.unsigned):t<32?(n=32-t,Re(this.low<<t|this.high>>>n,this.high<<t|this.low>>>n,this.unsigned)):(t-=32,n=32-t,Re(this.high<<t|this.low>>>n,this.low<<t|this.high>>>n,this.unsigned))};U.rotl=U.rotateLeft;U.rotateRight=function(t){var n;return Ft(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Re(this.high,this.low,this.unsigned):t<32?(n=32-t,Re(this.high<<n|this.low>>>t,this.low<<n|this.high>>>t,this.unsigned)):(t-=32,n=32-t,Re(this.low<<n|this.high>>>t,this.high<<n|this.low>>>t,this.unsigned))};U.rotr=U.rotateRight;U.toSigned=function(){return this.unsigned?Re(this.low,this.high,!1):this};U.toUnsigned=function(){return this.unsigned?this:Re(this.low,this.high,!0)};U.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};U.toBytesLE=function(){var t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};U.toBytesBE=function(){var t=this.high,n=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};Je.fromBytes=function(t,n,r){return r?Je.fromBytesLE(t,n):Je.fromBytesBE(t,n)};Je.fromBytesLE=function(t,n){return new Je(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)};Je.fromBytesBE=function(t,n){return new Je(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)};var Kr=Je;var g=Vn(Ds(),1);var cd=Vn(Ds(),1);function G0(){return{}}var mu={encode(e,t=cd.default.Writer.create()){return t},decode(e,t){let n=e instanceof cd.default.Reader?e:cd.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=G0();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return mu.fromPartial(e??{})},fromPartial(e){return G0()}};var hn=Vn(Ds(),1),Ia;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ia||(Ia={}));function kQ(e){switch(e){case 0:case"NULL_VALUE":return Ia.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Ia.UNRECOGNIZED}}function BQ(e){switch(e){case Ia.NULL_VALUE:return"NULL_VALUE";case Ia.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function p_(){return{fields:{}}}var B={encode(e,t=hn.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{r!==void 0&&m_.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=p_();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=m_.decode(n,n.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:H0(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=r,t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=i}))}return t},create(e){return B.fromPartial(e??{})},fromPartial(e){let t=p_();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=i),n),{}),t},wrap(e){let t=p_();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function W0(){return{key:"",value:void 0}}var m_={encode(e,t=hn.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&jr.encode(jr.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=W0();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=jr.unwrap(jr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:Ms(e.key)?globalThis.String(e.key):"",value:Ms(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 m_.fromPartial(e??{})},fromPartial(e){let t=W0();return t.key=e.key??"",t.value=e.value??void 0,t}};function f_(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var jr={encode(e,t=hn.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&&B.encode(B.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Tr.encode(Tr.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=f_();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==17)break;i.numberValue=n.double();continue;case 3:if(a!==26)break;i.stringValue=n.string();continue;case 4:if(a!==32)break;i.boolValue=n.bool();continue;case 5:if(a!==42)break;i.structValue=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.listValue=Tr.unwrap(Tr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:Ms(e.nullValue)?kQ(e.nullValue):void 0,numberValue:Ms(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:Ms(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:Ms(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:H0(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=BQ(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 jr.fromPartial(e??{})},fromPartial(e){let t=f_();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=f_();if(e===null)t.nullValue=Ia.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 h_(){return{values:[]}}var Tr={encode(e,t=hn.default.Writer.create()){for(let n of e.values)jr.encode(jr.wrap(n),t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof hn.default.Reader?e:hn.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=h_();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(jr.unwrap(jr.decode(n,n.uint32())));continue}if((a&7)===4||a===0)break;n.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 Tr.fromPartial(e??{})},fromPartial(e){let t=h_();return t.values=e.values?.map(n=>n)||[],t},wrap(e){let t=h_();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function H0(e){return typeof e=="object"&&e!==null}function Ms(e){return e!=null}var Sa=Vn(Ds(),1);function Z0(){return{seconds:BigInt("0"),nanos:0}}var Fe={encode(e,t=Sa.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 n=e instanceof Sa.default.Reader?e:Sa.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Z0();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.seconds=OQ(n.int64());continue;case 2:if(a!==16)break;i.nanos=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{seconds:X0(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:X0(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 Fe.fromPartial(e??{})},fromPartial(e){let t=Z0();return t.seconds=e.seconds??BigInt("0"),t.nanos=e.nanos??0,t}};function OQ(e){return BigInt(e.toString())}Sa.default.util.Long!==Kr&&(Sa.default.util.Long=Kr,Sa.default.configure());function X0(e){return e!=null}var Be=Vn(Ds(),1);var Y0;(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"})(Y0||(Y0={}));var $0;(function(e){e[e.ORG_MEMBER=0]="ORG_MEMBER",e[e.ORG_ADMIN=1]="ORG_ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($0||($0={}));var K0;(function(e){e[e.AND=0]="AND",e[e.OR=1]="OR",e[e.THEN=2]="THEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(K0||(K0={}));var j0;(function(e){e[e.READ=0]="READ",e[e.WRITE=1]="WRITE",e[e.ADMIN=2]="ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(j0||(j0={}));var eI;(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.UNRECOGNIZED=-1]="UNRECOGNIZED"})(eI||(eI={}));var tI;(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"})(tI||(tI={}));var nI;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(nI||(nI={}));var rI;(function(e){e[e.SENTIO=0]="SENTIO",e[e.SUBGRAPH=1]="SUBGRAPH",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(rI||(rI={}));var iI;(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"})(iI||(iI={}));var aI;(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_COHORTS=13]="IN_COHORTS",e[e.NOT_IN_COHORTS=14]="NOT_IN_COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(aI||(aI={}));var sI;(function(e){e[e.EVENTS=0]="EVENTS",e[e.COHORTS=1]="COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(sI||(sI={}));var oI;(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"})(oI||(oI={}));var cI;(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"})(cI||(cI={}));var uI;(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"})(uI||(uI={}));var lI;(function(e){e[e.PROCESSOR=0]="PROCESSOR",e[e.UI=1]="UI",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(lI||(lI={}));var dI;(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"})(dI||(dI={}));var pI;(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.UNRECOGNIZED=-1]="UNRECOGNIZED"})(pI||(pI={}));var fI;(function(e){e[e.OnOrAfter=0]="OnOrAfter",e[e.On=1]="On",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(fI||(fI={}));var hI;(function(e){e[e.Disable=0]="Disable",e[e.FirstInTimeRange=1]="FirstInTimeRange",e[e.FirstInGlobal=2]="FirstInGlobal",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(hI||(hI={}));var mI;(function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(mI||(mI={}));var gI;(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.UNRECOGNIZED=-1]="UNRECOGNIZED"})(gI||(gI={}));var dt;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(dt||(dt={}));function PQ(e){switch(e){case 0:case"NULL_VALUE":return dt.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return dt.UNRECOGNIZED}}function DQ(e){switch(e){case dt.NULL_VALUE:return"NULL_VALUE";case dt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function _I(){return{symbol:void 0,address:void 0}}var Ti={encode(e,t=Be.default.Writer.create()){return e.symbol!==void 0&&t.uint32(10).string(e.symbol),e.address!==void 0&&Fs.encode(e.address,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_I();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.symbol=n.string();continue;case 2:if(a!==18)break;i.address=Fs.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{symbol:ot(e.symbol)?globalThis.String(e.symbol):void 0,address:ot(e.address)?Fs.fromJSON(e.address):void 0}},toJSON(e){let t={};return e.symbol!==void 0&&(t.symbol=e.symbol),e.address!==void 0&&(t.address=Fs.toJSON(e.address)),t},create(e){return Ti.fromPartial(e??{})},fromPartial(e){let t=_I();return t.symbol=e.symbol??void 0,t.address=e.address!==void 0&&e.address!==null?Fs.fromPartial(e.address):void 0,t}};function AI(){return{address:"",chain:""}}var Fs={encode(e,t=Be.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 n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=AI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.chain=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:ot(e.address)?globalThis.String(e.address):"",chain:ot(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 Fs.fromPartial(e??{})},fromPartial(e){let t=AI();return t.address=e.address??"",t.chain=e.chain??"",t}};function yI(){return{nullValue:void 0,intValue: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}}var Gt={encode(e,t=Be.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.intValue!==void 0&&t.uint32(16).int32(e.intValue),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&&Fe.encode(MQ(e.timestampValue),t.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&yt.encode(e.bigintValue,t.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&Ls.encode(e.bigdecimalValue,t.uint32(74).fork()).ldelim(),e.listValue!==void 0&&Tn.encode(e.listValue,t.uint32(82).fork()).ldelim(),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=yI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.nullValue=n.int32();continue;case 2:if(a!==16)break;i.intValue=n.int32();continue;case 3:if(a!==25)break;i.floatValue=n.double();continue;case 4:if(a!==34)break;i.bytesValue=n.bytes();continue;case 5:if(a!==40)break;i.boolValue=n.bool();continue;case 6:if(a!==50)break;i.stringValue=n.string();continue;case 7:if(a!==58)break;i.timestampValue=TI(Fe.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.bigintValue=yt.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.bigdecimalValue=Ls.decode(n,n.uint32());continue;case 10:if(a!==82)break;i.listValue=Tn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{nullValue:ot(e.nullValue)?PQ(e.nullValue):void 0,intValue:ot(e.intValue)?globalThis.Number(e.intValue):void 0,floatValue:ot(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:ot(e.bytesValue)?SI(e.bytesValue):void 0,boolValue:ot(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:ot(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:ot(e.timestampValue)?FQ(e.timestampValue):void 0,bigintValue:ot(e.bigintValue)?yt.fromJSON(e.bigintValue):void 0,bigdecimalValue:ot(e.bigdecimalValue)?Ls.fromJSON(e.bigdecimalValue):void 0,listValue:ot(e.listValue)?Tn.fromJSON(e.listValue):void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=DQ(e.nullValue)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.floatValue!==void 0&&(t.floatValue=e.floatValue),e.bytesValue!==void 0&&(t.bytesValue=xI(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=yt.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(t.bigdecimalValue=Ls.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(t.listValue=Tn.toJSON(e.listValue)),t},create(e){return Gt.fromPartial(e??{})},fromPartial(e){let t=yI();return t.nullValue=e.nullValue??void 0,t.intValue=e.intValue??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?yt.fromPartial(e.bigintValue):void 0,t.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?Ls.fromPartial(e.bigdecimalValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?Tn.fromPartial(e.listValue):void 0,t}};function vI(){return{fields:{}}}var At={encode(e,t=Be.default.Writer.create()){return Object.entries(e.fields).forEach(([n,r])=>{g_.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=vI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=g_.decode(n,n.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:LQ(e.fields)?Object.entries(e.fields).reduce((t,[n,r])=>(t[n]=Gt.fromJSON(r),t),{}):{}}},toJSON(e){let t={};if(e.fields){let n=Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([r,i])=>{t.fields[r]=Gt.toJSON(i)}))}return t},create(e){return At.fromPartial(e??{})},fromPartial(e){let t=vI();return t.fields=Object.entries(e.fields??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=Gt.fromPartial(i)),n),{}),t}};function wI(){return{key:"",value:void 0}}var g_={encode(e,t=Be.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Gt.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=wI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=Gt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:ot(e.key)?globalThis.String(e.key):"",value:ot(e.value)?Gt.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=Gt.toJSON(e.value)),t},create(e){return g_.fromPartial(e??{})},fromPartial(e){let t=wI();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?Gt.fromPartial(e.value):void 0,t}};function bI(){return{values:[]}}var Tn={encode(e,t=Be.default.Writer.create()){for(let n of e.values)Gt.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=bI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.values.push(Gt.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(t=>Gt.fromJSON(t)):[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values.map(n=>Gt.toJSON(n))),t},create(e){return Tn.fromPartial(e??{})},fromPartial(e){let t=bI();return t.values=e.values?.map(n=>Gt.fromPartial(n))||[],t}};function EI(){return{entities:[]}}var Ni={encode(e,t=Be.default.Writer.create()){for(let n of e.entities)At.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=EI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(At.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>At.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(n=>At.toJSON(n))),t},create(e){return Ni.fromPartial(e??{})},fromPartial(e){let t=EI();return t.entities=e.entities?.map(n=>At.fromPartial(n))||[],t}};function CI(){return{value:void 0,exp:0}}var Ls={encode(e,t=Be.default.Writer.create()){return e.value!==void 0&&yt.encode(e.value,t.uint32(10).fork()).ldelim(),e.exp!==0&&t.uint32(16).int32(e.exp),t},decode(e,t){let n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=CI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.value=yt.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.exp=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{value:ot(e.value)?yt.fromJSON(e.value):void 0,exp:ot(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=yt.toJSON(e.value)),e.exp!==0&&(t.exp=Math.round(e.exp)),t},create(e){return Ls.fromPartial(e??{})},fromPartial(e){let t=CI();return t.value=e.value!==void 0&&e.value!==null?yt.fromPartial(e.value):void 0,t.exp=e.exp??0,t}};function II(){return{negative:!1,data:new Uint8Array(0)}}var yt={encode(e,t=Be.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 n=e instanceof Be.default.Reader?e:Be.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=II();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.negative=n.bool();continue;case 2:if(a!==18)break;i.data=n.bytes();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{negative:ot(e.negative)?globalThis.Boolean(e.negative):!1,data:ot(e.data)?SI(e.data):new Uint8Array(0)}},toJSON(e){let t={};return e.negative!==!1&&(t.negative=e.negative),e.data.length!==0&&(t.data=xI(e.data)),t},create(e){return yt.fromPartial(e??{})},fromPartial(e){let t=II();return t.negative=e.negative??!1,t.data=e.data??new Uint8Array(0),t}};function SI(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let t=globalThis.atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}}function xI(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let t=[];return e.forEach(n=>{t.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(t.join(""))}}function MQ(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function TI(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function FQ(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):TI(Fe.fromJSON(e))}Be.default.util.Long!==Kr&&(Be.default.util.Long=Kr,Be.default.configure());function LQ(e){return typeof e=="object"&&e!==null}function ot(e){return e!=null}var bt;(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"})(bt||(bt={}));function QQ(e){switch(e){case 0:case"UNKNOWN_TYPE":return bt.UNKNOWN_TYPE;case 1:case"COUNTER":return bt.COUNTER;case 2:case"GAUGE":return bt.GAUGE;case 3:case"HISTOGRAM":return bt.HISTOGRAM;case-1:case"UNRECOGNIZED":default:return bt.UNRECOGNIZED}}function UQ(e){switch(e){case bt.UNKNOWN_TYPE:return"UNKNOWN_TYPE";case bt.COUNTER:return"COUNTER";case bt.GAUGE:return"GAUGE";case bt.HISTOGRAM:return"HISTOGRAM";case bt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var pt;(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"})(pt||(pt={}));function qQ(e){switch(e){case 0:case"COUNT":return pt.COUNT;case 1:case"SUM":return pt.SUM;case 2:case"AVG":return pt.AVG;case 3:case"MIN":return pt.MIN;case 4:case"MAX":return pt.MAX;case 5:case"LAST":return pt.LAST;case-1:case"UNRECOGNIZED":default:return pt.UNRECOGNIZED}}function JQ(e){switch(e){case pt.COUNT:return"COUNT";case pt.SUM:return"SUM";case pt.AVG:return"AVG";case pt.MIN:return"MIN";case pt.MAX:return"MAX";case pt.LAST:return"LAST";case pt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var Rr;(function(e){e[e.ADDRESS=0]="ADDRESS",e[e.OBJECT=1]="OBJECT",e[e.WRAPPED_OBJECT=2]="WRAPPED_OBJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Rr||(Rr={}));function zQ(e){switch(e){case 0:case"ADDRESS":return Rr.ADDRESS;case 1:case"OBJECT":return Rr.OBJECT;case 2:case"WRAPPED_OBJECT":return Rr.WRAPPED_OBJECT;case-1:case"UNRECOGNIZED":default:return Rr.UNRECOGNIZED}}function VQ(e){switch(e){case Rr.ADDRESS:return"ADDRESS";case Rr.OBJECT:return"OBJECT";case Rr.WRAPPED_OBJECT:return"WRAPPED_OBJECT";case Rr.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var kr;(function(e){e[e.ERC20=0]="ERC20",e[e.ERC721=1]="ERC721",e[e.ERC1155=2]="ERC1155",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(kr||(kr={}));function GQ(e){switch(e){case 0:case"ERC20":return kr.ERC20;case 1:case"ERC721":return kr.ERC721;case 2:case"ERC1155":return kr.ERC1155;case-1:case"UNRECOGNIZED":default:return kr.UNRECOGNIZED}}function WQ(e){switch(e){case kr.ERC20:return"ERC20";case kr.ERC721:return"ERC721";case kr.ERC1155:return"ERC1155";case kr.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var ge;(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.COSMOS_CALL=14]="COSMOS_CALL",e[e.STARKNET_EVENT=15]="STARKNET_EVENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ge||(ge={}));function _x(e){switch(e){case 0:case"UNKNOWN":return ge.UNKNOWN;case 1:case"ETH_LOG":return ge.ETH_LOG;case 2:case"ETH_BLOCK":return ge.ETH_BLOCK;case 5:case"ETH_TRACE":return ge.ETH_TRACE;case 11:case"ETH_TRANSACTION":return ge.ETH_TRANSACTION;case 4:case"SOL_INSTRUCTION":return ge.SOL_INSTRUCTION;case 6:case"APT_EVENT":return ge.APT_EVENT;case 7:case"APT_CALL":return ge.APT_CALL;case 8:case"APT_RESOURCE":return ge.APT_RESOURCE;case 3:case"SUI_EVENT":return ge.SUI_EVENT;case 9:case"SUI_CALL":return ge.SUI_CALL;case 10:case"SUI_OBJECT":return ge.SUI_OBJECT;case 12:case"SUI_OBJECT_CHANGE":return ge.SUI_OBJECT_CHANGE;case 13:case"FUEL_CALL":return ge.FUEL_CALL;case 14:case"COSMOS_CALL":return ge.COSMOS_CALL;case 15:case"STARKNET_EVENT":return ge.STARKNET_EVENT;case-1:case"UNRECOGNIZED":default:return ge.UNRECOGNIZED}}function Ax(e){switch(e){case ge.UNKNOWN:return"UNKNOWN";case ge.ETH_LOG:return"ETH_LOG";case ge.ETH_BLOCK:return"ETH_BLOCK";case ge.ETH_TRACE:return"ETH_TRACE";case ge.ETH_TRANSACTION:return"ETH_TRANSACTION";case ge.SOL_INSTRUCTION:return"SOL_INSTRUCTION";case ge.APT_EVENT:return"APT_EVENT";case ge.APT_CALL:return"APT_CALL";case ge.APT_RESOURCE:return"APT_RESOURCE";case ge.SUI_EVENT:return"SUI_EVENT";case ge.SUI_CALL:return"SUI_CALL";case ge.SUI_OBJECT:return"SUI_OBJECT";case ge.SUI_OBJECT_CHANGE:return"SUI_OBJECT_CHANGE";case ge.FUEL_CALL:return"FUEL_CALL";case ge.COSMOS_CALL:return"COSMOS_CALL";case ge.STARKNET_EVENT:return"STARKNET_EVENT";case ge.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var wt;(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"})(wt||(wt={}));function HQ(e){switch(e){case 0:case"DEBUG":return wt.DEBUG;case 1:case"INFO":return wt.INFO;case 2:case"WARNING":return wt.WARNING;case 3:case"ERROR":return wt.ERROR;case 4:case"CRITICAL":return wt.CRITICAL;case-1:case"UNRECOGNIZED":default:return wt.UNRECOGNIZED}}function ZQ(e){switch(e){case wt.DEBUG:return"DEBUG";case wt.INFO:return"INFO";case wt.WARNING:return"WARNING";case wt.ERROR:return"ERROR";case wt.CRITICAL:return"CRITICAL";case wt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var ki;(function(e){e[e.AVG=0]="AVG",e[e.MEDIAN=1]="MEDIAN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ki||(ki={}));function bte(e){switch(e){case 0:case"AVG":return ki.AVG;case 1:case"MEDIAN":return ki.MEDIAN;case-1:case"UNRECOGNIZED":default:return ki.UNRECOGNIZED}}function Ete(e){switch(e){case ki.AVG:return"AVG";case ki.MEDIAN:return"MEDIAN";case ki.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var vt;(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"})(vt||(vt={}));function XQ(e){switch(e){case 0:case"STRING":return vt.STRING;case 1:case"DOUBLE":return vt.DOUBLE;case 2:case"BOOL":return vt.BOOL;case 3:case"TIMESTAMP":return vt.TIMESTAMP;case 4:case"BIG_INTEGER":return vt.BIG_INTEGER;case 5:case"BIG_DECIMAL":return vt.BIG_DECIMAL;case-1:case"UNRECOGNIZED":default:return vt.UNRECOGNIZED}}function YQ(e){switch(e){case vt.STRING:return"STRING";case vt.DOUBLE:return"DOUBLE";case vt.BOOL:return"BOOL";case vt.TIMESTAMP:return"TIMESTAMP";case vt.BIG_INTEGER:return"BIG_INTEGER";case vt.BIG_DECIMAL:return"BIG_DECIMAL";case vt.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var de;(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"})(de||(de={}));function $Q(e){switch(e){case 0:case"EQ":return de.EQ;case 1:case"NE":return de.NE;case 2:case"GT":return de.GT;case 3:case"GE":return de.GE;case 4:case"LT":return de.LT;case 5:case"LE":return de.LE;case 6:case"IN":return de.IN;case 7:case"NOT_IN":return de.NOT_IN;case 8:case"LIKE":return de.LIKE;case 9:case"NOT_LIKE":return de.NOT_LIKE;case 10:case"HAS_ALL":return de.HAS_ALL;case 11:case"HAS_ANY":return de.HAS_ANY;case-1:case"UNRECOGNIZED":default:return de.UNRECOGNIZED}}function KQ(e){switch(e){case de.EQ:return"EQ";case de.NE:return"NE";case de.GT:return"GT";case de.GE:return"GE";case de.LT:return"LT";case de.LE:return"LE";case de.IN:return"IN";case de.NOT_IN:return"NOT_IN";case de.LIKE:return"LIKE";case de.NOT_LIKE:return"NOT_LIKE";case de.HAS_ALL:return"HAS_ALL";case de.HAS_ANY:return"HAS_ANY";case de.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function NI(){return{name:"",version:""}}var Qs={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=NI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.version=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",version:E(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 Qs.fromPartial(e??{})},fromPartial(e){let t=NI();return t.name=e.name??"",t.version=e.version??"",t}};function RI(){return{sequential:!1,forceExactBlockTime:!1,processBindingTimeout:0}}var Us={encode(e,t=g.default.Writer.create()){return e.sequential!==!1&&t.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&t.uint32(16).bool(e.forceExactBlockTime),e.processBindingTimeout!==0&&t.uint32(24).int32(e.processBindingTimeout),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=RI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.sequential=n.bool();continue;case 2:if(a!==16)break;i.forceExactBlockTime=n.bool();continue;case 3:if(a!==24)break;i.processBindingTimeout=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{sequential:E(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:E(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,processBindingTimeout:E(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0}},toJSON(e){let t={};return e.sequential!==!1&&(t.sequential=e.sequential),e.forceExactBlockTime!==!1&&(t.forceExactBlockTime=e.forceExactBlockTime),e.processBindingTimeout!==0&&(t.processBindingTimeout=Math.round(e.processBindingTimeout)),t},create(e){return Us.fromPartial(e??{})},fromPartial(e){let t=RI();return t.sequential=e.sequential??!1,t.forceExactBlockTime=e.forceExactBlockTime??!1,t.processBindingTimeout=e.processBindingTimeout??0,t}};function kI(){return{}}var yx={encode(e,t=g.default.Writer.create()){return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=kI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return yx.fromPartial(e??{})},fromPartial(e){return kI()}};function BI(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],eventTrackingConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}var vx={encode(e,t=g.default.Writer.create()){e.config!==void 0&&Qs.encode(e.config,t.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&Us.encode(e.executionConfig,t.uint32(74).fork()).ldelim();for(let n of e.contractConfigs)qs.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.templateInstances)rr.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.accountConfigs)Zs.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.metricConfigs)Nr.encode(n,t.uint32(42).fork()).ldelim();for(let n of e.eventTrackingConfigs)Gs.encode(n,t.uint32(50).fork()).ldelim();for(let n of e.exportConfigs)Ws.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.eventLogConfigs)ei.encode(n,t.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&Js.encode(e.dbSchema,t.uint32(82).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=BI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.config=Qs.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.executionConfig=Us.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.contractConfigs.push(qs.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.templateInstances.push(rr.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.accountConfigs.push(Zs.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.metricConfigs.push(Nr.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.eventTrackingConfigs.push(Gs.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.exportConfigs.push(Ws.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.eventLogConfigs.push(ei.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.dbSchema=Js.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{config:E(e.config)?Qs.fromJSON(e.config):void 0,executionConfig:E(e.executionConfig)?Us.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(t=>qs.fromJSON(t)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>rr.fromJSON(t)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(t=>Zs.fromJSON(t)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(t=>Nr.fromJSON(t)):[],eventTrackingConfigs:globalThis.Array.isArray(e?.eventTrackingConfigs)?e.eventTrackingConfigs.map(t=>Gs.fromJSON(t)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(t=>Ws.fromJSON(t)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(t=>ei.fromJSON(t)):[],dbSchema:E(e.dbSchema)?Js.fromJSON(e.dbSchema):void 0}},toJSON(e){let t={};return e.config!==void 0&&(t.config=Qs.toJSON(e.config)),e.executionConfig!==void 0&&(t.executionConfig=Us.toJSON(e.executionConfig)),e.contractConfigs?.length&&(t.contractConfigs=e.contractConfigs.map(n=>qs.toJSON(n))),e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(n=>rr.toJSON(n))),e.accountConfigs?.length&&(t.accountConfigs=e.accountConfigs.map(n=>Zs.toJSON(n))),e.metricConfigs?.length&&(t.metricConfigs=e.metricConfigs.map(n=>Nr.toJSON(n))),e.eventTrackingConfigs?.length&&(t.eventTrackingConfigs=e.eventTrackingConfigs.map(n=>Gs.toJSON(n))),e.exportConfigs?.length&&(t.exportConfigs=e.exportConfigs.map(n=>Ws.toJSON(n))),e.eventLogConfigs?.length&&(t.eventLogConfigs=e.eventLogConfigs.map(n=>ei.toJSON(n))),e.dbSchema!==void 0&&(t.dbSchema=Js.toJSON(e.dbSchema)),t},create(e){return vx.fromPartial(e??{})},fromPartial(e){let t=BI();return t.config=e.config!==void 0&&e.config!==null?Qs.fromPartial(e.config):void 0,t.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?Us.fromPartial(e.executionConfig):void 0,t.contractConfigs=e.contractConfigs?.map(n=>qs.fromPartial(n))||[],t.templateInstances=e.templateInstances?.map(n=>rr.fromPartial(n))||[],t.accountConfigs=e.accountConfigs?.map(n=>Zs.fromPartial(n))||[],t.metricConfigs=e.metricConfigs?.map(n=>Nr.fromPartial(n))||[],t.eventTrackingConfigs=e.eventTrackingConfigs?.map(n=>Gs.fromPartial(n))||[],t.exportConfigs=e.exportConfigs?.map(n=>Ws.fromPartial(n))||[],t.eventLogConfigs=e.eventLogConfigs?.map(n=>ei.fromPartial(n))||[],t.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?Js.fromPartial(e.dbSchema):void 0,t}};function OI(){return{contract:void 0,intervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelCallConfigs:[],assetConfigs:[],fuelLogConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}var qs={encode(e,t=g.default.Writer.create()){e.contract!==void 0&&nr.encode(e.contract,t.uint32(10).fork()).ldelim();for(let n of e.intervalConfigs)tt.encode(n,t.uint32(90).fork()).ldelim();for(let n of e.logConfigs)ir.encode(n,t.uint32(26).fork()).ldelim();for(let n of e.traceConfigs)Ys.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.transactionConfig)$s.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveEventConfigs)so.encode(n,t.uint32(74).fork()).ldelim();for(let n of e.moveCallConfigs)sr.encode(n,t.uint32(82).fork()).ldelim();for(let n of e.moveResourceChangeConfigs)co.encode(n,t.uint32(98).fork()).ldelim();for(let n of e.fuelCallConfigs)mo.encode(n,t.uint32(106).fork()).ldelim();for(let n of e.assetConfigs)Ks.encode(n,t.uint32(114).fork()).ldelim();for(let n of e.fuelLogConfigs)eo.encode(n,t.uint32(122).fork()).ldelim();for(let n of e.cosmosLogConfigs)to.encode(n,t.uint32(130).fork()).ldelim();for(let n of e.starknetEventConfigs)po.encode(n,t.uint32(138).fork()).ldelim();if(e.instructionConfig!==void 0&&ro.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=OI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=nr.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.intervalConfigs.push(tt.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.logConfigs.push(ir.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.traceConfigs.push(Ys.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.transactionConfig.push($s.decode(n,n.uint32()));continue;case 9:if(a!==74)break;i.moveEventConfigs.push(so.decode(n,n.uint32()));continue;case 10:if(a!==82)break;i.moveCallConfigs.push(sr.decode(n,n.uint32()));continue;case 12:if(a!==98)break;i.moveResourceChangeConfigs.push(co.decode(n,n.uint32()));continue;case 13:if(a!==106)break;i.fuelCallConfigs.push(mo.decode(n,n.uint32()));continue;case 14:if(a!==114)break;i.assetConfigs.push(Ks.decode(n,n.uint32()));continue;case 15:if(a!==122)break;i.fuelLogConfigs.push(eo.decode(n,n.uint32()));continue;case 16:if(a!==130)break;i.cosmosLogConfigs.push(to.decode(n,n.uint32()));continue;case 17:if(a!==138)break;i.starknetEventConfigs.push(po.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.instructionConfig=ro.decode(n,n.uint32());continue;case 4:if(a!==32)break;i.startBlock=Qt(n.uint64());continue;case 5:if(a!==40)break;i.endBlock=Qt(n.uint64());continue;case 8:if(a!==66)break;i.processorType=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:E(e.contract)?nr.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>tt.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>ir.fromJSON(t)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(t=>Ys.fromJSON(t)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(t=>$s.fromJSON(t)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(t=>so.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>sr.fromJSON(t)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(t=>co.fromJSON(t)):[],fuelCallConfigs:globalThis.Array.isArray(e?.fuelCallConfigs)?e.fuelCallConfigs.map(t=>mo.fromJSON(t)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(t=>Ks.fromJSON(t)):[],fuelLogConfigs:globalThis.Array.isArray(e?.fuelLogConfigs)?e.fuelLogConfigs.map(t=>eo.fromJSON(t)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(t=>to.fromJSON(t)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(t=>po.fromJSON(t)):[],instructionConfig:E(e.instructionConfig)?ro.fromJSON(e.instructionConfig):void 0,startBlock:E(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:E(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:E(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=nr.toJSON(e.contract)),e.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>tt.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>ir.toJSON(n))),e.traceConfigs?.length&&(t.traceConfigs=e.traceConfigs.map(n=>Ys.toJSON(n))),e.transactionConfig?.length&&(t.transactionConfig=e.transactionConfig.map(n=>$s.toJSON(n))),e.moveEventConfigs?.length&&(t.moveEventConfigs=e.moveEventConfigs.map(n=>so.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>sr.toJSON(n))),e.moveResourceChangeConfigs?.length&&(t.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(n=>co.toJSON(n))),e.fuelCallConfigs?.length&&(t.fuelCallConfigs=e.fuelCallConfigs.map(n=>mo.toJSON(n))),e.assetConfigs?.length&&(t.assetConfigs=e.assetConfigs.map(n=>Ks.toJSON(n))),e.fuelLogConfigs?.length&&(t.fuelLogConfigs=e.fuelLogConfigs.map(n=>eo.toJSON(n))),e.cosmosLogConfigs?.length&&(t.cosmosLogConfigs=e.cosmosLogConfigs.map(n=>to.toJSON(n))),e.starknetEventConfigs?.length&&(t.starknetEventConfigs=e.starknetEventConfigs.map(n=>po.toJSON(n))),e.instructionConfig!==void 0&&(t.instructionConfig=ro.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 qs.fromPartial(e??{})},fromPartial(e){let t=OI();return t.contract=e.contract!==void 0&&e.contract!==null?nr.fromPartial(e.contract):void 0,t.intervalConfigs=e.intervalConfigs?.map(n=>tt.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>ir.fromPartial(n))||[],t.traceConfigs=e.traceConfigs?.map(n=>Ys.fromPartial(n))||[],t.transactionConfig=e.transactionConfig?.map(n=>$s.fromPartial(n))||[],t.moveEventConfigs=e.moveEventConfigs?.map(n=>so.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>sr.fromPartial(n))||[],t.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(n=>co.fromPartial(n))||[],t.fuelCallConfigs=e.fuelCallConfigs?.map(n=>mo.fromPartial(n))||[],t.assetConfigs=e.assetConfigs?.map(n=>Ks.fromPartial(n))||[],t.fuelLogConfigs=e.fuelLogConfigs?.map(n=>eo.fromPartial(n))||[],t.cosmosLogConfigs=e.cosmosLogConfigs?.map(n=>to.fromPartial(n))||[],t.starknetEventConfigs=e.starknetEventConfigs?.map(n=>po.fromPartial(n))||[],t.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?ro.fromPartial(e.instructionConfig):void 0,t.startBlock=e.startBlock??BigInt("0"),t.endBlock=e.endBlock??BigInt("0"),t.processorType=e.processorType??"",t}};function PI(){return{gqlSchema:""}}var Js={encode(e,t=g.default.Writer.create()){return e.gqlSchema!==""&&t.uint32(10).string(e.gqlSchema),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=PI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gqlSchema=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gqlSchema:E(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let t={};return e.gqlSchema!==""&&(t.gqlSchema=e.gqlSchema),t},create(e){return Js.fromPartial(e??{})},fromPartial(e){let t=PI();return t.gqlSchema=e.gqlSchema??"",t}};function DI(){return{}}var zs={encode(e,t=g.default.Writer.create()){return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=DI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return zs.fromPartial(e??{})},fromPartial(e){return DI()}};function MI(){return{retentionEventName:"",days:0}}var Vs={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=MI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.retentionEventName=n.string();continue;case 3:if(a!==24)break;i.days=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{retentionEventName:E(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:E(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 Vs.fromPartial(e??{})},fromPartial(e){let t=MI();return t.retentionEventName=e.retentionEventName??"",t.days=e.days??0,t}};function FI(){return{eventName:"",totalByDay:!1,unique:!1,totalPerEntity:void 0,distinctAggregationByDays:[],retentionConfig:void 0}}var Gs={encode(e,t=g.default.Writer.create()){e.eventName!==""&&t.uint32(10).string(e.eventName),e.totalByDay!==!1&&t.uint32(16).bool(e.totalByDay),e.unique!==!1&&t.uint32(24).bool(e.unique),e.totalPerEntity!==void 0&&zs.encode(e.totalPerEntity,t.uint32(34).fork()).ldelim(),t.uint32(42).fork();for(let n of e.distinctAggregationByDays)t.int32(n);return t.ldelim(),e.retentionConfig!==void 0&&Vs.encode(e.retentionConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=FI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.eventName=n.string();continue;case 2:if(a!==16)break;i.totalByDay=n.bool();continue;case 3:if(a!==24)break;i.unique=n.bool();continue;case 4:if(a!==34)break;i.totalPerEntity=zs.decode(n,n.uint32());continue;case 5:if(a===40){i.distinctAggregationByDays.push(n.int32());continue}if(a===42){let s=n.uint32()+n.pos;for(;n.pos<s;)i.distinctAggregationByDays.push(n.int32());continue}break;case 6:if(a!==50)break;i.retentionConfig=Vs.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{eventName:E(e.eventName)?globalThis.String(e.eventName):"",totalByDay:E(e.totalByDay)?globalThis.Boolean(e.totalByDay):!1,unique:E(e.unique)?globalThis.Boolean(e.unique):!1,totalPerEntity:E(e.totalPerEntity)?zs.fromJSON(e.totalPerEntity):void 0,distinctAggregationByDays:globalThis.Array.isArray(e?.distinctAggregationByDays)?e.distinctAggregationByDays.map(t=>globalThis.Number(t)):[],retentionConfig:E(e.retentionConfig)?Vs.fromJSON(e.retentionConfig):void 0}},toJSON(e){let t={};return e.eventName!==""&&(t.eventName=e.eventName),e.totalByDay!==!1&&(t.totalByDay=e.totalByDay),e.unique!==!1&&(t.unique=e.unique),e.totalPerEntity!==void 0&&(t.totalPerEntity=zs.toJSON(e.totalPerEntity)),e.distinctAggregationByDays?.length&&(t.distinctAggregationByDays=e.distinctAggregationByDays.map(n=>Math.round(n))),e.retentionConfig!==void 0&&(t.retentionConfig=Vs.toJSON(e.retentionConfig)),t},create(e){return Gs.fromPartial(e??{})},fromPartial(e){let t=FI();return t.eventName=e.eventName??"",t.totalByDay=e.totalByDay??!1,t.unique=e.unique??!1,t.totalPerEntity=e.totalPerEntity!==void 0&&e.totalPerEntity!==null?zs.fromPartial(e.totalPerEntity):void 0,t.distinctAggregationByDays=e.distinctAggregationByDays?.map(n=>n)||[],t.retentionConfig=e.retentionConfig!==void 0&&e.retentionConfig!==null?Vs.fromPartial(e.retentionConfig):void 0,t}};function LI(){return{name:"",channel:""}}var Ws={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=LI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.channel=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",channel:E(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 Ws.fromPartial(e??{})},fromPartial(e){let t=LI();return t.name=e.name??"",t.channel=e.channel??"",t}};function QI(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}var Nr={encode(e,t=g.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&&Hs.encode(e.aggregationConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 3:if(a!==26)break;i.description=n.string();continue;case 2:if(a!==18)break;i.unit=n.string();continue;case 4:if(a!==32)break;i.sparse=n.bool();continue;case 5:if(a!==40)break;i.persistentBetweenVersion=n.bool();continue;case 7:if(a!==56)break;i.type=n.int32();continue;case 6:if(a!==50)break;i.aggregationConfig=Hs.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",description:E(e.description)?globalThis.String(e.description):"",unit:E(e.unit)?globalThis.String(e.unit):"",sparse:E(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:E(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:E(e.type)?QQ(e.type):0,aggregationConfig:E(e.aggregationConfig)?Hs.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=UQ(e.type)),e.aggregationConfig!==void 0&&(t.aggregationConfig=Hs.toJSON(e.aggregationConfig)),t},create(e){return Nr.fromPartial(e??{})},fromPartial(e){let t=QI();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?Hs.fromPartial(e.aggregationConfig):void 0,t}};function UI(){return{name:"",fields:[]}}var ei={encode(e,t=g.default.Writer.create()){e.name!==""&&t.uint32(10).string(e.name);for(let n of e.fields)tr.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=UI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.fields.push(tr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>tr.fromJSON(t)):[]}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.fields?.length&&(t.fields=e.fields.map(n=>tr.toJSON(n))),t},create(e){return ei.fromPartial(e??{})},fromPartial(e){let t=UI();return t.name=e.name??"",t.fields=e.fields?.map(n=>tr.fromPartial(n))||[],t}};function qI(){return{fields:[]}}var Ri={encode(e,t=g.default.Writer.create()){for(let n of e.fields)tr.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.fields.push(tr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(t=>tr.fromJSON(t)):[]}},toJSON(e){let t={};return e.fields?.length&&(t.fields=e.fields.map(n=>tr.toJSON(n))),t},create(e){return Ri.fromPartial(e??{})},fromPartial(e){let t=qI();return t.fields=e.fields?.map(n=>tr.fromPartial(n))||[],t}};function JI(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}var tr={encode(e,t=g.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&&Ti.encode(e.coinType,t.uint32(26).fork()).ldelim(),e.structType!==void 0&&Ri.encode(e.structType,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=JI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==16)break;i.basicType=n.int32();continue;case 3:if(a!==26)break;i.coinType=Ti.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.structType=Ri.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",basicType:E(e.basicType)?XQ(e.basicType):void 0,coinType:E(e.coinType)?Ti.fromJSON(e.coinType):void 0,structType:E(e.structType)?Ri.fromJSON(e.structType):void 0}},toJSON(e){let t={};return e.name!==""&&(t.name=e.name),e.basicType!==void 0&&(t.basicType=YQ(e.basicType)),e.coinType!==void 0&&(t.coinType=Ti.toJSON(e.coinType)),e.structType!==void 0&&(t.structType=Ri.toJSON(e.structType)),t},create(e){return tr.fromPartial(e??{})},fromPartial(e){let t=JI();return t.name=e.name??"",t.basicType=e.basicType??void 0,t.coinType=e.coinType!==void 0&&e.coinType!==null?Ti.fromPartial(e.coinType):void 0,t.structType=e.structType!==void 0&&e.structType!==null?Ri.fromPartial(e.structType):void 0,t}};function zI(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}var Hs={encode(e,t=g.default.Writer.create()){t.uint32(10).fork();for(let n of e.intervalInMinutes)t.int32(n);t.ldelim(),t.uint32(18).fork();for(let n of e.types)t.int32(n);return t.ldelim(),e.discardOrigin!==!1&&t.uint32(24).bool(e.discardOrigin),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a===8){i.intervalInMinutes.push(n.int32());continue}if(a===10){let s=n.uint32()+n.pos;for(;n.pos<s;)i.intervalInMinutes.push(n.int32());continue}break;case 2:if(a===16){i.types.push(n.int32());continue}if(a===18){let s=n.uint32()+n.pos;for(;n.pos<s;)i.types.push(n.int32());continue}break;case 3:if(a!==24)break;i.discardOrigin=n.bool();continue}if((a&7)===4||a===0)break;n.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=>qQ(t)):[],discardOrigin:E(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let t={};return e.intervalInMinutes?.length&&(t.intervalInMinutes=e.intervalInMinutes.map(n=>Math.round(n))),e.types?.length&&(t.types=e.types.map(n=>JQ(n))),e.discardOrigin!==!1&&(t.discardOrigin=e.discardOrigin),t},create(e){return Hs.fromPartial(e??{})},fromPartial(e){let t=zI();return t.intervalInMinutes=e.intervalInMinutes?.map(n=>n)||[],t.types=e.types?.map(n=>n)||[],t.discardOrigin=e.discardOrigin??!1,t}};function VI(){return{chainId:"",address:"",startBlock:BigInt("0"),intervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],logConfigs:[]}}var Zs={encode(e,t=g.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())}for(let n of e.intervalConfigs)tt.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.moveIntervalConfigs)Xs.encode(n,t.uint32(58).fork()).ldelim();for(let n of e.moveCallConfigs)sr.encode(n,t.uint32(66).fork()).ldelim();for(let n of e.logConfigs)ir.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=VI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=n.string();continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.startBlock=Qt(n.uint64());continue;case 4:if(a!==34)break;i.intervalConfigs.push(tt.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.moveIntervalConfigs.push(Xs.decode(n,n.uint32()));continue;case 8:if(a!==66)break;i.moveCallConfigs.push(sr.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.logConfigs.push(ir.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{chainId:E(e.chainId)?globalThis.String(e.chainId):"",address:E(e.address)?globalThis.String(e.address):"",startBlock:E(e.startBlock)?BigInt(e.startBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(t=>tt.fromJSON(t)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(t=>Xs.fromJSON(t)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(t=>sr.fromJSON(t)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(t=>ir.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.intervalConfigs?.length&&(t.intervalConfigs=e.intervalConfigs.map(n=>tt.toJSON(n))),e.moveIntervalConfigs?.length&&(t.moveIntervalConfigs=e.moveIntervalConfigs.map(n=>Xs.toJSON(n))),e.moveCallConfigs?.length&&(t.moveCallConfigs=e.moveCallConfigs.map(n=>sr.toJSON(n))),e.logConfigs?.length&&(t.logConfigs=e.logConfigs.map(n=>ir.toJSON(n))),t},create(e){return Zs.fromPartial(e??{})},fromPartial(e){let t=VI();return t.chainId=e.chainId??"",t.address=e.address??"",t.startBlock=e.startBlock??BigInt("0"),t.intervalConfigs=e.intervalConfigs?.map(n=>tt.fromPartial(n))||[],t.moveIntervalConfigs=e.moveIntervalConfigs?.map(n=>Xs.fromPartial(n))||[],t.moveCallConfigs=e.moveCallConfigs?.map(n=>sr.fromPartial(n))||[],t.logConfigs=e.logConfigs?.map(n=>ir.fromPartial(n))||[],t}};function GI(){return{recentInterval:0,backfillInterval:0}}var er={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.recentInterval=n.int32();continue;case 2:if(a!==16)break;i.backfillInterval=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{recentInterval:E(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:E(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 er.fromPartial(e??{})},fromPartial(e){let t=GI();return t.recentInterval=e.recentInterval??0,t.backfillInterval=e.backfillInterval??0,t}};function WI(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0}}var tt={encode(e,t=g.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&&er.encode(e.minutesInterval,t.uint32(34).fork()).ldelim(),e.slot!==0&&t.uint32(24).int32(e.slot),e.slotInterval!==void 0&&er.encode(e.slotInterval,t.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&nt.encode(e.fetchConfig,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 2:if(a!==16)break;i.minutes=n.int32();continue;case 4:if(a!==34)break;i.minutesInterval=er.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.slot=n.int32();continue;case 5:if(a!==42)break;i.slotInterval=er.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:E(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:E(e.minutesInterval)?er.fromJSON(e.minutesInterval):void 0,slot:E(e.slot)?globalThis.Number(e.slot):0,slotInterval:E(e.slotInterval)?er.fromJSON(e.slotInterval):void 0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},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=er.toJSON(e.minutesInterval)),e.slot!==0&&(t.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(t.slotInterval=er.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(t.fetchConfig=nt.toJSON(e.fetchConfig)),t},create(e){return tt.fromPartial(e??{})},fromPartial(e){let t=WI();return t.handlerId=e.handlerId??0,t.minutes=e.minutes??0,t.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?er.fromPartial(e.minutesInterval):void 0,t.slot=e.slot??0,t.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?er.fromPartial(e.slotInterval):void 0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function HI(){return{intervalConfig:void 0,type:""}}var jQ={encode(e,t=g.default.Writer.create()){return e.intervalConfig!==void 0&&tt.encode(e.intervalConfig,t.uint32(10).fork()).ldelim(),e.type!==""&&t.uint32(18).string(e.type),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=HI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=tt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.type=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:E(e.intervalConfig)?tt.fromJSON(e.intervalConfig):void 0,type:E(e.type)?globalThis.String(e.type):""}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=tt.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),t},create(e){return jQ.fromPartial(e??{})},fromPartial(e){let t=HI();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?tt.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t}};function ZI(){return{intervalConfig:void 0,type:"",ownerType:0,fetchConfig:void 0}}var Xs={encode(e,t=g.default.Writer.create()){return e.intervalConfig!==void 0&&tt.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.fetchConfig!==void 0&&ao.encode(e.fetchConfig,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.intervalConfig=tt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.type=n.string();continue;case 3:if(a!==24)break;i.ownerType=n.int32();continue;case 4:if(a!==34)break;i.fetchConfig=ao.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{intervalConfig:E(e.intervalConfig)?tt.fromJSON(e.intervalConfig):void 0,type:E(e.type)?globalThis.String(e.type):"",ownerType:E(e.ownerType)?zQ(e.ownerType):0,fetchConfig:E(e.fetchConfig)?ao.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.intervalConfig!==void 0&&(t.intervalConfig=tt.toJSON(e.intervalConfig)),e.type!==""&&(t.type=e.type),e.ownerType!==0&&(t.ownerType=VQ(e.ownerType)),e.fetchConfig!==void 0&&(t.fetchConfig=ao.toJSON(e.fetchConfig)),t},create(e){return Xs.fromPartial(e??{})},fromPartial(e){let t=ZI();return t.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?tt.fromPartial(e.intervalConfig):void 0,t.type=e.type??"",t.ownerType=e.ownerType??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ao.fromPartial(e.fetchConfig):void 0,t}};function XI(){return{name:"",chainId:"",address:"",abi:""}}var nr={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.name=n.string();continue;case 2:if(a!==18)break;i.chainId=n.string();continue;case 3:if(a!==26)break;i.address=n.string();continue;case 4:if(a!==34)break;i.abi=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{name:E(e.name)?globalThis.String(e.name):"",chainId:E(e.chainId)?globalThis.String(e.chainId):"",address:E(e.address)?globalThis.String(e.address):"",abi:E(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 nr.fromPartial(e??{})},fromPartial(e){let t=XI();return t.name=e.name??"",t.chainId=e.chainId??"",t.address=e.address??"",t.abi=e.abi??"",t}};function YI(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}var rr={encode(e,t=g.default.Writer.create()){if(e.contract!==void 0&&nr.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&&B.encode(B.wrap(e.baseLabels),t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=YI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.contract=nr.decode(n,n.uint32());continue;case 2:if(a!==16)break;i.startBlock=Qt(n.uint64());continue;case 3:if(a!==24)break;i.endBlock=Qt(n.uint64());continue;case 4:if(a!==32)break;i.templateId=n.int32();continue;case 5:if(a!==42)break;i.baseLabels=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{contract:E(e.contract)?nr.fromJSON(e.contract):void 0,startBlock:E(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:E(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:E(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:Qe(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let t={};return e.contract!==void 0&&(t.contract=nr.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 rr.fromPartial(e??{})},fromPartial(e){let t=YI();return t.contract=e.contract!==void 0&&e.contract!==null?nr.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 $I(){return{templateInstances:[]}}var wx={encode(e,t=g.default.Writer.create()){for(let n of e.templateInstances)rr.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$I();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.templateInstances.push(rr.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(t=>rr.fromJSON(t)):[]}},toJSON(e){let t={};return e.templateInstances?.length&&(t.templateInstances=e.templateInstances.map(n=>rr.toJSON(n))),t},create(e){return wx.fromPartial(e??{})},fromPartial(e){let t=$I();return t.templateInstances=e.templateInstances?.map(n=>rr.fromPartial(n))||[],t}};function KI(){return{handlerId:0}}var eU={encode(e,t=g.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:E(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 eU.fromPartial(e??{})},fromPartial(e){let t=KI();return t.handlerId=e.handlerId??0,t}};function jI(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}var nt={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=jI();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.transaction=n.bool();continue;case 2:if(a!==16)break;i.transactionReceipt=n.bool();continue;case 5:if(a!==40)break;i.transactionReceiptLogs=n.bool();continue;case 3:if(a!==24)break;i.block=n.bool();continue;case 4:if(a!==32)break;i.trace=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:E(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:E(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:E(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:E(e.block)?globalThis.Boolean(e.block):!1,trace:E(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 nt.fromPartial(e??{})},fromPartial(e){let t=jI();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 eS(){return{signature:"",handlerId:0,fetchConfig:void 0}}var Ys={encode(e,t=g.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&&nt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=eS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.signature=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{signature:E(e.signature)?globalThis.String(e.signature):"",handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},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=nt.toJSON(e.fetchConfig)),t},create(e){return Ys.fromPartial(e??{})},fromPartial(e){let t=eS();return t.signature=e.signature??"",t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function tS(){return{handlerId:0,fetchConfig:void 0}}var $s={encode(e,t=g.default.Writer.create()){return e.handlerId!==0&&t.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&nt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=nt.toJSON(e.fetchConfig)),t},create(e){return $s.fromPartial(e??{})},fromPartial(e){let t=tS();return t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function nS(){return{filters:[],handlerId:0,fetchConfig:void 0}}var ir={encode(e,t=g.default.Writer.create()){for(let n of e.filters)no.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&nt.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(no.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=nt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>no.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?nt.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>no.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=nt.toJSON(e.fetchConfig)),t},create(e){return ir.fromPartial(e??{})},fromPartial(e){let t=nS();return t.filters=e.filters?.map(n=>no.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?nt.fromPartial(e.fetchConfig):void 0,t}};function rS(){return{filters:[],handlerId:0}}var Ks={encode(e,t=g.default.Writer.create()){for(let n of e.filters)js.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(js.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>js.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>js.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return Ks.fromPartial(e??{})},fromPartial(e){let t=rS();return t.filters=e.filters?.map(n=>js.fromPartial(n))||[],t.handlerId=e.handlerId??0,t}};function iS(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}var js={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=iS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.assetId=n.string();continue;case 2:if(a!==18)break;i.fromAddress=n.string();continue;case 3:if(a!==26)break;i.toAddress=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{assetId:E(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:E(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:E(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 js.fromPartial(e??{})},fromPartial(e){let t=iS();return t.assetId=e.assetId??void 0,t.fromAddress=e.fromAddress??void 0,t.toAddress=e.toAddress??void 0,t}};function aS(){return{logIds:[],handlerId:0}}var eo={encode(e,t=g.default.Writer.create()){for(let n of e.logIds)t.uint32(10).string(n);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=aS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logIds.push(n.string());continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(t=>globalThis.String(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.logIds?.length&&(t.logIds=e.logIds),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return eo.fromPartial(e??{})},fromPartial(e){let t=aS();return t.logIds=e.logIds?.map(n=>n)||[],t.handlerId=e.handlerId??0,t}};function sS(){return{logFilters:[],handlerId:0}}var to={encode(e,t=g.default.Writer.create()){for(let n of e.logFilters)t.uint32(10).string(n);return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.logFilters.push(n.string());continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(t=>globalThis.String(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.logFilters?.length&&(t.logFilters=e.logFilters),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return to.fromPartial(e??{})},fromPartial(e){let t=sS();return t.logFilters=e.logFilters?.map(n=>n)||[],t.handlerId=e.handlerId??0,t}};function oS(){return{topics:[],address:void 0,addressType:void 0}}var no={encode(e,t=g.default.Writer.create()){for(let n of e.topics)go.encode(n,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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=oS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.topics.push(go.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==24)break;i.addressType=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(t=>go.fromJSON(t)):[],address:E(e.address)?globalThis.String(e.address):void 0,addressType:E(e.addressType)?GQ(e.addressType):void 0}},toJSON(e){let t={};return e.topics?.length&&(t.topics=e.topics.map(n=>go.toJSON(n))),e.address!==void 0&&(t.address=e.address),e.addressType!==void 0&&(t.addressType=WQ(e.addressType)),t},create(e){return no.fromPartial(e??{})},fromPartial(e){let t=oS();return t.topics=e.topics?.map(n=>go.fromPartial(n))||[],t.address=e.address??void 0,t.addressType=e.addressType??void 0,t}};function cS(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}var ro={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.innerInstruction=n.bool();continue;case 2:if(a!==16)break;i.parsedInstruction=n.bool();continue;case 3:if(a!==24)break;i.rawDataInstruction=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{innerInstruction:E(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:E(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:E(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 ro.fromPartial(e??{})},fromPartial(e){let t=cS();return t.innerInstruction=e.innerInstruction??!1,t.parsedInstruction=e.parsedInstruction??!1,t.rawDataInstruction=e.rawDataInstruction??!1,t}};function uS(){return{moveTypePrefix:""}}var io={encode(e,t=g.default.Writer.create()){return e.moveTypePrefix!==""&&t.uint32(10).string(e.moveTypePrefix),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=uS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.moveTypePrefix=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{moveTypePrefix:E(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let t={};return e.moveTypePrefix!==""&&(t.moveTypePrefix=e.moveTypePrefix),t},create(e){return io.fromPartial(e??{})},fromPartial(e){let t=uS();return t.moveTypePrefix=e.moveTypePrefix??"",t}};function lS(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0}}var ar={encode(e,t=g.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&&io.encode(e.resourceConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=lS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.resourceChanges=n.bool();continue;case 2:if(a!==16)break;i.allEvents=n.bool();continue;case 4:if(a!==32)break;i.inputs=n.bool();continue;case 3:if(a!==26)break;i.resourceConfig=io.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{resourceChanges:E(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:E(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:E(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:E(e.resourceConfig)?io.fromJSON(e.resourceConfig):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=io.toJSON(e.resourceConfig)),t},create(e){return ar.fromPartial(e??{})},fromPartial(e){let t=lS();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?io.fromPartial(e.resourceConfig):void 0,t}};function dS(){return{owned:!1}}var ao={encode(e,t=g.default.Writer.create()){return e.owned!==!1&&t.uint32(8).bool(e.owned),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.owned=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{owned:E(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let t={};return e.owned!==!1&&(t.owned=e.owned),t},create(e){return ao.fromPartial(e??{})},fromPartial(e){let t=dS();return t.owned=e.owned??!1,t}};function pS(){return{filters:[],handlerId:0,fetchConfig:void 0}}var so={encode(e,t=g.default.Writer.create()){for(let n of e.filters)oo.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&ar.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=pS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(oo.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=ar.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>oo.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?ar.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>oo.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=ar.toJSON(e.fetchConfig)),t},create(e){return so.fromPartial(e??{})},fromPartial(e){let t=pS();return t.filters=e.filters?.map(n=>oo.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ar.fromPartial(e.fetchConfig):void 0,t}};function fS(){return{type:"",account:""}}var oo={encode(e,t=g.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.account!==""&&t.uint32(18).string(e.account),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==18)break;i.account=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:E(e.type)?globalThis.String(e.type):"",account:E(e.account)?globalThis.String(e.account):""}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.account!==""&&(t.account=e.account),t},create(e){return oo.fromPartial(e??{})},fromPartial(e){let t=fS();return t.type=e.type??"",t.account=e.account??"",t}};function hS(){return{filters:[],handlerId:0,fetchConfig:void 0}}var sr={encode(e,t=g.default.Writer.create()){for(let n of e.filters)uo.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&ar.encode(e.fetchConfig,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(uo.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue;case 3:if(a!==26)break;i.fetchConfig=ar.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>uo.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:E(e.fetchConfig)?ar.fromJSON(e.fetchConfig):void 0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>uo.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(t.fetchConfig=ar.toJSON(e.fetchConfig)),t},create(e){return sr.fromPartial(e??{})},fromPartial(e){let t=hS();return t.filters=e.filters?.map(n=>uo.fromPartial(n))||[],t.handlerId=e.handlerId??0,t.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ar.fromPartial(e.fetchConfig):void 0,t}};function mS(){return{type:"",handlerId:0}}var co={encode(e,t=g.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.type=n.string();continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{type:E(e.type)?globalThis.String(e.type):"",handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.type!==""&&(t.type=e.type),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return co.fromPartial(e??{})},fromPartial(e){let t=mS();return t.type=e.type??"",t.handlerId=e.handlerId??0,t}};function gS(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}var uo={encode(e,t=g.default.Writer.create()){e.function!==""&&t.uint32(10).string(e.function);for(let n of e.typeArguments)t.uint32(18).string(n);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&&lo.encode(e.fromAndToAddress,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=n.string();continue;case 2:if(a!==18)break;i.typeArguments.push(n.string());continue;case 3:if(a!==24)break;i.withTypeArguments=n.bool();continue;case 4:if(a!==32)break;i.includeFailed=n.bool();continue;case 5:if(a!==42)break;i.publicKeyPrefix=n.string();continue;case 6:if(a!==50)break;i.fromAndToAddress=lo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{function:E(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(t=>globalThis.String(t)):[],withTypeArguments:E(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:E(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:E(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:E(e.fromAndToAddress)?lo.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=lo.toJSON(e.fromAndToAddress)),t},create(e){return uo.fromPartial(e??{})},fromPartial(e){let t=gS();return t.function=e.function??"",t.typeArguments=e.typeArguments?.map(n=>n)||[],t.withTypeArguments=e.withTypeArguments??!1,t.includeFailed=e.includeFailed??!1,t.publicKeyPrefix=e.publicKeyPrefix??"",t.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?lo.fromPartial(e.fromAndToAddress):void 0,t}};function _S(){return{from:"",to:""}}var lo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_S();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.from=n.string();continue;case 2:if(a!==18)break;i.to=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:E(e.from)?globalThis.String(e.from):"",to:E(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 lo.fromPartial(e??{})},fromPartial(e){let t=_S();return t.from=e.from??"",t.to=e.to??"",t}};function AS(){return{filters:[],handlerId:0}}var po={encode(e,t=g.default.Writer.create()){for(let n of e.filters)fo.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=AS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(fo.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>fo.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>fo.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return po.fromPartial(e??{})},fromPartial(e){let t=AS();return t.filters=e.filters?.map(n=>fo.fromPartial(n))||[],t.handlerId=e.handlerId??0,t}};function yS(){return{address:"",keys:[]}}var fo={encode(e,t=g.default.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(let n of e.keys)t.uint32(18).string(n);return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=yS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 2:if(a!==18)break;i.keys.push(n.string());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:E(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 fo.fromPartial(e??{})},fromPartial(e){let t=yS();return t.address=e.address??"",t.keys=e.keys?.map(n=>n)||[],t}};function vS(){return{function:"",includeFailed:!1}}var ho={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=vS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.function=n.string();continue;case 2:if(a!==16)break;i.includeFailed=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{function:E(e.function)?globalThis.String(e.function):"",includeFailed:E(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 ho.fromPartial(e??{})},fromPartial(e){let t=vS();return t.function=e.function??"",t.includeFailed=e.includeFailed??!1,t}};function wS(){return{filters:[],handlerId:0}}var mo={encode(e,t=g.default.Writer.create()){for(let n of e.filters)ho.encode(n,t.uint32(10).fork()).ldelim();return e.handlerId!==0&&t.uint32(16).int32(e.handlerId),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=wS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.filters.push(ho.decode(n,n.uint32()));continue;case 2:if(a!==16)break;i.handlerId=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>ho.fromJSON(t)):[],handlerId:E(e.handlerId)?globalThis.Number(e.handlerId):0}},toJSON(e){let t={};return e.filters?.length&&(t.filters=e.filters.map(n=>ho.toJSON(n))),e.handlerId!==0&&(t.handlerId=Math.round(e.handlerId)),t},create(e){return mo.fromPartial(e??{})},fromPartial(e){let t=wS();return t.filters=e.filters?.map(n=>ho.fromPartial(n))||[],t.handlerId=e.handlerId??0,t}};function bS(){return{hashes:[]}}var go={encode(e,t=g.default.Writer.create()){for(let n of e.hashes)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=bS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.hashes.push(n.string());continue}if((a&7)===4||a===0)break;n.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 go.fromPartial(e??{})},fromPartial(e){let t=bS();return t.hashes=e.hashes?.map(n=>n)||[],t}};function ES(){return{bindings:[]}}var bx={encode(e,t=g.default.Writer.create()){for(let n of e.bindings)Lt.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ES();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(Lt.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>Lt.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(n=>Lt.toJSON(n))),t},create(e){return bx.fromPartial(e??{})},fromPartial(e){let t=ES();return t.bindings=e.bindings?.map(n=>Lt.fromPartial(n))||[],t}};function CS(){return{result:void 0}}var Ex={encode(e,t=g.default.Writer.create()){return e.result!==void 0&&mn.encode(e.result,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=CS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=mn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{result:E(e.result)?mn.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.result!==void 0&&(t.result=mn.toJSON(e.result)),t},create(e){return Ex.fromPartial(e??{})},fromPartial(e){let t=CS();return t.result=e.result!==void 0&&e.result!==null?mn.fromPartial(e.result):void 0,t}};function IS(){return{processId:0,binding:void 0,dbResult:void 0}}var Cx={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.binding!==void 0&&Lt.encode(e.binding,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&or.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=IS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.binding=Lt.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.dbResult=or.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,binding:E(e.binding)?Lt.fromJSON(e.binding):void 0,dbResult:E(e.dbResult)?or.fromJSON(e.dbResult):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.binding!==void 0&&(t.binding=Lt.toJSON(e.binding)),e.dbResult!==void 0&&(t.dbResult=or.toJSON(e.dbResult)),t},create(e){return Cx.fromPartial(e??{})},fromPartial(e){let t=IS();return t.processId=e.processId??0,t.binding=e.binding!==void 0&&e.binding!==null?Lt.fromPartial(e.binding):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?or.fromPartial(e.dbResult):void 0,t}};function SS(){return{processId:0,dbRequest:void 0,result:void 0}}var Ix={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&cr.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),e.result!==void 0&&mn.encode(e.result,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=SS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.dbRequest=cr.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.result=mn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,dbRequest:E(e.dbRequest)?cr.fromJSON(e.dbRequest):void 0,result:E(e.result)?mn.fromJSON(e.result):void 0}},toJSON(e){let t={};return e.processId!==0&&(t.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(t.dbRequest=cr.toJSON(e.dbRequest)),e.result!==void 0&&(t.result=mn.toJSON(e.result)),t},create(e){return Ix.fromPartial(e??{})},fromPartial(e){let t=SS();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?cr.fromPartial(e.dbRequest):void 0,t.result=e.result!==void 0&&e.result!==null?mn.fromPartial(e.result):void 0,t}};function xS(){return{processId:0,bindings:void 0,dbResult:void 0}}var Sx={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.bindings!==void 0&&_o.encode(e.bindings,t.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&or.encode(e.dbResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=xS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.bindings=_o.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.dbResult=or.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,bindings:E(e.bindings)?_o.fromJSON(e.bindings):void 0,dbResult:E(e.dbResult)?or.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=_o.toJSON(e.bindings)),e.dbResult!==void 0&&(t.dbResult=or.toJSON(e.dbResult)),t},create(e){return Sx.fromPartial(e??{})},fromPartial(e){let t=xS();return t.processId=e.processId??0,t.bindings=e.bindings!==void 0&&e.bindings!==null?_o.fromPartial(e.bindings):void 0,t.dbResult=e.dbResult!==void 0&&e.dbResult!==null?or.fromPartial(e.dbResult):void 0,t}};function TS(){return{bindings:[]}}var _o={encode(e,t=g.default.Writer.create()){for(let n of e.bindings)Lt.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=TS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bindings.push(Lt.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(t=>Lt.fromJSON(t)):[]}},toJSON(e){let t={};return e.bindings?.length&&(t.bindings=e.bindings.map(n=>Lt.toJSON(n))),t},create(e){return _o.fromPartial(e??{})},fromPartial(e){let t=TS();return t.bindings=e.bindings?.map(n=>Lt.fromPartial(n))||[],t}};function NS(){return{processId:0,dbRequest:void 0}}var xx={encode(e,t=g.default.Writer.create()){return e.processId!==0&&t.uint32(8).int32(e.processId),e.dbRequest!==void 0&&cr.encode(e.dbRequest,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=NS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.processId=n.int32();continue;case 2:if(a!==18)break;i.dbRequest=cr.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{processId:E(e.processId)?globalThis.Number(e.processId):0,dbRequest:E(e.dbRequest)?cr.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=cr.toJSON(e.dbRequest)),t},create(e){return xx.fromPartial(e??{})},fromPartial(e){let t=NS();return t.processId=e.processId??0,t.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?cr.fromPartial(e.dbRequest):void 0,t}};function RS(){return{opId:BigInt("0"),data:void 0,list:void 0,error:void 0,entities:void 0,entityList:void 0,nextCursor:void 0}}var or={encode(e,t=g.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&&B.encode(B.wrap(e.data),t.uint32(18).fork()).ldelim(),e.list!==void 0&&Tr.encode(Tr.wrap(e.list),t.uint32(34).fork()).ldelim(),e.error!==void 0&&t.uint32(26).string(e.error),e.entities!==void 0&&Ni.encode(e.entities,t.uint32(50).fork()).ldelim(),e.entityList!==void 0&&yo.encode(e.entityList,t.uint32(58).fork()).ldelim(),e.nextCursor!==void 0&&t.uint32(42).string(e.nextCursor),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=RS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Qt(n.uint64());continue;case 2:if(a!==18)break;i.data=B.unwrap(B.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.list=Tr.unwrap(Tr.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.error=n.string();continue;case 6:if(a!==50)break;i.entities=Ni.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.entityList=yo.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.nextCursor=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{opId:E(e.opId)?BigInt(e.opId):BigInt("0"),data:Qe(e.data)?e.data:void 0,list:globalThis.Array.isArray(e.list)?[...e.list]:void 0,error:E(e.error)?globalThis.String(e.error):void 0,entities:E(e.entities)?Ni.fromJSON(e.entities):void 0,entityList:E(e.entityList)?yo.fromJSON(e.entityList):void 0,nextCursor:E(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=Ni.toJSON(e.entities)),e.entityList!==void 0&&(t.entityList=yo.toJSON(e.entityList)),e.nextCursor!==void 0&&(t.nextCursor=e.nextCursor),t},create(e){return or.fromPartial(e??{})},fromPartial(e){let t=RS();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?Ni.fromPartial(e.entities):void 0,t.entityList=e.entityList!==void 0&&e.entityList!==null?yo.fromPartial(e.entityList):void 0,t.nextCursor=e.nextCursor??void 0,t}};function kS(){return{entity:"",genBlockNumber:BigInt("0"),genBlockChain:"",genBlockTime:void 0,data:void 0}}var Ao={encode(e,t=g.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&&Fe.encode(ur(e.genBlockTime),t.uint32(34).fork()).ldelim(),e.data!==void 0&&At.encode(e.data,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 2:if(a!==16)break;i.genBlockNumber=Qt(n.uint64());continue;case 3:if(a!==26)break;i.genBlockChain=n.string();continue;case 4:if(a!==34)break;i.genBlockTime=Nn(Fe.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.data=At.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:E(e.entity)?globalThis.String(e.entity):"",genBlockNumber:E(e.genBlockNumber)?BigInt(e.genBlockNumber):BigInt("0"),genBlockChain:E(e.genBlockChain)?globalThis.String(e.genBlockChain):"",genBlockTime:E(e.genBlockTime)?lr(e.genBlockTime):void 0,data:E(e.data)?At.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=At.toJSON(e.data)),t},create(e){return Ao.fromPartial(e??{})},fromPartial(e){let t=kS();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?At.fromPartial(e.data):void 0,t}};function BS(){return{entities:[]}}var yo={encode(e,t=g.default.Writer.create()){for(let n of e.entities)Ao.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=BS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entities.push(Ao.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(t=>Ao.fromJSON(t)):[]}},toJSON(e){let t={};return e.entities?.length&&(t.entities=e.entities.map(n=>Ao.toJSON(n))),t},create(e){return yo.fromPartial(e??{})},fromPartial(e){let t=BS();return t.entities=e.entities?.map(n=>Ao.fromPartial(n))||[],t}};function OS(){return{opId:BigInt("0"),get:void 0,upsert:void 0,delete:void 0,list:void 0}}var cr={encode(e,t=g.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&&vo.encode(e.get,t.uint32(18).fork()).ldelim(),e.upsert!==void 0&&bo.encode(e.upsert,t.uint32(26).fork()).ldelim(),e.delete!==void 0&&Eo.encode(e.delete,t.uint32(34).fork()).ldelim(),e.list!==void 0&&wo.encode(e.list,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=OS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.opId=Qt(n.uint64());continue;case 2:if(a!==18)break;i.get=vo.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.upsert=bo.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.delete=Eo.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.list=wo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{opId:E(e.opId)?BigInt(e.opId):BigInt("0"),get:E(e.get)?vo.fromJSON(e.get):void 0,upsert:E(e.upsert)?bo.fromJSON(e.upsert):void 0,delete:E(e.delete)?Eo.fromJSON(e.delete):void 0,list:E(e.list)?wo.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=vo.toJSON(e.get)),e.upsert!==void 0&&(t.upsert=bo.toJSON(e.upsert)),e.delete!==void 0&&(t.delete=Eo.toJSON(e.delete)),e.list!==void 0&&(t.list=wo.toJSON(e.list)),t},create(e){return cr.fromPartial(e??{})},fromPartial(e){let t=OS();return t.opId=e.opId??BigInt("0"),t.get=e.get!==void 0&&e.get!==null?vo.fromPartial(e.get):void 0,t.upsert=e.upsert!==void 0&&e.upsert!==null?bo.fromPartial(e.upsert):void 0,t.delete=e.delete!==void 0&&e.delete!==null?Eo.fromPartial(e.delete):void 0,t.list=e.list!==void 0&&e.list!==null?wo.fromPartial(e.list):void 0,t}};function PS(){return{entity:"",id:""}}var vo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=PS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 2:if(a!==18)break;i.id=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:E(e.entity)?globalThis.String(e.entity):"",id:E(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 vo.fromPartial(e??{})},fromPartial(e){let t=PS();return t.entity=e.entity??"",t.id=e.id??"",t}};function DS(){return{entity:"",filters:[],cursor:"",pageSize:void 0}}var wo={encode(e,t=g.default.Writer.create()){e.entity!==""&&t.uint32(10).string(e.entity);for(let n of e.filters)Co.encode(n,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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity=n.string();continue;case 4:if(a!==34)break;i.filters.push(Co.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.cursor=n.string();continue;case 6:if(a!==48)break;i.pageSize=n.uint32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{entity:E(e.entity)?globalThis.String(e.entity):"",filters:globalThis.Array.isArray(e?.filters)?e.filters.map(t=>Co.fromJSON(t)):[],cursor:E(e.cursor)?globalThis.String(e.cursor):"",pageSize:E(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(n=>Co.toJSON(n))),e.cursor!==""&&(t.cursor=e.cursor),e.pageSize!==void 0&&(t.pageSize=Math.round(e.pageSize)),t},create(e){return wo.fromPartial(e??{})},fromPartial(e){let t=DS();return t.entity=e.entity??"",t.filters=e.filters?.map(n=>Co.fromPartial(n))||[],t.cursor=e.cursor??"",t.pageSize=e.pageSize??void 0,t}};function MS(){return{entity:[],id:[],data:[],entityData:[]}}var bo={encode(e,t=g.default.Writer.create()){for(let n of e.entity)t.uint32(10).string(n);for(let n of e.id)t.uint32(18).string(n);for(let n of e.data)B.encode(B.wrap(n),t.uint32(26).fork()).ldelim();for(let n of e.entityData)At.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(n.string());continue;case 2:if(a!==18)break;i.id.push(n.string());continue;case 3:if(a!==26)break;i.data.push(B.unwrap(B.decode(n,n.uint32())));continue;case 4:if(a!==34)break;i.entityData.push(At.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.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=>At.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(n=>At.toJSON(n))),t},create(e){return bo.fromPartial(e??{})},fromPartial(e){let t=MS();return t.entity=e.entity?.map(n=>n)||[],t.id=e.id?.map(n=>n)||[],t.data=e.data?.map(n=>n)||[],t.entityData=e.entityData?.map(n=>At.fromPartial(n))||[],t}};function FS(){return{entity:[],id:[]}}var Eo={encode(e,t=g.default.Writer.create()){for(let n of e.entity)t.uint32(10).string(n);for(let n of e.id)t.uint32(18).string(n);return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.entity.push(n.string());continue;case 2:if(a!==18)break;i.id.push(n.string());continue}if((a&7)===4||a===0)break;n.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 Eo.fromPartial(e??{})},fromPartial(e){let t=FS();return t.entity=e.entity?.map(n=>n)||[],t.id=e.id?.map(n=>n)||[],t}};function LS(){return{field:"",op:0,value:void 0}}var Co={encode(e,t=g.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&&Tn.encode(e.value,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.field=n.string();continue;case 2:if(a!==16)break;i.op=n.int32();continue;case 3:if(a!==26)break;i.value=Tn.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{field:E(e.field)?globalThis.String(e.field):"",op:E(e.op)?$Q(e.op):0,value:E(e.value)?Tn.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.field!==""&&(t.field=e.field),e.op!==0&&(t.op=KQ(e.op)),e.value!==void 0&&(t.value=Tn.toJSON(e.value)),t},create(e){return Co.fromPartial(e??{})},fromPartial(e){let t=LS();return t.field=e.field??"",t.op=e.op??0,t.value=e.value!==void 0&&e.value!==null?Tn.fromPartial(e.value):void 0,t}};function QS(){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,fuelCall:void 0,cosmosCall:void 0,starknetEvents:void 0}}var Io={encode(e,t=g.default.Writer.create()){return e.ethLog!==void 0&&So.encode(e.ethLog,t.uint32(18).fork()).ldelim(),e.ethBlock!==void 0&&xo.encode(e.ethBlock,t.uint32(26).fork()).ldelim(),e.ethTransaction!==void 0&&To.encode(e.ethTransaction,t.uint32(34).fork()).ldelim(),e.ethTrace!==void 0&&No.encode(e.ethTrace,t.uint32(42).fork()).ldelim(),e.solInstruction!==void 0&&Ro.encode(e.solInstruction,t.uint32(50).fork()).ldelim(),e.aptEvent!==void 0&&ko.encode(e.aptEvent,t.uint32(58).fork()).ldelim(),e.aptCall!==void 0&&Bo.encode(e.aptCall,t.uint32(66).fork()).ldelim(),e.aptResource!==void 0&&Oo.encode(e.aptResource,t.uint32(74).fork()).ldelim(),e.suiEvent!==void 0&&Po.encode(e.suiEvent,t.uint32(82).fork()).ldelim(),e.suiCall!==void 0&&Do.encode(e.suiCall,t.uint32(90).fork()).ldelim(),e.suiObject!==void 0&&Mo.encode(e.suiObject,t.uint32(98).fork()).ldelim(),e.suiObjectChange!==void 0&&Fo.encode(e.suiObjectChange,t.uint32(106).fork()).ldelim(),e.fuelCall!==void 0&&Lo.encode(e.fuelCall,t.uint32(114).fork()).ldelim(),e.cosmosCall!==void 0&&Qo.encode(e.cosmosCall,t.uint32(122).fork()).ldelim(),e.starknetEvents!==void 0&&Uo.encode(e.starknetEvents,t.uint32(130).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=QS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.ethLog=So.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.ethBlock=xo.decode(n,n.uint32());continue;case 4:if(a!==34)break;i.ethTransaction=To.decode(n,n.uint32());continue;case 5:if(a!==42)break;i.ethTrace=No.decode(n,n.uint32());continue;case 6:if(a!==50)break;i.solInstruction=Ro.decode(n,n.uint32());continue;case 7:if(a!==58)break;i.aptEvent=ko.decode(n,n.uint32());continue;case 8:if(a!==66)break;i.aptCall=Bo.decode(n,n.uint32());continue;case 9:if(a!==74)break;i.aptResource=Oo.decode(n,n.uint32());continue;case 10:if(a!==82)break;i.suiEvent=Po.decode(n,n.uint32());continue;case 11:if(a!==90)break;i.suiCall=Do.decode(n,n.uint32());continue;case 12:if(a!==98)break;i.suiObject=Mo.decode(n,n.uint32());continue;case 13:if(a!==106)break;i.suiObjectChange=Fo.decode(n,n.uint32());continue;case 14:if(a!==114)break;i.fuelCall=Lo.decode(n,n.uint32());continue;case 15:if(a!==122)break;i.cosmosCall=Qo.decode(n,n.uint32());continue;case 16:if(a!==130)break;i.starknetEvents=Uo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethLog:E(e.ethLog)?So.fromJSON(e.ethLog):void 0,ethBlock:E(e.ethBlock)?xo.fromJSON(e.ethBlock):void 0,ethTransaction:E(e.ethTransaction)?To.fromJSON(e.ethTransaction):void 0,ethTrace:E(e.ethTrace)?No.fromJSON(e.ethTrace):void 0,solInstruction:E(e.solInstruction)?Ro.fromJSON(e.solInstruction):void 0,aptEvent:E(e.aptEvent)?ko.fromJSON(e.aptEvent):void 0,aptCall:E(e.aptCall)?Bo.fromJSON(e.aptCall):void 0,aptResource:E(e.aptResource)?Oo.fromJSON(e.aptResource):void 0,suiEvent:E(e.suiEvent)?Po.fromJSON(e.suiEvent):void 0,suiCall:E(e.suiCall)?Do.fromJSON(e.suiCall):void 0,suiObject:E(e.suiObject)?Mo.fromJSON(e.suiObject):void 0,suiObjectChange:E(e.suiObjectChange)?Fo.fromJSON(e.suiObjectChange):void 0,fuelCall:E(e.fuelCall)?Lo.fromJSON(e.fuelCall):void 0,cosmosCall:E(e.cosmosCall)?Qo.fromJSON(e.cosmosCall):void 0,starknetEvents:E(e.starknetEvents)?Uo.fromJSON(e.starknetEvents):void 0}},toJSON(e){let t={};return e.ethLog!==void 0&&(t.ethLog=So.toJSON(e.ethLog)),e.ethBlock!==void 0&&(t.ethBlock=xo.toJSON(e.ethBlock)),e.ethTransaction!==void 0&&(t.ethTransaction=To.toJSON(e.ethTransaction)),e.ethTrace!==void 0&&(t.ethTrace=No.toJSON(e.ethTrace)),e.solInstruction!==void 0&&(t.solInstruction=Ro.toJSON(e.solInstruction)),e.aptEvent!==void 0&&(t.aptEvent=ko.toJSON(e.aptEvent)),e.aptCall!==void 0&&(t.aptCall=Bo.toJSON(e.aptCall)),e.aptResource!==void 0&&(t.aptResource=Oo.toJSON(e.aptResource)),e.suiEvent!==void 0&&(t.suiEvent=Po.toJSON(e.suiEvent)),e.suiCall!==void 0&&(t.suiCall=Do.toJSON(e.suiCall)),e.suiObject!==void 0&&(t.suiObject=Mo.toJSON(e.suiObject)),e.suiObjectChange!==void 0&&(t.suiObjectChange=Fo.toJSON(e.suiObjectChange)),e.fuelCall!==void 0&&(t.fuelCall=Lo.toJSON(e.fuelCall)),e.cosmosCall!==void 0&&(t.cosmosCall=Qo.toJSON(e.cosmosCall)),e.starknetEvents!==void 0&&(t.starknetEvents=Uo.toJSON(e.starknetEvents)),t},create(e){return Io.fromPartial(e??{})},fromPartial(e){let t=QS();return t.ethLog=e.ethLog!==void 0&&e.ethLog!==null?So.fromPartial(e.ethLog):void 0,t.ethBlock=e.ethBlock!==void 0&&e.ethBlock!==null?xo.fromPartial(e.ethBlock):void 0,t.ethTransaction=e.ethTransaction!==void 0&&e.ethTransaction!==null?To.fromPartial(e.ethTransaction):void 0,t.ethTrace=e.ethTrace!==void 0&&e.ethTrace!==null?No.fromPartial(e.ethTrace):void 0,t.solInstruction=e.solInstruction!==void 0&&e.solInstruction!==null?Ro.fromPartial(e.solInstruction):void 0,t.aptEvent=e.aptEvent!==void 0&&e.aptEvent!==null?ko.fromPartial(e.aptEvent):void 0,t.aptCall=e.aptCall!==void 0&&e.aptCall!==null?Bo.fromPartial(e.aptCall):void 0,t.aptResource=e.aptResource!==void 0&&e.aptResource!==null?Oo.fromPartial(e.aptResource):void 0,t.suiEvent=e.suiEvent!==void 0&&e.suiEvent!==null?Po.fromPartial(e.suiEvent):void 0,t.suiCall=e.suiCall!==void 0&&e.suiCall!==null?Do.fromPartial(e.suiCall):void 0,t.suiObject=e.suiObject!==void 0&&e.suiObject!==null?Mo.fromPartial(e.suiObject):void 0,t.suiObjectChange=e.suiObjectChange!==void 0&&e.suiObjectChange!==null?Fo.fromPartial(e.suiObjectChange):void 0,t.fuelCall=e.fuelCall!==void 0&&e.fuelCall!==null?Lo.fromPartial(e.fuelCall):void 0,t.cosmosCall=e.cosmosCall!==void 0&&e.cosmosCall!==null?Qo.fromPartial(e.cosmosCall):void 0,t.starknetEvents=e.starknetEvents!==void 0&&e.starknetEvents!==null?Uo.fromPartial(e.starknetEvents):void 0,t}};function US(){return{log:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0}}var So={encode(e,t=g.default.Writer.create()){return e.log!==void 0&&B.encode(B.wrap(e.log),t.uint32(26).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(34).fork()).ldelim(),e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&B.encode(B.wrap(e.transactionReceipt),t.uint32(42).fork()).ldelim(),e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 3:if(a!==26)break;i.log=B.unwrap(B.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.transactionReceipt=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{log:Qe(e.log)?e.log:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,transaction:Qe(e.transaction)?e.transaction:void 0,transactionReceipt:Qe(e.transactionReceipt)?e.transactionReceipt:void 0,block:Qe(e.block)?e.block: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),t},create(e){return So.fromPartial(e??{})},fromPartial(e){let t=US();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}};function qS(){return{block:void 0}}var xo={encode(e,t=g.default.Writer.create()){return e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{block:Qe(e.block)?e.block:void 0}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),t},create(e){return xo.fromPartial(e??{})},fromPartial(e){let t=qS();return t.block=e.block??void 0,t}};function JS(){return{transaction:void 0,timestamp:void 0,transactionReceipt:void 0,block:void 0,trace:void 0}}var To={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(42).fork()).ldelim(),e.transactionReceipt!==void 0&&B.encode(B.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(50).fork()).ldelim(),e.trace!==void 0&&B.encode(B.wrap(e.trace),t.uint32(58).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=JS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue;case 7:if(a!==58)break;i.trace=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,transactionReceipt:Qe(e.transactionReceipt)?e.transactionReceipt:void 0,block:Qe(e.block)?e.block:void 0,trace:Qe(e.trace)?e.trace: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),t},create(e){return To.fromPartial(e??{})},fromPartial(e){let t=JS();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}};function zS(){return{trace:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0}}var No={encode(e,t=g.default.Writer.create()){return e.trace!==void 0&&B.encode(B.wrap(e.trace),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(42).fork()).ldelim(),e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&B.encode(B.wrap(e.transactionReceipt),t.uint32(26).fork()).ldelim(),e.block!==void 0&&B.encode(B.wrap(e.block),t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.trace=B.unwrap(B.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 3:if(a!==26)break;i.transactionReceipt=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.block=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{trace:Qe(e.trace)?e.trace:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,transaction:Qe(e.transaction)?e.transaction:void 0,transactionReceipt:Qe(e.transactionReceipt)?e.transactionReceipt:void 0,block:Qe(e.block)?e.block: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),t},create(e){return No.fromPartial(e??{})},fromPartial(e){let t=zS();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}};function VS(){return{instructionData:"",slot:BigInt("0"),programAccountId:"",accounts:[],parsed:void 0}}var Ro={encode(e,t=g.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 n of e.accounts)t.uint32(42).string(n);return e.parsed!==void 0&&B.encode(B.wrap(e.parsed),t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.instructionData=n.string();continue;case 2:if(a!==16)break;i.slot=Qt(n.uint64());continue;case 3:if(a!==26)break;i.programAccountId=n.string();continue;case 5:if(a!==42)break;i.accounts.push(n.string());continue;case 4:if(a!==34)break;i.parsed=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{instructionData:E(e.instructionData)?globalThis.String(e.instructionData):"",slot:E(e.slot)?BigInt(e.slot):BigInt("0"),programAccountId:E(e.programAccountId)?globalThis.String(e.programAccountId):"",accounts:globalThis.Array.isArray(e?.accounts)?e.accounts.map(t=>globalThis.String(t)):[],parsed:Qe(e.parsed)?e.parsed: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),t},create(e){return Ro.fromPartial(e??{})},fromPartial(e){let t=VS();return t.instructionData=e.instructionData??"",t.slot=e.slot??BigInt("0"),t.programAccountId=e.programAccountId??"",t.accounts=e.accounts?.map(n=>n)||[],t.parsed=e.parsed??void 0,t}};function GS(){return{transaction:void 0}}var ko={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),t},create(e){return ko.fromPartial(e??{})},fromPartial(e){let t=GS();return t.transaction=e.transaction??void 0,t}};function WS(){return{transaction:void 0}}var Bo={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=WS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 2:if(a!==18)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0}},toJSON(e){let t={};return e.transaction!==void 0&&(t.transaction=e.transaction),t},create(e){return Bo.fromPartial(e??{})},fromPartial(e){let t=WS();return t.transaction=e.transaction??void 0,t}};function HS(){return{resources:[],version:BigInt("0"),timestampMicros:BigInt("0")}}var Oo={encode(e,t=g.default.Writer.create()){for(let n of e.resources)B.encode(B.wrap(n),t.uint32(34).fork()).ldelim();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())}return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=HS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 4:if(a!==34)break;i.resources.push(B.unwrap(B.decode(n,n.uint32())));continue;case 2:if(a!==16)break;i.version=Qt(n.int64());continue;case 5:if(a!==40)break;i.timestampMicros=Qt(n.int64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{resources:globalThis.Array.isArray(e?.resources)?[...e.resources]:[],version:E(e.version)?BigInt(e.version):BigInt("0"),timestampMicros:E(e.timestampMicros)?BigInt(e.timestampMicros):BigInt("0")}},toJSON(e){let t={};return e.resources?.length&&(t.resources=e.resources),e.version!==BigInt("0")&&(t.version=e.version.toString()),e.timestampMicros!==BigInt("0")&&(t.timestampMicros=e.timestampMicros.toString()),t},create(e){return Oo.fromPartial(e??{})},fromPartial(e){let t=HS();return t.resources=e.resources?.map(n=>n)||[],t.version=e.version??BigInt("0"),t.timestampMicros=e.timestampMicros??BigInt("0"),t}};function ZS(){return{transaction:void 0,timestamp:void 0,slot:BigInt("0")}}var Po={encode(e,t=g.default.Writer.create()){if(e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,slot:E(e.slot)?BigInt(e.slot):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.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Po.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function XS(){return{transaction:void 0,timestamp:void 0,slot:BigInt("0")}}var Do={encode(e,t=g.default.Writer.create()){if(e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=XS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,slot:E(e.slot)?BigInt(e.slot):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.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Do.fromPartial(e??{})},fromPartial(e){let t=XS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function YS(){return{objects:[],self:void 0,timestamp:void 0,slot:BigInt("0")}}var Mo={encode(e,t=g.default.Writer.create()){for(let n of e.objects)B.encode(B.wrap(n),t.uint32(10).fork()).ldelim();if(e.self!==void 0&&B.encode(B.wrap(e.self),t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.objects.push(B.unwrap(B.decode(n,n.uint32())));continue;case 4:if(a!==34)break;i.self=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{objects:globalThis.Array.isArray(e?.objects)?[...e.objects]:[],self:Qe(e.self)?e.self:void 0,timestamp:E(e.timestamp)?lr(e.timestamp):void 0,slot:E(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.objects?.length&&(t.objects=e.objects),e.self!==void 0&&(t.self=e.self),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(t.slot=e.slot.toString()),t},create(e){return Mo.fromPartial(e??{})},fromPartial(e){let t=YS();return t.objects=e.objects?.map(n=>n)||[],t.self=e.self??void 0,t.timestamp=e.timestamp??void 0,t.slot=e.slot??BigInt("0"),t}};function $S(){return{changes:[],timestamp:void 0,txDigest:"",slot:BigInt("0")}}var Fo={encode(e,t=g.default.Writer.create()){for(let n of e.changes)B.encode(B.wrap(n),t.uint32(10).fork()).ldelim();if(e.timestamp!==void 0&&Fe.encode(ur(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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$S();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.changes.push(B.unwrap(B.decode(n,n.uint32())));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.txDigest=n.string();continue;case 3:if(a!==24)break;i.slot=Qt(n.uint64());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{changes:globalThis.Array.isArray(e?.changes)?[...e.changes]:[],timestamp:E(e.timestamp)?lr(e.timestamp):void 0,txDigest:E(e.txDigest)?globalThis.String(e.txDigest):"",slot:E(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let t={};return e.changes?.length&&(t.changes=e.changes),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 Fo.fromPartial(e??{})},fromPartial(e){let t=$S();return t.changes=e.changes?.map(n=>n)||[],t.timestamp=e.timestamp??void 0,t.txDigest=e.txDigest??"",t.slot=e.slot??BigInt("0"),t}};function KS(){return{transaction:void 0,timestamp:void 0}}var Lo={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=KS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(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 Lo.fromPartial(e??{})},fromPartial(e){let t=KS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function jS(){return{transaction:void 0,timestamp:void 0}}var Qo={encode(e,t=g.default.Writer.create()){return e.transaction!==void 0&&B.encode(B.wrap(e.transaction),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.transaction=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{transaction:Qe(e.transaction)?e.transaction:void 0,timestamp:E(e.timestamp)?lr(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 Qo.fromPartial(e??{})},fromPartial(e){let t=jS();return t.transaction=e.transaction??void 0,t.timestamp=e.timestamp??void 0,t}};function ex(){return{result:void 0,timestamp:void 0}}var Uo={encode(e,t=g.default.Writer.create()){return e.result!==void 0&&B.encode(B.wrap(e.result),t.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&Fe.encode(ur(e.timestamp),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ex();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.result=B.unwrap(B.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.timestamp=Nn(Fe.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{result:Qe(e.result)?e.result:void 0,timestamp:E(e.timestamp)?lr(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 Uo.fromPartial(e??{})},fromPartial(e){let t=ex();return t.result=e.result??void 0,t.timestamp=e.timestamp??void 0,t}};function tx(){return{data:void 0,handlerType:0,handlerIds:[]}}var Lt={encode(e,t=g.default.Writer.create()){e.data!==void 0&&Io.encode(e.data,t.uint32(10).fork()).ldelim(),e.handlerType!==0&&t.uint32(24).int32(e.handlerType),t.uint32(34).fork();for(let n of e.handlerIds)t.int32(n);return t.ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.data=Io.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.handlerType=n.int32();continue;case 4:if(a===32){i.handlerIds.push(n.int32());continue}if(a===34){let s=n.uint32()+n.pos;for(;n.pos<s;)i.handlerIds.push(n.int32());continue}break}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{data:E(e.data)?Io.fromJSON(e.data):void 0,handlerType:E(e.handlerType)?_x(e.handlerType):0,handlerIds:globalThis.Array.isArray(e?.handlerIds)?e.handlerIds.map(t=>globalThis.Number(t)):[]}},toJSON(e){let t={};return e.data!==void 0&&(t.data=Io.toJSON(e.data)),e.handlerType!==0&&(t.handlerType=Ax(e.handlerType)),e.handlerIds?.length&&(t.handlerIds=e.handlerIds.map(n=>Math.round(n))),t},create(e){return Lt.fromPartial(e??{})},fromPartial(e){let t=tx();return t.data=e.data!==void 0&&e.data!==null?Io.fromPartial(e.data):void 0,t.handlerType=e.handlerType??0,t.handlerIds=e.handlerIds?.map(n=>n)||[],t}};function nx(){return{configUpdated:!1,error:void 0}}var qo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.configUpdated=n.bool();continue;case 2:if(a!==18)break;i.error=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{configUpdated:E(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:E(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 qo.fromPartial(e??{})},fromPartial(e){let t=nx();return t.configUpdated=e.configUpdated??!1,t.error=e.error??void 0,t}};function rx(){return{gauges:[],counters:[],events:[],exports:[],states:void 0}}var mn={encode(e,t=g.default.Writer.create()){for(let n of e.gauges)Vo.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.counters)Go.encode(n,t.uint32(18).fork()).ldelim();for(let n of e.events)Wo.encode(n,t.uint32(34).fork()).ldelim();for(let n of e.exports)Ho.encode(n,t.uint32(42).fork()).ldelim();return e.states!==void 0&&qo.encode(e.states,t.uint32(50).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.gauges.push(Vo.decode(n,n.uint32()));continue;case 2:if(a!==18)break;i.counters.push(Go.decode(n,n.uint32()));continue;case 4:if(a!==34)break;i.events.push(Wo.decode(n,n.uint32()));continue;case 5:if(a!==42)break;i.exports.push(Ho.decode(n,n.uint32()));continue;case 6:if(a!==50)break;i.states=qo.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(t=>Vo.fromJSON(t)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(t=>Go.fromJSON(t)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(t=>Wo.fromJSON(t)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(t=>Ho.fromJSON(t)):[],states:E(e.states)?qo.fromJSON(e.states):void 0}},toJSON(e){let t={};return e.gauges?.length&&(t.gauges=e.gauges.map(n=>Vo.toJSON(n))),e.counters?.length&&(t.counters=e.counters.map(n=>Go.toJSON(n))),e.events?.length&&(t.events=e.events.map(n=>Wo.toJSON(n))),e.exports?.length&&(t.exports=e.exports.map(n=>Ho.toJSON(n))),e.states!==void 0&&(t.states=qo.toJSON(e.states)),t},create(e){return mn.fromPartial(e??{})},fromPartial(e){let t=rx();return t.gauges=e.gauges?.map(n=>Vo.fromPartial(n))||[],t.counters=e.counters?.map(n=>Go.fromPartial(n))||[],t.events=e.events?.map(n=>Wo.fromPartial(n))||[],t.exports=e.exports?.map(n=>Ho.fromPartial(n))||[],t.states=e.states!==void 0&&e.states!==null?qo.fromPartial(e.states):void 0,t}};function ix(){return{context:void 0,calldata:""}}var Jo={encode(e,t=g.default.Writer.create()){return e.context!==void 0&&zo.encode(e.context,t.uint32(10).fork()).ldelim(),e.calldata!==""&&t.uint32(18).string(e.calldata),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ix();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.context=zo.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.calldata=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{context:E(e.context)?zo.fromJSON(e.context):void 0,calldata:E(e.calldata)?globalThis.String(e.calldata):""}},toJSON(e){let t={};return e.context!==void 0&&(t.context=zo.toJSON(e.context)),e.calldata!==""&&(t.calldata=e.calldata),t},create(e){return Jo.fromPartial(e??{})},fromPartial(e){let t=ix();return t.context=e.context!==void 0&&e.context!==null?zo.fromPartial(e.context):void 0,t.calldata=e.calldata??"",t}};function ax(){return{chainId:"",address:"",blockTag:""}}var zo={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ax();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.chainId=n.string();continue;case 2:if(a!==18)break;i.address=n.string();continue;case 3:if(a!==26)break;i.blockTag=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{chainId:E(e.chainId)?globalThis.String(e.chainId):"",address:E(e.address)?globalThis.String(e.address):"",blockTag:E(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 zo.fromPartial(e??{})},fromPartial(e){let t=ax();return t.chainId=e.chainId??"",t.address=e.address??"",t.blockTag=e.blockTag??"",t}};function sx(){return{ethCallParams:[]}}var tU={encode(e,t=g.default.Writer.create()){for(let n of e.ethCallParams)Jo.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.ethCallParams.push(Jo.decode(n,n.uint32()));continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethCallParams:globalThis.Array.isArray(e?.ethCallParams)?e.ethCallParams.map(t=>Jo.fromJSON(t)):[]}},toJSON(e){let t={};return e.ethCallParams?.length&&(t.ethCallParams=e.ethCallParams.map(n=>Jo.toJSON(n))),t},create(e){return tU.fromPartial(e??{})},fromPartial(e){let t=sx();return t.ethCallParams=e.ethCallParams?.map(n=>Jo.fromPartial(n))||[],t}};function ox(){return{ethCallResults:{}}}var nU={encode(e,t=g.default.Writer.create()){return Object.entries(e.ethCallResults).forEach(([n,r])=>{__.encode({key:n,value:r},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ox();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;let s=__.decode(n,n.uint32());s.value!==void 0&&(i.ethCallResults[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{ethCallResults:Qe(e.ethCallResults)?Object.entries(e.ethCallResults).reduce((t,[n,r])=>(t[n]=String(r),t),{}):{}}},toJSON(e){let t={};if(e.ethCallResults){let n=Object.entries(e.ethCallResults);n.length>0&&(t.ethCallResults={},n.forEach(([r,i])=>{t.ethCallResults[r]=i}))}return t},create(e){return nU.fromPartial(e??{})},fromPartial(e){let t=ox();return t.ethCallResults=Object.entries(e.ethCallResults??{}).reduce((n,[r,i])=>(i!==void 0&&(n[r]=globalThis.String(i)),n),{}),t}};function cx(){return{key:"",value:""}}var __={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=cx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:E(e.key)?globalThis.String(e.key):"",value:E(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 __.fromPartial(e??{})},fromPartial(e){let t=cx();return t.key=e.key??"",t.value=e.value??"",t}};function ux(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}var rt={encode(e,t=g.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(([n,r])=>{A_.encode({key:n,value:r},t.uint32(58).fork()).ldelim()}),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ux();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.address=n.string();continue;case 9:if(a!==74)break;i.contractName=n.string();continue;case 2:if(a!==16)break;i.blockNumber=Qt(n.uint64());continue;case 6:if(a!==50)break;i.transactionHash=n.string();continue;case 5:if(a!==42)break;i.chainId=n.string();continue;case 3:if(a!==24)break;i.transactionIndex=n.int32();continue;case 4:if(a!==32)break;i.logIndex=n.int32();continue;case 10:if(a!==82)break;i.name=n.string();continue;case 7:if(a!==58)break;let s=A_.decode(n,n.uint32());s.value!==void 0&&(i.labels[s.key]=s.value);continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{address:E(e.address)?globalThis.String(e.address):"",contractName:E(e.contractName)?globalThis.String(e.contractName):"",blockNumber:E(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:E(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:E(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:E(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:E(e.logIndex)?globalThis.Number(e.logIndex):0,name:E(e.name)?globalThis.String(e.name):"",labels:Qe(e.labels)?Object.entries(e.labels).reduce((t,[n,r])=>(t[n]=String(r),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 n=Object.entries(e.labels);n.length>0&&(t.labels={},n.forEach(([r,i])=>{t.labels[r]=i}))}return t},create(e){return rt.fromPartial(e??{})},fromPartial(e){let t=ux();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((n,[r,i])=>(i!==void 0&&(n[r]=globalThis.String(i)),n),{}),t}};function lx(){return{key:"",value:""}}var A_={encode(e,t=g.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 n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=lx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.key=n.string();continue;case 2:if(a!==18)break;i.value=n.string();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{key:E(e.key)?globalThis.String(e.key):"",value:E(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 A_.fromPartial(e??{})},fromPartial(e){let t=lx();return t.key=e.key??"",t.value=e.value??"",t}};function dx(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}var Et={encode(e,t=g.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&&yt.encode(e.bigInteger,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=dx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.bigDecimal=n.string();continue;case 2:if(a!==17)break;i.doubleValue=n.double();continue;case 3:if(a!==26)break;i.bigInteger=yt.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{bigDecimal:E(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:E(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:E(e.bigInteger)?yt.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=yt.toJSON(e.bigInteger)),t},create(e){return Et.fromPartial(e??{})},fromPartial(e){let t=dx();return t.bigDecimal=e.bigDecimal??void 0,t.doubleValue=e.doubleValue??void 0,t.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?yt.fromPartial(e.bigInteger):void 0,t}};function px(){return{from:0}}var it={encode(e,t=g.default.Writer.create()){return e.from!==0&&t.uint32(8).int32(e.from),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=px();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==8)break;i.from=n.int32();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{from:E(e.from)?_x(e.from):0}},toJSON(e){let t={};return e.from!==0&&(t.from=Ax(e.from)),t},create(e){return it.fromPartial(e??{})},fromPartial(e){let t=px();return t.from=e.from??0,t}};function fx(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}var Vo={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&Et.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=fx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=Et.decode(n,n.uint32());continue;case 3:if(a!==26)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,metricValue:E(e.metricValue)?Et.fromJSON(e.metricValue):void 0,runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=Et.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Vo.fromPartial(e??{})},fromPartial(e){let t=fx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?Et.fromPartial(e.metricValue):void 0,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}};function hx(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}var Go={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&Et.encode(e.metricValue,t.uint32(18).fork()).ldelim(),e.add!==!1&&t.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.metricValue=Et.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.add=n.bool();continue;case 4:if(a!==34)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,metricValue:E(e.metricValue)?Et.fromJSON(e.metricValue):void 0,add:E(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.metricValue!==void 0&&(t.metricValue=Et.toJSON(e.metricValue)),e.add!==!1&&(t.add=e.add),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Go.fromPartial(e??{})},fromPartial(e){let t=hx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.metricValue=e.metricValue!==void 0&&e.metricValue!==null?Et.fromPartial(e.metricValue):void 0,t.add=e.add??!1,t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}};function mx(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,noMetric:!1}}var Wo={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&t.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&B.encode(B.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&&it.encode(e.runtimeInfo,t.uint32(42).fork()).ldelim(),e.noMetric!==!1&&t.uint32(24).bool(e.noMetric),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.distinctEntityId=n.string();continue;case 6:if(a!==50)break;i.attributes=B.unwrap(B.decode(n,n.uint32()));continue;case 7:if(a!==56)break;i.severity=n.int32();continue;case 8:if(a!==66)break;i.message=n.string();continue;case 5:if(a!==42)break;i.runtimeInfo=it.decode(n,n.uint32());continue;case 3:if(a!==24)break;i.noMetric=n.bool();continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,distinctEntityId:E(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:Qe(e.attributes)?e.attributes:void 0,severity:E(e.severity)?HQ(e.severity):0,message:E(e.message)?globalThis.String(e.message):"",runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0,noMetric:E(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.distinctEntityId!==""&&(t.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(t.attributes=e.attributes),e.severity!==0&&(t.severity=ZQ(e.severity)),e.message!==""&&(t.message=e.message),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),e.noMetric!==!1&&(t.noMetric=e.noMetric),t},create(e){return Wo.fromPartial(e??{})},fromPartial(e){let t=mx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.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?it.fromPartial(e.runtimeInfo):void 0,t.noMetric=e.noMetric??!1,t}};function gx(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}var Ho={encode(e,t=g.default.Writer.create()){return e.metadata!==void 0&&rt.encode(e.metadata,t.uint32(10).fork()).ldelim(),e.payload!==""&&t.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&it.encode(e.runtimeInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof g.default.Reader?e:g.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gx();for(;n.pos<r;){let a=n.uint32();switch(a>>>3){case 1:if(a!==10)break;i.metadata=rt.decode(n,n.uint32());continue;case 2:if(a!==18)break;i.payload=n.string();continue;case 3:if(a!==26)break;i.runtimeInfo=it.decode(n,n.uint32());continue}if((a&7)===4||a===0)break;n.skipType(a&7)}return i},fromJSON(e){return{metadata:E(e.metadata)?rt.fromJSON(e.metadata):void 0,payload:E(e.payload)?globalThis.String(e.payload):"",runtimeInfo:E(e.runtimeInfo)?it.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let t={};return e.metadata!==void 0&&(t.metadata=rt.toJSON(e.metadata)),e.payload!==""&&(t.payload=e.payload),e.runtimeInfo!==void 0&&(t.runtimeInfo=it.toJSON(e.runtimeInfo)),t},create(e){return Ho.fromPartial(e??{})},fromPartial(e){let t=gx();return t.metadata=e.metadata!==void 0&&e.metadata!==null?rt.fromPartial(e.metadata):void 0,t.payload=e.payload??"",t.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?it.fromPartial(e.runtimeInfo):void 0,t}},Cte={name:"Processor",fullName:"processor.Processor",methods:{start:{name:"Start",requestType:wx,requestStream:!1,responseType:mu,responseStream:!1,options:{}},stop:{name:"Stop",requestType:mu,requestStream:!1,responseType:mu,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:yx,requestStream:!1,responseType:vx,responseStream:!1,options:{}},processBindings:{name:"ProcessBindings",requestType:bx,requestStream:!1,responseType:Ex,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:Cx,requestStream:!0,responseType:Ix,responseStream:!0,options:{}},preprocessBindingsStream:{name:"PreprocessBindingsStream",requestType:Sx,requestStream:!0,responseType:xx,responseStream:!0,options:{}}}};function ur(e){let t=BigInt(Math.trunc(e.getTime()/1e3)),n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function Nn(e){let t=(globalThis.Number(e.seconds.toString())||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function lr(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):Nn(Fe.fromJSON(e))}function Qt(e){return BigInt(e.toString())}g.default.util.Long!==Kr&&(g.default.util.Long=Kr,g.default.configure());function Qe(e){return typeof e=="object"&&e!==null}function E(e){return e!=null}var Tx=":sto_bi",rU=":sto_bd";function iU(e){return e.slice(0,128).replace(/[^_a-zA-Z0-9]/g,"_")}function y_(e){return e==="labels"?"labels_":iU(e)}function aU(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}function v_(e){if(Object.keys(e).length===0)return e;let t={};for(let n in e)e[n]!==void 0?t[y_(n)]=aU(e[n]):console.warn(`key: ${n} has empty value in attributes`);return t}function Nx(e,t,n){let r;switch(typeof e){case"string":return e.slice(0,t);case"bigint":return e.toString()+Tx;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: ${n??""}`),null;if(e===Object(e)){if(e instanceof Date)return e.toISOString();if(e instanceof Mt)return e.isNaN()||!e.isFinite()?(console.error("can't submit NaN or Infinity value, will store as 0"),0):e.toString()+rU;if(Hr.isBN(e))return e.toString(10)+Tx;if(e instanceof Promise)return console.error("Cannot submit promise"),null;r={};for(let[a,s]of Object.entries(e)){let o=Nx(s,t,`${n??""}.${a}`);o!=null&&(r[a]=o)}}else r=e;return r}function ud(e){return Nx(e,1e3)}import{MapStateStorage as oU}from"@sentio/runtime";import{ListStateStorage as sU}from"@sentio/runtime";var w_=class extends sU{},Bi=w_;Yt(Bi,"INSTANCE",new w_);var Oi=class{static register(t){Bi.INSTANCE.addValue(t)}static findEntity(t){for(let n of Bi.INSTANCE.getValues())if(n.entities[t])return n.entities[t]}};var b_=class extends oU{},Zo=b_;Yt(Zo,"INSTANCE",new b_);var ld=class{ctx;constructor(t){this.ctx=t}emit(t,n){Bx(t),kx(this.ctx,t,n)}},Wte=vt;function Rx(e){let t=[];for(let[n,r]of Object.entries(e)){let i,a,s;typeof r=="number"?i=r:r.address||r.symbol?a=r:s=Ri.create({fields:Rx(r)}),t.push({name:n,basicType:i,coinType:a,structType:s})}return t}var dd=class{eventName;config;constructor(t,n){this.eventName=t,this.config=n}static register(t,n){Bx(t);let r=ei.create();n?.fields&&(r=ei.create({name:t,fields:Rx(n.fields)}));let i=new dd(t,r);return Zo.INSTANCE.getOrSetValue(t,i)}emit(t,n){kx(t,this.eventName,n)}};function kx(e,t,n){let{distinctId:r,severity:i,message:a,...s}=n,o={metadata:e.getMetaData(t,{}),severity:i||wt.INFO,message:a||"",distinctEntityId:r||"",attributes:{...v_(e.baseLabels),...ud(s)},runtimeInfo:void 0,noMetric:!0};e.update({events:[o]})}function Bx(e){if(Oi.findEntity(e))throw new Error(`Event name ${e} is already used in the database schema`)}function fd(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)?Et.fromPartial({bigInteger:E_(e)}):Et.fromPartial({doubleValue:Number(e)})}if(typeof e=="bigint")return Et.fromPartial({bigInteger:E_(e)});if(typeof e=="string")return Et.fromPartial({bigDecimal:e});if(e.isInteger())return Et.fromPartial({bigInteger:Ox(e)});if(e.isNaN())throw new Error("Cannot record NaN value");if(!e.isFinite())throw new Error("Cannot record infinite value");return Et.fromPartial({bigDecimal:e.toString()})}function Ox(e){let t=e.isNegative();return t&&(e=e.abs()),Px(e.toString(16),t)}function pd(e){let t=e<0;return t&&(e=-e),Px(e.toString(16),t)}function E_(e){return typeof e=="number"||typeof e=="bigint"?pd(e):typeof e=="string"?pd(BigInt(e)):e instanceof Mt?Ox(e):pd(e)}function Px(e,t){e.length%2===1&&(e="0"+e);let n=Buffer.from(e,"hex");return{negative:t,data:new Uint8Array(n)}}var Pi=class{name;constructor(t){this.name=y_(t)}};import{MapStateStorage as cU}from"@sentio/runtime";var C_=class{unit;description;sparse;aggregationConfig};var hd=class extends Pi{config;constructor(t,n,r){super(n),this.config=Nr.fromPartial({...r,name:this.name,type:t});let i=this.config.aggregationConfig;i&&i.intervalInMinutes.length&&(i.intervalInMinutes.length>1&&console.error("current only support one intervalInMinutes, only first interval will be used for",n),i.intervalInMinutes[0]>0&&i.types.length===0&&(i.types=[pt.SUM,pt.COUNT]))}},I_=class extends cU{getOrRegisterMetric(t,n,r){let i=this.getOrRegister(),a=i.get(n);if(a&&a.config.type!==t)throw Error(`redefine ${n} of metric type ${t} that is previously ${a.config.type}`);return a||(t===bt.COUNTER?a=Ta._create(n,r):a=Na._create(n,r)),i.set(n,a),a}},xa=I_;Yt(xa,"INSTANCE",new I_);var Ta=class extends hd{static register(t,n){return xa.INSTANCE.getOrRegisterMetric(bt.COUNTER,t,n)}static _create(t,n){return new Ta(t,n)}constructor(t,n){super(bt.COUNTER,t,Nr.fromPartial({...n,aggregationConfig:{intervalInMinutes:n?.resolutionConfig?[n?.resolutionConfig?.intervalInMinutes]:[]}}))}add(t,n,r={}){this.record(t,n,r,!0)}sub(t,n,r={}){this.record(t,n,r,!1)}record(t,n,r,i){t.update({counters:[{metadata:t.getMetaData(this.name,r),metricValue:fd(n),add:i,runtimeInfo:void 0}]})}},md=class{ctx;counter;constructor(t,n){this.counter=Ta._create(t),this.ctx=n}add(t,n={}){this.counter.add(this.ctx,t,n)}sub(t,n={}){this.counter.sub(this.ctx,t,n)}},Na=class extends hd{static register(t,n){return xa.INSTANCE.getOrRegisterMetric(bt.GAUGE,t,n)}static _create(t,n){return new Na(t,n)}constructor(t,n){super(bt.GAUGE,t,Nr.fromPartial({...n}))}record(t,n,r={}){t.update({gauges:[{metadata:t.getMetaData(this.config.name,r),metricValue:fd(n),runtimeInfo:void 0}]})}},gd=class{gauge;ctx;constructor(t,n){this.gauge=Na._create(t),this.ctx=n}record(t,n={}){this.gauge.record(this.ctx,t,n)}},gu=class{ctx;constructor(t){this.ctx=t}Counter(t){return new md(t,this.ctx)}Gauge(t){return new gd(t,this.ctx)}};var Wc=Vn(q2(),1);import{mergeProcessResults as B5,PluginManager as O5}from"@sentio/runtime";var J2=new Error("Value is required but received null or undefined");function Aae(e){let{from:t,to:n,...r}=e;return{from:i=>{if(i==null)throw J2;return t(i)},to:i=>{if(i==null||i.nullValue)throw J2;return n(i)},...r,required:!0}}function yae(e){return{from:t=>({listValue:{values:t.map(e.from)}}),to:t=>t.listValue?.values.map(e.to)||[],isArray:!0,isRelation:e.isRelation,relationName:e.relationName}}function vae(e){return{from:t=>t==null?{nullValue:dt.NULL_VALUE}:{stringValue:e[t]},to(t){return t.stringValue}}}function wae(e){return{from:t=>typeof t=="string"?{stringValue:t}:t instanceof Uint8Array?{stringValue:`0x${Buffer.from(t).toString("hex")}`}:typeof t=="object"?{stringValue:t.id.toString()}:{nullValue:dt.NULL_VALUE},to(t){return t.stringValue},isRelation:!0,relationName:e}}var w5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{stringValue:e},to(e){return e.stringValue}},b5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{intValue:Math.floor(e)},to(e){return e.intValue}},E5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{floatValue:e},to(e){return e.floatValue}},C5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{boolValue:e},to(e){return e.boolValue}},I5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{timestampValue:e},to(e){return e.timestampValue}},z2={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{bytesValue:e},to(e){return e.bytesValue}},S5={from(e){return typeof e=="string"?{stringValue:e}:e instanceof Uint8Array?{stringValue:`0x${Buffer.from(e).toString("hex")}`}:{nullValue:dt.NULL_VALUE}},to(e){if(e.stringValue)return e.stringValue;if(e.bytesValue)return`0x${Buffer.from(e.bytesValue).toString("hex")}`}},x5={from:e=>{if(e==null)return{nullValue:dt.NULL_VALUE};let t=(e.c||[]).join(""),n=-(t.length-(e.e??0)-1);return{bigdecimalValue:{value:Tf(BigInt(t)),exp:n}}},to(e){let t=e.bigdecimalValue;if(t){let n=V2(t.value.data),r=new Mt(n.toString());return t.exp<0?r=r.dividedBy(new Mt(10).pow(-t.exp)):r=r.multipliedBy(new Mt(10).pow(t.exp)),r.multipliedBy(t.value?.negative?-1:1)}}},T5={from:e=>e==null?{nullValue:dt.NULL_VALUE}:{bigintValue:Tf(e)},to(e){if(e.bigintValue){let t=V2(e.bigintValue?.data);return e.bigintValue.negative&&(t=-t),t}}};function V2(e){let t=BigInt(0);for(let n=0;n<e.length;n++)t=t*BigInt(256)+BigInt(e[n]);return t}function Tf(e){let t=e<0;t&&(e=-e);let n=e.toString(16);n.length%2===1&&(n="0"+n);let r=Buffer.from(n,"hex");return{negative:t,data:new Uint8Array(r)}}var bae={BigDecimal:x5,BigInt:T5,String:w5,Boolean:C5,Uint8Array:z2,ID:S5,Bytes:z2,Int:b5,Float:E5,Timestamp:I5};import{PluginManager as N5}from"@sentio/runtime";var Nf=class{cache=new Map;getKey(t,n){return`${t}-${n}`}has(t,n){return this.cache.has(this.getKey(t,n))}get(t,n){return this.cache.get(this.getKey(t,n))}set(t){let n=t.data?.fields.id.stringValue;if(n){let r=this.getKey(t.entity,n),i=t.data?.fields||{};if(this.cache.has(r)){let a=this.cache.get(r)?.data?.fields||{};i=Object.assign(a,i)}this.cache.set(r,{...t,data:{fields:i}})}}delete(t,n){n&&this.cache.delete(this.getKey(t,n))}};function Rf(e){if(e==null)throw new Error("can't figure out entityName from undefined");if(typeof e=="string")return e;if(typeof e=="function")return e.entityName;if(typeof e=="object")return e.constructor.entityName;throw new Error(`can't figure out entityName from ${typeof e}`)}var cl=class{constructor(t){this.context=t}cache=new Nf;async get(t,n){let r=Rf(t),i=this.cache.get(r,n);if(i)return Promise.resolve(this.newEntity(t,i));let s=await this.context.sendRequest({get:{entity:r,id:n.toString()}});if(s.entityList?.entities[0]){let o=s.entityList?.entities[0];return this.newEntity(t,o)}}async delete(t,n){let r={entity:[],id:[]},i=Rf(t);if(n)if(Array.isArray(n))for(let a of n)r.entity.push(i),r.id.push(a.toString()),this.cache.delete(i,a.toString());else r.entity.push(i),r.id.push(n),this.cache.delete(i,n);else{let a=Array.isArray(t)?t:[t];for(let s of a)r.entity.push(i),r.id.push(s.id.toString()),this.cache.delete(i,n)}await this.context.sendRequest({delete:r})}async upsert(t){let n=Array.isArray(t)?t:[t],r={upsert:{entity:n.map(a=>Rf(a)),id:n.map(a=>a.id.toString()),entityData:n.map(a=>a._data)}};return this.context.sendRequest(r).then(a=>{r.upsert?.entity.forEach((s,o)=>{this.cache.set({entity:s,data:r.upsert?.entityData[o],genBlockChain:"",genBlockTime:void 0,genBlockNumber:0n})})})}async*listIterator(t,n){let r;for(;;){let i=await this.listRequest(t,n||[],r);for(let a of i.entityList?.entities||[])yield this.newEntity(t,a);if(!i.nextCursor)break;r=i.nextCursor}}async*listBatched(t,n,r=100){let i;for(;;){let a=await this.listRequest(t,n||[],i,r);if(yield(a.entityList?.entities||[]).map(o=>this.newEntity(t,o)),!a.nextCursor)break;i=a.nextCursor}}async listRequest(t,n,r,i){let a=await this.context.sendRequest({list:{entity:Rf(t),cursor:r,pageSize:i,filters:n?.map(s=>({field:s.field,op:R5[s.op],value:{values:Array.isArray(s.value)?s.value.map(o=>Uv(o)):[Uv(s.value)]}}))||[]}},3600);return a.entityList?.entities?.forEach(s=>{this.cache.set(s)}),a}async list(t,n,r){if(r){let i=await this.listRequest(t,n||[],r.cursor,r.pageSize);return r.cursor=i.nextCursor,i.entityList?.entities.map(a=>this.newEntity(t,a))||[]}return this.fromAsync(this.listIterator(t,n??[]))}async fromAsync(t){let n=[];for await(let r of t)n.push(r);return n}newEntity(t,n){if(typeof t=="string"){let i=Oi.findEntity(t);if(!i&&(i=Oi.findEntity(n.entity),!i))throw new Error(`Entity ${t} not found`);t=i}let r=new t({});return r._data=n.data,r}},R5={"=":de.EQ,"!=":de.NE,"<":de.LT,"<=":de.LE,">":de.GT,">=":de.GE,in:de.IN,"not in":de.NOT_IN,like:de.LIKE,"not like":de.NOT_LIKE,"has all":de.HAS_ALL,"has any":de.HAS_ANY};function Uv(e){return e==null?{nullValue:0}:typeof e=="boolean"?{boolValue:e}:typeof e=="string"?{stringValue:e}:typeof e=="number"?{floatValue:e}:typeof e=="bigint"?{bigintValue:Tf(e)}:e instanceof Mt?k5(e):e instanceof Date?{timestampValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{listValue:{values:e.map(t=>Uv(t))}}:{nullValue:0}}function k5(e){return{bigdecimalValue:void 0}}function Bae(){let e=N5.INSTANCE.dbContextLocalStorage.getStore();if(e)return new cl(e)}var qv=class{meter;eventLogger;_store;baseLabels;active;_res={counters:[],events:[],exports:[],gauges:[],states:{configUpdated:!1}};update(t){if(this.active)this._res=B5([this._res,mn.fromPartial(t)]);else throw new Wc.ServerError(Wc.Status.INTERNAL,"context not active, possible async function invoke without await")}constructor(t){this.meter=new gu(this),this.eventLogger=new ld(this),this.baseLabels=t||{},this.active=!0,this.initStore()}stopAndGetResult(){if(this.active)return this.active=!1,this._res;throw new Wc.ServerError(Wc.Status.INTERNAL,"Can't get result from same context twice")}getMetaData(t,n){return{...this.baseLabels,...this.getMetaDataInternal(t,n)}}get store(){return this._store==null&&console.warn("Store is not set, please initialize the processor with your database schema first."),this._store}initStore(){let t=O5.INSTANCE.dbContextLocalStorage.getStore();t&&(this._store=new cl(t))}};import{MapStateStorage as P5}from"@sentio/runtime";var Jv=class extends P5{},Hc=Jv;Yt(Hc,"INSTANCE",new Jv);var ul=class extends Pi{static register(t,n){let r=new ul(t,n);return Hc.INSTANCE.getOrSetValue(t,r)}channel;constructor(t,n){super(t),this.channel=n}emit(t,n){let r={metadata:t.getMetaData(this.name,{}),payload:JSON.stringify(n),runtimeInfo:void 0};t.update({exports:[r]})}};import{MapStateStorage as D5}from"@sentio/runtime";var Vv=class extends D5{},Za=Vv;Yt(Za,"INSTANCE",new Vv);var Bf=class extends Pi{static register(t,n){let r=new Bf(t,{...Bf.DEFAULT_OPTIONS,...n});return Za.INSTANCE.getOrSetValue(t,r)}options;constructor(t,n){super(t),this.options=n}trackEvent(t,n){let{distinctId:r,message:i,severity:a,...s}=n,o={message:i||"",severity:a||wt.INFO,metadata:t.getMetaData(this.name,{}),distinctEntityId:r||"",attributes:ud(s),runtimeInfo:void 0,noMetric:!1};t.update({events:[o]})}},kf=Bf;Yt(kf,"DEFAULT_OPTIONS",{totalByDay:!0,unique:!0});var Of=class extends kf{static register(t,n){t?t=["user",t].join("_"):t="user";let r=new Of(t,{...Of.DEFAULT_OPTIONS,...n});return Za.INSTANCE.getOrSetValue(t,r)}},zv=Of;Yt(zv,"DEFAULT_OPTIONS",{totalByDay:!0,unique:!0,distinctByDays:[1,7,30]});import{Plugin as F5,PluginManager as L5}from"@sentio/runtime";import{ListStateStorage as M5}from"@sentio/runtime";var Gv=class extends M5{},ll=Gv;Yt(ll,"INSTANCE",new Gv);var Pf=class extends F5{name="CorePlugin";async configure(t){t.templateInstances=[...ll.INSTANCE.getValues()];for(let n of xa.INSTANCE.getValues())t.metricConfigs.push({...n.config});for(let n of Zo.INSTANCE.getValues())t.eventLogConfigs.push({...n.config});for(let n of Za.INSTANCE.getValues())t.eventTrackingConfigs.push({distinctAggregationByDays:n.options.distinctByDays||[],eventName:n.name,retentionConfig:void 0,totalByDay:n.options.totalByDay||!1,totalPerEntity:void 0,unique:n.options.unique||!1});for(let n of Hc.INSTANCE.getValues())t.exportConfigs.push({name:n.name,channel:n.channel});Bi.INSTANCE.getValues().length>0&&(t.dbSchema={gqlSchema:Bi.INSTANCE.getValues().map(n=>n.source).join(`
|
|
830
830
|
|
|
831
831
|
`)})}};L5.INSTANCE.register(new Pf);export{Kr as a,Ds as b,mu as c,Ia as d,kQ as e,BQ as f,B as g,m_ as h,jr as i,Tr as j,Fe as k,dt as l,Ti as m,Gt as n,At as o,Ni as p,yt as q,bt as r,QQ as s,UQ as t,pt as u,qQ as v,JQ as w,Rr as x,zQ as y,VQ as z,kr as A,GQ as B,WQ as C,ge as D,_x as E,Ax as F,wt as G,HQ as H,ZQ as I,ki as J,bte as K,Ete as L,vt as M,XQ as N,YQ as O,de as P,$Q as Q,KQ as R,Qs as S,Us as T,yx as U,vx as V,qs as W,Js as X,zs as Y,Vs as Z,Gs as _,Ws as $,Nr as aa,ei as ba,Ri as ca,tr as da,Hs as ea,Zs as fa,er as ga,tt as ha,jQ as ia,Xs as ja,nr as ka,rr as la,wx as ma,eU as na,nt as oa,Ys as pa,$s as qa,ir as ra,Ks as sa,js as ta,eo as ua,to as va,no as wa,ro as xa,io as ya,ar as za,ao as Aa,so as Ba,oo as Ca,sr as Da,co as Ea,uo as Fa,lo as Ga,po as Ha,fo as Ia,ho as Ja,mo as Ka,go as La,bx as Ma,Ex as Na,Cx as Oa,Ix as Pa,Sx as Qa,_o as Ra,xx as Sa,or as Ta,Ao as Ua,yo as Va,cr as Wa,vo as Xa,wo as Ya,bo as Za,Eo as _a,Co as $a,Io as ab,So as bb,xo as cb,To as db,No as eb,Ro as fb,ko as gb,Bo as hb,Oo as ib,Po as jb,Do as kb,Mo as lb,Fo as mb,Lo as nb,Qo as ob,Uo as pb,Lt as qb,qo as rb,mn as sb,Jo as tb,zo as ub,tU as vb,nU as wb,__ as xb,rt as yb,A_ as zb,Et as Ab,it as Bb,Vo as Cb,Go as Db,Wo as Eb,Ho as Fb,Cte as Gb,q as Hb,En as Ib,he as Jb,Ae as Kb,ne as Lb,pn as Mb,ab as Nb,tu as Ob,Ts as Pb,f4 as Qb,Wl as Rb,Zl as Sb,ed as Tb,hQ as Ub,vee as Vb,Hg as Wb,v_ as Xb,Oi as Yb,Zo as Zb,ld as _b,Wte as $b,Rx as ac,dd as bc,fd as cc,E_ as dc,C_ as ec,Ta as fc,md as gc,Na as hc,gd as ic,gu as jc,Rn as kc,oa as lc,ca as mc,q2 as nc,J2 as oc,Aae as pc,yae as qc,vae as rc,wae as sc,w5 as tc,b5 as uc,E5 as vc,C5 as wc,I5 as xc,z2 as yc,S5 as zc,x5 as Ac,T5 as Bc,V2 as Cc,Tf as Dc,bae as Ec,Rf as Fc,cl as Gc,Bae as Hc,qv as Ic,ul as Jc,Za as Kc,kf as Lc,zv as Mc,ll as Nc,Pf as Oc};
|
|
832
832
|
/*! Bundled license information:
|
|
@@ -927,4 +927,4 @@ long/index.js:
|
|
|
927
927
|
* SPDX-License-Identifier: Apache-2.0
|
|
928
928
|
*)
|
|
929
929
|
*/
|
|
930
|
-
//# sourceMappingURL=chunk-
|
|
930
|
+
//# sourceMappingURL=chunk-DMMZTRC2.js.map
|