signer

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const EnvKey = "VALIST_SIGNER"

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer signs transactions.

func NewSigner

func NewSigner(chainID *big.Int, backends ...accounts.Backend) (*Signer, error)

NewSigner returns a signer that uses the given backends to sign transactions. If VALIST_SIGNER env is set, an ephemeral keystore is created and the default account is set.

func (*Signer) Account

func (s *Signer) Account() accounts.Account

Account returns the default signer account.

func (*Signer) List

func (s *Signer) List() []accounts.Account

List returns a list of all signer accounts.

func (*Signer) NewTransactor

func (s *Signer) NewTransactor() *gasless.TransactOpts

NewTransactor returns TransactOpts for meta or regular transactions.

func (*Signer) SetAccount

func (s *Signer) SetAccount(account accounts.Account)

SetAccount sets the default signer account.

func (*Signer) SetAccountWithPassphrase

func (s *Signer) SetAccountWithPassphrase(account accounts.Account, passphrase string)

SetAccountWithPassphrase sets the default signer account and passphrase to unlock the account.

func (*Signer) SignTx

func (s *Signer) SignTx(address common.Address, tx *types.Transaction) (*types.Transaction, error)

SignTx signs the given transaction using the given account's wallet.

func (*Signer) SignTypedData

func (s *Signer) SignTypedData(address common.Address, typedData core.TypedData) ([]byte, error)

SignTypedData signs the given typedData using the given account's wallet.

Jump to

Keyboard shortcuts

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