You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using angular4 to setup web3 (version 1.0.0-beta.26)
Property 'sendRawTransaction' does not exist on type 'Eth'.
import {Injectable} from '@angular/core';
import Web3 from 'web3';
import {default as contract} from 'truffle-contract';
import {Subject} from 'rxjs/Rx';
import {Tx} from 'ethereumjs-tx';
@Injectable()
export class Web3Service {
private web3: Web3;
public bootstrapWeb3() {
if (typeof window.web3 !== 'undefined') {
this.web3 = new Web3(window.web3.currentProvider);
} else {
Web3.providers.HttpProvider.prototype.sendAsync = Web3.providers.HttpProvider.prototype.send;
this.web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
}
getTransaction(txHash){
this.web3.eth.getTransaction(txHash, function(err, tx) {
if(err || !tx) {
console.error("TxWeb3 error :" + err)
} else {
var ttx = tx;
console.log('getTransaction2',tx);
//ttx.value = etherUnits.toEther( new BigNumber(tx.value), "wei");
}
});
}
sendRaw(rawTx,key) {
var privateKey = new Buffer(key, 'hex');
var transaction = new Tx(rawTx);
transaction.sign(privateKey);
var serializedTx = transaction.serialize().toString('hex');
this.web3.eth.sendRawTransaction('0x' + serializedTx, function(err, result) {
if(err) {
console.log(err);
} else {
console.log(result);
}
});
}
}
In compiling the project, I got an error,
Property 'sendRawTransaction' does not exist on type 'Eth'
I can't understand why sendRawTransation fails but getTransaction works.
update
I found more function doesn't exist, like
Property 'gasPrice' does not exist on type 'Eth'
Property 'fromWei' does not exist on type 'Web3'.
Property 'toHex' does not exist on type 'Web3'
Property 'isConnected' does not exist on type 'Web3'.
```any ideas
The text was updated successfully, but these errors were encountered:
I am using angular4 to setup web3 (version 1.0.0-beta.26)
Property 'sendRawTransaction' does not exist on type 'Eth'.
In compiling the project, I got an error,
Property 'sendRawTransaction' does not exist on type 'Eth'
I can't understand why sendRawTransation fails but getTransaction works.
update
I found more function doesn't exist, like
The text was updated successfully, but these errors were encountered: