Categorygithub.com/tak1827/eth-extended-client
repository
0.1.1
Repository: https://github.com/tak1827/eth-extended-client.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

eth-extended-client

The extended Ethereum client

  • support sync send, confirming x blocks mined
  • support async send

Sample

var (
	ctx     = context.Background()
	cfmOpts = []confirm.Opt{
		confirm.WithWorkers(1),
		confirm.WithWorkerInterval(64),
		confirm.WithConfirmationBlock(0),
	}
	c, _   = NewClient(ctx, TestEndpoint, cfmOpts, WithTimeout(10), WithSyncSendConfirmInterval(64))
	to, _  = GenerateAddr()
	amount = ToWei(1.0, 9) // 1gwai
)

c.Start()
defer c.Stop()

hash, err := c.SyncSend(ctx, TestPrivKey, &to, amount, nil, 0)
if err != nil {
	panic(err)
}
fmt.Printf("tx: %s\n", hash)