Questions tagged [subxt]
The subxt tag has no usage guidance.
67
questions
0
votes
1
answer
21
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 ...
1
vote
1
answer
40
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 ...
1
vote
1
answer
30
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 = &...
2
votes
1
answer
46
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 ...
0
votes
1
answer
39
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 = "../...
0
votes
1
answer
26
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()....
2
votes
1
answer
59
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) = ...
1
vote
1
answer
66
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....
1
vote
1
answer
28
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 ...
0
votes
1
answer
70
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 ...
2
votes
1
answer
62
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::{...
0
votes
2
answers
53
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 ...
1
vote
1
answer
18
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);
...
0
votes
1
answer
41
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 ...
0
votes
1
answer
71
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/...
2
votes
0
answers
99
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 ...
1
vote
2
answers
61
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 ...
4
votes
2
answers
56
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 ...
3
votes
1
answer
51
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 ...
3
votes
1
answer
113
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?
....
5
votes
2
answers
117
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(...
2
votes
1
answer
57
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 > ...
1
vote
1
answer
53
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 ...
2
votes
2
answers
59
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(...
4
votes
1
answer
36
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<...
4
votes
1
answer
126
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 = "...
5
votes
0
answers
127
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 ...
2
votes
1
answer
45
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
3
votes
1
answer
150
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?
4
votes
4
answers
110
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 ...
4
votes
3
answers
100
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)...
1
vote
1
answer
117
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&...
2
votes
1
answer
100
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&...
0
votes
1
answer
48
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 ...
3
votes
3
answers
142
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 ...
1
vote
1
answer
93
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",
...
0
votes
1
answer
52
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 ...
0
votes
1
answer
48
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 ...
1
vote
1
answer
37
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 ...
2
votes
1
answer
107
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 ...
2
votes
1
answer
74
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 ...
0
votes
1
answer
81
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&...
1
vote
1
answer
90
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'...
2
votes
1
answer
40
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,
...
2
votes
1
answer
43
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 ...
0
votes
2
answers
211
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:
...
0
votes
1
answer
80
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:
...
1
vote
2
answers
186
views
Use subxt to connect to any live node
To query Polkadot node with subxt this is the code I used and that works fine.
use subxt::{OnlineClient, SubstrateConfig};
#[subxt::subxt(runtime_metadata_path = "metadata.scale")]
pub mod ...
0
votes
2
answers
82
views
Is it safe to store pair on local storage for signing transaction?
I'm trying to use subxt in my yew front end app.
let pair = Pair::from_phrase(&"mnemonic".to_string(), Some("password"))?;
As I can't use polkadot extension for signing ...
0
votes
1
answer
36
views
I want to generate sigHex from sign in rust
This is the polkadotjs code:
const { Keyring } = require('@polkadot/keyring');
const seeds = "caution juice atom organ advance problem want pledge someone senior holiday very";
const ...