@sentio/runtime 4.0.0-rc.6 → 4.0.0-rc.8
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/{chunk-Q4CE6IMV.js → chunk-7JGO6QCN.js} +12 -5
- package/lib/{chunk-Q4CE6IMV.js.map → chunk-7JGO6QCN.js.map} +1 -1
- package/lib/index.d.ts +18 -3
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/processor-runner.js +1 -1
- package/package.json +1 -1
- package/src/chain-config.ts +6 -1
- package/src/endpoints.ts +22 -4
- package/src/provider.ts +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -55,19 +55,34 @@ declare function parseSemver(version: string): Semver;
|
|
|
55
55
|
declare function compareSemver(a: Semver, b: Semver): number;
|
|
56
56
|
declare function locatePackageJson(pkgId: string): any;
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Resolved RPC endpoint for a chain: the base URL plus optional gRPC metadata
|
|
60
|
+
* (key-value pairs) attached to every request, e.g. the `authority` routing key
|
|
61
|
+
* for the Sui gRPC client talking to the Sentio rpc-node.
|
|
62
|
+
*/
|
|
63
|
+
interface ChainRpc {
|
|
64
|
+
url: string;
|
|
65
|
+
meta?: Record<string, string>;
|
|
66
|
+
}
|
|
58
67
|
declare class Endpoints {
|
|
59
68
|
static INSTANCE: Endpoints;
|
|
60
69
|
concurrency: number;
|
|
61
70
|
priceFeedAPI: string;
|
|
62
|
-
|
|
71
|
+
chainRpc: Map<string, ChainRpc>;
|
|
63
72
|
batchCount: number;
|
|
73
|
+
/** Convenience accessor for callers that only need the endpoint URL. */
|
|
74
|
+
getChainRpcUrl(chainId: string): string | undefined;
|
|
64
75
|
}
|
|
65
76
|
declare function configureEndpoints(options: any): void;
|
|
66
77
|
|
|
78
|
+
interface RpcConfig {
|
|
79
|
+
Url: string;
|
|
80
|
+
Meta?: Record<string, string>;
|
|
81
|
+
}
|
|
67
82
|
interface ChainConfig {
|
|
68
83
|
ChainID: string;
|
|
69
84
|
Https?: string[];
|
|
70
|
-
|
|
85
|
+
Rpc?: RpcConfig;
|
|
71
86
|
}
|
|
72
87
|
|
|
73
88
|
declare const program: Command<[string], {
|
|
@@ -1745,4 +1760,4 @@ declare const processMetrics: {
|
|
|
1745
1760
|
};
|
|
1746
1761
|
declare const metricsStorage: AsyncLocalStorage<string>;
|
|
1747
1762
|
|
|
1748
|
-
export { type ChainConfig, DummyProvider, Endpoints, GLOBAL_CONFIG, type GlobalConfig, ListStateStorage, MapStateStorage, ProcessorServiceImplV3, QueuedStaticJsonRpcProvider, type Semver, State, StateStorage, USER_PROCESSOR, compareSemver, configureEndpoints, dbMetrics, errorString, getProvider, locatePackageJson, makeEthCallKey, mergeProcessResults, mergeProcessResultsInPlace, metricsStorage, parseSemver, processMetrics, providerMetrics, recordRuntimeInfo };
|
|
1763
|
+
export { type ChainConfig, type ChainRpc, DummyProvider, Endpoints, GLOBAL_CONFIG, type GlobalConfig, ListStateStorage, MapStateStorage, ProcessorServiceImplV3, QueuedStaticJsonRpcProvider, type RpcConfig, type Semver, State, StateStorage, USER_PROCESSOR, compareSemver, configureEndpoints, dbMetrics, errorString, getProvider, locatePackageJson, makeEthCallKey, mergeProcessResults, mergeProcessResultsInPlace, metricsStorage, parseSemver, processMetrics, providerMetrics, recordRuntimeInfo };
|
package/lib/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
providerMetrics,
|
|
22
22
|
recordRuntimeInfo,
|
|
23
23
|
timeoutError
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7JGO6QCN.js";
|
|
25
25
|
import {
|
|
26
26
|
Plugin,
|
|
27
27
|
PluginManager
|
|
@@ -21194,7 +21194,7 @@ function getProvider2(chainId) {
|
|
|
21194
21194
|
chainId = import_chain.EthChainId.ETHEREUM;
|
|
21195
21195
|
}
|
|
21196
21196
|
const network = Network.from(parseInt(chainId));
|
|
21197
|
-
const address = Endpoints.INSTANCE.
|
|
21197
|
+
const address = Endpoints.INSTANCE.getChainRpcUrl(chainId);
|
|
21198
21198
|
const key = network.chainId.toString() + "-" + address;
|
|
21199
21199
|
let provider = providers.get(key);
|
|
21200
21200
|
if (provider) {
|
|
@@ -21202,7 +21202,7 @@ function getProvider2(chainId) {
|
|
|
21202
21202
|
}
|
|
21203
21203
|
if (address === void 0) {
|
|
21204
21204
|
throw Error(
|
|
21205
|
-
"Provider not found for chain " + network.chainId + ", configured chains: " + [...Endpoints.INSTANCE.
|
|
21205
|
+
"Provider not found for chain " + network.chainId + ", configured chains: " + [...Endpoints.INSTANCE.chainRpc.keys()].join(" ")
|
|
21206
21206
|
);
|
|
21207
21207
|
}
|
|
21208
21208
|
provider = new QueuedStaticJsonRpcProvider(
|