scale-value
Encode and decode values of arbitrary shapes to SCALE bytes
0.18.2
5.9M downloads/mo
#4171 most downloaded on crates.io
paritytech/scale-value
What this package is like to depend on
Last release 6 months ago
17 Feb 2026
Release timing varies
gaps range from 8 days to 11 months
Most releases are documented
notes for 25 of 28 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
28 releases · first in 2022
2 releases in the last 12 months
see the full history below
Release timeline
28 releases · May 2022 to Feb 2026Releases
latest 28-
0.18.217 Feb 2026Nothing published for this version
-
0.18.109 Oct 2025Nothing published for this version
-
0.18.015 Nov 2024Release notes
Open source →0.18.0 (2024-11-15)
This release makes scale-value entirely no_std which is now using core::error::Error instead of std::error::Error as it was using before behind
the std feature. Because of that the std feature is now removed and the MSRV is bumped to 1.81.0. In addition it bumps a few dependencies to their latest versions.Changed
- Remove std feature and make the crate fully no_std
- Update
scale-decodeto v0.16.0 - Update
scale-encodeto v0.10.0 - Update
yapto v0.12.0 - Update
scale-bitsto v0.7.0 - Remove
scale-infodependency and the re-export PortableRegistry - Bump MSRV to 1.81.0
- Replace
derive_morewiththiserror
Full Changelog: v0.17.0...v0.18.0
Release notes
Open source →This release makes scale-value entirely no_std which is now using core::error::Error instead of std::error::Error as it was using before behind the std feature. Because of that the std feature is now removed and the MSRV is bumped to 1.81.0. In addition it bumps a few dependencies to their latest versions.
Changed
- Remove std feature and make the crate fully no_std
- Update
scale-decodeto v0.16.0 - Update
scale-encodeto v0.10.0 - Update
yapto v0.12.0 - Update
scale-bitsto v0.7.0 - Remove
scale-infodependency and the re-export PortableRegistry - Bump MSRV to 1.81.0
- Replace
derive_morewiththiserror
-
0.17.022 Oct 2024Release notes
Open source →0.17.0 (2024-10-22)
This release:
- Bumps
derive_morefrom 0.99 to 1.0 (#57) - Bumps
scale-decodefrom 0.13 to 0.14 (#58) - Bumps
scale-encodefrom 0.7 to 0.8 (#59) - Removes
frame-metadatadependency (#60)
Full Changelog: v0.16.2...v0.17.0
- Bumps
-
0.16.327 Sep 2024Release notes
Open source →This release exports
scale_value::scale::ValueVisitor<TypeResolver>, allowing the values to be created from functions likescale_decode::visitor::decode_with_visitor. -
0.16.209 Aug 2024Release notes
Open source →0.16.2 (2024-08-08)
This release adds
scale_value::stringify::to_writerandscale_value::stringify::to_writer_custom(to align with the already presentscale_value::stringify::from_str_custom), and also exposes a newscale_value::stringiy::custom_formatterscontaining a formatter for displaying things as hex.scale_value::stringify::to_writer_customallows for custom formatting of values, including a "pretty" spaced/indented formatting and a "compact" formatting which removes all unnecessary spaces. It also allows customising of the indentation and for custom formatters to be applied, as well as displaying the contexts of values if desired.See #52 for more information.
Release notes
Open source →This release adds
scale_value::stringify::to_writerandscale_value::stringify::to_writer_custom(to align with the already presentscale_value::stringify::from_str_custom), and also exposes a newscale_value::stringiy::custom_formatterscontaining a formatter for displaying things as hex.scale_value::stringify::to_writer_customallows for custom formatting of values, including a "pretty" spaced/indented formatting and a "compact" formatting which removes all unnecessary spaces. It also allows customising of the indentation and for custom formatters to be applied, as well as displaying the contexts of values if desired.See #52 for more information.
-
0.16.124 Jul 2024Release notes
Open source →0.16.1 (2024-07-24)
This release:
- Adds a "tracing decoder" (via
scale_value::scale::tracing::{decode_as_type,*}), which is likescale_value::scale::decode_as_type, but traces and hands back much more detail in case of a decoding failure, so that it's easier to track down where decoding failed. This is particularly useful when working with historic type information, which must be provided independently and could easily be misaligned with reality. (#52)
Release notes
Open source →This release:
- Adds a "tracing decoder" (via
scale_value::scale::tracing::{decode_as_type,*}), which is likescale_value::scale::decode_as_type, but traces and hands back much more detail in case of a decoding failure, so that it's easier to track down where decoding failed. This is particularly useful when working with historic type information, which must be provided independently and could easily be misaligned with reality. (#52)
- Adds a "tracing decoder" (via
-
0.16.015 May 2024Release notes
Open source →0.16.0 (2024-05-15)
This release:
- Bumps
scale-decodeto its latest version (0.13.0).
- Bumps
-
0.15.108 May 2024Release notes
Open source →Fixed
- Fix an infinite loop when trying to encode Composite values of the wrong shape ((#48)[https://github.com/paritytech/scale-value/pull/48])
-
0.15.029 Apr 2024Release notes
Open source →0.15.0 (2024-04-29)
This release bumps
scale-type-resolver,scale-encode,scale-decodeandscale-bitsto their latest versions.Release notes
Open source →This release bumps
scale-type-resolver,scale-encode,scale-decodeandscale-bitsto their latest versions. -
0.14.105 Mar 2024Release notes
Open source →0.14.1 (2024-03-04)
Added
A
scale_value::decode_as_fieldsfunction was added that can decode a series of values from some bytes given an iterator of type ids. Previously it was only possible through thescale_decode::DecodeAsFieldsimplementation ofscale_value::Composite<()>. With the new functionscale_value::Composite<R::TypeId>'s can be decoded for any type resolverR.Release notes
Open source →Added
A
scale_value::decode_as_fieldsfunction was added that can decode a series of values from some bytes given an iterator of type ids. Previously it was only possible through thescale_decode::DecodeAsFieldsimplementation ofscale_value::Composite<()>. With the new functionscale_value::Composite<R::TypeId>'s can be decoded for any type resolverR. -
0.14.027 Feb 2024Release notes
Open source →0.14.0 (2024-02-27)
Changed
The crate now uses
scale-type-resolverto be generic over the provider of type information that is used when encoding and decodingValues.One implication is that
scale_decode::IntoVisitoris now only implemented forValue<()>and no longer forValue<u32>. SoValue::decode_from_type()cannot be used anymore to create aValue<u32>that keeps type id information. Instead you now usescale_value::scale::decode_as_type()which can return the desiredValue<u32>.Release notes
Open source →Changed
The crate now uses
scale-type-resolverto be generic over the provider of type information that is used when encoding and decodingValues.One implication is that
scale_decode::IntoVisitoris now only implemented forValue<()>and no longer forValue<u32>. SoValue::decode_from_type()cannot be used anymore to create aValue<u32>that keeps type id information. Instead you now usescale_value::scale::decode_as_type()which can return the desiredValue<u32>. -
0.13.010 Nov 2023Release notes
Open source →0.13.0 (2023-11-10)
This release:
- Bumps
scale-decodeto its latest version.
- Bumps
-
0.12.002 Aug 2023Release notes
Open source →0.12.0 (2023-08-02)
Bumps
scale-encodeandscale-decodeto their latest versions (0.5 and 0.9 respectively).One effect that this has is that structs containing compact encoded values, after being encoded, now decode to composite types that better
reflect their original shape. For example,Compact(MyWrapper { inner: 123 }), when encoded, used to decode toValue::u128(123),
but now it decodes toValue::named_composite(vec![("inner", Value::u128(123))]).Release notes
Open source →Bumps
scale-encodeandscale-decodeto their latest versions (0.5 and 0.9 respectively).One effect that this has is that structs containing compact encoded values, after being encoded, now decode to composite types that better reflect their original shape. For example,
Compact(MyWrapper { inner: 123 }), when encoded, used to decode toValue::u128(123), but now it decodes toValue::named_composite(vec![("inner", Value::u128(123))]). -
0.11.019 Jul 2023Release notes
Open source →Added
- Adds support for
no_stdenvironments; disable the "std" feature flag for this. (#38) This PR makes a couple of small breaking changes:- The
from_stringfeature flag is nowfrom-string. - Some sub-
ErrorKind's infrom_stringno logner implstd::error::Error. ParseErrorKind::Customerrors are now strings rather than boxedstd::error::Errors to play nicer withno_std.
- The
- Adds a
value!macro to make constructingValue's much easier; thinkserde_json::value!. (#36)
Changed
- Bumps
scale-encodeandscale-decodeto their latest versions (0.4 and 0.8 respectively).
- Adds support for
-
0.10.031 May 2023Release notes
Open source →This release:
- bumps
scale-encodeandscale-decodeto their latest versions.
- bumps
-
0.9.030 May 2023Release notes
Open source →This release:
- bumps
scale-encodeandscale-decodeto their latest versions.
- bumps
-
0.8.130 May 2023Release notes
Open source →This patch release:
- Changes how composite
Value's are encoded to improve the likelihood that values will encode correctly. (#32)
- Changes how composite
-
0.8.011 May 2023Release notes
Open source →This release:
- Bumps to using
scale-info2.5.0 and uses field rather than method accessors as introduced by that change. - Introduces
scale_value::stringify::from_str_custom(), which allows you to construct aValueparser that can inject custom parsing logic while parsing strings into Values. - Adds two new custom parsers in a new
stringify::custom_parsersmodule for parsing hex values and ss58 addresses. These can be used in conjunction with the above. - Fixes a small bug in stringifying so that field and enum idents are no longer quoted unless necessary; this will make the output prettier.
There should be no breaking API changes.
Added
- Bumps to using
-
0.7.013 Mar 2023Release notes
Open source →The main change in this release is that it makes use of a new
scale-encodecrate and updatedscale-decodecrate for the SCALE encoding and decoding of Values.- Values now implement
DecodeAsTypeandEncodeAsType. - Composites now implement
DecodeAsFields. - As a small breaking API change, the
TypeIdpassed to the encode and decode methods is now a plainu32for simplicity, rather than a newtype struct.
It should be very straightforward to update to this release as the changes are mainly additive in nature.
Changed
- Use latest
scale-decodeand newscale-encodecrate for SCALE encoding and decoding Values. (#25)
- Values now implement
-
0.6.021 Sep 2022Release notes
Open source →Here we move to
scale_bitsfrombitvecto handle our encode/decode logic and provide a simple type to decode bits into. We also now add a WASM CI test, and will expect this crate (potentially via features in the future) to be WASM compatible.Changed
- Use
scale-bitsforBitSequencedecoding etc and enable WASM test. (#24)
- Use
-
0.5.002 Aug 2022Release notes
Open source →The main user-facing change in this release is that the SCALE bytes for compact-encoded structs previously decoded into
Compositevalues with the same degree of nesting (ie if the compact encoded value was nested within 2 structs, it would be decoded into a value nested inside 2Composites). This nesting has now been removed, and the compact value is returned directly. This should have no impact on re-encoding the Value, since encoding into single-field composites will just delegrate to the inner field type as needed.Internally, the SCALE decoding logic has mostly moved to
scale-decode, simplifying the logic in this crate (and exposing a more general/lower level decoding interface via that crate).Full list of changes:
Changed
- Use
scale-decodeforValuedecoding. (#22)
- Use
-
0.4.022 Jul 2022Release notes
Open source →The main addition in this release is the
Attrait (and corresponding.at()method) for indexing intoValues. There are also various small breaking changes as a result of tidying up various constructors, which will hopefully in general allow you to constructValues with a little less verbosity. Theuint/intconstructors have been made more consistent with their siblings and have been renamed tou128andi128.Full list of changes:
Added
- Index into values with at, and more generic/extra accessors/constructors. (#19)
-
0.3.020 Jul 2022Release notes
Open source →This release introduces a small breaking change:
scale_value::scale::encode_value_as_typenow takes a reference to a value rather than ownership of it, since on the happy path this shouldnt affect performance, and it would often mean cloning the entire value before passing it in, anyway.Full list of changes:
Changed
- SCALE encoding now accepts a reference, and make encoding slightly more flexible w.r.t newtype wrappers. (#17)
-
0.2.127 Jun 2022Release notes
Open source →Fixed
- Fix compile error on 32-bit architectures owing to BitVec not supporting a store type of u64 on them. Also fix an internal naming mixup w.r.t bitvec types. (#12)
-
0.2.014 Jun 2022Release notes
Open source →Added
- Added a string syntax for values, and the ability to parse
Value's from strings or encode them into strings (see the newstringifymodule exposed at the crate root). Parsing from strings requires thefrom_stringfeature to be enabled. (#7)
- Added a string syntax for values, and the ability to parse
-
0.1.023 May 2022Release notes
Open source →The initial release.
Added
- Added a
Valuetype that can be SCALE encoded and decoded using ascale_info::PortableRegistry, as well as serialized and deserialized to things viaserde. (#1)
- Added a
-
0.0.018 May 2022Nothing published for this version