lighter

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIGHTER_URL = "https://mainnet.zklighter.elliot.ai/api"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LighterAPI

type LighterAPI struct {
	HTTPClient *http.Client
}

func NewLighterAPI

func NewLighterAPI() *LighterAPI

func (*LighterAPI) GetTx

func (a *LighterAPI) GetTx(hash string) (*LighterTx, error)

GetTx fetches transaction from the lighter API

type LighterTx

type LighterTx struct {
	Code      uint64 `json:"code"`
	Hash      string `json:"hash"`
	Type      TxType `json:"type"`
	Info      string `json:"info"`
	L1Address string `json:"l1_address"`
	Transfer  *Transfer
}

func (*LighterTx) UnmarshalJSON

func (tx *LighterTx) UnmarshalJSON(data []byte) error

type Transfer

type Transfer struct {
	USDCAmount       uint64
	FromAccountIndex uint64
	ToAccountIndex   int
	Fee              uint64
}

type TxType

type TxType uint64
const (
	TxTypeL2Transfer TxType = 12
	TxTypeL2Withdraw TxType = 13
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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