relayer

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetaTxnStatusFromString added in v0.29.0

func MetaTxnStatusFromString(s string) sequence.MetaTxnStatus

func NewRelayer added in v0.29.0

func NewRelayer(relayerURL string, projectAccessKey string, options ...Options) proto.RelayerClient

NewRpcRelayer creates a new Sequence Relayer client instance. See https://docs.sequence.xyz for a list of relayer urls, and please see https://sequence.build to get a `projectAccessKey`.

Types

type LocalRelayer

type LocalRelayer struct {
	Sender *ethwallet.Wallet
	// contains filtered or unexported fields
}

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, receiptListener *ethreceipts.ReceiptsListener) (*LocalRelayer, error)

func (*LocalRelayer) Client added in v0.29.0

func (r *LocalRelayer) Client() proto.Relayer

func (*LocalRelayer) EstimateGasLimits

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

func (*LocalRelayer) FeeOptions added in v0.29.1

func (r *LocalRelayer) FeeOptions(ctx context.Context, signedTxs *sequence.SignedTransactions) ([]*sequence.RelayerFeeOption, *sequence.RelayerFeeQuote, error)

func (*LocalRelayer) GetNonce

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

func (*LocalRelayer) GetProvider

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

func (*LocalRelayer) IsDeployTransaction added in v0.29.0

func (r *LocalRelayer) IsDeployTransaction(signedTxs *sequence.SignedTransactions) bool

func (*LocalRelayer) Relay

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

func (*LocalRelayer) Simulate added in v0.13.0

func (r *LocalRelayer) Simulate(ctx context.Context, txs *sequence.SignedTransactions) ([]*sequence.RelayerSimulateResult, error)

func (*LocalRelayer) Wait

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

type Options added in v0.25.1

type Options struct {
	HTTPClient   proto.HTTPClient
	JWTAuthToken string
}

type RpcRelayer

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

func NewRpcRelayer added in v0.2.1

func NewRpcRelayer(relayerURL string, projectAccessKey string, provider *ethrpc.Provider, receiptListener *ethreceipts.ReceiptsListener, options ...Options) (*RpcRelayer, error)

NewRpcRelayer creates a new Sequence Relayer client instance. See https://docs.sequence.xyz for a list of relayer urls, and please see https://sequence.build to get a `projectAccessKey`.

func (*RpcRelayer) Client added in v0.29.0

func (r *RpcRelayer) Client() proto.Relayer

func (*RpcRelayer) EstimateGasLimits

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

func (*RpcRelayer) FeeOptions added in v0.29.1

func (r *RpcRelayer) FeeOptions(ctx context.Context, signedTxs *sequence.SignedTransactions) ([]*sequence.RelayerFeeOption, *sequence.RelayerFeeQuote, error)

func (*RpcRelayer) GetNonce

func (r *RpcRelayer) GetNonce(ctx context.Context, walletConfig core.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) IsDeployTransaction added in v0.29.0

func (r *RpcRelayer) IsDeployTransaction(signedTxs *sequence.SignedTransactions) bool

func (*RpcRelayer) Relay

func (r *RpcRelayer) Relay(ctx context.Context, signedTxs *sequence.SignedTransactions, quote ...*sequence.RelayerFeeQuote) (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) Simulate added in v0.13.0

func (r *RpcRelayer) Simulate(ctx context.Context, txs *sequence.SignedTransactions) ([]*sequence.RelayerSimulateResult, error)

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.1 e4df7ceb0987a6b6fd6a61d65e57a0a072b101aa -- Code generated by webrpc-gen@v0.18.7 with golang generator.
sequence-relayer v0.4.1 e4df7ceb0987a6b6fd6a61d65e57a0a072b101aa -- Code generated by webrpc-gen@v0.18.7 with golang generator.

Jump to

Keyboard shortcuts

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