Transaction Builder
To create a transaction first you need to create a TxBuilder object.
Constructor
Using the NewTxBuilder
you can instantiate the TxBuilder.
builder := NexTxBuilder(
contracts: map[string]Contract{"erc20": NewContract{address, abi}},
mnemonic: mnemonic,
customGasLimit: map[string]uint64{},
defaultGasLimit: uint64(200_000),
requester: requester.NewClient().WithUnsecureWeb3Endpoint("https://proxy.evmos.org/web3"),
)
After having the builder instantiated, you can send transactions
Simple Constructor
If you just need the SendTx
method, instead of creating a TxBuilder
with the contracts information, you can use the NewSimpleTxBuilder
function.
builder := txbuilder.NewSimpleTxBuilder(mnemonic, web3Endpoint)