Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexEncodeBig ¶ added in v0.0.4
HexEncodeBig encodes bigint as a hex string with 0x prefix. The sign of the integer is ignored.
func IsHexValid ¶ added in v0.0.4
IsHexValid checks if the provided string is a valid hexadecimal value
Types ¶
type ArgBig ¶ added in v0.0.4
ArgBig helps to marshal big number values provided in the RPC requests
func (ArgBig) MarshalText ¶ added in v0.0.4
MarshalText marshals an array of bytes into an instance of ArgBig
func (*ArgBig) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals an instance of ArgBig into an array of bytes
type ArgBytes ¶ added in v0.0.4
type ArgBytes []byte
ArgBytes helps to marshal byte array values provided in the RPC requests
func ArgBytesPtr ¶ added in v0.0.4
ArgBytesPtr helps to marshal byte array values provided in the RPC requests
func (ArgBytes) MarshalText ¶ added in v0.0.4
MarshalText marshals into text
func (*ArgBytes) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals from text
type ArgHash ¶ added in v0.0.4
ArgHash represents a common.Hash that accepts strings shorter than 64 bytes, like 0x00
func (*ArgHash) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals from text
type ArgUint64 ¶ added in v0.0.4
type ArgUint64 uint64
ArgUint64 helps to marshal uint64 values provided in the RPC requests
func (ArgUint64) MarshalText ¶ added in v0.0.4
MarshalText marshals into text
func (*ArgUint64) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals from text
type EthClient ¶ added in v0.0.4
type EthClient interface { BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) }
EthClient defines functions that an ethereum rpc client should implement
type EthClientFactory ¶ added in v0.0.4
type EthClientFactory interface {
CreateEthClient(ctx context.Context, url string) (EthClient, error)
}
EthClientFactory defines functions for a EthClient factory
func NewEthClientFactory ¶ added in v0.0.4
func NewEthClientFactory() EthClientFactory
NewEthClientFactory is the constructor of ethClientFactory
type OffChainData ¶
OffChainData represents some data that is not stored on chain and should be preserved
type Sequence ¶
type Sequence []ArgBytes
Sequence represents the data that the sequencer will send to L1 and other metadata needed to build the accumulated input hash aka accInputHash
func (*Sequence) HashToSign ¶
HashToSign returns the accumulated input hash of the sequence. Note that this is equivalent to what happens on the smart contract
func (*Sequence) OffChainData ¶
func (s *Sequence) OffChainData() []OffChainData
OffChainData returns the data that needs to be stored off chain from a given sequence
func (*Sequence) Sign ¶
func (s *Sequence) Sign(privateKey *ecdsa.PrivateKey) (*SignedSequence, error)
Sign returns a signed sequence by the private key. Note that what's being signed is the accumulated input hash
type SignedSequence ¶
type SignedSequence struct { Sequence Sequence `json:"sequence"` Signature ArgBytes `json:"signature"` }
SignedSequence is a sequence but signed