@sentio/sdk-bundle 4.5.0-rc.1 → 4.5.0-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.
Files changed (40) hide show
  1. package/dist/{0x1-4jrQcGKy.js → 0x1-3KkvB3JJ.js} +3 -3
  2. package/dist/{0x1-4jrQcGKy.js.map → 0x1-3KkvB3JJ.js.map} +1 -1
  3. package/dist/aptos/builtin/0x1.js +1 -1
  4. package/dist/aptos/builtin/0x3.js +1 -1
  5. package/dist/aptos/builtin/0x4.js +1 -1
  6. package/dist/aptos/builtin/index.js +1 -1
  7. package/dist/aptos/ext/index.js +1 -1
  8. package/dist/aptos/index.js +1 -1
  9. package/dist/{aptos-Bwo7QuI8.js → aptos-IGprZj5Q.js} +2 -2
  10. package/dist/{aptos-Bwo7QuI8.js.map → aptos-IGprZj5Q.js.map} +1 -1
  11. package/dist/{coin-D9n8cKaD.js → coin-Dlp7xgul.js} +2 -2
  12. package/dist/{coin-D9n8cKaD.js.map → coin-Dlp7xgul.js.map} +1 -1
  13. package/dist/{coin-C6vlCSsU.js → coin-Dr9d7pEo.js} +2 -2
  14. package/dist/{coin-C6vlCSsU.js.map → coin-Dr9d7pEo.js.map} +1 -1
  15. package/dist/eth/builtin/eacaggregatorproxy.js +1 -1
  16. package/dist/eth/builtin/erc1155.js +1 -1
  17. package/dist/eth/builtin/erc20.js +1 -1
  18. package/dist/eth/builtin/erc721.js +1 -1
  19. package/dist/eth/builtin/index.js +1 -1
  20. package/dist/eth/builtin/weth9.js +1 -1
  21. package/dist/eth/index.js +1 -1
  22. package/dist/iota/builtin/0x1.js +2 -2
  23. package/dist/iota/builtin/0x2.js +2 -2
  24. package/dist/iota/builtin/0x3.js +2 -2
  25. package/dist/iota/ext/index.js +1 -1
  26. package/dist/iota/index.js +2 -2
  27. package/dist/sui/builtin/0x1.js +1 -1
  28. package/dist/sui/builtin/0x2.js +3 -3
  29. package/dist/sui/builtin/0x3.js +3 -3
  30. package/dist/sui/builtin/index.js +1 -1
  31. package/dist/sui/ext/index.js +1 -1
  32. package/dist/sui/index.js +2 -2
  33. package/dist/{sui-eNjtYhM_.js → sui-Bw0Xk7MT.js} +3 -3
  34. package/dist/{sui-eNjtYhM_.js.map → sui-Bw0Xk7MT.js.map} +1 -1
  35. package/dist/testing/index.js +5 -5
  36. package/dist/utils/index.js +1 -1
  37. package/dist/{utils-krbSF18i.js → utils-D1f8k5YC.js} +65 -9
  38. package/dist/utils-D1f8k5YC.js.map +1 -0
  39. package/package.json +2 -2
  40. package/dist/utils-krbSF18i.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { a as __name, n as __commonJSMin, t as BigDecimal } from "../bignumber-DddanwOv.js";
2
2
  import { Ar as TemplateInstanceSchema, Er as StartRequestSchema, Gr as RichValueListSchema, Kr as RichValueSchema, Lr as UpdateTemplatesRequestSchema, Lt as DBResponseSchema, Mn as HandlerType, Mr as TimeseriesResult_TimeseriesType, Nt as DBRequest_DBOperator, Q as require_graphql, X as DatabaseSchemaState, Z as buildSchema, b as BigIntConverter, cr as ProcessBindingsRequestSchema, ei as EmptySchema, fr as ProcessStreamRequestSchema, ii as timestampNow, lr as ProcessConfigRequestSchema, pi as create, r as ALL_ADDRESS, ri as timestampFromDate, s as Store, sr as ProcessBindingResponseSchema, y as BigDecimalConverter, zt as DataBindingSchema } from "../core-6Ypd3zW8.js";
