Questions tagged [polkadot-js]

Questions about the Polakdot JS API used to interact with Substrate based chains via JavaScript.

Filter by
Sorted by
Tagged with
0 votes
1 answer
7 views

dApp registration issue - Shiden Network

I'm in the process of making a video tutorial for The Kusamarian YouTube channel :"How to register a dApp on Shiden Network" I went through all the steps, but it failed at the end. Could you ...
0 votes
0 answers
7 views

How to check what node authoring a block with Aura in the Polkadot.js App?

There is a way to see what node authoring a specific block in the Polkadot app?
  • 63
0 votes
0 answers
14 views

JavaScript/TypeScript: How to pass arguments of an array individually to a function?

I want to dynamically call contract functions. The only problem with this is, that all of the functions have a different amount of variables. As of now, the function looks like this: async call(...
  • 182
2 votes
1 answer
115 views

Is there a way to add a some transaction message to the dot transfer?

Example: If we are doing 10DOT Transfer from one address to another address, Can we attach some description like "test transaction" or "investment"?
1 vote
1 answer
13 views

How can I tell which validator is being bonded to for a given bonding extrinsic?

I would like to extract the validator that a given nominator is bonding? Is this possible given the extrinsic or should it be done some other way? Here is my code: const { ApiPromise, WsProvider } = ...
  • 37
0 votes
0 answers
23 views

Is it possible to pull the transactions that the Moonbeam collators are sending to the Polkadot relay chain?

Currently, working inside the Moonbeam interface and was wondering if it was possible to pull the group of transactions that the Moonbeam collators are sending to the Polkadot Relay Chain before the ...
  • 1
0 votes
2 answers
26 views

Docker container...-p 9944:9944 running Node Template not working on polkadot js apps

I'm trying to run a substrate node through docker container but i am not able to with this command: docker run -p 9944:9944 -p 30333:30333 -p 9933:9933 -p 9615:9615 docker.io/decentration/supersig-...
0 votes
2 answers
29 views

What exactly is the payload?

I am trying to understand what is in a transaction specifically the payload. While the documentation references the term payload, it is not explicit/clear about what exactly it is. It seems to ...
  • 103
0 votes
0 answers
5 views

How to interact with the pre-defined public address

I want to interact with the pre-defined public address. I want to use a map function to hide the public address with any name I want
0 votes
1 answer
15 views

Is it possible to stake DOT programmatically?

The title is pretty much it. Can I use Polkadot API to stake dot programmatically? Can't seem to find that in the docs.
1 vote
1 answer
22 views

Display type alias for primitive types

I have observed few pallets have type alias for primitive types for chain state. For eg- Grandpa pallet has one storage setIdSession which shows type as SetId even though its primitive type is u64. ...
1 vote
0 answers
14 views

How to call a function from custom pallet using api.tx?

I made a custom pallet and wants to access its method using a extrinsic call like api.tx.<module>.<method> but was not able to do that, do i need to implement it in blockchain code or it ...
0 votes
0 answers
14 views

How did kusama and Polkadot integrated their respective ledger nano app via Polkadot ui?

Polkadot and kusama respectively have integrated their platform with ledger hardware wallet. After reading documentation I came to know that integrating a blockchain with ledger requires a nano app ...
0 votes
0 answers
49 views

error TS2742: The inferred type of X cannot be named without a reference to

I am building simple SDK for Polkadot Api calls. I am running into following issue trying to build it: error TS2742: The inferred type of 'closeChannel' cannot be named without a reference to '.pnpm/@...
  • 1
1 vote
2 answers
49 views

How to use `asMultiThreshold1` within the multisig pallet

Aim I would like to use the asMultiThreshold1 extrinsic in the Extrinsic Tab to produce a multi-sig call to authorise a balance transfer from the multi-sig account ABC (made by Alice, Bob and Charlie) ...
  • 11
0 votes
1 answer
21 views

Calling an extrinsic using the polkadot-js-api CLI tool

How can I call an extrinsic on a palette using the polkadot-js-api CLI tool? I don't see much documentation on the tool nor does the --help provide much detail. Could I use this tool for this ...
0 votes
2 answers
41 views

Where does initial ALICE account balance come from? From development_config() or local_testnet_config() in chain_spec.rs?

Every time when I start my parachain, I see Alice, Bob, Charlie, Dave,... etc and each of them has 1.1529 MUNIT on Polkadot.js.org's Accounts -> Accounts -> My Account page. How does Polkadot.js....
  • 737
1 vote
1 answer
18 views

Subscribe to all storage

Reading through this: https://polkadot.js.org/docs/api/start/api.query.multi/ It states "It should be trivially extendable to subscribe to the validators, track which one have entered or left&...
  • 11
0 votes
1 answer
16 views

How to get event args values from contracts::contractemitted data?

I am using const decodedEvent = Abi.decodeEvent(Uint8Array.from(Buffer.from("00000064a7b3b6e00d000000000000000000000000000000000000000000000000", 'hex'))) (...
  • 101
1 vote
1 answer
21 views

How to set decimal points on Polkadot.js.org account balances for parachain

Every time when I start my parachain, I see Bob, Charlie, Dave,... etc and each of them has 1.1529 MUNIT on Polkadot.js.org's Accounts -> Accounts -> My Account page. But how does Polkadot.js....
  • 737
0 votes
0 answers
20 views

Why is it that the signature created using polkadot api is valid, but verifying that signature using substrate library is invalid?

The js code uses polkadot api, util-crypto and extension-dap const { signature } = await signRaw({ address: account.address, data: payload, type: 'bytes' }); // ...
  • 101
0 votes
1 answer
47 views

Past reward history in polkadot.js

api.query.staking.erasRewardPoints(era) query returns reward history for selected era. And only last 84 eras reward history is available. I want to get reward history from first era. How can I get ...
0 votes
0 answers
13 views

Why I don't see OpaquePeerId in the polkadot app?

I have this simple function that emits this event. I also set a GenesisConfig for the pallet in the node/src/chain_spec.rs in this way. But when I run the blockchain in dev mode and I call the ...
  • 63
1 vote
1 answer
29 views

what is Substrate Files Decentralised storage?

Can anyone please give me any link or docs where I can find more about Substrate Files decentralized storage? I have gone through this link: https://github.com/polkadot-js/apps/pull/6106 Is there any ...
0 votes
0 answers
21 views

Get reward amount in polkadot.js/api

I want to get reward for specific address in polkadot.js/api. Especially for kusama. Is polkadot.js providing such api to get reward for specific validator address? also for specific block height?
0 votes
0 answers
27 views

Can not transfer balance in polkadot.js.org?

I start running development node, and try to test about transfer balance in polkadot.js.org Problem: Make Transfer button only hidden, not show
  • 198
0 votes
0 answers
14 views

PolkadotAPI Signing transaction using AccountKey20 address format [duplicate]

I have error signing transaction with account that uses accountkey20, have anyone encountered this problem and fixed it? What is the current behavior and expected behavior? When I try to sign ...
  • 1
0 votes
0 answers
15 views

How can I tell which validator a nominator is bonding when extracting bondExtra extrinsic from block polkadot-js?

I am trying to extract extrinsics with a bonding event from a block and extract a validator, nominator pair for each. I would also like to know how to fetch the amount that was staked. Code: // ...
  • 37
0 votes
2 answers
30 views

Typescript errors when using @polkadot/api

I'm building a typescript project and I'm trying to do the very simplest thing as a first step with Polkadot: Connect to a node and get account information. However, when I run tsc, it totally blows ...
  • 99
1 vote
1 answer
17 views

How to get circulating supply / 'electorate' from API

I would like to calculate the threshold for referendums to pass. I found this article about how the calculation works, but it requires the number of coins in circulation. Is there an API endpoint for ...
  • 113
0 votes
1 answer
30 views

polkadot-js: What does targets mean in api.query.staking.nominators?

code: const nominators = await api.query.staking.nominators.entries(); example json output for nominators vaiable: [ [ [ "145xupEFYa81KCexCH5bRU6k3fqY9GgLWAH8nMhat2CKHkcd" ],...
  • 37
2 votes
2 answers
47 views

Polkadot js API Type Issue

I am getting type as Codec while using api.query.<module><method>. The types should be specific or am i missing something. Is there any way to convert this into the right type.
  • 21
1 vote
1 answer
30 views

How do I connect to an archive node with polkadot.js api?

Is there a list of archive nodes for polkadot/kusama/parachains? I'm trying to fetch all historical events in order to visualize staking rewards for nominators and validators.
  • 37
0 votes
1 answer
27 views

After BABE changed to RRSC, explorer does not show the author

After BABE changed to RRSC, explorer does not show the author
1 vote
1 answer
54 views

Polkadot.js: How do I fetch all rewards paid to a specific nominator that resulted from a specific validator?

I have tried using api/packages/api-derive/src/staking/erasRewards.ts, but I do not understand what titrates the number of eras being shown. Also, whose rewards am I looking at? All rewards in that ...
  • 37
1 vote
1 answer
21 views

How to change input from string to Id::Bytes in JavaScript?

I am using the openbrush standard to implement a psp34 token. Now I want to call certain methods from said token, like for example owner_of. owner_of from psp34 has id:Id as an input which can then be ...
  • 182
0 votes
2 answers
33 views

How to save decoded events using polkadot.js?

I am monitoring the events when calling a method from my contract and want to save the output of one of my custom events, to display it. The call of my method looks like this: contract.tx .method({ ...
  • 182
0 votes
1 answer
38 views

How to call prefixed by trait(interface) methods using the polkadot api?

I wrote a smart contract, implementing a psp34 token (docs). Inside the smart contract, it is no problem using the methods provided by openbrush. However, when I deploy it on chain and want to call a ...
  • 182
1 vote
1 answer
42 views

Using polkadot.js api, how can we list the members of a Kusama nomination pool?

According to the documentation, api.query.nominationPools.poolMembers should yield details about pool members. The result should be a Map so we should be able to iterate the .entries / .keys. (async ()...
  • 145
0 votes
1 answer
35 views

How to get output when calling a contract method and signing it?

I have a contract which I want to call using the polkadot{.js} extension. To call the method successfully, you have to sign it. When I am now signing a method, I have trouble reading out the value the ...
  • 182
0 votes
1 answer
25 views

Polkadot-JS: Retrieve return type of a query operation dynamically

Given the following code sample api.query.system.account I'd like to know the key prefix constituents, i.e. System + Account and the type this operation will return as a string, i.e. ...
  • 173
0 votes
1 answer
20 views

@polkadot/typegen 9.1.1 use the missing types

generated files augment-api-runtime.ts has a line augment-api-runtime.ts:136 which looks like this: /** * Return all the current data for a block in a single runtime call. **/ ...
  • 1
0 votes
2 answers
27 views

How to format time in client get from pallet_timestamp polkadotjs?

I get 1,660,103,328,001 type string from substrate node created by T::Timestamp::now(). What type is this? How can I format this value to readable date time? I've tried with new Date() but it return a ...
1 vote
1 answer
54 views

Integrate @polkadot/api with Vuexy React Template

I try to use PolkadotJs with my website create with Vuexy React but i have this error: ./node_modules/@polkadot/api/packageInfo.js 6:14 Module parse failed: Unexpected token (6:14) File was processed ...
1 vote
1 answer
47 views

How to call a contract using a custom RPC?

I uploaded a smart contract to the Aleph Zero test net. When I tried to query one of the methods of said smart contract, I encountered this error: 2022-08-09 09:34:28 API/INIT: RPC methods not ...
  • 182
0 votes
1 answer
21 views

How to query an address that has sub-identity?

Using polkadot.js api: How do I get from an address to the parent address/identity? Is there any way to traverse from an identity to the sub-identities? Just calling the identity of the address ...
  • 145
1 vote
1 answer
46 views

How do I get the block hash of an event?

I am subscribing system events using the events api. After I got the specific event I am looking for, how should get the block hash of this event? Thanks api.query.system.events((events) => { ...
2 votes
1 answer
34 views

getBlock - Unable to catch some transactions

when I run getBlock function as followed const signedBlock = await api.derived.chain.getBlock(blockhash) I can fetch data from this blockhash: ...
0 votes
1 answer
38 views

RPC deployment Guideline

I have a questions in regard to RPC node for Polkadot or Substrate. RPC node configuration - i dont see too many information in regard to this. Is there public information on how to setup a RPC, if ...
0 votes
2 answers
95 views

polkadot.js api: How to find all nominators of a validator?

How does the polkadot api keep track of the nominators per validator? Here you can see there is a count of nominators. api.query.staking.nominators(stash) provides a list of validators the stash has ...
  • 145

1
2 3 4 5 6