Questions tagged [subxt]
The subxt tag has no usage guidance.
36
questions
0
votes
0
answers
22
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
0
answers
39
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
15
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 ...
2
votes
3
answers
65
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 ...
0
votes
1
answer
27
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
31
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
32
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
31
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 ...
1
vote
1
answer
57
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 ...
0
votes
1
answer
48
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
46
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
65
views
how to transform OpaqueExtrinsic to get the variables within the transaciton?
im 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 im ...
1
vote
1
answer
27
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,
...
0
votes
1
answer
20
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
50
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
37
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
96
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
59
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
28
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 ...
0
votes
2
answers
131
views
How to get the extrinsics and their hash from a block with Subxt
How to get all extrinsics executed in a block with subxt?
My question is identical to With subxt how can I subscribe to watch extrinsics?
There's some great examples of how to use subxt to listen to ...
2
votes
1
answer
141
views
Call ink contract using rust
I'm a developer who wants to call the ink contract's function from the outside. I already know that ink contract supports cross-contract. But what I want to do is call the function using subxt or ...
2
votes
1
answer
165
views
Create submittable extrinsic from call bytes
I have been trying to implement a transaction queue which will store extrinsic call data and later execute it.
Transaction Queue
This is how the queue looks like, which enqueue and dequeue call-data ...
2
votes
2
answers
101
views
Is it possible to make a transaction with my own account?
I'm currently trying to make a transaction using subxt tool.
I could generate tx with test sr25519 keyring (Alice, Bob, ...), but I'm not sure I can do this with my account on rococo testnet.
I made ...
1
vote
1
answer
165
views
Simple runtime call in Rust
I am building a somewhat generic client for Substrate-based chains in Rust using the subxt crate. To learn about runtime calls, my goal was to call the core.version runtime API directly using the RPC ...
1
vote
1
answer
50
views
How to create Signature from &str?
I'm trying to create a basic HTTP server that authorizes users with Authorization Pubkey:Sig like what Crust explained here.
However, creating a Signature from &str with Signature::fromSlice() ...
3
votes
1
answer
109
views
How to use subxt to query for an historical event
I'm having trouble using subxt to query for an historical event. Not sure what manipulation is necessary to filter for the specific events I want.
In my case, I want to query for a ...
5
votes
2
answers
220
views
Determining the final fee from a client
Is there a way to check the exact final_fee that the signer of an extrinsic was charged? I'd like to do so from subxt for monitoring purposes, but could not find this info in the TransactionProgress ...
2
votes
1
answer
96
views
High transaction throughput - single acccount
I'm using subxt with the aim to handle bursts of transactions concurrently through a single account. I understand the nonce must be incremented, however I'm unsure of the exact lifecycle of a tx and ...
0
votes
1
answer
41
views
How to do "erasStakers" in Rust?
Very sorry for such a newbie question; just don't know where else to ask 🙏
Essentially, I want to programmatically dump from the network who won the most recent election. To do so, I'm issuing an ...
6
votes
1
answer
167
views
With subxt how can I subscribe to watch extrinsics?
There's some great examples of how to use subxt to listen to all events.
Polkadot-js events screen seem to show events grouped by the extrinsic that created them. Can I do the same in rust?
(if not ...
1
vote
1
answer
73
views
Fetch storage data and convert it to primitive types with subxt
I want to get the bool value from the flipper contract. I use Rust and subxt. But I cannot convert it to a primitive type.
let value: bool = api
.metadata()
.pallet("...
4
votes
1
answer
97
views
How do `subxt` and `substrate-api-client` libraries differ?
I understand that there are two main Rust client libraries for Substrate:
subxt
substrate-api-client
I've checked out the examples for both libraries and it seems to me that they are mostly the same....
5
votes
2
answers
87
views
Why can't I decode an extrinsic created with the contracts tab in Polkadot JS apps?
I am running the substrate-contracts-node and using the contracts UI to interact with it in Polkadot JS Apps. The contract call is failing when I try using the UI, although the same call works from a ...
3
votes
1
answer
67
views
Making sudo call using subxt
Good day, I would love to know how to make Sudo calls through subxt library , I can't seem to find a meaningful solution. substrate-api-client has an example on how to make on, but going through the ...
6
votes
1
answer
108
views
Filter Events with subxt over multiple threads
I'm working on a project that uses Substrate in the backend. The System I am working on is written with Elixir and so I have a rustler NIF (Erlang/Elixir Native Function interface) for interacting ...
2
votes
3
answers
81
views
What is the difference between check_extrinsic and uncheck_extrinsic?
I want to decode the polkadot's extrinsics I received through json-rpc (at rust or java).
But every time I leave a question here, there's no clear answer.
First, I'm using subxt.
(subxt : https://...