Sorry if question is duplicate . I tried to find answers in google but I don't know \how to search really . Here is my problem . Basic Smart contract gives you some sort of API to communicate with blockchain , when using in it's method
var MyContract = web3.eth.contract(abiArray);
var contractInstance = MyContract.new([contructorParam1] [, contructorParam2], {data: '0x12345...', from: myAccount, gas: 1000000});
After you can do smth like
contractInstance.methodWhichIsDescribedInContract(foo,bar)
So basically all erc20 standart contract must implements methods for sending and receiving tokens so far . But if contract already has the interface why people use raw transactions ?
1) Is it possible to interact with blockchain without contract ?
2) Is it the case for using raw transaction ?
3) If we have smart contract does it mean we don't need raw transactions?
Thanks
Edit 1 Example of raw transaction
var tx = new ethereumjs.Tx({
nonce: nonce,
gasPrice: web3.toHex(web3.toWei('20', 'gwei')),
gasLimit: 100000,
to: address,
value: 0,
data: data,
});
tx.sign(ethereumjs.Buffer.Buffer.from(privateKey, 'hex'));
var raw = '0x' + tx.serialize().toString('hex');
web3.eth.sendRawTransaction(raw, function (err, transactionHash) {
console.log(transactionHash);
});