api

package
v0.0.0-...-8024cb9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const COIN_TYPE_HEADER = "CoinType"
View Source
const KEEPER_KEY = "keeper"

Variables

View Source
var ACCOUNT_REGEXP = regexp.MustCompile("^([a-z|A-Z|0-9])+$")
View Source
var METHODS_SUPPORTED = map[string]string{

	"/ping":   "check if api service valid and backend bitcoin service healthy",
	"/health": "check system status",
	"/help":   "display this message",

	"/getaddress":     "return address of specified account or default",
	"/getbalance":     "sum balances of all accounts",
	"/listaccounts":   "list accounts with amount, minconf is 6",
	"/getaccountinfo": "return account with corresponding bablance and addresses",
	"/createaccount":  "create account and return receive address, error if account exists",
	"/sendfrom":       "send amount of satoshi from some account to targets address",
	"/move":           "move from one account to another",
}

http api list

Functions

func R

func R(data interface{}) gin.H

Types

type ApiServer

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

func NewApiServer

func NewApiServer(addr string) *ApiServer

func (*ApiServer) CreateAccount

func (api *ApiServer) CreateAccount(c *gin.Context)

Create func

func (*ApiServer) GetAccountInfo

func (api *ApiServer) GetAccountInfo(c *gin.Context)

Create func

func (*ApiServer) GetAddress

func (api *ApiServer) GetAddress(c *gin.Context)

func (*ApiServer) GetAddressesByAccount

func (api *ApiServer) GetAddressesByAccount(c *gin.Context)

func (*ApiServer) GetBlockCount

func (api *ApiServer) GetBlockCount(c *gin.Context)

func (*ApiServer) GetNewAddress

func (api *ApiServer) GetNewAddress(c *gin.Context)

func (*ApiServer) HttpListen

func (api *ApiServer) HttpListen() error

func (*ApiServer) InitBtcClient

func (api *ApiServer) InitBtcClient(host, user, pass, logDir string) (err error)

TODO valid host is valid

func (*ApiServer) InitEthClient

func (api *ApiServer) InitEthClient(host, walletDir, password, accountPath, logDir string) (err error)

func (*ApiServer) InitUsdtClient

func (api *ApiServer) InitUsdtClient(host, user, pass, logDir string, propertyId int64) (err error)

func (*ApiServer) KeeperCheck

func (api *ApiServer) KeeperCheck() (err error)

Check

func (*ApiServer) ListAccounts

func (api *ApiServer) ListAccounts(c *gin.Context)

ListAccounts func

func (*ApiServer) ListUnspentMin

func (api *ApiServer) ListUnspentMin(c *gin.Context)

func (*ApiServer) Move

func (api *ApiServer) Move(c *gin.Context)

func (*ApiServer) SendFrom

func (api *ApiServer) SendFrom(c *gin.Context)

func (*ApiServer) SendToAddress

func (api *ApiServer) SendToAddress(c *gin.Context)

type Base

type Base struct {
}

Jump to

Keyboard shortcuts

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