trades

package
v0.0.0-...-901c18c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(r money.Resource, log *logrus.Logger, c *cli.Context) (bool, error)
func Mod(r money.Resource, log *logrus.Logger, c *cli.Context) (bool, error) {
	t := r.(*money.Trades)
	id := int(util.Stf(c.Args().Get(0)))
	narg := c.NArg()
	narg -= 1
	t.Pairs[id].Base = c.Args().Get(1)
	t.Pairs[id].Invs = c.Args().Get(2)
	t.Pairs[id].Cost = util.Stf(c.Args().Get(3))
	t.Pairs[id].Amount = util.Stf(c.Args().Get(4))
	t.Update()
	return true, nil
}

func mod(t *money.Trades, id int, field string, val string) {

	switch field {
	case "base":
		t.Open[id].Base = val
	case "invs":
		t.Open[id].Invs = val
	case "amount":
		t.Open[id].Amount = util.Stf(val)
	case "cost":
		t.Open[id].Cost = util.Stf(val)
	case "dir":
		if val == "buy" {
			t.Open[id].Claim = false
		} else {
			t.Open[id].Claim = true
		}

	}
}

func Close

func Close(r money.Resource, log *logrus.Logger, c *cli.Context) (bool, error)

func List

func List(r money.Resource, log *logrus.Logger, c *cli.Context) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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