broker

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Command = &cobra.Command{
		Use:   "broker",
		Short: "BrokerDealer utilities",
	}

	DeployCommand = &cobra.Command{
		Use:     "deploy",
		Short:   "Deploys a new broker-dealer registry contract",
		Example: "t0ken broker deploy --keystoreAddress owner",
		Args:    cobra.NoArgs,
		PreRun:  commands.ConnectWithKeyStore,
		Run: func(cmd *cobra.Command, args []string) {

			addr, tx, _, err := registry.DeployBrokerDealer(cli.Conn.Opts, cli.Conn.Client)
			cli.CheckErr(cmd, err)
			cmd.Println("   Contract:", addr.String())
			cli.PrintTransactionFn(cmd)(tx, nil)
		},
	}
)
View Source
var GetterCommands = []*cobra.Command{
	&cobra.Command{
		Use:     "abi",
		Short:   "Outputs the Storage ABI",
		Example: "t0ken investor abi",
		Args:    cobra.NoArgs,
		Run:     func(cmd *cobra.Command, args []string) { cmd.Println(registry.StorageABI) },
	},
	&cobra.Command{
		Use:     "bin",
		Short:   "Outputs the Storage Binary",
		Example: "t0ken investor bin",
		Args:    cobra.NoArgs,
		Run:     func(cmd *cobra.Command, args []string) { cmd.Println(registry.StorageBin) },
	},
	&cobra.Command{
		Use:     "storage",
		Short:   "Gets the Storage contract address",
		Example: "t0ken investor storage",
		Args:    cobra.NoArgs,
		PreRun:  connectCaller,
		Run: func(cmd *cobra.Command, args []string) {
			cli.CheckAddressGetter(cmd)(callSession.Store())
		},
	},
}
View Source
var SetterCommands = []*cobra.Command{
	&cobra.Command{
		Use:     "add <broker>",
		Short:   "Adds the <broker> address",
		Example: "t0ken broker add 0xb01ba0d19cc9cd613253bad489b69e583dbfd4da --keystoreAddress custodian",
		Args:    cli.AddressArgFunc("broker", 0),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			broker := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.Add(broker))
		},
	},
	&cobra.Command{
		Use:     "addAccount <broker> <acccount>",
		Short:   "Adds the custodial-<account> to the <broker>",
		Example: "t0ken broker addAccount 0xb01ba0d19cc9cd613253bad489b69e583dbfd4da 0xa01a0a93716633058d69a28fbd472fd40e7c6b79 --keystoreAddress custodian",
		Args:    cli.ChainArgs(cli.AddressArgFunc("broker", 0), cli.AddressArgFunc("account", 1)),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			broker := common.HexToAddress(args[0])
			custodialAccount := common.HexToAddress(args[1])
			cli.PrintTransactionFn(cmd)(transSession.AddAccount(broker, custodialAccount))
		},
	},
	&cobra.Command{
		Use:     "remove <broker>",
		Short:   "Removes the <broker> address",
		Example: "t0ken broker remove 0xb01ba0d19cc9cd613253bad489b69e583dbfd4da --keystoreAddress custodian",
		Args:    cli.ChainArgs(cli.AddressArgFunc("broker", 0)),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			addr := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.Remove(addr))
		},
	},
	&cobra.Command{
		Use:     "removeAccount <acccount>",
		Short:   "Removes the custodial-<account> of a broker",
		Example: "t0ken broker removeAccount 0xa01a0a93716633058d69a28fbd472fd40e7c6b79 --keystoreAddress custodian",
		Args:    cli.AddressArgFunc("account", 0),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			custodialAccount := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.RemoveAccount(custodialAccount))
		},
	},
	&cobra.Command{
		Use:     "setStorage <address>",
		Short:   "Sets the storage contract to <address>",
		Example: "t0ken broker setStorage 0x397e7b9c15ff22ba67ec6e78f46f1e21540bcb36 --keystoreAddress owner",
		Args:    cli.AddressArgFunc("address", 0),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			addr := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.SetStorage(addr))
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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