Questions tagged [typescript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
34 views

What is the easiest way to write truffle tests in typescript?

I read about Typechain, but the configuration is rather verbose and generally feels like a very custom solution: Everytime you change contracts you need to run yarn generate.
2
votes
2answers
726 views

TypeError: web3_1.default is not a constructor

I'm trying to convert a DApp that uses web3.js from JavaScript to TypeScript, but I have encountered a bunch of runtime errors. I'm using Visual Studio Code IDE, and I'm compiling to ES6. I've reduced ...
1
vote
1answer
44 views

Calling transfer returns true but doesn't perform the transfer

I have the following simple transfer method in my contract to transfer my erc20 token to another account: function transfer(address to, uint tokens) public returns (bool success) { balances[msg....
9
votes
4answers
2k views

How to use web3.js@1.0.0-beta34 with TypeScript?

Here is a minimal code for testing: import * as Web3 from "web3" const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545")) const main = async () => { const blockNumber = ...
1
vote
0answers
271 views

Problem with web3.eth.personal.ecRecover

I'm using web3 v1.0 beta33 ethereum packages to do some signing and address recovery in a javascript/Angular5 app. I picked this version because I didn't see this function in 0.2x web3 versions' ...
1
vote
1answer
3k views

Getting Metamask account's balance using fromWei

Using web3 javascript code to get selected account's balance in Metamask and show it in html, web3.eth.getCoinbase(function(err, account) { if (err === null) { App.account = account; $("#...
3
votes
2answers
4k views

How can I use web3.js with Angular 2

I'm trying to import Web3 to my component files which is written in Typescript but I couldn't make it. I used npm install --save web3-typescript-typings and added "include": [ "../node_modules/...