@lido-nestjs/execution 1.11.0 → 1.12.0
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/ethers/debug-trace-block-by-hash.d.ts +4 -0
- package/dist/ethers/debug-trace-block-by-hash.js +13 -0
- package/dist/interfaces/debug-traces.d.ts +27 -0
- package/dist/provider/extended-json-rpc-batch-provider.d.ts +2 -0
- package/dist/provider/extended-json-rpc-batch-provider.js +9 -0
- package/dist/provider/simple-fallback-json-rpc-batch-provider.d.ts +2 -0
- package/dist/provider/simple-fallback-json-rpc-batch-provider.js +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ExtendedJsonRpcBatchProvider } from '../provider/extended-json-rpc-batch-provider';
|
|
2
|
+
import { SimpleFallbackJsonRpcBatchProvider } from '../provider/simple-fallback-json-rpc-batch-provider';
|
|
3
|
+
import { TraceConfig, TraceResult } from '../interfaces/debug-traces';
|
|
4
|
+
export declare function getDebugTraceBlockByHash(this: ExtendedJsonRpcBatchProvider | SimpleFallbackJsonRpcBatchProvider, blockHash: string, traceConfig: Partial<TraceConfig>): Promise<TraceResult[]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
async function getDebugTraceBlockByHash(blockHash, traceConfig) {
|
|
6
|
+
await this.getNetwork();
|
|
7
|
+
return (await this.perform('getDebugTraceBlockByHash', {
|
|
8
|
+
blockHash,
|
|
9
|
+
traceConfig,
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.getDebugTraceBlockByHash = getDebugTraceBlockByHash;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare type CallType = 'CALL' | 'DELEGATECALL' | 'STATICCALL';
|
|
2
|
+
export declare type TraceResultItem = {
|
|
3
|
+
from: string;
|
|
4
|
+
gas: string;
|
|
5
|
+
gasUsed: string;
|
|
6
|
+
to: string;
|
|
7
|
+
input: string;
|
|
8
|
+
type: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
calls?: TraceResultItem[];
|
|
11
|
+
};
|
|
12
|
+
export declare type TraceResult = {
|
|
13
|
+
txHash?: string;
|
|
14
|
+
result: TraceResultItem;
|
|
15
|
+
};
|
|
16
|
+
export declare type TraceResponse = {
|
|
17
|
+
id: number;
|
|
18
|
+
jsonrpc: string;
|
|
19
|
+
result: TraceResult[];
|
|
20
|
+
};
|
|
21
|
+
export declare type TraceConfig = {
|
|
22
|
+
tracer: string;
|
|
23
|
+
disableStorage: boolean;
|
|
24
|
+
disableStack: boolean;
|
|
25
|
+
enableMemory: boolean;
|
|
26
|
+
enableReturnData: boolean;
|
|
27
|
+
};
|
|
@@ -10,6 +10,7 @@ import { BlockTag } from '../ethers/block-tag';
|
|
|
10
10
|
import { TransactionRequest } from '@ethersproject/abstract-provider/src.ts/index';
|
|
11
11
|
import { MiddlewareCallback, MiddlewareService } from '@lido-nestjs/middleware';
|
|
12
12
|
import { FeeHistory } from '../ethers/fee-history';
|
|
13
|
+
import { TraceConfig, TraceResult } from '../interfaces/debug-traces';
|
|
13
14
|
export interface RequestPolicy {
|
|
14
15
|
jsonRpcMaxBatchSize: number;
|
|
15
16
|
maxConcurrentRequests: number;
|
|
@@ -72,6 +73,7 @@ export declare class ExtendedJsonRpcBatchProvider extends JsonRpcProvider {
|
|
|
72
73
|
protected _batchAggregatorTick(): void;
|
|
73
74
|
protected _startBatchAggregator(): void;
|
|
74
75
|
getFeeHistory(blockCount: number, newestBlock?: string | null | number, rewardPercentiles?: number[]): Promise<FeeHistory>;
|
|
76
|
+
getDebugTraceBlockByHash(blockHash: string, traceConfig: TraceConfig): Promise<TraceResult[]>;
|
|
75
77
|
prepareRequest(method: string, params: any): [string, Array<any>];
|
|
76
78
|
use(callback: MiddlewareCallback<Promise<any>>): void;
|
|
77
79
|
send(method: string, params: Array<unknown>): Promise<unknown>;
|
|
@@ -14,6 +14,7 @@ var formatterWithEip1898 = require('../ethers/formatter-with-eip1898.js');
|
|
|
14
14
|
var middleware = require('@lido-nestjs/middleware');
|
|
15
15
|
var feeHistory = require('../ethers/fee-history.js');
|
|
16
16
|
var errorCodes = require('../error/codes/error-codes.js');
|
|
17
|
+
var debugTraceBlockByHash = require('../ethers/debug-trace-block-by-hash.js');
|
|
17
18
|
|
|
18
19
|
exports.ExtendedJsonRpcBatchProvider = class ExtendedJsonRpcBatchProvider extends providers.JsonRpcProvider {
|
|
19
20
|
constructor(url, network, requestPolicy, fetchMiddlewares = []) {
|
|
@@ -140,6 +141,9 @@ exports.ExtendedJsonRpcBatchProvider = class ExtendedJsonRpcBatchProvider extend
|
|
|
140
141
|
async getFeeHistory(blockCount, newestBlock, rewardPercentiles) {
|
|
141
142
|
return feeHistory.getFeeHistory.call(this, blockCount, newestBlock, rewardPercentiles);
|
|
142
143
|
}
|
|
144
|
+
async getDebugTraceBlockByHash(blockHash, traceConfig) {
|
|
145
|
+
return debugTraceBlockByHash.getDebugTraceBlockByHash.call(this, blockHash, traceConfig);
|
|
146
|
+
}
|
|
143
147
|
prepareRequest(method, params) {
|
|
144
148
|
switch (method) {
|
|
145
149
|
case 'getFeeHistory':
|
|
@@ -147,6 +151,11 @@ exports.ExtendedJsonRpcBatchProvider = class ExtendedJsonRpcBatchProvider extend
|
|
|
147
151
|
'eth_feeHistory',
|
|
148
152
|
[params.blockCount, params.newestBlock, params.rewardPercentiles],
|
|
149
153
|
];
|
|
154
|
+
case 'getDebugTraceBlockByHash':
|
|
155
|
+
return [
|
|
156
|
+
'debug_traceBlockByHash',
|
|
157
|
+
[params.blockHash, params.traceConfig],
|
|
158
|
+
];
|
|
150
159
|
default:
|
|
151
160
|
return super.prepareRequest(method, params);
|
|
152
161
|
}
|
|
@@ -10,6 +10,7 @@ import { Deferrable } from '@ethersproject/properties';
|
|
|
10
10
|
import { TransactionRequest } from '@ethersproject/abstract-provider/src.ts/index';
|
|
11
11
|
import { EventType, Listener } from '@ethersproject/abstract-provider';
|
|
12
12
|
import { FeeHistory } from '../ethers/fee-history';
|
|
13
|
+
import { TraceConfig, TraceResult } from '../interfaces/debug-traces';
|
|
13
14
|
/**
|
|
14
15
|
* EIP-1898 support
|
|
15
16
|
* https://eips.ethereum.org/EIPS/eip-1898
|
|
@@ -40,6 +41,7 @@ export declare class SimpleFallbackJsonRpcBatchProvider extends BaseProvider {
|
|
|
40
41
|
static getFormatter(): Formatter;
|
|
41
42
|
on(eventName: EventType, listener: Listener): this;
|
|
42
43
|
getFeeHistory(blockCount: number, newestBlock?: string | null | number, rewardPercentiles?: number[]): Promise<FeeHistory>;
|
|
44
|
+
getDebugTraceBlockByHash(blockHash: string, traceConfig: Partial<TraceConfig>): Promise<TraceResult[]>;
|
|
43
45
|
protected get provider(): FallbackProvider;
|
|
44
46
|
protected switchToNextProvider(): void;
|
|
45
47
|
protected isNonRetryableError(error: Error | unknown): boolean;
|
|
@@ -13,6 +13,7 @@ var noNewBlocksWhilePolling_error = require('../error/no-new-blocks-while-pollin
|
|
|
13
13
|
var errors = require('../common/errors.js');
|
|
14
14
|
var allProvidersFailed_error = require('../error/all-providers-failed.error.js');
|
|
15
15
|
var feeHistory = require('../ethers/fee-history.js');
|
|
16
|
+
var debugTraceBlockByHash = require('../ethers/debug-trace-block-by-hash.js');
|
|
16
17
|
|
|
17
18
|
exports.SimpleFallbackJsonRpcBatchProvider = class SimpleFallbackJsonRpcBatchProvider extends providers.BaseProvider {
|
|
18
19
|
constructor(config, logger) {
|
|
@@ -66,7 +67,7 @@ exports.SimpleFallbackJsonRpcBatchProvider = class SimpleFallbackJsonRpcBatchPro
|
|
|
66
67
|
};
|
|
67
68
|
if (eventName === 'block') {
|
|
68
69
|
startDieTimer(-1);
|
|
69
|
-
super.on(eventName, function (...args) {
|
|
70
|
+
return super.on(eventName, function (...args) {
|
|
70
71
|
startDieTimer(args[0]);
|
|
71
72
|
return listener.apply(this, args);
|
|
72
73
|
});
|
|
@@ -76,6 +77,9 @@ exports.SimpleFallbackJsonRpcBatchProvider = class SimpleFallbackJsonRpcBatchPro
|
|
|
76
77
|
async getFeeHistory(blockCount, newestBlock, rewardPercentiles) {
|
|
77
78
|
return feeHistory.getFeeHistory.call(this, blockCount, newestBlock, rewardPercentiles);
|
|
78
79
|
}
|
|
80
|
+
async getDebugTraceBlockByHash(blockHash, traceConfig) {
|
|
81
|
+
return debugTraceBlockByHash.getDebugTraceBlockByHash.call(this, blockHash, traceConfig);
|
|
82
|
+
}
|
|
79
83
|
get provider() {
|
|
80
84
|
if (this.activeFallbackProviderIndex > this.fallbackProviders.length - 1) {
|
|
81
85
|
this.activeFallbackProviderIndex = 0;
|