client

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Status string `json:"status"`
	Data   []struct {
		ExecBlockNumber int `json:"exec_block_number"`
	} `json:"data"`
}

Struct to unmarshal the JSON data

type Client

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

func StartNewClient

func StartNewClient(ctx context.Context, logger log.Logger, tokenDepositsCache *tokenbridgetypes.DepositReports) *Client

func (*Client) CheckForFinality

func (c *Client) CheckForFinality(blockHeight *big.Int) (bool, error)

func (*Client) EncodeQueryData

func (c *Client) EncodeQueryData(depositReceipt DepositReceipt) ([]byte, error)

func (*Client) EncodeReportValue

func (c *Client) EncodeReportValue(depositReceipt DepositReceipt) ([]byte, error)

replicate solidity encoding, abi.encode(address ethSender, string layerRecipient, uint256 amount)

func (*Client) InitializeDeposits

func (c *Client) InitializeDeposits() error

func (*Client) QueryAPI

func (c *Client) QueryAPI(urlStr string) ([]byte, error)

func (*Client) QueryCurrentDepositId

func (c *Client) QueryCurrentDepositId() (*big.Int, error)

func (*Client) QueryDepositDetails

func (c *Client) QueryDepositDetails(depositId *big.Int) (DepositReceipt, error)

func (*Client) QueryTokenBridgeContract

func (c *Client) QueryTokenBridgeContract() error

type DepositReceipt

type DepositReceipt struct {
	DepositId   *big.Int
	Sender      common.Address
	Recipient   string
	Amount      *big.Int
	Tip         *big.Int
	BlockHeight *big.Int
}

type DepositReport

type DepositReport struct {
	QueryData []byte
	Value     string
}

Jump to

Keyboard shortcuts

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