Questions tagged [polkadot-js]

Questions about the Polkadot-JS API used to interact with Substrate-based chains using JavaScript.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Polkadot Typegen importing JS extension instead of TS

We are using the typegen to create types for our custom chain. Following the docs The code that is generated is kinda strange. In the augment-api.ts file it tries to import all the other generated ts ...
donkeydonkey's user avatar
2 votes
0 answers
7 views

How to use staking proxy signing the proxied stash's unbond action?

You know the controller account is deprecating, and the proxy account function is introduced. I set up a proxy with my validator, but I can't nominate(or other staking functions) if I only have the ...
Purson Chan's user avatar
0 votes
0 answers
65 views

Smoldot + polkadotjs: UnusedProofEntry when attempting to query a contract

I'm running a custom smoldot node, synced with a hosted bootnode, in a react-based application and attempting to interact with an ink! contract deployed to the network. My fork of smoldot accounts for ...
Tony's user avatar
  • 517
0 votes
1 answer
13 views

Polkadot.js wallet dosen't show methot section(transaction details) when making a transaction

When making a transaction we are supposed to see the transaction details under the method section but we only see method data Wrong: Correct(you can see the method -> assetConversion..):
Nikola Grujičić's user avatar
1 vote
1 answer
21 views

Polkadot JS query response types are missing

