Skip to content

Instantly share code, notes, and snippets.

@MariusVanDerWijden
Created July 8, 2020 09:13
Show Gist options
  • Save MariusVanDerWijden/180ac7229b3e533a9da03ae11be8f376 to your computer and use it in GitHub Desktop.
Save MariusVanDerWijden/180ac7229b3e533a9da03ae11be8f376 to your computer and use it in GitHub Desktop.
// Retrieve the pending nonce for an account
nonce, err := cl.NonceAt(ctx, addr, nil)
to := common.HexToAddress("0xABCD")
amount := big.NewInt(10 * params.GWei)
gasLimit := uint64(21000)
gasPrice := big.NewInt(10 * params.GWei)
data := []byte{}
// Create a raw unsigned transaction
tx := types.NewTransaction(nonce, to, amount, gasLimit, gasPrice, data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment