viz-go-lib: Index | Files | Directories

package client

import ""


Package Files

client.go helper.go keys.go trx.go


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[types.OpType][]string)

func GenPassword Uses

func GenPassword() string

GenPassword allows to generate a 52-character password of the evil system.

func GenerateProposalOperation Uses

func GenerateProposalOperation(ops []types.Operation) types.ProposalObjects

GenerateProposalOperation generate []Operation to ProposalOperations

func JSONOpString Uses

func JSONOpString(v []types.Operation) (string, error)

JSONOpString generate Operations to String

func JSONTrxString Uses

func JSONTrxString(v *transactions.SignedTransaction) (string, error)

JSONTrxString generate Trx to String

func SetAsset Uses

func SetAsset(amount float64, symbol string) *types.Asset

SetAsset returns data of type Asset

type BResp Uses

type BResp struct {
    ID       string
    BlockNum int32
    TrxNum   int32
    Expired  bool
    JSONTrx  string

BResp of response when sending a transaction.

type Client Uses

type Client struct {
    ConfigNet *api.Config

    AsyncProtocol bool

    // Database represents database_api.
    API *api.API

    // Current keys for operations
    CurrentKeys *Keys
    // contains filtered or unexported fields

Client can be used to access VIZ remote APIs. There is a public field for every VIZ API available, e.g. Client.Database corresponds to database_api.

func NewClient Uses

func NewClient(s string) (*Client, error)

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 Uses

func (client *Client) Close() error

Close should be used to close the client when no longer needed. It simply calls Close() on the underlying CallCloser.

func (*Client) GetPrivateKey Uses

func (client *Client) GetPrivateKey(user, role, password string) string

GetPrivateKey generates a private key based on the specified parameters.

func (*Client) GetPublicKey Uses

func (client *Client) GetPublicKey(privatekey string) string

GetPublicKey generates a public key based on the prefix and the private key.

func (*Client) GetTrx Uses

func (client *Client) GetTrx(strx []types.Operation) (*types.Transaction, error)

func (*Client) PerMvest Uses

func (client *Client) PerMvest() (float64, error)

PerMvest returns the ratio of TotalVersingFund to TotalVestingShares.

func (*Client) SendTrx Uses

func (client *Client) SendTrx(strx []types.Operation) (*BResp, error)

SendTrx generates and sends an array of transactions to VIZ.

func (*Client) SetKeys Uses

func (client *Client) SetKeys(keys *Keys)

SetKeys you can specify keys for signing transactions.

func (*Client) SigningKeys Uses

func (client *Client) SigningKeys(trx types.Operation) ([][]byte, error)

SigningKeys returns the key from the CurrentKeys

type Keys Uses

type Keys struct {
    RKey []string
    AKey []string
    GKey []string
    MKey []string

Keys is used as a keystroke for a specific user. Only a few keys can be set.


transactions/rfc6979Package rfc6979 is an implementation of RFC 6979's deterministic DSA.

Package client imports 17 packages (graph). Updated 2019-06-14. Refresh now. Tools for package owners.