No types for blockchain query responses are available in our IDE. Doing any query like this await blockchain.api.query.assets.asset(id, (res) => { const info = res.toJSON() console.log(&...
donkeydonkey's user avatar
1 vote
1 answer
28 views

Substrate Node Error: Denied request: HTTP header: host value verification failed

I am trying to run a Substrate node with a custom configuration using the following command: ./target/release/node-template \ --base-path /tmp/pikamo \ --chain ./customSpecRaw.json \ --port ...
Mr Coder's user avatar
  • 819
1 vote
2 answers
24 views

how many ways are there to get all items stored in custom pallet

I would like to know what are the ways and how we can retrieve the all items stored in a custom pallet I was having data structured in this way #[derive( Clone, Encode, Decode, Eq, PartialEq, ...
Mojo's user avatar
  • 55
1 vote
0 answers
47 views

BestWay The Restart Substrate Node

After adding the validator node, it may encounter issues preventing it from creating blocks and initiating the next era in the blockchain. in this case,is there a way to restart the network? keep the ...
user4676's user avatar
0 votes
1 answer
34 views

How to properly decode a SCALE-encoded string using polkadot-js?

Using @polkadot-js/api, one can encode a string aabbcc into 0x18616162626363 > u8aToHex(api.createType('String', "aabbcc").toU8a()) "0x18616162626363" I know that SCALE ...
btwiuse's user avatar
  • 261
2 votes
1 answer
26 views

Transaction pool management

I have to send thousands of transactions to a custom substrate chain, it will probably take a few days to process all of them. Of course I can't just send all the transactions at once because they ...
Valentin Fernandez's user avatar
2 votes
1 answer
28 views

How to retrieve number of decimals for custom token (not DOT)?

How to retrieve number of decimals for custom token (not DOT)? api.registry.chainDecimals is for DOT. I need to retrieve it for a custom token.
Robert La Ferla's user avatar
1 vote
0 answers
15 views

Why are payloads wrapped in a <Bytes> tag? [duplicate]

In Polkadot JS Apps, when signing a payload the payload is wrapped in a <Bytes> tag. E.g. I put a few console log's in the polkadot JS apps code to figure out what's going on. As you can see, ...
goastler's user avatar
  • 529
1 vote
1 answer
30 views

Decode event data

I am learning to use polkadotjs api, I am trying to send a system.remarkWithEvent and then get the event that this created and decode de output to verify that the remark is there. The sending of the ...
Valentin Fernandez's user avatar
1 vote
1 answer
48 views

Issues approving transactions after updating parity signer

After a year of not using my Parity Signer, I attempted to approve a transaction using it. Initially, the signer displayed an error upon scanning the transaction QR code. In response, I updated the ...
user4594's user avatar
2 votes
1 answer
36 views

Obtain the balance of erc20 tokens with Polkadot JS

I'm seeking a method to retrieve the balances of all ERC20 tokens associated with an account using the Polkadot JS API. I've been unable to locate a specific API call that enables this functionality. ...
Brian Ramirez's user avatar
1 vote
1 answer
126 views

Polkadot - westend/westmint: how to create a pool using the asset conversion pallet?

We want to create a pool and we need to provide asset1 and asset2 values to the function, we are not sure what those asset1 and 2 are exactly (we are not sure what it represents or where to find it). ...
Nikola Grujičić's user avatar
1 vote
2 answers
38 views

system.ExtrinsicFailed Token.NotExpendable

I'm working on a project that involves setting up a shared pot account. Anyone can fund this account, and the owner has the ability to withdraw money from it. However, I'm encountering an error: ...
Deepak Chaudhary's user avatar
0 votes
1 answer
30 views

If a transaction is created using subxt/polkadot-js and how to sign it using any crypto libraries and send it again using subxt/polkadot-js

I'm trying to create a poc to separate out the signing of transactions from the libraries such as subxt or polkadot-js. I was trying subxt and schnorrkel libs to create partial signed transaction and ...
kroos47's user avatar
  • 59
1 vote
0 answers
59 views

My implementation wont let me batch more than 4 transfer calls

My implementation wont let me batch more than 4 transfers. Am I doing something wrong? I know the code is a bit complex because its normally not in one func but i has to be in this way. I am suprised ...
Jozzy's user avatar
  • 33
1 vote
2 answers
25 views

Provide judgement on polkadot js

I'm trying to use my node's identity pallet via polkadot js. Generally that works well, but I do run into an issue when providing judgements. This function requires an identity: H256 (Hash) value. ...
Arjan van Eersel's user avatar
0 votes
1 answer
39 views

Kilt SDK import breaks types

after adding the kiltprotocol/sdk-js to my front-end, I get the following two errors when importing the kilt module. Error 1: Type 'Codec | Codec[]' is not assignable to type 'InjectedAccountWithMeta[]...
Kazunobu Ndong's user avatar
0 votes
0 answers
20 views

How to Handle Disconnections with WsProvider for Persistent Browser Tabs and Safari on IOS?

We're currently working on [Grill. chat] (https://grill.chat)and uses the WsProvider to establish a WebSocket connection with xSubsocial node. However, we are encountering an issue where the WebSocket ...
Oleh Mell's user avatar
0 votes
0 answers
33 views

Error: createType(ExtrinsicSignature):: Unable to create Enum via index 108, in Ed25519, Sr25519, Ecdsa

I'm trying to use the Polkadot CLI to create an unsigned extrinsic, which I subsequently generate a signature for sign out of band using my custody provider. The Polkadot CLI has a useful tool for ...
Roger's user avatar
  • 1
3 votes
1 answer
31 views

subscriptions with parameters in polkadot.js api

I am using React+Typescript and trying to retrieve data from a struc using a query subscription. I first tried the following in order to check that I'm retrieving the right data: api.query.rolesModule....
Kazunobu Ndong's user avatar
0 votes
1 answer
31 views

Uncaught (in promise) Error: Cannot convert 'InBlock' via asFinalized

I am trying to sign and send some transactions using the batch function. Here are some code snippets for reproduction. const nftMinting = async (item) => { try { let collection = 1 ...
Alan Ma's user avatar
  • 47
0 votes
1 answer
27 views

Where can I find the js code of polkadot pallet?

As we can see in polkadotjs, when we add pallet then we can see interaction interface as shown in image below. But how this code is generated? Where can I find the code?
Ganesh11's user avatar
  • 1,168
2 votes
0 answers
33 views

Someone suggest me some resources of NFT Pallet frontend react implementation?

I am using nft-pallet for nft creation. I have implemented in substrate node. Now I wan't to write my own code not polkadotjs to create with nft using nft pallet using react frontend. Someone please ...
Ganesh11's user avatar
  • 1,168
0 votes
0 answers
28 views

How to get the current session keys used by an active validator?

There are api.query.session.nextKeys and api.query.session.queuedKeys for obtaining the next session keys for a validator (doc). But how do I query the current the session keys used by an active ...
btwiuse's user avatar
  • 261
1 vote
1 answer
24 views

When sending Transact XCM Instruction, how to specify the pallet which contains the extrinsic to execute on target parachain?

When sending Transact XCM Instruction from parachain A, how do I specify (or how does the xcm-executor know) the pallet / pallet id on the target Parachain B which contains the extrinsic to be ...
Neo's user avatar
  • 263
3 votes
1 answer
35 views

Estimated fees too high

Estimated fees for some extrinsics look significantly higher (4-10x) that the final used ones. This example of a delegate call highlight this: https://polkadot.subscan.io/extrinsic/16420739-2 (see ...
Julien Eluard's user avatar
1 vote
1 answer
45 views

How to programmatically execute xcm message from Patachain A to execute an extrinsic on Parachain B

I have a local relaychain setup with 2 parachains Parachain A and Parachain B . I will like to execute an XCM message from Parachain A to execute an extrinsic on Parachain B using the Transact ...
Neo's user avatar
  • 263
1 vote
3 answers
48 views

How to call PSP22::approve function from Frontend

Any guidance on how to call my psp22 approve function from the front end ? This is currently how I'm doing it but it doesn't seem to give increased allowance (although its successful) : import { ...
0xD1x0n's user avatar
  • 119
3 votes
1 answer
40 views

Custom RPC vs. runtime API

As a Substrate builder, I don't see any reason of still implementing custom RPCs as runtime API seems superior to me. So I was wondering about any arguments for still adding custom RPCs to the client. ...
0x5hmoo's user avatar
  • 157
2 votes
1 answer
35 views

I'm using Polkadot js api to fetch the westmint nft pallet collection and their details but i got an error it dosen't show me the instance id

I tried to figure out the collection id from the api i got an hex value but when i tried to convert that hex to numbers i got an undefined value here is my code i think the hex value which is outside ...
Ashutosh singh's user avatar
2 votes
1 answer
34 views

Error with submitted preimage

I am attempting to note.preimage the following call data hash: ...
Paradox - ParaNodes.io's user avatar
2 votes
1 answer
25 views

How to Recover Address from MasterPrivateKey in JS

I trying to make Signature using Polkadot.js without mnemonic in LedgerAddress. import { hdLedger } from "@polkadot/util-crypto"; import { u8aToHex } from "@polkadot/util"; import ...
Albert's user avatar
  • 21
0 votes
0 answers
11 views

polkadot-apps build working, but failing to run

We have a forked apps repo and did an upstream merge recently. It is working fine when running yarn start, but whenever we try to build the code and use that index.html file its failing to run. There ...
kroos47's user avatar
  • 59
0 votes
1 answer
38 views

Substrate-connect for solo-chains

I don't see any support for connecting via the substract-connect library for a sovereign chain. E.g. the addChain function has a dependency on the relay chain. Is there some way to connect to a custom ...
Justin Frevert's user avatar
2 votes
1 answer
57 views

api.createType does not work?

I would like to create a type called XcmVersionedMultiLocation. It can be imported using the following code: import { XcmVersionedMultiLocation } from "@polkadot/types/lookup"; To create an ...
Michal Danco's user avatar
0 votes
2 answers
30 views

How to cleanup a failed ApiPromise after initialising

Currently trying to create a way to attempt a new ApiPromise .If a specific RPC is deemed to be down / unavailable Code basically looks like this const api = await ApiPromise.create({ ...
Joon's user avatar
  • 13
0 votes
1 answer
25 views

How to get a list of voters per referenda through Polkadot JS?

I am trying to assemble a list of all voters on a referendum with their votes, etc. I need help on what storage pallet to call, I tried calling the functions on the convictionVoting pallet which is ...
user4394's user avatar
0 votes
2 answers
42 views

duplicated sessionkey

In polkadot.js staking , when i put the session key, the result is "duplicated session key" I use the command in SSH "echo '{"id":1,"jsonrpc":"2.0","...
jay p's user avatar
  • 61
5 votes
2 answers
53 views

How to query chainspec with @polkadot/api

In the documentation getChainProperties(https://polkadot.js.org/docs/api/examples/promise/chain-info/) is mentioned for getting the properties for a blockchain, but it contains very little amount of ...
Szegoo's user avatar
  • 563
2 votes
1 answer
38 views

validating node, how connet to polkadot.js

for running validate nodes, through set up, now i can see my node on the telemetry. but i dont know how to connect to polkadot.js. polka wiki says "You can generate your Session keys in the ...
jay p's user avatar
  • 61
3 votes
2 answers
46 views

How to perform chain state query for entries AND at a block hash?

I can do this to get all the structs in my storage: let queryResult = await api.query.mypallet.mystorage.entries(); but I want this query AT a specific block hash: let currentHeader = ...
Robert La Ferla's user avatar
4 votes
3 answers
68 views

Troubleshooting Polkadot.js Recognition of Prefunded Dev Accounts on a Network Using EthereumSignature

I've made some changes to my blockchain setup recently. I switched the signature over to EthereumSignature, which changed my AccountId to an H160 size. Thankfully, I can still use scripts to manage ...
ALeSD's user avatar
  • 389
4 votes
0 answers
32 views

Polkadot JS units for currency

I am implementing a pallet which interacts with pallet_balances via Currency trait. For some reason, when I call any operation on currency trait (like Slash on screen below), it is not aligned to ...
Klapeyron's user avatar
  • 101
4 votes
3 answers
37 views

How to independently check in which block extrinsic got included?

The standard way to track extrinsics is: api.tx.balances .transfer(recipient, 123) .signAndSend(sender, ({ status, events }) => { if (status.isInBlock) { // here we know that our tx ...
Mexke's user avatar
  • 45
3 votes
0 answers
31 views

How to compare current date with a stored date in a Substrate blockchain module?

I'm working with a Substrate blockchain and have a structure with a field named end_date. I'd like to check if the current date is greater than end_date within a Substrate runtime module, but I'm ...
Mr Coder's user avatar
  • 819
3 votes
0 answers
32 views

How to get runtime types in polkadotjs (typescript)

In subxt we can have Rust types directly from scale-encoded runtime metadata. Is the same possible in polkadotjs? Is there a "polkadots" which has typescript types automatically derived from ...
Hugo Trentesaux's user avatar

1
2 3 4 5
11