Questions tagged [polkadot-js]
Questions about the Polakdot JS API used to interact with Substrate based chains via JavaScript.
469
questions
0
votes
1
answer
33
views
Liquid Staking Unclaimed Reward via Polkadot.js
we would like to know if there is any solution to get the amount of the unclaimed rewards for nominationPool via Polkadot.js extrinsics.
Please help. Thanks!
0
votes
1
answer
42
views
How to add a Substrate token created with a smart contract to my wallet? What wallet can I use for testing in a local environment?
I created a token on the Substrate chain using a smart contract and I am now trying to add it to my wallet. However, when I enter the contract address into the "Import a token" section of ...
0
votes
1
answer
22
views
Would it be possible to render existing values in update form in Polkadot JS UI
I am not sure if this is the right forum to ask question related to PolkadotJS UI. Is there any way to render existing value in the extrinsic fields?
I have an extrinsic to update values in a storage. ...
1
vote
1
answer
83
views
contracts.OutofGas when i want to uplooad smart contract
i want upload smart contract in the https://polkadot.js.org/apps/#/contracts but it when i press the depoloy button , it show me this error :
polkadot-v0.9.34
substrate-contracts-node : substrate-...
2
votes
0
answers
55
views
Fuzzing Polkadot produces Invalid Signature after chaos is injected
I'm using Polkadot version 0.9.37-08b1c09ca46, across 4 Nodes - Alice, Bob, Charlie, Dave, in a local testnet environment. I have a period of network chaos applied, and then moments of stabilized '...
0
votes
1
answer
69
views
Can't success to fetch list of data in frontend
This is Contract code to return List of TodoItem:
#[ink(message)]
pub fn gettodolist(&self) -> Vec<TodoItem> {
let caller = self.env().caller();
let mut ...
0
votes
2
answers
48
views
@polkadot/util module issue
I got some error when using Polkadot{js} API. what's wrong?
should I update the version of package?
import { BN, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, bnToBn, bnToHex, bnToU8a, ...
0
votes
1
answer
10
views
Polkadot.js ui displays orange branding for Kusama
When connecting to my own RPC server the polkadot.js displays an orange branding.
https://polkadot.js.org/apps/?rpc=wss://ibp-rpc.metaspan.io/kusama#/explorer/node
It should just show the default ...
7
votes
1
answer
181
views
How to estimate gas for ink contracts transactions for Weights V2?
For ink contracts with weight v2 it requires refTime and proofSize. For this we are first querying(dry run) the transaction method, getting gasRequired from query result and sending it to transaction. ...
0
votes
1
answer
41
views
`UnknownTransaction::CannotLookup` error on each extrinsic
I've implemented unified accounts in a NPoS consensus-based substrate chain, and modified the polkadot-js/apps accordingly as well. The transactions through metamask go through successfully, but I'm ...
1
vote
1
answer
24
views
Errors on generated code from Typegen
We are following the polkadot{.js} docs on TypeScript user generated for Chain modules. We are trying to get our custom chain module types into Typescript. We can generate fine however the generated ...
2
votes
1
answer
70
views
MultiLocation type polkadot js
I am trying to figure out correct way how to type MultiLocation type
I thought that I would do
import {MultiLocation} from "@polkadot/types/interfaces"
const location: MultiLocation = {
...
0
votes
2
answers
42
views
How to decode an error that happened in a proxy.proxy call
I'd like to show my users if an error occurred while doing a proxy.proxy call.
While I know how to decode a system.ExtrinsicFailed, as this is well documented, I have difficulties finding the correct ...
2
votes
1
answer
77
views
How do I include a tip for transactions using Polkadot.JS/API
I am attempting to add a tip to a transaction in the following manner:
const batch = await api.tx.utility.batch([...]);
batch.tip = 1;
It appears that tip is a read-only property and I'm receiving an ...
0
votes
0
answers
30
views
Council propose motion failing
I have a custom substrate node running and when I tried to use the council propose motion page to propose something it was failing. At first I thought its an issue becasue of my custom implementations ...
1
vote
1
answer
44
views
How to generate augmented types from V14 metadata generated with subwasm
The common way of generated type augmentation is by fetching the latest metadata from a running node with the following piece of code:
await provider.connect()
await provider.isReady
const result = ...
2
votes
1
answer
38
views
How do withdraw or transfer tokens from the custom predefined accounts in a private network?
I've created a custom network from node-template with more pallets (staking, babe,...)
I've generated a custom chain_specs.json following this tutorial
chain_specs.json
{
...
"genesis"...
1
vote
0
answers
32
views
PolkadotJS system and storage events are not being decoded and shown properly
I found a perhaps similar question here : Polkadot Explorer: decode storage system.events
We are running a custom parachain with frontier on a local testnet and while the transactions go through fine,...
3
votes
1
answer
42
views
Command to insert keys in Polkadot Relay Chain and Parachain for Custom Validators in ChainSpec?
I have the keys separate in a file. I don't want to insert keys for polkadot js app for each node running the relay chain. Same for collator for parachain.
What is command to insert keys through CLI?
0
votes
1
answer
13
views
Dependency Errors While Running Yarn On Ubuntu For Local Installation of Polkadot-JS/apps
I am attempting to compile and run polkadot-JS/apps on Ubuntu cloud server (Digital Ocean). I have Node.JS and yarn installed. While running "yarn" in the polkadot-JS/apps folder, I get a ...
0
votes
1
answer
40
views
Get pool name and stash account from nomination pool creator
Can you explain me how I retrieve (from Polkadot JS) :
The nomination pool name (from a given pool Id)
The stash account of nomination pool creator ?
For example, here is the first nomination pool :
...
1
vote
1
answer
92
views
NGINX Reverse Proxy JSON Parse Error
I have NGINX and SSL set up on Digital Ocean Linux Ubuntu, running an RPC node. The RPC node sees the Polkadot-JS/apps and accepts the connection but the Polkadot-JS/apps never sees anything in return ...
1
vote
1
answer
26
views
Is there a .into_sub_account_truncating equivalent for Javascript?
In rust I use:
.into_sub_account_truncating()
Is there a Javascript equivalent?
1
vote
2
answers
112
views
Update Runtime sudo transaction exhausted (Substrate)
I am trying to reimplement one of the Substrate tutorials:
https://docs.substrate.io/tutorials/get-started/upgrade-a-running-network/
But I am stuck with an issue - where it says to do Scheduler -> ...
0
votes
1
answer
41
views
How do we resolve the InvalidScheduleVersion error?
From the contracts pallet:
/// A new schedule must have a greater version than the current one.
InvalidScheduleVersion,
The context of this error is sending batch transactions from ...
0
votes
2
answers
82
views
Problem Connecting Digital Ocean RPC Node to Polkadot-JS (NGINX Configuration Problem?)
I have established an RPC node on a Digital Ocean droplet and configured NGINX and SSL according to the instructions at the polkadot wiki. Configurations below. Connecting on wss://koabd.rocks or wss:/...
0
votes
1
answer
93
views
How to get transaction hash from Storage?
I created my own Pallet to save Student certificates, then I am reading the Storage to retrieve the certificates that I have stored in BC using Plokadot.js, this is the code for read the certificate ...
1
vote
1
answer
71
views
"Cannot convert undefined or null to object" using polkadot.js in substrate tutorials
I've been following through the pallets tutorial: https://docs.substrate.io/tutorials/work-with-pallets/use-macros-in-a-custom-pallet/ and got stuck at the last step of interacting with the blockchain....
0
votes
1
answer
39
views
polkadotJS chain state system.account() include option false, how to rebuild with RPC?
I'm trying to parse the whole storage from a node with the encoded partial key through RPC, it seems to be doable with polkadotJS see the picture in one call.
The fastest approach that we currently ...
0
votes
1
answer
80
views
"new CodePromise" now throws an error [ Issue of Weight V2] [duplicate]
I implemented this sample(https://github.com/realtakahashi/polkadot_js_examples) about 3 months ago
This sample works on astar-collator v4.33.0, but does not work on v4.39.0
I got an error when &...
0
votes
2
answers
40
views
toHuman() but with regular numbers
The toHuman() call on Types casts numbers into formatted strings and rounds currency values.
I would like to store large amounts of block information in human-readable format, but not lose the ...
0
votes
1
answer
42
views
Which PolkadotJs function receive as a parameter the user's wallet password to sign a transaction?
All examples that I found are using //Alice. However, these accounts are usually funded with test tokens and don't require a password to sign transactions. So, I would like to know how to sign and ...
1
vote
1
answer
190
views
Suppress Warning "API/INIT: RPC methods not decorated"
Is there a way to suppress this warning when using Polkadot.js?
API/INIT: RPC methods not decorated: chainHead_unstable_body, chainHead_unstable_call, chainHead_unstable_follow, ...
4
votes
1
answer
85
views
How to make runtime api available from polkadot js
I declared runtime api, implemented it in runtime, but i can't call my runtime api from polkadot.js. What i need to do to be able to call it?
Declaration:
sp_api::decl_runtime_apis! {
pub trait ...
0
votes
0
answers
27
views
How can I select a keypair from my keyring and prompt a password for signing transactions?
As the title says, I'm trying to be able to select a keypair from my keyring prompt for a password then sign a transaction and submit to the tx pool.
How should I use the ui-keyring and keyring to ...
0
votes
0
answers
46
views
--listen-addr /ip4/0.0.0.0/tcp/9944/ws breaks polkadot.js
I am trying to get my westend boot nodes to also serve polkadot.js
Following https://github.com/paritytech/polkadot/issues/6208, there is a recommendation [requirement?] to run polkadot with Node was ...
0
votes
0
answers
54
views
How to use `useCall()` polkadot react-hook? Type issue
I'm trying to use useCall() to add to polkadot js ui.
.
I've added the type interface:
/** @name UserSupersig */
export interface UserSupersig extends Struct {
readonly user_supersigs: Vec<...
0
votes
1
answer
29
views
"Cannot call send() while not connected" with RPC websocket provider
I will try to explain it briefly. I'm using Promise API to connect to few different RPCs (ws). Also I'm listening to an event connected on each websocket provider. When all providers are connected I ...
0
votes
1
answer
63
views
Can't vote from ledger using a hardware wallet?
I tried to vote from a ledger kusama account on polkadot js and I get Raw data signing is not supported for hardware wallets. Is this a limitation of the zondax ledger app or a polkadot-js limitation?
1
vote
1
answer
66
views
Custom ChargeTransactionPayment type for extrinsics
if the type for extrinsic verification pub struct ChargeTransactionPayment<T: Config> has been changed on a chain, how do we update the polkadot.js API to use the new types? Suppose the type has ...
1
vote
0
answers
21
views
How to show dropdown in PolkadotJS after selecting an item for extrinsic?
First of all I apologise in advance for asking this weird question. I am not sure if this is the right forum.
I have a scenario, where I have a data structure and storage like this:
#[derive(PartialEq,...
2
votes
0
answers
15
views
core::default::Default` is not implemented for `<T as frame_system::Config>::AccountId` [duplicate]
use frame_support::pallet_prelude::;
use frame_system::pallet_prelude::;
use scale_info::{prelude::vec};
use frame_support::inherent::Vec;
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait ...
2
votes
1
answer
54
views
Nomination Pool Question
We would like to know What parameter should we pass in as “extra” for bondExtra(extra)? And what does it mean for the type “PalletNominationPoolsBondExtra”
Thank you, the Starfish team
0
votes
1
answer
84
views
`total_supply` function return value on erc20(psp22)
I am using erc20(psp22) smart contract to create fungible token. Contract successfully compiled and deployed. While I was deploying, I added initial_supply: Balance as 2. I tried to read ...
0
votes
1
answer
36
views
Use polkadot-v0.9.33 or hight verison bianry launch local parachain onborading fails
Using the ts code to call the parasSudoWrapper.sudoScheduleParaInitialize interface to register the parachain locally, the parachain has not produced blocks.. It is only a parathread found in the ...
1
vote
1
answer
35
views
Polkadot-JS wallet staking automation
We are trying to achieve staking automation to nominationPool.
Is there any solution to get the number of bonded & unbound (unlocked) funds using the Polakdot-JS API?
We would like to fetch the ...
0
votes
0
answers
11
views
UnsubscribePromise not being returned from subscription
When I try to create a subscription from a custom pallet, it doesn't return a UnsubscribePromise (like the native ones), but returns a Promise<Codec>, even though I added a callback as the last ...
0
votes
1
answer
36
views
How to determine the conviction of a democratic vote using Polkadot API
When I cast a vote on a referendum with a value as
let vote = {
Standard: {
vote: { ...
3
votes
0
answers
35
views
Where to add the Custom RPC types in polkadot-js/apps directory?
In the Custom RPC types docs it explains how to create the types within the API promise, but it doesn't explain where to add it within the polkadot-js/apps repo, which is understandable because the ...
0
votes
0
answers
37
views
Updated version of @polkadot/api throws uncaught node error
Upgraded @polkadot/api from version 6 to version 9
Uncaught NodeError Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './cjs/packageInfo' is not defined by "exports" in node_modules/@...