@sentio/sdk-bundle 2.63.0 → 2.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/aptos/builtin/0x1.js +1 -1
- package/lib/aptos/builtin/0x3.js +1 -1
- package/lib/aptos/builtin/0x4.js +1 -1
- package/lib/aptos/builtin/index.js +1 -1
- package/lib/aptos/ext/index.js +1 -1
- package/lib/aptos/index.js +1 -1
- package/lib/{chunk-RWNFJKBC.js → chunk-3UW3O4RI.js} +2 -2
- package/lib/{chunk-INM2JQXV.js → chunk-3XOMJPOV.js} +2 -2
- package/lib/{chunk-MEXIWEPZ.js → chunk-4CH3FO2Y.js} +2 -2
- package/lib/{chunk-MEXIWEPZ.js.map → chunk-4CH3FO2Y.js.map} +1 -1
- package/lib/chunk-67VWORXP.js +7 -0
- package/lib/chunk-67VWORXP.js.map +1 -0
- package/lib/{chunk-57B2QEFU.js → chunk-ATNNVLSV.js} +2 -2
- package/lib/{chunk-CIT277G3.js → chunk-CQUCT4WO.js} +2 -2
- package/lib/{chunk-MV77KZ7X.js → chunk-D2UTA6NP.js} +3 -3
- package/lib/{chunk-MV77KZ7X.js.map → chunk-D2UTA6NP.js.map} +1 -1
- package/lib/{chunk-NF7SQC5T.js → chunk-DCBB6WSY.js} +2 -2
- package/lib/{chunk-IRMT3JAE.js → chunk-E32G76ZD.js} +2 -2
- package/lib/{chunk-45NSVYWS.js → chunk-HYBAVEVS.js} +2 -2
- package/lib/{chunk-EDLEFVHW.js → chunk-MEWILSVR.js} +2 -2
- package/lib/{chunk-33Y7LZTL.js → chunk-OSRVBU5W.js} +2 -2
- package/lib/{chunk-XCZJCPWS.js → chunk-PJJSNY3A.js} +2 -2
- package/lib/{chunk-VG7IARUK.js → chunk-STFYLBQW.js} +2 -2
- package/lib/{chunk-RFTTBMZW.js → chunk-US7CSPMG.js} +2 -2
- package/lib/{chunk-TLJXINOL.js → chunk-WESN5VPX.js} +2 -2
- package/lib/{chunk-JWIM4IJV.js → chunk-WS3R3PHZ.js} +2 -2
- package/lib/{chunk-XMZYAXTX.js → chunk-ZXTBG7Q4.js} +2 -2
- package/lib/{chunk-VGSWB3RH.js → chunk-ZXUK2KRA.js} +2 -2
- package/lib/core/index.js +1 -1
- package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
- package/lib/eth/builtin/erc1155.js +1 -1
- package/lib/eth/builtin/erc20.js +1 -1
- package/lib/eth/builtin/erc721.js +1 -1
- package/lib/eth/builtin/index.js +1 -1
- package/lib/eth/builtin/weth9.js +1 -1
- package/lib/eth/index.js +1 -1
- package/lib/fuel/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/iota/builtin/0x1.js +1 -1
- package/lib/iota/builtin/0x2.js +1 -1
- package/lib/iota/builtin/0x3.js +1 -1
- package/lib/iota/builtin/index.js +1 -1
- package/lib/iota/ext/index.js +1 -1
- package/lib/iota/index.js +1 -1
- package/lib/move/index.js +1 -1
- package/lib/solana/builtin/index.js +1 -1
- package/lib/solana/index.js +1 -1
- package/lib/stark/index.js +1 -1
- package/lib/store/index.js +1 -1
- package/lib/sui/builtin/0x1.js +1 -1
- package/lib/sui/builtin/0x2.js +1 -1
- package/lib/sui/builtin/0x3.js +1 -1
- package/lib/sui/builtin/index.js +1 -1
- package/lib/sui/ext/index.js +1 -1
- package/lib/sui/index.js +1 -1
- package/lib/testing/index.js +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +2 -2
- package/lib/chunk-V7ONVBT4.js +0 -7
- package/lib/chunk-V7ONVBT4.js.map +0 -1
- /package/lib/{chunk-RWNFJKBC.js.map → chunk-3UW3O4RI.js.map} +0 -0
- /package/lib/{chunk-INM2JQXV.js.map → chunk-3XOMJPOV.js.map} +0 -0
- /package/lib/{chunk-57B2QEFU.js.map → chunk-ATNNVLSV.js.map} +0 -0
- /package/lib/{chunk-CIT277G3.js.map → chunk-CQUCT4WO.js.map} +0 -0
- /package/lib/{chunk-NF7SQC5T.js.map → chunk-DCBB6WSY.js.map} +0 -0
- /package/lib/{chunk-IRMT3JAE.js.map → chunk-E32G76ZD.js.map} +0 -0
- /package/lib/{chunk-45NSVYWS.js.map → chunk-HYBAVEVS.js.map} +0 -0
- /package/lib/{chunk-EDLEFVHW.js.map → chunk-MEWILSVR.js.map} +0 -0
- /package/lib/{chunk-33Y7LZTL.js.map → chunk-OSRVBU5W.js.map} +0 -0
- /package/lib/{chunk-XCZJCPWS.js.map → chunk-PJJSNY3A.js.map} +0 -0
- /package/lib/{chunk-VG7IARUK.js.map → chunk-STFYLBQW.js.map} +0 -0
- /package/lib/{chunk-RFTTBMZW.js.map → chunk-US7CSPMG.js.map} +0 -0
- /package/lib/{chunk-TLJXINOL.js.map → chunk-WESN5VPX.js.map} +0 -0
- /package/lib/{chunk-JWIM4IJV.js.map → chunk-WS3R3PHZ.js.map} +0 -0
- /package/lib/{chunk-XMZYAXTX.js.map → chunk-ZXTBG7Q4.js.map} +0 -0
- /package/lib/{chunk-VGSWB3RH.js.map → chunk-ZXUK2KRA.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
|
2
|
+
import{a as Tt,b as wt,c as ue,e as yt,f as M,g as X,i as vt}from"./chunk-E32G76ZD.js";import{a as It,b as St,c as le,e as Ot,f as N,g as z,i as xt}from"./chunk-WESN5VPX.js";import{a as h,b as T,d as Ct}from"./chunk-TTG5P3RD.js";import{D as Z,E as Me,a as b,d as O,f as j,i as xe,m as C,n as q,o as Q,u as je,v as Ne,w as _}from"./chunk-HYBAVEVS.js";import{Dd as F,E as m,Fd as g,Hd as bt,Ic as B,Sa as S,ja as ye,ta as ve,y as I}from"./chunk-4CH3FO2Y.js";import{b as J}from"./chunk-T2GZNU62.js";import{a,f as G}from"./chunk-G5BIPHMS.js";import{ListStateStorage as Vt}from"@sentio/runtime";var y=G(J(),1);var an="0x0000000000000000000000000000000000000000000000000000000000000000";function A(n){return typeof n!="object"||n==null?!1:n.$kind==="GasCoin"||n.$kind==="Result"||n.$kind==="NestedResult"||n.$kind==="Input"}a(A,"isTransactionArgument");function dn(n,e){return e.object(n)}a(dn,"transactionArgumentOrObject");function ln(n,e){return A(n)?n:typeof n=="string"?e.pure.string(n):e.pure.u64(n)}a(ln,"transactionArgumentOrPure");function un(n,e){return A(n)?n:e.pure.address(n)}a(un,"transactionArgumentOrPureAddress");function pn(n,e){return A(n)?n:e.pure.u8(n)}a(pn,"transactionArgumentOrPureU8");function fn(n,e){return A(n)?n:e.pure.u16(n)}a(fn,"transactionArgumentOrPureU16");function hn(n,e){return A(n)?n:e.pure.u32(n)}a(hn,"transactionArgumentOrPureU32");function mn(n,e){return A(n)?n:e.pure.u64(n)}a(mn,"transactionArgumentOrPureU64");function gn(n,e){return A(n)?n:e.pure.u128(n)}a(gn,"transactionArgumentOrPureU128");function bn(n,e){return A(n)?n:e.pure.u256(n)}a(bn,"transactionArgumentOrPureU256");function Cn(n,e){return A(n)?n:e.pure.bool(n)}a(Cn,"transactionArgumentOrPureBool");function In(n,e){return A(n)?n:e.makeMoveVec({elements:n.map(t=>e.object(t))})}a(In,"transactionArgumentOrVec");function Ae(n){return{address:n.address,exposedFunctions:Object.entries(n.exposedFunctions).map(([e,t])=>Ht(e,t)),name:n.name,structs:Object.entries(n.structs).map(([e,t])=>Bt(e,t)),enums:Object.entries(n.enums||{}).map(([e,t])=>Ft(e,t))}}a(Ae,"toInternalModule");function Ht(n,e){let t;switch(e.visibility){case"Private":t=_.PRIVATE;break;case"Public":t=_.PUBLIC;break;case"Friend":t=_.FRIEND;break;default:throw Error("No visibility for function"+n)}return{typeParams:e.typeParameters.map(r=>({constraints:r.abilities})),isEntry:e.isEntry,name:n,params:e.parameters.map($),return:e.return.map($),visibility:t}}a(Ht,"toInternalFunction");function Bt(n,e){return{abilities:e.abilities.abilities,fields:e.fields.map(jt),typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),isNative:!1,isEvent:!1,name:n}}a(Bt,"toInternalStruct");function Ft(n,e){return{name:n,abilities:e.abilities.abilities,typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),variants:Object.entries(e.variants).reduce((t,[r,o])=>(t[r]=o.map(jt),t),{})}}a(Ft,"toInternalEnum");function jt(n){return{name:n.name,type:$(n.type)}}a(jt,"toInternalField");function $(n){if(typeof n=="string")return new C(n);if("Struct"in n){let e=[n.Struct.address,n.Struct.module,n.Struct.name].join(b),t=n.Struct.typeArguments.map($);return new C(e,t)}if("Vector"in n)return new C("Vector",[$(n.Vector)]);if("TypeParameter"in n)return new C("T"+n.TypeParameter);if("Reference"in n){let e=$(n.Reference);return e.reference=!0,e}if("MutableReference"in n){let e=$(n.MutableReference);return e.reference=!0,e.mutable=!0,e}throw new Error("Unexpected sui type")}a($,"toTypeDescriptor");var ke=class extends je{static{a(this,"SuiChainAdapter")}async getChainId(){return this.client.getChainIdentifier()}client;constructor(e){super(),this.client=e}async fetchModule(e,t){return await this.client.getNormalizedMoveModule({package:e,module:t})}async fetchModules(e){let t=await this.client.getNormalizedMoveModulesByPackage({package:e});return Object.values(t)}getMeaningfulFunctionParams(e){return e}toInternalModules(e){return Object.values(e).map(Ae)}getAllEventStructs(e){let t=new Map;for(let r of e){let o=xe(r);for(let s of r.structs){let i=new Set(s.abilities);i.has("Drop")&&i.has("Copy")&&t.set(o+b+s.name,s)}}return t}getType(e){return e.type}getData(e){if(e===void 0)throw Error("val is undefined");return"parsedJson"in e?e.parsedJson:e.dataType==="moveObject"||"fields"in e&&"type"in e&&Object.keys(e).length===2?e.fields:e}};var L=class extends Ne{static{a(this,"MoveCoder")}constructor(e){super(new ke(e))}load(e,t){t=O(t);let r=this.moduleMapping.get(e.address+"::"+e.name),o=this.moduleMapping.get(t+"::"+e.name);return r&&o||(this.accounts.add(e.address),r=Ae(e),this.loadInternal(r,t)),r}async decode(e,t){switch(t.qname){case"0x1::ascii::Char":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).byte;return String.fromCharCode(o)}case"0x1::ascii::String":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).bytes;return new TextDecoder().decode(new Uint8Array(o))}case"0x2::object::ID":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).bytes;return wt(o)}case"0x2::url::Url":if(e!==void 0&&typeof e!="string")return(await super.decode(e,t)).url;case"0x2::coin::Coin":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).id.id.bytes;return new TextDecoder().decode(new Uint8Array(o))}return e;case"0x2::balance::Balance":return e.value?(await super.decode(e,t)).value:BigInt(e);case"0x1::option::Option":if(e===null)return e;if(e.vec){let o=await super.decode(e,t);return o=o.vec,o.length===0?null:o[0]}return this.decode(e,t.typeArgs[0]);case"Address":return Tt(e);case"0x1::string::String":if(typeof e!="string")return new TextDecoder().decode(new Uint8Array(e.bytes));default:return super.decode(e,t)}}decodeEvent(e){return this.decodedStruct(e)}filterAndDecodeEvents(e,t){return typeof e=="string"&&(e=q(e)),this.filterAndDecodeStruct(e,t)}async getDynamicFields(e,t=Q,r=Q){let o=new C("0x2::dynamic_field::Field");return o.typeArgs=[t,r],(await this.filterAndDecodeObjects(o,e)).map(i=>i.data_decoded)}filterAndDecodeObjects(e,t){return this.filterAndDecodeStruct(e,t)}async decodeFunctionPayload(e,t){let r=[e.package,e.module,e.function].join(b),o=await this.getMoveFunction(r),s=this.adapter.getMeaningfulFunctionParams(o.params),i=[];for(let c of e.arguments||[]){let l=c;if("Input"in l){let p=l.Input,f=t[p];f.type==="pure"?i.push(f.value):(f.type==="object"||console.error("unexpected function arg value"),i.push(void 0))}else i.push(void 0)}let d=await this.decodeArray(i,s,!1);return{...e,arguments_decoded:d}}bcsRegistered=new Set;bcsRegistry=new Map;async getBCSTypeWithArgs(e,t=[]){let r=e.qname,o=e.getNormalizedSignature(),s=this.bcsRegistry.get(o);if(s)return s;let i=r.toLowerCase();switch(i){case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":case"bool":return ue[i]();case"address":return ue.Address;case"vector":return ue.vector(t[0]);default:if(!r.includes("::"))throw`Unimplemented builtin type ${r}`}let d;try{d=await this.getMoveStruct(r)}catch(l){throw console.error("Invalid move address",r),l}let c={};for(let l of d.fields)if(l.type.qname.startsWith("T")&&t.length){let p=+l.type.qname.slice(1);c[l.name]=t[p]}else l.type.typeArgs.length&&t.length?c[l.name]=await this.getBCSTypeWithArgs(l.type,t):c[l.name]=await this.getBCSType(l.type);return ue.struct(r,c)}async getBCSType(e){let t=await Promise.all(e.typeArgs.map(o=>this.getBCSType(o))),r=await this.getBCSTypeWithArgs(e,t);return this.bcsRegistry.set(e.getNormalizedSignature(),r),r}async registerBCSTypes(e){let t=e.getNormalizedSignature();if(this.bcsRegistered.has(t))return;this.bcsRegistered.add(t);let r=await this.getBCSType(e);this.bcsRegistry.set(e.getNormalizedSignature(),r)}async decodeBCS(e,t,r){if(await this.registerBCSTypes(e),typeof t=="string"){let s=Buffer.from(t,r);t=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}return this.bcsRegistry.get(e.getNormalizedSignature())?.parse(t)}async decodeDevInspectResult(e){let t=[];if(e.results!=null)for(let r of e.results)if(r.returnValues)for(let o of r.returnValues){let s=q(o[1]),i=await this.decodeBCS(s,new Uint8Array(o[0])),d=await this.decodeType(i,s);t.push(d)}else t.push(null);return{...e,results_decoded:t}}},_t="https://fullnode.mainnet.sui.io/",Nt=new Map;function At(n=_t){let e=Nt.get(n);return e||(e=new L(new yt({url:n})),Nt.set(n,e)),e}a(At,"defaultMoveCoder");var Mt=new Map,Ke;async function Lt(n){let e=Mt.get(n);if(!e){e=new L(n);let t=await n.getChainIdentifier(),r=At();Ke||(Ke=await r.adapter.getChainId()),t===Ke&&(e=r),Mt.set(n,e)}return e}a(Lt,"getMoveCoder");var kt=new Map;function ee(n=M.MAIN_NET){let e=kt.get(n);return e||(e=new L(X(n)),kt.set(n,e)),e}a(ee,"defaultMoveCoder");import("node:process").then(n=>n.stdout.write(""));var w=class extends Z{static{a(this,"SuiContext")}moduleName;timestamp;checkpoint;transaction;eventIndex;coder;constructor(e,t,r,o,s,i,d,c){super(c),this.address=r.toLowerCase(),this.network=t,this.moduleName=e,this.timestamp=o,this.checkpoint=s,this.eventIndex=d,this.coder=ee(t),i&&(this.transaction=i)}getChainId(){return this.network}getTimestamp(){return this.timestamp.getDate()}getMetaDataInternal(e,t){return{address:this.address,contractName:this.moduleName,blockNumber:this.checkpoint,transactionIndex:0,transactionHash:this.transaction?.digest||"",logIndex:this.eventIndex,chainId:this.getChainId(),name:e,labels:B(t)}}get client(){return X(this.network)}},te=class extends Z{static{a(this,"SuiObjectChangeContext")}timestamp;checkpoint;coder;txDigest;constructor(e,t,r,o,s,i){super(i),this.address=t,this.network=e,this.timestamp=r,this.checkpoint=o,this.txDigest=s,this.coder=ee(e)}getChainId(){return this.network}getTimestamp(){return this.timestamp.getDate()}getMetaDataInternal(e,t){return{address:this.address,contractName:"*",blockNumber:this.checkpoint,transactionIndex:-1,transactionHash:this.txDigest,logIndex:0,chainId:this.getChainId(),name:e,labels:B(t)}}get client(){return X(this.network)}},We=class extends Me{static{a(this,"SuiAddressContext")}address;network;checkpoint;timestamp;coder;contractName="address";constructor(e,t,r,o,s){super(s),this.address=t,this.network=e,this.checkpoint=r,this.timestamp=o,this.coder=ee(e)}getChainId(){return this.network}getMetaDataInternal(e,t){return{address:this.address,contractName:this.contractName,blockNumber:this.checkpoint,transactionIndex:0,transactionHash:"",logIndex:0,chainId:this.getChainId(),name:e,labels:B(t)}}get client(){return X(this.network)}getTimestamp(){return this.timestamp.getDate()}},Pe=class extends We{static{a(this,"SuiObjectContext")}contractName="object";objectId;objectVersion;constructor(e,t,r,o,s,i){super(e,t,o,s,i),this.objectId=t,this.objectVersion=r}};import("node:process").then(n=>n.stdout.write(""));function Ye(n){let e=n.transaction?.data.transaction;if(!e)return[];let t=e.kind==="ProgrammableTransaction"?e:void 0;return t?t.transactions.flatMap(r=>{if("MoveCall"in r){let o=r.MoveCall;return o.package=O(o.package),[o]}return[]}):[]}a(Ye,"getMoveCalls");import("node:process").then(n=>n.stdout.write(""));var pe={resourceChanges:!1,allEvents:!0,inputs:!0};function Ze(n){return{startCheckpoint:n.startCheckpoint||0n,endCheckpoint:n.endCheckpoint,address:n.address===g?g:j(n.address),network:n.network||M.MAIN_NET,baseLabels:n.baseLabels}}a(Ze,"configure");var ne=class n extends Vt{static{a(this,"SuiProcessorState")}static INSTANCE=new n},fe=class{static{a(this,"SuiBaseProcessor")}moduleName;config;eventHandlers=[];callHandlers=[];objectChangeHandlers=[];coder;constructor(e,t){return this.moduleName=e,this.config=Ze(t),ne.INSTANCE.addValue(this),this.coder=ee(this.config.network),T(this)}getChainId(){return this.config.network}onMoveEvent(e,t,r){let o=[],s=S.fromPartial({...pe,...r});Array.isArray(t)?o=t:o.push(t);let i=this;return this.eventHandlers.push({handlerName:h(),handler:a(async function(d){if(!d.rawTransaction)throw new y.ServerError(y.Status.INVALID_ARGUMENT,"event is null");let c=JSON.parse(d.rawTransaction);c.events==null&&(c.events=[]);let l=JSON.parse(d.rawEvent),p=Number(l.id.eventSeq)||0,f=new w(i.moduleName,i.config.network,i.config.address,d.timestamp||new Date(0),d.slot,c,p,i.config.baseLabels),x=await i.coder.decodeEvent(l);return await e(x||l,f),f.stopAndGetResult()},"handler"),filters:o,fetchConfig:s,partitionHandler:a(async d=>{let c=r?.partitionKey;if(c){if(typeof c=="function"){let l=JSON.parse(d.rawEvent),p=await i.coder.decodeEvent(l);return c(p||l)}return c}},"partitionHandler")}),this}onEntryFunctionCall(e,t,r){let o=[],s=S.fromPartial({...pe,...r});Array.isArray(t)?o=t:o.push(t);let i=this,d=new Set(o.map(c=>c.function));return this.callHandlers.push({handlerName:h(),handler:a(async function(c){if(!c.rawTransaction)throw new y.ServerError(y.Status.INVALID_ARGUMENT,"call is null");let l=JSON.parse(c.rawTransaction),p=new w(i.moduleName,i.config.network,i.config.address,c.timestamp||new Date(0),c.slot,l,0,i.config.baseLabels);if(l){let f=Ye(l),x=l.transaction?.data?.transaction;if(!x)throw new y.ServerError(y.Status.INVALID_ARGUMENT,"Unexpected getTransactionKind get empty");let Ge=x.kind==="ProgrammableTransaction"?x:void 0;for(let U of f){let Je=[U.module,U.function].join(b);if(!d.has(Je))continue;let $e=await i.coder.decodeFunctionPayload(U,Ge?.inputs||[]);await e($e,p)}}return p.stopAndGetResult()},"handler"),filters:o,fetchConfig:s,partitionHandler:a(async c=>{let l=r?.partitionKey;if(l){if(typeof l=="function"){let p=JSON.parse(c.rawTransaction),f=Ye(p);return f.length>0?l(f[0]):void 0}return l}},"partitionHandler")}),this}onEvent(e,t){return this.onMoveEvent(e,{type:""},t),this}onTransactionBlock(e,t,r){let o=S.fromPartial({...pe,...r}),s=this;return this.callHandlers.push({handlerName:h(),handler:a(async function(i){if(!i.rawTransaction)throw new y.ServerError(y.Status.INVALID_ARGUMENT,"transaction is null");let d=JSON.parse(i.rawTransaction),c=new w(s.moduleName,s.config.network,s.config.address,i.timestamp||new Date(0),i.slot,d,0,s.config.baseLabels);return d&&await e(d,c),c.stopAndGetResult()},"handler"),filters:[{...t,function:""}],fetchConfig:o,partitionHandler:a(async i=>{let d=r?.partitionKey;if(d){if(typeof d=="function"){let c=JSON.parse(i.rawTransaction);return d(c)}return d}},"partitionHandler")}),this}onObjectChange(e,t){if(this.config.network===M.TEST_NET)throw new y.ServerError(y.Status.INVALID_ARGUMENT,"object change not supported in testnet");let r=this;return this.objectChangeHandlers.push({handlerName:h(),handler:a(async function(o){let s=new te(r.config.network,r.config.address,o.timestamp||new Date(0),o.slot,o.txDigest,r.config.baseLabels);return await e(o.rawChanges.map(i=>JSON.parse(i)),s),s.stopAndGetResult()},"handler"),type:t}),this}},qe=class n extends fe{static{a(this,"SuiModulesProcessor")}static bind(e){return new n(g,e)}},Qe=class n extends fe{static{a(this,"SuiGlobalProcessor")}static bind(e){return new n(g,{...e,address:g})}onTransactionBlock(e,t,r){return super.onTransactionBlock(e,t,r)}onObjectChange(e,t){return super.onObjectChange(e,t)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as Ut}from"@sentio/runtime";var re=G(J(),1);var Xe={owned:!1},R=class n extends Ut{static{a(this,"SuiAccountProcessorState")}static INSTANCE=new n},Ee=class{static{a(this,"SuiBaseObjectOrAddressProcessor")}config;ownerType;templateId;objectHandlers=[];objectChangeHandlers=[];constructor(e){return e.ownerType===I.TYPE?this.config={startCheckpoint:e.startCheckpoint||0n,endCheckpoint:e.endCheckpoint,address:e.address==="*"?"*":O(e.address),network:e.network||M.MAIN_NET,baseLabels:e.baseLabels}:this.config=Ze(e),this.ownerType=e.ownerType,R.INSTANCE.addValue(this),T(this)}getChainId(){return this.config.network}onInterval(e,t,r,o,s,i=h()){let d=this;return this.objectHandlers.push({handlerName:i,handler:a(async function(c){let l=new Pe(d.config.network,c.objectId,c.objectVersion,c.slot,c.timestamp||new Date(0),d.config.baseLabels);return await d.doHandle(e,c,l),l.stopAndGetResult()},"handler"),timeIntervalInMinutes:t,checkPointInterval:r,type:o,fetchConfig:{...Xe,...s}}),this}},he=class extends Ee{static{a(this,"SuiBaseObjectOrAddressProcessorInternal")}onTimeInterval(e,t=60,r=240,o,s){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,o,s)}onCheckpointInterval(e,t=1e5,r=4e5,o,s){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},o,s)}},K=class n extends he{static{a(this,"SuiAddressProcessor")}callHandlers=[];static bind(e){return new n({...e,ownerType:I.ADDRESS})}async doHandle(e,t,r){return e(t.rawObjects.map(o=>JSON.parse(o)),r)}onTransactionBlock(e,t,r){let o=S.fromPartial({...pe,...r}),s={fromAndToAddress:{from:"",to:this.config.address},...t},i=this;return this.callHandlers.push({handlerName:h(),handler:a(async function(d){if(!d.rawTransaction)throw new re.ServerError(re.Status.INVALID_ARGUMENT,"transaction is null");let c=JSON.parse(d.rawTransaction),l=new w("object",i.config.network,i.config.address,d.timestamp||new Date(0),d.slot,c,0,i.config.baseLabels);return c&&await e(c,l),l.stopAndGetResult()},"handler"),filters:[{...s,function:""}],fetchConfig:o}),this}},me=class n extends he{static{a(this,"SuiObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,endCheckpoint:e.endCheckpoint,ownerType:I.OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}return e(JSON.parse(t.rawSelf),t.rawObjects.map(o=>JSON.parse(o)),r)}},ze=class n extends Ee{static{a(this,"SuiObjectTypeProcessor")}objectType;static bind(e){let t=new n({address:g,network:e.network,startCheckpoint:e.startCheckpoint,endCheckpoint:e.endCheckpoint,ownerType:I.TYPE,baseLabels:e.baseLabels});return t.objectType=e.objectType,t}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}let o=await r.coder.filterAndDecodeObjects(this.objectType,[JSON.parse(t.rawSelf)]);return e(o[0],t.rawObjects.map(s=>JSON.parse(s)),r)}onObjectChange(e){if(this.config.network===M.TEST_NET)throw new re.ServerError(re.Status.INVALID_ARGUMENT,"object change not supported in testnet");let t=this;return this.objectChangeHandlers.push({handlerName:h(),handler:a(async function(r){let o=new te(t.config.network,t.config.address,r.timestamp||new Date(0),r.slot,r.txDigest,t.config.baseLabels);return await e(r.rawChanges.map(s=>JSON.parse(s)),o),o.stopAndGetResult()},"handler"),type:this.objectType.getSignature()}),this}onTimeInterval(e,t=60,r=240,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,this.objectType.getSignature(),o)}onCheckpointInterval(e,t=1e5,r=4e5,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},this.objectType.qname,o)}},ge=class n extends he{static{a(this,"SuiWrappedObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,endCheckpoint:e.endCheckpoint,ownerType:I.WRAPPED_OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){return e(t.rawObjects.map(o=>JSON.parse(o)),r)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as Gt}from"@sentio/runtime";var k=G(J(),1);var oe=class n extends Gt{static{a(this,"SuiAccountProcessorTemplateState")}static INSTANCE=new n},be=class{static{a(this,"SuiObjectOrAddressProcessorTemplate")}id;objectHandlers=[];binds=new Set;constructor(){return this.id=oe.INSTANCE.getValues().length,oe.INSTANCE.addValue(this),T(this)}bind(e,t){e.network=e.network||t.network,e.startCheckpoint=e.startCheckpoint||t.checkpoint;let r=e.objectId||e.address;if(r==="*")throw new k.ServerError(k.Status.INVALID_ARGUMENT,"can't bind template instance with *");r=j(r);let o=[e.network,r].join("_");if(this.binds.has(o)){console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${o}`);return}this.binds.add(o);let s=this.createProcessor(e);for(let d of this.objectHandlers)s.onInterval(d.handler,d.timeIntervalInMinutes,d.checkpointInterval,d.type,d.fetchConfig,d.handlerName);let i=s.config;t.update({states:{configUpdated:!0}}),F.INSTANCE.addValue({templateId:this.id,contract:{name:"",chainId:i.network,address:i.address,abi:""},startBlock:i.startCheckpoint,endBlock:i.endCheckpoint||0n,baseLabels:i.baseLabels}),console.log(`successfully bind template ${o}`)}unbind(e,t){e.network=e.network||t.network,e.startCheckpoint=e.startCheckpoint||t.checkpoint;let r=e.objectId||e.address;if(r==="*")throw new k.ServerError(k.Status.INVALID_ARGUMENT,"can't delete template instance bind with *");r=j(r);let o=[e.network,r].join("_");if(!this.binds.has(o)){console.log(`the template instance ${o} not existed or already unbind`);return}this.binds.delete(o);let s=0,i=F.INSTANCE.unregister();for(let c of i){if(c.contract?.chainId===e.network&&c.contract.address==r){s++;continue}F.INSTANCE.addValue(c)}if(s!==1)throw new k.ServerError(k.Status.INVALID_ARGUMENT,`Failed to delete template instance ${o}, deleted ${s} times`);let d=R.INSTANCE.unregister();s=0;for(let c of d){if(c.templateId===this.id&&c.config.network==e.network&&c.config.address===r){s++;continue}R.INSTANCE.addValue(c)}if(s!==1)throw new k.ServerError(k.Status.INVALID_ARGUMENT,`Failed to delete processor for template ${this.id}, ${o}. deleted ${s} times`);console.log(`successfully unbind template ${o}`),t.update({states:{configUpdated:!0}})}onInterval(e,t,r,o,s){return this.objectHandlers.push({handlerName:h(),handler:e,timeIntervalInMinutes:t,checkpointInterval:r,type:o,fetchConfig:{...Xe,...s}}),this}onTimeInterval(e,t=60,r=240,o,s){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,o,s)}onCheckpointInterval(e,t=1e5,r=4e5,o,s){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},o,s)}};var et=class extends be{static{a(this,"SuiAddressProcessorTemplate")}handlers=[];createProcessor(e){let t=K.bind(e);for(let r of this.handlers)t.onTransactionBlock(r.handler,r.filter,r.fetchConfig);return t.templateId=this.id,t}onTransactionBlock(e,t,r){return this.handlers.push({handler:e,filter:t,fetchConfig:r}),this}},tt=class extends be{static{a(this,"SuiObjectProcessorTemplate")}createProcessor(e){let t=me.bind(e);return t.templateId=this.id,t}},nt=class extends be{static{a(this,"SuiWrappedObjectProcessorTemplate")}createProcessor(e){let t=ge.bind(e);return t.templateId=this.id,t}};import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));import{errorString as Le,mergeProcessResults as Ve,Plugin as rn,PluginManager as on}from"@sentio/runtime";var u=G(J(),1);import{SuiChainId as sn}from"@sentio/chain";import{USER_PROCESSOR as Jt}from"@sentio/runtime";import{SuiChainId as rt}from"@sentio/chain";var De=class{constructor(e,t){this.handlerRegister=e;this.partitionManager=t}static{a(this,"SuiPluginPart")}async start(e){await vt(),console.log("total instances:",e.templateInstances.length);let t=new Set([rt.SUI_MAINNET,rt.SUI_TESTNET]);for(let r of e.templateInstances){if(!t.has(r.contract?.chainId||""))continue;console.log("start template instance",r.templateId),oe.INSTANCE.getValues()[r.templateId].bind({address:r.contract?.address||"",objectId:r.contract?.address||"",network:r.contract?.chainId||M.MAIN_NET,startCheckpoint:r.startBlock||0n,endCheckpoint:r.endBlock||0n,baseLabels:r.baseLabels},$t)}}async init(e){for(let t of[ne.INSTANCE,R.INSTANCE])for(let r of t.getValues())e.chainIds.push(r.config.network)}async configure(e,t){for(let r of ne.INSTANCE.getValues()){let o=r.config.network;if(t!==void 0&&t!==o.toString())continue;let s=ye.fromPartial({transactionConfig:[],processorType:Jt,contract:{name:r.moduleName,chainId:r.config.network,address:r.config.address,abi:""},startBlock:r.config.startCheckpoint,endBlock:r.config.endCheckpoint});for(let i of r.eventHandlers){let d=this.handlerRegister.register(i.handler,o);this.partitionManager.registerPartitionHandler(m.SUI_EVENT,d,i.partitionHandler);let c={filters:i.filters.map(l=>({type:l.type,account:l.account||"",eventAccount:l.eventAccount||""})),fetchConfig:i.fetchConfig,handlerId:d,handlerName:i.handlerName};s.moveEventConfigs.push(c)}for(let i of r.callHandlers){let d=this.handlerRegister.register(i.handler,o);this.partitionManager.registerPartitionHandler(m.SUI_CALL,d,i.partitionHandler);let c={filters:i.filters.map(l=>({function:l.function,typeArguments:l.typeArguments||[],withTypeArguments:!!l.typeArguments,includeFailed:l.includeFailed||!1,publicKeyPrefix:l.publicKeyPrefix||"",fromAndToAddress:l.fromAndToAddress})),fetchConfig:i.fetchConfig,handlerId:d,handlerName:i.handlerName};s.moveCallConfigs.push(c)}for(let i of r.objectChangeHandlers){let d=this.handlerRegister.register(i.handler,o),c={type:i.type,types:[i.type],handlerId:d,handlerName:i.handlerName,includeDeleted:!1};s.moveResourceChangeConfigs.push(c)}e.contractConfigs.push(s)}for(let r of R.INSTANCE.getValues()){let o=r.getChainId();if(t!==void 0&&t!==o.toString())continue;let s=ve.fromPartial({address:r.config.address,chainId:r.getChainId(),startBlock:r.config.startCheckpoint,endBlock:r.config.endCheckpoint});for(let i of r.objectChangeHandlers){let d=this.handlerRegister.register(i.handler,o),c={type:i.type,types:[i.type],handlerId:d,handlerName:i.handlerName,includeDeleted:!1};s.moveResourceChangeConfigs.push(c)}for(let i of r.objectHandlers){let d=this.handlerRegister.register(i.handler,o);s.moveIntervalConfigs.push({intervalConfig:{handlerId:d,handlerName:i.handlerName,minutes:0,minutesInterval:i.timeIntervalInMinutes,slot:0,slotInterval:i.checkPointInterval,fetchConfig:void 0},type:i.type||"",ownerType:r.ownerType,resourceFetchConfig:i.fetchConfig,fetchConfig:void 0})}if(r instanceof K)for(let i of r.callHandlers){let d=this.handlerRegister.register(i.handler,o),c={filters:i.filters.map(l=>({function:l.function,typeArguments:l.typeArguments||[],withTypeArguments:!!l.typeArguments,includeFailed:l.includeFailed||!1,publicKeyPrefix:l.publicKeyPrefix||"",fromAndToAddress:l.fromAndToAddress})),fetchConfig:i.fetchConfig,handlerId:d,handlerName:i.handlerName};s.moveCallConfigs.push(c)}e.accountConfigs.push(s)}}},$t=new w("",rt.SUI_MAINNET,"",new Date,0n,{},0,{});import("node:process").then(n=>n.stdout.write(""));import{USER_PROCESSOR as tn}from"@sentio/runtime";import{ListStateStorage as en}from"@sentio/runtime";var v=G(J(),1);var To="0x0000000000000000000000000000000000000000000000000000000000000000";function P(n){return typeof n!="object"||n==null?!1:n.$kind==="GasCoin"||n.$kind==="Result"||n.$kind==="NestedResult"||n.$kind==="Input"}a(P,"isTransactionArgument");function yo(n,e){return e.object(n)}a(yo,"transactionArgumentOrObject");function vo(n,e){return P(n)?n:typeof n=="string"?e.pure.string(n):e.pure.u64(n)}a(vo,"transactionArgumentOrPure");function xo(n,e){return P(n)?n:e.pure.address(n)}a(xo,"transactionArgumentOrPureAddress");function jo(n,e){return P(n)?n:e.pure.u8(n)}a(jo,"transactionArgumentOrPureU8");function No(n,e){return P(n)?n:e.pure.u16(n)}a(No,"transactionArgumentOrPureU16");function Mo(n,e){return P(n)?n:e.pure.u32(n)}a(Mo,"transactionArgumentOrPureU32");function Ao(n,e){return P(n)?n:e.pure.u64(n)}a(Ao,"transactionArgumentOrPureU64");function ko(n,e){return P(n)?n:e.pure.u128(n)}a(ko,"transactionArgumentOrPureU128");function Po(n,e){return P(n)?n:e.pure.u256(n)}a(Po,"transactionArgumentOrPureU256");function Eo(n,e){return P(n)?n:e.pure.bool(n)}a(Eo,"transactionArgumentOrPureBool");function Do(n,e){return P(n)?n:e.makeMoveVec({elements:n.map(t=>e.object(t))})}a(Do,"transactionArgumentOrVec");function Re(n){return{address:n.address,exposedFunctions:Object.entries(n.exposedFunctions).map(([e,t])=>Kt(e,t)),name:n.name,structs:Object.entries(n.structs).map(([e,t])=>Wt(e,t)),enums:[]}}a(Re,"toInternalModule");function Kt(n,e){let t;switch(e.visibility){case"Private":t=_.PRIVATE;break;case"Public":t=_.PUBLIC;break;case"Friend":t=_.FRIEND;break;default:throw Error("No visibility for function"+n)}return{typeParams:e.typeParameters.map(r=>({constraints:r.abilities})),isEntry:e.isEntry,name:n,params:e.parameters.map(W),return:e.return.map(W),visibility:t}}a(Kt,"toInternalFunction");function Wt(n,e){return{abilities:e.abilities.abilities,fields:e.fields.map(Yt),typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),isNative:!1,isEvent:!1,name:n}}a(Wt,"toInternalStruct");function Yt(n){return{name:n.name,type:W(n.type)}}a(Yt,"toInternalField");function W(n){if(typeof n=="string")return new C(n);if("Struct"in n){let e=[n.Struct.address,n.Struct.module,n.Struct.name].join(b),t=n.Struct.typeArguments.map(W);return new C(e,t)}if("Vector"in n)return new C("Vector",[W(n.Vector)]);if("TypeParameter"in n)return new C("T"+n.TypeParameter);if("Reference"in n){let e=W(n.Reference);return e.reference=!0,e}if("MutableReference"in n){let e=W(n.MutableReference);return e.reference=!0,e.mutable=!0,e}throw new Error("Unexpected sui type")}a(W,"toTypeDescriptor");var He=class extends je{static{a(this,"IotaChainAdapter")}async getChainId(){return this.client.getChainIdentifier()}client;constructor(e){super(),this.client=e}async fetchModule(e,t){return await this.client.getNormalizedMoveModule({package:e,module:t})}async fetchModules(e){let t=await this.client.getNormalizedMoveModulesByPackage({package:e});return Object.values(t)}getMeaningfulFunctionParams(e){return e}toInternalModules(e){return Object.values(e).map(Re)}getAllEventStructs(e){let t=new Map;for(let r of e){let o=xe(r);for(let s of r.structs){let i=new Set(s.abilities);i.has("Drop")&&i.has("Copy")&&t.set(o+b+s.name,s)}}return t}getType(e){return e.type}getData(e){if(e===void 0)throw Error("val is undefined");return"parsedJson"in e?e.parsedJson:e.dataType==="moveObject"||"fields"in e&&"type"in e&&Object.keys(e).length===2?e.fields:e}};var V=class extends Ne{static{a(this,"MoveCoder")}constructor(e){super(new He(e))}load(e,t){t=O(t);let r=this.moduleMapping.get(e.address+"::"+e.name),o=this.moduleMapping.get(t+"::"+e.name);return r&&o||(this.accounts.add(e.address),r=Re(e),this.loadInternal(r,t)),r}async decode(e,t){switch(t.qname){case"0x1::ascii::Char":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).byte;return String.fromCharCode(o)}case"0x1::ascii::String":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).bytes;return new TextDecoder().decode(new Uint8Array(o))}case"0x2::object::ID":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).bytes;return St(o)}case"0x2::url::Url":if(e!==void 0&&typeof e!="string")return(await super.decode(e,t)).url;case"0x2::coin::Coin":if(e!==void 0&&typeof e!="string"){let o=(await super.decode(e,t)).id.id.bytes;return new TextDecoder().decode(new Uint8Array(o))}return e;case"0x2::balance::Balance":return e.value?(await super.decode(e,t)).value:BigInt(e);case"0x1::option::Option":if(e===null)return e;if(e.vec){let o=await super.decode(e,t);return o=o.vec,o.length===0?null:o[0]}return this.decode(e,t.typeArgs[0]);case"Address":return It(e);case"0x1::string::String":if(typeof e!="string")return new TextDecoder().decode(new Uint8Array(e.bytes));default:return super.decode(e,t)}}decodeEvent(e){return this.decodedStruct(e)}filterAndDecodeEvents(e,t){return typeof e=="string"&&(e=q(e)),this.filterAndDecodeStruct(e,t)}async getDynamicFields(e,t=Q,r=Q){let o=new C("0x2::dynamic_field::Field");return o.typeArgs=[t,r],(await this.filterAndDecodeObjects(o,e)).map(i=>i.data_decoded)}filterAndDecodeObjects(e,t){return this.filterAndDecodeStruct(e,t)}async decodeFunctionPayload(e,t){let r=[e.package,e.module,e.function].join(b),o=await this.getMoveFunction(r),s=this.adapter.getMeaningfulFunctionParams(o.params),i=[];for(let c of e.arguments||[]){let l=c;if("Input"in l){let p=l.Input,f=t[p];f.type==="pure"?i.push(f.value):(f.type==="object"||console.error("unexpected function arg value"),i.push(void 0))}else i.push(void 0)}let d=await this.decodeArray(i,s,!1);return{...e,arguments_decoded:d}}bcsRegistered=new Set;bcsRegistry=new Map;async getBCSTypeWithArgs(e,t=[]){let r=e.qname,o=e.getNormalizedSignature(),s=this.bcsRegistry.get(o);if(s)return s;let i=r.toLowerCase();switch(i){case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":case"bool":return le[i]();case"address":return le.Address;case"vector":return le.vector(t[0]);default:if(!r.includes("::"))throw`Unimplemented builtin type ${r}`}let d;try{d=await this.getMoveStruct(r)}catch(l){throw console.error("Invalid move address",r),l}let c={};for(let l of d.fields)if(l.type.qname.startsWith("T")&&t.length){let p=+l.type.qname.slice(1);c[l.name]=t[p]}else l.type.typeArgs.length&&t.length?c[l.name]=await this.getBCSTypeWithArgs(l.type,t):c[l.name]=await this.getBCSType(l.type);return le.struct(r,c)}async getBCSType(e){let t=await Promise.all(e.typeArgs.map(o=>this.getBCSType(o))),r=await this.getBCSTypeWithArgs(e,t);return this.bcsRegistry.set(e.getNormalizedSignature(),r),r}async registerBCSTypes(e){let t=e.getNormalizedSignature();if(this.bcsRegistered.has(t))return;this.bcsRegistered.add(t);let r=await this.getBCSType(e);this.bcsRegistry.set(e.getNormalizedSignature(),r)}async decodeBCS(e,t,r){if(await this.registerBCSTypes(e),typeof t=="string"){let s=Buffer.from(t,r);t=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}return this.bcsRegistry.get(e.getNormalizedSignature())?.parse(t)}async decodeDevInspectResult(e){let t=[];if(e.results!=null)for(let r of e.results)if(r.returnValues)for(let o of r.returnValues){let s=q(o[1]),i=await this.decodeBCS(s,new Uint8Array(o[0])),d=await this.decodeType(i,s);t.push(d)}else t.push(null);return{...e,results_decoded:t}}},qt="https://api.mainnet.iota.cafe/",Pt=new Map;function Dt(n=qt){let e=Pt.get(n);return e||(e=new V(new Ot({url:n})),Pt.set(n,e)),e}a(Dt,"defaultMoveCoder");var Et=new Map,ot;async function Qt(n){let e=Et.get(n);if(!e){e=new V(n);let t=await n.getChainIdentifier(),r=Dt();ot||(ot=await r.adapter.getChainId()),t===ot&&(e=r),Et.set(n,e)}return e}a(Qt,"getMoveCoder");var Rt=new Map;function ie(n=N.MAIN_NET){let e=Rt.get(n);return e||(e=new V(z(n)),Rt.set(n,e)),e}a(ie,"defaultMoveCoder");import("node:process").then(n=>n.stdout.write(""));var E=class extends Z{static{a(this,"IotaContext")}moduleName;timestamp;checkpoint;transaction;eventIndex;coder;constructor(e,t,r,o,s,i,d,c){super(c),this.address=r.toLowerCase(),this.network=t,this.moduleName=e,this.timestamp=o,this.checkpoint=s,this.eventIndex=d,this.coder=ie(t),i&&(this.transaction=i)}getChainId(){return this.network}getTimestamp(){return this.timestamp.getDate()}getMetaDataInternal(e,t){return{address:this.address,contractName:this.moduleName,blockNumber:this.checkpoint,transactionIndex:0,transactionHash:this.transaction?.digest||"",logIndex:this.eventIndex,chainId:this.getChainId(),name:e,labels:B(t)}}get client(){return z(this.network)}},se=class extends Z{static{a(this,"IotaObjectChangeContext")}timestamp;checkpoint;coder;txDigest;constructor(e,t,r,o,s,i){super(i),this.address=t,this.network=e,this.timestamp=r,this.checkpoint=o,this.txDigest=s,this.coder=ie(e)}getChainId(){return this.network}getTimestamp(){return this.timestamp.getDate()}getMetaDataInternal(e,t){return{address:this.address,contractName:"*",blockNumber:this.checkpoint,transactionIndex:-1,transactionHash:this.txDigest,logIndex:0,chainId:this.getChainId(),name:e,labels:B(t)}}get client(){return z(this.network)}},it=class extends Me{static{a(this,"IotaAddressContext")}address;network;checkpoint;timestamp;coder;contractName="address";constructor(e,t,r,o,s){super(s),this.address=t,this.network=e,this.checkpoint=r,this.timestamp=o,this.coder=ie(e)}getChainId(){return this.network}getMetaDataInternal(e,t){return{address:this.address,contractName:this.contractName,blockNumber:this.checkpoint,transactionIndex:0,transactionHash:"",logIndex:0,chainId:this.getChainId(),name:e,labels:B(t)}}get client(){return z(this.network)}getTimestamp(){return this.timestamp.getDate()}},Be=class extends it{static{a(this,"IotaObjectContext")}contractName="object";objectId;objectVersion;constructor(e,t,r,o,s,i){super(e,t,o,s,i),this.objectId=t,this.objectVersion=r}};import("node:process").then(n=>n.stdout.write(""));function st(n){let e=n.transaction?.data.transaction;if(!e)return[];let t=e.kind==="ProgrammableTransaction"?e:void 0;return t?t.transactions.flatMap(r=>{if("MoveCall"in r){let o=r.MoveCall;return o.package=O(o.package),[o]}return[]}):[]}a(st,"getMoveCalls");import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as Zt}from"@sentio/runtime";var ae=G(J(),1);var dt={owned:!1},H=class n extends Zt{static{a(this,"IotaAccountProcessorState")}static INSTANCE=new n},Fe=class{static{a(this,"IotaBaseObjectOrAddressProcessor")}config;ownerType;templateId;objectHandlers=[];objectChangeHandlers=[];constructor(e){return e.ownerType===I.TYPE?this.config={startCheckpoint:e.startCheckpoint||0n,endCheckpoint:e.endCheckpoint,address:e.address==="*"?"*":O(e.address),network:e.network||N.MAIN_NET,baseLabels:e.baseLabels}:this.config=ct(e),this.ownerType=e.ownerType,H.INSTANCE.addValue(this),T(this)}getChainId(){return this.config.network}onInterval(e,t,r,o,s,i=h()){let d=this;return this.objectHandlers.push({handlerName:i,handler:a(async function(c){let l=new Be(d.config.network,c.objectId,c.objectVersion,c.slot,c.timestamp||new Date(0),d.config.baseLabels);return await d.doHandle(e,c,l),l.stopAndGetResult()},"handler"),timeIntervalInMinutes:t,checkPointInterval:r,type:o,fetchConfig:{...dt,...s}}),this}},Ce=class extends Fe{static{a(this,"IotaBaseObjectOrAddressProcessorInternal")}onTimeInterval(e,t=60,r=240,o,s){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,o,s)}onCheckpointInterval(e,t=1e5,r=4e5,o,s){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},o,s)}},Y=class n extends Ce{static{a(this,"IotaAddressProcessor")}callHandlers=[];static bind(e){return new n({...e,ownerType:I.ADDRESS})}async doHandle(e,t,r){return e(t.rawObjects.map(o=>JSON.parse(o)),r)}onTransactionBlock(e,t,r){let o=S.fromPartial({...Oe,...r}),s={fromAndToAddress:{from:"",to:this.config.address},...t},i=this;return this.callHandlers.push({handlerName:h(),handler:a(async function(d){if(!d.rawTransaction)throw new ae.ServerError(ae.Status.INVALID_ARGUMENT,"transaction is null");let c=JSON.parse(d.rawTransaction),l=new E("object",i.config.network,i.config.address,d.timestamp||new Date(0),d.slot,c,0,i.config.baseLabels);return c&&await e(c,l),l.stopAndGetResult()},"handler"),filters:[{...s,function:""}],fetchConfig:o}),this}},Ie=class n extends Ce{static{a(this,"IotaObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,endCheckpoint:e.endCheckpoint,ownerType:I.OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Iota object not existed in ${r.checkpoint}, please specific a start time`);return}return e(JSON.parse(t.rawSelf),t.rawObjects.map(o=>JSON.parse(o)),r)}},at=class n extends Fe{static{a(this,"IotaObjectTypeProcessor")}objectType;static bind(e){let t=new n({address:g,network:e.network,startCheckpoint:e.startCheckpoint,endCheckpoint:e.endCheckpoint,ownerType:I.TYPE,baseLabels:e.baseLabels});return t.objectType=e.objectType,t}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Iota object not existed in ${r.checkpoint}, please specific a start time`);return}let o=await r.coder.filterAndDecodeObjects(this.objectType,[JSON.parse(t.rawSelf)]);return e(o[0],t.rawObjects.map(s=>JSON.parse(s)),r)}onObjectChange(e){if(this.config.network===N.TEST_NET)throw new ae.ServerError(ae.Status.INVALID_ARGUMENT,"object change not supported in testnet");let t=this;return this.objectChangeHandlers.push({handlerName:h(),handler:a(async function(r){let o=new se(t.config.network,t.config.address,r.timestamp||new Date(0),r.slot,r.txDigest,t.config.baseLabels);return await e(r.rawChanges.map(s=>JSON.parse(s)),o),o.stopAndGetResult()},"handler"),type:this.objectType.getSignature()}),this}onTimeInterval(e,t=60,r=240,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,this.objectType.getSignature(),o)}onCheckpointInterval(e,t=1e5,r=4e5,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},this.objectType.qname,o)}},Se=class n extends Ce{static{a(this,"IotaWrappedObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,endCheckpoint:e.endCheckpoint,ownerType:I.WRAPPED_OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){return e(t.rawObjects.map(o=>JSON.parse(o)),r)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as zt}from"@sentio/runtime";var D=G(J(),1);var ce=class n extends zt{static{a(this,"IotaAccountProcessorTemplateState")}static INSTANCE=new n},Te=class{static{a(this,"IotaObjectOrAddressProcessorTemplate")}id;objectHandlers=[];binds=new Set;constructor(){return this.id=ce.INSTANCE.getValues().length,ce.INSTANCE.addValue(this),T(this)}bind(e,t){e.network=e.network||t.network,e.startCheckpoint=e.startCheckpoint||t.checkpoint;let r=e.objectId||e.address;if(r==="*")throw new D.ServerError(D.Status.INVALID_ARGUMENT,"can't bind template instance with *");r=j(r);let o=[e.network,r].join("_");if(this.binds.has(o)){console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${o}`);return}this.binds.add(o);let s=this.createProcessor(e);for(let d of this.objectHandlers)s.onInterval(d.handler,d.timeIntervalInMinutes,d.checkpointInterval,d.type,d.fetchConfig,d.handlerName);let i=s.config;t.update({states:{configUpdated:!0}}),F.INSTANCE.addValue({templateId:this.id,contract:{name:"",chainId:i.network,address:i.address,abi:""},startBlock:i.startCheckpoint,endBlock:i.endCheckpoint||0n,baseLabels:i.baseLabels}),console.log(`successfully bind template ${o}`)}unbind(e,t){e.network=e.network||t.network,e.startCheckpoint=e.startCheckpoint||t.checkpoint;let r=e.objectId||e.address;if(r==="*")throw new D.ServerError(D.Status.INVALID_ARGUMENT,"can't delete template instance bind with *");r=j(r);let o=[e.network,r].join("_");if(!this.binds.has(o)){console.log(`the template instance ${o} not existed or already unbind`);return}this.binds.delete(o);let s=0,i=F.INSTANCE.unregister();for(let c of i){if(c.contract?.chainId===e.network&&c.contract.address==r){s++;continue}F.INSTANCE.addValue(c)}if(s!==1)throw new D.ServerError(D.Status.INVALID_ARGUMENT,`Failed to delete template instance ${o}, deleted ${s} times`);let d=H.INSTANCE.unregister();s=0;for(let c of d){if(c.templateId===this.id&&c.config.network==e.network&&c.config.address===r){s++;continue}H.INSTANCE.addValue(c)}if(s!==1)throw new D.ServerError(D.Status.INVALID_ARGUMENT,`Failed to delete processor for template ${this.id}, ${o}. deleted ${s} times`);console.log(`successfully unbind template ${o}`),t.update({states:{configUpdated:!0}})}onInterval(e,t,r,o,s){return this.objectHandlers.push({handlerName:h(),handler:e,timeIntervalInMinutes:t,checkpointInterval:r,type:o,fetchConfig:{...dt,...s}}),this}onTimeInterval(e,t=60,r=240,o,s){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,o,s)}onCheckpointInterval(e,t=1e5,r=4e5,o,s){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},o,s)}};var lt=class extends Te{static{a(this,"IotaAddressProcessorTemplate")}handlers=[];createProcessor(e){let t=Y.bind(e);for(let r of this.handlers)t.onTransactionBlock(r.handler,r.filter,r.fetchConfig);return t.templateId=this.id,t}onTransactionBlock(e,t,r){return this.handlers.push({handler:e,filter:t,fetchConfig:r}),this}},ut=class extends Te{static{a(this,"IotaObjectProcessorTemplate")}createProcessor(e){let t=Ie.bind(e);return t.templateId=this.id,t}},pt=class extends Te{static{a(this,"IotaWrappedObjectProcessorTemplate")}createProcessor(e){let t=Se.bind(e);return t.templateId=this.id,t}};import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));var ft=class{static{a(this,"IotaPlugin")}};import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));var Oe={resourceChanges:!1,allEvents:!0,inputs:!0};function ct(n){return{startCheckpoint:n.startCheckpoint||0n,endCheckpoint:n.endCheckpoint,address:n.address===g?g:j(n.address),network:n.network||N.MAIN_NET,baseLabels:n.baseLabels}}a(ct,"configure");var de=class n extends en{static{a(this,"IotaProcessorState")}static INSTANCE=new n},we=class{static{a(this,"IotaBaseProcessor")}moduleName;config;eventHandlers=[];callHandlers=[];objectChangeHandlers=[];coder;constructor(e,t){return this.moduleName=e,this.config=ct(t),de.INSTANCE.addValue(this),this.coder=ie(this.config.network),T(this)}getChainId(){return this.config.network}onMoveEvent(e,t,r){let o=[],s=S.fromPartial({...Oe,...r});Array.isArray(t)?o=t:o.push(t);let i=this;return this.eventHandlers.push({handlerName:h(),handler:a(async function(d){if(!d.rawTransaction)throw new v.ServerError(v.Status.INVALID_ARGUMENT,"event is null");let c=JSON.parse(d.rawTransaction);c.events==null&&(c.events=[]);let l=JSON.parse(d.rawEvent),p=Number(l.id.eventSeq)||0,f=new E(i.moduleName,i.config.network,i.config.address,d.timestamp||new Date(0),d.slot,c,p,i.config.baseLabels),x=await i.coder.decodeEvent(l);return await e(x||l,f),f.stopAndGetResult()},"handler"),filters:o,fetchConfig:s,partitionHandler:a(async d=>{let c=r?.partitionKey;if(c){if(typeof c=="function"){let l=JSON.parse(d.rawEvent),p=await i.coder.decodeEvent(l);return c(p||l)}return c}},"partitionHandler")}),this}onEntryFunctionCall(e,t,r){let o=[],s=S.fromPartial({...Oe,...r});Array.isArray(t)?o=t:o.push(t);let i=this,d=new Set(o.map(c=>c.function));return this.callHandlers.push({handlerName:h(),handler:a(async function(c){if(!c.rawTransaction)throw new v.ServerError(v.Status.INVALID_ARGUMENT,"call is null");let l=JSON.parse(c.rawTransaction),p=new E(i.moduleName,i.config.network,i.config.address,c.timestamp||new Date(0),c.slot,l,0,i.config.baseLabels);if(l){let f=st(l),x=l.transaction?.data?.transaction;if(!x)throw new v.ServerError(v.Status.INVALID_ARGUMENT,"Unexpected getTransactionKind get empty");let Ge=x.kind==="ProgrammableTransaction"?x:void 0;for(let U of f){let Je=[U.module,U.function].join(b);if(!d.has(Je))continue;let $e=await i.coder.decodeFunctionPayload(U,Ge?.inputs||[]);await e($e,p)}}return p.stopAndGetResult()},"handler"),filters:o,fetchConfig:s,partitionHandler:a(async c=>{let l=r?.partitionKey;if(l){if(typeof l=="function"){let p=JSON.parse(c.rawTransaction),f=st(p);return f.length>0?l(f[0]):void 0}return l}},"partitionHandler")}),this}onEvent(e,t){return this.onMoveEvent(e,{type:""},t),this}onTransactionBlock(e,t,r){let o=S.fromPartial({...Oe,...r}),s=this;return this.callHandlers.push({handlerName:h(),handler:a(async function(i){if(!i.rawTransaction)throw new v.ServerError(v.Status.INVALID_ARGUMENT,"transaction is null");let d=JSON.parse(i.rawTransaction),c=new E(s.moduleName,s.config.network,s.config.address,i.timestamp||new Date(0),i.slot,d,0,s.config.baseLabels);return d&&await e(d,c),c.stopAndGetResult()},"handler"),filters:[{...t,function:""}],fetchConfig:o,partitionHandler:a(async i=>{let d=r?.partitionKey;if(d){if(typeof d=="function"){let c=JSON.parse(i.rawTransaction);return d(c)}return d}},"partitionHandler")}),this}onObjectChange(e,t){if(this.config.network===N.TEST_NET)throw new v.ServerError(v.Status.INVALID_ARGUMENT,"object change not supported in testnet");let r=this;return this.objectChangeHandlers.push({handlerName:h(),handler:a(async function(o){let s=new se(r.config.network,r.config.address,o.timestamp||new Date(0),o.slot,o.txDigest,r.config.baseLabels);return await e(o.rawChanges.map(i=>JSON.parse(i)),s),s.stopAndGetResult()},"handler"),type:t}),this}},ht=class n extends we{static{a(this,"IotaModulesProcessor")}static bind(e){return new n(g,e)}},mt=class n extends we{static{a(this,"IotaGlobalProcessor")}static bind(e){return new n(g,{...e,address:g})}onTransactionBlock(e,t,r){return super.onTransactionBlock(e,t,r)}onObjectChange(e,t){return super.onObjectChange(e,t)}};import("node:process").then(n=>n.stdout.write(""));import{SuiChainId as gt}from"@sentio/chain";var _e=class{constructor(e,t){this.handlerRegister=e;this.partitionManager=t}static{a(this,"IotaPluginPart")}async start(e){await xt(),console.log("total instances:",e.templateInstances.length);let t=new Set([gt.IOTA_MAINNET,gt.IOTA_TESTNET]);for(let r of e.templateInstances){if(!t.has(r.contract?.chainId||""))continue;console.log("start template instance",r.templateId),ce.INSTANCE.getValues()[r.templateId].bind({address:r.contract?.address||"",objectId:r.contract?.address||"",network:r.contract?.chainId||N.MAIN_NET,startCheckpoint:r.startBlock||0n,endCheckpoint:r.endBlock||0n,baseLabels:r.baseLabels},nn)}}async init(e){for(let t of[de.INSTANCE,H.INSTANCE])for(let r of t.getValues())e.chainIds.push(r.config.network)}async configure(e,t){for(let r of de.INSTANCE.getValues()){let o=r.config.network;if(t!==void 0&&t!==o.toString())continue;let s=ye.fromPartial({transactionConfig:[],processorType:tn,contract:{name:r.moduleName,chainId:r.config.network,address:r.config.address,abi:""},startBlock:r.config.startCheckpoint,endBlock:r.config.endCheckpoint});for(let i of r.eventHandlers){let d=this.handlerRegister.register(i.handler,o);this.partitionManager.registerPartitionHandler(m.SUI_EVENT,d,i.partitionHandler);let c={filters:i.filters.map(l=>({type:l.type,account:l.account||"",eventAccount:l.eventAccount||""})),fetchConfig:i.fetchConfig,handlerId:d,handlerName:i.handlerName};s.moveEventConfigs.push(c)}for(let i of r.callHandlers){let d=this.handlerRegister.register(i.handler,o);this.partitionManager.registerPartitionHandler(m.SUI_CALL,d,i.partitionHandler);let c={filters:i.filters.map(l=>({function:l.function,typeArguments:l.typeArguments||[],withTypeArguments:!!l.typeArguments,includeFailed:l.includeFailed||!1,publicKeyPrefix:l.publicKeyPrefix||"",fromAndToAddress:l.fromAndToAddress})),fetchConfig:i.fetchConfig,handlerId:d,handlerName:i.handlerName};s.moveCallConfigs.push(c)}for(let i of r.objectChangeHandlers){let d=this.handlerRegister.register(i.handler,o),c={type:i.type,types:[i.type],handlerId:d,handlerName:i.handlerName,includeDeleted:!1};s.moveResourceChangeConfigs.push(c)}e.contractConfigs.push(s)}for(let r of H.INSTANCE.getValues()){let o=r.getChainId();if(t!==void 0&&t!==o.toString())continue;let s=ve.fromPartial({address:r.config.address,chainId:r.getChainId(),startBlock:r.config.startCheckpoint,endBlock:r.config.endCheckpoint});for(let i of r.objectChangeHandlers){let d=this.handlerRegister.register(i.handler,o),c={type:i.type,types:[i.type],handlerId:d,handlerName:i.handlerName,includeDeleted:!1};s.moveResourceChangeConfigs.push(c)}for(let i of r.objectHandlers){let d=this.handlerRegister.register(i.handler,o);s.moveIntervalConfigs.push({intervalConfig:{handlerId:d,handlerName:i.handlerName,minutes:0,minutesInterval:i.timeIntervalInMinutes,slot:0,slotInterval:i.checkPointInterval,fetchConfig:void 0},type:i.type||"",ownerType:r.ownerType,resourceFetchConfig:i.fetchConfig,fetchConfig:void 0})}if(r instanceof Y)for(let i of r.callHandlers){let d=this.handlerRegister.register(i.handler,o),c={filters:i.filters.map(l=>({function:l.function,typeArguments:l.typeArguments||[],withTypeArguments:!!l.typeArguments,includeFailed:l.includeFailed||!1,publicKeyPrefix:l.publicKeyPrefix||"",fromAndToAddress:l.fromAndToAddress})),fetchConfig:i.fetchConfig,handlerId:d,handlerName:i.handlerName};s.moveCallConfigs.push(c)}e.accountConfigs.push(s)}}},nn=new E("",gt.IOTA_MAINNET,"",new Date,0n,{},0,{});import("node:process").then(n=>n.stdout.write(""));var Ue=class extends rn{static{a(this,"SuiPlugin")}name="SuiPlugin";handlerRegister=new Ct;partitionManager=new bt;suiPart=new De(this.handlerRegister,this.partitionManager);iotaPart=new _e(this.handlerRegister,this.partitionManager);async start(e){await this.suiPart.start(e),await this.iotaPart.start(e)}async init(e){await this.suiPart.init(e),await this.iotaPart.init(e)}async configure(e,t){this.handlerRegister.clear(t),await this.suiPart.configure(e),await this.iotaPart.configure(e)}supportedHandlers=[m.SUI_EVENT,m.SUI_CALL,m.SUI_OBJECT,m.SUI_OBJECT_CHANGE];processBinding(e){switch(e.handlerType){case m.SUI_EVENT:return this.processSuiEvent(e);case m.SUI_CALL:return this.processSuiFunctionCall(e);case m.SUI_OBJECT:return this.processSuiObject(e);case m.SUI_OBJECT_CHANGE:return this.processSuiObjectChange(e);default:throw new u.ServerError(u.Status.INVALID_ARGUMENT,"No handle type registered "+e.handlerType)}}async partition(e){let t;switch(e.handlerType){case m.SUI_EVENT:if(!e.data?.suiEvent)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"suiEvent can't be empty");t=e.data.suiEvent;break;case m.SUI_CALL:if(!e.data?.suiCall)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"suiCall can't be empty");t=e.data.suiCall;break;case m.SUI_OBJECT:if(!e.data?.suiObject)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"suiObject can't be empty");t=e.data.suiObject;break;case m.SUI_OBJECT_CHANGE:if(!e.data?.suiObjectChange)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"suiObjectChange can't be empty");t=e.data.suiObjectChange;break;default:throw new u.ServerError(u.Status.INVALID_ARGUMENT,"No handle type registered "+e.handlerType)}return{partitions:await this.partitionManager.processPartitionForHandlerType(e.handlerType,e.handlerIds,t)}}async processSuiEvent(e){if(!e.data?.suiEvent)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"Event can't be empty");let t=[],r=e.data.suiEvent;for(let o of e.handlerIds)t.push(this.handlerRegister.getHandlerById(e.chainId,o)(r).catch(s=>{throw new u.ServerError(u.Status.INTERNAL,"error processing event: "+JSON.stringify(r)+`
|
|
3
|
+
`+Le(s))}));return Ve(await Promise.all(t))}async processSuiFunctionCall(e){if(!e.data?.suiCall)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"Call can't be empty");let t=e.data.suiCall,r=[];for(let o of e.handlerIds){let s=this.handlerRegister.getHandlerById(e.chainId,o)(t).catch(i=>{throw new u.ServerError(u.Status.INTERNAL,"error processing call: "+JSON.stringify(t)+`
|
|
4
|
+
`+Le(i))});r.push(s)}return Ve(await Promise.all(r))}async processSuiObject(e){if(!e.data?.suiObject)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"Object can't be empty");let t=e.data.suiObject,r=[];for(let o of e.handlerIds)r.push(this.handlerRegister.getHandlerById(e.chainId,o)(t).catch(s=>{throw new u.ServerError(u.Status.INTERNAL,"error processing object: "+JSON.stringify(t)+`
|
|
5
|
+
`+Le(s))}));return Ve(await Promise.all(r))}async processSuiObjectChange(e){if(!e.data?.suiObjectChange)throw new u.ServerError(u.Status.INVALID_ARGUMENT,"Object change can't be empty");let t=e.data.suiObjectChange,r=[];for(let o of e.handlerIds)r.push(this.handlerRegister.getHandlerById(e.chainId,o)(t).catch(s=>{throw new u.ServerError(u.Status.INTERNAL,"error processing object change: "+JSON.stringify(t)+`
|
|
6
|
+
`+Le(s))}));return Ve(await Promise.all(r))}};on.INSTANCE.register(new Ue);var la=new w("",sn.SUI_MAINNET,"",new Date,0n,{},0,{});import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));export{To as a,yo as b,vo as c,xo as d,jo as e,No as f,Mo as g,Ao as h,ko as i,Po as j,Eo as k,Do as l,V as m,Qt as n,ie as o,E as p,se as q,it as r,Be as s,st as t,we as u,ht as v,mt as w,Y as x,Ie as y,at as z,Se as A,lt as B,ut as C,pt as D,an as E,dn as F,ln as G,un as H,pn as I,fn as J,hn as K,mn as L,gn as M,bn as N,Cn as O,In as P,L as Q,Lt as R,ee as S,w as T,te as U,We as V,Pe as W,Ye as X,fe as Y,qe as Z,Qe as _,K as $,me as aa,ze as ba,ge as ca,et as da,tt as ea,nt as fa,Ue as ga,ft as ha};
|
|
7
|
+
//# sourceMappingURL=chunk-67VWORXP.js.map
|