api

package
v0.0.0-...-13d5c5d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnSupportTxType errCode = 2000 + iota
	ErrUnSupportTxVersion
	ErrUnSupportEcosystem
	ErrUnSupportCrowdSaleSP
	ErrUnSupportPrecision
)

consensus error

View Source
const (
	ErrCreatePayload errCode = 2100 + iota
	ErrCreateRawTxInput
	ErrCreateRawTxReference
	ErrCreateRawTxOpReturn
	ErrCreateRawTxChange
	ErrSendRawTransaction
	ErrWhcDecodeTransaction
	ErrWhcGetTransaction
	ErrAssembleBCHTransaction
)

RPC error

View Source
const (
	ErrFormItems errCode = 2200 + iota
	ErrConvertFloat64
	ErrEmptyAddressList
	ErrGetTxType
	ErrIncorrectAddress
	ErrConvertInt
	ErrIncorrectAmount
	ErrEmptyQueryParam
	ErrCategoryNotFound
	ErrHexStringFormat
	ErrHash256Format
	ErrIncorrectPropertyID
	ErrIncorrectPropertyName
	ErrIncorrectPropertyQueryByKeyword
	ErrExceedMaxAddressRequestLimit
	ErrExceedMaxNulldataLimit
	ErrEmptyDeviceName
	ErrParseVersionString
	ErrHightestVersionString
)

User input error

View Source
const (
	ErrGetHistoryList errCode = 2300 + iota
	ErrGetHistoryListCount
	ErrGetHistoryDetail
	ErrEmptyHistoryDetail
	ErrEmptyHistorySpDetail
	ErrGetPropertyByAddressIssuer
	ErrGetPropertyByAddressIssuerCount
	ErrGetPropertyByAddress
	ErrGetPropertyByID
	ErrGetPropertyByName
	ErrListProperties
	ErrListPropertiesCount
	ErrGetAllCrowdSale
	ErrGetActiveCrowdSale
	ErrGetActiveCrowdSaleCount
	ErrQueryTotal
	ErrQueryTransactions
	ErrGetBalanceFromRedis
	ErrGetBalanceFromDatabase
	ErrEmptyBalance
	ErrGetPurchasedCrowdSaleList
	ErrGetPurchasedCrowdSaleCount
	ErrGetNewestVersionFailed
	ErrGetNotification
)

database error

View Source
const (
	ErrChallenge errCode = 2400 + iota
	ErrCreateWallet
	ErrUpdateWallet
	ErrLogin
	ErrNotUUID
	ErrVerify
	ErrMfaToken
	ErrInsufficientBalance
)

account error

View Source
const (
	ErrInsertBCH errCode = 2500 + iota
	ErrInsertWhc
	ErrCanNotGetUtxo
	ErrCanNotGetInputs
	ErrDecodeRawTransaction
	ErrTxDeserialize
	ErrGetBCHBalance
	ErrVersionSetting
	ErrAmountString
)

server or handle error

View Source
const (
	ErrTransactionGet errCode = 2600 + iota
)

Variables

This section is empty.

Functions

func AssembleBCHTx

func AssembleBCHTx(c *gin.Context)

func BchHistory

func BchHistory(c *gin.Context)

func BroadcastBCHTx

func BroadcastBCHTx(c *gin.Context)

func Challenge

func Challenge(c *gin.Context)

func CheckAddressList

func CheckAddressList(c *gin.Context) ([]string, error)

CheckAddressList check address number limit and encoded, and only apply for post request.

func CheckAddressListReturnLegacy

func CheckAddressListReturnLegacy(c *gin.Context) ([]string, error)

func Create

func Create(c *gin.Context)

func FeeRate

func FeeRate(c *gin.Context)

func GetBCHBalance

func GetBCHBalance(c *gin.Context)

func GetBalanceForAddress

func GetBalanceForAddress(c *gin.Context)

func GetBalanceFromCache

func GetBalanceFromCache(addresses []string, refresh bool) (map[string][]commodel.BalanceForAddress, error)

func GetCategories

func GetCategories(c *gin.Context)

func GetEnv

func GetEnv(c *gin.Context)

func GetHistory

func GetHistory(c *gin.Context)

func GetHistoryDetail

