Questions tagged [api]

The tag has no usage guidance.

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

Help needed with payloads and extrinsics

I know that the payload and extrinsics are dynamic, and even different between parachains/base chains(kusama,polkadot,rococo,westend). But I am struggling to find good documentation on how these ...
user avatar
  • 1
1 vote
1 answer
23 views

get bonded balance using API

This is how to get the free balance of an account: api.query.system.account(stash_account_address).data.free.toBigInt() How to get the bonded balance instead?
user avatar
1 vote
1 answer
24 views

Query account balance with HTTP calls

maybe a silly question... Is possible to query a balance using a HTTP call like eth_getBalance? I need a raw http call, like one that i can perform with curl. I looked the methods that polkadot RPC ...
user avatar
2 votes
1 answer
49 views

Dev Substrate Node at Capacity for WS Connections, how to flush?

I'm running a node in dev mode: ./substrate/target/release/substrate --dev --tmp --ws-external My client connection code: provider = new WsProvider(wsProvider) api = await new ApiPromise({ provider })....
user avatar
0 votes
1 answer
24 views

Runtime API to collect values in StorageMap

I'm trying to retrieve all values in my StorageMap defined as such in my pallet: #[pallet::storage] #[pallet::getter(fn submitted_tasks)] pub type SubmittedTasks<T: Config> = StorageMap<_,...
user avatar
0 votes
0 answers
43 views

DRR: createType(ExtrinsicStatus):: Cannot map Enum JSON, unable to find 'reason' in future, ready, broadcast, inblock, retracted, finalitytimeout

When I run the following code in some calls I get the following errors: DRR: createType(ExtrinsicStatus):: Cannot map Enum JSON, unable to find 'reason' in future, ready, broadcast, inblock, ...
user avatar
  • 387
3 votes
2 answers
41 views

Access your NFTs using PolkadotJS API

Still very new to this ecosystem. I'm trying to build a ReactApp that can access my NFT's that I have purchased on the Singular App. High level explanation, how do I do this? Low level, point me in ...
user avatar
  • 111
5 votes
2 answers
52 views

How to use Polkadot.js API for governance proxy call correctly?

I am trying to create a JS code to be able to vote using proxy account that has been given democracy permissions to stash account, so I would be able to vote using just my mobile phone instead of ...
user avatar
0 votes
1 answer
14 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 ...
user avatar
  • 497
1 vote
1 answer
38 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("@...
user avatar
0 votes
1 answer
14 views

Substrate Sidecar Custom Type Issue

I'm wiring up the substrate sidecar to a chain which has some custom type and some out of date types (as compared to current) such as AccountInfo. I've found that it uses the older ...
user avatar
3 votes
1 answer
35 views

How do I obtain key-value storage proof for a runtime call?

I want to run an experiment to see how big are PoVs for my parachain blocks. I figured I can leverage the same API that is used during syncing execute_block for the blocks I am interested in and ...
user avatar
  • 1,491
0 votes
1 answer
40 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
user avatar
1 vote
2 answers
40 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 = { ...
user avatar
2 votes
2 answers
71 views

Can I call external APIs inside my pallet?

How can I call external APIs from the chain then use that data to implement further logic
user avatar