Documentation ¶
Index ¶
- Variables
- func GenerateProposalOperation(ops []operations.Operation) operations.ProposalObjects
- func JSONOpString(v []operations.Operation) (string, error)
- func JSONTrxString(v *transactions.SignedTransaction) (string, error)
- func SetAsset(amount float64, symbol string) *types.Asset
- type Client
- func (client *Client) Close() error
- func (client *Client) GetTrx(strx []operations.Operation) (*operations.Transaction, error)
- func (client *Client) SendTrx(username string, strx []operations.Operation) (*types.OperationResponse, error)
- func (client *Client) SetAsyncProtocol(value bool)
- func (client *Client) SetKeys(keys *Keys)
- func (client *Client) SigningKeys(trx operations.Operation) ([][]byte, error)
- type Keys
Constants ¶
This section is empty.
Variables ¶
var (
ErrInitializeTransport = errors.New("Failed to initialize transport.")
)
var ( //OpTypeKey include a description of the operation and the key needed to sign it OpTypeKey = make(map[operations.OpType][]string) )
Functions ¶
func GenerateProposalOperation ¶
func GenerateProposalOperation(ops []operations.Operation) operations.ProposalObjects
GenerateProposalOperation generate []Operation to ProposalOperations
func JSONOpString ¶
func JSONOpString(v []operations.Operation) (string, error)
JSONOpString generate Operations to String
func JSONTrxString ¶
func JSONTrxString(v *transactions.SignedTransaction) (string, error)
JSONTrxString generate Trx to String
Types ¶
type Client ¶
type Client struct { API *api.API Config api.Config // Current keys for operations CurrentKeys *Keys // contains filtered or unexported fields }
Client can be used to access GOLOS remote APIs. There is a function for every available GOLOS API, for example, Client.API.GetDatabaseInfo() corresponds to database_api -> get_database_info.
func NewClient ¶
NewClient creates a new RPC client that use the given CallCloser internally. Initialize only server present API. Absent API initialized as nil value.
func (*Client) Close ¶
Close should be used to close the client when no longer needed. It simply calls Close() on the underlying CallCloser.
func (*Client) GetTrx ¶
func (client *Client) GetTrx(strx []operations.Operation) (*operations.Transaction, error)
func (*Client) SendTrx ¶
func (client *Client) SendTrx(username string, strx []operations.Operation) (*types.OperationResponse, error)
SendTrx generates and sends an array of transactions to VIZ.
func (*Client) SetAsyncProtocol ¶
SetAsyncProtocol enables or disables the asynchronous operation protocol
func (*Client) SigningKeys ¶
func (client *Client) SigningKeys(trx operations.Operation) ([][]byte, error)
SigningKeys returns the key from the CurrentKeys