@sentio/sdk 0.2.18 → 0.2.19
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/context.d.ts +2 -0
- package/dist/context.js +11 -0
- package/dist/context.js.map +1 -1
- package/package.json +1 -1
package/dist/context.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import { CounterResult, HistogramResult } from './gen/processor/protos/processor
|
|
|
2
2
|
import { BaseContract, EventFilter } from 'ethers';
|
|
3
3
|
import { Block, Log } from '@ethersproject/abstract-provider';
|
|
4
4
|
import { Meter } from './meter';
|
|
5
|
+
import Long from 'long';
|
|
5
6
|
export declare class Context<TContract extends BaseContract, TContractWrapper extends ContractWrapper<TContract>> {
|
|
6
7
|
contract: TContractWrapper;
|
|
7
8
|
chainId: string;
|
|
8
9
|
log?: Log;
|
|
9
10
|
block?: Block;
|
|
11
|
+
blockNumber: Long;
|
|
10
12
|
histograms: HistogramResult[];
|
|
11
13
|
counters: CounterResult[];
|
|
12
14
|
meter: Meter;
|
package/dist/context.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.SolanaContext = exports.ContractWrapper = exports.Context = void 0;
|
|
4
7
|
const meter_1 = require("./meter");
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
5
9
|
class Context {
|
|
6
10
|
contract;
|
|
7
11
|
chainId;
|
|
8
12
|
log;
|
|
9
13
|
block;
|
|
14
|
+
blockNumber;
|
|
10
15
|
histograms = [];
|
|
11
16
|
counters = [];
|
|
12
17
|
meter;
|
|
@@ -15,6 +20,12 @@ class Context {
|
|
|
15
20
|
this.chainId = chainId;
|
|
16
21
|
this.log = log;
|
|
17
22
|
this.block = block;
|
|
23
|
+
if (log) {
|
|
24
|
+
this.blockNumber = long_1.default.fromNumber(log.blockNumber);
|
|
25
|
+
}
|
|
26
|
+
else if (block) {
|
|
27
|
+
this.blockNumber = long_1.default.fromNumber(block.number);
|
|
28
|
+
}
|
|
18
29
|
this.meter = new meter_1.Meter(this);
|
|
19
30
|
}
|
|
20
31
|
}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;;;;AAGA,mCAA+B;AAC/B,gDAAuB;AAEvB,MAAa,OAAO;IAClB,QAAQ,CAAkB;IAC1B,OAAO,CAAQ;IACf,GAAG,CAAM;IACT,KAAK,CAAQ;IACb,WAAW,CAAM;IACjB,UAAU,GAAsB,EAAE,CAAA;IAClC,QAAQ,GAAoB,EAAE,CAAA;IAC9B,KAAK,CAAO;IAEZ,YAAY,QAA0B,EAAE,OAAe,EAAE,KAAa,EAAE,GAAS;QAC/E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,WAAW,GAAG,cAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;SACpD;aAAM,IAAI,KAAK,EAAE;YAChB,IAAI,CAAC,WAAW,GAAG,cAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;SACjD;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;CACF;AAtBD,0BAsBC;AAED,MAAa,eAAe;IAChB,QAAQ,CAAW;IAE7B,OAAO,CAA0D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