@sentio/sdk-bundle 4.1.0-rc.2 → 4.1.0-rc.3

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.
Files changed (61) hide show
  1. package/dist/{0x1-BZ1q0D5w.js → 0x1-DsRLSNfp.js} +4 -4
  2. package/dist/{0x1-BZ1q0D5w.js.map → 0x1-DsRLSNfp.js.map} +1 -1
  3. package/dist/aptos/builtin/0x1.js +1 -1
  4. package/dist/aptos/builtin/0x3.js +2 -2
  5. package/dist/aptos/builtin/0x4.js +2 -2
  6. package/dist/aptos/builtin/index.js +1 -1
  7. package/dist/aptos/ext/index.js +2 -2
  8. package/dist/aptos/index.js +2 -2
  9. package/dist/{aptos-5tjCEQ6p.js → aptos-Bkm5LunO.js} +5 -5
  10. package/dist/{aptos-5tjCEQ6p.js.map → aptos-Bkm5LunO.js.map} +1 -1
  11. package/dist/{coin-BXFrwxRE.js → coin-BDJBo_lb.js} +3 -3
  12. package/dist/{coin-BXFrwxRE.js.map → coin-BDJBo_lb.js.map} +1 -1
  13. package/dist/{coin-DbknVApK.js → coin-DcELdVP_.js} +3 -3
  14. package/dist/{coin-DbknVApK.js.map → coin-DcELdVP_.js.map} +1 -1
  15. package/dist/core/index.js +1 -1
  16. package/dist/{core-CPC-6jsb.js → core-BElsJ1pw.js} +23 -114
  17. package/dist/core-BElsJ1pw.js.map +1 -0
  18. package/dist/{decode-worker-BZuZO3Ef.js → decode-worker-C7q_r8x3.js} +2 -2
  19. package/dist/{decode-worker-BZuZO3Ef.js.map → decode-worker-C7q_r8x3.js.map} +1 -1
  20. package/dist/eth/abi-decoder/decode-worker.js +1 -1
  21. package/dist/eth/builtin/eacaggregatorproxy.js +1 -1
  22. package/dist/eth/builtin/erc1155.js +3 -3
  23. package/dist/eth/builtin/erc20.js +1 -1
  24. package/dist/eth/builtin/erc721.js +1 -1
  25. package/dist/eth/builtin/index.js +1 -1
  26. package/dist/eth/builtin/weth9.js +3 -3
  27. package/dist/eth/index.js +2 -2
  28. package/dist/fuel/index.js +1 -1
  29. package/dist/{fuel-DLmNPUq9.js → fuel-C9Y84R8S.js} +3 -3
  30. package/dist/{fuel-DLmNPUq9.js.map → fuel-C9Y84R8S.js.map} +1 -1
  31. package/dist/{handler-register-DkEYbBGE.js → handler-register-DU3CwNoM.js} +2 -2
  32. package/dist/{handler-register-DkEYbBGE.js.map → handler-register-DU3CwNoM.js.map} +1 -1
  33. package/dist/index.js +2 -2
  34. package/dist/iota/builtin/0x1.js +3 -3
  35. package/dist/iota/builtin/0x2.js +3 -3
  36. package/dist/iota/builtin/0x3.js +3 -3
  37. package/dist/iota/ext/index.js +1 -1
  38. package/dist/iota/index.js +3 -3
  39. package/dist/move/index.js +1 -1
  40. package/dist/{move-Ce6GumtF.js → move-BHEDP8e5.js} +2 -2
  41. package/dist/{move-Ce6GumtF.js.map → move-BHEDP8e5.js.map} +1 -1
  42. package/dist/solana/builtin/index.js +1 -1
  43. package/dist/solana/index.js +1 -1
  44. package/dist/{solana-DY7xsNa5.js → solana-CjV1K7WR.js} +2 -2
  45. package/dist/{solana-DY7xsNa5.js.map → solana-CjV1K7WR.js.map} +1 -1
  46. package/dist/store/index.js +1 -1
  47. package/dist/sui/builtin/0x1.js +1 -1
  48. package/dist/sui/builtin/0x2.js +4 -4
  49. package/dist/sui/builtin/0x3.js +4 -4
  50. package/dist/sui/builtin/index.js +1 -1
  51. package/dist/sui/ext/index.js +1 -1
  52. package/dist/sui/index.js +3 -3
  53. package/dist/{sui-CcreC9Mj.js → sui-DCf9ZKVa.js} +6 -6
  54. package/dist/{sui-CcreC9Mj.js.map → sui-DCf9ZKVa.js.map} +1 -1
  55. package/dist/testing/index.js +87 -14
  56. package/dist/testing/index.js.map +1 -1
  57. package/dist/utils/index.js +1 -1
  58. package/dist/{utils-B26ewwB8.js → utils-D3qk3_rF.js} +4 -4
  59. package/dist/{utils-B26ewwB8.js.map → utils-D3qk3_rF.js.map} +1 -1
  60. package/package.json +2 -2
  61. package/dist/core-CPC-6jsb.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { a as __name, n as __commonJSMin, t as BigDecimal } from "../bignumber-DddanwOv.js";
