Documentation ¶
Index ¶
- Constants
- func BasicAuth(username, password string) string
- type BTCBlockScanner
- func (bs *BTCBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []string) error
- func (bs *BTCBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, txid string) ExtractResult
- func (bs *BTCBlockScanner) ExtractTxInput(blockHeight uint64, blockHash string, vin, vinout []gjson.Result, ...) ([]string, decimal.Decimal)
- func (bs *BTCBlockScanner) ExtractTxOutput(blockHeight uint64, blockHash string, trx *gjson.Result, result *ExtractResult) ([]string, decimal.Decimal)
- func (bs *BTCBlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error)
- func (bs *BTCBlockScanner) GetSourceKeyByAddress(address string) (string, bool)
- func (bs *BTCBlockScanner) RescanFailedRecord()
- func (bs *BTCBlockScanner) SaveUnscanRecord(record *UnscanRecord) error
- func (bs *BTCBlockScanner) ScanBlock(height uint64) error
- func (bs *BTCBlockScanner) ScanBlockTask()
- func (bs *BTCBlockScanner) ScanTxMemPool()
- func (bs *BTCBlockScanner) SetRescanBlockHeight(height uint64) error
- type Block
- type BlockchainInfo
- type Client
- type ExtractResult
- type Response
- type SaveResult
- type TransactionDecoder
- func (decoder *TransactionDecoder) CreateRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) SignRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) SubmitRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) VerifyRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
- type UnscanRecord
- type Unspent
- type UnspentSort
- type User
- type WalletConfig
- type WalletManager
- func (wm *WalletManager) AddWalletInSummary(wid string, wallet *openwallet.Wallet)
- func (wm *WalletManager) BackupWallet(walletID string) (string, error)
- func (wm *WalletManager) BackupWalletData(dest string) error
- func (wm *WalletManager) BackupWalletFlow() error
- func (wm *WalletManager) BuildTransaction(utxos []*Unspent, to []string, change string, amount []decimal.Decimal, ...) (string, decimal.Decimal, error)
- func (wm *WalletManager) CreateAddressFlow() error
- func (wm *WalletManager) CreateBatchAddress(name, password string, count uint64) (string, []*openwallet.Address, error)
- func (wm *WalletManager) CreateChangeAddress(walletID string, key *hdkeystore.HDKey) (*openwallet.Address, error)
- func (wm *WalletManager) CreateNewAddress(key *hdkeystore.HDKey) (*openwallet.Address, error)
- func (wm *WalletManager) CreateNewPrivateKey(accountID string, key *owkeychain.ExtendedKey, derivedPath string, ...) (string, *openwallet.Address, error)
- func (wm *WalletManager) CreateNewWallet(name, password string) (*openwallet.Wallet, string, error)
- func (wm *WalletManager) CreateReceiverAddress(account string) (string, error)
- func (wm *WalletManager) CreateWalletFlow() error
- func (wm *WalletManager) CurveType() uint32
- func (wm *WalletManager) Decimal() int32
- func (wm *WalletManager) DeleteUnscanRecord(height uint64) error
- func (wm *WalletManager) DeleteUnscanRecordNotFindTX() error
- func (wm *WalletManager) DumpWallet(filename string) error
- func (wm *WalletManager) EncryptWallet(password string) error
- func (wm *WalletManager) EstimateFee(inputs, outputs int64, feeRate decimal.Decimal) (decimal.Decimal, error)
- func (wm *WalletManager) EstimateFeeRate() (decimal.Decimal, error)
- func (wm *WalletManager) FullName() string
- func (wm *WalletManager) GatherUsdtAddress(wallet *openwallet.Wallet) (map[string]decimal.Decimal, error)
- func (wm *WalletManager) GenerateSeed() []byte
- func (wm *WalletManager) GetAddressBalance(walletID, address string) string
- func (wm *WalletManager) GetAddressDecode() openwallet.AddressDecoder
- func (wm *WalletManager) GetAddressWithBalance(address ...*openwallet.Address) error
- func (wm *WalletManager) GetAddressesByAccount(walletID string) ([]string, error)
- func (wm *WalletManager) GetAddressesFromLocalDB(walletID string, offset, limit int) ([]*openwallet.Address, error)
- func (wm *WalletManager) GetBlock(hash string) (*Block, error)
- func (wm *WalletManager) GetBlockChainInfo() (*BlockchainInfo, error)
- func (wm *WalletManager) GetBlockCount() (int, error)
- func (wm *WalletManager) GetBlockHash(height uint64) (string, error)
- func (wm *WalletManager) GetBlockHeight() (uint64, error)
- func (wm *WalletManager) GetBlockScanner() openwallet.BlockScanner
- func (wm *WalletManager) GetCoreWalletinfo() error
- func (wm *WalletManager) GetLocalBlock(height uint64) (*Block, error)
- func (wm *WalletManager) GetLocalNewBlock() (uint64, string)
- func (wm *WalletManager) GetNetworkInfo() error
- func (wm *WalletManager) GetTransaction(txid string) (*gjson.Result, error)
- func (wm *WalletManager) GetTransactionDecoder() *TransactionDecoder
- func (wm *WalletManager) GetTxIDsInMemPool() ([]string, error)
- func (wm *WalletManager) GetTxOut(txid string, vout uint64) (*gjson.Result, error)
- func (wm *WalletManager) GetUnscanRecords() ([]*UnscanRecord, error)
- func (wm *WalletManager) GetWalletBalance(accountID string) string
- func (wm *WalletManager) GetWalletInfo(walletID string) (*openwallet.Wallet, error)
- func (wm *WalletManager) GetWalletList() error
- func (wm *WalletManager) GetWallets() ([]*openwallet.Wallet, error)
- func (wm *WalletManager) ImportAddress(address *openwallet.Address) error
- func (wm *WalletManager) ImportMulti(addresses []*openwallet.Address, keys []string, watchOnly bool) ([]int, error)
- func (wm *WalletManager) ImportPrivKey(wif, walletID string) error
- func (wm *WalletManager) ImportWallet(filename string) error
- func (wm *WalletManager) ImportWatchOnlyAddress(address ...*openwallet.Address) error
- func (wm *WalletManager) InitConfigFlow() error
- func (wm *WalletManager) InitNodeConfigFlow() error
- func (wm *WalletManager) InstallNodeFlow() error
- func (wm *WalletManager) KeyPoolRefill(keyPoolSize uint64) error
- func (wm *WalletManager) ListUnspent(min uint64, addresses ...string) ([]*Unspent, error)
- func (wm *WalletManager) ListUnspentFromLocalDB(walletID string) ([]*Unspent, error)
- func (wm *WalletManager) LoadConfig() error
- func (wm *WalletManager) LockWallet() error
- func (wm *WalletManager) Omni_Transfer(walletID, password string, from string, to string, feeAddress string, ...) (string, error)
- func (wm *WalletManager) Omni_createTransaction(utxos []*Unspent) (string, decimal.Decimal, error)
- func (wm *WalletManager) Omni_createpayload_simplesend(propertyId int64, amount string) (string, error)
- func (wm *WalletManager) Omni_createrawtx_change(utxos []*Unspent, rawHex, change string, fee float64) (string, error)
- func (wm *WalletManager) Omni_createrawtx_opreturn(rawTx, payload string) (string, error)
- func (wm *WalletManager) Omni_createrawtx_reference(rawHex, receiver string) (string, error)
- func (wm *WalletManager) Omni_getallbalancesforid(propertyid int64) (*gjson.Result, error)
- func (wm *WalletManager) Omni_getbalance(propertyId int64, addr string) (string, error)
- func (wm *WalletManager) RebuildWalletUnspent(walletID string) error
- func (wm *WalletManager) RestartNodeFlow() error
- func (wm *WalletManager) RestoreWallet(keyFile, dbFile, datFile, password string) error
- func (wm *WalletManager) RestoreWalletFlow() error
- func (wm *WalletManager) SaveLocalBlock(block *Block)
- func (wm *WalletManager) SaveLocalNewBlock(blockHeight uint64, blockHash string)
- func (wm *WalletManager) SendBatchTransaction(walletID string, to []string, amounts []decimal.Decimal, password string) (string, error)
- func (wm *WalletManager) SendBtcToUsdtAddress(wallet *openwallet.Wallet, ab map[string]decimal.Decimal) error
- func (wm *WalletManager) SendRawTransaction(txHex string) (string, error)
- func (wm *WalletManager) SendTransaction(walletID, to string, amount decimal.Decimal, password string, ...) ([]string, error)
- func (wm *WalletManager) SetConfigFlow(subCmd string) error
- func (wm *WalletManager) ShowConfig() error
- func (wm *WalletManager) ShowConfigInfo(subCmd string) error
- func (wm *WalletManager) ShowNodeInfo() error
- func (wm *WalletManager) SignRawTransactionInCoreWallet(txHex, walletID string, key *hdkeystore.HDKey, utxos []*Unspent) (string, error)
- func (wm *WalletManager) StartNodeFlow() error
- func (wm *WalletManager) StopNodeFlow() error
- func (wm *WalletManager) SummaryBtc(wid string, wallet *openwallet.Wallet) error
- func (wm *WalletManager) SummaryFollow() error
- func (wm *WalletManager) SummaryUsdt(wallet *openwallet.Wallet, ab map[string]decimal.Decimal) ([]string, error)
- func (wm *WalletManager) SummaryWallets()
- func (wm *WalletManager) Symbol() string
- func (wm *WalletManager) TransferFlow() error
- func (wm *WalletManager) UnlockWallet(passphrase string, seconds int) error
Constants ¶
const ( //币种 Symbol = "USDT" MasterKey = "omnicore 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 BTCBlockScanner ¶
type BTCBlockScanner struct { *openwallet.BlockScannerBase CurrentBlockHeight uint64 //当前区块高度 IsScanMemPool bool //是否扫描交易池 RescanLastBlockCount uint64 //重扫上N个区块数量 // contains filtered or unexported fields }
BTCBlockScanner bitcoin的区块链扫描器
func NewBTCBlockScanner ¶
func NewBTCBlockScanner(wm *WalletManager) *BTCBlockScanner
NewBTCBlockScanner 创建区块链扫描器
func (*BTCBlockScanner) BatchExtractTransaction ¶
func (bs *BTCBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []string) error
BatchExtractTransaction 批量提取交易单 bitcoin 1M的区块链可以容纳3000笔交易,批量多线程处理,速度更快
func (*BTCBlockScanner) ExtractTransaction ¶
func (bs *BTCBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, txid string) ExtractResult
ExtractTransaction 提取交易单
func (*BTCBlockScanner) ExtractTxInput ¶
func (bs *BTCBlockScanner) ExtractTxInput(blockHeight uint64, blockHash string, vin, vinout []gjson.Result, result *ExtractResult) ([]string, decimal.Decimal)
ExtractTxInput 提取交易单输入部分
func (*BTCBlockScanner) ExtractTxOutput ¶
func (bs *BTCBlockScanner) ExtractTxOutput(blockHeight uint64, blockHash string, trx *gjson.Result, result *ExtractResult) ([]string, decimal.Decimal)
ExtractTxInput 提取交易单输入部分
func (*BTCBlockScanner) GetCurrentBlockHeader ¶
func (bs *BTCBlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error)
GetCurrentBlockHeader 获取当前区块高度
func (*BTCBlockScanner) GetSourceKeyByAddress ¶
func (bs *BTCBlockScanner) GetSourceKeyByAddress(address string) (string, bool)
GetSourceKeyByAddress 获取地址对应的数据源标识
func (*BTCBlockScanner) RescanFailedRecord ¶
func (bs *BTCBlockScanner) RescanFailedRecord()
rescanFailedRecord 重扫失败记录
func (*BTCBlockScanner) SaveUnscanRecord ¶
func (bs *BTCBlockScanner) SaveUnscanRecord(record *UnscanRecord) error
SaveTxToWalletDB 保存交易记录到钱包数据库
func (*BTCBlockScanner) ScanBlock ¶
func (bs *BTCBlockScanner) ScanBlock(height uint64) error
ScanBlock 扫描指定高度区块
func (*BTCBlockScanner) ScanBlockTask ¶
func (bs *BTCBlockScanner) ScanBlockTask()
ScanBlockTask 扫描任务
func (*BTCBlockScanner) ScanTxMemPool ¶
func (bs *BTCBlockScanner) ScanTxMemPool()
ScanTxMemPool 扫描交易内存池
func (*BTCBlockScanner) SetRescanBlockHeight ¶
func (bs *BTCBlockScanner) SetRescanBlockHeight(height uint64) error
SetRescanBlockHeight 重置区块链扫描高度
type Block ¶
type BlockchainInfo ¶
type BlockchainInfo struct { Chain string `json:"chain"` Blocks uint64 `json:"blocks"` Headers uint64 `json:"headers"` Bestblockhash string `json:"bestblockhash"` Difficulty string `json:"difficulty"` Mediantime uint64 `json:"mediantime"` Verificationprogress string `json:"verificationprogress"` Chainwork string `json:"chainwork"` Pruned bool `json:"pruned"` }
BlockchainInfo 本地节点区块链信息
func NewBlockchainInfo ¶
func NewBlockchainInfo(json *gjson.Result) *BlockchainInfo
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 ExtractResult ¶
type ExtractResult struct { //Recharges []*openwallet.Recharge TxID string BlockHeight uint64 Success bool // contains filtered or unexported fields }
ExtractResult 扫描完成的提取结果
type SaveResult ¶
SaveResult 保存结果
type TransactionDecoder ¶
type TransactionDecoder struct {
// contains filtered or unexported fields
}
func NewTransactionDecoder ¶
func NewTransactionDecoder(wm *WalletManager) *TransactionDecoder
NewTransactionDecoder 交易单解析器
func (*TransactionDecoder) CreateRawTransaction ¶
func (decoder *TransactionDecoder) CreateRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
CreateRawTransaction 创建交易单
func (*TransactionDecoder) SignRawTransaction ¶
func (decoder *TransactionDecoder) SignRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
SignRawTransaction 签名交易单
func (*TransactionDecoder) SubmitRawTransaction ¶
func (decoder *TransactionDecoder) SubmitRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
SendRawTransaction 广播交易单
func (*TransactionDecoder) VerifyRawTransaction ¶
func (decoder *TransactionDecoder) VerifyRawTransaction(wrapper *openwallet.WalletWrapper, rawTx *openwallet.RawTransaction) error
VerifyRawTransaction 验证交易单,验证交易单并返回加入签名后的交易单
type UnscanRecord ¶
type UnscanRecord struct { ID string `storm:"id"` // primary key BlockHeight uint64 TxID string Reason string }
UnscanRecords 扫描失败的区块及交易
func NewUnscanRecord ¶
func NewUnscanRecord(height uint64, txID, reason string) *UnscanRecord
type Unspent ¶
type Unspent struct { /* { "txid" : "d54994ece1d11b19785c7248868696250ab195605b469632b7bd68130e880c9a", "vout" : 1, "address" : "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe", "account" : "test label", "scriptPubKey" : "76a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac", "amount" : 0.00010000, "confirmations" : 6210, "spendable" : true, "solvable" : true } */ Key string `storm:"id"` TxID string `json:"txid"` Vout uint64 `json:"vout"` Address string `json:"address"` AccountID string `json:"account" storm:"index"` ScriptPubKey string `json:"scriptPubKey"` Amount string `json:"amount"` Confirmations uint64 `json:"confirmations"` Spendable bool `json:"spendable"` Solvable bool `json:"solvable"` HDAddress openwallet.Address }
Unspent 未花记录
func NewUnspent ¶
type UnspentSort ¶
type UnspentSort struct {
// contains filtered or unexported fields
}
func (UnspentSort) Len ¶
func (s UnspentSort) Len() int
func (UnspentSort) Less ¶
func (s UnspentSort) Less(i, j int) bool
func (UnspentSort) Swap ¶
func (s UnspentSort) Swap(i, j int)
type WalletConfig ¶
type WalletConfig struct { //币种 Symbol string MasterKey string //RPC认证账户名 RpcUser string //RPC认证账户密码 RpcPassword string //证书目录 CertsDir string //rpc证书 CertFileName string //区块链数据文件 BlockchainFile string //是否测试网络 IsTestNet bool // 核心钱包是否只做监听 CoreWalletWatchOnly bool //最大的输入数量 MaxTxInputs int //钱包服务API ServerAPI string //钱包安装的路径 NodeInstallPath string //钱包数据文件目录 WalletDataPath string //汇总阀值 Threshold decimal.Decimal //汇总地址 SumAddress string //汇总执行间隔时间 CycleSeconds time.Duration //默认配置内容 DefaultConfig string //曲线类型 CurveType uint32 //小数位长度 CoinDecimal decimal.Decimal //支付手续费地址 FeeAdddress string //资产ID PropertyID int64 //debug Debug bool // contains filtered or unexported fields }
func NewConfig ¶
func NewConfig(symbol string, masterKey string) *WalletConfig
func (*WalletConfig) PrintConfig ¶
func (wc *WalletConfig) PrintConfig() error
printConfig Print config information
type WalletManager ¶
type WalletManager struct { Storage *hdkeystore.HDKeystore //秘钥存取 WalletClient *Client // 节点客户端 Config *WalletConfig //钱包管理配置 WalletsInSum map[string]*openwallet.Wallet //参与汇总的钱包 Blockscanner *BTCBlockScanner //区块扫描器 Decoder openwallet.AddressDecoder //地址编码器 TxDecoder *TransactionDecoder //交易单编码器 }
func NewWalletManager ¶
func NewWalletManager() *WalletManager
func (*WalletManager) AddWalletInSummary ¶
func (wm *WalletManager) AddWalletInSummary(wid string, wallet *openwallet.Wallet)
AddWalletInSummary 添加汇总钱包账户
func (*WalletManager) BackupWallet ¶
func (wm *WalletManager) BackupWallet(walletID string) (string, error)
BackupWallet 备份数据
func (*WalletManager) BackupWalletData ¶
func (wm *WalletManager) BackupWalletData(dest string) error
BackupWalletData 备份钱包
func (*WalletManager) BuildTransaction ¶
func (wm *WalletManager) BuildTransaction(utxos []*Unspent, to []string, change string, amount []decimal.Decimal, fees decimal.Decimal) (string, decimal.Decimal, error)
BuildTransaction 构建交易单
func (*WalletManager) CreateBatchAddress ¶
func (wm *WalletManager) CreateBatchAddress(name, password string, count uint64) (string, []*openwallet.Address, error)
CreateBatchAddress 批量创建地址
func (*WalletManager) CreateChangeAddress ¶
func (wm *WalletManager) CreateChangeAddress(walletID string, key *hdkeystore.HDKey) (*openwallet.Address, error)
CreateChangeAddress 创建找零地址
func (*WalletManager) CreateNewAddress ¶
func (wm *WalletManager) CreateNewAddress(key *hdkeystore.HDKey) (*openwallet.Address, error)
CreateNewAddress 给指定账户创建地址
func (*WalletManager) CreateNewPrivateKey ¶
func (wm *WalletManager) CreateNewPrivateKey(accountID string, key *owkeychain.ExtendedKey, derivedPath string, index uint64) (string, *openwallet.Address, error)
CreateNewPrivateKey 创建私钥,返回私钥wif格式字符串
func (*WalletManager) CreateNewWallet ¶
func (wm *WalletManager) CreateNewWallet(name, password string) (*openwallet.Wallet, string, error)
CreateNewWallet 创建钱包
func (*WalletManager) CreateReceiverAddress ¶
func (wm *WalletManager) CreateReceiverAddress(account string) (string, error)
CreateReceiverAddress 给指定账户创建地址
func (*WalletManager) DeleteUnscanRecord ¶
func (wm *WalletManager) DeleteUnscanRecord(height uint64) error
DeleteUnscanRecord 删除指定高度的未扫记录
func (*WalletManager) DeleteUnscanRecordNotFindTX ¶
func (wm *WalletManager) DeleteUnscanRecordNotFindTX() error
DeleteUnscanRecordNotFindTX 删除未没有找到交易记录的重扫记录
func (*WalletManager) DumpWallet ¶
func (wm *WalletManager) DumpWallet(filename string) error
DumpWallet 导出钱包所有私钥文件
func (*WalletManager) EncryptWallet ¶
func (wm *WalletManager) EncryptWallet(password string) error
EncryptWallet 通过密码加密钱包,只在第一次加密码时才有效
func (*WalletManager) EstimateFee ¶
func (wm *WalletManager) EstimateFee(inputs, outputs int64, feeRate decimal.Decimal) (decimal.Decimal, error)
EstimateFee 预估手续费
func (*WalletManager) EstimateFeeRate ¶
func (wm *WalletManager) EstimateFeeRate() (decimal.Decimal, error)
EstimateFeeRate 预估的没KB手续费率
func (*WalletManager) GatherUsdtAddress ¶
func (wm *WalletManager) GatherUsdtAddress(wallet *openwallet.Wallet) (map[string]decimal.Decimal, error)
func (*WalletManager) GenerateSeed ¶
func (wm *WalletManager) GenerateSeed() []byte
generateSeed 创建种子
func (*WalletManager) GetAddressBalance ¶
func (wm *WalletManager) GetAddressBalance(walletID, address string) string
GetAddressBalance 获取地址余额
func (*WalletManager) GetAddressDecode ¶
func (wm *WalletManager) GetAddressDecode() openwallet.AddressDecoder
AddressDecode 地址解析器
func (*WalletManager) GetAddressWithBalance ¶
func (wm *WalletManager) GetAddressWithBalance(address ...*openwallet.Address) error
GetAddressWithBalance
func (*WalletManager) GetAddressesByAccount ¶
func (wm *WalletManager) GetAddressesByAccount(walletID string) ([]string, error)
func (*WalletManager) GetAddressesFromLocalDB ¶
func (wm *WalletManager) GetAddressesFromLocalDB(walletID string, offset, limit int) ([]*openwallet.Address, error)
GetAddressesFromLocalDB 从本地数据库
func (*WalletManager) GetBlock ¶
func (wm *WalletManager) GetBlock(hash string) (*Block, error)
GetBlock 获取区块数据
func (*WalletManager) GetBlockChainInfo ¶
func (wm *WalletManager) GetBlockChainInfo() (*BlockchainInfo, error)
GetBlockChainInfo 获取钱包区块链信息
func (*WalletManager) GetBlockCount ¶
func (wm *WalletManager) GetBlockCount() (int, error)
func (*WalletManager) GetBlockHash ¶
func (wm *WalletManager) GetBlockHash(height uint64) (string, error)
GetBlockHash 根据区块高度获得区块hash
func (*WalletManager) GetBlockHeight ¶
func (wm *WalletManager) GetBlockHeight() (uint64, error)
GetBlockHeight 获取区块链高度
func (*WalletManager) GetBlockScanner ¶
func (wm *WalletManager) GetBlockScanner() openwallet.BlockScanner
GetBlockScanner 获取区块链
func (*WalletManager) GetCoreWalletinfo ¶
func (wm *WalletManager) GetCoreWalletinfo() error
GetCoreWalletinfo 获取核心钱包节点信息
func (*WalletManager) GetLocalBlock ¶
func (wm *WalletManager) GetLocalBlock(height uint64) (*Block, error)
GetLocalBlock 获取本地区块数据
func (*WalletManager) GetLocalNewBlock ¶
func (wm *WalletManager) GetLocalNewBlock() (uint64, string)
GetLocalNewBlock 获取本地记录的区块高度和hash
func (*WalletManager) GetNetworkInfo ¶
func (wm *WalletManager) GetNetworkInfo() error
GetNetworkInfo 获取网络信息
func (*WalletManager) GetTransaction ¶
func (wm *WalletManager) GetTransaction(txid string) (*gjson.Result, error)
GetTransaction 获取交易单
func (*WalletManager) GetTransactionDecoder ¶
func (wm *WalletManager) GetTransactionDecoder() *TransactionDecoder
TransactionDecoder 交易单解析器
func (*WalletManager) GetTxIDsInMemPool ¶
func (wm *WalletManager) GetTxIDsInMemPool() ([]string, error)
GetTxIDsInMemPool 获取待处理的交易池中的交易单IDs
func (*WalletManager) GetUnscanRecords ¶
func (wm *WalletManager) GetUnscanRecords() ([]*UnscanRecord, error)
获取未扫记录
func (*WalletManager) GetWalletBalance ¶
func (wm *WalletManager) GetWalletBalance(accountID string) string
GetWalletBalance 获取钱包余额
func (*WalletManager) GetWalletInfo ¶
func (wm *WalletManager) GetWalletInfo(walletID string) (*openwallet.Wallet, error)
GetWalletInfo 获取钱包列表
func (*WalletManager) GetWalletList ¶
func (wm *WalletManager) GetWalletList() error
GetWalletList 获取钱包列表
func (*WalletManager) GetWallets ¶
func (wm *WalletManager) GetWallets() ([]*openwallet.Wallet, error)
GetWallets 获取钱包列表
func (*WalletManager) ImportAddress ¶
func (wm *WalletManager) ImportAddress(address *openwallet.Address) error
ImportAddress 导入地址核心钱包
func (*WalletManager) ImportMulti ¶
func (wm *WalletManager) ImportMulti(addresses []*openwallet.Address, keys []string, watchOnly bool) ([]int, error)
ImportMulti 批量导入地址和私钥
func (*WalletManager) ImportPrivKey ¶
func (wm *WalletManager) ImportPrivKey(wif, walletID string) error
ImportPrivKey 导入私钥
func (*WalletManager) ImportWallet ¶
func (wm *WalletManager) ImportWallet(filename string) error
ImportWallet 导入钱包私钥文件
func (*WalletManager) ImportWatchOnlyAddress ¶
func (wm *WalletManager) ImportWatchOnlyAddress(address ...*openwallet.Address) error
ImportWatchOnlyAddress 导入观测地址
func (*WalletManager) InitNodeConfigFlow ¶
func (wm *WalletManager) InitNodeConfigFlow() error
InitNodeConfig 初始化节点配置文件
func (*WalletManager) InstallNodeFlow ¶
func (wm *WalletManager) InstallNodeFlow() error
InstallNode 安装节点
func (*WalletManager) KeyPoolRefill ¶
func (wm *WalletManager) KeyPoolRefill(keyPoolSize uint64) error
KeyPoolRefill 重新填充私钥池
func (*WalletManager) ListUnspent ¶
func (wm *WalletManager) ListUnspent(min uint64, addresses ...string) ([]*Unspent, error)
ListUnspent 获取未花记录
func (*WalletManager) ListUnspentFromLocalDB ¶
func (wm *WalletManager) ListUnspentFromLocalDB(walletID string) ([]*Unspent, error)
ListUnspentFromLocalDB 查询本地数据库的未花记录
func (*WalletManager) Omni_Transfer ¶
func (wm *WalletManager) Omni_Transfer(walletID, password string, from string, to string, feeAddress string, amount string) (string, error)
将有余额的地址的btc汇总到手续费地址,usdt汇总到汇总地址
func (*WalletManager) Omni_createTransaction ¶
func (*WalletManager) Omni_createpayload_simplesend ¶
func (wm *WalletManager) Omni_createpayload_simplesend(propertyId int64, amount string) (string, error)
func (*WalletManager) Omni_createrawtx_change ¶
func (*WalletManager) Omni_createrawtx_opreturn ¶
func (wm *WalletManager) Omni_createrawtx_opreturn(rawTx, payload string) (string, error)
func (*WalletManager) Omni_createrawtx_reference ¶
func (wm *WalletManager) Omni_createrawtx_reference(rawHex, receiver string) (string, error)
func (*WalletManager) Omni_getallbalancesforid ¶
func (wm *WalletManager) Omni_getallbalancesforid(propertyid int64) (*gjson.Result, error)
func (*WalletManager) Omni_getbalance ¶
func (wm *WalletManager) Omni_getbalance(propertyId int64, addr string) (string, error)
func (*WalletManager) RebuildWalletUnspent ¶
func (wm *WalletManager) RebuildWalletUnspent(walletID string) error
RebuildWalletUnspent 批量插入未花记录到本地
func (*WalletManager) RestartNodeFlow ¶
func (wm *WalletManager) RestartNodeFlow() error
RestartNodeFlow 重启节点
func (*WalletManager) RestoreWallet ¶
func (wm *WalletManager) RestoreWallet(keyFile, dbFile, datFile, password string) error
RestoreWallet 恢复钱包
func (*WalletManager) RestoreWalletFlow ¶
func (wm *WalletManager) RestoreWalletFlow() error
RestoreWalletFlow 恢复钱包流程
func (*WalletManager) SaveLocalBlock ¶
func (wm *WalletManager) SaveLocalBlock(block *Block)
SaveLocalBlock 记录本地新区块
func (*WalletManager) SaveLocalNewBlock ¶
func (wm *WalletManager) SaveLocalNewBlock(blockHeight uint64, blockHash string)
SaveLocalNewBlock 记录区块高度和hash到本地
func (*WalletManager) SendBatchTransaction ¶
func (wm *WalletManager) SendBatchTransaction(walletID string, to []string, amounts []decimal.Decimal, password string) (string, error)
SendBatchTransaction 发送批量交易
func (*WalletManager) SendBtcToUsdtAddress ¶
func (wm *WalletManager) SendBtcToUsdtAddress(wallet *openwallet.Wallet, ab map[string]decimal.Decimal) error
func (*WalletManager) SendRawTransaction ¶
func (wm *WalletManager) SendRawTransaction(txHex string) (string, error)
SendRawTransaction 广播交易
func (*WalletManager) SendTransaction ¶
func (wm *WalletManager) SendTransaction(walletID, to string, amount decimal.Decimal, password string, feesInSender bool) ([]string, error)
SendTransaction 发送交易
func (*WalletManager) SetConfigFlow ¶
func (wm *WalletManager) SetConfigFlow(subCmd string) error
SetConfigFlow 初始化配置流程
func (*WalletManager) ShowConfigInfo ¶
func (wm *WalletManager) ShowConfigInfo(subCmd string) error
ShowConfigInfo 查看配置信息
func (*WalletManager) ShowNodeInfo ¶
func (wm *WalletManager) ShowNodeInfo() error
ShowNodeInfo 显示节点信息
func (*WalletManager) SignRawTransactionInCoreWallet ¶
func (wm *WalletManager) SignRawTransactionInCoreWallet(txHex, walletID string, key *hdkeystore.HDKey, utxos []*Unspent) (string, error)
SignRawTransactionInCoreWallet 钱包交易单
func (*WalletManager) StartNodeFlow ¶
func (wm *WalletManager) StartNodeFlow() error
StartNodeFlow 开启节点
func (*WalletManager) StopNodeFlow ¶
func (wm *WalletManager) StopNodeFlow() error
StopNodeFlow 关闭节点
func (*WalletManager) SummaryBtc ¶
func (wm *WalletManager) SummaryBtc(wid string, wallet *openwallet.Wallet) error
汇总个btc
func (*WalletManager) SummaryFollow ¶
func (wm *WalletManager) SummaryFollow() error
SummaryFollow 汇总流程
func (*WalletManager) SummaryUsdt ¶
func (wm *WalletManager) SummaryUsdt(wallet *openwallet.Wallet, ab map[string]decimal.Decimal) ([]string, error)
汇总usdt
func (*WalletManager) SummaryWallets ¶
func (wm *WalletManager) SummaryWallets()
SummaryWallets 执行汇总流程
func (*WalletManager) UnlockWallet ¶
func (wm *WalletManager) UnlockWallet(passphrase string, seconds int) error
UnlockWallet 解锁钱包