@xdc.org/interaction-detector 1.0.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.
Files changed (74) hide show
  1. package/README.md +767 -0
  2. package/dist/checkpoint/checkpoint.d.ts +32 -0
  3. package/dist/checkpoint/checkpoint.d.ts.map +1 -0
  4. package/dist/checkpoint/checkpoint.js +68 -0
  5. package/dist/checkpoint/checkpoint.js.map +1 -0
  6. package/dist/decoder/abi-registry.d.ts +49 -0
  7. package/dist/decoder/abi-registry.d.ts.map +1 -0
  8. package/dist/decoder/abi-registry.js +88 -0
  9. package/dist/decoder/abi-registry.js.map +1 -0
  10. package/dist/decoder/event-decoder.d.ts +31 -0
  11. package/dist/decoder/event-decoder.d.ts.map +1 -0
  12. package/dist/decoder/event-decoder.js +142 -0
  13. package/dist/decoder/event-decoder.js.map +1 -0
  14. package/dist/explorer/explorer-client.d.ts +65 -0
  15. package/dist/explorer/explorer-client.d.ts.map +1 -0
  16. package/dist/explorer/explorer-client.js +164 -0
  17. package/dist/explorer/explorer-client.js.map +1 -0
  18. package/dist/explorer/rate-limiter.d.ts +31 -0
  19. package/dist/explorer/rate-limiter.d.ts.map +1 -0
  20. package/dist/explorer/rate-limiter.js +79 -0
  21. package/dist/explorer/rate-limiter.js.map +1 -0
  22. package/dist/index.d.ts +24 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +26 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/rpc/rpc-client.d.ts +70 -0
  27. package/dist/rpc/rpc-client.d.ts.map +1 -0
  28. package/dist/rpc/rpc-client.js +136 -0
  29. package/dist/rpc/rpc-client.js.map +1 -0
  30. package/dist/rpc/ws-manager.d.ts +27 -0
  31. package/dist/rpc/ws-manager.d.ts.map +1 -0
  32. package/dist/rpc/ws-manager.js +161 -0
  33. package/dist/rpc/ws-manager.js.map +1 -0
  34. package/dist/scanner/block-scanner.d.ts +45 -0
  35. package/dist/scanner/block-scanner.d.ts.map +1 -0
  36. package/dist/scanner/block-scanner.js +180 -0
  37. package/dist/scanner/block-scanner.js.map +1 -0
  38. package/dist/tracer/call-tree-parser.d.ts +25 -0
  39. package/dist/tracer/call-tree-parser.d.ts.map +1 -0
  40. package/dist/tracer/call-tree-parser.js +80 -0
  41. package/dist/tracer/call-tree-parser.js.map +1 -0
  42. package/dist/tracer/state-diff-parser.d.ts +13 -0
  43. package/dist/tracer/state-diff-parser.d.ts.map +1 -0
  44. package/dist/tracer/state-diff-parser.js +70 -0
  45. package/dist/tracer/state-diff-parser.js.map +1 -0
  46. package/dist/tracer/transaction-tracer.d.ts +52 -0
  47. package/dist/tracer/transaction-tracer.d.ts.map +1 -0
  48. package/dist/tracer/transaction-tracer.js +107 -0
  49. package/dist/tracer/transaction-tracer.js.map +1 -0
  50. package/dist/types/index.d.ts +262 -0
  51. package/dist/types/index.d.ts.map +1 -0
  52. package/dist/types/index.js +8 -0
  53. package/dist/types/index.js.map +1 -0
  54. package/dist/utils/address.d.ts +29 -0
  55. package/dist/utils/address.d.ts.map +1 -0
  56. package/dist/utils/address.js +49 -0
  57. package/dist/utils/address.js.map +1 -0
  58. package/dist/utils/format.d.ts +20 -0
  59. package/dist/utils/format.d.ts.map +1 -0
  60. package/dist/utils/format.js +53 -0
  61. package/dist/utils/format.js.map +1 -0
  62. package/dist/utils/logger.d.ts +16 -0
  63. package/dist/utils/logger.d.ts.map +1 -0
  64. package/dist/utils/logger.js +58 -0
  65. package/dist/utils/logger.js.map +1 -0
  66. package/dist/watcher/contract-watcher.d.ts +56 -0
  67. package/dist/watcher/contract-watcher.d.ts.map +1 -0
  68. package/dist/watcher/contract-watcher.js +353 -0
  69. package/dist/watcher/contract-watcher.js.map +1 -0
  70. package/dist/watcher/log-poller.d.ts +24 -0
  71. package/dist/watcher/log-poller.d.ts.map +1 -0
  72. package/dist/watcher/log-poller.js +82 -0
  73. package/dist/watcher/log-poller.js.map +1 -0
  74. package/package.json +57 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Pluggable checkpoint persistence backends.
