Documentation ¶
Index ¶
- func MetaTxnStatusFromString(s string) sequence.MetaTxnStatus
- func NewRelayer(relayerURL string, projectAccessKey string, options ...Options) proto.RelayerClient
- type LocalRelayer
- func (r *LocalRelayer) Client() proto.Relayer
- func (r *LocalRelayer) EstimateGasLimits(ctx context.Context, walletConfig core.WalletConfig, ...) (sequence.Transactions, error)
- func (r *LocalRelayer) FeeOptions(ctx context.Context, signedTxs *sequence.SignedTransactions) ([]*sequence.RelayerFeeOption, *sequence.RelayerFeeQuote, error)
- func (r *LocalRelayer) GetNonce(ctx context.Context, walletConfig core.WalletConfig, ...) (*big.Int, error)
- func (r *LocalRelayer) GetProvider() *ethrpc.Provider
- func (r *LocalRelayer) IsDeployTransaction(signedTxs *sequence.SignedTransactions) bool
- func (r *LocalRelayer) Relay(ctx context.Context, signedTxs *sequence.SignedTransactions, ...) (sequence.MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
- func (r *LocalRelayer) Simulate(ctx context.Context, txs *sequence.SignedTransactions) ([]*sequence.RelayerSimulateResult, error)
- func (r *LocalRelayer) Wait(ctx context.Context, metaTxnID sequence.MetaTxnID, optTimeout ...time.Duration) (sequence.MetaTxnStatus, *types.Receipt, error)
- type Options
- type RpcRelayer
- func (r *RpcRelayer) Client() proto.Relayer
- func (r *RpcRelayer) EstimateGasLimits(ctx context.Context, walletConfig core.WalletConfig, ...) (sequence.Transactions, error)
- func (r *RpcRelayer) FeeOptions(ctx context.Context, signedTxs *sequence.SignedTransactions) ([]*sequence.RelayerFeeOption, *sequence.RelayerFeeQuote, error)
- func (r *RpcRelayer) GetNonce(ctx context.Context, walletConfig core.WalletConfig, ...) (*big.Int, error)
- func (r *RpcRelayer) GetProvider() *ethrpc.Provider
- func (r *RpcRelayer) IsDeployTransaction(signedTxs *sequence.SignedTransactions) bool
- func (r *RpcRelayer) Relay(ctx context.Context, signedTxs *sequence.SignedTransactions, ...) (sequence.MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
- func (r *RpcRelayer) Simulate(ctx context.Context, txs *sequence.SignedTransactions) ([]*sequence.RelayerSimulateResult, error)
- func (r *RpcRelayer) Wait(ctx context.Context, metaTxnID sequence.MetaTxnID, optTimeout ...time.Duration) (sequence.MetaTxnStatus, *types.Receipt, error)
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 ¶
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) 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)
type Options ¶ added in v0.25.1
type Options struct { HTTPClient proto.HTTPClient JWTAuthToken string }
type RpcRelayer ¶
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.