Questions tagged [web3js-v0.x]

For questions specifically about version 0.x of the web3js Javascript API and library for Ethereum

Filter by
Sorted by
Tagged with
1
vote
2answers
149 views

Why web3.version.api shows undefined for web3 1.0 and not undefined for web3 0.20.3?

I'm trying to use MetaMask and web3js to talk to my smart contract. Below are my test codes. This is without defining a web3 js file and I get the result "0.20.3" at console. <script> window....
1
vote
1answer
846 views

How to wait until transaction is confirmed web3 0.20.3?

I am new to web3. I am trying to connect UI with web3. Metamask version is 6.0.1 and web3 version injected by (don't know who), but it is 0.20.3. Following is my code to send ethers to a function of ...
1
vote
1answer
62 views

How to register an account in web3.js v0.x

I want to create a new account using web3.js < v1.0 In web3.js 1.0.x we have this method: web3.eth.accounts.create(); or at least this method: web3.eth.accounts.privateKeyToAccount(myPrivateKey)...
1
vote
1answer
422 views

web3.js Contract return null instead of string

Here is contract: pragma solidity ^0.4.17; contract Demo{ string public data; function Demo()public{ data = "Jiu Wei"; } function getData() public view returns (string) { return ...
1
vote
1answer
52 views

Infura event listening [duplicate]

I am using Infura, Ropsten Test network, Web3@0.20 in the back-end of my Express website. I want to listen events in my ERC20 contract. I tried a lot of methods, but still failed. How do I revise it? ...
0
votes
2answers
400 views

Solc error invalid opcode, but works in truffle

I am trying to compile solidity code in solc(nodejs) but unsuccessful so far. I have created a sample app for demo. Here is sample's directory structure (node.js and truffle combined): │ app.js │ ...
0
votes
1answer
232 views

How to get private key with web3 v0.2.x?

web3 version 1.x has the decrypt method, which decrypts a keystore v3 JSON. By using it the following way, I can get the private key easily: web3.eth.accounts.decrypt(keystoreJsonV3, password); But ...
0
votes
0answers
33 views

getAccounts undefined recently

I've been using web3 v 0.20 and I recently noticed that getting accounts from web3.eth.getAccounts(function(error, accounts) { returns undefined. Is Metamask 7.2.1 forcing it to be undefined for ...
0
votes
0answers
16 views

Use web3 0.2.x within Truffle V5

It's a pain to have to refactor tests written for TruffleV4 in web3 0.2.x to web3 1.0.x. Is there any way to avoid this situation by using web3 0.2.x instead within Truffle V5?
0
votes
1answer
36 views

get Transfer events from 0x0 address for ERC20 token

I am trying to get all the events that originate from zero (0x0) address in order to capture the mint activity for my ERC20 token. Here is my code snippet: var instance = web3.eth.contract(abi).at(...
0
votes
0answers
35 views

Contract's Mapping variable state change fails when called from web3 js javascript program

I am running into a strange issue with following contract- pragma solidity ^0.4.25; contract ApprovedPOCreateAndOwnershipTransferContract { struct PO{ bytes32 bill_to_location; ...
0
votes
0answers
30 views

Sending raw transaction to the contract 0.20.7 [duplicate]

Is it possible to send a raw, state-changing transaction to the contract using web3js version 0.20.7 or lower?
0
votes
1answer
536 views

Calling a “view” function using web3js

--- HEAVILY EDITED --- Solidity contract: pragma solidity ^0.4.24; contract PatientRecords { struct Patient { string ID; string weight; string height; string diseasehistory; ...