3
+ */
4
+ import type { CheckpointBackend } from '../types/index.js';
5
+ /**
6
+ * In-memory checkpoint — no persistence, for development/testing.
7
+ */
8
+ export declare class MemoryCheckpoint implements CheckpointBackend {
9
+ private store;
10
+ save(key: string, blockNumber: number): Promise<void>;
11
+ load(key: string): Promise<number | null>;
12
+ }
13
+ /**
14
+ * File-based checkpoint — persists to a JSON file.
15
+ * Suitable for simple production deployments.
16
+ */
17
+ export declare class FileCheckpoint implements CheckpointBackend {
18
+ private readonly filePath;
19
+ constructor(dirPath?: string);
20
+ save(key: string, blockNumber: number): Promise<void>;
21
+ load(key: string): Promise<number | null>;
22
+ private readFile;
23
+ }
24
+ /**
25
+ * Create a checkpoint backend from configuration.
26
+ */
27
+ export declare function createCheckpointBackend(config?: {
28
+ backend: string;
29
+ path?: string;
30
+ custom?: CheckpointBackend;
31
+ }): CheckpointBackend;
32
+ //# sourceMappingURL=checkpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../src/checkpoint/checkpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;GAEG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD,OAAO,CAAC,KAAK,CAAkC;IAEzC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAGhD;AAED;;;GAGG;AACH,qBAAa,cAAe,YAAW,iBAAiB;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,OAAO,GAAE,MAAwB;IAOvC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMrD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YAKjC,QAAQ;CASvB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,GACtE,iBAAiB,CAanB"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Pluggable checkpoint persistence backends.
3
+ */
4
+ import * as fs from 'fs';
5
+ import * as path from 'path';
6
+ /**
7
+ * In-memory checkpoint — no persistence, for development/testing.
8
+ */
9
+ export class MemoryCheckpoint {
10
+ store = new Map();
11
+ async save(key, blockNumber) {
12
+ this.store.set(key, blockNumber);
13
+ }
14
+ async load(key) {
15
+ return this.store.get(key) ?? null;
16
+ }
17
+ }
18
+ /**
19
+ * File-based checkpoint — persists to a JSON file.
20
+ * Suitable for simple production deployments.
21
+ */
22
+ export class FileCheckpoint {
23
+ filePath;
24
+ constructor(dirPath = './checkpoints') {
25
+ if (!fs.existsSync(dirPath)) {
26
+ fs.mkdirSync(dirPath, { recursive: true });
27
+ }
28
+ this.filePath = path.join(dirPath, 'checkpoints.json');
29
+ }
30
+ async save(key, blockNumber) {
31
+ const data = await this.readFile();
32
+ data[key] = blockNumber;
33
+ fs.writeFileSync(this.filePath, JSON.stringify(data, null, 2));
34
+ }
35
+ async load(key) {
36
+ const data = await this.readFile();
37
+ return data[key] ?? null;
38
+ }
39
+ async readFile() {
40
+ try {
41
+ if (fs.existsSync(this.filePath)) {
42
+ const content = fs.readFileSync(this.filePath, 'utf-8');
43
+ return JSON.parse(content);
44
+ }
45
+ }
46
+ catch { /* ignore corrupt file */ }
47
+ return {};
48
+ }
49
+ }
50
+ /**
51
+ * Create a checkpoint backend from configuration.
52
+ */
53
+ export function createCheckpointBackend(config) {
54
+ if (!config)
55
+ return new MemoryCheckpoint();
56
+ switch (config.backend) {
57
+ case 'file':
58
+ return new FileCheckpoint(config.path);
59
+ case 'custom':
60
+ if (!config.custom)
61
+ throw new Error('Custom checkpoint backend not provided');
62
+ return config.custom;
63
+ case 'memory':
64
+ default:
65
+ return new MemoryCheckpoint();
66
+ }
67
+ }
68
+ //# sourceMappingURL=checkpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint.js","sourceRoot":"","sources":["../../src/checkpoint/checkpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACnB,KAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE/C,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,WAAmB;QACzC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,GAAW;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IACrC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,cAAc;IACR,QAAQ,CAAS;IAElC,YAAY,UAAkB,eAAe;QAC3C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,WAAmB;QACzC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACn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ry — stores ABIs keyed by contract address.
3
+ * Supports topic hash → event name resolution and auto-fetch from explorer.
4
+ */
5
+ import { Interface } from 'ethers';
6
+ import type { ExplorerClient } from '../explorer/explorer-client.js';
7
+ import type { LogLevel } from '../types/index.js';
8
+ export interface RegisteredContract {
9
+ address: string;
10
+ iface: Interface;
11
+ name?: string;
12
+ /** topic0 hash → event name */
13
+ topicMap: Map<string, string>;
14
+ }
15
+ export declare class AbiRegistry {
16
+ private readonly logger;
17
+ private readonly contracts;
18
+ constructor(logLevel?: LogLevel);
19
+ /**
20
+ * Register a contract ABI for a given address.
21
+ */
22
+ register(address: string, abi: readonly any[] | any[], name?: string): void;
23
+ /**
24
+ * Auto-fetch ABI from block explorer and register it.
25
+ * Returns true if successful, false if ABI not found or not verified.
26
+ */
27
+ registerFromExplorer(address: string, explorer: ExplorerClient, name?: string): Promise<boolean>;
28
+ /**
29
+ * Get the registered contract info for an address.
30
+ */
31
+ get(address: string): RegisteredContract | undefined;
32
+ /**
33
+ * Check if an ABI is registered for this address.
34
+ */
35
+ has(address: string): boolean;
36
+ /**
37
+ * Get the event name for a topic0 hash from any registered contract.
38
+ */
39
+ getEventName(topic0: string): string | undefined;
40
+ /**
41
+ * Get all registered contract addresses.
42
+ */
43
+ getAddresses(): string[];
44
+ /**
45
+ * Get the human-readable name for a contract address.
46
+ */
47
+ getName(address: string): string | undefined;
48
+ }
49
+ //# sourceMappingURL=abi-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi-registry.d.ts","sourceRoot":"","sources":["../../src/decoder/abi-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8C;gBAE5D,QAAQ,CAAC,EAAE,QAAQ;IAI/B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAc3E;;;OAGG;IACG,oBAAoB,CACxB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,EACxB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC;IAuBnB;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAIpD;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI7B;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQhD;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAG7C"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * ABI Registry — stores ABIs keyed by contract address.
3
+ * Supports topic hash → event name resolution and auto-fetch from explorer.
4
+ */
5
+ import { Interface } from 'ethers';
6
+ import { normalizeAddress } from '../utils/address.js';
7
+ import { Logger } from '../utils/logger.js';
8
+ export class AbiRegistry {
9
+ logger;
10
+ contracts = new Map();
11
+ constructor(logLevel) {
12
+ this.logger = new Logger('AbiRegistry', logLevel ?? 'info');
13
+ }
14
+ /**
15
+ * Register a contract ABI for a given address.
16
+ */
17
+ register(address, abi, name) {
18
+ const normalizedAddr = normalizeAddress(address);
19
+ const iface = new Interface(abi);
20
+ // Build topic0 → event name map
21
+ const topicMap = new Map();
22
+ iface.forEachEvent((event) => {
23
+ topicMap.set(event.topicHash, event.name);
24
+ });
25
+ this.contracts.set(normalizedAddr, { address: normalizedAddr, iface, name, topicMap });
26
+ this.logger.debug(`Registered ABI for ${name ?? normalizedAddr} (${topicMap.size} events)`);
27
+ }
28
+ /**
29
+ * Auto-fetch ABI from block explorer and register it.
30
+ * Returns true if successful, false if ABI not found or not verified.
31
+ */
32
+ async registerFromExplorer(address, explorer, name) {
33
+ const normalizedAddr = normalizeAddress(address);
34
+ // Skip if already registered
35
+ if (this.contracts.has(normalizedAddr)) {
36
+ this.logger.debug(`ABI already registered for ${name ?? normalizedAddr}`);
37
+ return true;
38
+ }
39
+ try {
40
+ const abi = await explorer.getContractABI(address);
41
+ if (abi && Array.isArray(abi) && abi.length > 0) {
42
+ this.register(address, abi, name);
43
+ this.logger.info(`Auto-fetched ABI for ${name ?? normalizedAddr} (${abi.length} entries)`);
44
+ return true;
45
+ }
46
+ }
47
+ catch (err) {
48
+ this.logger.warn(`Failed to auto-fetch ABI for ${normalizedAddr}: ${err.message}`);
49
+ }
50
+ return false;
51
+ }
52
+ /**
53
+ * Get the registered contract info for an address.
54
+ */
55
+ get(address) {
56
+ return this.contracts.get(normalizeAddress(address));
57
+ }
58
+ /**
59
+ * Check if an ABI is registered for this address.
60
+ */
61
+ has(address) {
62
+ return this.contracts.has(normalizeAddress(address));
63
+ }
64
+ /**
65
+ * Get the event name for a topic0 hash from any registered contract.
66
+ */
67
+ getEventName(topic0) {
68
+ for (const contract of this.contracts.values()) {
69
+ const name = contract.topicMap.get(topic0);
70
+ if (name)
71
+ return name;
72
+ }
73
+ return undefined;
74
+ }
75
+ /**
76
+ * Get all registered contract addresses.
77
+ */
78
+ getAddresses() {
79
+ return Array.from(this.contracts.keys());
80
+ }
81
+ /**
82
+ * Get the human-readable name for a contract address.
83
+ */
84
+ getName(address) {
85
+ return this.contracts.get(normalizeAddress(address))?.name;
86
+ }
87
+ }
88
+ //# sourceMappingURL=abi-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi-registry.js","sourceRoot":"","sources":["../../src/decoder/abi-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAY5C,MAAM,OAAO,WAAW;IACL,MAAM,CAAS;IACf,SAAS,GAAoC,IAAI,GAAG,EAAE,CAAC;IAExE,YAAY,QAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,EAAE,QAAQ,IAAI,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,OAAe,EAAE,GAA2B,EAAE,IAAa;QAClE,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,GAAY,CAAC,CAAC;QAE1C,gCAAgC;QAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC3C,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE;YAC3B,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACvF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,IAAI,IAAI,cAAc,KAAK,QAAQ,CAAC,IAAI,UAAU,CAAC,C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AC;IAED;;OAEG;IACH,YAAY,CAAC,MAAc;QACzB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;YAC/C,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAC3C,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC;QACxB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAe;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC;IAC7D,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Generic event decoder — ABI-aware with XDC non-standard fallback.
3
+ *
4
+ * Primary: ethers Interface.parseLog() for standard ABI encoding.
5
+ * Fallback: manual byte-offset extraction for XDC non-standard encoding
6
+ * (all indexed params packed into data field with only topic[0]).
7
+ */
8
+ import type { DecodedEvent, RawLog, LogLevel } from '../types/index.js';
9
+ import { AbiRegistry } from './abi-registry.js';
10
+ export declare class EventDecoder {
11
+ private readonly logger;
12
+ private readonly registry;
13
+ constructor(registry: AbiRegistry, logLevel?: LogLevel);
14
+ /**
15
+ * Decode a raw log into a DecodedEvent.
16
+ * Returns null if no ABI is registered or decoding fails entirely.
17
+ * Always provides raw log data regardless of decode success.
18
+ */
19
+ decode(log: RawLog): DecodedEvent | null;
20
+ /**
21
+ * XDC non-standard fallback decoder.
22
+ * All parameters (including indexed ones) are ABI-encoded in the data field,
23
+ * with only topic[0] (event signature) in topics.
24
+ */
25
+ private decodeFromDataFallback;
26
+ /**
27
+ * Extract 32-byte words from hex data for manual inspection.
28
+ */
29
+ private extractWordsFromData;
30
+ }
31
+ //# sourceMappingURL=event-decoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-decoder.d.ts","sourceRoot":"","sources":["../../src/decoder/event-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;gBAE3B,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAKtD;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IA2DxC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAyD9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAQ7B"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Generic event decoder — ABI-aware with XDC non-standard fallback.
3
+ *
4
+ * Primary: ethers Interface.parseLog() for standard ABI encoding.
5
+ * Fallback: manual byte-offset extraction for XDC non-standard encoding
6
+ * (all indexed params packed into data field with only topic[0]).
7
+ */
8
+ import { AbiCoder } from 'ethers';
9
+ import { Logger } from '../utils/logger.js';
10
+ import { normalizeAddress } from '../utils/address.js';
11
+ import { parseHexOrDecimal } from '../utils/format.js';
12
+ const abiCoder = AbiCoder.defaultAbiCoder();
13
+ export class EventDecoder {
14
+ logger;
15
+ registry;
16
+ constructor(registry, logLevel) {
17
+ this.registry = registry;
18
+ this.logger = new Logger('EventDecoder', logLevel ?? 'info');
19
+ }
20
+ /**
21
+ * Decode a raw log into a DecodedEvent.
22
+ * Returns null if no ABI is registered or decoding fails entirely.
23
+ * Always provides raw log data regardless of decode success.
24
+ */
25
+ decode(log) {
26
+ if (!log || !log.topics || log.topics.length === 0)
27
+ return null;
28
+ const address = normalizeAddress(log.address);
29
+ const contract = this.registry.get(address);
30
+ const blockNumber = parseHexOrDecimal(log.blockNumber);
31
+ const logIndex = parseHexOrDecimal(log.logIndex);
32
+ // Base event (always populated)
33
+ const baseEvent = {
34
+ contract: address,
35
+ contractName: contract?.name,
36
+ blockNumber,
37
+ txHash: log.transactionHash,
38
+ logIndex,
39
+ timestamp: 0, // filled by caller
40
+ raw: log,
41
+ };
42
+ if (!contract) {
43
+ // No ABI registered — return event with topic0 as name
44
+ const eventName = this.registry.getEventName(log.topics[0]);
45
+ return {
46
+ ...baseEvent,
47
+ name: eventName ?? 'UnknownEvent',
48
+ signature: log.topics[0],
49
+ args: {},
50
+ };
51
+ }
52
+ // Try standard ethers decoding first
53
+ try {
54
+ const parsed = contract.iface.parseLog({
55
+ topics: log.topics,
56
+ data: log.data,
57
+ });
58
+ if (parsed) {
59
+ const args = {};
60
+ parsed.fragment.inputs.forEach((input, i) => {
61
+ args[input.name] = parsed.args[i];
62
+ });
63
+ return {
64
+ ...baseEvent,
65
+ name: parsed.name,
66
+ signature: parsed.signature,
67
+ args,
68
+ };
69
+ }
70
+ }
71
+ catch {
72
+ // ethers failed (BUFFER_OVERRUN) — try XDC fallback
73
+ }
74
+ // Fallback: XDC non-standard encoding
75
+ // All params packed into data field with only topic[0]
76
+ return this.decodeFromDataFallback(baseEvent, log, contract);
77
+ }
78
+ /**
79
+ * XDC non-standard fallback decoder.
80
+ * All parameters (including indexed ones) are ABI-encoded in the data field,
81
+ * with only topic[0] (event signature) in topics.
82
+ */
83
+ decodeFromDataFallback(baseEvent, log, contract) {
84
+ const topic0 = log.topics[0];
85
+ const eventName = contract.topicMap.get(topic0);
86
+ if (!eventName)
87
+ return null;
88
+ const data = log.data;
89
+ if (!data || data.length < 66) {
90
+ return {
91
+ ...baseEvent,
92
+ name: eventName,
93
+ signature: topic0,
94
+ args: {},
95
+ };
96
+ }
97
+ // Try to decode all params from data field
98
+ try {
99
+ const eventFragment = contract.iface.getEvent(eventName);
100
+ if (!eventFragment) {
101
+ return { ...baseEvent, name: eventName, signature: topic0, args: {} };
102
+ }
103
+ // Decode using all inputs as non-indexed (since they're all in data)
104
+ const types = eventFragment.inputs.map((i) => i.type);
105
+ const decoded = abiCoder.decode(types, data);
106
+ const args = {};
107
+ eventFragment.inputs.forEach((input, i) => {
108
+ args[input.name] = decoded[i];
109
+ });
110
+ this.logger.debug(`Decoded ${eventName} via XDC fallback (${types.length} params)`);
111
+ return {
112
+ ...baseEvent,
113
+ name: eventName,
114
+ signature: eventFragment.format('sighash'),
115
+ args,
116
+ };
117
+ }
118
+ catch (err) {
119
+ this.logger.debug(`Fallback decode failed for ${eventName}: ${err.message}`);
120
+ // Last resort — return with raw data, manual extraction
121
+ const args = this.extractWordsFromData(data);
122
+ return {
123
+ ...baseEvent,
124
+ name: eventName,
125
+ signature: topic0,
126
+ args: { _rawWords: args },
127
+ };
128
+ }
129
+ }
130
+ /**
131
+ * Extract 32-byte words from hex data for manual inspection.
132
+ */
133
+ extractWordsFromData(data) {
134
+ const words = [];
135
+ const hex = data.startsWith('0x') ? data.slice(2) : data;
136
+ for (let i = 0; i < hex.length; i += 64) {
137
+ words.push('0x' + hex.slice(i, i + 64));
138
+ }
139
+ return words;
140
+ }
141
+ }
142
+ //# sourceMappingURL=event-decoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-decoder.js","sourceRoot":"","sources":["../../src/decoder/event-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAuB,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,QAAQ,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;AAE5C,MAAM,OAAO,YA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AAC,IAAI,CAAC,CAAC;YAC7C,OAAO;gBACL,GAAG,SAAS;gBACZ,IAAI,EAAE,SAAS;gBACf,SAAS,EAAE,MAAM;gBACjB,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;aACV,CAAC;QACpB,CAAC;IACH,CAAC;IAED;;OAEG;IACK,oBAAoB,CAAC,IAAY;QACvC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;YACxC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Etherscan-compatible block explorer API client.
3
+ *
4
+ * Works with: XDCScan, Etherscan v2, BSCScan, PolygonScan, and any
5
+ * Etherscan-compatible API by changing the base URL.
6
+ */
7
+ import type { ExplorerConfig, ExplorerTransaction, LogLevel } from '../types/index.js';
8
+ export declare class ExplorerClient {
9
+ private readonly logger;
10
+ private readonly baseUrl;
11
+ private readonly apiKey?;
12
+ private readonly chainId?;
13
+ private readonly rateLimiter;
14
+ constructor(config: ExplorerConfig, logLevel?: LogLevel);
15
+ /**
16
+ * Get external transactions for an address (txlist).
17
+ */
18
+ getTransactions(address: string, options?: {
19
+ startBlock?: number;
20
+ endBlock?: number;
21
+ sort?: 'asc' | 'desc';
22
+ }): Promise<ExplorerTransaction[]>;
23
+ /**
24
+ * Get internal transactions for an address (txlistinternal).
25
+ */
26
+ getInternalTransactions(address: string, options?: {
27
+ startBlock?: number;
28
+ endBlock?: number;
29
+ sort?: 'asc' | 'desc';
30
+ }): Promise<ExplorerTransaction[]>;
31
+ /**
32
+ * Get internal transactions within a specific transaction (txlistinternal by txhash).
33
+ */
34
+ getInternalTransactionsByTx(txHash: string): Promise<ExplorerTransaction[]>;
35
+ /**
36
+ * Get event logs for an address (getLogs).
37
+ */
38
+ getLogs(address: string, options?: {
39
+ fromBlock?: number;
40
+ toBlock?: number;
41
+ topic0?: string;
42
+ }): Promise<any[]>;
43
+ /**
44
+ * Get verified contract ABI from explorer.
45
+ */
46
+ getContractABI(address: string): Promise<any[] | null>;
47
+ /**
48
+ * Get ERC-20 / XRC-20 token transfers for an address.
49
+ */
50
+ getTokenTransfers(address: string, options?: {
51
+ startBlock?: number;
52
+ endBlock?: number;
53
+ sort?: 'asc' | 'desc';
54
+ }): Promise<any[]>;
55
+ /**
56
+ * Get native balance for an address.
57
+ */
58
+ getBalance(address: string): Promise<string>;
59
+ /**
60
+ * Destroy the client and clean up rate limiter.
61
+ */
62
+ destroy(): void;
63
+ private request;
64
+ }
65
+ //# sourceMappingURL=explorer-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explorer-client.d.ts","sourceRoot":"","sources":["../../src/explorer/explorer-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEvF,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;gBAE9B,MAAM,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAQvD;;OAEG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