@sentio/sdk-bundle 2.41.4 → 2.41.5
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/btc/index.js +1 -1
- package/lib/{chunk-SDJOH3KH.js → chunk-3C4YSA42.js} +2 -2
- package/lib/{chunk-QRNQPRH4.js → chunk-3KK6D6YO.js} +2 -2
- package/lib/{chunk-7IA5RTOB.js → chunk-4ACVSPIF.js} +2 -2
- package/lib/{chunk-GPETITBA.js → chunk-4QS3NUUW.js} +2 -2
- package/lib/{chunk-WL4SNWT6.js → chunk-BVDLKPY7.js} +2 -2
- package/lib/{chunk-63HPJECU.js → chunk-CJVPUD6U.js} +2 -2
- package/lib/{chunk-5WEQ4PSE.js → chunk-CSVBDVD7.js} +2 -2
- package/lib/{chunk-JGYBNJHX.js → chunk-JTQMVYTS.js} +9 -9
- package/lib/{chunk-JGYBNJHX.js.map → chunk-JTQMVYTS.js.map} +1 -1
- package/lib/{chunk-KY7NG4ER.js → chunk-KY5AFKV5.js} +2 -2
- package/lib/{chunk-RYFT36S5.js → chunk-LCUGDGMN.js} +2 -2
- package/lib/{chunk-5WM5D6EI.js → chunk-MGIOFRXM.js} +2 -2
- package/lib/{chunk-R7S4ZNCQ.js → chunk-PSYYSAEX.js} +2 -2
- package/lib/{chunk-EL6CQHDY.js → chunk-RDBX2EIJ.js} +2 -2
- package/lib/{chunk-SPZVAGFS.js → chunk-VEVTWG5S.js} +2 -2
- package/lib/{chunk-G6D6EDWO.js → chunk-VM5J6G66.js} +2 -2
- package/lib/{chunk-T5A3YPP2.js → chunk-X7K74U6O.js} +2 -2
- package/lib/{chunk-WGFT7DSU.js → chunk-XYISSQEU.js} +2 -2
- package/lib/{chunk-IQNZE4RM.js → chunk-XZRRBRMQ.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/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/lib/{chunk-SDJOH3KH.js.map → chunk-3C4YSA42.js.map} +0 -0
- /package/lib/{chunk-QRNQPRH4.js.map → chunk-3KK6D6YO.js.map} +0 -0
- /package/lib/{chunk-7IA5RTOB.js.map → chunk-4ACVSPIF.js.map} +0 -0
- /package/lib/{chunk-GPETITBA.js.map → chunk-4QS3NUUW.js.map} +0 -0
- /package/lib/{chunk-WL4SNWT6.js.map → chunk-BVDLKPY7.js.map} +0 -0
- /package/lib/{chunk-63HPJECU.js.map → chunk-CJVPUD6U.js.map} +0 -0
- /package/lib/{chunk-5WEQ4PSE.js.map → chunk-CSVBDVD7.js.map} +0 -0
- /package/lib/{chunk-KY7NG4ER.js.map → chunk-KY5AFKV5.js.map} +0 -0
- /package/lib/{chunk-RYFT36S5.js.map → chunk-LCUGDGMN.js.map} +0 -0
- /package/lib/{chunk-5WM5D6EI.js.map → chunk-MGIOFRXM.js.map} +0 -0
- /package/lib/{chunk-R7S4ZNCQ.js.map → chunk-PSYYSAEX.js.map} +0 -0
- /package/lib/{chunk-EL6CQHDY.js.map → chunk-RDBX2EIJ.js.map} +0 -0
- /package/lib/{chunk-SPZVAGFS.js.map → chunk-VEVTWG5S.js.map} +0 -0
- /package/lib/{chunk-G6D6EDWO.js.map → chunk-VM5J6G66.js.map} +0 -0
- /package/lib/{chunk-T5A3YPP2.js.map → chunk-X7K74U6O.js.map} +0 -0
- /package/lib/{chunk-WGFT7DSU.js.map → chunk-XYISSQEU.js.map} +0 -0
- /package/lib/{chunk-IQNZE4RM.js.map → chunk-XZRRBRMQ.js.map} +0 -0
package/lib/sui/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
|
2
|
-
import{a as e,b as f,c as g,d as h,e as i,f as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t}from"../chunk-
|
|
2
|
+
import{a as e,b as f,c as g,d as h,e as i,f as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t}from"../chunk-X7K74U6O.js";import"../chunk-3C4YSA42.js";import"../chunk-QCAKDU3Q.js";import{f as b,g as c,h as d}from"../chunk-ZDHGKRIS.js";import"../chunk-F2HFFA4Z.js";import"../chunk-NHARQGR7.js";import"../chunk-PE6MZT4O.js";import"../chunk-KY5AFKV5.js";import"../chunk-4ACVSPIF.js";import{q as a}from"../chunk-KBIQLRRR.js";import"../chunk-LBLFXPCY.js";import"../chunk-LCUGDGMN.js";import"../chunk-3KK6D6YO.js";import"../chunk-4QS3NUUW.js";import"../chunk-2GOCSOX5.js";import"../chunk-7HVQTJAO.js";import"../chunk-JTQMVYTS.js";import"../chunk-TW3ZXDJC.js";import"../chunk-PLLN42GP.js";import"../chunk-NMFPLO65.js";import"../chunk-K6FJLTBX.js";import"../chunk-GQE2JYJW.js";import"../chunk-DJQ5RDDN.js";import"../chunk-FC546GTB.js";import"../chunk-LLHU72AA.js";export{a as BUILTIN_TYPES,e as MoveCoder,i as SuiAddressContext,n as SuiAddressProcessor,q as SuiAddressProcessorTemplate,k as SuiBaseProcessor,g as SuiContext,m as SuiGlobalProcessor,l as SuiModulesProcessor,b as SuiNetwork,h as SuiObjectChangeContext,j as SuiObjectContext,o as SuiObjectProcessor,r as SuiObjectProcessorTemplate,t as SuiPlugin,p as SuiWrappedObjectProcessor,s as SuiWrappedObjectProcessorTemplate,f as defaultMoveCoder,c as getClient,d as getRpcEndpoint};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/testing/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
|
2
|
-
import{b as F}from"../chunk-EL6CQHDY.js";import"../chunk-SPZVAGFS.js";import{g as _}from"../chunk-T5A3YPP2.js";import"../chunk-SDJOH3KH.js";import"../chunk-QCAKDU3Q.js";import{f as g}from"../chunk-ZDHGKRIS.js";import"../chunk-WL4SNWT6.js";import{c as T}from"../chunk-WFUK2UMU.js";import"../chunk-3FX7DHPT.js";import"../chunk-SSMP6EWG.js";import"../chunk-F2HFFA4Z.js";import"../chunk-NHARQGR7.js";import"../chunk-PE6MZT4O.js";import{d as M}from"../chunk-KY7NG4ER.js";import"../chunk-PNA6LFOX.js";import"../chunk-7IA5RTOB.js";import{a as D,d as u,n as E}from"../chunk-KBIQLRRR.js";import"../chunk-LBLFXPCY.js";import"../chunk-RYFT36S5.js";import"../chunk-QRNQPRH4.js";import"../chunk-GPETITBA.js";import"../chunk-2GOCSOX5.js";import{a as m}from"../chunk-7HVQTJAO.js";import{D as a}from"../chunk-JGYBNJHX.js";import"../chunk-TW3ZXDJC.js";import"../chunk-PLLN42GP.js";import"../chunk-NMFPLO65.js";import"../chunk-K6FJLTBX.js";import"../chunk-GQE2JYJW.js";import"../chunk-DJQ5RDDN.js";import{a as L}from"../chunk-FC546GTB.js";import{e as h}from"../chunk-LLHU72AA.js";var U=h(m(),1);import{Endpoints as q,ProcessorServiceImpl as G,State as j}from"@sentio/runtime";var I=class{server;constructor(e){this.server=e}testEntryFunctionCall(e,t=T.MAIN_NET){return this.testEntryFunctionCalls([e],t)}testEntryFunctionCalls(e,t=T.MAIN_NET){let n=[];for(let r of e){let s=this.buildEntryFunctionCallBinding(r,t);if(!s)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(e,t=T.MAIN_NET){let n=e.payload;for(let r of this.server.contractConfigs)if(r.contract?.chainId===t){for(let s of r.moveCallConfigs)for(let o of s.filters)if(u(r.contract.address)+"::"+o.function===n.function)return{data:{aptCall:{transaction:e}},handlerIds:[s.handlerId],handlerType:a.APT_CALL}}}testEvent(e,t=T.MAIN_NET){let n=this.buildEventBinding(e,t);if(!n)throw Error("Invalid test event: "+JSON.stringify(e));return this.server.processBinding(n)}buildEventBinding(e,t=T.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===t){for(let r of n.moveEventConfigs)for(let s of r.filters)for(let o of e.events)if(u(n.contract.address)+"::"+s.type===E(o.type).qname)return{data:{aptEvent:{transaction:e}},handlerIds:[r.handlerId],handlerType:a.APT_EVENT}}}};var v=class{server;constructor(e){this.server=e}testInstructions(e){return this.server.processBindings({bindings:e.map(t=>({data:{raw:new Uint8Array,solInstruction:t},handlerIds:[],handlerType:a.SOL_INSTRUCTION}))})}};var f=h(m(),1),B=class{server;constructor(e){this.server=e}testTrace(e,t=f.EthChainId.ETHEREUM){return this.testTraces([e],t)}testTraces(e,t=f.EthChainId.ETHEREUM){let n=[];for(let r of e){let s=this.buildTraceBinding(r,t);if(!s)throw Error("Invalid test trace: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildTraceBinding(e,t=f.EthChainId.ETHEREUM){if(e.type!=="call"||!e.action.input)throw Error("Invalid test trace: "+JSON.stringify(e));let n=e.action.input.slice(0,10);for(let r of this.server.contractConfigs)if(r.contract?.chainId===t&&!(e.action.to?.toLowerCase()!==r.contract?.address.toLowerCase()&&r.contract?.address!=="*")){for(let s of r.traceConfigs)if(s.signature==n)return{data:{ethTrace:{trace:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.ETH_TRACE}}}testLog(e,t=f.EthChainId.ETHEREUM){return this.testLogs([e],t)}testLogs(e,t=f.EthChainId.ETHEREUM){let n=[];for(let r of e){let s=this.buildLogBinding(r,t);if(!s)throw Error("Invalid test log: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildLogBinding(e,t=f.EthChainId.ETHEREUM){for(let n of this.server.contractConfigs)if(n.contract?.chainId===t&&!(e.address.toLowerCase()!==n.contract?.address.toLowerCase()&&n.contract?.address!=="*"))for(let r of n.logConfigs)for(let s of r.filters){let o=!0;for(let c in s.topics){let d=e.topics[c],l=s.topics[c].hashes;if(l.length!==0&&!l.find(p=>p.toLowerCase()===d.toLowerCase())){o=!1;break}}if(o)return{data:{ethLog:{log:e,timestamp:new Date}},handlerIds:[r.handlerId],handlerType:a.ETH_LOG}}}testAccountLog(e,t,n=f.EthChainId.ETHEREUM){return this.testAccountLogs(e,[t],n)}testAccountLogs(e,t,n=f.EthChainId.ETHEREUM){let r=[];for(let s of t){let o=this.buildAccountLogBinding(e,s,n);if(!o)throw Error("Invalid test log: "+JSON.stringify(s));r.push(o)}return this.server.processBindings({bindings:r})}buildAccountLogBinding(e,t,n=f.EthChainId.ETHEREUM){for(let r of this.server.accountConfigs)if(r.chainId===n&&e.toLowerCase()===r.address.toLowerCase())for(let s of r.logConfigs)for(let o of s.filters){let c=!0;for(let d in o.topics){let l=t.topics[d],p=o.topics[d].hashes;if(p.length!==0&&!p.find(w=>w.toLowerCase()===l.toLowerCase())){c=!1;break}}if(c)return{data:{ethLog:{log:t,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.ETH_LOG}}}testBlock(e,t=f.EthChainId.ETHEREUM){return this.testBlocks([e],t)}testBlocks(e,t=f.EthChainId.ETHEREUM){let n=[];for(let r of e){let s=this.buildBlockBinding(r,t);if(!s)throw Error("Invalid test block: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildBlockBinding(e,t=f.EthChainId.ETHEREUM){let n={data:{ethBlock:{block:e}},handlerType:a.ETH_BLOCK,handlerIds:[]};for(let r of this.server.contractConfigs){if(r.contract?.chainId!==t)continue;let s=e.number;if(!(s<r.startBlock)&&!(r.endBlock!==0n&&s>=r.endBlock))for(let o of r.intervalConfigs)n.handlerIds.push(o.handlerId)}return n}};var S=class{server;constructor(e){this.server=e}testEntryFunctionCall(e,t=g.MAIN_NET){return this.testEntryFunctionCalls([e],t)}testEntryFunctionCalls(e,t=g.MAIN_NET){let n=[];for(let r of e){let s=this.buildEntryFunctionCallBinding(r,t);if(!s)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(e,t=g.MAIN_NET){let n=_(e);for(let r of n){let s=[u(r.package),r.module,r.function].join(D);for(let o of this.server.contractConfigs)if(o.contract?.chainId===t){for(let c of o.moveCallConfigs)for(let d of c.filters)if(u(o.contract.address)+"::"+d.function===s)return{data:{suiCall:{transaction:e,timestamp:new Date,slot:10000n}},handlerIds:[c.handlerId],handlerType:a.SUI_CALL}}}}testEvent(e,t=g.MAIN_NET){let n=this.buildEventBinding(e,t);if(!n)throw Error("Invalid test event: "+JSON.stringify(e));return this.server.processBinding(n)}testGlobalTransaction(e,t=g.MAIN_NET){let n=[];for(let s of this.server.contractConfigs)if(s.contract?.address==="*")for(let o of s.moveCallConfigs)o.filters.length===1&&o.filters[0].function===""&&n.push(o.handlerId);if(n.length===0)throw Error("Invalid test global transaction: "+JSON.stringify(e));let r={handlerIds:n,handlerType:a.SUI_CALL,data:{suiCall:{transaction:e,timestamp:e.timestampMs?new Date(e.timestampMs):new Date,slot:BigInt(e.checkpoint||0)}}};return this.server.processBinding(r)}buildEventBinding(e,t=g.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===t){for(let r of n.moveEventConfigs)for(let s of r.filters)for(let o of e.events||[])if(u(n.contract.address)+"::"+s.type===E(o.type).qname)return{data:{suiEvent:{transaction:e,timestamp:new Date(e.timestampMs||0),slot:10000n}},handlerIds:[r.handlerId],handlerType:a.SUI_EVENT}}}};var N=class{server;constructor(e){this.server=e}testOnTransaction(e,t=F.TEST_NET){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===t){for(let s of r.fuelCallConfigs){let o={data:{fuelCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.FUEL_CALL},c=s.filters[0]?.function;if(c)for(let d of e.status.receipts||[])d.receiptType=="CALL"&&d.param1==c&&n.push(o);else n.push(o)}for(let s of r.fuelLogConfigs){let o={data:{fuelCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.FUEL_CALL},c=s.logIds;for(let d of e.status.receipts||[])if((d.receiptType=="LOG"||d.receiptType=="LOG_DATA")&&c.includes(d.rb)){n.push(o);break}}for(let s of r.assetConfigs){let o={data:{fuelCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.FUEL_CALL};n.push(o)}}return n}};var R=h(m(),1),x={INJECTIVE_MAINNET:R.CosmosChainId.INJECTIVE_MAINNET,INJECTIVE_TESTNET:R.CosmosChainId.INJECTIVE_TESTNET};var P=class{server;constructor(e){this.server=e}testOnTransaction(e,t=x.INJECTIVE_TESTNET){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===t)for(let s of r.cosmosLogConfigs){let o={data:{cosmosCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.COSMOS_CALL},c=s.logFilters;for(let d of e.logs||[])if(d.events.find(l=>c.includes(l.type))){n.push(o);break}}return n}};var O=h(m(),1),y=class{server;constructor(e){this.server=e}testOnEvents(e,t=O.StarknetChainId.STARKNET_SEPOLIA){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test : "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[],r=Array.isArray(e)?e:[e];for(let s of r)for(let o of this.server.contractConfigs)if(o.contract?.chainId===t)for(let c of o.starknetEventConfigs){let d={data:{starknetEvents:{result:s,timestamp:new Date}},handlerIds:[c.handlerId],handlerType:a.STARKNET_EVENT},l=c.filters,p=s.keys;for(let w of p)for(let J of l)if(J.keys.includes(w))return n.push(d),n}return n}};var H=h(m(),1);var b=class{server;constructor(e){this.server=e}testOnTransactions(e,t=H.BTCChainId.BTC_TESTNET){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test : "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===t)for(let s of r.btcTransactionConfigs){let o={data:{btcTransaction:e},handlerIds:[s.handlerId],handlerType:a.BTC_TRANSACTION};n.push(o)}return n}};var C={};function K(){j.reset()}var k=class{service;contractConfigs;accountConfigs;aptos;eth;solana;sui;fuel;cosmos;starknet;btc;constructor(e,t={}){K(),this.service=new G(e),this.aptos=new I(this),this.solana=new v(this),this.eth=new B(this),this.sui=new S(this),this.fuel=new N(this),this.cosmos=new P(this),this.starknet=new y(this),this.btc=new b(this);for(let n in U.CHAIN_MAP){let r=t[n]||"";q.INSTANCE.chainServer.set(n,r)}}async start(e={templateInstances:[]},t=C){let n=await this.service.start(e,t),r=await this.getConfig({});return this.contractConfigs=r.contractConfigs,this.accountConfigs=r.accountConfigs,n}stop(e,t=C){return this.service.stop(e,t)}getConfig(e,t=C){return this.service.getConfig(e,t)}processBindings(e,t=C){return this.service.processBindings(e,t)}processBinding(e,t=C){return this.service.processBindings({bindings:[e]},t)}processBindingsStream(e,t){throw new Error("Method not implemented.")}preprocessBindingsStream(e,t){throw new Error("Method not implemented.")}};function A(i){if(i!==void 0){if(i.doubleValue!==void 0)return i.doubleValue;if(i.bigInteger!==void 0){let e=M(i.bigInteger.data);return i.bigInteger.negative&&(e=-e),e}if(i.bigDecimal!==void 0)return new L(i.bigDecimal)}}function X(i,e){if(i){for(let t of i.counters)if(t.metadata?.name===e)return A(t.metricValue)}}function z(i,e){if(i){for(let t of i.gauges)if(t.metadata?.name===e)return A(t.metricValue)}}var V=h(m(),1);import{Endpoints as Q}from"@sentio/runtime";function W(i){let e=[];Array.isArray(i)||(i=[i]);for(let t of Object.keys(V.CHAIN_MAP)){let n="TEST_ENDPOINT_"+t,r=process.env[n];r&&(e.push(t),Q.INSTANCE.chainServer.set(t,r))}for(let t of i)if(!e.includes(t))return!1;return!0}export{A as MetricValueToNumber,k as TestProcessorServer,X as firstCounterValue,z as firstGaugeValue,W as loadTestProvidersFromEnv};
|
|
2
|
+
import{b as F}from"../chunk-RDBX2EIJ.js";import"../chunk-VEVTWG5S.js";import{g as _}from"../chunk-X7K74U6O.js";import"../chunk-3C4YSA42.js";import"../chunk-QCAKDU3Q.js";import{f as g}from"../chunk-ZDHGKRIS.js";import"../chunk-BVDLKPY7.js";import{c as T}from"../chunk-WFUK2UMU.js";import"../chunk-3FX7DHPT.js";import"../chunk-SSMP6EWG.js";import"../chunk-F2HFFA4Z.js";import"../chunk-NHARQGR7.js";import"../chunk-PE6MZT4O.js";import{d as M}from"../chunk-KY5AFKV5.js";import"../chunk-PNA6LFOX.js";import"../chunk-4ACVSPIF.js";import{a as D,d as u,n as E}from"../chunk-KBIQLRRR.js";import"../chunk-LBLFXPCY.js";import"../chunk-LCUGDGMN.js";import"../chunk-3KK6D6YO.js";import"../chunk-4QS3NUUW.js";import"../chunk-2GOCSOX5.js";import{a as m}from"../chunk-7HVQTJAO.js";import{D as a}from"../chunk-JTQMVYTS.js";import"../chunk-TW3ZXDJC.js";import"../chunk-PLLN42GP.js";import"../chunk-NMFPLO65.js";import"../chunk-K6FJLTBX.js";import"../chunk-GQE2JYJW.js";import"../chunk-DJQ5RDDN.js";import{a as L}from"../chunk-FC546GTB.js";import{e as h}from"../chunk-LLHU72AA.js";var U=h(m(),1);import{Endpoints as q,ProcessorServiceImpl as G,State as j}from"@sentio/runtime";var I=class{server;constructor(e){this.server=e}testEntryFunctionCall(e,t=T.MAIN_NET){return this.testEntryFunctionCalls([e],t)}testEntryFunctionCalls(e,t=T.MAIN_NET){let n=[];for(let r of e){let s=this.buildEntryFunctionCallBinding(r,t);if(!s)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(e,t=T.MAIN_NET){let n=e.payload;for(let r of this.server.contractConfigs)if(r.contract?.chainId===t){for(let s of r.moveCallConfigs)for(let o of s.filters)if(u(r.contract.address)+"::"+o.function===n.function)return{data:{aptCall:{transaction:e}},handlerIds:[s.handlerId],handlerType:a.APT_CALL}}}testEvent(e,t=T.MAIN_NET){let n=this.buildEventBinding(e,t);if(!n)throw Error("Invalid test event: "+JSON.stringify(e));return this.server.processBinding(n)}buildEventBinding(e,t=T.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===t){for(let r of n.moveEventConfigs)for(let s of r.filters)for(let o of e.events)if(u(n.contract.address)+"::"+s.type===E(o.type).qname)return{data:{aptEvent:{transaction:e}},handlerIds:[r.handlerId],handlerType:a.APT_EVENT}}}};var v=class{server;constructor(e){this.server=e}testInstructions(e){return this.server.processBindings({bindings:e.map(t=>({data:{raw:new Uint8Array,solInstruction:t},handlerIds:[],handlerType:a.SOL_INSTRUCTION}))})}};var f=h(m(),1),B=class{server;constructor(e){this.server=e}testTrace(e,t=f.EthChainId.ETHEREUM){return this.testTraces([e],t)}testTraces(e,t=f.EthChainId.ETHEREUM){let n=[];for(let r of e){let s=this.buildTraceBinding(r,t);if(!s)throw Error("Invalid test trace: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildTraceBinding(e,t=f.EthChainId.ETHEREUM){if(e.type!=="call"||!e.action.input)throw Error("Invalid test trace: "+JSON.stringify(e));let n=e.action.input.slice(0,10);for(let r of this.server.contractConfigs)if(r.contract?.chainId===t&&!(e.action.to?.toLowerCase()!==r.contract?.address.toLowerCase()&&r.contract?.address!=="*")){for(let s of r.traceConfigs)if(s.signature==n)return{data:{ethTrace:{trace:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.ETH_TRACE}}}testLog(e,t=f.EthChainId.ETHEREUM){return this.testLogs([e],t)}testLogs(e,t=f.EthChainId.ETHEREUM){let n=[];for(let r of e){let s=this.buildLogBinding(r,t);if(!s)throw Error("Invalid test log: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildLogBinding(e,t=f.EthChainId.ETHEREUM){for(let n of this.server.contractConfigs)if(n.contract?.chainId===t&&!(e.address.toLowerCase()!==n.contract?.address.toLowerCase()&&n.contract?.address!=="*"))for(let r of n.logConfigs)for(let s of r.filters){let o=!0;for(let c in s.topics){let d=e.topics[c],l=s.topics[c].hashes;if(l.length!==0&&!l.find(p=>p.toLowerCase()===d.toLowerCase())){o=!1;break}}if(o)return{data:{ethLog:{log:e,timestamp:new Date}},handlerIds:[r.handlerId],handlerType:a.ETH_LOG}}}testAccountLog(e,t,n=f.EthChainId.ETHEREUM){return this.testAccountLogs(e,[t],n)}testAccountLogs(e,t,n=f.EthChainId.ETHEREUM){let r=[];for(let s of t){let o=this.buildAccountLogBinding(e,s,n);if(!o)throw Error("Invalid test log: "+JSON.stringify(s));r.push(o)}return this.server.processBindings({bindings:r})}buildAccountLogBinding(e,t,n=f.EthChainId.ETHEREUM){for(let r of this.server.accountConfigs)if(r.chainId===n&&e.toLowerCase()===r.address.toLowerCase())for(let s of r.logConfigs)for(let o of s.filters){let c=!0;for(let d in o.topics){let l=t.topics[d],p=o.topics[d].hashes;if(p.length!==0&&!p.find(w=>w.toLowerCase()===l.toLowerCase())){c=!1;break}}if(c)return{data:{ethLog:{log:t,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.ETH_LOG}}}testBlock(e,t=f.EthChainId.ETHEREUM){return this.testBlocks([e],t)}testBlocks(e,t=f.EthChainId.ETHEREUM){let n=[];for(let r of e){let s=this.buildBlockBinding(r,t);if(!s)throw Error("Invalid test block: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildBlockBinding(e,t=f.EthChainId.ETHEREUM){let n={data:{ethBlock:{block:e}},handlerType:a.ETH_BLOCK,handlerIds:[]};for(let r of this.server.contractConfigs){if(r.contract?.chainId!==t)continue;let s=e.number;if(!(s<r.startBlock)&&!(r.endBlock!==0n&&s>=r.endBlock))for(let o of r.intervalConfigs)n.handlerIds.push(o.handlerId)}return n}};var S=class{server;constructor(e){this.server=e}testEntryFunctionCall(e,t=g.MAIN_NET){return this.testEntryFunctionCalls([e],t)}testEntryFunctionCalls(e,t=g.MAIN_NET){let n=[];for(let r of e){let s=this.buildEntryFunctionCallBinding(r,t);if(!s)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(s)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(e,t=g.MAIN_NET){let n=_(e);for(let r of n){let s=[u(r.package),r.module,r.function].join(D);for(let o of this.server.contractConfigs)if(o.contract?.chainId===t){for(let c of o.moveCallConfigs)for(let d of c.filters)if(u(o.contract.address)+"::"+d.function===s)return{data:{suiCall:{transaction:e,timestamp:new Date,slot:10000n}},handlerIds:[c.handlerId],handlerType:a.SUI_CALL}}}}testEvent(e,t=g.MAIN_NET){let n=this.buildEventBinding(e,t);if(!n)throw Error("Invalid test event: "+JSON.stringify(e));return this.server.processBinding(n)}testGlobalTransaction(e,t=g.MAIN_NET){let n=[];for(let s of this.server.contractConfigs)if(s.contract?.address==="*")for(let o of s.moveCallConfigs)o.filters.length===1&&o.filters[0].function===""&&n.push(o.handlerId);if(n.length===0)throw Error("Invalid test global transaction: "+JSON.stringify(e));let r={handlerIds:n,handlerType:a.SUI_CALL,data:{suiCall:{transaction:e,timestamp:e.timestampMs?new Date(e.timestampMs):new Date,slot:BigInt(e.checkpoint||0)}}};return this.server.processBinding(r)}buildEventBinding(e,t=g.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===t){for(let r of n.moveEventConfigs)for(let s of r.filters)for(let o of e.events||[])if(u(n.contract.address)+"::"+s.type===E(o.type).qname)return{data:{suiEvent:{transaction:e,timestamp:new Date(e.timestampMs||0),slot:10000n}},handlerIds:[r.handlerId],handlerType:a.SUI_EVENT}}}};var N=class{server;constructor(e){this.server=e}testOnTransaction(e,t=F.TEST_NET){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===t){for(let s of r.fuelCallConfigs){let o={data:{fuelCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.FUEL_CALL},c=s.filters[0]?.function;if(c)for(let d of e.status.receipts||[])d.receiptType=="CALL"&&d.param1==c&&n.push(o);else n.push(o)}for(let s of r.fuelLogConfigs){let o={data:{fuelCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.FUEL_CALL},c=s.logIds;for(let d of e.status.receipts||[])if((d.receiptType=="LOG"||d.receiptType=="LOG_DATA")&&c.includes(d.rb)){n.push(o);break}}for(let s of r.assetConfigs){let o={data:{fuelCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.FUEL_CALL};n.push(o)}}return n}};var R=h(m(),1),x={INJECTIVE_MAINNET:R.CosmosChainId.INJECTIVE_MAINNET,INJECTIVE_TESTNET:R.CosmosChainId.INJECTIVE_TESTNET};var P=class{server;constructor(e){this.server=e}testOnTransaction(e,t=x.INJECTIVE_TESTNET){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===t)for(let s of r.cosmosLogConfigs){let o={data:{cosmosCall:{transaction:e,timestamp:new Date}},handlerIds:[s.handlerId],handlerType:a.COSMOS_CALL},c=s.logFilters;for(let d of e.logs||[])if(d.events.find(l=>c.includes(l.type))){n.push(o);break}}return n}};var O=h(m(),1),y=class{server;constructor(e){this.server=e}testOnEvents(e,t=O.StarknetChainId.STARKNET_SEPOLIA){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test : "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[],r=Array.isArray(e)?e:[e];for(let s of r)for(let o of this.server.contractConfigs)if(o.contract?.chainId===t)for(let c of o.starknetEventConfigs){let d={data:{starknetEvents:{result:s,timestamp:new Date}},handlerIds:[c.handlerId],handlerType:a.STARKNET_EVENT},l=c.filters,p=s.keys;for(let w of p)for(let J of l)if(J.keys.includes(w))return n.push(d),n}return n}};var H=h(m(),1);var b=class{server;constructor(e){this.server=e}testOnTransactions(e,t=H.BTCChainId.BTC_TESTNET){let n=this.buildBinding(e,t);if(!n)throw Error("Invalid test : "+JSON.stringify(e));return this.server.processBindings({bindings:n})}buildBinding(e,t){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===t)for(let s of r.btcTransactionConfigs){let o={data:{btcTransaction:e},handlerIds:[s.handlerId],handlerType:a.BTC_TRANSACTION};n.push(o)}return n}};var C={};function K(){j.reset()}var k=class{service;contractConfigs;accountConfigs;aptos;eth;solana;sui;fuel;cosmos;starknet;btc;constructor(e,t={}){K(),this.service=new G(e),this.aptos=new I(this),this.solana=new v(this),this.eth=new B(this),this.sui=new S(this),this.fuel=new N(this),this.cosmos=new P(this),this.starknet=new y(this),this.btc=new b(this);for(let n in U.CHAIN_MAP){let r=t[n]||"";q.INSTANCE.chainServer.set(n,r)}}async start(e={templateInstances:[]},t=C){let n=await this.service.start(e,t),r=await this.getConfig({});return this.contractConfigs=r.contractConfigs,this.accountConfigs=r.accountConfigs,n}stop(e,t=C){return this.service.stop(e,t)}getConfig(e,t=C){return this.service.getConfig(e,t)}processBindings(e,t=C){return this.service.processBindings(e,t)}processBinding(e,t=C){return this.service.processBindings({bindings:[e]},t)}processBindingsStream(e,t){throw new Error("Method not implemented.")}preprocessBindingsStream(e,t){throw new Error("Method not implemented.")}};function A(i){if(i!==void 0){if(i.doubleValue!==void 0)return i.doubleValue;if(i.bigInteger!==void 0){let e=M(i.bigInteger.data);return i.bigInteger.negative&&(e=-e),e}if(i.bigDecimal!==void 0)return new L(i.bigDecimal)}}function X(i,e){if(i){for(let t of i.counters)if(t.metadata?.name===e)return A(t.metricValue)}}function z(i,e){if(i){for(let t of i.gauges)if(t.metadata?.name===e)return A(t.metricValue)}}var V=h(m(),1);import{Endpoints as Q}from"@sentio/runtime";function W(i){let e=[];Array.isArray(i)||(i=[i]);for(let t of Object.keys(V.CHAIN_MAP)){let n="TEST_ENDPOINT_"+t,r=process.env[n];r&&(e.push(t),Q.INSTANCE.chainServer.set(t,r))}for(let t of i)if(!e.includes(t))return!1;return!0}export{A as MetricValueToNumber,k as TestProcessorServer,X as firstCounterValue,z as firstGaugeValue,W as loadTestProvidersFromEnv};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
|
2
|
-
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l}from"../chunk-
|
|
2
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l}from"../chunk-KY5AFKV5.js";import"../chunk-LCUGDGMN.js";import"../chunk-3KK6D6YO.js";import"../chunk-4QS3NUUW.js";import"../chunk-2GOCSOX5.js";import"../chunk-7HVQTJAO.js";import"../chunk-JTQMVYTS.js";import"../chunk-TW3ZXDJC.js";import"../chunk-PLLN42GP.js";import"../chunk-NMFPLO65.js";import"../chunk-K6FJLTBX.js";import"../chunk-GQE2JYJW.js";import"../chunk-DJQ5RDDN.js";import"../chunk-FC546GTB.js";import"../chunk-LLHU72AA.js";export{f as EthereumDexPrice,d as PriceUnit,g as SepoliaDexPrice,b as bytesToBigInt,a as estimateBlockNumberAtDate,k as getCoinsThatHasPrice,e as getPackageRoot,j as getPriceBySymbol,i as getPriceByType,h as getPriceClient,l as ignoreEthCallException,c as token};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentio/sdk-bundle",
|
|
3
|
-
"version": "2.41.
|
|
3
|
+
"version": "2.41.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"!{lib,src}/*/tests"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sentio/runtime": "^2.41.
|
|
51
|
+
"@sentio/runtime": "^2.41.5"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {},
|
|
54
54
|
"devDependencies": {},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|