@xdc.org/interaction-detector 1.0.6 → 1.0.7
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/README.md +8 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,8 +68,8 @@ import { ContractWatcher } from '@xdc.org/interaction-detector';
|
|
|
68
68
|
|
|
69
69
|
const watcher = new ContractWatcher({
|
|
70
70
|
// RPC endpoints
|
|
71
|
-
rpcUrl: 'https://rpc.
|
|
72
|
-
wsUrl: 'wss://
|
|
71
|
+
rpcUrl: 'https://rpc.xdc.network',
|
|
72
|
+
wsUrl: 'wss://rpc.xdc.network/ws', // optional — enables real-time push
|
|
73
73
|
chainId: 50, // XDC Mainnet
|
|
74
74
|
|
|
75
75
|
// Contracts to monitor
|
|
@@ -128,7 +128,7 @@ import { ContractWatcher } from '@xdc.org/interaction-detector';
|
|
|
128
128
|
|
|
129
129
|
const watcher = new ContractWatcher({
|
|
130
130
|
// ─── Required ───────────────────────────────────────────
|
|
131
|
-
rpcUrl: 'https://rpc.
|
|
131
|
+
rpcUrl: 'https://rpc.xdc.network',
|
|
132
132
|
contracts: [
|
|
133
133
|
{
|
|
134
134
|
address: '0xContractAddress', // 0x or xdc prefix both work
|
|
@@ -140,7 +140,7 @@ const watcher = new ContractWatcher({
|
|
|
140
140
|
],
|
|
141
141
|
|
|
142
142
|
// ─── Optional: WebSocket (real-time push) ───────────────
|
|
143
|
-
wsUrl: 'wss://
|
|
143
|
+
wsUrl: 'wss://rpc.xdc.network/ws',
|
|
144
144
|
chainId: 50, // default: 50 (XDC Mainnet)
|
|
145
145
|
|
|
146
146
|
// ─── Optional: Explorer API (direct + internal calls) ───
|
|
@@ -261,7 +261,7 @@ Scans a block range for all events and interactions involving a contract. Automa
|
|
|
261
261
|
import { BlockScanner } from '@xdc.org/interaction-detector';
|
|
262
262
|
|
|
263
263
|
const scanner = new BlockScanner({
|
|
264
|
-
rpcUrl: 'https://rpc.
|
|
264
|
+
rpcUrl: 'https://rpc.xdc.network',
|
|
265
265
|
maxBlockRange: 100, // default: 100 (XDC limit)
|
|
266
266
|
concurrency: 3, // parallel chunk fetches
|
|
267
267
|
logLevel: 'info',
|
|
@@ -332,7 +332,7 @@ Traces a single transaction to extract the full execution story: call tree, stat
|
|
|
332
332
|
import { TransactionTracer } from '@xdc.org/interaction-detector';
|
|
333
333
|
|
|
334
334
|
const tracer = new TransactionTracer({
|
|
335
|
-
rpcUrl: 'https://archive-rpc.
|
|
335
|
+
rpcUrl: 'https://archive-rpc.xdc.network', // must support debug_traceTransaction
|
|
336
336
|
timeoutMs: 120_000, // tracing can be slow on complex txs
|
|
337
337
|
logLevel: 'info',
|
|
338
338
|
});
|
|
@@ -426,7 +426,7 @@ The `LogPoller` is used internally by `ContractWatcher` and `BlockScanner`, but
|
|
|
426
426
|
import { LogPoller, RpcClient } from '@xdc.org/interaction-detector';
|
|
427
427
|
import type { FetchLogsResult } from '@xdc.org/interaction-detector';
|
|
428
428
|
|
|
429
|
-
const rpc = new RpcClient('https://rpc.
|
|
429
|
+
const rpc = new RpcClient('https://rpc.xdc.network');
|
|
430
430
|
const poller = new LogPoller(
|
|
431
431
|
rpc,
|
|
432
432
|
['0x0000000000000000000000000000000000000088'], // addresses to monitor
|
|
@@ -890,6 +890,7 @@ See the `examples/` directory for runnable scripts:
|
|
|
890
890
|
Run any example with:
|
|
891
891
|
|
|
892
892
|
```bash
|
|
893
|
+
npm run build
|
|
893
894
|
npx tsx examples/basic-watcher.ts
|
|
894
895
|
npx tsx examples/trace-transaction.ts 0xYourTxHash
|
|
895
896
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xdc.org/interaction-detector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Standalone TypeScript library for detecting all on-chain contract interactions — events, direct calls, internal calls, and transaction tracing — on XDC and EVM-compatible chains.",
|
|
5
5
|
"author": "XinFinOrg",
|
|
6
6
|
"license": "MIT",
|