3
- import { yt as bytesToBigInt } from "../utils-krbSF18i.js";
3
+ import { yt as bytesToBigInt } from "../utils-D1f8k5YC.js";
4
4
  import "../index.js";
5
- import { Wn as AptosNetwork } from "../aptos-Bwo7QuI8.js";
5
+ import { Wn as AptosNetwork } from "../aptos-IGprZj5Q.js";
6
6
  import { C as accountTypeString, b as SPLITTER, v as parseMoveType } from "../move-D3gl6sZV.js";
7
- import { c as SuiNetwork } from "../coin-C6vlCSsU.js";
8
- import { U as getMoveCalls, p as getMoveCalls$1 } from "../sui-eNjtYhM_.js";
9
- import { c as IotaNetwork } from "../coin-D9n8cKaD.js";
7
+ import { c as SuiNetwork } from "../coin-Dr9d7pEo.js";
8
+ import { U as getMoveCalls, p as getMoveCalls$1 } from "../sui-Bw0Xk7MT.js";
9
+ import { c as IotaNetwork } from "../coin-Dlp7xgul.js";
10
10
  import { x as getRpcEndpoint, y as FuelNetwork } from "../fuel-BuHRFjnR.js";
11
11
  import { GraphQLList, GraphQLNonNull, GraphQLObjectType } from "graphql";
12
12
  import { DataBindingContext, Endpoints, PluginManager, ProcessorServiceImplV3, State, mergeProcessResults } from "@sentio/runtime";
@@ -1,3 +1,3 @@
1
- import { St as timeOrBlockToBlockNumber, a as getPriceClient, bt as estimateBlockNumberAtDate, c as SepoliaDexPrice, i as getPriceByType, l as getPackageRoot, n as getCoinsThatHasPrice, o as EthereumDexPrice, r as getPriceBySymbol, s as PriceUnit, t as ignoreEthCallException, x as token_exports, xt as estimateBlockNumberAtDateSlow, yt as bytesToBigInt } from "../utils-krbSF18i.js";
1
+ import { St as timeOrBlockToBlockNumber, a as getPriceClient, bt as estimateBlockNumberAtDate, c as SepoliaDexPrice, i as getPriceByType, l as getPackageRoot, n as getCoinsThatHasPrice, o as EthereumDexPrice, r as getPriceBySymbol, s as PriceUnit, t as ignoreEthCallException, x as token_exports, xt as estimateBlockNumberAtDateSlow, yt as bytesToBigInt } from "../utils-D1f8k5YC.js";
2
2
 
3
3
  export { EthereumDexPrice, PriceUnit, SepoliaDexPrice, bytesToBigInt, estimateBlockNumberAtDate, estimateBlockNumberAtDateSlow, getCoinsThatHasPrice, getPackageRoot, getPriceBySymbol, getPriceByType, getPriceClient, ignoreEthCallException, timeOrBlockToBlockNumber, token_exports as token };
@@ -10,6 +10,8 @@ import https from "https";
10
10
  import { gunzipSync } from "zlib";
11
11
  import { Endpoints, GLOBAL_CONFIG, ListStateStorage, MapStateStorage, Plugin, PluginManager, USER_PROCESSOR, errorString, makeEthCallKey, mergeProcessResults, metricsStorage, processMetrics, providerMetrics } from "@sentio/runtime";
12
12
  import { EthChainId, EthChainId as EthChainId$1 } from "@sentio/chain";
13
+ import http$1 from "node:http";
14
+ import https$1 from "node:https";
13
15
  import { Piscina } from "piscina";
14
16
  import fs from "fs";
15
17
  import path from "path";
@@ -14116,6 +14118,65 @@ var LRUCache = class LRUCache {
14116
14118
  }
14117
14119
  };
14118
14120
 
