utils

package
v0.0.0-...-db344e9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchSendRawTransactions

func BatchSendRawTransactions(batches [][]*types.Transaction, url string) ([]string, error)

func DeriveAddress

func DeriveAddress(wallet *hdwallet.Wallet, index int) (common.Address, error)

Helper functions

func DeriveAddressFromMnemonic

func DeriveAddressFromMnemonic(mnemonic string, index int) (*common.Address, error)

func DerivePrivateKey

func DerivePrivateKey(wallet *hdwallet.Wallet, index int) (*accounts.Account, *ecdsa.PrivateKey, error)

func DerivePrivateKeyFromMnemonic

func DerivePrivateKeyFromMnemonic(mnemonic string, index int) (*accounts.Account, *ecdsa.PrivateKey, error)

func DisableTextColors

func DisableTextColors()

func FormatEther

func FormatEther(wei *big.Int) string

FormatEther converts wei value into a decimal string using 18 decimal places.

func FormatUnits

func FormatUnits(value *big.Int, decimals int) string

FormatUnits converts a value into a decimal string, assuming the specified number of decimal places.

func FormatUnitsString

func FormatUnitsString(value string, decimals int) (string, error)

FormatUnitsString is a helper function that accepts a string input

func GenerateBatches

func GenerateBatches[ItemType any](items []ItemType, batchSize int) [][]ItemType

func GetNodesPlotColors

func GetNodesPlotColors(nodes map[string]tooltypes.Node) map[string]string

func GetRNG

func GetRNG(randomSeed *tooltypes.RandomSeed) (*rand.Rand, error)

func GetSenderAccounts

func GetSenderAccounts(ethclient *ethclient.Client, mnemonic string, accountIndexes []int, numTxs int) ([]*tooltypes.SenderAccount, error)

func NewFloat64

func NewFloat64(x float64) *float64

func NewInt

func NewInt(x int) *int

func NewJsonrpcMessage

func NewJsonrpcMessage(method string, parameters []interface{}) *types.JsonrpcMessage

func ParseNode

func ParseNode(node string, requestMetadata bool) (tooltypes.Node, error)

ParseNode parses a single node according to input specification

func ParseNodes

func ParseNodes(nodes []string, verbose bool, requestMetadata bool) (map[string]tooltypes.Node, error)

ParseNodes parses the given nodes according to input specification

func PrintBullet

func PrintBullet(text string)

func PrintHeader

func PrintHeader(text string)

func PrintMetricTables

func PrintMetricTables(
	results map[string]interface{},
	metrics []string,
	suffix string,
	decimals *int,
	comparison *bool,
	indent *int,
)

func PrintMultilineTable

func PrintMultilineTable(rows [][]string, headers []string)

func PrintNodesTable

func PrintNodesTable(nodes map[string]tooltypes.Node)

PrintNodesTable prints a table of nodes

func PrintTable

func PrintTable(rows [][]string, headers []string)

func PrintTextBox

func PrintTextBox(text string)

func PrintTimestamped

func PrintTimestamped(message string)

func SignTransactions

func SignTransactions(ethclient *ethclient.Client, accounts []*tooltypes.SenderAccount, transactions []*types.Transaction) ([]*types.Transaction, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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