gasless

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MPL-2.0 Imports: 10 Imported by: 4

README

Gasless

Ethereum meta transaction library.

Contributing

Found a bug or have an idea for a feature? Create an issue.

Maintainers

@awantoch

@jiyuu-jin

@nasdf

License

Valist is licensed under the Mozilla Public License Version 2.0.

Documentation

Index

Constants

View Source
const EIP712Domain = "EIP712Domain"

Variables

This section is empty.

Functions

func SendTransaction

func SendTransaction(ctx context.Context, meta MetaTransactor, message EIP712Message, signer Signer) (*types.Transaction, error)

SendTransaction signs the given message and submits it to the given Meta provider.

Types

type EIP712Message

type EIP712Message interface {
	// TypedData returns the typed data formatted message.
	TypedData() core.TypedDataMessage
}

EIP712Message contains meta transaction data.

type MetaTransactor

type MetaTransactor interface {
	// Types returns the typed data types.
	Types() core.Types
	// PrimaryType returns the typed data primary type.
	PrimaryType() string
	// Domain returns the typed data domain.
	Domain() core.TypedDataDomain
	// Nonce returns the latest nonce for the given address.
	Nonce(context.Context, common.Address) (*big.Int, error)
	// SendTransaction submits the meta transaction with the given signature.
	SendTransaction(context.Context, EIP712Message, []byte, []byte) (*types.Transaction, error)
}

MetaTransactor is a meta transaction sender.

type Signer

type Signer func(core.TypedData) ([]byte, error)

Signer is a function that returns a signature for the given typed data.

func NewPrivateKeySigner

func NewPrivateKeySigner(private *ecdsa.PrivateKey) Signer

NewPrivateKeySigner returns a signer that uses an ECDSA private key.

func NewWalletSigner

func NewWalletSigner(account accounts.Account, wallet accounts.Wallet) Signer

NewWalletSigner returns a signer that uses an Ethereum wallet provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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