Skip to main content

Questions tagged [subxt]

The tag has no usage guidance.

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

Getting error expected `MiniSecretKey`, found `schnorrkel::keys::MiniSecretKey`

I have a test-suite that is based on sub-xt. This is also pulled in the suite as a dependency in cargo.toml as follows. [dependencies] subxt = { version = "0.37.0", git = "https://...
RRR's user avatar
  • 45
1 vote
0 answers
5 views

Call ink! Smart Contract method using subxt

I am trying to call ink! smart contract method using subxt but i cannot find any solution. Can anyone help me out?
Wasif Shah's user avatar
0 votes
1 answer
34 views

How can I properly use scale::Decode to get consistent results?

I'm trying to process a result from a contract call using what's here. It works totally fine when I'm trying to get a u32 result from an ink_e2e test. E.g. // -- Snip -- let number_of_items = client ...
Kofi's user avatar
  • 143
0 votes
2 answers
32 views

How to write scripts of subxt for evm transactions?

I want to use subxt for performing transactions on evm chain. Do we have resources where we are doing evm transactions?
Deepak Chaudhary's user avatar
1 vote
1 answer
25 views

How to integrate Subxt with frontier?

I want the transaction to be happen through subxt on frontier node template. I'm getting this error in this process: Metadata error: The generated code is not compatible with the node How to solve ...
Deepak Chaudhary's user avatar
0 votes
1 answer
30 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
21 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
  • 535
1 vote
2 answers
68 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
54 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
62 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
43 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
54 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
99 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
34 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
105 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
93 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,757
1 vote
1 answer
75 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
153 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
91 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
76 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
66 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
120 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
118 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
104 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,757
3 votes
1 answer
84 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,757
3 votes
1 answer
140 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,757
6 votes
2 answers
199 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
121 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,757
1 vote
1 answer
77 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
76 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
39 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
145 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
194 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
53 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
207 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,335
5 votes
4 answers
199 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
121 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
152 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
60 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
202 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
149 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
57 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
63 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
40 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
117 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
109 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
113 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