func GetHistoryDetail(c *gin.Context)

func GetHistoryDetailPending

func GetHistoryDetailPending(c *gin.Context)

func GetHistoryList

func GetHistoryList(c *gin.Context)

func GetNotification

func GetNotification(c *gin.Context)

func GetProperty

func GetProperty(c *gin.Context)

GetProperty query property data via property name of property id. will return most ten items for select.

func GetPropertyByAddress

func GetPropertyByAddress(c *gin.Context)

func GetPropertyByID

func GetPropertyByID(c *gin.Context)

func GetPropertyByName

func GetPropertyByName(c *gin.Context)

func GetPurchasedCrowdSaleTimes

func GetPurchasedCrowdSaleTimes(c *gin.Context)

func GetSubCategories

func GetSubCategories(c *gin.Context)

func GetUnsignedTx

func GetUnsignedTx(c *gin.Context)

func GetUtxoElectrumx

func GetUtxoElectrumx(addr cashutil.Address, requireAmount decimal.Decimal, needAllUtxos bool) ([]btcjson.PrevTx, error)

func InTxTypeArray

func InTxTypeArray(target int32, array []int32) bool

func IsAvailablePropertyID

func IsAvailablePropertyID(id uint64) bool

func IsAvailablePropertyName

func IsAvailablePropertyName(name string) bool

func IsAvailableQueryForProperty

func IsAvailableQueryForProperty(keyword string) bool

func IsSupportPrecision

func IsSupportPrecision(precision string) bool

func ListActiveCrowdSales

func ListActiveCrowdSales(c *gin.Context)

func ListByOwner

func ListByOwner(c *gin.Context)

func ListOwners

func ListOwners(c *gin.Context)

func ListProperties

func ListProperties(c *gin.Context)

func Login

func Login(c *gin.Context)

func NewMfa

func NewMfa(c *gin.Context)

func NotifyBalanceUpdated

func NotifyBalanceUpdated(ctx *gin.Context)

func OnAddressAdd

func OnAddressAdd(addrs []string)

func PurchaseCrowdSaleList

func PurchaseCrowdSaleList(c *gin.Context)

func PushTx

func PushTx(c *gin.Context)

func SyncBalanceForBCH

func SyncBalanceForBCH(addr cashutil.Address)

func Update

func Update(c *gin.Context)

func UpdateSoftware

func UpdateSoftware(c *gin.Context)

func Verify

func Verify(c *gin.Context)

* The api is used for web ajax verify email unique or phone unique

Types

type Balance

type Balance struct {
	Address     string  `json:"address"`
	Confirmed   float64 `json:"confirmed"`
	Unconfirmed float64 `json:"unconfirmed"`
}

type GetNotificationParam

type GetNotificationParam struct {
	From      int64    `form:"from" binding:"required,gt=0"`
	To        int64    `form:"to"`
	Addresses []string `form:"address" binding:"required"`
}

type HistoryListResult

type HistoryListResult struct {
	TxHash                      string `json:"tx_hash"`
	TxType                      int32  `json:"tx_type"`
	TxState                     string `json:"tx_state"`
	Address                     string `json:"address"`
	AddressRole                 string `json:"address_role"`
	BalanceAvailableCreditDebit string `json:"balance_available_credit_debit"`
	PropertyID                  uint64 `json:"property_id"`
	PropertyName                string `json:"property_name"`
	Created                     int64  `json:"created"`
}

type ListByOwnerResult

type ListByOwnerResult struct {
	TxData       util.Result
	PropertyData util.Result
}

type OperateAddrsMsg

type OperateAddrsMsg struct {
	Type      action   `json:"type"`
	Addresses []string `json:"addresses"`
}

type only select from add/remove

type Response

type Response struct {
	Code    errCode     `json:"code"`
	Message string      `json:"message"`
	Result  interface{} `json:"result"`
}

type TxHist

type TxHist struct {
	IsReceive         bool            `json:"isReceive"`
	Txid              string          `json:"txid"`
	BlockUTCTimeStamp int64           `json:"blockUTCTimestamp"`
	BalanceDiff       decimal.Decimal `json:"balanceDiff"`
	Confirmations     int64           `json:"confirmations"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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