rpc

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxType_NSG            = 0  //	NSG Transactions
	TxType_SetSecureCode  = 1  //Set secure code
	TxType_Delegate       = 2  //Register as a delegator
	TxType_Vote           = 3  //Submit a vote
	TxType_MultiSig       = 4  //multisignature
	TxType_PublishDAPP    = 5  //Publish a dapp in mainnet
	TxType_DeopsitDAPP    = 6  //deposit to a Dapp
	TxType_WithdrawalDAPP = 7  //withdrawal from a dapp
	TxType_RegPublisher   = 9  //register as a asset publisher
	TxType_RegAsset       = 10 //register an asset in mainnet
	TxType_IssueAsset     = 13 //issue an asset
	TxType_Asset          = 14 //asset transactions
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	UiaTransfer *UiaTransfer `json:"uiaTransfer,omitempty"`
}

type AssetsBalance

type AssetsBalance struct {
	Currency  string `json:"currency"`
	Balance   string `json:"balance"`
	Precision uint8  `json:"precision"`
}

type AssetsBalanceResponse

type AssetsBalanceResponse struct {
	Balance *AssetsBalance `json:"balance"`
}

type BalanceResponse

type BalanceResponse struct {
	Balance uint64 `json:"balance"`
}

type BaseClient

type BaseClient struct {
	// contains filtered or unexported fields
}

func (*BaseClient) ReadResponse

func (bk *BaseClient) ReadResponse(resp *resty.Response) ([]byte, error)

type Block

type Block struct {
	// contains filtered or unexported fields
}

func (*Block) GetBlockHeight

func (blk *Block) GetBlockHeight() (uint64, error)

GetBlockHeight get height

func (*Block) GetByHash

func (blk *Block) GetByHash(hash string) (*Header, error)

GetByHash by hash

func (*Block) GetByHeight

func (blk *Block) GetByHeight(height uint64) (*Header, error)

GetByHeight by height

type BlockHeightResponse

type BlockHeightResponse struct {
	Success bool   `json:"success"`
	Height  uint64 `json:"height"`
}

type BlockResponse

type BlockResponse struct {
	Success bool    `json:"success"`
	Block   *Header `json:"block"` // block
}

type Client

type Client struct {
	Wallet *Wallet
	Tx     *Tx
	Block  *Block
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseAddress string) *Client

type ErrorResponse

type ErrorResponse struct {
	StatusText string `json:"status"`          // user-level status message
	AppCode    int64  `json:"code,omitempty"`  // application-specific error code
	ErrorText  string `json:"error,omitempty"` // application-level error message, for debugging
}
type Header struct {
	ID                   string `json:"id"`                   // Hash
	Version              uint32 `json:"version"`              // Block version information (note, this is signed)
	Timestamp            int64  `json:"timestamp"`            // A timestamp recording when this block was created (Will overflow in 2106[2])
	Height               uint64 `json:"height"`               // Height
	PrevBlock            string `json:"previousBlock"`        // The hash value of the previous block this particular block references
	NumberOfTransactions uint32 `json:"numberOfTransactions"` // Number Of Transactions
}

type Transaction

type Transaction struct {
	ID            string   `json:"id"`
	Height        string   `json:"height,omitempty"`
	BlockID       string   `json:"blockId,omitempty"` // block id
	Type          uint32   `json:"type"`
	Timestamp     int64    `json:"timestamp"` // A timestamp recording when this block was created (Will overflow in 2106[2])
	SenderID      string   `json:"senderId"`
	RecipientId   string   `json:"recipientId"`
	Amount        uint64   `json:"amount"`
	Fee           uint64   `json:"fee"`
	Signature     string   `json:"signature"`
	Signatures    []string `json:"signatures,omitempty"`
	SignSignature string   `json:"signSignature,omitempty"`
	Confirmations string   `json:"confirmations,omitempty"`
	Message       string   `json:"message"`
	Asset         *Asset   `json:"asset,omitempty"`
}

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

func (*Tx) Broadcast

func (tx *Tx) Broadcast(txData interface{}) error

func (*Tx) BroadcastTx

func (tx *Tx) BroadcastTx(txData interface{}, try int64) error

func (*Tx) GetTransaction

func (tx *Tx) GetTransaction(id string) (*Transaction, error)

func (*Tx) GetTransactionsByBlock

func (tx *Tx) GetTransactionsByBlock(blockId string) ([]*Transaction, error)

type TxPublishResponse

type TxPublishResponse struct {
	Result bool   `json:"success"`
	Error  string `json:"error"`
}

type TxResponse

type TxResponse struct {
	Success     bool         `json:"success"`
	Transaction *Transaction `json:"transaction"`
}

type TxsResponse

type TxsResponse struct {
	Success      bool           `json:"success"`
	Transactions []*Transaction `json:"transactions"`
}

type UiaTransfer

type UiaTransfer struct {
	TransactionId string `json:"transactionId,omitempty"`
	Currency      string `json:"currency"`
	Amount        string `json:"amount"`
	Precision     uint8  `json:"precision,omitempty"`
}

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

func (*Wallet) GetAssetsBalance

func (w *Wallet) GetAssetsBalance(address, currency string) (*AssetsBalance, error)

func (*Wallet) GetBalance

func (w *Wallet) GetBalance(address string) (uint64, error)

Jump to

Keyboard shortcuts

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