@neuraiproject/neurai-assets 1.2.2 → 1.2.5
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 +21 -21
- package/dist/NeuraiAssets.global.js +329 -235
- package/dist/NeuraiAssets.global.js.map +1 -1
- package/dist/browser.js +329 -235
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +329 -235
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +329 -235
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Complete asset management library for Neurai blockchain. Supports creation, reis
|
|
|
10
10
|
- ✅ **RPC queries**: Complete wrapper for all asset query methods
|
|
11
11
|
- ✅ **Client-side validation**: Prevents errors before creating transactions
|
|
12
12
|
- ✅ **Owner token protection**: Validation to prevent permanent loss
|
|
13
|
-
- ✅ **
|
|
13
|
+
- ✅ **Legacy + AuthScript destinations**: Supports classic `N...` / `t...` and witness-v1 `nq1...` / `tnq1...` addresses
|
|
14
14
|
|
|
15
15
|
## Supported Asset Types
|
|
16
16
|
|
|
@@ -87,14 +87,14 @@ const signedTx = await wallet.signTransaction(result.rawTx);
|
|
|
87
87
|
const txid = await wallet.broadcastTransaction(signedTx);
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
You can also initialize the library with
|
|
90
|
+
You can also initialize the library with AuthScript addresses:
|
|
91
91
|
|
|
92
92
|
```javascript
|
|
93
93
|
const assetsPQ = new NeuraiAssets(rpc, {
|
|
94
|
-
network: 'xna
|
|
95
|
-
addresses: ['
|
|
96
|
-
changeAddress: '
|
|
97
|
-
toAddress: '
|
|
94
|
+
network: 'xna', // 'xna-pq' / 'xna-pq-test' remain valid aliases
|
|
95
|
+
addresses: ['nq1yourauthscriptaddress...'],
|
|
96
|
+
changeAddress: 'nq1yourauthscriptchange...',
|
|
97
|
+
toAddress: 'nq1recipientauthscriptaddress...'
|
|
98
98
|
});
|
|
99
99
|
```
|
|
100
100
|
|
|
@@ -148,8 +148,8 @@ const result = await assets.createDepinAsset({
|
|
|
148
148
|
});
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
> **Note**: DEPIN assets always use `units = 0`.
|
|
152
|
-
>
|
|
151
|
+
> **Note**: DEPIN assets always use `units = 0`. Recipient and change destinations
|
|
152
|
+
> can be either legacy or AuthScript, as long as they belong to the same chain family.
|
|
153
153
|
|
|
154
154
|
### Create UNIQUE Assets (NFTs)
|
|
155
155
|
|
|
@@ -504,17 +504,17 @@ const assets = new NeuraiAssets(rpc, {
|
|
|
504
504
|
toAddress: 't...'
|
|
505
505
|
});
|
|
506
506
|
|
|
507
|
-
//
|
|
507
|
+
// AuthScript mainnet using the canonical network label
|
|
508
508
|
const assetsPQ = new NeuraiAssets(rpc, {
|
|
509
|
-
network: 'xna
|
|
509
|
+
network: 'xna',
|
|
510
510
|
addresses: ['nq1...'],
|
|
511
511
|
changeAddress: 'nq1...',
|
|
512
512
|
toAddress: 'nq1...'
|
|
513
513
|
});
|
|
514
514
|
|
|
515
|
-
//
|
|
515
|
+
// AuthScript testnet using the canonical network label
|
|
516
516
|
const assetsPQTest = new NeuraiAssets(rpc, {
|
|
517
|
-
network: 'xna-
|
|
517
|
+
network: 'xna-test',
|
|
518
518
|
addresses: ['tnq1...'],
|
|
519
519
|
changeAddress: 'tnq1...',
|
|
520
520
|
toAddress: 'tnq1...'
|
|
@@ -523,13 +523,13 @@ const assetsPQTest = new NeuraiAssets(rpc, {
|
|
|
523
523
|
|
|
524
524
|
The library accepts these network names:
|
|
525
525
|
|
|
526
|
-
- `xna`:
|
|
527
|
-
- `xna-test`:
|
|
528
|
-
- `xna-pq`:
|
|
529
|
-
- `xna-pq-test`:
|
|
526
|
+
- `xna`: mainnet chain family, valid for both legacy `N...` and AuthScript `nq1...`
|
|
527
|
+
- `xna-test`: testnet chain family, valid for both legacy `t...` and AuthScript `tnq1...`
|
|
528
|
+
- `xna-pq`: compatibility alias for AuthScript mainnet flows
|
|
529
|
+
- `xna-pq-test`: compatibility alias for AuthScript testnet flows
|
|
530
530
|
|
|
531
|
-
If you need to derive
|
|
532
|
-
or `tnq1...` addresses into this library.
|
|
531
|
+
If you need to derive AuthScript addresses, use `neurai-key` and pass the resulting
|
|
532
|
+
`nq1...` or `tnq1...` addresses into this library.
|
|
533
533
|
|
|
534
534
|
## Update Configuration
|
|
535
535
|
|
|
@@ -648,6 +648,6 @@ const txid = await wallet.broadcastTransaction(signedTx);
|
|
|
648
648
|
console.log('Transaction ID:', txid);
|
|
649
649
|
```
|
|
650
650
|
|
|
651
|
-
For
|
|
652
|
-
`
|
|
653
|
-
|
|
651
|
+
For AuthScript wallets, derive addresses externally with `neurai-key`, then initialize
|
|
652
|
+
`NeuraiAssets` with those `nq1...` / `tnq1...` addresses. The recommended network labels
|
|
653
|
+
are `xna` and `xna-test`; `xna-pq` and `xna-pq-test` remain available as compatibility aliases.
|