A dapp hands a wallet an `era` it encoded itself, as opaque bytes. There is no
way to render those as a variant without knowing the era algorithm, which is
exactly the kind of knowledge this crate refuses to hold — so they are accepted
as `Supplied::Raw`.
Not on trust, though. Raw bytes are decoded against the type the runtime
declares and re-encoded, and anything that does not come back identical is
refused: a short read, trailing bytes, a non-canonical compact. Appending them
unchecked would mean signing a payload whose shape nobody verified, and the only
report of that is `BadProof` from a node — which is also what a wrong key looks
like.
Also makes a single-field struct transparent whether or not its field is named,
so `CheckMetadataHash { mode }` takes `"Disabled"` the way `AccountId32([u8;32])`
takes its hex. Both wrappers are the runtime's choice, and the registry is what
says they are there.
Refs #3
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012uDUodEcRbBwNRi3UCmw8f
25 lines
686 B
JSON
25 lines
686 B
JSON
{
|
|
"author": "Quantus Network Developers <hello@quantus.com>",
|
|
"bugs": "https://git.lair.cafe/quantus/wasm/issues",
|
|
"description": "Metadata-driven SCALE encode/decode for the Quantus chain",
|
|
"engines": {
|
|
"node": ">=18"
|
|
},
|
|
"homepage": "https://git.lair.cafe/quantus/wasm/src/branch/main/packages/quantus-codec#readme",
|
|
"license": "Apache-2.0",
|
|
"name": "@quantus/codec",
|
|
"repository": {
|
|
"directory": "packages/quantus-codec",
|
|
"type": "git",
|
|
"url": "https://git.lair.cafe/quantus/wasm.git"
|
|
},
|
|
"sideEffects": false,
|
|
"type": "module",
|
|
"version": "0.2.0",
|
|
"main": "index.js",
|
|
"dependencies": {
|
|
"fflate": "^0.8.2",
|
|
"tslib": "^2.7.0"
|
|
}
|
|
}
|