@sig-net/midnight-serde 0.24.0-rc.8 → 0.24.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/README.md +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @sig-net/midnight-serde
|
|
2
2
|
|
|
3
|
-
A thin wrapper around the real [borsh-js](https://github.com/near/borsh-js) package,
|
|
3
|
+
A thin wrapper around the real [borsh-js](https://github.com/near/borsh-js) package, declared as an exact 2.0.0 dependency for workspace and published consumers. Schemas and value representations are native Borsh. Optional zero padding supports Midnight fixed byte containers.
|
|
4
4
|
|
|
5
5
|
## Use
|
|
6
6
|
|
|
@@ -47,7 +47,7 @@ The byte layout and the value constraints are separate contracts. The wrappers d
|
|
|
47
47
|
- borsh-js 2.0.0 treats fixed arrays with `len: 0` as dynamic arrays and adds a four-byte prefix. Rust Borsh fixed empty arrays occupy zero bytes. This is an implementation difference, not the fixed-array rule of the Borsh format.
|
|
48
48
|
- borsh-js 2.0.0 accepts non-zero Boolean bytes as true and can silently truncate overflowing integers. Rust's native Boolean decoder rejects byte 2. Do not use malformed-input behaviour as a cross-language contract.
|
|
49
49
|
|
|
50
|
-
For the EVM response path, `@sig-net/midnight`
|
|
50
|
+
For the EVM response path, `@sig-net/midnight` derives the Borsh schema from the request's ABI output schema (`bool` to `bool`, `uint256` to a 32-byte fixed array holding the value little-endian, `address` to a 20-byte fixed array, `bytesN` to an N-byte fixed array) and calls this package with it. No integer is narrowed off chain: a Compact circuit narrows the `Bytes<32>` with `checkedTruncationU128`. That mapping belongs to the EVM layer, not to these generic Borsh wrappers.
|
|
51
51
|
|
|
52
52
|
## Evidence and references
|
|
53
53
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sig-net/midnight-serde",
|
|
3
|
-
"version": "0.24.0
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sig-net/midnight-integration",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"vitest": "^5.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"borsh": "
|
|
45
|
+
"borsh": "2.0.0"
|
|
46
46
|
},
|
|
47
47
|
"main": "./dist/index.js",
|
|
48
48
|
"types": "./dist/index.d.ts"
|