Documentation
¶
Index ¶
- Constants
- Variables
- func NewRPCClient(ctx context.Context, cfg config.L2RPCClientConfig) (aggkittypes.EthClienter, error)
- func NewRPCClientModeOp(ctx context.Context, cfg config.L2RPCClientConfig) (aggkittypes.EthClienter, error)
- func TryParseError(err error) (error, bool)
- type OpNodeClienter
- type RPCOpNodeDecorator
- type RollupDataQuerier
- type RollupManagerContract
- type RollupManagerFactoryFunc
Constants ¶
const (
ExtraParamFieldName = "OpNodeURL"
)
Variables ¶
var ( // ErrGasRequiredExceedsAllowance gas required exceeds the allowance ErrGasRequiredExceedsAllowance = errors.New("gas required exceeds allowance") // ErrContentLengthTooLarge content length is too large ErrContentLengthTooLarge = errors.New("content length too large") // ErrTimestampMustBeInsideRange Timestamp must be inside range ErrTimestampMustBeInsideRange = errors.New("timestamp must be inside range") // ErrInsufficientAllowance insufficient allowance ErrInsufficientAllowance = errors.New("insufficient allowance") // ErrBothGasPriceAndMaxFeeGasAreSpecified both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified ErrBothGasPriceAndMaxFeeGasAreSpecified = errors.New( "both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified", ) // ErrMaxFeeGasAreSpecifiedButLondonNotActive maxFeePerGas or maxPriorityFeePerGas // specified but london fork is not active yet ErrMaxFeeGasAreSpecifiedButLondonNotActive = errors.New( "maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet", ) // ErrNoSigner no signer to authorize the transaction with ErrNoSigner = errors.New("no signer to authorize the transaction with") // ErrMissingTrieNode means that a node is missing on the trie ErrMissingTrieNode = errors.New("missing trie node") // ErrNotFound is used when the object is not found ErrNotFound = errors.New("not found") // ErrPrivateKeyNotFound used when the provided sender does not have a private key registered to be used ErrPrivateKeyNotFound = errors.New("can't find sender private key to sign tx") )
var ( ErrInvalidRollupID = errors.New("invalid rollup id (0)") ErrInvalidChainID = errors.New("invalid chain id (0)") )
Functions ¶
func NewRPCClient ¶ added in v0.1.0
func NewRPCClient(ctx context.Context, cfg config.L2RPCClientConfig) (aggkittypes.EthClienter, error)
NewRPCClient creates a new RPC client based on the provided configuration. It supports both basic RPC mode and OPNode mode. In basic mode, it simply creates a client with the given URL. In OPNode mode, it creates a client that uses the OPNode client to get the finalized block.
func NewRPCClientModeOp ¶ added in v0.1.0
func NewRPCClientModeOp(ctx context.Context, cfg config.L2RPCClientConfig) (aggkittypes.EthClienter, error)
NewRPCClientModeOp creates a new RPC client that uses the OPNode client to get the finalized block
func TryParseError ¶
Types ¶
type OpNodeClienter ¶ added in v0.1.0
type RPCOpNodeDecorator ¶ added in v0.1.0
type RPCOpNodeDecorator struct {
aggkittypes.EthClienter
OpNodeClient OpNodeClienter
}
RPCOpNodeDecorator is a decorator for the ethclient.Client that intercepts calls to the HeaderByNumber method and if the block number is the FinalizedBlockNumber, it will ask the OpNodeClient for the finalized block instead of asking the ethclient.Client
func NewRPCOpNodeDecorator ¶ added in v0.1.0
func NewRPCOpNodeDecorator(client aggkittypes.EthClienter, opNodeClient OpNodeClienter) *RPCOpNodeDecorator
func (*RPCOpNodeDecorator) HeaderByNumber ¶ added in v0.1.0
type RollupDataQuerier ¶ added in v0.5.0
type RollupDataQuerier struct {
RollupID uint32
// contains filtered or unexported fields
}
RollupDataQuerier is a simple implementation of Etherman.
func NewRollupDataQuerier ¶ added in v0.5.0
func NewRollupDataQuerier( l1Config config.L1NetworkConfig, ethClient aggkittypes.BaseEthereumClienter, rollupManagerFactory RollupManagerFactoryFunc, ) (*RollupDataQuerier, error)
NewRollupDataQuerier creates a new rollup data querier instance
func (*RollupDataQuerier) GetRollupChainID ¶ added in v0.5.0
func (r *RollupDataQuerier) GetRollupChainID() (uint64, error)
GetRollupChainID returns rollup chain id (L2 network)
func (*RollupDataQuerier) GetRollupData ¶ added in v0.5.0
func (r *RollupDataQuerier) GetRollupData(blockNumber *big.Int) ( polygonrollupmanager.PolygonRollupManagerRollupDataReturn, error)
GetRollupData returns rollup data based on the provided rollup id
type RollupManagerContract ¶ added in v0.5.0
type RollupManagerContract interface {
RollupIDToRollupData(opts *bind.CallOpts, rollupID uint32) (
polygonrollupmanager.PolygonRollupManagerRollupDataReturn, error)
RollupAddressToID(opts *bind.CallOpts, rollupAddress common.Address) (uint32, error)
}
RollupManagerContract is an abstraction for RollupManager smart contract
type RollupManagerFactoryFunc ¶ added in v0.5.0
type RollupManagerFactoryFunc func(rollupAddress common.Address, client aggkittypes.BaseEthereumClienter) (RollupManagerContract, error)
mockery:ignore RollupManagerFactoryFunc is a callback function that creates RollupManager contrat instance