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

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

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

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

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

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://'); ...
1 vote
2 answers

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

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)); const voteConfig: Vote = ...
2 votes
1 answer

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