Documentation
¶
Index ¶
- Variables
- func AlertColor(str string) string
- func BigToFloat(b *big.Int, decimal uint64) float64
- func BigToFloatString(value *big.Int, decimal uint64) string
- func BuildContractCreationTx(txType uint8, nonce uint64, ethAmount *big.Int, gasLimit uint64, ...) (tx *types.Transaction)
- func BuildExactSendETHTx(txType uint8, nonce uint64, to string, ethAmount *big.Int, gasLimit uint64, ...) (tx *types.Transaction)
- func BuildExactTx(txType uint8, nonce uint64, to string, ethAmount *big.Int, gasLimit uint64, ...) (tx *types.Transaction)
- func BuildTx(txType uint8, nonce uint64, to string, ethAmount float64, gasLimit uint64, ...) (tx *types.Transaction)
- func DebugObjPrint(obj interface{})
- func DebugPrintf(format string, a ...any) (n int, err error)
- func EthToWei(n float64) *big.Int
- func FloatStringToBig(value string, decimal uint64) (*big.Int, error)
- func FloatToBigInt(amount float64, decimal uint64) *big.Int
- func FloatToInt(amount float64) int64
- func GetEIP1967BeaconABI() *abi.ABI
- func GetERC20ABI() *abi.ABI
- func GetMultiCallABI() *abi.ABI
- func GetSignerAddressFromTx(tx *types.Transaction, chainID *big.Int) (common.Address, error)
- func GweiToWei(n float64) *big.Int
- func HexToAddress(hex string) common.Address
- func HexToAddresses(hexes []string) []common.Address
- func HexToBig(hex string) *big.Int
- func HexToHash(hex string) common.Hash
- func InfoColor(str string) string
- func NameWithColor(name string) string
- func PackERC20Data(function string, params ...interface{}) ([]byte, error)
- func PrintElapseTime(start time.Time, str string)
- func PrintFunctionCall(fc *FunctionCall)
- func PrintTupleFieldNamesToWriter(writer io.Writer, tuple TupleParamResult, indentLevel int)
- func PrintTxDetails(result *TxResult, network Network, writer io.Writer)
- func PrintTxSuccessSummary(result *TxResult, network Network, writer io.Writer)
- func PrintVerboseArraysToWriter(writer io.Writer, arrays []ParamResult, indentLevel int)
- func PrintVerboseParamResultToWriter(writer io.Writer, param ParamResult, indentLevel int, includeFieldNames bool)
- func PrintVerboseTopicToWriter(writer io.Writer, topic TopicResult)
- func PrintVerboseTupleToWriter(writer io.Writer, tuple TupleParamResult, indentLevel int, ...)
- func PrintVerboseTuplesToWriter(writer io.Writer, tuples []TupleParamResult, indentLevel int)
- func PrintVerboseValueToWriter(writer io.Writer, values []Value)
- func RawTxToHash(data string) string
- func ReadableNumber(value string) string
- func RunParallel(funcs ...func() error) (error, int)
- func StringToBig(input string) *big.Int
- func StringToBigInt(str string) (*big.Int, error)
- func StringToFloat(input string, decimal uint64) float64
- func VerboseAddress(addr Address) string
- func VerboseValues(values []Value) []string
- type ABIDatabase
- type Address
- type FunctionCall
- type InternalTx
- type LogResult
- type ParamResult
- type TopicResult
- type Transaction
- type TupleParamResult
- type TxExtraInfo
- type TxInfo
- type TxResult
- type TxResults
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var Start time.Time
Functions ¶
func AlertColor ¶
func BigToFloat ¶ added in v0.0.25
BigToFloat converts a big int to float according to its number of decimal digits Example: - BigToFloat(1100, 3) = 1.1 - BigToFloat(1100, 2) = 11 - BigToFloat(1100, 5) = 0.11
func BigToFloatString ¶ added in v0.0.25
func BuildContractCreationTx ¶ added in v0.0.25
func BuildExactSendETHTx ¶ added in v0.0.25
func BuildExactTx ¶ added in v0.0.25
func DebugObjPrint ¶ added in v0.0.30
func DebugObjPrint(obj interface{})
func FloatStringToBig ¶ added in v0.0.25
func FloatToBigInt ¶ added in v0.0.25
FloatToBigInt converts a float to a big int with specific decimal Example: - FloatToBigInt(1, 4) = 10000 - FloatToBigInt(1.234, 4) = 12340
func FloatToInt ¶ added in v0.0.25
func GetEIP1967BeaconABI ¶ added in v0.0.30
func GetERC20ABI ¶ added in v0.0.25
func GetMultiCallABI ¶ added in v0.0.25
func GetSignerAddressFromTx ¶ added in v0.0.30
func HexToAddress ¶ added in v0.0.25
func HexToAddresses ¶ added in v0.0.25
func NameWithColor ¶
func PackERC20Data ¶ added in v0.0.25
func PrintElapseTime ¶ added in v0.0.30
func PrintFunctionCall ¶ added in v0.0.20
func PrintFunctionCall(fc *FunctionCall)
func PrintTupleFieldNamesToWriter ¶ added in v0.0.33
func PrintTupleFieldNamesToWriter(writer io.Writer, tuple TupleParamResult, indentLevel int)
func PrintTxDetails ¶
func PrintTxSuccessSummary ¶ added in v0.0.27
func PrintVerboseArraysToWriter ¶ added in v0.0.33
func PrintVerboseArraysToWriter(writer io.Writer, arrays []ParamResult, indentLevel int)
func PrintVerboseParamResultToWriter ¶ added in v0.0.33
func PrintVerboseParamResultToWriter(writer io.Writer, param ParamResult, indentLevel int, includeFieldNames bool)
func PrintVerboseTopicToWriter ¶ added in v0.0.33
func PrintVerboseTopicToWriter(writer io.Writer, topic TopicResult)
func PrintVerboseTupleToWriter ¶ added in v0.0.33
func PrintVerboseTupleToWriter(writer io.Writer, tuple TupleParamResult, indentLevel int, includeFieldNames bool)
func PrintVerboseTuplesToWriter ¶ added in v0.0.33
func PrintVerboseTuplesToWriter(writer io.Writer, tuples []TupleParamResult, indentLevel int)
func PrintVerboseValueToWriter ¶ added in v0.0.20
func RawTxToHash ¶ added in v0.0.25
RawTxToHash returns valid hex data of a transaction to transaction hash
func ReadableNumber ¶
func RunParallel ¶ added in v0.0.33
RunParallel takes multiple functions that each return an error, runs them in parallel using goroutines, then aggregates any errors using errors.Join (Go 1.20+).
func StringToBig ¶ added in v0.0.25
func StringToFloat ¶ added in v0.0.25
func VerboseAddress ¶
func VerboseValues ¶
Types ¶
type ABIDatabase ¶ added in v0.0.20
type FunctionCall ¶ added in v0.0.20
type FunctionCall struct { Destination Address Value *big.Int Method string Params []ParamResult DecodedFunctionCalls []*FunctionCall Error string }
type InternalTx ¶ added in v0.0.25
type LogResult ¶
type LogResult struct { Name string Topics []TopicResult Data []ParamResult }
type ParamResult ¶
type ParamResult struct { Name string Type string Values []Value // Values stores the values of the parameters, in case the param is an array of arbitrary types, it will have more than one value Tuples []TupleParamResult // []ParamResult represents a tuple, this has more than one tuple if the param is a slice or an array of tuples Arrays []ParamResult // Arrays stores the values of the parameters, in case the param is a slice or an array of another slice/array, it will have more than one value }
ParamResult is the general struct that aims to be able to store all of the information of a parameter
- Para meter is an arbitrary type such as string, int, uint, bool, address, hash, bytes, fixed bytes ParamResult{ Name: "param1", // in case it is an element of an array, name = array_name[index] Type: "string", // or "int", "uint", "bool", "address", "hash", "bytes", "fixed bytes" Values: [1]Value{}, // where this has only one value }
- Parameter is a slice or an array of arbitrary types ParamResult{ Name: "param1", Type: "string[]", // or "int[]", "uint[]", "bool[]", "address[]", "hash[]", "bytes[]", "fixed bytes[]" Values: [n]Value{}, // where this has multiple values }
- Parameter is a tuple ParamResult{ Name: "param1", Type: "tuple", Tuples: [1][]ParamResult{}, // where this has }
- Parameter is a slice or an array of tuples ParamResult{ Name: "param1", Type: "tuple[]", // or "tuple[2]", "tuple[2][3]" Tuples: [n][]ParamResult{}, // where this has multiple tuples, []ParamResult represents a tuple }
- Parameter is a slice or an array of another slice/array ParamResult{ Name: "param1", Type: "string[][]", // or "int[][]", "uint[][]", "bool[][]", "address[][]", "hash[][]", "bytes[][]", "fixed bytes[][]" Arrays: [n]ParamResult{}, // where this has multiple arrays, []ParamResult represents an array }
type TopicResult ¶
type Transaction ¶ added in v0.0.25
type Transaction struct { *types.Transaction Extra TxExtraInfo `json:"extra"` }
func (*Transaction) MarshalJSON ¶ added in v0.0.25
func (tx *Transaction) MarshalJSON() ([]byte, error)
func (*Transaction) UnmarshalJSON ¶ added in v0.0.25
func (tx *Transaction) UnmarshalJSON(msg []byte) error
type TupleParamResult ¶ added in v0.0.33
type TupleParamResult struct { Name string Type string Values []ParamResult }
type TxExtraInfo ¶ added in v0.0.25
type TxInfo ¶ added in v0.0.25
type TxInfo struct { Status string Tx *Transaction InternalTxs []InternalTx Receipt *types.Receipt }
type TxResult ¶
type TxResult struct { Hash string Network string Status string From Address Value string To Address Nonce string GasPrice string GasLimit string GasUsed string GasCost string Timestamp string TxType string FunctionCall *FunctionCall Logs []LogResult Completed bool Error string }
func NewTxResult ¶
func NewTxResult() *TxResult
Click to show internal directories.
Click to hide internal directories.