As of May 31, 2023, we have updated our Code of Conduct.

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
66 views

How to know if the extrinsic completed without any extrinsic errors

I'd like to get if the extrinsic completed without any extrinsic errors and get the errors if any. result.isError returns false when there's an error. Could this be because I return DispatchResult ...
Burak's user avatar
  • 773
1 vote
1 answer
155 views

Sometimes Polkadot JS won't connect to the local node, unless I enable rpc-cors all

I am using the polkadot js appimage and sometimes while connecting to my node, I see this : Blocked connection to WebSockets server from untrusted origin: Some("file://"). I've tried running ...
Purple_Turtle's user avatar
1 vote
1 answer
59 views

How to connect to a node from other computer?

I am running a local node on a computer. How can I connect and get information on this node from another computer using Polkadot Js API?
Minh Mốc's user avatar
3 votes
1 answer
151 views

How to obtain extrinsic hash

PolkadotJS explorer provides a hash value for every extrinsic (see marked screenshot) but the extrinsics list from block data (block.extrinsics) does not explicitly provide one. How is this value ...
John Otu's user avatar
  • 345
2 votes
3 answers
203 views

Can we query blocks by (extrinsics) timestamp?

Can we query block data by timestamp? If so what time is the correct one to use? For a typical block object, there's a time property that seems to always be undefined, but the first extrinsic (index 0)...
John Otu's user avatar
  • 345
0 votes
1 answer
55 views

Invalid params: unknown field `storageDepositLimit` Error when getting contract data from a chain

I deploy the flipper contract to Jupiter testnet, when I try to get the contract data, I got this error message although it works just fine on a local node. (I also tested on other test networks and ...
Minh Mốc's user avatar
1 vote
1 answer
322 views

Transaction would exhaust the block limits error when calling a smart contract from Polkadot JS API

I'm trying to call a smart contract using the Polkadot JS API (like here). The contract function is really simple, it takes 2 strings: a key and a value as input parameters, then adds the key, value ...
Minh Mốc's user avatar
1 vote
1 answer
102 views

OutOfGas Error when trying to read contract data using Polkadot JS API

I'm trying to read the flipper contract data from a contract in a local node, following the code in here. This is my code: // Required imports const { ApiPromise, WsProvider } = require("@...
Minh Mốc's user avatar
3 votes
1 answer
276 views

How to format balance?

I tried using @polkadot/util's formatBalance function to get the formatted balance of the account. But it doesn't make sense. I believe unit conversion is not working properly and I wonder what I am ...
Burak's user avatar
  • 773
4 votes
1 answer
58 views

How to see the parameters that were passed into a contract call?

I want to know the contract address, contract caller, and what parameters were passed into the contract call but in the Polkadot.js UI, the presented fields don't seem to be helpful.
Minh Mốc's user avatar
5 votes
2 answers
171 views

What format is the block timestamp?

I'm using @polkadot-js to decode extrinsic data. The following method call returns a timestamp at a specific block, but I don't know how to parse this. I tried assuming that it's a unix timestamp in ...
mango's user avatar
  • 153
0 votes
1 answer
48 views

How to access storage items using polkadot js, javascript playground [closed]

As when i try to to do api.query.templatemodule.get_something() it shows errors in the console
Mrisho Lukamba's user avatar
4 votes
2 answers
190 views

How to get historical substrate (extrinsic, events, etc) data using polkaDotJS API

PolkaDotJS API docs show to get extrinsic, events, etc data for a particular block. Is there a way to get all the extrinsic, events, etc data for the substrate network without having to get for each ...
John Otu's user avatar
  • 345
2 votes
2 answers
63 views

How do I write custom a custom api-derive?

I am trying to create my own derives using DeriveCustom like this: import { DeriveCustom } from '@polkadot/api-derive'; import * as staking from './staking'; export const derive: DeriveCustom = { ...
Imri Paran's user avatar
5 votes
2 answers
503 views

How to decode extrinsic at json-RPC call's data(byte code)

I call json-RPC through the terminal and get the data as below. extrinsics is raw byte, but I'm using polkadot-js(SCALE codec?) to decode it. But I don't know which method to call. "block": ...
PaperFrog's user avatar
  • 445
2 votes
1 answer
155 views

How do you resolve missing type errors in the @polkadot/api v7.x.x packages?

Upgrading from: // package.json "@polkadot/api": "^6.7.2", "@polkadot/types": "^6.7.2", to: // package.json "@polkadot/api": "^7.7.1", &...
tarrball's user avatar
  • 215
5 votes
2 answers
194 views

How to enable units for currencies in polkadot-js

Currently, polkadot-js doesn't allow me to select a unit when specifying balances in the Developer > Extrinsics section, which means that all balances must be specified in the smallest unit (10^12 ...
mkl's user avatar
  • 348
7 votes
1 answer
91 views

Can an account's transactions be front-run on Polkadot? If so, how?

Is it possible to reliably monitor an account and receive information about a transaction of that account before the transaction is InBlock and then front-run that transaction by issuing a ...
mkl's user avatar
  • 348
4 votes
1 answer
63 views

How to create pallet errors for sudo that show up on the Polkadot JS apps interface?

Repost from stackoverflow: So I've been at my wits' end for quite some time regarding #[pallet::error] showing up on Polkadot JS apps interface when calling a fallible function from sudo. So as I've ...
Purple_Turtle's user avatar

1
6 7 8 9
10