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 ¶
Common Transaction utilities, helps to create them consistently
Index ¶
- func CreateBalanceRequest(args *BalanceArguments) []byte
- func CreateMintRequest(args *SendArguments) []byte
- func CreateRegisterRequest(args *RegisterArguments) []byte
- func CreateSendRequest(args *SendArguments) []byte
- func CreateSwapRequest(args *SwapArguments) []byte
- func GetAccountKey(identity string) []byte
- func GetBalance(accountKey id.AccountKey) *data.Coin
- func GetPublicKey() id.PublicKey
- func GetSigners() []id.PublicKey
- func GetSwapAddress(currencyName string) []byte
- func SignAndPack(ttype action.Type, transaction action.Transaction) []byte
- type BalanceArguments
- type RegisterArguments
- type SendArguments
- type SwapArguments
- type Terminal
- type Tty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBalanceRequest ¶
func CreateBalanceRequest(args *BalanceArguments) []byte
func CreateMintRequest ¶
func CreateMintRequest(args *SendArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateRegisterRequest ¶
func CreateRegisterRequest(args *RegisterArguments) []byte
Create a request to register a new identity with the chain
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.Coin
func GetPublicKey ¶
Given an Identity or Account, get the correct associated public key
func GetSigners ¶
GetSigners will return the public keys of the signers
func GetSwapAddress ¶ added in v0.5.0
func SignAndPack ¶
func SignAndPack(ttype action.Type, transaction action.Transaction) []byte
Prepare a transaction to be issued.
Types ¶
type BalanceArguments ¶
type BalanceArguments struct {
}
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