common

package
v0.0.0-...-bcf92e7 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const AttributeMaxLen = 252
View Source
const TlsPort int = 443

Variables

This section is empty.

Functions

func CheckAccessToken

func CheckAccessToken(auth_type, access_token string) (cakey string, errCode int64, result interface{})

func CheckPushBlock

func CheckPushBlock() bool

func GetAssetByHash

func GetAssetByHash(cmd map[string]interface{}) map[string]interface{}

Asset

func GetBalanceByAddr

func GetBalanceByAddr(cmd map[string]interface{}) map[string]interface{}

func GetBalanceByAsset

func GetBalanceByAsset(cmd map[string]interface{}) map[string]interface{}

func GetBlockByHash

func GetBlockByHash(cmd map[string]interface{}) map[string]interface{}

func GetBlockByHeight

func GetBlockByHeight(cmd map[string]interface{}) map[string]interface{}

func GetBlockHash

func GetBlockHash(cmd map[string]interface{}) map[string]interface{}

func GetBlockHeight

func GetBlockHeight(cmd map[string]interface{}) map[string]interface{}

Block

func GetBlockInfo

func GetBlockInfo(block *ledger.Block) BlockInfo
func GetTotalIssued(cmd map[string]interface{}) map[string]interface{} {
	resp := ResponsePack(Err.SUCCESS)
	assetid, ok := cmd["Assetid"].(string)
	if !ok {
		resp["Error"] = Err.INVALID_PARAMS
		return resp
	}
	var assetHash Uint256

	bys, err := HexStringToBytesReverse(assetid)
	if err != nil {
		resp["Error"] = Err.INVALID_PARAMS
		return resp
	}
	if err := assetHash.Deserialize(bytes.NewReader(bys)); err != nil {
		resp["Error"] = Err.INVALID_PARAMS
		return resp
	}
	amount, err := ledger.DefaultLedger.Store.GetQuantityIssued(assetHash)
	if err != nil {
		resp["Error"] = Err.INVALID_PARAMS
		return resp
	}
	resp["Result"] = amount.String()
	return resp
}

func GetBlockTransactions

func GetBlockTransactions(block *ledger.Block) interface{}

func GetBlockTxsByHeight

func GetBlockTxsByHeight(cmd map[string]interface{}) map[string]interface{}

func GetConnectionCount

func GetConnectionCount(cmd map[string]interface{}) map[string]interface{}

Node

func GetContract

func GetContract(cmd map[string]interface{}) map[string]interface{}

func GetNoticeServerUrl

func GetNoticeServerUrl(cmd map[string]interface{}) map[string]interface{}

func GetOauthServerUrl

func GetOauthServerUrl(cmd map[string]interface{}) map[string]interface{}

config

func GetStateUpdate

func GetStateUpdate(cmd map[string]interface{}) map[string]interface{}

stateupdate

func GetTransactionByHash

func GetTransactionByHash(cmd map[string]interface{}) map[string]interface{}

Transaction

func GetTransactionPool

func GetTransactionPool(cmd map[string]interface{}) map[string]interface{}

func GetUnspendOutput

func GetUnspendOutput(cmd map[string]interface{}) map[string]interface{}

func GetUnspends

func GetUnspends(cmd map[string]interface{}) map[string]interface{}

func NewOauthClient

func NewOauthClient() *http.Client

func OauthRequest

func OauthRequest(method string, cmd map[string]interface{}, url string) (map[string]interface{}, error)

func PostRequest

func PostRequest(cmd map[string]interface{}, url string) (map[string]interface{}, error)

func ResponsePack

func ResponsePack(errCode int64) map[string]interface{}

func SendRawTransaction

func SendRawTransaction(cmd map[string]interface{}) map[string]interface{}

func SendRecord

func SendRecord(cmd map[string]interface{}) map[string]interface{}

func SendRecordTransaction

func SendRecordTransaction(cmd map[string]interface{}) map[string]interface{}

func SetNode

func SetNode(n Noder)

func SetNoticeServerUrl

func SetNoticeServerUrl(cmd map[string]interface{}) map[string]interface{}

func SetOauthServerUrl

func SetOauthServerUrl(cmd map[string]interface{}) map[string]interface{}

func SetPushBlockFlag

func SetPushBlockFlag(cmd map[string]interface{}) map[string]interface{}

Types

type ApiServer

type ApiServer interface {
	Start() error
	Stop()
}

Jump to

Keyboard shortcuts

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