Documentation ¶
Index ¶
- Constants
- func BasicAuth(username, password string) string
- type Address
- type Balance
- type Client
- type ClientInterface
- type WalletConfig
- type WalletManager
- func (wm *WalletManager) BackupWallet() (string, error)
- func (wm *WalletManager) BackupWalletFlow() error
- func (wm *WalletManager) CreateAddressFlow() error
- func (wm *WalletManager) CreateBatchAddress(count uint64) (string, []*Address, error)
- func (wm *WalletManager) CreateWalletFlow() error
- func (wm *WalletManager) CurveType() uint32
- func (wm *WalletManager) Decimal() int32
- func (wm *WalletManager) FullName() string
- func (wm *WalletManager) GetAssetsLogger() *log.OWLogger
- func (wm *WalletManager) GetBalance() (*Balance, error)
- func (wm *WalletManager) GetChangeAddress() (*Address, error)
- func (wm *WalletManager) GetInfo() (*gjson.Result, error)
- func (wm *WalletManager) GetNewAddress() (*Address, error)
- func (wm *WalletManager) GetWalletList() error
- func (wm *WalletManager) InitAssetsConfig() (config.Configer, error)
- func (wm *WalletManager) InitConfigFlow() error
- func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error
- func (wm *WalletManager) LoadConfig() error
- func (wm *WalletManager) RestoreWallet(keyFile string, confFile string) error
- func (wm *WalletManager) RestoreWalletFlow() error
- func (wm *WalletManager) SendToAddress(address string, amount int64) (string, error)
- func (wm *WalletManager) ShowConfig() error
- func (wm *WalletManager) SummaryFollow() error
- func (wm *WalletManager) SummaryWallets()
- func (wm *WalletManager) Symbol() string
- func (wm *WalletManager) TransferFlow() error
Constants ¶
const ( //币种 Symbol = "GBYTE" MasterKey = "masterkey seed" CurveType = owcrypt.ECC_CURVE_SECP256K1 )
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
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 Balance ¶
func NewBalance ¶
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.
type ClientInterface ¶
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) 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) CreateBatchAddress ¶
func (wm *WalletManager) CreateBatchAddress(count uint64) (string, []*Address, error)
CreateBatchAddress 批量创建地址
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) 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) LoadAssetsConfig ¶
func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error
LoadAssetsConfig 加载外部配置
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) SummaryFollow ¶
func (wm *WalletManager) SummaryFollow() error
SummaryFollow 汇总流程
func (*WalletManager) SummaryWallets ¶
func (wm *WalletManager) SummaryWallets()
SummaryWallets 执行汇总流程