subxt-core
A no-std compatible subset of Subxt's functionality
0.44.3
6.2M downloads/mo
#4056 most downloaded on crates.io
paritytech/subxt
What this package is like to depend on
Last release 5 months ago
12 Mar 2026
Release timing varies
gaps range from 2 weeks to 5 months
Most releases are documented
notes for 12 of 17 stable releases
1 version withdrawn
withdrawn after publishing
2 years old
18 releases · first in 2024
4 releases in the last 12 months
see the full history below
Release timeline
18 releases · Apr 2024 to Mar 2026Releases
latest 18-
0.44.312 Mar 2026Nothing published for this version
-
0.44.209 Jan 2026Release notes
Open source →[0.44.2] - 2026-01-09
This manually cherry-picks #2142 onto the 0.44 branch to allow using $OUT_DIR in a couple of Subxt macro attributes.
Changed
- Allow passing $OUT_DIR in the runtime_metadata_path attribute #2142
-
0.44.108 Jan 2026Release notes
Open source →[0.44.1] - 2026-01-08
When using
.tip_of(some_tip, optional_asset_id)to configure a tip for transactions, the actual tip was being set to 0. This is now fixed.Fixed
- Fix tipping for ChargeAssetTxPayment tx extension(#2151)
-
0.44.029 Aug 2025Release notes
Open source →[0.44.0] - 2025-08-28
This small release primarily fixes a few issues, but also adds the code for a prelease of
subxt-historic, a new crate (at the moment) for working with historic blocks and state. Future releases will aim to stabilize this crate to the level of othersubxtcrates or otherwise merge the logic intosubxtitself.This is a minor version bump because, in theory at least, adding the
Clonebound to block headers in (#2047) is a breaking change, although I think it is unlikely that this will impact any users.Added
- Add prerelease
subxt-historiccrate for accessing historic (non head-of-chain) blocks (#2040)
Changed
Fixed
Release notes
Open source →This small release primarily fixes a few issues, but also adds the code for a prelease of
subxt-historic, a new crate (at the moment) for working with historic blocks and state. Future releases will aim to stabilize this crate to the level of othersubxtcrates or otherwise merge the logic intosubxtitself.This is a minor version bump because, in theory at least, adding the
Clonebound to block headers in (#2047) is a breaking change, although I think it is unlikely that this will impact any users.Added
- Add prerelease
subxt-historiccrate for accessing historic (non head-of-chain) blocks (#2040)
Changed
Fixed
- Add prerelease
-
0.43.018 Jul 2025Release notes
Open source →[0.43.0] - 2025-07-17
This is a reasonably small release which is mainly bug fixing, but has a couple of changes I'd like to elaborate on:
Remove
codec::Encodeandcodec::Decodederives from generated APIs by default (#2008)When generating an API using the
#[subxt::subxt(...)]macro (or programatically viasubxt-codegen), we had always previously addedparity_scale_codec::Encodeandparity_scale_codec::Decodederives to all of the generated types. Most places in Subxt have not made use of these for a long time (relying instead onscale_encode::EncodeAsTypeandscale_decode::DecodeAsType, since they allow encoding and encoding which takes the type information into account and can more gracefully handle incompatibilities).We eventually hit an issue to which the most appropriate fix was just to remove these derives.
If you still need the
parity_scale_codec::Encodeorparity_scale_codec::Decodederives on certain types, you have two options:- Use the
derive_for_typeattr to add them back where needed, eg:#[subxt::subxt( ... derive_for_type( path = "staging_xcm::v3::multilocation::MultiLocation", derive = "parity_scale_codec::Encode, parity_scale_codec::Decode", recursive ) )]
- Use the
derive_for_all_typesattr to add them back everywhere, eg:#[subxt::subxt( ... derive_for_all_types = "parity_scale_codec::Encode, parity_scale_codec::Decode" )]
Prefer (1) where possible to reduce the amount of generated code, and reduce the likelihood of running into issues around those derives in certain edge cases.
This PR changes some things around storage keys to remove one last requirement for
EncodeandDecodederives, and also as a side effect changesapi.storage().call_raw()slightly to no longer also try to decode the resulting type viaDecode, leaving this to the user (and also meaning it's much easier now for the user to obtain the raw bytes for some storage entry).In other words, instead of doing something like:
let (compact_len, metadata) = rt .call_raw::<(Compact<u32>, frame_metadata::RuntimeMetadataPrefixed)>( "Metadata_metadata", None, ) .await?;
You would now do:
let meta_bytes = rt.call_raw("Metadata_metadata", None).await?; let (compact_len, metadata): (Compact<u32>, frame_metadata::RuntimeMetadataPrefixed) = Decode::decode(&mut &*meta_bytes)?;
Address some issues around tx mortality (#2025)
Prior to this change, the intended behavior was that any transaction submitted via an
OnlineClientwould have a mortality of 32 blocks by default, and any transaction submitted via anOfflineClientwould be immortal by default. A couple of issues were present or cropped up however:- If you explicitly configure the mortality via setting params like
PolkadotExtrinsicParamsBuilder::new().mortal(32).build(), theOfflineClienttransaction would still be immortal, because it didn't have enough information to properly configure the mortality as asked for (by virtue of being offline and unable to fetch it). - The intended behaviour turned out to have been broken, and transactions were being submitted as immortal even via the
OnlineClientby default, unless mortality was explicitly configured. - There was no easy way to actually set the mortality for an
OfflineClienttransaction; you'd have to do something like this:let params = DefaultExtrinsicParamsBuilder::new(); params.5 = CheckMortalityParams::mortal_from_unchecked(for_n_blocks, from_block_n, from_block_hash);
With this PR, transactions are now mortal by default using the
OnlineClient, we now return an error if you try to construct a transaction with theOfflineClientand try to useparams.mortal(..)when configuring it, and we exposeparams.mortal_from_unchecked(..)to allow configuration for offline transactions without the ugly code above.In this PR, we also discovered an issue decoding
Erasand fixed this, so that decoding the mortality of a transaction when it is mortal should now work.Add FFI example (#2037)
I'd like to do a quick shoutout to @wassimans, who submitted an excellent example for how to interact with Subxt via the C FFI in Python and Node.JS. This is something I've wanted to add for a while, so it's lovely to see this new example which highlights one of the strengths of Subxt over Javascript based compatitors in the space.
All of the non-trivial changes in this release are listed below:
Added
- Add FFI example (#2037)
Changed
- Remove
codec::Encodeandcodec::Decodederives from generated APIs by default (#2008) - Address some issues around tx mortality (#2025)
Fixed
- Fix 'subxt explore storage': don't turn keys to bytes (#2038)
- Refactor: improve nonce and block injection in extrinsic params (#2032)
- Improve docs for
at_latest(#2035) - Clippy fixes for latest Rustc (#2033)
- docs: fix minor comment typos (#2027)
- chore: remove redundant backtick in comment (#2020)
- Keep codec attrs even when Encode/Decode not used (#2023)
- Run CI on v0.N.x branches or PRs to them for ease of backporting (#2017)
- De-dup types early in CLI/macro so that derives/substitutes work for de-duped types (#2015)
- If only one hasher, always treat any key as a single and not NMap key, even if it's a tuple. (#2010)
Release notes
Open source →This is a reasonably small release which is mainly bug fixing, but has a couple of changes I'd like to elaborate on:
Remove
codec::Encodeandcodec::Decodederives from generated APIs by default (#2008)When generating an API using the
#[subxt::subxt(...)]macro (or programatically viasubxt-codegen), we had always previously addedparity_scale_codec::Encodeandparity_scale_codec::Decodederives to all of the generated types. Most places in Subxt have not made use of these for a long time (relying instead onscale_encode::EncodeAsTypeandscale_decode::DecodeAsType, since they allow encoding and encoding which takes the type information into account and can more gracefully handle incompatibilities).We eventually hit an issue to which the most appropriate fix was just to remove these derives.
If you still need the
parity_scale_codec::Encodeorparity_scale_codec::Decodederives on certain types, you have two options:- Use the
derive_for_typeattr to add them back where needed, eg:#[subxt::subxt( ... derive_for_type( path = "staging_xcm::v3::multilocation::MultiLocation", derive = "parity_scale_codec::Encode, parity_scale_codec::Decode", recursive ) )] - Use the
derive_for_all_typesattr to add them back everywhere, eg:#[subxt::subxt( ... derive_for_all_types = "parity_scale_codec::Encode, parity_scale_codec::Decode" )]
Prefer (1) where possible to reduce the amount of generated code, and reduce the likelihood of running into issues around those derives in certain edge cases.
This PR changes some things around storage keys to remove one last requirement for
EncodeandDecodederives, and also as a side effect changesapi.storage().call_raw()slightly to no longer also try to decode the resulting type viaDecode, leaving this to the user (and also meaning it's much easier now for the user to obtain the raw bytes for some storage entry).In other words, instead of doing something like:
let (compact_len, metadata) = rt .call_raw::<(Compact<u32>, frame_metadata::RuntimeMetadataPrefixed)>( "Metadata_metadata", None, ) .await?;You would now do:
let meta_bytes = rt.call_raw("Metadata_metadata", None).await?; let (compact_len, metadata): (Compact<u32>, frame_metadata::RuntimeMetadataPrefixed) = Decode::decode(&mut &*meta_bytes)?;Address some issues around tx mortality (#2025)
Prior to this change, the intended behavior was that any transaction submitted via an
OnlineClientwould have a mortality of 32 blocks by default, and any transaction submitted via anOfflineClientwould be immortal by default. A couple of issues were present or cropped up however:- If you explicitly configure the mortality via setting params like
PolkadotExtrinsicParamsBuilder::new().mortal(32).build(), theOfflineClienttransaction would still be immortal, because it didn't have enough information to properly configure the mortality as asked for (by virtue of being offline and unable to fetch it). - The intended behaviour turned out to have been broken, and transactions were being submitted as immortal even via the
OnlineClientby default, unless mortality was explicitly configured. - There was no easy way to actually set the mortality for an
OfflineClienttransaction; you'd have to do something like this:let params = DefaultExtrinsicParamsBuilder::new(); params.5 = CheckMortalityParams::mortal_from_unchecked(for_n_blocks, from_block_n, from_block_hash);
With this PR, transactions are now mortal by default using the
OnlineClient, we now return an error if you try to construct a transaction with theOfflineClientand try to useparams.mortal(..)when configuring it, and we exposeparams.mortal_from_unchecked(..)to allow configuration for offline transactions without the ugly code above.In this PR, we also discovered an issue decoding
Erasand fixed this, so that decoding the mortality of a transaction when it is mortal should now work.Add FFI example (#2037)
I'd like to do a quick shoutout to @wassimans, who submitted an excellent example for how to interact with Subxt via the C FFI in Python and Node.JS. This is something I've wanted to add for a while, so it's lovely to see this new example which highlights one of the strengths of Subxt over Javascript based compatitors in the space.
All of the non-trivial changes in this release are listed below:
Added
- Add FFI example (#2037)
Changed
- Remove
codec::Encodeandcodec::Decodederives from generated APIs by default (#2008) - Address some issues around tx mortality (#2025)
Fixed
- Fix 'subxt explore storage': don't turn keys to bytes (#2038)
- Refactor: improve nonce and block injection in extrinsic params (#2032)
- Improve docs for
at_latest(#2035) - Clippy fixes for latest Rustc (#2033)
- docs: fix minor comment typos (#2027)
- chore: remove redundant backtick in comment (#2020)
- Keep codec attrs even when Encode/Decode not used (#2023)
- Run CI on v0.N.x branches or PRs to them for ease of backporting (#2017)
- De-dup types early in CLI/macro so that derives/substitutes work for de-duped types (#2015)
- If only one hasher, always treat any key as a single and not NMap key, even if it's a tuple. (#2010)
- Use the
-
0.42.112 May 2025Release notes
Open source →This patch release reduces the rust-version to 1.85.0, given that we don't use any features newer than this at the moment.
-
0.42.012 May 2025Release notes
Open source →The primary benefit of this release is introducing support for the about-to-be-stabilised-in-polkadot-sdk V16 metadata, and with that, support for calling Pallet View Functions on runtimes which will support this. Pallet View Functions are used much like Runtime APIs, except that they are declared in specific pallets and not declared at the runtime-wide level, allowing pallets to carry their own APIs with them.
Pallet View Functions
Calling a Pallet View Function in this Subxt release will look like:
use runtime::proxy::view_functions::check_permissions::{Call, ProxyType}; // Construct the call, providing the two arguments. let view_function_call = runtime::view_functions() .proxy() .check_permissions( Call::System(runtime::system::Call::remark { remark: b"hi".to_vec() }), ProxyType::Any ); // Submit the call and get back a result. let _is_call_allowed = api .view_functions() .at_latest() .await? .call(view_function_call) .await?;Like Runtime APIs and others, the dynamic API can also be used to call into Pallet View Functions, which has the advantage of not needing the statically generated interface, but the downside of not being strongly typed. This looks like the following:
use scale_value::value; let metadata = api.metadata(); // Look up the query ID for the View Function in the node metadata: let query_id = metadata .pallet_by_name("Proxy") .unwrap() .view_function_by_name("check_permissions") .unwrap() .query_id(); // Construct the call, providing the two arguments. let view_function_call = subxt::dynamic::view_function_call( *query_id, vec![ value!(System(remark(b"hi".to_vec()))), value!(Any()) ], ); // Submit the call and get back a result. let _is_call_allowed = api .view_functions() .at_latest() .await? .call(view_function_call) .await?;Updated
ConfigtraitAnother change to be aware of is that our
Configtrait has been tweaked. TheHashassociated type is no longer needed, as it can be obtained via theHasherassociated type already, andPolkadotConfig/SubstrateConfignow set the hasher by default to beDynamicHasher256, which will (when V16 metadata is available for a runtime) automatically select between Keccak256 and BlakeTwo256 hashers depending on what the chain requires.Other changes
We also solidify our support for V1 archive RPCs, upgrade the codebase to Rust 2024 edition, and a bunch of other changes, the full list of which is here:
Added
- Support v16 metadata and use it by default if it's available (#1999)
- Metadata V16: Implement support for Pallet View Functions (#1981)
- Metadata V16: Be more dynamic over which hasher is used. (#1974)
Changed
- Update to 2024 edition (#2001)
- Update Smoldot to latest version (#1991)
- Update native test timeout to 45 mins (#2002)
- chore(deps): tokio ^1.44.2 (#1989)
- Add DefaultParams to allow more transaction extensions to be used when calling _default() methods (#1979)
- Use wat instead of wabt to avoid CI cmake error (and use supported dep) (#1980)
- Support v1 archive RPCs (#1977)
- Support V16 metadata and refactor metadata code (#1967)
- Allow submitting transactions ignoring follow events (#1962)
- Improve error message regarding failure to extract metadata from WASM runtime (#1961)
- Add docs for subxt-rpcs and fix example (#1954)
Fixed
-
0.41.011 Mar 2025Release notes
Open source →This release makes two main changes:
Add
subxt-rpcscrate.Previously, if you wanted to make raw RPC calls but weren't otherwise interested in using the higher level Subxt interface, you still needed to include the entire Subxt crate.
Now, one can depend on
subxt-rpcsdirectly. This crate implements the new RPC-V2chainHead/transactionendpoints as well as the currently unstablearchiveendpoints. it also implements various legacy endpoints that Subxt uses as a fallback to the modern ones. It also provides several feature gated clients for interacting with them:- jsonrpsee: A
jsonrpseebased RPC client for connecting to individual RPC nodes. - unstable-light-client: A Smoldot based light client which connects to multiple nodes in chains via p2p and verifies everything handed back, removing the need to trust any individual nodes.
- reconnecting-rpc-client: Another
jsonrpseebased client which handles reconnecting automatically in the event of network issues. - mock-rpc-client: A mock RPC client that can be used in tests.
Custom clients can be implemented if preferred.
Example usage via
jsonrpseefeature:use subxt_rpcs::{RpcClient, ChainHeadRpcMethods}; // Connect to a local node: let client = RpcClient::from_url("ws://127.0.0.1:9944").await?; // Use chainHead/archive V2 methods: let methods = ChainHeadRpcMethods::new(client); // Call some RPC methods (in this case a subscription): let mut follow_subscription = methods.chainhead_v1_follow(false).await.unwrap(); while let Some(follow_event) = follow_subscription.next().await { // do something with events.. }Support creating V5 transactions.
Subxt has supported decoding V5 transactions from blocks since 0.38.0, but now it also supports constructing V5 transactions where allowed. Some naming changes have also taken place to align with the Substrate terminology now around transactions (see #1931 for more!).
The main changes here are:
subxt_corenow contains versioned methods for creating each of the possible types of transaction (V4 unsigned, V4 signed, V5 "bare" or V5 "general"), enabling the APIs to be tailored for each case.subxtexposes higher level wrappers these (ieapi.tx().create_v4_unsigned(..),api.tx().create_v5_bare(..)), but also continues to expose the same standard APIs for creating transactions which will, under the hood, decide what to create based on the chain we're connected to.- APIs like
sign_and_submitnow take aT::AccountIdrather than aT::Addresssince it was found to not be useful to provide the latter, and V5 transactions only expect anT::AccountId. - Signed Extensions are now referred to as Transaction Extensions, and we've tweaked the interface around how these work slightly to accomodate the fact that in V5 transactions, the signature is passed into a transaction extension where applicable (
VerifySignature). - As a side effect, it's simpler to set mortality on transactions; no more block hash needs to be provided; only the number of blocks you would like a transaction to live for.
A full list of the relevant changes is as follows:
Added
- Support constructing and submitting V5 transactions (#1931)
- Add archive RPCs to subxt-rpcs (#1940)
- Document generating interface from Runtime WASM and change feature to
runtime-wasm-path(#1936) - Split RPCs into a separate crate (#1910)
Changed
- jsonrpsee: A
-
0.40.103 Jun 2025Nothing published for this version
-
0.40.006 Mar 2025Release notes
Open source →This release reverts the usage of the
polkadot-sdkumbrella crate, which was causing issues such as an increased number of dependencies in Cargo.lock. For more details, see #1925.Additionally, this update bumps the Polkadot SDK-related dependencies to their latest versions, ensuring compatibility and stability.
Fixed
- Remove usage of polkadot-sdk umbrella crate (#1926)
Full Changelog: https://github.com/paritytech/subxt/compare/v0.39.0...v0.40.0
-
0.39.005 Feb 2025Release notes
Open source →This release is mostly bug fixes and changes. The only change that should be a breaking change is removing the
substrate-compatfeature flag (see #1850), which we'll go into more detail about.The
substrate-compatfeature flag has been removed.The
substrate-compatfeature flag essentially provided:- An implementation of the
subxt::config::Headertrait for anything implementingsp_runtime::traits::Header(here). - Same for
subxt::config::Hasherand anything implementingsp_runtime::traits::Hasher(here). - A
subxt_core::tx::PairSignertype which could be given something implementingsp_core::Pairand then be used to sign transactions (here). - From impls for
sp_runtime::AccountId32and related forsubxt::utils::AccountId32(here). - Likewise for
sp_runtime::MultiAddressandsubxt::utils::MultiAddress(here). - Likewise for
sp_runtime::MultiSignatureandsubxt::utils::MultiSignature(here).
While useful, providing these features in Subxt is almost impossible to maintain: we can only support a single version of
sp_runtime/sp_coreat a time, but many versions are in use in the wild. This led to various issues regarding the mismatch betweensp_*crates in use and a given version of Subxt. More generally, the goal of Subxt is to be independent from any specific version of Substrate, and communicate via the exposed RPC APIs in order to work across any compatible Substrate version (or indeed, alternative implementations that follow things like the RPC spec).As a result, we've taken the decision to remove this compatibility layer from Subxt itself. To migrate away from this feature, we suggest:
- Using the example here to see how to use a Substrate signer to sign Subxt transactions.
- Looking at
subxt_signerinstead, if it's a viable alternative in your case. - Following the "here" links above to see what impls were removed. Impls can generally be recreated as needed using wrapper types which allow converting between Substrate and Subxt types/traits, for instance:
// Wrap a substrate header type in this to impl the subxt Header trait: struct SubxtHeader<T>(pub T); // This basically copies the code removed from Subxt, but on a wrapper type: impl <T> subxt::config::Header for SubxtHeader<T> where T: sp_runtime::traits::Header, <T as sp_runtime::traits::Header>::Number: Into<u64>, { type Number = T::Number; type Hasher = T::Hashing; fn number(&self) -> Self::Number { *self.0.number() } }The hope is that this pattern is applicable to any such types that you find useful to share between Substrate and Subxt code. Please raise an issue if you can't find a solution in your case, and we'll endeavour to help!
The result of this is that your code will work against whichever Substrate crate versions you are using, at the cost of this code no longer being included behind the
substrate-compatfeature flag.A full list of relevant changes and fixes (nothing was added in this release) is as follows:
Changed
- remove substrate compat (#1850)
- migrate custom error trait impls to
thiserror(#1856) - re-export
jsonrpseeinsubxt::ext(#1843)
Fixed
- don't double hash: use the same hash in ExtrinsicDetails and ExtrinsicDetails (#1917)
- fix and test sr25519 signing in nostd (#1872)
- preserve custom metadata when converting between Subxt metadata and frame_metadata (#1914)
- fix: don't wrap rpc error in DisconnectedWillReconnect in reconnecting rpc client (#1904)
- fix: substrate runner, support new libp2p addr log (#1892)
- update Artifacts (auto-generated) (#1874)
- bump frame-decode and frame-metadata to latest (#1870)
- fix unstable-light-client + ChainHeadBackend tx events (#1865)
- when native feature is enabled, we need polkadot-sdk/std for eg examples to work (#1864)
- load latest metadata version from Wasm blobs. (#1859)
- minor fix - Yew example (#1852)
- update the release notes to work for current releases (#1842)
- An implementation of the
-
0.38.124 Jan 2025Nothing published for this version
-
0.38.024 Oct 2024Release notes
Open source →This release doesn't introduce any substantial breaking changes and focuses primarily on incremental improvements, testing and bug fixes. A few of the highlights include:
- #1785: Support decoding V5 extrinsics in blocks (currently Subxt will still submit V4 extrinsics). This also unifies our extrinsic decoding logic into one place.
- #1802: Stabilizing the
subxt::backend::unstable::UnstableBackend(it's now calledsubxt::backend::chain_head::ChainHeadBackend). This backend can be used to interact with the modernchainHeadRPC methods exposed by Smoldot and compliant RPC nodes. See this example. - #1803: Stabilizing the
reconnecting-rpc-client. See this example. - #1720: A nice little QoL improvement if you have the raw runtime WASM and would like to generate an interface directly from that (ie with
#[subx(runtime_path = "path/to/runtime.wasm")]). - #1661: Support loading keys directly from the PolkadotJS JSON to be used in Subxt.
- #1638: Improve support for Eth style chains by defining a 20-byte account ID type directly in
subxt-core. See this example.
The notable changes in this release are as follows:
Added
- add reconnecting tests for unstable_backend (#1765)
- add support for generating metadata from runtime wasm files (#1720)
- support loading keys from Polkadot-JS accounts (#1661)
- allow tx payloads to be boxed (#1690)
- add hash method to ExtrinsicDetails (#1676)
- expose
secret_keymethod forecdsa::Keypairandeth::Keypair(#1628) - add 20-byte account id to subxt_core (#1638)
Changed
- make it clearer which extrinsic failed to decode (#1835)
- chore(deps): bump frame-metadata from 16 to 17 (#1836)
- chore(deps): bump
scale family crates,primitive-typesandimpl-serde(#1832) - chore(deps): replace
instantwithweb-time(#1830) - deps: use polkadot-sdk umbrella crate (#1786)
- stabilize reconnecting-rpc-client (#1803)
- stabilize chainhead backend (#1802)
- derive serialize on more types (#1797)
- use frame-decode for core extrinsic decode logic (including v5 support) (#1785)
- reconn-rpc-client: parse URL before connecting (#1789)
- update proc_macro_error to proc_macro_error2 (#1767)
- chore(deps): update Smoldot to the latest version (#1400)
- remove unneeded
?Sizedbound and replace never type with()(#1758) - improve test coverage for legacy
Backendimpl (#1751) - add integration tests for
unstable-reconnecting-rpc-client(#1711) - replace
reconnecting-jsonrpsee-ws-clientwithsubxt-reconnecting-rpc-client(#1705) - allow PartialExtrinsic to be held across await points (#1658)
- chore(deps): bump jsonrpsee from 0.22.5 to 0.23.1 (#1656)
Fixed
- fix stripping metadata in the case where enums like RuntimeCall are handed back (#1774)
- fix:
defalt-feature->default-featuresCargo.toml (#1828) - avoid hang by notifying subscribers when the backend is closed (#1817)
- fix: error message on rpc errors (#1804)
- docs: fix typos (#1776)
- examples: fix reconnecting logging target (#1733)
- docs: fix spelling issues (#1699)
- chore: fix some comments (#1697)
- codegen: Fix decode error by adding
#[codec(dumb_trait_bound)](#1630)
-
0.37.122 Oct 2024Nothing published for this version
-
0.37.028 May 2024Release notes
Open source →This release mainly adds support for the sign extension
CheckMetadataHashand fixes a regression introduced in v0.36.0 where the type de-duplication was too aggressive and lots of the same type such asBoundedVecwas duplicated to plenty of different types such as BoundedVec1, BoundedVec2, .. BoundedVec<N>.Added
-
0.36.128 May 2024 withdrawn -
0.36.016 May 2024Release notes
Open source →This release adds a few new features, which I'll go over below in more detail.
subxt-coreWe now have a brand new
subxt-corecrate, which is#[no-std]compatible, and contains a lot of the core logic that is needed in Subxt. Using this crate, you can do things in a no-std environment like:blocks: decode and explore block bodies.constants: access and validate the constant addresses in some metadata.custom_values: access and validate the custom value addresses in some metadata.metadata: decode bytes into the metadata used throughout this library.storage: construct storage request payloads and decode the results you'd get back.tx: construct and sign transactions (extrinsics).runtime_api: construct runtime API request payloads and decode the results you'd get back.events: decode and explore events.
Check out the docs for more, including examples of each case.
A breaking change that comes from migrating a bunch of logic to this new crate is that the
ExtrinsicParamstrait is now handed&ClientState<T>rather than aClient.ClientStateis just a concrete struct containing the state that one needs for things like signed extensions.Support for reconnecting
We've baked in a bunch of support for automatically reconnecting after a connection loss into Subxt. This comes in three parts:
- An RPC client that is capable of reconnecting. This is gated behind the
unstable-reconnecting-rpc-clientfeature flag at the moment, and - Handling in the subxt Backends such that when the RPC client notifies it that it is reconnecting, the backend will transparently handle this behind the scenes, or else pass on a
DisconnectedWillReconnecterror to the user where it cannot. Note that the individualLegacyRpcMethodsandUnstableRpcMethodsare not automatically retried on reconnection. Which leads us to.. - A couple of util helpers (
subxt::backend::retryandsubxt::backend::retry_stream) which can be used in conjunction with a reconnecting RPC client to make it easy to automatically retry RPC method calls where needed.
We'd love feedback on this reconnecting work! To try it out, enable the
unstable-reconnecting-rpc-clientfeature flag and then you can make use of this like so:use std::time::Duration; use futures::StreamExt; use subxt::backend::rpc::reconnecting_rpc_client::{Client, ExponentialBackoff}; use subxt::{OnlineClient, PolkadotConfig}; // Generate an interface that we can use from the node's metadata. #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // Create a new client with a reconnecting RPC client. let rpc = Client::builder() // We can configure the retry policy; here to an exponential backoff. // This API accepts an iterator of retry delays, and here we use `take` // to limit the number of retries. .retry_policy( ExponentialBackoff::from_millis(100) .max_delay(Duration::from_secs(10)) .take(3), ) .build("ws://localhost:9944".to_string()) .await?; // Use this reconnecting client when instantiating a Subxt client: let api: OnlineClient<PolkadotConfig> = OnlineClient::from_rpc_client(rpc.clone()).await?;Check out the full example here.
Better Ethereum support
We've added built-in support for Ethereum style chains (eg Frontier and Moonbeam) in
subxt-signer, making it easier to sign transactions for these chains now.Check out a full example here.
We plan to improve on this in the future, baking in better Ethereum support if possible so that it's as seamless to use
AccountId20as it isAccountId32.Stabilizing the new V2 RPCs (#1540, #1539, #1538)
A bunch of the new RPCs are now stable in the spec, and have consequently been stabilized here, bringing the
unstable-backenda step closer to being stabilized itself! We'll probably first remove the feature flag and next make it the default backend, in upcoming releases.All of the notable changes in this release are as follows:
Added
- Add
frontier/ethereumexample (#1557) - Rpc: add full support reconnecting rpc client (#1505)
- Signer: ethereum implementation (#1501)
subxt-corecrate (#1466)
Changed
- Bump scale-decode and related deps to latest (#1583)
- Update Artifacts (auto-generated) (#1577)
- Update deps to use
scale-type-resolver0.2 (#1565) - Stabilize transactionBroadcast methods (#1540)
- Stabilize transactionWatch methods (#1539)
- Stabilize chainHead methods (#1538)
- Rename traits to remove T suffix (#1535)
- Add Debug/Clone/etc for common Configs for convenience (#1542)
- Unstable_rpc: Add transactionBroadcast and transactionStop (#1497)
Fixed
- metadata: Fix cargo clippy (#1574)
- Fixed import in
subxt-signer::eth(#1553) - chore: fix typos and link broken (#1541)
- Make subxt-core ready for publishing (#1508)
- Remove dupe storage item if we get one back, to be compatible with Smoldot + legacy RPCs (#1534)
- fix: substrate runner libp2p port (#1533)
- Swap BinaryHeap for Vec to avoid Ord constraint issue (#1523)
- storage_type: Strip key proper hash and entry bytes (32 instead of 16) (#1522)
- testing: Prepare light client testing with substrate binary and add subxt-test macro (#1507)
-
0.0.102 Apr 2024Nothing published for this version