Transaction
To create and send transactions, we need some on-chain info, encode the data correctly and broadcast the transaction to the network.
Send Transaction
The SendTx
function is the basic function to broadcast Ethereum transactions
txHash, err := t.SendTx(from, to, value, gasLimit, data, privateKey)
Send Transaction To Contract
The SendTxToContract
function takes care of building the correct transaction and broadcasting it.
txHash, err := t.SendTxToContract(contractName, address, privateKey, value, message, args)
Interact with Smart Contracts
This helper function makes it easy to send a transaction to a smart contract, it automatically instantie your wallet based on the TxBuilder
mnemonic and the account ID.
txHash, err := t.InteractWithContract(contractName, accountID, value, message, args)
Deploy a Contract
This helper function makes it easy to send a transaction to deploy a smart contract.
txHash, err := t.DeployContract(accountID, bytecode, gasLimit)