eth

package
v0.0.0-...-7d1b45a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERC20_ABI abi.ABI
View Source
var ERC20_ABI_JSON []byte
View Source
var MULTICALL2_ABI abi.ABI
View Source
var MULTICALL2_ABI_JSON []byte

Functions

func BalanceOf

func BalanceOf(b *cmn.Blockchain, t *cmn.Token, address common.Address) (*big.Int, error)

func BuildHailToSendTemplate

func BuildHailToSendTemplate(b *cmn.Blockchain, t *cmn.Token,
	from *cmn.Address, to common.Address, amount *big.Int, suggested_gas_price *big.Int, confirmed bool) (string, error)

func BuildHailToSendTxTemplate

func BuildHailToSendTxTemplate(b *cmn.Blockchain, from *cmn.Address, to common.Address,
	amount *big.Int, data []byte, suggested_gas_price *big.Int, confirmed bool) (string, error)

func BuildTx

func BuildTx(b *cmn.Blockchain, s *cmn.Signer, from *cmn.Address, to common.Address,
	amount *big.Int, data []byte) (*types.Transaction, error)

func BuildTxERC20Transfer

func BuildTxERC20Transfer(b *cmn.Blockchain, t *cmn.Token, s *cmn.Signer, from *cmn.Address,
	to common.Address, amount *big.Int) (*types.Transaction, error)

func BuildTxTransfer

func BuildTxTransfer(b *cmn.Blockchain, s *cmn.Signer, from *cmn.Address, to common.Address, amount *big.Int) (*types.Transaction, error)

func ERC20Transfer

func ERC20Transfer(msg *bus.Message, b *cmn.Blockchain, t *cmn.Token, s *cmn.Signer, from *cmn.Address, to common.Address, amount *big.Int) error

func GetBalance

func GetBalance(b *cmn.Blockchain, address common.Address) (*big.Int, error)

func GetCurrentRateLimit

func GetCurrentRateLimit(chainId int) int

GetCurrentRateLimit returns the current rate limit for a chain (for display purposes)

func GetERC20Balance

func GetERC20Balance(b *cmn.Blockchain, t *cmn.Token, address common.Address) (*big.Int, error)

func GetERC20BalancesBatch

func GetERC20BalancesBatch(b *cmn.Blockchain, queries []*BalanceQuery) error

GetERC20BalancesBatch fetches multiple ERC20 balances in a single multicall All tokens must be on the same chain

func GetERC20TokenInfo

func GetERC20TokenInfo(b *cmn.Blockchain, address common.Address) (string, string, int, error)

func GetNativeBalancesBatch

func GetNativeBalancesBatch(b *cmn.Blockchain, queries []*NativeBalanceQuery) error

GetNativeBalancesBatch fetches multiple native balances in a single multicall Uses multicall's getEthBalance function

func Init

func Init()

func LoadABIs

func LoadABIs()

func Loop

func Loop()

func ReportRateLimitError

func ReportRateLimitError(chainId int)

ReportRateLimitError should be called when a 429 error is detected

func ReportSuccess

func ReportSuccess(chainId int)

ReportSuccess should be called after a successful RPC call

func SendSignedTx

func SendSignedTx(signedTx *types.Transaction) (string, error)

func Transfer

func Transfer(msg *bus.Message, b *cmn.Blockchain, s *cmn.Signer, from *cmn.Address, to common.Address, amount *big.Int) error

func UpdateRateLimiterSettings

func UpdateRateLimiterSettings(chainId int)

UpdateRateLimiterSettings updates an existing rate limiter with new settings from blockchain config This preserves timing state (lastCallTime, backoffUntil) to avoid race conditions

Types

type BalanceQuery

type BalanceQuery struct {
	Token   *cmn.Token
	Holder  common.Address
	Balance *big.Int // Result will be stored here
}

BalanceQuery represents a single balance query (token + holder address)

type NativeBalanceQuery

type NativeBalanceQuery struct {
	Holder  common.Address
	Balance *big.Int // Result will be stored here
}

NativeBalanceQuery represents a single native balance query

Jump to

Keyboard shortcuts

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