Documentation
¶
Overview ¶
Copyright 2017-2018 OneLedger
Encapsulate any reads/writes to a terminal, to allow scripting later.
Should be separate from logging...
Copyright 2017 - 2018 OneLedger ¶
Query the chain for answers ¶
Copyright 2017 - 2018 OneLedger ¶
Structures and functions for getting command line arguments, and functions to convert these into specific requests.
Copyright 2017-2018 OneLedger ¶
Copyright 2017-2018 OneLedger ¶
Common Transaction utilities, helps to create them consistently
Index ¶
- func CatchSigterm(StopProcess func())
- func CreateApplyValidatorRequest(args *comm.ApplyValidatorArguments) []byte
- func CreateBalanceRequest(args *BalanceArguments) []byte
- func CreateExSendRequest(args *ExSendArguments) []byte
- func CreateMintRequest(args *SendArguments) []byte
- func CreateSendRequest(args *SendArguments) []byte
- func CreateSwapRequest(args *SwapArguments) []byte
- func GetAccountKey(identity string) []byte
- func GetBalance(accountKey id.AccountKey) *data.Balance
- func GetCurrencyAddress(currencyName string, id string) []byte
- func GetNodeName() string
- func GetPublicKey() id.PublicKey
- func GetSequenceNumber(accountKey id.AccountKey) int64
- func GetTxByHash(hash []byte) *ctypes.ResultTx
- func GetTxByHeight(height int) *ctypes.ResultTxSearch
- func GetTxByType(t string) *ctypes.ResultTxSearch
- func RegisterIdentityRequest(args *RegisterArguments) interface{}
- func SignAndPack(transaction action.Transaction) []byte
- func UpdateAccountRequest(args *AccountArguments) interface{}
- type AccountArguments
- type BalanceArguments
- type ExSendArguments
- type RegisterArguments
- type SendArguments
- type SwapArguments
- type Terminal
- type Tty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatchSigterm ¶ added in v0.7.1
func CatchSigterm(StopProcess func())
A polite way of bring down the service on a SIGTERM
func CreateApplyValidatorRequest ¶ added in v0.7.1
func CreateApplyValidatorRequest(args *comm.ApplyValidatorArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateBalanceRequest ¶
func CreateBalanceRequest(args *BalanceArguments) []byte
func CreateExSendRequest ¶ added in v0.7.1
func CreateExSendRequest(args *ExSendArguments) []byte
func CreateMintRequest ¶
func CreateMintRequest(args *SendArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateSendRequest ¶
func CreateSendRequest(args *SendArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func GetAccountKey ¶
func GetBalance ¶
func GetBalance(accountKey id.AccountKey) *data.Balance
TODO: Return a balance, not a coin
func GetCurrencyAddress ¶ added in v0.7.1
func GetNodeName ¶ added in v0.6.2
func GetNodeName() string
func GetPublicKey ¶
Given an Identity or Account, get the correct associated public key
func GetSequenceNumber ¶ added in v0.7.1
func GetSequenceNumber(accountKey id.AccountKey) int64
func GetTxByHash ¶ added in v0.7.0
func GetTxByHeight ¶ added in v0.7.0
func GetTxByHeight(height int) *ctypes.ResultTxSearch
func GetTxByType ¶ added in v0.7.0
func GetTxByType(t string) *ctypes.ResultTxSearch
func RegisterIdentityRequest ¶ added in v0.7.1
func RegisterIdentityRequest(args *RegisterArguments) interface{}
Create a request to register a new identity with the chain
func SignAndPack ¶
func SignAndPack(transaction action.Transaction) []byte
Prepare a transaction to be issued.
func UpdateAccountRequest ¶ added in v0.7.1
func UpdateAccountRequest(args *AccountArguments) interface{}
Types ¶
type AccountArguments ¶ added in v0.7.1
type AccountArguments struct {
Account string
Chain string
PublicKey string
PrivateKey string
NodeAccount bool
}
Registration
type BalanceArguments ¶
type BalanceArguments struct {
}
type ExSendArguments ¶ added in v0.7.1
type RegisterArguments ¶
Registration
type SendArguments ¶
type SwapArguments ¶
type SwapArguments struct {
Party string
CounterParty string
Amount string
Currency string
Fee string
Gas string // TODO: Not sure this is necessary, unless the chain is like Ethereum
Exchange string
Excurrency string
Nonce int64
}
Arguments to the command
type Terminal ¶
type Terminal interface {
// Output
//Print(text ...interface{})
Question(text ...interface{})
Info(text ...interface{})
Warning(text ...interface{})
Error(text ...interface{})
// Input
Read(string) string
Password() string
}
var Console Terminal
A globally accessable terminal called Console