transport

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Mainnet = vsys.Mainnet
View Source
const Testnet = vsys.Testnet

Variables

View Source
var Endpoint = map[NetType]string{
	Testnet: "http://klymena.vos.systems:9924",
	Mainnet: "http://vnode.vos.systems:9922",
}

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Code    int                    `json:"error"`
	Message string                 `json:"message"`
	Data    map[string]interface{} `json:"-"`
}

type LatestHeight

type LatestHeight struct {
	Height int64 `json:"height"`
}

response schema for /blocks/height

type NetType

type NetType = vsys.NetType

type NodeStatus

type NodeStatus struct {
	BlockchainHeight int64     `json:"blockchainHeight"`
	StateHeight      int64     `json:"stateHeight"`
	UpdatedTimestamp int64     `json:"updatedTimestamp"`
	UpdatedDate      time.Time `json:"updatedDate"`
}

response schema for /node/status

type Provider

type Provider struct {
	NetType  NetType
	Endpoint string
	Client   *http.Client
}

func NewProvider

func NewProvider(endpoint string, netType NetType) (*Provider, error)

func (*Provider) Get

func (p *Provider) Get(path string, queries map[string]string, respData interface{}) error

func (*Provider) Post

func (p *Provider) Post(path string, queries map[string]string, reqData, respData interface{}) error

func (*Provider) SendRequest

func (p *Provider) SendRequest(method, path string, queries map[string]string, reqData, respData interface{}) error

type SecureCryptographicHash

type SecureCryptographicHash struct {
	Message string `json:"message"`
	Hash    string `json:"hash"`
}

response schema for /utils/hash/secure

type SignedMessage

type SignedMessage struct {
	Message   string `json:"message"`
	PublicKey string `json:"publicKey"`
	Signature string `json:"signature"`
}

response schema for /addresses/signText/{address}

type TokenBalance

type TokenBalance struct {
	Address string `json:"address/contractId"`
	TokenId string `json:"tokenId"`
	Balance int64  `json:"balance"`
	Unity   int64  `json:"unity"`
	Height  int64  `json:"height"`
}

response schema for /contract/balance/{address}/{tokenId}

type Transaction

type Transaction struct {
	vsys.Transaction

	// override fields
	Contract map[string]interface{} `json:"contract"`

	Proofs []struct {
		ProofType string `json:"proofType"`
		PublicKey string `json:"publicKey"`
		Address   string `json:"address"`
		Signature string `json:"signature"`
	} `json:"proofs"`

	Status     string `json:"status"`
	FeeCharged int64  `json:"feeCharged"`
	Height     int64  `json:"height"`
}

response schema for /transactions/info/{txId}

type TransactionList

type TransactionList struct {
	TotalCount   int           `json:"totalCount"`
	Size         int           `json:"size"`
	Transactions []Transaction `json:"transactions"`
}

response schema for /transactions/list

type VsysBalance

type VsysBalance struct {
	Address       string `json:"address"`
	Confirmations int    `json:"confirmations"`
	Balance       int64  `json:"balance"`
}

response schema for /addresses/balance/{address}

type VsysErr

type VsysErr struct {
	sdkErr.Err
	Code int
	Data map[string]interface{}
	Raw  string
}

func NewVsysError

func NewVsysError(httpResp *http.Response) VsysErr

func (VsysErr) Error

func (e VsysErr) Error() string

Jump to

Keyboard shortcuts

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