rpc

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeClientInterface

type BridgeClientInterface interface {
	L1InfoTreeIndexForBridge(networkID uint32, depositCount uint32) (uint32, error)
	InjectedInfoAfterIndex(networkID uint32, l1InfoTreeIndex uint32) (*l1infotreesync.L1InfoTreeLeaf, error)
	ClaimProof(networkID uint32, depositCount uint32, l1InfoTreeIndex uint32) (*types.ClaimProof, error)
	SponsorClaim(claim claimsponsor.Claim) error
	GetSponsoredClaimStatus(globalIndex *big.Int) (claimsponsor.ClaimStatus, error)
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps all the available endpoints of the data abailability committee node server

func NewClient

func NewClient(url string) *Client

NewClient returns a client ready to be used

func (*Client) ClaimProof

func (c *Client) ClaimProof(networkID uint32, depositCount uint32, l1InfoTreeIndex uint32) (*types.ClaimProof, error)

ClaimProof returns the proofs needed to claim a bridge. NetworkID and depositCount refere to the bridge origin while globalExitRoot should be already injected on the destination network. This call needs to be done to a client of the same network were the bridge tx was sent

func (*Client) GetSponsoredClaimStatus

func (c *Client) GetSponsoredClaimStatus(globalIndex *big.Int) (claimsponsor.ClaimStatus, error)

GetSponsoredClaimStatus returns the status of a claim that has been previously requested to be sponsored. This call needs to be done to the same client were it was requested to be sponsored

func (*Client) InjectedInfoAfterIndex

func (c *Client) InjectedInfoAfterIndex(
	networkID uint32, l1InfoTreeIndex uint32,
) (*l1infotreesync.L1InfoTreeLeaf, error)

InjectedInfoAfterIndex return the first GER injected onto the network that is linked to the given index or greater. This call is useful to understand when a bridge is ready to be claimed on its destination network

func (*Client) L1InfoTreeIndexForBridge

func (c *Client) L1InfoTreeIndexForBridge(networkID uint32, depositCount uint32) (uint32, error)

L1InfoTreeIndexForBridge returns the first L1 Info Tree index in which the bridge was included. networkID represents the origin network. This call needs to be done to a client of the same network were the bridge tx was sent

func (*Client) SponsorClaim

func (c *Client) SponsorClaim(claim claimsponsor.Claim) error

SponsorClaim sends a claim tx on behalf of the user. This call needs to be done to a client of the same network were the claim is going to be sent (bridge destination)

type ClientFactory

type ClientFactory struct{}

ClientFactory is the implementation of the data committee client factory

func (*ClientFactory) NewClient

func (f *ClientFactory) NewClient(url string) ClientInterface

NewClient returns an implementation of the data committee node client

type ClientFactoryInterface

type ClientFactoryInterface interface {
	NewClient(url string) ClientInterface
}

ClientFactoryInterface interface for the client factory

type ClientInterface

type ClientInterface interface {
	BridgeClientInterface
}

ClientInterface is the interface that defines the implementation of all the endpoints

Jump to

Keyboard shortcuts

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