Documentation ¶
Index ¶
- func AbiDecodeString(bz []byte) (string, error)
- func AbiEncodeString(str string) ([]byte, error)
- func BeautifyJson(bzJson []byte) ([]byte, error)
- func ConvertDisplayWithExponentIntoRaw(display string, exponent int, decimalsPoint rune) (number, highNumber, lowNumber *big.Int, err error)
- func ConvertNumberIntoDisplayWithExponent(number *big.Int, exponent int) (display string, highNumber, lowNumber *big.Int, err error)
- func DecodeRawEvmTx(rawTx string) (*ethtypes.Transaction, error)
- func ExitOnErr(err error, msg string)
- func FromMnemonicToPrivateKey(mnemonic, password string) (*ecdsa.PrivateKey, error)
- func GetEvmAddressFromAnyFormatAddress(addrs ...string) (evmAddrs []common.Address, err error)
- func MarshalPrettyJsonEvmTx(tx *ethtypes.Transaction, option *PrettyMarshalJsonEvmTxOption) ([]byte, error)
- func MarshalPrettyJsonEvmTxReceipt(receipt *ethtypes.Receipt, option *PrettyMarshalJsonEvmTxReceiptOption) ([]byte, error)
- func OrderNumberForDenom(denom string) int
- func PanicIfErr(err error, msg string)
- func PrintfStdErr(format string, a ...any)
- func PrintlnStdErr(a ...any)
- func ProvidedArgsOrFromPipe(providedArgs []string) (outputArgs []string, err error)
- func ReadShortInt(input string) (out *big.Int, err error)
- func ReadShortIntOrHex(input string) (out *big.Int, err error)
- func RequireArgs(args []string, cmd *cobra.Command)
- func RequireExactArgsCount(args []string, want int, cmd *cobra.Command)
- func ResolveBase64Events(events []acbitypes.Event) []acbitypes.Event
- func TryInjectTranslatedFieldForEvmRpcObjects(originalObject any, _map map[string]interface{}, key string)
- func TryInjectTranslationValueByKey[K comparable, V any](_map map[K]V, key K, newKeyModifier func(K) K, ...)
- func TryPrintBeautyJson(bz []byte)
- type PrettyMarshalJsonEvmTxOption
- type PrettyMarshalJsonEvmTxReceiptOption
- type TxHashType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbiDecodeString ¶
func AbiEncodeString ¶
func BeautifyJson ¶
BeautifyJson beautifies the given json.
func DecodeRawEvmTx ¶
func DecodeRawEvmTx(rawTx string) (*ethtypes.Transaction, error)
func FromMnemonicToPrivateKey ¶
func FromMnemonicToPrivateKey(mnemonic, password string) (*ecdsa.PrivateKey, error)
func MarshalPrettyJsonEvmTx ¶
func MarshalPrettyJsonEvmTx(tx *ethtypes.Transaction, option *PrettyMarshalJsonEvmTxOption) ([]byte, error)
func MarshalPrettyJsonEvmTxReceipt ¶
func MarshalPrettyJsonEvmTxReceipt(receipt *ethtypes.Receipt, option *PrettyMarshalJsonEvmTxReceiptOption) ([]byte, error)
func OrderNumberForDenom ¶
func PanicIfErr ¶
PanicIfErr raises a panic. If the `err` is nil, this method does nothing
func ProvidedArgsOrFromPipe ¶
ProvidedArgsOrFromPipe will prioritize provided args, if not provided, it will try to read from pipe.
func RequireArgs ¶
RequireArgs will exit program if no arg provided.
func RequireExactArgsCount ¶
RequireExactArgsCount will exit program if number of arguments is not equal to want.
func TryInjectTranslationValueByKey ¶
func TryInjectTranslationValueByKey[K comparable, V any](_map map[K]V, key K, newKeyModifier func(K) K, valueTranslate func(V) (V, bool))
TryInjectTranslationValueByKey tries to translate the value of the given key in the map and put back.
func TryPrintBeautyJson ¶
func TryPrintBeautyJson(bz []byte)
TryPrintBeautyJson tries to beautify the given json and print it. If failed to beautify, it will print the original json.
Types ¶
type PrettyMarshalJsonEvmTxReceiptOption ¶
type PrettyMarshalJsonEvmTxReceiptOption struct {
InjectTranslateAbleFields bool
}
type TxHashType ¶
type TxHashType uint8
const ( TxHashTypeInvalid TxHashType = iota TxHashTypeEvm TxHashTypeCosmos )
func DetectTxHashType ¶
func DetectTxHashType(txHash string) TxHashType
Click to show internal directories.
Click to hide internal directories.