2
- import { It as DBResponseSchema, J as DatabaseSchemaState, Jr as RichValueSchema, Mr as TemplateInstanceSchema, Mt as DBRequest_DBOperator, Nn as HandlerType, Or as StartRequestSchema, Rt as DataBindingSchema, X as require_graphql, Y as buildSchema, _ as BigDecimalConverter, ai as timestampFromDate, cr as ProcessBindingResponseSchema, lr as ProcessBindingsRequestSchema, mi as create, ni as EmptySchema, oi as timestampNow, pr as ProcessStreamRequestSchema, qr as RichValueListSchema, r as ALL_ADDRESS, s as Store, ur as ProcessConfigRequestSchema, v as BigIntConverter, zr as UpdateTemplatesRequestSchema } from "../core-CPC-6jsb.js";
3
- import { yt as bytesToBigInt } from "../utils-B26ewwB8.js";
2
+ import { An as HandlerType, Ar as TimeseriesResult_TimeseriesType, Fr as UpdateTemplatesRequestSchema, Ft as DBResponseSchema, J as DatabaseSchemaState, Lt as DataBindingSchema, Or as TemplateInstanceSchema, Qr as EmptySchema, Ur as RichValueListSchema, Wr as RichValueSchema, X as require_graphql, Y as buildSchema, _ as BigDecimalConverter, ar as ProcessBindingResponseSchema, jt as DBRequest_DBOperator, ni as timestampNow, or as ProcessBindingsRequestSchema, r as ALL_ADDRESS, s as Store, sr as ProcessConfigRequestSchema, ti as timestampFromDate, ui as create, ur as ProcessStreamRequestSchema, v as BigIntConverter, wr as StartRequestSchema } from "../core-BElsJ1pw.js";
3
+ import { yt as bytesToBigInt } from "../utils-D3qk3_rF.js";
4
4
  import "../index.js";
5
- import { Wn as AptosNetwork } from "../aptos-5tjCEQ6p.js";
6
- import { C as accountTypeString, b as SPLITTER, v as parseMoveType } from "../move-Ce6GumtF.js";
7
- import { c as SuiNetwork } from "../coin-DbknVApK.js";
8
- import { U as getMoveCalls, p as getMoveCalls$1 } from "../sui-CcreC9Mj.js";
9
- import { c as IotaNetwork } from "../coin-BXFrwxRE.js";
10
- import { x as getRpcEndpoint, y as FuelNetwork } from "../fuel-DLmNPUq9.js";
5
+ import { Wn as AptosNetwork } from "../aptos-Bkm5LunO.js";
6
+ import { C as accountTypeString, b as SPLITTER, v as parseMoveType } from "../move-BHEDP8e5.js";
7
+ import { c as SuiNetwork } from "../coin-DcELdVP_.js";
8
+ import { U as getMoveCalls, p as getMoveCalls$1 } from "../sui-DCf9ZKVa.js";
9
+ import { c as IotaNetwork } from "../coin-BDJBo_lb.js";
10
+ import { x as getRpcEndpoint, y as FuelNetwork } from "../fuel-C9Y84R8S.js";
11
11
  import { GraphQLList, GraphQLNonNull, GraphQLObjectType } from "graphql";
12
12
  import { DataBindingContext, Endpoints, PluginManager, ProcessorServiceImplV3, State, mergeProcessResults } from "@sentio/runtime";
13
13
  import { ChainId, ChainInfo, CosmosChainId, EthChainId } from "@sentio/chain";
