signer

package
v0.0.0-...-54fe0b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHDWallet

func NewHDWallet(length int) (string, error)

func VerifyTypedData

func VerifyTypedData(typedData *TypedData, sig []byte) (string, error)

VerifyTypedData verify eip712 sig, and return signer address ...

Types

type Signer

type Signer interface {
	// The signer ether address
	Addresss() string
	// SignTypedData implement eip712 sign ...
	SignTypedData(typedData *TypedData) ([]byte, error)
	// SignTransaction sign ether transaction
	SignTransaction(tx *Transaction) error
}

Signer the ethers signer ....

func OpenHDWallet

func OpenHDWallet(mnemonic string, bip44Path string) (Signer, error)

type Transaction

type Transaction struct {
	AccountNonce uint64    `json:"nonce"    gencodec:"required"`
	Price        *big.Int  `json:"gasPrice" gencodec:"required"`
	GasLimit     *big.Int  `json:"gas"      gencodec:"required"`
	Recipient    *[20]byte `json:"to"       rlp:"nil"` // nil means contract creation
	Amount       *big.Int  `json:"value"    gencodec:"required"`
	Payload      []byte    `json:"input"    gencodec:"required"`
	V            *big.Int  `json:"v" gencodec:"required"`
	R            *big.Int  `json:"r" gencodec:"required"`
	S            *big.Int  `json:"s" gencodec:"required"`
}

Transaction ether transaction object

func (*Transaction) Encode

func (tx *Transaction) Encode() ([]byte, error)

Encode encode tx to raw transaction bytes

func (*Transaction) Hash

func (tx *Transaction) Hash() string

Hash get tx hash string

func (*Transaction) SignHash

func (tx *Transaction) SignHash() []byte

type TypedData

type TypedData eip712.TypedData

TypedData ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL