util

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NEXT                     int    = -1
	BACK                     int    = -2
	CUSTOM                   int    = -3
	CONSTRUCTOR_METHOD_INDEX uint64 = 1000000 // assuming there is no contract with more than 1m methods
)

Variables

This section is empty.

Functions

func AllZeroParamFunctions added in v0.0.30

func AllZeroParamFunctions(a *abi.ABI) []abi.Method

func AnalyzeAndShowMsigTxInfo

func AnalyzeAndShowMsigTxInfo(
	multisigContract *msig.MultisigContract,
	txid *big.Int,
	network jarvisnetworks.Network,
) (fc *jarviscommon.FunctionCall, confirmed bool, executed bool)

func CommonFunctionCallPreprocess

func CommonFunctionCallPreprocess(cmd *cobra.Command, args []string) (err error)

CommonFunctionCallPreprocess processes args passed to the command in order to initiate config's variables in a conventional way across many Function Call alike commands.

func CommonTxPreprocess

func CommonTxPreprocess(cmd *cobra.Command, args []string) (err error)

CommonTxPreprocess processes args passed to the command in order to initiate config's variables in a conventional way across many commands that do txs.

func HandleApproveOrRevokeOrExecuteMsig

func HandleApproveOrRevokeOrExecuteMsig(
	method string,
	cmd *cobra.Command,
	args []string,
	postProcess PostProcessFunc,
)

func HandlePostSign added in v0.0.30

func HandlePostSign(
	signedTx *types.Transaction,
	reader *reader.EthReader,
	analyzer *txanalyzer.TxAnalyzer,
	a *abi.ABI,
) (broadcasted bool, err error)

func PromptArray added in v0.0.30

func PromptArray(input abi.Argument, prefill string, network jarvisnetworks.Network) (interface{}, error)

func PromptFilePath added in v0.0.30

func PromptFilePath(prompter string) string

func PromptFunctionCallData added in v0.0.30

func PromptFunctionCallData(
	analyzer util.TxAnalyzer,
	contractAddress string,
	methodIndex uint64,
	prefills []string,
	prefillMode bool,
	mode string,
	a *abi.ABI,
	customABIs map[string]*abi.ABI,
	network jarvisnetworks.Network,
) (method *abi.Method, params []interface{}, err error)

func PromptIndex added in v0.0.30

func PromptIndex(prompter string, min, max int) int

func PromptInput added in v0.0.30

func PromptInput(prompter string) string

func PromptInputWithValidation added in v0.0.30

func PromptInputWithValidation(prompter string, validator StringValidator) string

func PromptItemInList added in v0.0.30

func PromptItemInList(prompter string, options []string) string

func PromptMethod added in v0.0.30

func PromptMethod(a *abi.ABI, methodIndex uint64, mode string) (*abi.Method, string, error)

func PromptNonArray added in v0.0.30

func PromptNonArray(input abi.Argument, prefill string, network jarvisnetworks.Network) (interface{}, error)

func PromptNumber added in v0.0.30

func PromptNumber(prompter string, validator NumberValidator, network jarvisnetworks.Network) *big.Int

func PromptParam added in v0.0.30

func PromptParam(
	interactiveMode bool,
	input abi.Argument,
	prefill string,
	network jarvisnetworks.Network,
) (interface{}, error)

func PromptPercentageBps added in v0.0.30

func PromptPercentageBps(prompter string, upbound int64, network jarvisnetworks.Network) *big.Int

func PromptTxConfirmation added in v0.0.30

func PromptTxConfirmation(
	analyzer util.TxAnalyzer,
	from jarviscommon.Address,
	tx *types.Transaction,
	customABIs map[string]*abi.ABI,
	network jarvisnetworks.Network,
) error

func PromptTxData added in v0.0.30

func PromptTxData(
	analyzer util.TxAnalyzer,
	contractAddress string,
	methodIndex uint64,
	prefills []string,
	prefillMode bool,
	a *abi.ABI,
	customABIs map[string]*abi.ABI,
	network jarvisnetworks.Network,
) ([]byte, error)

func ScanForTxs added in v0.0.30

func ScanForTxs(para string) (nwks []string, addresses []string)

func StringParamToBytes added in v0.0.32

func StringParamToBytes(data string) []byte

func ValidTxType added in v0.0.30

func ValidTxType(r *reader.EthReader, network jarvisnetworks.Network) (uint8, error)

Types

type NumberValidator added in v0.0.30

type NumberValidator func(number *big.Int) error

type PostProcessFunc

type PostProcessFunc func(fc *jarviscommon.FunctionCall) error

type StringValidator added in v0.0.30

type StringValidator func(st string) error

Jump to

Keyboard shortcuts

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