@@ -10162,15 +10162,20 @@ var TestProcessorServer = class {
10162
10162
  const processId = this.nextProcessId++;
10163
10163
  const subject = this.storeContext.subject;
10164
10164
  return new Promise((resolve, reject) => {
10165
+ const collectedTimeseries = [];
10165
10166
  const subscription = subject.subscribe({
10166
10167
  next: (response) => {
10167
10168
  if (response.processId !== processId) return;
10168
10169
  if (response.value?.case === "tplRequest") this.storeContext.applyTemplateRequest((response.value.value.templates ?? []).map((template) => create(TemplateInstanceSchema, template)), response.value.value.remove ?? false);
10170
+ if (response.value?.case === "tsRequest") collectedTimeseries.push(...response.value.value.data ?? []);
10169
10171
  if (response.value?.case === "result") {
10170
10172
  subscription.unsubscribe();
10171
10173
  const result = response.value.value;
10172
10174
  if (result.states?.error) reject(new Error(result.states.error));
10173
- else resolve(result);
10175
+ else {
10176
+ result.timeseriesResult = collectedTimeseries;
10177
+ resolve(result);
10178
+ }
10174
10179
  }
10175
10180
  },
10176
10181
  error: (e) => {
@@ -10242,13 +10247,81 @@ function MetricValueToNumber(v) {
10242
10247
  default: return;
10243
10248
  }
10244
10249
  }
10250
+ function RichValueToNumber(v) {
10251
+ if (v === void 0) return;
10252
+ switch (v.value.case) {
10253
+ case "floatValue": return v.value.value;
10254
+ case "bigintValue": {
10255
+ let intValue = bytesToBigInt(v.value.value.data);
10256
+ if (v.value.value.negative) intValue = -intValue;
10257
+ return intValue;
10258
+ }
10259
+ case "bigdecimalValue": {
10260
+ const bd = v.value.value;
10261
+ if (bd.value === void 0) return;
10262
+ let intValue = bytesToBigInt(bd.value.data);
10263
+ if (bd.value.negative) intValue = -intValue;
10264
+ return new BigDecimal(`${intValue}e${bd.exp}`);
10265
+ }
10266
+ default: return;
10267
+ }
10268
+ }
10269
+ function timeseriesOf(result, type) {
10270
+ return result?.timeseriesResult.filter((t) => t.type === type) ?? [];
10271
+ }
10272
+ function countersOf(result) {
10273
+ return timeseriesOf(result, TimeseriesResult_TimeseriesType.COUNTER);
10274
+ }
10275
+ function gaugesOf(result) {
10276
+ return timeseriesOf(result, TimeseriesResult_TimeseriesType.GAUGE);
10277
+ }
10278
+ function eventsOf(result) {
10279
+ return timeseriesOf(result, TimeseriesResult_TimeseriesType.EVENT);
10280
+ }
10281
+ function eventField(ts, key) {
10282
+ const v = ts?.data?.fields?.[key]?.value;
10283
+ return v?.case === "stringValue" ? v.value : void 0;
10284
+ }
10285
+ function richValueToJs(v) {
10286
+ if (v === void 0) return;
10287
+ switch (v.value.case) {
10288
+ case "nullValue": return null;
10289
+ case "stringValue":
10290
+ case "boolValue":
10291
+ case "floatValue": return v.value.value;
10292
+ case "bigintValue": {
10293
+ let n = bytesToBigInt(v.value.value.data);
10294
+ if (v.value.value.negative) n = -n;
10295
+ return n;
10296
+ }
10297
+ case "bigdecimalValue": {
10298
+ const bd = v.value.value;
10299
+ if (bd.value === void 0) return;
10300
+ let n = bytesToBigInt(bd.value.data);
10301
+ if (bd.value.negative) n = -n;
10302
+ return new BigDecimal(`${n}e${bd.exp}`);
10303
+ }
10304
+ case "structValue": return richStructToJs(v.value.value);
10305
+ case "listValue": return v.value.value.values.map(richValueToJs);
10306
+ default: return;
10307
+ }
10308
+ }
10309
+ function richStructToJs(s) {
10310
+ const out = {};
10311
+ if (s) for (const [k, v] of Object.entries(s.fields)) out[k] = richValueToJs(v);
10312
+ return out;
10313
+ }
10314
+ function eventFieldValue(ts, key) {
10315
+ return richValueToJs(ts?.data?.fields?.[key]);
10316
+ }
10317
+ function firstTimeseriesValue(result, type, name) {
10318
+ for (const ts of timeseriesOf(result, type)) if (ts.metadata?.name === name) return RichValueToNumber(ts.data?.fields?.value);
10319
+ }
10245
10320
  function firstCounterValue(result, name) {
10246
- if (!result) return;
10247
- for (const counter of result.counters) if (counter.metadata?.name === name) return MetricValueToNumber(counter.metricValue);
10321
+ return firstTimeseriesValue(result, TimeseriesResult_TimeseriesType.COUNTER, name);
10248
10322
  }
10249
10323
  function firstGaugeValue(result, name) {
10250
- if (!result) return;
10251
- for (const gauge of result.gauges) if (gauge.metadata?.name === name) return MetricValueToNumber(gauge.metricValue);
10324
+ return firstTimeseriesValue(result, TimeseriesResult_TimeseriesType.GAUGE, name);
10252
10325
  }
10253
10326
 
10254
10327
  //#endregion
@@ -10268,5 +10341,5 @@ function loadTestProvidersFromEnv(requiredChainIds) {
10268
10341
  }
10269
10342
 
10270
10343
  //#endregion
10271
- export { MemoryDatabase, MetricValueToNumber, TestProcessorServer, firstCounterValue, firstGaugeValue, loadTestProvidersFromEnv, withStoreContext };
10344
+ export { MemoryDatabase, MetricValueToNumber, TestProcessorServer, countersOf, eventField, eventFieldValue, eventsOf, firstCounterValue, firstGaugeValue, gaugesOf, loadTestProvidersFromEnv, withStoreContext };
10272
10345
  //# sourceMappingURL=index.js.map