This library provides a clean wrapper around all the methods exposed by a Polkadot/Subtrate network client and defines all the types exposed by a node.
Questions tagged [polkadot-js]
88 questions
1
vote
1 answer
Could not convert parameter `tx` between node and runtime: Error decoding field CheckMortality.0
I tried to use polkadot-js libray to run a simple app for transferring tokens between Dusty accounts on plasm. Source code and package.json for running the snippet is found on this git repo
Node version: v12.8.2
Yarn version: 1.22.5
const {…

Milton Cezar
- 35
- 5
1
vote
2 answers
Polkadot App js UI - "waiting to make a connection to the remote endpoint and finishing API initialization
I am following the tutorial Use the Sudo Pallet
....Built & run the upgraded runtime - cargo +nightly-2020-10-06 run --release -- --dev --tmp....
Connected to Polkadot JS Apps - https://polkadot.js.org/apps/#/extrinsics?rpc=ws://127.0.0.1:9944.
I am…

Tasszz44
- 91
- 1
- 7
1
vote
1 answer
Getting the reward points of a validator by account
I am trying to find the reward points belonging to a validator. I started with this:
const activeEra = await api.query.staking.activeEra()
const rewardPoints = await api.query.staking.erasRewardPoints(activeEra.unwrap().index)
const…

lunr
- 5,159
- 4
- 31
- 47
1
vote
0 answers
encoding struct in polkadot.js api
I have a question regarding the frontend polkadot.js api. Suppose I have a struct
pub struct B {
b: i32,
}
pub struct A {
a: Vec,
b: B,
}
I want to encode struct A into byte array and then pass it in substrate dispatch call, then I…

ohmygoddess
- 619
- 1
- 7
- 23
1
vote
1 answer
How to query substrate storage via `.entries` for partial items
how can i query the storage via .entries when i know the list of the IDs which are used to store the data?
snippet from decl_storage
/// PoE Proofs
Proofs get(fn proofs): map hasher(blake2_128_concat) GenericId=> ProofInfo

woss
- 933
- 1
- 11
- 20
1
vote
1 answer
How to query for Polkadot transaction info using only txHash?
I cannot find any description on how to get the transaction info using just the txHash returned by signAndSend() in the API documentation. I think it's a basic function which is really weird that it's not there.
As I can see the only way to track…

Minh Tran Duc
- 227
- 3
- 13
1
vote
2 answers
Adding additional data fields to account information in Substrate
Very new to Substrate and Rust. My understanding of the ChainState is that it acts sort of like a database which holds account numbers (in this case public keys) and their associated balances. When making a transaction, Substrate basically checks to…

Giovanni_Visione
- 25
- 3
1
vote
0 answers
Extrinsic failed when invoke HashMap/BTreeMap insert() in ink! contract via Polkadot JS api
I got an issue when invoke a contract call from Polkadot JS api.
If the function include HashMap insert() or BTreeMap insert() in contract, when call it via api, I'll get:
{"ApplyExtrinsic":1}
[ An extrinsic…

Yun Chen
- 11
- 3
0
votes
0 answers
Way to cancel a signature request in Polkadot Extension
I hava an app that uses the polkadot extension to let the user sign requests. I am using the signAndSend method with the signer from the browser extension.
Is there a way to cancel a pending signature request programatically? I.e. the signature…

niklas
- 2,887
- 3
- 38
- 70
0
votes
0 answers
Decoding problems in polkadot-js after updating of substrate version
Recently I updated substrate version in our project from monthly-2022-09 to monthly-2022-12. After that in out webapp that uses polkadot-js/api I got a decoding error on attempt to query fee details payment_queryFeeDetails
type.js:57 Uncaught (in…

foo
- 1
0
votes
0 answers
Unable to upload smart contract in Polkadot.js - contracts.instantiateWithCode: ready the whole time
When I try to upload smart contract to Polkadot (local and testnet), this will popup after submitting contracts.instantiateWithCode: ready and it will be look like that the whole time and will not proceed following with this error:
TypeError:…
0
votes
0 answers
How to import an account to Keyring which was exported from the polkadot{.js] browser extension?
I have installed the polkadot{.js} browser extension and exported an account to a json-file.
I want to have that account available on a server where I have installed the @polkadot/keyring library.
Is there a way I can use the information in the…

yodas_dev
- 1
- 1
0
votes
1 answer
First Substrate Chain
When i run this command according to the documentation.
**cargo build**
I recived this error.
enter image description here
I didn`t find any solution for this.
This is the tutorial…
0
votes
0 answers
Private key Meta Mask got phissed
My private key got stolen threw phissing scam, some eth got transfert but im worried they use it to get to my Polkadot wallet. What can i do. Is there a way of restoring this?

Segnix
- 1
0
votes
1 answer
How to call Openbrush contract from Front-end app
I implement smart contracts with ink!, substrate's WASM smart contract implementation language.
At that time, I decided to use the openbrush library. openbrush is like openzeppelin in EVM.
The smart contract was easy to implement according to the…

s.Takahashi
- 469
- 4
- 15