14121
+ //#endregion
14122
+ //#region src/eth/rpc-agent.ts
14123
+ const FREE_SOCKET_IDLE_MS = 5e3;
14124
+ const DEFAULT_RPC_CALL_TIMEOUT_MS = 12e4;
14125
+ function rpcCallTimeoutMs() {
14126
+ const n = Number(process.env["RPC_CALL_TIMEOUT_MS"]);
14127
+ return Number.isFinite(n) && n > 0 ? n : DEFAULT_RPC_CALL_TIMEOUT_MS;
14128
+ }
14129
+ function keepAliveWithShortIdle(agent) {
14130
+ const hooks = agent;
14131
+ const base = hooks.keepSocketAlive.bind(agent);
14132
+ hooks.keepSocketAlive = (socket) => {
14133
+ const keep = base(socket);
14134
+ if (keep) socket.setTimeout(freeSocketIdleMs(socket.timeout));
14135
+ return keep;
14136
+ };
14137
+ return agent;
14138
+ }
14139
+ function freeSocketIdleMs(selected) {
14140
+ return selected && selected > 0 ? Math.min(selected, FREE_SOCKET_IDLE_MS) : FREE_SOCKET_IDLE_MS;
14141
+ }
14142
+ function isHttpsUrl(url) {
14143
+ return url.split(":")[0].toLowerCase() === "https";
14144
+ }
14145
+ function rpcAgentOptions(extra) {
14146
+ return {
14147
+ keepAlive: true,
14148
+ scheduling: "lifo",
14149
+ timeout: rpcCallTimeoutMs(),
14150
+ ...extra
14151
+ };
14152
+ }
14153
+ function createRpcHttpAgent(extra) {
14154
+ return keepAliveWithShortIdle(new http$1.Agent(rpcAgentOptions(extra)));
14155
+ }
14156
+ function createRpcHttpsAgent(extra) {
14157
+ return keepAliveWithShortIdle(new https$1.Agent(rpcAgentOptions(extra)));
14158
+ }
14159
+ let agents;
14160
+ function rpcAgents() {
14161
+ if (!agents) {
14162
+ const viaHttp = createRpcHttpAgent();
14163
+ const viaHttps = createRpcHttpsAgent();
14164
+ const overHttp = FetchRequest.createGetUrlFunc({ agent: viaHttp });
14165
+ const overHttps = FetchRequest.createGetUrlFunc({ agent: viaHttps });
14166
+ agents = {
14167
+ http: viaHttp,
14168
+ https: viaHttps,
14169
+ getUrlFunc: (req, signal) => (isHttpsUrl(req.url) ? overHttps : overHttp)(req, signal)
14170
+ };
14171
+ }
14172
+ return agents;
14173
+ }
14174
+ function rpcFetchRequest(url) {
14175
+ const req = new FetchRequest(url);
14176
+ req.getUrlFunc = rpcAgents().getUrlFunc;
14177
+ return req;
14178
+ }
14179
+
14119
14180
  //#endregion
14120
14181
  //#region src/eth/provider.ts
14121
14182
  const { miss_count, hit_count, queue_size } = providerMetrics;
@@ -14129,15 +14190,10 @@ function getProvider(chainId) {
14129
14190
  let provider = providers.get(key);
14130
14191
  if (provider) return provider;
14131
14192
  if (address === void 0) throw Error("Provider not found for chain " + network.chainId + ", configured chains: " + [...Endpoints.INSTANCE.chainRpc.keys()].join(" "));
14132
- provider = new QueuedStaticJsonRpcProvider(address, network, Endpoints.INSTANCE.concurrency, Endpoints.INSTANCE.batchCount);
14193
+ provider = new QueuedStaticJsonRpcProvider(rpcFetchRequest(address), network, Endpoints.INSTANCE.concurrency, Endpoints.INSTANCE.batchCount);
14133
14194
  providers.set(key, provider);
14134
14195
  return provider;
14135
14196
  }
14136
- const DEFAULT_RPC_CALL_TIMEOUT_MS = 12e4;
14137
- function rpcCallTimeoutMs() {
14138
- const n = Number(process.env["RPC_CALL_TIMEOUT_MS"]);
14139
- return Number.isFinite(n) && n > 0 ? n : DEFAULT_RPC_CALL_TIMEOUT_MS;
14140
- }
14141
14197
  const TIMEOUT_WHAT_MAX = 120;
