commands

package
v0.0.0-...-0653a19 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package commands provides all the different command options and logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Balance

func Balance(ctx context.Context, converter *currency.Converter, book *book.Book, address string) error

Balance returns the current balance of the specified address.

func Deploy

func Deploy(ctx context.Context, converter *currency.Converter, clt *ethereum.Client) (err error)

Deploy will deploy the smart contract to the configured network.

func Deposit

func Deposit(ctx context.Context, converter *currency.Converter, book *book.Book, amountUSD float64) error

Deposit will move money from the wallet into the game contract.

func Parse

func Parse() (Flags, Args, error)

Parse will parse the environment variables and command line flags. The command line flags will overwrite environment variables. Validation takes place.

func PrintUsage

func PrintUsage()

PrintUsage displays the usage information.

func Transaction

func Transaction(ctx context.Context, converter *currency.Converter, clt *ethereum.Client, tranID string) error

Transaction returns the transaction and receipt information for the specified transaction. The txHex is expected to be in a 0x format.

func Wallet

func Wallet(ctx context.Context, converter *currency.Converter, clt *ethereum.Client, address common.Address) error

Wallet returns the current wallet balance for the specified address.

func Withdraw

func Withdraw(ctx context.Context, converter *currency.Converter, book *book.Book) error

Withdraw will remove money from the game contract back into the wallet.

Types

type Args

type Args struct {
	Network          string
	PassPhrase       string
	TranID           string
	FileKey          string
	Address          string
	ContractID       string
	CoinMarketCapKey string
	Money            float64
}

Args represent the values for each of the specified flags.

type Flags

type Flags map[string]struct{}

Flags represents the flags that were provided.

Jump to

Keyboard shortcuts

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