@neuraiproject/neurai-rpc 0.4.5 → 0.4.6

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/CHANGELOG.md ADDED
@@ -0,0 +1,128 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.4.6] - 2025-12-10
9
+
10
+ ### Fixed
11
+ - **IMPORTANT**: Removed an incorrect restriction that required DePIN assets to start with `&`.
12
+ - The Neurai DePIN system can operate with **any asset** on the blockchain.
13
+ - Documentation updated in `docs.json`, `docs.ts`, `DEPIN_IMPLEMENTATION_GUIDE.md`, and `neurai_methods.md`.
14
+ - Examples that showed tokens requiring the `&` prefix were corrected.
15
+ - Affected commands: `checkdepinvalidity`, `listdepinholders`, `freezedepin`, `unfreezedepin`, `selfrevokedepin`.
16
+
17
+ ### Changed
18
+ - Updated owner token example from `&ASSET!` to `ASSET!` in the documentation.
19
+ - Updated the technical implementation guide (`DEPIN_IMPLEMENTATION_GUIDE.md`) to reflect that any asset can be used.
20
+
21
+ ## [0.4.5] - 2025-12-09
22
+
23
+ ### Added
24
+ - 13 new RPC commands for the DePIN (Decentralized Physical Infrastructure Networks) system:
25
+
26
+ **DePIN Asset Management:**
27
+ - `checkdepinvalidity` - Verify whether a DePIN asset is valid for an address
28
+ - `listdepinholders` - List all holders of a DePIN asset with their validity status
29
+ - `freezedepin` - Freeze a DePIN asset for an address (owner only)
30
+ - `unfreezedepin` - Unfreeze a DePIN asset (owner only)
31
+ - `selfrevokedepin` - Self-revoke a DePIN asset (holder)
32
+
33
+ **DePIN Messaging System:**
34
+ - `depingetmsginfo` - Get messaging system information
35
+ - `depinsendmsg` - Send encrypted messages through a remote gateway (challenge/response)
36
+ - `depinsubmitmsg` - Submit pre-encrypted messages to the local pool
37
+ - `depingetmsg` - Retrieve and decrypt DePIN messages
38
+ - `depinclearmsg` - Remove messages from the pool
39
+ - `depingetpoolcontent` - Inspect the message pool
40
+ - `depinpoolstats` - Get message pool statistics
41
+
42
+ **AI/MCP Worker:**
43
+ - `depinmcpstatus` - MCP (Model Context Protocol) worker status
44
+
45
+ ### Changed
46
+ - TypeScript configuration updated with `tsconfig.json`.
47
+ - Targeting ES2015 for full Promise/Buffer/startsWith support.
48
+ - Parcel package versions consolidated to 2.16.3.
49
+
50
+ ### Fixed
51
+ - Removed TypeScript compilation warnings.
52
+ - Resolved version conflicts in Parcel dependencies.
53
+
54
+ ### Documentation
55
+ - Added `DEPIN_IMPLEMENTATION_GUIDE.md` - full technical guide to implement DePIN in web wallets.
56
+ - Detailed documentation of the dual-port architecture (8766 RPC + 19002 DePIN).
57
+ - Complete code examples with `DePINClient` and `DePINChat` classes.
58
+ - Documentation of the shared ECIES encryption protocol.
59
+ - Documentation of the challenge/response authentication protocol.
60
+
61
+ ## [0.4.4] - 2025-12-08
62
+
63
+ ### Added
64
+ - `getpubkey` command - Retrieve the public key associated with an address
65
+ - Specific documentation in `GETPUBKEY.md`
66
+ - Test scripts: `test-getpubkey.js` with CLI argument support
67
+
68
+ ### Changed
69
+ - Added `@types/node` as a development dependency
70
+
71
+ ## Previous Versions
72
+
73
+ See repository commits for the full history of changes.
74
+
75
+ ---
76
+
77
+ ## Migration Notes
78
+
79
+ ### From 0.4.5 to 0.4.6
80
+
81
+ **IMPORTANT**: If you were validating that DePIN tokens start with `&` in your code:
82
+
83
+ ❌ **Incorrect (old code):**
84
+ ```javascript
85
+ if (!token.startsWith('&')) {
86
+ throw new Error('Token must start with &');
87
+ }
88
+ ```
89
+
90
+ ✅ **Correct (0.4.6+):**
91
+ ```javascript
92
+ // DePIN tokens can be any asset on the blockchain
93
+ // Do not validate by prefix; use checkdepinvalidity instead
94
+ const validity = await rpc('checkdepinvalidity', [token, address]);
95
+ if (!validity.has_asset || validity.valid === 0) {
96
+ throw new Error('Invalid DePIN token for this address');
97
+ }
98
+ ```
99
+
100
+ **Updated examples:**
101
+ - `&FRANCE` → may be `FRANCE`, `&FRANCE`, or any other asset
102
+ - Owner token: `&ASSET!` → `ASSET!` (no mandatory prefix)
103
+
104
+ ### Node configuration
105
+
106
+ Ensure the following in `neurai.conf`:
107
+
108
+ ```ini
109
+ # DePIN Messaging
110
+ depinmsg=1
111
+ depintoken=YOUR_TOKEN_HERE # Any valid asset
112
+ depinport=19002
113
+ depinmaxmessagesize=1024
114
+ depinmessageexpiry=168
115
+ depinmaxpoolsize=100
116
+
117
+ # Asset Index (required for listdepinholders)
118
+ assetindex=1
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Links
124
+
125
+ - [GitHub repository](https://github.com/NeuraiProject/neurai-rpc)
126
+ - [NPM Package](https://www.npmjs.com/package/@neuraiproject/neurai-rpc)
127
+ - [DePIN documentation](./DEPIN_IMPLEMENTATION_GUIDE.md)
128
+ - [Issues & Support](https://github.com/NeuraiProject/neurai-rpc/issues)