Questions tagged [substrateinterface]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
2 answers
124 views

How key-values database and Merkle Tree works together on Substrate

I have been looking deep dive into Substrate and trying to understand things behind the hood, especially storage API. I am really keen to explore more in the Merkle abstraction between Storage API and ...
user avatar
1 vote
0 answers
20 views

How do externalities work in runtime?

What makes me confused about the runtime is the Externalities. I found the definition in sp_externalities, moreover I found that the pub fn set_and_run_with_externalities(ext: &mut dyn ...
user avatar
  • 21
2 votes
1 answer
47 views

How to obtain the staking amount for non-active validators?

Using substrate-interface I'm trying to get the amount of DOT in staking for non-active validators, those that are waiting. I can get the active validators' amount by using the storage_function ...
user avatar
3 votes
1 answer
18 views

Access The Unbonding Amount With Substrate Query

I'm trying to measure the unbonding amount directly from a substrate-interface query. Here's the amount I'm interested in: I can get some account information with this query: value = self....
user avatar
4 votes
2 answers
69 views

How to find how many transactions are pending from address to be added to block?

In my application, I need to fire multiple transactions from same address, and want to create statusCheck() function, which will let me know how many transactions of total are still pending to be ...
user avatar
3 votes
1 answer
47 views

How to understand [runtime-interface] and `Externalities`?

I am struggling with #[runtime_interface] the whole day. here is the Runtime Interface Trait Defination, the expanded macro is too long to paste here, here is a expanded macro. I have lots of ...
user avatar
4 votes
1 answer
44 views

How to convert substrate Specific Types(Option<BalanceOf<T>> ) to Rust Primitive types (U64)?

I don't know how can I convert Option<BalanceOf> (subtrate specific type)to u64 (rust primitive types)? I followed this article( How do you convert between Substrate specific types and Rust ...
user avatar
0 votes
0 answers
31 views

How to solve " ValueError: Element count of value (1) doesn\'t match type_definition (2)" when I teleport ksm in kusama to ksm in statemine? [duplicate]

I want to teleport the ksm in kusama to ksm in statemine. I use the code call = _substrate.compose_call( call_module='XcmPallet', call_function='limited_teleport_assets', ...
user avatar
  • 11
1 vote
1 answer
22 views

Can generate an address by mnemonic with the sdk substrate-interface?

I want to generate an kusama address. The substrate-interface can make it?Or how to generate an ss58 format address by python
user avatar
  • 11
0 votes
1 answer
40 views

How to solve the issue"Element "asset_id" of struct is missing in given value" when I send a token transaction

I send the transaction using the substrate interface. I get the key pair and call: call_module = "Assets" call_function = 'transfer' call_params = { "id": asset_id, "...
user avatar
  • 11
1 vote
1 answer
49 views

How to decode and encode transactions by using substrate?

I want to decode blocks and transactions from the Node. I want to use https://github.com/paritytech/substrate . But I can not find methods about it. Could you tell me where it is ?
user avatar
  • 11
0 votes
1 answer
51 views

Retrieve reason of fail substrate rpc call

I would like to know if there is a way for understanding why a rpc call via python substrate-interface is failing. On my case, I'm using python substrateinterface lib. And in function "...
user avatar