@sentio/sdk-bundle 2.44.3 → 2.44.4-rc.2
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/codegen/index.js +9 -9
- package/lib/aptos/codegen/index.js.map +1 -1
- package/lib/aptos/ext/index.js +1 -1
- package/lib/aptos/index.js +1 -1
- package/lib/aptos/network.d.ts.map +1 -1
- package/lib/{chunk-JSAYWFRM.js → chunk-6VELGYNR.js} +2 -2
- package/lib/{chunk-Z46LGJE2.js → chunk-ABLESLV7.js} +2 -2
- package/lib/{chunk-LWWZZ3VD.js → chunk-B7YDBLBV.js} +2 -2
- package/lib/{chunk-AZTU3RH7.js → chunk-CPSB2UZQ.js} +2 -2
- package/lib/{chunk-Y6QA2AK2.js → chunk-F7Q5QB6Q.js} +2 -2
- package/lib/{chunk-Z3BDII4O.js → chunk-G3ZGY3OS.js} +2 -2
- package/lib/{chunk-4XUN2MHT.js → chunk-HDNVG6V3.js} +2 -2
- package/lib/{chunk-BTKJOALH.js → chunk-IOV7WAT6.js} +2 -2
- package/lib/{chunk-RCUUZHUG.js → chunk-MAXAKVBP.js} +12 -12
- package/lib/{chunk-RCUUZHUG.js.map → chunk-MAXAKVBP.js.map} +1 -1
- package/lib/{chunk-LTVKTBHO.js → chunk-MB75AKO3.js} +2 -2
- package/lib/{chunk-CNL6UJ7C.js → chunk-QUNXEV6Z.js} +2 -2
- package/lib/{chunk-AQU5WWON.js → chunk-QW2MPHP5.js} +2 -2
- package/lib/{chunk-AQU5WWON.js.map → chunk-QW2MPHP5.js.map} +1 -1
- package/lib/{chunk-YW7MDOGO.js → chunk-RVQBDYQ2.js} +2 -2
- package/lib/{chunk-V7BXBDG7.js → chunk-VO57HTCG.js} +2 -2
- package/lib/{chunk-E333Q3OG.js → chunk-WQV3TSRA.js} +2 -2
- package/lib/{chunk-GR3GN3NC.js → chunk-YVDAQU2U.js} +2 -2
- package/lib/{chunk-TIOVAWYM.js → chunk-YX4LDK5Y.js} +2 -2
- package/lib/{chunk-4ADBI657.js → chunk-ZI5N3H3K.js} +2 -2
- 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/solana/builtin/index.js +1 -1
- package/lib/solana/index.js +1 -1
- package/lib/stark/codegen/index.js +1 -1
- package/lib/stark/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/codegen/index.js +1 -1
- package/lib/sui/ext/index.js +1 -1
- package/lib/sui/index.js +1 -1
- package/lib/testing/index.js +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +2 -2
- package/src/aptos/codegen/codegen.ts +11 -5
- package/src/aptos/network.ts +5 -2
- /package/lib/{chunk-JSAYWFRM.js.map → chunk-6VELGYNR.js.map} +0 -0
- /package/lib/{chunk-Z46LGJE2.js.map → chunk-ABLESLV7.js.map} +0 -0
- /package/lib/{chunk-LWWZZ3VD.js.map → chunk-B7YDBLBV.js.map} +0 -0
- /package/lib/{chunk-AZTU3RH7.js.map → chunk-CPSB2UZQ.js.map} +0 -0
- /package/lib/{chunk-Y6QA2AK2.js.map → chunk-F7Q5QB6Q.js.map} +0 -0
- /package/lib/{chunk-Z3BDII4O.js.map → chunk-G3ZGY3OS.js.map} +0 -0
- /package/lib/{chunk-4XUN2MHT.js.map → chunk-HDNVG6V3.js.map} +0 -0
- /package/lib/{chunk-BTKJOALH.js.map → chunk-IOV7WAT6.js.map} +0 -0
- /package/lib/{chunk-LTVKTBHO.js.map → chunk-MB75AKO3.js.map} +0 -0
- /package/lib/{chunk-CNL6UJ7C.js.map → chunk-QUNXEV6Z.js.map} +0 -0
- /package/lib/{chunk-YW7MDOGO.js.map → chunk-RVQBDYQ2.js.map} +0 -0
- /package/lib/{chunk-V7BXBDG7.js.map → chunk-VO57HTCG.js.map} +0 -0
- /package/lib/{chunk-E333Q3OG.js.map → chunk-WQV3TSRA.js.map} +0 -0
- /package/lib/{chunk-GR3GN3NC.js.map → chunk-YVDAQU2U.js.map} +0 -0
- /package/lib/{chunk-TIOVAWYM.js.map → chunk-YX4LDK5Y.js.map} +0 -0
- /package/lib/{chunk-4ADBI657.js.map → chunk-ZI5N3H3K.js.map} +0 -0
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-4XUN2MHT.js";import"../chunk-E2QT6K2E.js";import{g as _}from"../chunk-CNL6UJ7C.js";import"../chunk-Z46LGJE2.js";import"../chunk-MOVK3WB7.js";import{e as g}from"../chunk-LWWZZ3VD.js";import"../chunk-4ADBI657.js";import{c as T}from"../chunk-RCUUZHUG.js";import"../chunk-7K2CQ73Y.js";import"../chunk-KUHMQRSY.js";import"../chunk-JLRCAHLL.js";import"../chunk-44SAPBRK.js";import"../chunk-P73GOPCF.js";import"../chunk-6GMS6XU7.js";import{b as M}from"../chunk-YW7MDOGO.js";import"../chunk-WQ7UQGQE.js";import"../chunk-W4OBSPHA.js";import{a as D,d as u,n as E}from"../chunk-M7BSUAPO.js";import"../chunk-JSAYWFRM.js";import"../chunk-TIOVAWYM.js";import"../chunk-Y6QA2AK2.js";import"../chunk-OUOSDGWD.js";import{a as m}from"../chunk-AQU5WWON.js";import{D as a}from"../chunk-24SCJPBI.js";import"../chunk-GU4UN43Q.js";import"../chunk-CA6DKOT2.js";import"../chunk-NDC6HDQD.js";import"../chunk-WZLM66YL.js";import"../chunk-2BO4GGPL.js";import{a as L}from"../chunk-FC546GTB.js";import{e as h}from"../chunk-6GD6B22G.js";var U=h(m(),1);import{Endpoints as q,ProcessorServiceImpl as G,State as j}from"@sentio/runtime";var I=class{server;constructor(t){this.server=t}testEntryFunctionCall(t,e=T.MAIN_NET){return this.testEntryFunctionCalls([t],e)}testEntryFunctionCalls(t,e=T.MAIN_NET){let n=[];for(let r of t){let o=this.buildEntryFunctionCallBinding(r,e);if(!o)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(t,e=T.MAIN_NET){let n=t.payload;for(let r of this.server.contractConfigs)if(r.contract?.chainId===e){for(let o of r.moveCallConfigs)for(let i of o.filters)if(u(r.contract.address)+"::"+i.function===n.function)return{data:{aptCall:{transaction:t}},handlerIds:[o.handlerId],handlerType:a.APT_CALL}}}testEvent(t,e=T.MAIN_NET){let n=this.buildEventBinding(t,e);if(!n)throw Error("Invalid test event: "+JSON.stringify(t));return this.server.processBinding(n)}buildEventBinding(t,e=T.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===e){for(let r of n.moveEventConfigs)for(let o of r.filters)for(let i of t.events)if(u(n.contract.address)+"::"+o.type===E(i.type).qname)return{data:{aptEvent:{transaction:t}},handlerIds:[r.handlerId],handlerType:a.APT_EVENT}}}};import("process").then(s=>s.stdout.write(""));var v=class{server;constructor(t){this.server=t}testInstructions(t){return this.server.processBindings({bindings:t.map(e=>({data:{raw:new Uint8Array,solInstruction:e},handlerIds:[],handlerType:a.SOL_INSTRUCTION}))})}};import("process").then(s=>s.stdout.write(""));var f=h(m(),1),B=class{server;constructor(t){this.server=t}testTrace(t,e=f.EthChainId.ETHEREUM){return this.testTraces([t],e)}testTraces(t,e=f.EthChainId.ETHEREUM){let n=[];for(let r of t){let o=this.buildTraceBinding(r,e);if(!o)throw Error("Invalid test trace: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildTraceBinding(t,e=f.EthChainId.ETHEREUM){if(t.type!=="call"||!t.action.input)throw Error("Invalid test trace: "+JSON.stringify(t));let n=t.action.input.slice(0,10);for(let r of this.server.contractConfigs)if(r.contract?.chainId===e&&!(t.action.to?.toLowerCase()!==r.contract?.address.toLowerCase()&&r.contract?.address!=="*")){for(let o of r.traceConfigs)if(o.signature==n)return{data:{ethTrace:{trace:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.ETH_TRACE}}}testLog(t,e=f.EthChainId.ETHEREUM){return this.testLogs([t],e)}testLogs(t,e=f.EthChainId.ETHEREUM){let n=[];for(let r of t){let o=this.buildLogBinding(r,e);if(!o)throw Error("Invalid test log: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildLogBinding(t,e=f.EthChainId.ETHEREUM){for(let n of this.server.contractConfigs)if(n.contract?.chainId===e&&!(t.address.toLowerCase()!==n.contract?.address.toLowerCase()&&n.contract?.address!=="*"))for(let r of n.logConfigs)for(let o of r.filters){let i=!0;for(let c in o.topics){let d=t.topics[c],l=o.topics[c].hashes;if(l.length!==0&&!l.find(p=>p.toLowerCase()===d.toLowerCase())){i=!1;break}}if(i)return{data:{ethLog:{log:t,timestamp:new Date}},handlerIds:[r.handlerId],handlerType:a.ETH_LOG}}}testAccountLog(t,e,n=f.EthChainId.ETHEREUM){return this.testAccountLogs(t,[e],n)}testAccountLogs(t,e,n=f.EthChainId.ETHEREUM){let r=[];for(let o of e){let i=this.buildAccountLogBinding(t,o,n);if(!i)throw Error("Invalid test log: "+JSON.stringify(o));r.push(i)}return this.server.processBindings({bindings:r})}buildAccountLogBinding(t,e,n=f.EthChainId.ETHEREUM){for(let r of this.server.accountConfigs)if(r.chainId===n&&t.toLowerCase()===r.address.toLowerCase())for(let o of r.logConfigs)for(let i of o.filters){let c=!0;for(let d in i.topics){let l=e.topics[d],p=i.topics[d].hashes;if(p.length!==0&&!p.find(w=>w.toLowerCase()===l.toLowerCase())){c=!1;break}}if(c)return{data:{ethLog:{log:e,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.ETH_LOG}}}testBlock(t,e=f.EthChainId.ETHEREUM){return this.testBlocks([t],e)}testBlocks(t,e=f.EthChainId.ETHEREUM){let n=[];for(let r of t){let o=this.buildBlockBinding(r,e);if(!o)throw Error("Invalid test block: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildBlockBinding(t,e=f.EthChainId.ETHEREUM){let n={data:{ethBlock:{block:t}},handlerType:a.ETH_BLOCK,handlerIds:[]};for(let r of this.server.contractConfigs){if(r.contract?.chainId!==e)continue;let o=t.number;if(!(o<r.startBlock)&&!(r.endBlock!==0n&&o>=r.endBlock))for(let i of r.intervalConfigs)n.handlerIds.push(i.handlerId)}return n}};import("process").then(s=>s.stdout.write(""));var S=class{server;constructor(t){this.server=t}testEntryFunctionCall(t,e=g.MAIN_NET){return this.testEntryFunctionCalls([t],e)}testEntryFunctionCalls(t,e=g.MAIN_NET){let n=[];for(let r of t){let o=this.buildEntryFunctionCallBinding(r,e);if(!o)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(t,e=g.MAIN_NET){let n=_(t);for(let r of n){let o=[u(r.package),r.module,r.function].join(D);for(let i of this.server.contractConfigs)if(i.contract?.chainId===e){for(let c of i.moveCallConfigs)for(let d of c.filters)if(u(i.contract.address)+"::"+d.function===o)return{data:{suiCall:{transaction:t,timestamp:new Date,slot:10000n}},handlerIds:[c.handlerId],handlerType:a.SUI_CALL}}}}testEvent(t,e=g.MAIN_NET){let n=this.buildEventBinding(t,e);if(!n)throw Error("Invalid test event: "+JSON.stringify(t));return this.server.processBinding(n)}testGlobalTransaction(t,e=g.MAIN_NET){let n=[];for(let o of this.server.contractConfigs)if(o.contract?.address==="*")for(let i of o.moveCallConfigs)i.filters.length===1&&i.filters[0].function===""&&n.push(i.handlerId);if(n.length===0)throw Error("Invalid test global transaction: "+JSON.stringify(t));let r={handlerIds:n,handlerType:a.SUI_CALL,data:{suiCall:{transaction:t,timestamp:t.timestampMs?new Date(t.timestampMs):new Date,slot:BigInt(t.checkpoint||0)}}};return this.server.processBinding(r)}buildEventBinding(t,e=g.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===e){for(let r of n.moveEventConfigs)for(let o of r.filters)for(let i of t.events||[])if(u(n.contract.address)+"::"+o.type===E(i.type).qname)return{data:{suiEvent:{transaction:t,timestamp:new Date(t.timestampMs||0),slot:10000n}},handlerIds:[r.handlerId],handlerType:a.SUI_EVENT}}}};import("process").then(s=>s.stdout.write(""));var N=class{server;constructor(t){this.server=t}testOnTransaction(t,e=F.TEST_NET){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===e){for(let o of r.fuelCallConfigs){let i={data:{fuelCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.FUEL_CALL},c=o.filters[0]?.function;if(c)for(let d of t.status.receipts||[])d.receiptType=="CALL"&&d.param1==c&&n.push(i);else n.push(i)}for(let o of r.fuelLogConfigs){let i={data:{fuelCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.FUEL_CALL},c=o.logIds;for(let d of t.status.receipts||[])if((d.receiptType=="LOG"||d.receiptType=="LOG_DATA")&&c.includes(d.rb)){n.push(i);break}}for(let o of r.assetConfigs){let i={data:{fuelCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.FUEL_CALL};n.push(i)}}return n}};import("process").then(s=>s.stdout.write(""));var R=h(m(),1),x={INJECTIVE_MAINNET:R.CosmosChainId.INJECTIVE_MAINNET,INJECTIVE_TESTNET:R.CosmosChainId.INJECTIVE_TESTNET};import("process").then(s=>s.stdout.write(""));var P=class{server;constructor(t){this.server=t}testOnTransaction(t,e=x.INJECTIVE_TESTNET){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===e)for(let o of r.cosmosLogConfigs){let i={data:{cosmosCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.COSMOS_CALL},c=o.logFilters;for(let d of t.logs||[])if(d.events.find(l=>c.includes(l.type))){n.push(i);break}}return n}};import("process").then(s=>s.stdout.write(""));var O=h(m(),1),y=class{server;constructor(t){this.server=t}testOnEvents(t,e=O.StarknetChainId.STARKNET_SEPOLIA){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test : "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[],r=Array.isArray(t)?t:[t];for(let o of r)for(let i of this.server.contractConfigs)if(i.contract?.chainId===e)for(let c of i.starknetEventConfigs){let d={data:{starknetEvents:{result:o,timestamp:new Date}},handlerIds:[c.handlerId],handlerType:a.STARKNET_EVENT},l=c.filters,p=o.keys;for(let w of p)for(let J of l)if(J.keys.includes(w))return n.push(d),n}return n}};import("process").then(s=>s.stdout.write(""));var H=h(m(),1);var b=class{server;constructor(t){this.server=t}testOnTransactions(t,e=H.BTCChainId.BTC_TESTNET){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test : "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===e)for(let o of r.btcTransactionConfigs){let i={data:{btcTransaction:t},handlerIds:[o.handlerId],handlerType:a.BTC_TRANSACTION};n.push(i)}return n}};import("process").then(s=>s.stdout.write(""));var C={};function K(){j.reset()}var k=class{service;contractConfigs;accountConfigs;aptos;eth;solana;sui;fuel;cosmos;starknet;btc;constructor(t,e={}){K(),this.service=new G(t),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=e[n]||"";q.INSTANCE.chainServer.set(n,r)}}async start(t={templateInstances:[]},e=C){let n=await this.service.start(t,e),r=await this.getConfig({});return this.contractConfigs=r.contractConfigs,this.accountConfigs=r.accountConfigs,n}stop(t,e=C){return this.service.stop(t,e)}getConfig(t,e=C){return this.service.getConfig(t,e)}processBindings(t,e=C){return this.service.processBindings(t,e)}processBinding(t,e=C){return this.service.processBindings({bindings:[t]},e)}processBindingsStream(t,e){throw new Error("Method not implemented.")}preprocessBindingsStream(t,e){throw new Error("Method not implemented.")}};import("process").then(s=>s.stdout.write(""));function A(s){if(s!==void 0){if(s.doubleValue!==void 0)return s.doubleValue;if(s.bigInteger!==void 0){let t=M(s.bigInteger.data);return s.bigInteger.negative&&(t=-t),t}if(s.bigDecimal!==void 0)return new L(s.bigDecimal)}}function X(s,t){if(s){for(let e of s.counters)if(e.metadata?.name===t)return A(e.metricValue)}}function z(s,t){if(s){for(let e of s.gauges)if(e.metadata?.name===t)return A(e.metricValue)}}import("process").then(s=>s.stdout.write(""));var V=h(m(),1);import{Endpoints as Q}from"@sentio/runtime";function W(s){let t=[];Array.isArray(s)||(s=[s]);for(let e of Object.keys(V.CHAIN_MAP)){let n="TEST_ENDPOINT_"+e,r=process.env[n];r&&(t.push(e),Q.INSTANCE.chainServer.set(e,r))}for(let e of s)if(!t.includes(e))return!1;return!0}import("process").then(s=>s.stdout.write(""));import("process").then(s=>s.stdout.write(""));export{A as MetricValueToNumber,k as TestProcessorServer,X as firstCounterValue,z as firstGaugeValue,W as loadTestProvidersFromEnv};
|
|
2
|
+
import{b as F}from"../chunk-HDNVG6V3.js";import"../chunk-E2QT6K2E.js";import{g as _}from"../chunk-QUNXEV6Z.js";import"../chunk-ABLESLV7.js";import"../chunk-MOVK3WB7.js";import{e as g}from"../chunk-B7YDBLBV.js";import"../chunk-ZI5N3H3K.js";import{c as T}from"../chunk-MAXAKVBP.js";import"../chunk-7K2CQ73Y.js";import"../chunk-KUHMQRSY.js";import"../chunk-JLRCAHLL.js";import"../chunk-44SAPBRK.js";import"../chunk-P73GOPCF.js";import"../chunk-6GMS6XU7.js";import{b as M}from"../chunk-RVQBDYQ2.js";import"../chunk-WQ7UQGQE.js";import"../chunk-W4OBSPHA.js";import{a as D,d as u,n as E}from"../chunk-M7BSUAPO.js";import"../chunk-6VELGYNR.js";import"../chunk-YX4LDK5Y.js";import"../chunk-F7Q5QB6Q.js";import"../chunk-OUOSDGWD.js";import{a as m}from"../chunk-QW2MPHP5.js";import{D as a}from"../chunk-24SCJPBI.js";import"../chunk-GU4UN43Q.js";import"../chunk-CA6DKOT2.js";import"../chunk-NDC6HDQD.js";import"../chunk-WZLM66YL.js";import"../chunk-2BO4GGPL.js";import{a as L}from"../chunk-FC546GTB.js";import{e as h}from"../chunk-6GD6B22G.js";var U=h(m(),1);import{Endpoints as q,ProcessorServiceImpl as G,State as j}from"@sentio/runtime";var I=class{server;constructor(t){this.server=t}testEntryFunctionCall(t,e=T.MAIN_NET){return this.testEntryFunctionCalls([t],e)}testEntryFunctionCalls(t,e=T.MAIN_NET){let n=[];for(let r of t){let o=this.buildEntryFunctionCallBinding(r,e);if(!o)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(t,e=T.MAIN_NET){let n=t.payload;for(let r of this.server.contractConfigs)if(r.contract?.chainId===e){for(let o of r.moveCallConfigs)for(let i of o.filters)if(u(r.contract.address)+"::"+i.function===n.function)return{data:{aptCall:{transaction:t}},handlerIds:[o.handlerId],handlerType:a.APT_CALL}}}testEvent(t,e=T.MAIN_NET){let n=this.buildEventBinding(t,e);if(!n)throw Error("Invalid test event: "+JSON.stringify(t));return this.server.processBinding(n)}buildEventBinding(t,e=T.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===e){for(let r of n.moveEventConfigs)for(let o of r.filters)for(let i of t.events)if(u(n.contract.address)+"::"+o.type===E(i.type).qname)return{data:{aptEvent:{transaction:t}},handlerIds:[r.handlerId],handlerType:a.APT_EVENT}}}};import("process").then(s=>s.stdout.write(""));var v=class{server;constructor(t){this.server=t}testInstructions(t){return this.server.processBindings({bindings:t.map(e=>({data:{raw:new Uint8Array,solInstruction:e},handlerIds:[],handlerType:a.SOL_INSTRUCTION}))})}};import("process").then(s=>s.stdout.write(""));var f=h(m(),1),B=class{server;constructor(t){this.server=t}testTrace(t,e=f.EthChainId.ETHEREUM){return this.testTraces([t],e)}testTraces(t,e=f.EthChainId.ETHEREUM){let n=[];for(let r of t){let o=this.buildTraceBinding(r,e);if(!o)throw Error("Invalid test trace: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildTraceBinding(t,e=f.EthChainId.ETHEREUM){if(t.type!=="call"||!t.action.input)throw Error("Invalid test trace: "+JSON.stringify(t));let n=t.action.input.slice(0,10);for(let r of this.server.contractConfigs)if(r.contract?.chainId===e&&!(t.action.to?.toLowerCase()!==r.contract?.address.toLowerCase()&&r.contract?.address!=="*")){for(let o of r.traceConfigs)if(o.signature==n)return{data:{ethTrace:{trace:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.ETH_TRACE}}}testLog(t,e=f.EthChainId.ETHEREUM){return this.testLogs([t],e)}testLogs(t,e=f.EthChainId.ETHEREUM){let n=[];for(let r of t){let o=this.buildLogBinding(r,e);if(!o)throw Error("Invalid test log: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildLogBinding(t,e=f.EthChainId.ETHEREUM){for(let n of this.server.contractConfigs)if(n.contract?.chainId===e&&!(t.address.toLowerCase()!==n.contract?.address.toLowerCase()&&n.contract?.address!=="*"))for(let r of n.logConfigs)for(let o of r.filters){let i=!0;for(let c in o.topics){let d=t.topics[c],l=o.topics[c].hashes;if(l.length!==0&&!l.find(p=>p.toLowerCase()===d.toLowerCase())){i=!1;break}}if(i)return{data:{ethLog:{log:t,timestamp:new Date}},handlerIds:[r.handlerId],handlerType:a.ETH_LOG}}}testAccountLog(t,e,n=f.EthChainId.ETHEREUM){return this.testAccountLogs(t,[e],n)}testAccountLogs(t,e,n=f.EthChainId.ETHEREUM){let r=[];for(let o of e){let i=this.buildAccountLogBinding(t,o,n);if(!i)throw Error("Invalid test log: "+JSON.stringify(o));r.push(i)}return this.server.processBindings({bindings:r})}buildAccountLogBinding(t,e,n=f.EthChainId.ETHEREUM){for(let r of this.server.accountConfigs)if(r.chainId===n&&t.toLowerCase()===r.address.toLowerCase())for(let o of r.logConfigs)for(let i of o.filters){let c=!0;for(let d in i.topics){let l=e.topics[d],p=i.topics[d].hashes;if(p.length!==0&&!p.find(w=>w.toLowerCase()===l.toLowerCase())){c=!1;break}}if(c)return{data:{ethLog:{log:e,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.ETH_LOG}}}testBlock(t,e=f.EthChainId.ETHEREUM){return this.testBlocks([t],e)}testBlocks(t,e=f.EthChainId.ETHEREUM){let n=[];for(let r of t){let o=this.buildBlockBinding(r,e);if(!o)throw Error("Invalid test block: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildBlockBinding(t,e=f.EthChainId.ETHEREUM){let n={data:{ethBlock:{block:t}},handlerType:a.ETH_BLOCK,handlerIds:[]};for(let r of this.server.contractConfigs){if(r.contract?.chainId!==e)continue;let o=t.number;if(!(o<r.startBlock)&&!(r.endBlock!==0n&&o>=r.endBlock))for(let i of r.intervalConfigs)n.handlerIds.push(i.handlerId)}return n}};import("process").then(s=>s.stdout.write(""));var S=class{server;constructor(t){this.server=t}testEntryFunctionCall(t,e=g.MAIN_NET){return this.testEntryFunctionCalls([t],e)}testEntryFunctionCalls(t,e=g.MAIN_NET){let n=[];for(let r of t){let o=this.buildEntryFunctionCallBinding(r,e);if(!o)throw Error("Invalid test transaction: "+JSON.stringify(r));n.push(o)}return this.server.processBindings({bindings:n})}buildEntryFunctionCallBinding(t,e=g.MAIN_NET){let n=_(t);for(let r of n){let o=[u(r.package),r.module,r.function].join(D);for(let i of this.server.contractConfigs)if(i.contract?.chainId===e){for(let c of i.moveCallConfigs)for(let d of c.filters)if(u(i.contract.address)+"::"+d.function===o)return{data:{suiCall:{transaction:t,timestamp:new Date,slot:10000n}},handlerIds:[c.handlerId],handlerType:a.SUI_CALL}}}}testEvent(t,e=g.MAIN_NET){let n=this.buildEventBinding(t,e);if(!n)throw Error("Invalid test event: "+JSON.stringify(t));return this.server.processBinding(n)}testGlobalTransaction(t,e=g.MAIN_NET){let n=[];for(let o of this.server.contractConfigs)if(o.contract?.address==="*")for(let i of o.moveCallConfigs)i.filters.length===1&&i.filters[0].function===""&&n.push(i.handlerId);if(n.length===0)throw Error("Invalid test global transaction: "+JSON.stringify(t));let r={handlerIds:n,handlerType:a.SUI_CALL,data:{suiCall:{transaction:t,timestamp:t.timestampMs?new Date(t.timestampMs):new Date,slot:BigInt(t.checkpoint||0)}}};return this.server.processBinding(r)}buildEventBinding(t,e=g.MAIN_NET){for(let n of this.server.contractConfigs)if(n.contract?.chainId===e){for(let r of n.moveEventConfigs)for(let o of r.filters)for(let i of t.events||[])if(u(n.contract.address)+"::"+o.type===E(i.type).qname)return{data:{suiEvent:{transaction:t,timestamp:new Date(t.timestampMs||0),slot:10000n}},handlerIds:[r.handlerId],handlerType:a.SUI_EVENT}}}};import("process").then(s=>s.stdout.write(""));var N=class{server;constructor(t){this.server=t}testOnTransaction(t,e=F.TEST_NET){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===e){for(let o of r.fuelCallConfigs){let i={data:{fuelCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.FUEL_CALL},c=o.filters[0]?.function;if(c)for(let d of t.status.receipts||[])d.receiptType=="CALL"&&d.param1==c&&n.push(i);else n.push(i)}for(let o of r.fuelLogConfigs){let i={data:{fuelCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.FUEL_CALL},c=o.logIds;for(let d of t.status.receipts||[])if((d.receiptType=="LOG"||d.receiptType=="LOG_DATA")&&c.includes(d.rb)){n.push(i);break}}for(let o of r.assetConfigs){let i={data:{fuelCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.FUEL_CALL};n.push(i)}}return n}};import("process").then(s=>s.stdout.write(""));var R=h(m(),1),x={INJECTIVE_MAINNET:R.CosmosChainId.INJECTIVE_MAINNET,INJECTIVE_TESTNET:R.CosmosChainId.INJECTIVE_TESTNET};import("process").then(s=>s.stdout.write(""));var P=class{server;constructor(t){this.server=t}testOnTransaction(t,e=x.INJECTIVE_TESTNET){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test transaction: "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===e)for(let o of r.cosmosLogConfigs){let i={data:{cosmosCall:{transaction:t,timestamp:new Date}},handlerIds:[o.handlerId],handlerType:a.COSMOS_CALL},c=o.logFilters;for(let d of t.logs||[])if(d.events.find(l=>c.includes(l.type))){n.push(i);break}}return n}};import("process").then(s=>s.stdout.write(""));var O=h(m(),1),y=class{server;constructor(t){this.server=t}testOnEvents(t,e=O.StarknetChainId.STARKNET_SEPOLIA){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test : "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[],r=Array.isArray(t)?t:[t];for(let o of r)for(let i of this.server.contractConfigs)if(i.contract?.chainId===e)for(let c of i.starknetEventConfigs){let d={data:{starknetEvents:{result:o,timestamp:new Date}},handlerIds:[c.handlerId],handlerType:a.STARKNET_EVENT},l=c.filters,p=o.keys;for(let w of p)for(let J of l)if(J.keys.includes(w))return n.push(d),n}return n}};import("process").then(s=>s.stdout.write(""));var H=h(m(),1);var b=class{server;constructor(t){this.server=t}testOnTransactions(t,e=H.BTCChainId.BTC_TESTNET){let n=this.buildBinding(t,e);if(!n)throw Error("Invalid test : "+JSON.stringify(t));return this.server.processBindings({bindings:n})}buildBinding(t,e){let n=[];for(let r of this.server.contractConfigs)if(r.contract?.chainId===e)for(let o of r.btcTransactionConfigs){let i={data:{btcTransaction:t},handlerIds:[o.handlerId],handlerType:a.BTC_TRANSACTION};n.push(i)}return n}};import("process").then(s=>s.stdout.write(""));var C={};function K(){j.reset()}var k=class{service;contractConfigs;accountConfigs;aptos;eth;solana;sui;fuel;cosmos;starknet;btc;constructor(t,e={}){K(),this.service=new G(t),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=e[n]||"";q.INSTANCE.chainServer.set(n,r)}}async start(t={templateInstances:[]},e=C){let n=await this.service.start(t,e),r=await this.getConfig({});return this.contractConfigs=r.contractConfigs,this.accountConfigs=r.accountConfigs,n}stop(t,e=C){return this.service.stop(t,e)}getConfig(t,e=C){return this.service.getConfig(t,e)}processBindings(t,e=C){return this.service.processBindings(t,e)}processBinding(t,e=C){return this.service.processBindings({bindings:[t]},e)}processBindingsStream(t,e){throw new Error("Method not implemented.")}preprocessBindingsStream(t,e){throw new Error("Method not implemented.")}};import("process").then(s=>s.stdout.write(""));function A(s){if(s!==void 0){if(s.doubleValue!==void 0)return s.doubleValue;if(s.bigInteger!==void 0){let t=M(s.bigInteger.data);return s.bigInteger.negative&&(t=-t),t}if(s.bigDecimal!==void 0)return new L(s.bigDecimal)}}function X(s,t){if(s){for(let e of s.counters)if(e.metadata?.name===t)return A(e.metricValue)}}function z(s,t){if(s){for(let e of s.gauges)if(e.metadata?.name===t)return A(e.metricValue)}}import("process").then(s=>s.stdout.write(""));var V=h(m(),1);import{Endpoints as Q}from"@sentio/runtime";function W(s){let t=[];Array.isArray(s)||(s=[s]);for(let e of Object.keys(V.CHAIN_MAP)){let n="TEST_ENDPOINT_"+e,r=process.env[n];r&&(t.push(e),Q.INSTANCE.chainServer.set(e,r))}for(let e of s)if(!t.includes(e))return!1;return!0}import("process").then(s=>s.stdout.write(""));import("process").then(s=>s.stdout.write(""));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{a,b,c,d,e,f,g,h,i,j,k,l}from"../chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"../chunk-RVQBDYQ2.js";import"../chunk-6VELGYNR.js";import"../chunk-YX4LDK5Y.js";import"../chunk-F7Q5QB6Q.js";import"../chunk-OUOSDGWD.js";import"../chunk-QW2MPHP5.js";import"../chunk-24SCJPBI.js";import"../chunk-GU4UN43Q.js";import"../chunk-CA6DKOT2.js";import"../chunk-NDC6HDQD.js";import"../chunk-WZLM66YL.js";import"../chunk-2BO4GGPL.js";import"../chunk-FC546GTB.js";import"../chunk-6GD6B22G.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.44.
|
|
3
|
+
"version": "2.44.4-rc.2",
|
|
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.44.
|
|
51
|
+
"@sentio/runtime": "^2.44.4-rc.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {},
|
|
54
54
|
"devDependencies": {},
|
|
@@ -55,16 +55,17 @@ class AptosNetworkCodegen extends BaseAptosCodegen {
|
|
|
55
55
|
|
|
56
56
|
const MAINNET_CODEGEN = new AptosNetworkCodegen(AptosNetwork.MAIN_NET)
|
|
57
57
|
const TESTNET_CODEGEN = new AptosNetworkCodegen(AptosNetwork.TEST_NET)
|
|
58
|
-
const
|
|
58
|
+
const MOVEMENT_MAINNET_CODEGEN = new AptosNetworkCodegen(AptosNetwork.MOVEMENT_MAIN_NET)
|
|
59
59
|
const M2_TESTNET_CODEGEN = new AptosNetworkCodegen(AptosNetwork.MOVEMENT_TEST_NET)
|
|
60
|
+
const MOVEMENT_PROTO_CODEGEN = new AptosNetworkCodegen(AptosNetwork.MOVEMENT_PORTO)
|
|
60
61
|
|
|
61
62
|
class AptosCodegen {
|
|
62
63
|
async generate(srcDir: string, outputDir: string, builtin = false): Promise<number> {
|
|
63
64
|
const num1 = await MAINNET_CODEGEN.generate(srcDir, outputDir, builtin)
|
|
64
65
|
const num2 = await TESTNET_CODEGEN.generate(path.join(srcDir, 'testnet'), path.join(outputDir, 'testnet'), builtin)
|
|
65
|
-
const num3 = await
|
|
66
|
-
path.join(srcDir, '
|
|
67
|
-
path.join(outputDir, '
|
|
66
|
+
const num3 = await MOVEMENT_MAINNET_CODEGEN.generate(
|
|
67
|
+
path.join(srcDir, 'movement-mainnet'),
|
|
68
|
+
path.join(outputDir, 'movement-mainnet'),
|
|
68
69
|
builtin
|
|
69
70
|
)
|
|
70
71
|
const num4 = await M2_TESTNET_CODEGEN.generate(
|
|
@@ -72,6 +73,11 @@ class AptosCodegen {
|
|
|
72
73
|
path.join(outputDir, 'm2-testnet'),
|
|
73
74
|
builtin
|
|
74
75
|
)
|
|
75
|
-
|
|
76
|
+
const num5 = await MOVEMENT_PROTO_CODEGEN.generate(
|
|
77
|
+
path.join(srcDir, 'movement-porto'),
|
|
78
|
+
path.join(outputDir, 'movement-porto'),
|
|
79
|
+
builtin
|
|
80
|
+
)
|
|
81
|
+
return num1 + num2 + num3 + num4 + num5
|
|
76
82
|
}
|
|
77
83
|
}
|
package/src/aptos/network.ts
CHANGED
|
@@ -23,14 +23,17 @@ export class AptosBindOptions {
|
|
|
23
23
|
|
|
24
24
|
export function getRpcEndpoint(network: AptosNetwork): string {
|
|
25
25
|
switch (network) {
|
|
26
|
+
case AptosNetwork.MAIN_NET:
|
|
27
|
+
return 'https://mainnet.aptoslabs.com/v1'
|
|
26
28
|
case AptosNetwork.TEST_NET:
|
|
27
29
|
return 'https://testnet.aptoslabs.com/v1'
|
|
28
30
|
case AptosNetwork.MOVEMENT_TEST_NET:
|
|
29
31
|
return 'https://aptos.testnet.suzuka.movementlabs.xyz/v1'
|
|
30
32
|
case AptosNetwork.MOVEMENT_MAIN_NET:
|
|
31
|
-
return 'https://mainnet.
|
|
33
|
+
return 'https://aptos.mainnet.movementlabs.xyz/v1'
|
|
34
|
+
case AptosNetwork.MOVEMENT_PORTO:
|
|
35
|
+
return 'https://aptos.testnet.porto.movementlabs.xyz/v1'
|
|
32
36
|
}
|
|
33
|
-
return 'https://mainnet.aptoslabs.com/v1'
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
export function getClient(network: AptosNetwork): Aptos {
|
|
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
|