14142
14198
  function timeoutError(ms, what) {
14143
14199
  const bounded = what.length > TIMEOUT_WHAT_MAX ? `${what.slice(0, TIMEOUT_WHAT_MAX)}…(${what.length} chars)` : what;
@@ -20081,7 +20137,7 @@ const file_google_api_annotations = /*@__PURE__*/ fileDesc("Chxnb29nbGUvYXBpL2Fu
20081
20137
  *
20082
20138
  * @generated from extension: google.api.HttpRule http = 72295728;
20083
20139
  */
20084
- const http$1 = /*@__PURE__*/ extDesc(file_google_api_annotations, 0);
20140
+ const http$2 = /*@__PURE__*/ extDesc(file_google_api_annotations, 0);
20085
20141
 
20086
20142
  //#endregion
20087
20143
  //#region ../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.1_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.1_/node_modules/@sentio/connect-gateway-es/dist/esm/route.js
@@ -20123,7 +20179,7 @@ function resolveAnnotatedRoute(method) {
20123
20179
  const cached = annotatedRouteCache.get(method);
20124
20180
  if (cached !== void 0) return cached ?? void 0;
20125
20181
  let route = null;
20126
- if (hasOption(method, http$1)) route = compileRoute(method, getOption(method, http$1));
20182
+ if (hasOption(method, http$2)) route = compileRoute(method, getOption(method, http$2));
20127
20183
  annotatedRouteCache.set(method, route);
20128
20184
  return route ?? void 0;
20129
20185
  }
@@ -20757,4 +20813,4 @@ async function ignoreEthCallException(promise, logError = false) {
20757
20813
 
20758
20814
  //#endregion
20759
20815
  export { EACAggregatorProxy__factory as $, ERC20ContractView as A, mockApprovalForAllLog as B, ERC20BytesProcessor as C, mockOwnershipTransferredLog$1 as D, mockApprovalLog$1 as E, EthChainId$1 as F, ERC721Processor as G, mockTransferLog$2 as H, makeEthCallKey as I, getERC721ContractOnContext as J, ERC721ProcessorTemplate as K, EthPlugin as L, ERC20ProcessorTemplate as M, getERC20Contract as N, mockTransferLog$1 as O, getERC20ContractOnContext as P, ERC1155__factory as Q, AccountProcessor as R, erc20bytes_exports as S, timeOrBlockToBlockNumber as St, erc20_exports as T, ERC721BoundContractView as U, mockApprovalLog$2 as V, ERC721ContractView as W, ERC721__factory as X, WETH9__factory as Y, ERC20__factory as Z, EACAggregatorProxyProcessor as _, EthContext as _t, getPriceClient as a, getProcessor as at, getEACAggregatorProxyContractOnContext as b, estimateBlockNumberAtDate as bt, SepoliaDexPrice as c, DummyProvider as ct, mockAnswerUpdatedLog as d, GlobalProcessor as dt, BaseProcessorTemplate as et, mockNewRoundLog as f, defaultPreprocessHandler as ft, EACAggregatorProxyContractView as g, ContractView as gt, EACAggregatorProxyBoundContractView as h, ContractContext as ht, getPriceByType as i, getContractByABI as it, ERC20Processor as j, ERC20BoundContractView as k, getPackageRoot as l, getProvider as lt, mockOwnershipTransferredLog as m, BoundContractView as mt, getCoinsThatHasPrice as n, addContractByABI as nt, EthereumDexPrice as o, AccountBindOptions as ot, mockOwnershipTransferRequestedLog as p, AccountContext as pt, getERC721Contract as q, getPriceBySymbol as r, addProcessor as rt, PriceUnit as s, BindOptions as st, ignoreEthCallException as t, GenericProcessor as tt, eacaggregatorproxy_exports as u, BaseProcessor as ut, EACAggregatorProxyProcessorTemplate as v, GlobalContext as vt, ERC20BytesProcessorTemplate as w, token_exports as x, estimateBlockNumberAtDateSlow as xt, getEACAggregatorProxyContract as y, bytesToBigInt as yt, erc721_exports as z };
20760
- //# sourceMappingURL=utils-krbSF18i.js.map
20816
+ //# sourceMappingURL=utils-D1f8k5YC.js.map