Questions tagged [subxt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

subxt: How to derive serialize trait for runtime type?

I want to define a struct serializeable to json #[derive(Serialize)] struct Struct { item: SomeRuntimeType, } but I get this error: error[E0277]: the trait bound `pallet_pallet::types::...
Hugo Trentesaux's user avatar
0 votes
1 answer
20 views

Do we need to regenerate subxt metadata after upgrading substrate node?

I have a Rust application, which is using Subxt library to connect with a running node and submitting the transaction. This application is running on 3 different instances. I need to perform a runtime ...
Boleng's user avatar
  • 475
1 vote
2 answers
65 views

Issues with Adding `subxt` Dependency to `node-template-runtime` in Substrate Project

I'm developing a project based on the substrate-node-template and encountered an issue when adding a subxt dependency. When I add subxt = { version = "0.29", default-features = false } to ...
Staish's user avatar
  • 11
1 vote
1 answer
47 views

subxt: How to submit pallet_session::set_keys() extrinsic?

I have generated the session keys using the author.rotateKeys() RPC call. The keys are of type Vec<u8> and the length is 128 bytes. I am trying to call the set_keys() method from pallet_session ...
akhil nichenametla's user avatar
1 vote
1 answer
57 views

Parsing the result from author_pendingExtrinsics

What return type should I use in subxt to be able to parse the result from author_pendingExtrinsics? I have implemented a wrapper call and returning a vector of OpaqueExtrinsic: async fn ...
Simson's user avatar
  • 1,201
2 votes
1 answer
38 views

How to use core crypto types instead of runtime types?

I am trying to use core crypto types instead of runtime types (because I know they are the same): #[subxt::subxt( runtime_metadata_path = "metadata.scale", derive_for_all_types = &...
Hugo Trentesaux's user avatar
3 votes
1 answer
51 views

Signing transactions with another secure app

If we make an Android dapp, can't we use Android intents to sign a transaction in another Android wallet app that supports receiving data through intents? We can pass message and public key in the ...
Amiya Behera's user avatar
1 vote
1 answer
71 views

How to get typed keys when querying a storage map via subxt

The example here https://github.com/paritytech/subxt/blob/master/subxt/examples/storage_iterating.rs use subxt::{OnlineClient, PolkadotConfig}; #[subxt::subxt(runtime_metadata_path = "../...
Damian's user avatar
  • 13
1 vote
1 answer
33 views

Attaining an Integer from StorageKey

I'm porting a script from TypeScript using the Polkadot.JS/api to Rust using Subxt. let query = polkadot::storage().referenda().referendum_info_for_root(); let mut results = api.storage()....
Paradox - ParaNodes.io's user avatar
2 votes
1 answer
91 views

MultiAddress to Address String

I'm trying to retrieve the author's address as a string, and I've successfully obtained the MultiAddress using the following code: let validator_address = if let Some(author_multi_address) = ...
Yeou's user avatar
  • 229
1 vote
1 answer
82 views

Specify asset to pay fees in a transfer - Subxt

I am doing a transfer in AssetHub and I want to use another asset to pay fees. I have seen an example in JavaScript where it needs to specify the assetId in the signAndSend function: await api.tx....
Alex Bean's user avatar
  • 5,692
1 vote
1 answer
52 views

Get the block timestamp using subxt

I am using subxt to get the block details, including the block number, hash, parent hash, timestamp, events and the extrinsics. I am able to find most details, except the timestamp. Is there a way to ...
Yeou's user avatar
  • 229
0 votes
1 answer
142 views

If a transaction is created using subxt/polkadot-js and how to sign it using any crypto libraries and send it again using subxt/polkadot-js

I'm trying to create a poc to separate out the signing of transactions from the libraries such as subxt or polkadot-js. I was trying subxt and schnorrkel libs to create partial signed transaction and ...
kroos47's user avatar
  • 59
3 votes
1 answer
86 views

Incompatibility between subxt_signer and subxt

https://github.com/paritytech/subxt/blob/master/subxt/examples/tx_basic.rs I want to call a function in my substrate pallet. I am using the substrate-node-template subxt subxt_signer use subxt::{...
Haider's user avatar
  • 71
0 votes
2 answers
67 views

Is it possible to submit an unsigned transaction using subxt?

Is it possible to send an unsigned tx from subxt similar to TxClient::sign_and_submit(...)? I have a bizarre use case where the transaction authenticity is to be verified on a foreign chain via an RPC ...
Yury Yukhananov's user avatar
2 votes
1 answer
28 views

Sudo tx with subxt

I'm writing a script with subxt. How can I wrap a set_code tx in a sudo_unchecked_weight tx? Current code: let sudo_set_code: Payload<SetCode> = nodetemplate::tx().system().set_code(code); ...
flipchan's user avatar
  • 369
0 votes
1 answer
53 views

Could not decode `RuntimeCall::System.0`

Can somebody explain what this means? Rpc(ClientError(Call(Custom(ErrorObject { code: ServerError(1002), message: "Verification Error: Runtime error: Execution failed: Runtime panicked: Bad ...
Jitterbug's user avatar
  • 219
0 votes
1 answer
114 views

compile error for `subxt-signer` version 0.30: use of unstable library feature 'once_cell'

I was testing with subxt and used the latest version. But I encountered this error: error[E0658]: use of unstable library feature 'once_cell' --> .cargo/registry/src/github.com-1ecc6299db9ec823/...
Jitterbug's user avatar
  • 219
3 votes
1 answer
114 views

Troubleshooting Persistent Error Following Parachain Runtime Upgrade Despite Code Modification

We recently attempted a runtime upgrade on our parachain testnet (wss://moonbeam-integration-parachain.polkadex.trade) and made some modifications to the validate_unsigned code, specifically ...
ZKT's user avatar
  • 113
1 vote
2 answers
96 views

transfer balance subxt

I am using subxt library . I have downloaded metadata from chain using this url wss://rpc.polkadot.io:443 . I have also implemented default example from subxt documentation of transfer balance . i ...
Karanvir Singh's user avatar
4 votes
2 answers
58 views

WebAssembly runtime file into ValidationCode

I have a CLI tool that gets a WebAssembly runtime file: let validation_code_content = fs::read_to_string(path_validation_code) .expect("Should have been able to read the validation code ...
Alex Bean's user avatar
  • 5,692
3 votes
1 answer
67 views

Error Metadata(IncompatibleCodegen) - subxt

I was executing a transaction using Alice account to make a sudo call in local Rococo Network let alice = PairSigner::new(AccountKeyring::Alice.pair()) I am trying to change it to use my own account ...
Alex Bean's user avatar
  • 5,692
3 votes
1 answer
130 views

Subxt - Catch Extrinsic Error

I am doing sudo call using this example Making sudo call using subxt: let found_event = api .tx() .sign_and_submit_then_watch_default(&tx, &bob) .await? ....
Alex Bean's user avatar
  • 5,692
6 votes
2 answers
176 views

How to get block author with Subxt?

I am fetching specific block by hash using subxt: let block_hash = subxt::utils::H256::from_str( "0xfb6f67233cc212a40522351c88d86d9ac83f68a6b6d6be14c0cb69e83a5b8407" ).unwrap(...
Szymig's user avatar
  • 225
3 votes
1 answer
106 views

Metadata(PalletNotFound) with subxt

I am using subxt to get the list of parachains on the Polkadot network. Firstly I used the subxt-cli tool to download the metadata: subxt metadata --url https://rpc.polkadot.io:443 -f bytes > ...
Alex Bean's user avatar
  • 5,692
1 vote
1 answer
70 views

How to supply tuple parameters to a dynamic call in subxt

I am struggling to figure out how to supply tuple parameters to a dynamic call in the latest subxt master branch. I know parameters are combinations of Value types. My current non-working code looks ...
twhitehead's user avatar
2 votes
2 answers
68 views

Failing to execute transactions via subxt on a substrate chain

I am trying to use subxt (latest master branch) to submit transactions on our substrate chain. I get the following error: actix_web::middleware::logger] Error in response: SubxtError(Rpc(ClientError(...
twhitehead's user avatar
4 votes
1 answer
37 views

Why do subxt::Error not fit in anyhow::Error?

I'm implementing a client based on subxt, and have difficulties with subxt errors: the trait `From<Result<std::option::Option<u32>, subxt::Error>>` is not implemented for `Result<...
Hugo Trentesaux's user avatar
4 votes
1 answer
142 views

In-browser signing of payload generated with subxt

I am generating a partial unsigned extrinsic via subxt however cannot figure how to how to sign it using the polkadot.js api. For example: #[subxt::subxt(runtime_metadata_path = "...
myson's user avatar
  • 61
6 votes
0 answers
153 views

Subxt call to custom pallet method returning `wasm 'unreachable'` - (`TaggedTransactionQueue_validate_transaction`)

So I am trying to submit extrinsics to a running parachain node using subxt, but encounter a Codec error. The parachain is based on the substrate-parachain-template, the relay chain is compiled ...
Niels Vistisen's user avatar
2 votes
1 answer
51 views

How to get Runtime types and Runtime (PalletCustomOrigins) from subxt metadata.scale

The main aim is to get Governance Origins using subxt from the encoded metadata
Mrisho Lukamba's user avatar
4 votes
1 answer
181 views

Where do I add a SignedExtension in a Subxt call?

I am creating a Subxt call where I need to add support for a signed extension that my chain uses. Is there an example of where I can add support for a signed extension?
Bruno's user avatar
  • 8,325
5 votes
4 answers
166 views

Decoding Polkadot/Kusama transactions in Rust

I would like to inspect transactions (extrinsics) in a given block to potentially: Find different types of transactions and their parameters Look through all transactions included in the block and ...
Szymig's user avatar
  • 225
4 votes
3 answers
113 views

subxt `PairSigner` trait bounds not satisfied

When I try to create a PairSigner, then the Pair traits are not satisfied. GitHub repo to check the code With this code: let pair = sp_core::sr25519::Pair::from_phrase(mnemonic_phrase.as_str(), None)...
Martin L. Jensen's user avatar
1 vote
1 answer
139 views

why the subxt can not decode metadata

Here is test demo, but always fail to run. Cargo.toml [dependencies] yew = { version = "0.20.0", features = ["csr"] } gloo = "0.8.0" wasm-bindgen-futures = "0.4.32&...
Ginmus's user avatar
  • 31
2 votes
1 answer
111 views

How to use subxt in yew.rs front-end app

Here is test demo, but always fail to run. Cargo.toml [dependencies] yew = { version = "0.20.0", features = ["csr"] } gloo = "0.8.0" wasm-bindgen-futures = "0.4.32&...
Ginmus's user avatar
  • 31
0 votes
1 answer
54 views

How do you use subxt without having to use the re-exported types?

Answering my own question here, but I had an issue where I had a shared Rust library (entropy-shared) with types that were shared between a Rust binary using subxt and some Substrate pallets it ...
Jake Hemmerle's user avatar
3 votes
3 answers
183 views

Subxt vs substrate-api-client vs polkadotjs

What are the primary differences between subxt and substrate-api-client and how do they compare to polkadotjs? I'm building a desktop application using Tauri which runs server side rust code and ...
Snowmead's user avatar
  • 625
1 vote
1 answer
124 views

How to get balance of account in subxt?

use sp_core::crypto::AccountId32; use sp_core::crypto::Ss58Codec; use subxt::{ PolkadotConfig, }; #[subxt::subxt( runtime_metadata_path = "./artifacts/metadata.scale", ...
Amiya Behera's user avatar
0 votes
1 answer
55 views

How index the substrate storage maps and ipfs cids?

How can I index the substrate storage maps of pallets and ipfs content of cids, to have filters and build custom search queries? Is it a good idea to use subxt for querying storage through rpc from ...
Amiya Behera's user avatar
0 votes
1 answer
62 views

Extrinsics ejected from pool with subxt::tx::TxStatus::Invalid error

What are possible explanations why sub subxt::tx::TxStatus::Invalid The documentation is very brief about it: Invalid The transaction is no longer valid in the current state. Could someone please ...
Simson's user avatar
  • 1,201
1 vote
1 answer
39 views

How do we check Subxt's compatibility (or any Substrate product's compatibility) with Polkadot versions?

I am asking this on behalf of some of the builders in the community. Will subxt get an update for the v0.9.36 (Polkadot equivalent) branch? On a broader level - How do we check Subxt's compatibility ...
Joshua's user avatar
  • 66
2 votes
1 answer
114 views

PairSigner does not work in Subxt

let signer = PairSigner::<PolkadotConfig,Pair>::new(AccountKeyring::Alice.pair()); This code cannot compile due to AccountKeyring::Alice.pair() returns sp_core::sr25519::Pair while new method ...
Mrisho Lukamba's user avatar
2 votes
1 answer
94 views

What is the smartest way to make multiple dynamic storage queries using subxt?

Is it possible to make batched storage calls to the runtime using subxt or is it only possible to make repeated individual calls against the state? Say there are 3 storage variables I would like to ...
Drew Stone's user avatar
  • 1,194
0 votes
1 answer
102 views

How to use subxt to execute a utility.batch call?

So far the team was aiming for doing something like this: let batch_tx = subxt::dynamic::tx( "Utility", "batch", txes.iter().map(|tx| tx.into_value()).collect::<Vec&...
Santiago Balaguer's user avatar
1 vote
1 answer
98 views

how to transform OpaqueExtrinsic to get the variables within the transaciton?

I'm writing a custom BlockImport and I need to decode the transactions within the block,as we know a transaction is simply a pallet method call for example store_value(value), but at the point where I'...
dadzerlaze's user avatar
  • 1,083
2 votes
1 answer
42 views

How to provide argument to storage call in subxt?

In polkadotjs I have following code: const opts = [{"UniqueIdenfier1":[0,"challengeprofile"]}] let data = api.query.templateModule.periodName( ...opts, ...
Amiya Behera's user avatar
2 votes
1 answer
52 views

Signed bytes from Schnorrkel library throws Bad Signature error

Hey I have some call data which is similar to this. I am signing it using schnorrkel libaray function function. as secret.sign_simple(&[], msg) where secret is a Keypair and msg is in bytes. Then ...
Rusty Pythonic Script's user avatar
0 votes
2 answers
299 views

Create a signed transaction using a signature and unsigned_transaction

I have two functions. The first function: Generates payload of unsigned_transaction: The second function: Needs to generate a signed transaction, using unsigned_transaction and signature. Process: ...
Rusty Pythonic Script's user avatar
0 votes
1 answer
102 views

Decoding extrinsic hex into readable form in Rust

I am running the substrate-dev node. Made a transaction using Polkadot-explorer. After fetching the block using subxt I am getting extrinsic hex as: ...
Rusty Pythonic Script's user avatar