@neuraiproject/neurai-assets 1.5.0 → 1.5.1

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 CHANGED
@@ -613,12 +613,26 @@ rejects with `unit must be larger than current unit selection`.
613
613
  The value read from the chain is still used, to check that the requested
614
614
  `quantity` fits the asset's precision.
615
615
 
616
- One consequence worth knowing: the **node-built** `rawTx` cannot reissue an
617
- asset whose `units` are above zero at all. `createrawtransaction`'s `reissue`
618
- object has no field for units and the node fills in `0`, so it refuses. That is
619
- a limitation of the RPC interface, not of the operation build those offline
620
- with `createFromOperation(result.createTransactionBuild)`. The error message
621
- says so when you hit it.
616
+ ### Reissue is built locally
617
+
618
+ `createrawtransaction`'s `reissue` object has no field for units, so the node
619
+ fills in `0` and refuses any asset whose units are above zero
620
+ (`unit must be larger than current unit selection`). Since 1.5.0 the two
621
+ reissue operations therefore skip that RPC and build their `rawTx` with
622
+ `createFromOperation`, which can say "keep the current units". They report
623
+ `buildStrategy: 'local-builder'`; every other operation still reports
624
+ `'rpc-node'`.
625
+
626
+ This is why `@neuraiproject/neurai-create-transaction` is a runtime
627
+ **dependency**, not just a dev one.
628
+
629
+ One consequence to know about: on the local path `result.outputs` and `rawTx`
630
+ describe the same operation but not the same output list. The node
631
+ auto-generates the owner-token return while processing a reissue entry, so the
632
+ RPC envelope omits it, while the locally built transaction carries it
633
+ explicitly — three entries in `outputs` against four vouts in `rawTx`. Both are
634
+ valid; parse `rawTx` when you need the outputs the chain will see, and do not
635
+ index `outputs` against its vouts.
622
636
 
623
637
  ## Owner Tokens - IMPORTANT
624
638
 
@@ -6020,7 +6020,12 @@ var NeuraiAssetsBundle = (function (exports) {
6020
6020
  return 0;
6021
6021
  }
6022
6022
 
6023
- const nameLength = Buffer.byteLength(String(descriptor.assetName), 'ascii');
6023
+ // One byte per character, matching how the payload encodes the name
6024
+ // (`serializeString` -> `asciiBytes`, which writes a single byte per char).
6025
+ // Node's byte-length helper would be equivalent here, but it hangs off a
6026
+ // global that browsers do not have: using it broke the extension bundle with
6027
+ // "Buffer is not defined", and this library does much of its work there.
6028
+ const nameLength = String(descriptor.assetName).length;
6024
6029
  const kind = descriptor.kind || 'transfer';
6025
6030
 
6026
6031
  // marker(3) + type(1) + CompactSize name length(1) + name