Questions tagged [typescript]

TypeScript is a typed superset of JavaScript that transpiles to plain JavaScript. It adds optional types, classes, interfaces, and modules to JavaScript. This tag is for questions specific to TypeScript. It is not used for general JavaScript questions.

Filter by
Sorted by
Tagged with
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
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
2 votes
2 answers
57 views

How to decorate polkadot.js api with upcoming runtime features

There's upcoming features coming to pallet uniques. They are now merged to master of substrate repo but not yet released. We would like to be prepared for it on Singular marketplace but not 100% sure ...
  • 143
1 vote
2 answers
44 views

Are there any tools available for creating a mock version of a contract in JS/TS?

Currently, we use "live" versions of our contracts running on a substrate contracts node in our JavaScript tests. This makes them integration tests and difficult to include in simple GitHub ...
  • 874
1 vote
1 answer
22 views

Polkadot{js} state queryies example not working

I am trying to run one of the examples in the Polkadot{.js} documentation and it is not working for me in TypeScript. This much works const wsProvider = new WsProvider('wss://rpc.polkadot.io'); ...
1 vote
2 answers
169 views

How to prevent / remove duplicate modules and mismatched version numbers (i.e. @polkdadot/types)?

I am still learning TypeScript and I have some code that is working, but it returns a lot of messages about multiple versions of modules and conflicting packages. What is the best way to fix these ...
1 vote
1 answer
35 views

How to do a democracy pallet vote using Polkadot API in typescript

I am trying to do a democracy vote using the API. First I am getting the balance of my account: const balance = (await api.query.system.account(my_account)).data.free; const voteConfig: Vote = ...
2 votes
1 answer
73 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", &...
  • 215