obyte

package
v1.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	//币种
	Symbol    = "GBYTE"
	MasterKey = "masterkey seed"
	CurveType = owcrypt.ECC_CURVE_SECP256K1
)

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, password string) string

See 2 (end of page 4) http://www.ietf.org/rfc/rfc2617.txt "To receive authorization, the client sends the userid and password, separated by a single colon (":") character, within a base64 encoded string in the credentials." It is not meant to be urlencoded.

Types

type Address

type Address struct {
	Address string
}

func NewAddress

func NewAddress(r gjson.Result) *Address

type Balance

type Balance struct {
	Stable  string
	Pending string
}

func NewBalance

func NewBalance(r gjson.Result) *Balance

type Client

type Client struct {
	BaseURL     string
	AccessToken string
	Debug       bool
	// contains filtered or unexported fields
}

A Client is a Bitcoin RPC client. It performs RPCs over HTTP using JSON request and responses. A Client must be configured with a secret token to authenticate with other Cores on the network.

func NewClient

func NewClient(url, token string, debug bool) *Client

func (*Client) Call

func (c *Client) Call(path string, request interface{}) (*gjson.Result, error)

Call calls a remote procedure on another node, specified by the path.

type ClientInterface

type ClientInterface interface {
	Call(path string, request []interface{}) (*gjson.Result, error)
}

type WalletConfig

type WalletConfig struct {

	//币种
	Symbol    string
	MasterKey string

	//钱包服务API
	ServerAPI string
	//钱包数据文件目录
	WalletDataPath string
	//汇总阀值
	Threshold decimal.Decimal
	//汇总地址
	SumAddress string
	//汇总执行间隔时间
	CycleSeconds time.Duration
	//默认配置内容
	DefaultConfig string
	//曲线类型
	CurveType uint32
	//小数位长度
	CoinDecimals int32
	//最小矿工费
	MinFees string
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(symbol string) *WalletConfig

func (*WalletConfig) InitConfig

func (wc *WalletConfig) InitConfig()

initConfig 初始化配置文件

func (*WalletConfig) PrintConfig

func (wc *WalletConfig) PrintConfig() error

printConfig Print config information

type WalletManager

type WalletManager struct {
	openwallet.AssetsAdapterBase

	WalletClient *Client       // 节点客户端
	Config       *WalletConfig //钱包管理配置
	Log          *log.OWLogger //日志工具
}

func NewWalletManager

func NewWalletManager() *WalletManager

func (*WalletManager) BackupWallet

func (wm *WalletManager) BackupWallet() (string, error)

BackupWallet 备份数据

func (*WalletManager) BackupWalletFlow

func (wm *WalletManager) BackupWalletFlow() error

备份钱包流程

func (*WalletManager) CreateAddressFlow

func (wm *WalletManager) CreateAddressFlow() error

创建地址流程

func (*WalletManager) CreateBatchAddress

func (wm *WalletManager) CreateBatchAddress(count uint64) (string, []*Address, error)

CreateBatchAddress 批量创建地址

func (*WalletManager) CreateWalletFlow

func (wm *WalletManager) CreateWalletFlow() error

创建钱包流程

func (*WalletManager) CurveType

func (wm *WalletManager) CurveType() uint32

CurveType 曲线类型

func (*WalletManager) Decimal

func (wm *WalletManager) Decimal() int32

小数位精度

func (*WalletManager) FullName

func (wm *WalletManager) FullName() string

FullName 币种全名

func (*WalletManager) GetAssetsLogger

func (wm *WalletManager) GetAssetsLogger() *log.OWLogger

GetAssetsLogger 获取资产账户日志工具

func (*WalletManager) GetBalance

func (wm *WalletManager) GetBalance() (*Balance, error)

GetBalance

func (*WalletManager) GetChangeAddress

func (wm *WalletManager) GetChangeAddress() (*Address, error)

GetChangeAddress

func (*WalletManager) GetInfo

func (wm *WalletManager) GetInfo() (*gjson.Result, error)

GetInfo

func (*WalletManager) GetNewAddress

func (wm *WalletManager) GetNewAddress() (*Address, error)

GetNewAddress

func (*WalletManager) GetWalletList

func (wm *WalletManager) GetWalletList() error

GetWalletList 获取钱包列表

func (*WalletManager) InitAssetsConfig

func (wm *WalletManager) InitAssetsConfig() (config.Configer, error)

InitAssetsConfig 初始化默认配置

func (*WalletManager) InitConfigFlow

func (wm *WalletManager) InitConfigFlow() error

初始化配置流程

func (*WalletManager) LoadAssetsConfig

func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error

LoadAssetsConfig 加载外部配置

func (*WalletManager) LoadConfig

func (wm *WalletManager) LoadConfig() error

loadConfig 读取配置

func (*WalletManager) RestoreWallet

func (wm *WalletManager) RestoreWallet(keyFile string, confFile string) error

RestoreWallet 恢复钱包

func (*WalletManager) RestoreWalletFlow

func (wm *WalletManager) RestoreWalletFlow() error

RestoreWalletFlow 恢复钱包流程

func (*WalletManager) SendToAddress

func (wm *WalletManager) SendToAddress(address string, amount int64) (string, error)

SendToAddress

func (*WalletManager) ShowConfig

func (wm *WalletManager) ShowConfig() error

查看配置信息

func (*WalletManager) SummaryFollow

func (wm *WalletManager) SummaryFollow() error

SummaryFollow 汇总流程

func (*WalletManager) SummaryWallets

func (wm *WalletManager) SummaryWallets()

SummaryWallets 执行汇总流程

func (*WalletManager) Symbol

func (wm *WalletManager) Symbol() string

Symbol 币种标识

func (*WalletManager) TransferFlow

func (wm *WalletManager) TransferFlow() error

SendTXFlow 发送交易

Jump to

Keyboard shortcuts

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