relayer

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalRelayer

type LocalRelayer struct {
	Sender *ethwallet.Wallet
}

LocalRelayer is a simple implementation of a relayer which will dispatch meta transactions locally. This should only be used for testing / debugging, and never seriously in a real app.

func NewLocalRelayer

func NewLocalRelayer(sender *ethwallet.Wallet) (*LocalRelayer, error)

func (*LocalRelayer) EstimateGasLimits

func (r *LocalRelayer) EstimateGasLimits(ctx context.Context, walletConfig sequence.WalletConfig, walletContext sequence.WalletContext, txns sequence.Transactions) (sequence.Transactions, error)

func (*LocalRelayer) GetNonce

func (r *LocalRelayer) GetNonce(ctx context.Context, walletConfig sequence.WalletConfig, walletContext sequence.WalletContext, space *big.Int, blockNum *big.Int) (*big.Int, error)

func (*LocalRelayer) GetProvider

func (r *LocalRelayer) GetProvider() *ethrpc.Provider

func (*LocalRelayer) Relay

func (r *LocalRelayer) Relay(ctx context.Context, signedTxs *sequence.SignedTransactions) (sequence.MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)

func (*LocalRelayer) Wait

func (r *LocalRelayer) Wait(ctx context.Context, metaTxnID sequence.MetaTxnID, optTimeout ...time.Duration) (sequence.MetaTxnStatus, *types.Receipt, error)

type RpcRelayer

type RpcRelayer struct {
	Service proto.Relayer
	// contains filtered or unexported fields
}

func NewRpcRelayer added in v0.2.1

func NewRpcRelayer(provider *ethrpc.Provider, rpcRelayerURL string, httpClient proto.HTTPClient) (*RpcRelayer, error)

func (*RpcRelayer) EstimateGasLimits

func (r *RpcRelayer) EstimateGasLimits(ctx context.Context, walletConfig sequence.WalletConfig, walletContext sequence.WalletContext, txns sequence.Transactions) (sequence.Transactions, error)

func (*RpcRelayer) GetNonce

func (r *RpcRelayer) GetNonce(ctx context.Context, walletConfig sequence.WalletConfig, walletContext sequence.WalletContext, space *big.Int, blockNum *big.Int) (*big.Int, error)

NOTE: nonce space is 160 bits wide

func (*RpcRelayer) GetProvider

func (r *RpcRelayer) GetProvider() *ethrpc.Provider

func (*RpcRelayer) Relay

func (r *RpcRelayer) Relay(ctx context.Context, signedTxs *sequence.SignedTransactions) (sequence.MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)

Relay will submit the Sequence signed meta transaction to the relayer. The method will block until the relayer responds with the native transaction hash (*types.Transaction), which means the relayer has submitted the transaction request to the network. Clients can use WaitReceipt to wait until the metaTxnID has been mined.

func (*RpcRelayer) Wait

func (r *RpcRelayer) Wait(ctx context.Context, metaTxnID sequence.MetaTxnID, optTimeout ...time.Duration) (sequence.MetaTxnStatus, *types.Receipt, error)

..

Directories

Path Synopsis
sequence-relayer v0.4.0 59a862f763edcaca2fb2e11901b24873c4c02034 -- This file has been generated by https://github.com/webrpc/webrpc using gen/golang Do not edit by hand.
sequence-relayer v0.4.0 59a862f763edcaca2fb2e11901b24873c4c02034 -- This file has been generated by https://github.com/webrpc/webrpc using gen/golang Do not edit by hand.

Jump to

Keyboard shortcuts

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