neo-n3-watch 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.
- package/LICENSE +150 -0
- package/README.md +95 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and its Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of discussing and
|
|
55
|
+
improving the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or designated in writing by the copyright owner as "Not a
|
|
57
|
+
Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those Claims licensable by such
|
|
76
|
+
Contributor that are necessarily infringed by their Contribution(s)
|
|
77
|
+
alone or by the combination of their Contribution(s) with the Work to
|
|
78
|
+
which such Contribution(s) was submitted.
|
|
79
|
+
|
|
80
|
+
4. Redistribution. You may reproduce and distribute copies of the Work
|
|
81
|
+
or Derivative Works thereof in any medium, with or without
|
|
82
|
+
modifications, and in Source or Object form, provided that You meet
|
|
83
|
+
the following conditions:
|
|
84
|
+
|
|
85
|
+
(a) You must give any other recipients of the Work or Derivative Works
|
|
86
|
+
a copy of this License; and
|
|
87
|
+
|
|
88
|
+
(b) You must cause any modified files to carry prominent notices
|
|
89
|
+
stating that You changed the files; and
|
|
90
|
+
|
|
91
|
+
(c) You must retain, in the Source form of any Derivative Works that
|
|
92
|
+
You distribute, all copyright, patent, trademark, and attribution
|
|
93
|
+
notices from the Source form of the Work, excluding those notices
|
|
94
|
+
that do not pertain to any part of the Derivative Works; and
|
|
95
|
+
|
|
96
|
+
(d) If the Work includes a "NOTICE" text file as a part of its
|
|
97
|
+
distribution, You must include a readable copy of the attribution
|
|
98
|
+
notices contained within such NOTICE file, in such places and in
|
|
99
|
+
such form as is reasonable, as either a part of the Derivative
|
|
100
|
+
Works, or in Source or Object form.
|
|
101
|
+
|
|
102
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
103
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
104
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
105
|
+
this License, without any additional terms or conditions.
|
|
106
|
+
|
|
107
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
108
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
109
|
+
except as required for reasonable and customary use in describing the
|
|
110
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
111
|
+
|
|
112
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed
|
|
113
|
+
to in writing, the Licensor provides the Work (and each Contributor
|
|
114
|
+
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES
|
|
115
|
+
OR CONDITIONS OF ANY KIND, either express or implied, including,
|
|
116
|
+
without limitation, any warranties of title, non-infringement,
|
|
117
|
+
merchantability, or fitness for a particular purpose. You are solely
|
|
118
|
+
responsible for determining the appropriateness of using or
|
|
119
|
+
reproducing the Work and assume any risks associated with Your
|
|
120
|
+
exercise of permissions under this License.
|
|
121
|
+
|
|
122
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
123
|
+
whether in tort (including negligence), contract, or otherwise, unless
|
|
124
|
+
required by applicable law or agreed to in writing, shall any
|
|
125
|
+
Contributor be liable to You for damages, including any direct,
|
|
126
|
+
indirect, special, incidental, or exemplary damages of any character
|
|
127
|
+
arising as a result of this License or out of the use or inability to
|
|
128
|
+
use the Work (even if such Contributor has been advised of the
|
|
129
|
+
possibility of such damages).
|
|
130
|
+
|
|
131
|
+
9. Accepting Warranty or Liability. While redistributing the Work or
|
|
132
|
+
Derivative Works thereof, You may choose to offer, and charge a fee
|
|
133
|
+
for, acceptance of support, warranty, indemnity, or other liability
|
|
134
|
+
obligations and/or rights consistent with this License. However, in
|
|
135
|
+
accepting such obligations, You may charge only on your own behalf
|
|
136
|
+
and on Your sole responsibility, not on behalf of any other
|
|
137
|
+
Contributor, and only if You agree to indemnify, defend, and hold
|
|
138
|
+
each Contributor harmless for any liability incurred by, or claims
|
|
139
|
+
asserted against, such Contributor by reason of your accepting any
|
|
140
|
+
such warranty or additional liability.
|
|
141
|
+
|
|
142
|
+
END OF TERMS AND CONDITIONS
|
|
143
|
+
|
|
144
|
+
Copyright 2026 thenotespublisher
|
|
145
|
+
|
|
146
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
147
|
+
you may not use this file except in compliance with the License.
|
|
148
|
+
You may obtain a copy of the License at
|
|
149
|
+
|
|
150
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# neo-n3-watch
|
|
2
|
+
|
|
3
|
+
Real-time Neo N3 contract event monitor. Stream on-chain notifications straight to your terminal — no node setup, no code, just `npx`.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
── Block 4821903 ───────────────────────────
|
|
7
|
+
TX 0xabc123...
|
|
8
|
+
Contract 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5
|
|
9
|
+
Event Transfer
|
|
10
|
+
Args
|
|
11
|
+
[0] Hash160 = 0xd2a4cff31913016155e38e474a2c06d08be276cf
|
|
12
|
+
[1] Hash160 = 0x0000000000000000000000000000000000000000
|
|
13
|
+
[2] Integer = 100000000
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Every Neo N3 dApp developer eventually needs to watch contract events while testing — but doing it today means either writing custom RPC polling code, running a full indexer, or staring at a block explorer. `neo-n3-watch` gives you a focused, zero-setup event stream in your terminal in one command.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g neo-n3-watch
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or run without installing:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx neo-n3-watch --contract 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
neo-n3-watch [options]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Options
|
|
39
|
+
|
|
40
|
+
| Flag | Description | Default |
|
|
41
|
+
|------|-------------|---------|
|
|
42
|
+
| `-c, --contract <hash>` | Filter by contract script hash | all contracts |
|
|
43
|
+
| `-e, --event <name>` | Filter by event name (e.g. `Transfer`) | all events |
|
|
44
|
+
| `-n, --network <name>` | `mainnet` or `testnet` | `mainnet` |
|
|
45
|
+
| `--rpc <url>` | Custom RPC node URL (overrides `--network`) | — |
|
|
46
|
+
| `-p, --poll <ms>` | Polling interval in milliseconds | `2000` |
|
|
47
|
+
|
|
48
|
+
### Examples
|
|
49
|
+
|
|
50
|
+
Watch all NEO token transfers on mainnet:
|
|
51
|
+
```bash
|
|
52
|
+
neo-n3-watch --contract 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5 --event Transfer
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Watch all events from any contract on testnet:
|
|
56
|
+
```bash
|
|
57
|
+
neo-n3-watch --network testnet
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Watch a custom contract with fast polling:
|
|
61
|
+
```bash
|
|
62
|
+
neo-n3-watch --contract 0xYOUR_CONTRACT_HASH --network testnet --poll 1000
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use a custom RPC node:
|
|
66
|
+
```bash
|
|
67
|
+
neo-n3-watch --rpc https://your-node.example.com:443 --contract 0xYOUR_CONTRACT_HASH
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Default RPC Nodes
|
|
71
|
+
|
|
72
|
+
| Network | URL |
|
|
73
|
+
|---------|-----|
|
|
74
|
+
| mainnet | `https://mainnet1.neo.coz.io:443` |
|
|
75
|
+
| testnet | `https://testnet1.neo.coz.io:443` |
|
|
76
|
+
|
|
77
|
+
## How It Works
|
|
78
|
+
|
|
79
|
+
`neo-n3-watch` polls `getBlockCount` on the Neo N3 RPC every `--poll` milliseconds. For each new block it fetches all transactions and their `ApplicationLog`, then filters notifications by contract hash and/or event name and pretty-prints them to your terminal.
|
|
80
|
+
|
|
81
|
+
No indexer. No database. No websocket. Just RPC polling — lightweight and works with any public Neo N3 node.
|
|
82
|
+
|
|
83
|
+
## Known Limitations
|
|
84
|
+
|
|
85
|
+
- Relies on RPC polling (not WebSocket push), so minimum latency equals the block time (~15s on mainnet)
|
|
86
|
+
- The RPC node must have the `ApplicationLogs` plugin enabled (all public COZ nodes do)
|
|
87
|
+
- Very high-volume contracts may produce a lot of output — use `--event` to narrow the stream
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
Apache 2.0 — see [LICENSE](./LICENSE)
|
|
92
|
+
|
|
93
|
+
## Contributing
|
|
94
|
+
|
|
95
|
+
PRs welcome. Open an issue first for bigger changes.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const neon_js_1 = require("@cityofzion/neon-js");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const ora_1 = __importDefault(require("ora"));
|
|
10
|
+
const commander_1 = require("commander");
|
|
11
|
+
const NETWORKS = {
|
|
12
|
+
mainnet: "https://mainnet1.neo.coz.io:443",
|
|
13
|
+
testnet: "https://testnet1.neo.coz.io:443",
|
|
14
|
+
};
|
|
15
|
+
function formatValue(val) {
|
|
16
|
+
if (val === null || val === undefined)
|
|
17
|
+
return chalk_1.default.gray("null");
|
|
18
|
+
if (typeof val === "object")
|
|
19
|
+
return JSON.stringify(val);
|
|
20
|
+
return String(val);
|
|
21
|
+
}
|
|
22
|
+
function printEvent(blockIndex, txHash, contract, eventName, state) {
|
|
23
|
+
console.log(chalk_1.default.cyan(`\n── Block ${blockIndex} ──────────────────────────────`));
|
|
24
|
+
console.log(chalk_1.default.white(` TX `) + chalk_1.default.gray(txHash));
|
|
25
|
+
console.log(chalk_1.default.white(` Contract`) + chalk_1.default.yellow(` ${contract}`));
|
|
26
|
+
console.log(chalk_1.default.white(` Event `) + chalk_1.default.green(` ${eventName}`));
|
|
27
|
+
if (state.length > 0) {
|
|
28
|
+
console.log(chalk_1.default.white(` Args`));
|
|
29
|
+
state.forEach((item, i) => {
|
|
30
|
+
console.log(chalk_1.default.gray(` [${i}]`) +
|
|
31
|
+
chalk_1.default.magenta(` ${item.type}`) +
|
|
32
|
+
chalk_1.default.white(` = ${formatValue(item.value)}`));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function watch(options) {
|
|
37
|
+
const rpcUrl = options.rpc ?? NETWORKS[options.network];
|
|
38
|
+
if (!rpcUrl) {
|
|
39
|
+
console.error(chalk_1.default.red(`Unknown network "${options.network}". Use mainnet, testnet, or --rpc <url>.`));
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
const client = new neon_js_1.rpc.RPCClient(rpcUrl);
|
|
43
|
+
const contractFilter = options.contract?.toLowerCase();
|
|
44
|
+
const eventFilter = options.event?.toLowerCase();
|
|
45
|
+
console.log(chalk_1.default.bold.green("\n neo-n3-watch"));
|
|
46
|
+
console.log(chalk_1.default.gray(` Network : ${options.network} (${rpcUrl})`));
|
|
47
|
+
console.log(chalk_1.default.gray(` Contract: ${contractFilter ?? chalk_1.default.italic("all contracts")}`));
|
|
48
|
+
console.log(chalk_1.default.gray(` Event : ${eventFilter ?? chalk_1.default.italic("all events")}`));
|
|
49
|
+
console.log(chalk_1.default.gray(` Poll : ${options.poll}ms\n`));
|
|
50
|
+
const spinner = (0, ora_1.default)("Connecting to Neo N3...").start();
|
|
51
|
+
let lastBlock;
|
|
52
|
+
try {
|
|
53
|
+
lastBlock = await client.getBlockCount() - 1;
|
|
54
|
+
spinner.succeed(chalk_1.default.green(`Connected. Starting from block ${lastBlock + 1}`));
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
spinner.fail(chalk_1.default.red("Failed to connect: " + err.message));
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
console.log(chalk_1.default.gray("Watching for events. Press Ctrl+C to stop.\n"));
|
|
61
|
+
async function poll() {
|
|
62
|
+
try {
|
|
63
|
+
const currentBlock = await client.getBlockCount() - 1;
|
|
64
|
+
for (let i = lastBlock + 1; i <= currentBlock; i++) {
|
|
65
|
+
const block = await client.getBlock(i, true);
|
|
66
|
+
const txs = block.tx;
|
|
67
|
+
if (!txs || txs.length === 0)
|
|
68
|
+
continue;
|
|
69
|
+
for (const tx of txs) {
|
|
70
|
+
let appLog;
|
|
71
|
+
try {
|
|
72
|
+
appLog = await client.getApplicationLog(tx.hash);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const executions = appLog?.executions ?? [];
|
|
78
|
+
for (const exec of executions) {
|
|
79
|
+
const notifications = exec?.notifications ?? [];
|
|
80
|
+
for (const notif of notifications) {
|
|
81
|
+
const notifContract = (notif.contract ?? "").toLowerCase();
|
|
82
|
+
const notifEvent = notif.eventname ?? "";
|
|
83
|
+
const state = notif.state?.value ?? [];
|
|
84
|
+
if (contractFilter && notifContract !== contractFilter)
|
|
85
|
+
continue;
|
|
86
|
+
if (eventFilter &&
|
|
87
|
+
notifEvent.toLowerCase() !== eventFilter)
|
|
88
|
+
continue;
|
|
89
|
+
printEvent(i, tx.hash, notif.contract, notifEvent, state);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
lastBlock = i;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
console.error(chalk_1.default.red("\nPoll error: " + err.message));
|
|
98
|
+
}
|
|
99
|
+
setTimeout(poll, options.poll);
|
|
100
|
+
}
|
|
101
|
+
poll();
|
|
102
|
+
}
|
|
103
|
+
commander_1.program
|
|
104
|
+
.name("neo-n3-watch")
|
|
105
|
+
.description("Real-time Neo N3 contract event monitor — stream on-chain events to your terminal")
|
|
106
|
+
.version("1.0.0")
|
|
107
|
+
.option("-c, --contract <hash>", "Contract script hash to filter (e.g. 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5)")
|
|
108
|
+
.option("-e, --event <name>", "Event name to filter (e.g. Transfer)")
|
|
109
|
+
.option("-n, --network <name>", "Network: mainnet or testnet (default: mainnet)", "mainnet")
|
|
110
|
+
.option("--rpc <url>", "Custom RPC node URL (overrides --network)")
|
|
111
|
+
.option("-p, --poll <ms>", "Polling interval in milliseconds (default: 2000)", (v) => parseInt(v, 10), 2000)
|
|
112
|
+
.action(watch);
|
|
113
|
+
commander_1.program.parse();
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,iDAA0C;AAC1C,kDAA0B;AAC1B,8CAAsB;AACtB,yCAAoC;AAEpC,MAAM,QAAQ,GAA2B;IACvC,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EAAE,iCAAiC;CAC3C,CAAC;AAEF,SAAS,WAAW,CAAC,GAAY;IAC/B,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjE,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED,SAAS,UAAU,CACjB,UAAkB,EAClB,MAAc,EACd,QAAgB,EAChB,SAAiB,EACjB,KAAyC;IAEzC,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,IAAI,CAAC,cAAc,UAAU,iCAAiC,CAAC,CACtE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,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,UAAU,CAAC,WAAW,EAAE,KAAK,WAAW;gCAExC,SAAS;4BAEX,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;wBAC5D,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,SAAS,GAAG,CAAC,CAAC;YAChB,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,gBAAgB,GAAI,GAAa,CAAC,OAAO,CAAC,CAAC,CAAC;QACtE,CAAC;QAED,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,EAAE,CAAC;AACT,CAAC;AAED,mBAAO;KACJ,IAAI,CAAC,cAAc,CAAC;KACpB,WAAW,CACV,mFAAmF,CACpF;KACA,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CACL,uBAAuB,EACvB,kFAAkF,CACnF;KACA,MAAM,CAAC,oBAAoB,EAAE,sCAAsC,CAAC;KACpE,MAAM,CACL,sBAAsB,EACtB,gDAAgD,EAChD,SAAS,CACV;KACA,MAAM,CAAC,aAAa,EAAE,2CAA2C,CAAC;KAClE,MAAM,CACL,iBAAiB,EACjB,kDAAkD,EAClD,CAAC,CAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,EAC9B,IAAI,CACL;KACA,MAAM,CAAC,KAAK,CAAC,CAAC;AAEjB,mBAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "neo-n3-watch",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Real-time Neo N3 contract event monitor — stream on-chain notifications to your terminal",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"neo-n3-watch": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "ts-node src/index.ts",
|
|
12
|
+
"prepublishOnly": "npm run build"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"neo",
|
|
16
|
+
"neo-n3",
|
|
17
|
+
"blockchain",
|
|
18
|
+
"smart-contract",
|
|
19
|
+
"events",
|
|
20
|
+
"notifications",
|
|
21
|
+
"cli",
|
|
22
|
+
"monitor",
|
|
23
|
+
"watch",
|
|
24
|
+
"nep-17"
|
|
25
|
+
],
|
|
26
|
+
"author": "thenotespublisher",
|
|
27
|
+
"license": "Apache-2.0",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/thenotespublisher/neo-n3-watch"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/thenotespublisher/neo-n3-watch#readme",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/thenotespublisher/neo-n3-watch/issues"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@cityofzion/neon-js": "^5.6.1",
|
|
38
|
+
"chalk": "^4.1.2",
|
|
39
|
+
"commander": "^11.1.0",
|
|
40
|
+
"ora": "^5.4.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"ts-node": "^10.9.2",
|
|
45
|
+
"typescript": "^5.3.3"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=16"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"README.md",
|
|
53
|
+
"LICENSE"
|
|
54
|
+
]
|
|
55
|
+
}
|