Documentation ¶
Index ¶
- Constants
- func AddWalletInSummary(wid string, wallet *AccountBalance)
- func BackupWallet() (string, error)
- func BuildSummaryTransaction(to, assetsID string, amount uint64, utxo []*Unspent) (string, error)
- func BuildTransaction(from, to, assetsID string, amount, fees uint64) (string, error)
- func CreateBatchAddress(alias, accountID string, count uint64) (string, error)
- func EstimateTransactionGas(txForm string) (uint64, error)
- func GetTransactions(accountID string) (string, error)
- func RestoreWallet(keystore []byte) error
- func SendSummaryTransaction(accountID, to, assetsID string, password string) ([]string, error)
- func SendTransaction(accountID, to, assetsID string, amount uint64, password string, ...) (string, error)
- func SignMessage(address, message, password string) (string, error)
- func SignTransaction(txForm, password string) (string, error)
- func SubmitTransaction(txRaw string) (string, error)
- func SummaryWallets()
- type Account
- type AccountBalance
- type Address
- type Client
- type Response
- type Unspent
- type Wallet
- type WalletManager
- func (w *WalletManager) BackupWalletFlow() error
- func (w *WalletManager) BuildImage() error
- func (w *WalletManager) ConfigMerchantWallet(wallet *openwallet.Wallet) error
- func (w *WalletManager) CreateAddressFlow() error
- func (w *WalletManager) CreateMerchantAddress(walletID string, count int) ([]*openwallet.Address, error)
- func (w *WalletManager) CreateMerchantWallet(alias string, password string) (*openwallet.Wallet, error)
- func (w *WalletManager) CreateWalletFlow() error
- func (w *WalletManager) GetMerchantAddressList(walletID string, offset uint64, limit uint64) ([]*openwallet.Address, error)
- func (w *WalletManager) GetMerchantWalletList() ([]*openwallet.Wallet, error)
- func (w *WalletManager) GetWalletList() error
- func (w *WalletManager) ImportMerchantAddress(addresses []*openwallet.Address) error
- func (w *WalletManager) InitConfigFlow() error
- func (w *WalletManager) InitNodeConfig() error
- func (w *WalletManager) LoginContainer() error
- func (w *WalletManager) RestoreWalletFlow() error
- func (w *WalletManager) RunContainer() error
- func (w *WalletManager) RunFullNode() error
- func (w *WalletManager) SetConfigFlow(subCmd string) error
- func (w *WalletManager) ShowConfig() error
- func (w *WalletManager) ShowConfigInfo(subCmd string) error
- func (w *WalletManager) SummaryFollow() error
- func (w *WalletManager) TransferFlow() error
Constants ¶
const (
//币种
Symbol = "BTM"
)
Variables ¶
This section is empty.
Functions ¶
func AddWalletInSummary ¶
func AddWalletInSummary(wid string, wallet *AccountBalance)
AddWalletInSummary 添加汇总钱包账户
func BuildSummaryTransaction ¶
BuildSummaryTransaction 创建汇总交易单
func BuildTransaction ¶
CreateReceiverAddress 给指定账户创建地址
func CreateBatchAddress ¶
CreateBatchAddress 批量创建地址
func EstimateTransactionGas ¶
GetTransactions 获取交易列表
func GetTransactions ¶
GetTransactions 获取交易列表
func SendSummaryTransaction ¶
func SendTransaction ¶
func SendTransaction(accountID, to, assetsID string, amount uint64, password string, feesInSender bool) (string, error)
SendTransaction 发送交易
func SignMessage ¶
SignMessage 消息签名
func SignTransaction ¶
SignTransaction 签名交易
func SubmitTransaction ¶
SubmitTransaction 提交新交易单
Types ¶
type Account ¶
type Account struct { Alias string `json:"alias"` ID string `json:"id"` KeyIndex int64 `json:"key_index"` Quorum int64 `json:"quorum"` XPubs []string `json:"xpubs"` }
func CreateNormalAccount ¶
CreateNormalAccount 创建一个单签普通账户
func NewAccount ¶
type AccountBalance ¶
type AccountBalance struct { AccountID string `json:"account_id"` Alias string `json:"account_alias"` AssetAlias string `json:"asset_alias"` AssetID string `json:"asset_id"` Amount uint64 `json:"amount"` Password string }
AccountBalance account balance
func GetAccountBalance ¶
func GetAccountBalance(accountID string, assetsID string) ([]*AccountBalance, error)
GetAccountBalance 获取账户资产
func GetWalletList ¶
func GetWalletList(assetsID string) ([]*AccountBalance, error)
GetWalletList 获取钱包资产信息列表
func NewAccountBalance ¶
func NewAccountBalance(json gjson.Result) *AccountBalance
type Address ¶
func CreateReceiverAddress ¶
CreateReceiverAddress 给指定账户创建地址
func GetAddressInfo ¶
GetAddressInfo 获取指定账户的所有地址
type Client ¶
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 Unspent ¶
type Unspent struct { AccountId string Address string Amount uint64 AssetId string Change bool ControlProgramIndex uint64 Id string Program string SourceId string SourcePos uint64 ValidHeight uint64 }
func ListUnspent ¶
ListUnspent 获取指定账户的utxo
func NewUnspent ¶
type Wallet ¶
type Wallet struct { WalletID string `json:"walletID"` Alias string `json:"alias"` Balance string `json:"balance"` AccountsNumber uint64 `json:"accountsNumber"` Password string `json:"password"` PublicKey string `json:"xpub"` }
Wallet 钱包模型
func CreateNewWallet ¶
CreateNewWallet 创建钱包
type WalletManager ¶
type WalletManager struct{}
func (*WalletManager) BuildImage ¶
func (w *WalletManager) BuildImage() error
func (*WalletManager) ConfigMerchantWallet ¶
func (w *WalletManager) ConfigMerchantWallet(wallet *openwallet.Wallet) error
ConfigMerchantWallet 钱包工具配置接口
func (*WalletManager) CreateMerchantAddress ¶
func (w *WalletManager) CreateMerchantAddress(walletID string, count int) ([]*openwallet.Address, error)
CreateMerchantAddress 创建钱包地址
func (*WalletManager) CreateMerchantWallet ¶
func (w *WalletManager) CreateMerchantWallet(alias string, password string) (*openwallet.Wallet, error)
CreateMerchantWallet 创建钱包
func (*WalletManager) GetMerchantAddressList ¶
func (w *WalletManager) GetMerchantAddressList(walletID string, offset uint64, limit uint64) ([]*openwallet.Address, error)
GetMerchantAddressList 获取钱包地址
func (*WalletManager) GetMerchantWalletList ¶
func (w *WalletManager) GetMerchantWalletList() ([]*openwallet.Wallet, error)
GetMerchantWalletList 获取钱包列表
func (*WalletManager) GetWalletList ¶
func (w *WalletManager) GetWalletList() error
GetWalletList 获取钱包列表
func (*WalletManager) ImportMerchantAddress ¶
func (w *WalletManager) ImportMerchantAddress(addresses []*openwallet.Address) error
ImportMerchantAddress 导入地址
func (*WalletManager) InitNodeConfig ¶
func (w *WalletManager) InitNodeConfig() error
func (*WalletManager) RestoreWalletFlow ¶
func (w *WalletManager) RestoreWalletFlow() error
RestoreWalletFlow 恢复钱包流程
func (*WalletManager) SetConfigFlow ¶
func (w *WalletManager) SetConfigFlow(subCmd string) error
SetConfigFlow 初始化配置流程
func (*WalletManager) ShowConfigInfo ¶
func (w *WalletManager) ShowConfigInfo(subCmd string) error
ShowConfigInfo 查看配置信息
func (*WalletManager) SummaryFollow ¶
func (w *WalletManager) SummaryFollow() error
SummaryFollow 汇总流程