Documentation
¶
Index ¶
- Variables
- func EnsureHashMined(ctx context.Context, log *logan.Entry, getter ByHasher, hash common.Hash)
- func FromGwei(amount *big.Int) *big.Int
- func SignTXWithPrivate(key *ecdsa.PrivateKey, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
- func ToGwei(amount *big.Int) *big.Int
- type ByHasher
- type ETHDeriver
- type Keypair
- type Wallet
- func (wallet *Wallet) Addresses(ctx context.Context) (result []common.Address)
- func (wallet *Wallet) HasAddress(address common.Address) bool
- func (wallet *Wallet) Import(raw []byte) (common.Address, error)
- func (wallet *Wallet) ImportHEX(data string) (common.Address, error)
- func (wallet *Wallet) SignTX(address common.Address, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoKey = errors.New("wallet doesn't have requested key")
)
View Source
var KeypairHook = figure.Hooks{ "eth.Keypair": func(raw interface{}) (reflect.Value, error) { switch value := raw.(type) { case string: kp, err := NewKeypair(value) if err != nil { return reflect.Value{}, errors.Wrap(err, "failed to init keypair") } return reflect.ValueOf(*kp), nil default: return reflect.Value{}, fmt.Errorf("cant init keypair from type: %T", value) } }, }
Functions ¶
func EnsureHashMined ¶
func SignTXWithPrivate ¶
func SignTXWithPrivate(key *ecdsa.PrivateKey, tx *types.Transaction, chainID *big.Int, ) (*types.Transaction, error)
Types ¶
type ETHDeriver ¶
type ETHDeriver struct {
// contains filtered or unexported fields
}
func NewETHDeriver ¶
func NewETHDeriver(src string) (*ETHDeriver, error)
func (*ETHDeriver) ChildAddress ¶
func (s *ETHDeriver) ChildAddress(i uint64) (string, error)
func (*ETHDeriver) ChildPrivate ¶
func (s *ETHDeriver) ChildPrivate(i uint32) (string, error)
type Keypair ¶
type Keypair struct {
// contains filtered or unexported fields
}
Keypair helper struct to simplify Wallet usage where only one signer is needed
func NewKeypair ¶
func (*Keypair) SignTX ¶
func (kp *Keypair) SignTX(tx *types.Transaction, chainID *big.Int, ) (*types.Transaction, error)
Click to show internal directories.
Click to hide internal directories.