@sentio/sdk-bundle 4.4.0-rc.1 → 4.4.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.
- package/dist/{0x1-Ckzo4cDP.js → 0x1-CSwo-jKL.js} +3 -3
- package/dist/{0x1-Ckzo4cDP.js.map → 0x1-CSwo-jKL.js.map} +1 -1
- package/dist/aptos/builtin/0x1.js +1 -1
- package/dist/aptos/builtin/0x3.js +1 -1
- package/dist/aptos/builtin/0x4.js +1 -1
- package/dist/aptos/builtin/index.js +1 -1
- package/dist/aptos/ext/index.js +1 -1
- package/dist/aptos/index.js +1 -1
- package/dist/{aptos-CCQAA9FL.js → aptos-CJSICa7l.js} +2 -2
- package/dist/{aptos-CCQAA9FL.js.map → aptos-CJSICa7l.js.map} +1 -1
- package/dist/{coin-Bh6G2kFp.js → coin-Br7pm0_k.js} +2 -2
- package/dist/{coin-Bh6G2kFp.js.map → coin-Br7pm0_k.js.map} +1 -1
- package/dist/{coin-BThydAwQ.js → coin-C-mHtvER.js} +2 -2
- package/dist/{coin-BThydAwQ.js.map → coin-C-mHtvER.js.map} +1 -1
- package/dist/eth/builtin/eacaggregatorproxy.js +1 -1
- package/dist/eth/builtin/erc1155.js +1 -1
- package/dist/eth/builtin/erc20.js +1 -1
- package/dist/eth/builtin/erc721.js +1 -1
- package/dist/eth/builtin/index.js +1 -1
- package/dist/eth/builtin/weth9.js +1 -1
- package/dist/eth/index.js +1 -1
- package/dist/iota/builtin/0x1.js +2 -2
- package/dist/iota/builtin/0x2.js +2 -2
- package/dist/iota/builtin/0x3.js +2 -2
- package/dist/iota/ext/index.js +1 -1
- package/dist/iota/index.js +2 -2
- package/dist/sui/builtin/0x1.js +1 -1
- package/dist/sui/builtin/0x2.js +3 -3
- package/dist/sui/builtin/0x3.js +3 -3
- package/dist/sui/builtin/index.js +1 -1
- package/dist/sui/ext/index.js +1 -1
- package/dist/sui/index.js +2 -2
- package/dist/{sui-Cz91kq2j.js → sui-CXlj8p9H.js} +3 -3
- package/dist/{sui-Cz91kq2j.js.map → sui-CXlj8p9H.js.map} +1 -1
- package/dist/testing/index.js +5 -5
- package/dist/utils/index.js +1 -1
- package/dist/{utils-B1D-f9YQ.js → utils-CyBjNK5t.js} +63 -3
- package/dist/{utils-B1D-f9YQ.js.map → utils-CyBjNK5t.js.map} +1 -1
- package/package.json +2 -2
package/dist/testing/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as __name, n as __commonJSMin, t as BigDecimal } from "../bignumber-DddanwOv.js";
|
|
2
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, di as create, jt as DBRequest_DBOperator, ni as timestampNow, or as ProcessBindingsRequestSchema, r as ALL_ADDRESS, s as Store, sr as ProcessConfigRequestSchema, ti as timestampFromDate, ur as ProcessStreamRequestSchema, v as BigIntConverter, wr as StartRequestSchema } from "../core-BI-Uwpn4.js";
|
|
3
|
-
import { yt as bytesToBigInt } from "../utils-
|
|
3
|
+
import { yt as bytesToBigInt } from "../utils-CyBjNK5t.js";
|
|
4
4
|
import "../index.js";
|
|
5
|
-
import { Wn as AptosNetwork } from "../aptos-
|
|
5
|
+
import { Wn as AptosNetwork } from "../aptos-CJSICa7l.js";
|
|
6
6
|
import { C as accountTypeString, b as SPLITTER, v as parseMoveType } from "../move-CQYkdwo_.js";
|
|
7
|
-
import { c as SuiNetwork } from "../coin-
|
|
8
|
-
import { U as getMoveCalls, p as getMoveCalls$1 } from "../sui-
|
|
9
|
-
import { c as IotaNetwork } from "../coin-
|
|
7
|
+
import { c as SuiNetwork } from "../coin-Br7pm0_k.js";
|
|
8
|
+
import { U as getMoveCalls, p as getMoveCalls$1 } from "../sui-CXlj8p9H.js";
|
|
9
|
+
import { c as IotaNetwork } from "../coin-C-mHtvER.js";
|
|
10
10
|
import { x as getRpcEndpoint, y as FuelNetwork } from "../fuel-B08qdTri.js";
|
|
11
11
|
import { GraphQLList, GraphQLNonNull, GraphQLObjectType } from "graphql";
|
|
12
12
|
import { DataBindingContext, Endpoints, PluginManager, ProcessorServiceImplV3, State, mergeProcessResults } from "@sentio/runtime";
|
package/dist/utils/index.js
CHANGED
|
@@ -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-
|
|
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-CyBjNK5t.js";
|
|
2
2
|
|
|
3
3
|
export { EthereumDexPrice, PriceUnit, SepoliaDexPrice, bytesToBigInt, estimateBlockNumberAtDate, estimateBlockNumberAtDateSlow, getCoinsThatHasPrice, getPackageRoot, getPriceBySymbol, getPriceByType, getPriceClient, ignoreEthCallException, timeOrBlockToBlockNumber, token_exports as token };
|
|
@@ -14133,6 +14133,65 @@ function getProvider(chainId) {
|
|
|
14133
14133
|
providers.set(key, provider);
|
|
14134
14134
|
return provider;
|
|
14135
14135
|
}
|
|
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
|
+
const TIMEOUT_WHAT_MAX = 120;
|
|
14142
|
+
function timeoutError(ms, what) {
|
|
14143
|
+
const bounded = what.length > TIMEOUT_WHAT_MAX ? `${what.slice(0, TIMEOUT_WHAT_MAX)}…(${what.length} chars)` : what;
|
|
14144
|
+
const e = /* @__PURE__ */ new Error(`rpc request did not settle within ${ms}ms: ${bounded}`);
|
|
14145
|
+
e.code = "TIMEOUT";
|
|
14146
|
+
return e;
|
|
14147
|
+
}
|
|
14148
|
+
/**
|
|
14149
|
+
* Run `task` on `executor` such that BOTH of these settle within the deadline:
|
|
14150
|
+
*
|
|
14151
|
+
* - the returned (outward) promise — a request whose transport dies without
|
|
14152
|
+
* ever settling (half-dead keep-alive connection, a rejection lost inside a
|
|
14153
|
+
* lower layer) must not hang its awaiters. For eth_call this is amplified by
|
|
14154
|
+
* the in-flight promise cache: the pending promise is cached by tag, so one
|
|
14155
|
+
* dead request would pin every later identical call, surviving even
|
|
14156
|
+
* process-level retries (the replayed block issues the same call and awaits
|
|
14157
|
+
* the same zombie promise);
|
|
14158
|
+
* - the queue task itself — PQueue must always get its concurrency slot back.
|
|
14159
|
+
* Racing only the outward promise would leave the never-settling task owning
|
|
14160
|
+
* its slot forever, and after `concurrency` such zombies every later call
|
|
14161
|
+
* could only time out in the queue.
|
|
14162
|
+
*
|
|
14163
|
+
* A task that only starts after the deadline rejects immediately, releasing
|
|
14164
|
+
* the slot without touching the transport. A task still running when its
|
|
14165
|
+
* remaining budget expires is abandoned; the orphaned transport promise gets a
|
|
14166
|
+
* swallow-handler so a late rejection is never unhandled.
|
|
14167
|
+
*
|
|
14168
|
+
* The timeout error carries code 'TIMEOUT' so the existing eth_call retry
|
|
14169
|
+
* path treats it exactly like an ethers transport timeout.
|
|
14170
|
+
*/
|
|
14171
|
+
function boundedTask(executor, what, task) {
|
|
14172
|
+
const ms = rpcCallTimeoutMs();
|
|
14173
|
+
const enqueued = Date.now();
|
|
14174
|
+
const settled = executor.add(() => {
|
|
14175
|
+
const remaining = ms - (Date.now() - enqueued);
|
|
14176
|
+
if (remaining <= 0) return Promise.reject(timeoutError(ms, what));
|
|
14177
|
+
const running = task();
|
|
14178
|
+
let timer;
|
|
14179
|
+
const deadline = new Promise((_, reject) => {
|
|
14180
|
+
timer = setTimeout(() => {
|
|
14181
|
+
running.catch(() => {});
|
|
14182
|
+
reject(timeoutError(ms, what));
|
|
14183
|
+
}, remaining);
|
|
14184
|
+
timer.unref?.();
|
|
14185
|
+
});
|
|
14186
|
+
return Promise.race([running, deadline]).finally(() => clearTimeout(timer));
|
|
14187
|
+
});
|
|
14188
|
+
let timer;
|
|
14189
|
+
const deadline = new Promise((_, reject) => {
|
|
14190
|
+
timer = setTimeout(() => reject(timeoutError(ms, what)), ms);
|
|
14191
|
+
timer.unref?.();
|
|
14192
|
+
});
|
|
14193
|
+
return Promise.race([settled, deadline]).finally(() => clearTimeout(timer));
|
|
14194
|
+
}
|
|
14136
14195
|
function getTag(prefix, value) {
|
|
14137
14196
|
return prefix + ":" + JSON.stringify(value, (k, v) => {
|
|
14138
14197
|
if (v == null) return "null";
|
|
@@ -14164,7 +14223,7 @@ var QueuedStaticJsonRpcProvider = class extends JsonRpcProvider {
|
|
|
14164
14223
|
this.executor = new PQueue({ concurrency });
|
|
14165
14224
|
}
|
|
14166
14225
|
async send(method, params) {
|
|
14167
|
-
if (method !== "eth_call" || params.length > 2) return await this.executor
|
|
14226
|
+
if (method !== "eth_call" || params.length > 2) return await boundedTask(this.executor, method, () => super.send(method, params));
|
|
14168
14227
|
const tag = getTag(method, params);
|
|
14169
14228
|
const block = params[params.length - 1];
|
|
14170
14229
|
let perform = this.#performCache.get(tag);
|
|
@@ -14172,7 +14231,8 @@ var QueuedStaticJsonRpcProvider = class extends JsonRpcProvider {
|
|
|
14172
14231
|
miss_count.add(1);
|
|
14173
14232
|
const handler = metricsStorage.getStore();
|
|
14174
14233
|
const queued = Date.now();
|
|
14175
|
-
|
|
14234
|
+
const what = `eth_call to=${params[0]?.to} block=${block}`;
|
|
14235
|
+
perform = boundedTask(this.executor, what, () => {
|
|
14176
14236
|
const started = Date.now();
|
|
14177
14237
|
processMetrics.processor_rpc_queue_duration.record(started - queued, {
|
|
14178
14238
|
chain_id: this._network.chainId.toString(),
|
|
@@ -20697,4 +20757,4 @@ async function ignoreEthCallException(promise, logError = false) {
|
|
|
20697
20757
|
|
|
20698
20758
|
//#endregion
|
|
20699
20759
|
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 };
|
|
20700
|
-
//# sourceMappingURL=utils-
|
|
20760
|
+
//# sourceMappingURL=utils-CyBjNK5t.js.map
|