Questions tagged [polkadot-js]

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.

Useful Links

88 questions
0
votes
2 answers

How to get unique smart contract errors in a frontend app using polkadot.js

I am implementing a smart contract with ink! I have defined my own errors in the smart contract like the example below. I don't know how to get the error information in my frontend app using polkadot.js when this error occurs. Can anyone tell me…
s.Takahashi
  • 469
  • 4
  • 15
0
votes
0 answers

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

I am using const decodedEvent = Abi.decodeEvent(Uint8Array.from(Buffer.from("00000064a7b3b6e00d000000000000000000000000000000000000000000000000", 'hex'))) (00000064a7b3b6e00d000000000000000000000000000000000000000000000000 is the data in the…
Ayudh
  • 1,673
  • 1
  • 22
  • 55
0
votes
1 answer

Why does nodejs wait a long time before exiting

i try to write a Creation Operator to got a observable from a wsprovider on polkadot.js. and try to got polkadot event. this is the code import {from, fromEvent, of,Observable} from 'rxjs'; import {tap,mergeMap} from "rxjs/operators" import {…
kula
  • 1
  • 1
  • 3
0
votes
2 answers

Uncaught (in promise) Error: Objects are not valid as a React chid. If you meant to render a collection of children, use an array instead

Im trying to render the output of the polkadot browser extension but i'm getting this error Uncaught (in promise) Error: Objects are not valid as a React child (found: object with keys {address, meta, type}). If you meant to render a collection of…
nvx
  • 1
0
votes
0 answers

Correlate events with extrinsics in a utility.batch call in Polkadot

In Polkadot and Kusama blockchains emitted module events has the phase property so we can correlate them with the extrinsic that triggered that event but I can't do the same when the extrinsic is included in a utility.batch…
0
votes
1 answer

Cannot create polkadot keyring with react native

I created a new react native project with this command: npx react-native init AwesomeProject installed package @polkadot/keyring, and created a default keyring: const keyring = new Keyring(); After launching the project I get an error: TypeError:…
0
votes
2 answers

Can I send transactions async using polkadot-js

I have walked through the official document and found a page about how to transfer using polkadot-js https://polkadot.js.org/docs/api/examples/promise/make-transfer const transfer = api.tx.balances.transfer(BOB, 12345); const hash = await…
Joey
  • 1,233
  • 3
  • 11
  • 18
0
votes
1 answer

How do you create an account using PolkadotJS?

The hosted PolkadotJS app allows connected Substrate nodes to use 'Add account' to create a new account on the blockchain. Using the PolkadotJS NPM package, how can I implement the 'Add account' feature?
lovelikelando
  • 7,593
  • 6
  • 32
  • 50
0
votes
2 answers

Retrieving password from Polkadot js extention

hey as the title hints to, yes i have managed to loose the mnemonic phrase for my polkadot js wallet in the event of staking and creating the account. In addition i have forgot the password to the wallet itself. Now my question is if it is possible…
kib
  • 77
  • 5
0
votes
1 answer

How to list all the parachains in a Polkadot network?

Is it possible to list all the parachains in a given network? The documentation for test-network for parachains states that we can select the desired parachain from the dropdown. I want to do the same thing from the backend using Rust but I am not…
Aviral Srivastava
  • 4,058
  • 8
  • 29
  • 81
0
votes
1 answer

polkadot-js balances.transfer throws error

In my webapp balances.transfer is throwing an error but staking.bondExtra is working as expected. Its connected to westend network. Error: Error: createType(Call):: Call: failed decoding balances.transfer:: Struct: failed on args:…
0
votes
0 answers

Got this runtime error while implementing assets pallet in substrate(1002: Verification Error: Runtime error: Execution failed:

Got this runtime error while implementing assets pallet 1002: Verification Error: Runtime error: Execution failed: ApiError(FailedToConvertParameter More info about error: 1002: Verification Error: Runtime error: Execution failed:…
0
votes
1 answer

UTXO Workshop: how to get Alice's sigscript?

This might be a stupid question... I was playing around the utxo-workshop, and there's a comment below asking on how to get alice's sigscript. I tried following the procedure in the test cases found in utxo.rs: let alice_signature =…
Jitterbug
  • 302
  • 1
  • 11
0
votes
1 answer

Polkadot: Weird Transaction Hash using JS API with Westend chain

I’m using the Polkadot JS API to send transactions on Westend. For that, the snippet is something like this: const hash = await api.tx.balances .transfer(to, amount) .signAndSend(from, { tip, nonce: -1 }) .catch(e => { …
0
votes
1 answer

Loading @polkadot packages in react native app with expo

I am currently working on a react application to complement a web application, and have been tasked with implementing an self-sovereign identity solution using the Kilt.io protocol. This worked fine for the web app, however I am running some issues…