Skip to main content
8 votes
Accepted

How to get bytes [u8; 32] from AccountId?

From<AccountId32> is implemented for [u8; 32] as you can see here in the Substrate code, so you can do: let account_bytes: [u8; 32] = sender.into();
kukabi's user avatar
  • 543
5 votes

How does the AccountData type work in FRAME runtimes?

I believe I'd asked a similar question on stackoverflow a while ago and it may answer your question: https://stackoverflow.com/questions/70845959/balances-accountstore-definition-in-substrate-runtime ...
Purple_Turtle's user avatar
1 vote

How does the AccountData type work in FRAME runtimes?

The FRAME System AccountData type could track any data structure that implements Member + FullCodec + Clone + Default + TypeInfo + MaxEncodedLen (which we know by looking at what AccountData is bound ...
Sacha Lansky's user avatar
  • 2,640
1 vote

How do I find out what caused a reserved balance, and what I should do to free it up

I must say, this is quite inconvenient. Unlike the balance lock, there's no "reserve ID" available for this. Ideally, a good pallet should keep a record of such transactions. For instance, ...
AurevoirXavier's user avatar
  • 10.6k
1 vote
Accepted

What is the flags field in system account info?

It is a simple mechanism to indicate whether the new ref-counting logic is in place for this account. See the code below: const IS_NEW_LOGIC: u128 = 0x80000000_00000000_00000000_00000000u128; #[...
Alex Bean's user avatar
  • 5,747
1 vote

How do I create an Asset account using polkadot JS with a reason other than Consumer?

So there's a function called touch() in pallet assets which will allow you to reserve the deposit AssetAccountDeposit in the runtime config, with the reason of DepositHeld(..). For sufficient reason, ...
b0zero's user avatar
  • 533
1 vote
Accepted

Get a breakdown of DOT for an account

Using PolkadotJS, this is the code to get the breakdown of a DOT for an account in the current block (change the block hash if you want to query it in an specific block). const ADDR = 'your-...
Alex Bean's user avatar
  • 5,747
1 vote

account_sequence and suggested_fee in substrate

If for account sequence you mean the nonce of the account (number of outgoing transactions from the account), it is stored in the system account info together with other account data like free and ...
Iker's user avatar
  • 1,356
1 vote

How to calculate Total Value Locked for a Substrate Chain? Should 'Reserved Balances' be included?

It depends entirely on what you want to calculate. TVL is often used as an indicator in the field of defi, and for that you'd probably need to look at attributes beyond merely locks and reserves. For ...
Gav's user avatar
  • 2,681
1 vote

How to calculate Total Value Locked for a Substrate Chain? Should 'Reserved Balances' be included?

The difference between locked and reserve balance is that the former can be overlapping while the latter cannot. Usually reserved balance is used to lock tokens for storage consumed. When exactly ...
Alexander Theißen's user avatar
1 vote

How to get bytes [u8; 32] from AccountId?

For more details, how AccountId turns out to be AccountId32 ? You can follow the following path: in xxxx/runtime.rs(which use to config your node's runtime), you can find following code: pub type ...
ironman_ch_parami's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible