Documentation ¶
Index ¶
- Constants
- type AddressCreateResult
- type ApiClient
- func (c *ApiClient) CreateAddress() (string, error)
- func (c *ApiClient) CreateBatchAddress(count, workerSize uint64) ([]string, error)
- func (c *ApiClient) GetAddressBalance(address string) (string, error)
- func (c *ApiClient) GetAddressList() ([]string, error)
- func (c *ApiClient) GetBlockByHash(hash string) (*Block, error)
- func (c *ApiClient) GetBlockByHeight(height uint64) (*Block, error)
- func (c *ApiClient) GetTransaction(txid string) (*Transaction, error)
- func (c *ApiClient) GetTransactionsByHeight(height uint64) ([]*Transaction, error)
- func (c *ApiClient) GetWalletStatus() (*WalletStatus, error)
- func (c *ApiClient) SendTransaction(to, amount, paymentId string) (string, error)
- func (c *ApiClient) ValidateAddress(address string) bool
- type Block
- type Client
- func (c *Client) CreateBatchAddress(count, workerSize uint64) ([]string, error)
- func (c *Client) GetAddressBalance(address string) (string, error)
- func (c *Client) GetBlockByHeight(height uint64) (*Block, error)
- func (c *Client) GetTransaction(txid string) (*Transaction, error)
- func (c *Client) GetTransactionsByHeight(height uint64) ([]*Transaction, error)
- func (c *Client) GetWalletAddress() ([]string, error)
- func (c *Client) GetWalletBalance() (*openwallet.Balance, error)
- func (c *Client) GetWalletStatus() (*WalletStatus, error)
- func (c *Client) SummaryToAddress(summaryAddress string) (string, string, string, error)
- func (c *Client) TransFCoin(toAddress, toAmount, paymentId string) (string, error)
- func (c *Client) ValidateAddress(address string) (bool, error)
- type ExtractResult
- type NinjaBlockScanner
- func (bs *NinjaBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []walletapi.Transaction, ...) error
- func (bs *NinjaBlockScanner) DeleteUnscanRecord(height uint64) error
- func (bs *NinjaBlockScanner) DeleteUnscanRecordNotFindTX() error
- func (bs *NinjaBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, tx walletapi.Transaction, ...) ExtractResult
- func (bs *NinjaBlockScanner) ExtractTransactionData(txid string, scanAddressFunc openwallet.BlockScanTargetFunc) (map[string][]*openwallet.TxExtractData, error)
- func (bs *NinjaBlockScanner) GetBalanceByAddress(address ...string) ([]*openwallet.Balance, error)
- func (bs *NinjaBlockScanner) GetBlockByHeight(height uint64) (*Block, error)
- func (bs *NinjaBlockScanner) GetCurrentBlock() (*WalletStatus, error)
- func (bs *NinjaBlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error)
- func (bs *NinjaBlockScanner) GetGlobalMaxBlockHeight() uint64
- func (bs *NinjaBlockScanner) GetLocalBlock(height uint64) (*openwallet.BlockHeader, error)
- func (bs *NinjaBlockScanner) GetLocalBlockHead() (uint64, string, error)
- func (bs *NinjaBlockScanner) GetLocalNewBlock() (uint64, string, error)
- func (bs *NinjaBlockScanner) GetScannedBlockHeader() (*openwallet.BlockHeader, error)
- func (bs *NinjaBlockScanner) GetScannedBlockHeight() uint64
- func (bs *NinjaBlockScanner) GetUnscanRecords() ([]*openwallet.UnscanRecord, error)
- func (bs *NinjaBlockScanner) InitExtractResult(tx walletapi.Transaction, feePayed string, blockHeight uint64, ...)
- func (bs *NinjaBlockScanner) Pause() error
- func (bs *NinjaBlockScanner) RescanFailedRecord()
- func (bs *NinjaBlockScanner) Restart() error
- func (bs *NinjaBlockScanner) Run() error
- func (bs *NinjaBlockScanner) SaveLocalBlock(blockHeader *openwallet.BlockHeader) error
- func (bs *NinjaBlockScanner) SaveLocalBlockHead(blockHeight uint64, blockHash string) error
- func (bs *NinjaBlockScanner) SaveLocalNewBlock(blockHeight uint64, blockHash string) error
- func (bs *NinjaBlockScanner) SaveUnscanRecord(record *openwallet.UnscanRecord) error
- func (bs *NinjaBlockScanner) ScanBlock(height uint64) error
- func (bs *NinjaBlockScanner) ScanBlockTask()
- func (bs *NinjaBlockScanner) SetRescanBlockHeight(height uint64) error
- func (bs *NinjaBlockScanner) Stop() error
- func (bs *NinjaBlockScanner) SupportBlockchainDAI() bool
- type SaveResult
- type Server
- func (server *Server) Close()
- func (server *Server) GetAddressBalance(ctx *owtp.Context)
- func (server *Server) GetWalletStatus(ctx *owtp.Context)
- func (server *Server) Listen()
- func (server *Server) SetConnectHandler(h func(node *Server, nodeInfo *TrustNodeInfo))
- func (server *Server) SetDisconnectHandler(h func(node *Server, nodeID string))
- type Transaction
- type TransactionDecoder
- func (decoder *TransactionDecoder) CreateRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) CreateSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransaction, error)
- func (decoder *TransactionDecoder) CreateSummaryRawTransactionWithError(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)
- func (decoder *TransactionDecoder) GetRawTransactionFeeRate() (feeRate string, unit string, err error)
- func (decoder *TransactionDecoder) SignRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) SubmitRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) (*openwallet.Transaction, error)
- func (decoder *TransactionDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- type TrustNodeInfo
- type WalletConfig
- type WalletManager
- func (wm *WalletManager) BackupWalletData() error
- func (wm *WalletManager) BalanceModelType() openwallet.BalanceModelType
- func (wm WalletManager) CreateLocalWalletAddress(count, workerSize uint64) ([]string, error)
- func (wm WalletManager) CreateRemoteWalletAddress(count, workerSize uint64) ([]string, error)
- func (wm *WalletManager) CurveType() uint32
- func (wm *WalletManager) Decimal() int32
- func (wm *WalletManager) FullName() string
- func (wm *WalletManager) GetAddressDecode() openwallet.AddressDecoder
- func (wm *WalletManager) GetAssetsLogger() *log.OWLogger
- func (wm *WalletManager) GetBlockScanner() openwallet.BlockScanner
- func (wm WalletManager) GetLocalWalletAddress() ([]string, error)
- func (wm WalletManager) GetLocalWalletBalance() (*openwallet.Balance, error)
- func (wm WalletManager) GetRemoteBlockByHeight(height uint64) (*Block, error)
- func (wm WalletManager) GetRemoteWalletAddress() ([]string, error)
- func (wm WalletManager) GetRemoteWalletBalance() (*openwallet.Balance, error)
- func (wm *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder
- func (wm *WalletManager) GetTransaction(txid string) (*Transaction, error)
- func (wm *WalletManager) GetTransactionDecoder() openwallet.TransactionDecoder
- func (wm *WalletManager) GetTransactionsByHeight(height uint64) ([]*Transaction, error)
- func (wm *WalletManager) InitAssetsConfig() (config.Configer, error)
- func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error
- func (wm *WalletManager) SetupLog(logDir, logFile string, debug bool)
- func (wm *WalletManager) StartSummaryWallet() error
- func (wm *WalletManager) SummaryWalletProcess(summaryToAddress string) (string, string, string, error)
- func (wm *WalletManager) SummaryWalletProcessRemote(summaryToAddress string) (string, string, string, error)
- func (wm *WalletManager) SummaryWallets()
- func (wm *WalletManager) Symbol() string
- func (wm *WalletManager) TransferCoinRemote(toAddress, toAmount, paymentId string) (string, error)
- func (wm *WalletManager) ValidateAddress(address string) bool
- func (wm *WalletManager) ValidateAddressRemote(address string) (bool, error)
- type WalletStatus
Constants ¶
const ( //币种 Symbol = "NINJA" Decimal = 5 CurveType = owcrypt.ECC_CURVE_ED25519 //交易单发送超时时限 DefaultTxSendingTimeout = 5 * time.Minute )
const ( TxStatusPending = 0 TxStatusInProgress = 1 TxStatusCanceled = 2 TxStatusCompleted = 3 TxStatusFailed = 4 TxStatusRegistering = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressCreateResult ¶
type ApiClient ¶
type ApiClient struct {
WalletAPI, BlockAPI string
Debug bool
BlockClient *req.Req
WalletClient *walletapi.WalletAPI
}
A Client is a Bitcoin RPC BlockClient. 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 NewWalletClient ¶
func (*ApiClient) CreateBatchAddress ¶
CreateBatchAddress 批量创建地址 @count 连续创建数量 @workerSize 并行线程数。建议20条。
func (*ApiClient) GetAddressBalance ¶
获取地址余额
func (*ApiClient) GetAddressList ¶
GetAddressList
func (*ApiClient) GetBlockByHash ¶
GetBlockByHash
func (*ApiClient) GetBlockByHeight ¶
GetBlockByHeight
func (*ApiClient) GetTransaction ¶
func (c *ApiClient) GetTransaction(txid string) (*Transaction, error)
GetTransaction
func (*ApiClient) GetTransactionsByHeight ¶
func (c *ApiClient) GetTransactionsByHeight(height uint64) ([]*Transaction, error)
GetTransactionsByHeight
func (*ApiClient) GetWalletStatus ¶
func (c *ApiClient) GetWalletStatus() (*WalletStatus, error)
GetWalletStatus
func (*ApiClient) SendTransaction ¶
SendTransaction
type Block ¶
type Block struct { Hash string PrevBlockHash string Height uint64 Txs []walletapi.Transaction }
func (*Block) BlockHeader ¶
func (b *Block) BlockHeader(symbol string) *openwallet.BlockHeader
BlockHeader 区块链头
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(wm *WalletManager) (*Client, error)
func (*Client) CreateBatchAddress ¶
CreateBatchAddress
func (*Client) GetAddressBalance ¶
验证地址
func (*Client) GetBlockByHeight ¶
GetBlockByHeight
func (*Client) GetTransaction ¶
func (c *Client) GetTransaction(txid string) (*Transaction, error)
GetTransaction
func (*Client) GetTransactionsByHeight ¶
func (c *Client) GetTransactionsByHeight(height uint64) ([]*Transaction, error)
GetTransactionsByHeight
func (*Client) GetWalletAddress ¶
GetWalletAddress
func (*Client) GetWalletBalance ¶
func (c *Client) GetWalletBalance() (*openwallet.Balance, error)
GetWalletBalance
func (*Client) GetWalletStatus ¶
func (c *Client) GetWalletStatus() (*WalletStatus, error)
GetWalletStatus 获取钱包当前状态
func (*Client) SummaryToAddress ¶
打币
func (*Client) TransFCoin ¶
打币
type ExtractResult ¶
type ExtractResult struct { TxID string BlockHeight uint64 Success bool // contains filtered or unexported fields }
//ExtractResult 扫描完成的提取结果
type NinjaBlockScanner ¶
type NinjaBlockScanner struct { *openwallet.BlockScannerBase CurrentBlockHeight uint64 //当前区块高度 RescanLastBlockCount uint64 //重扫上N个区块数量 // contains filtered or unexported fields }
func NewNinjaBlockScanner ¶
func NewNinjaBlockScanner(wm *WalletManager) *NinjaBlockScanner
// NewEOSBlockScanner create a block scanner
func (*NinjaBlockScanner) BatchExtractTransaction ¶
func (bs *NinjaBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []walletapi.Transaction, blockTime int64) error
BatchExtractTransaction 批量提取交易单 直接获取区块 Payment 操作
func (*NinjaBlockScanner) DeleteUnscanRecord ¶
func (bs *NinjaBlockScanner) DeleteUnscanRecord(height uint64) error
DeleteUnscanRecord 删除指定高度的未扫记录
func (*NinjaBlockScanner) DeleteUnscanRecordNotFindTX ¶
func (bs *NinjaBlockScanner) DeleteUnscanRecordNotFindTX() error
DeleteUnscanRecordNotFindTX 删除未没有找到交易记录的重扫记录
func (*NinjaBlockScanner) ExtractTransaction ¶
func (bs *NinjaBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, tx walletapi.Transaction, scanTargetFunc openwallet.BlockScanTargetFunc) ExtractResult
提取交易单
func (*NinjaBlockScanner) ExtractTransactionData ¶
func (bs *NinjaBlockScanner) ExtractTransactionData(txid string, scanAddressFunc openwallet.BlockScanTargetFunc) (map[string][]*openwallet.TxExtractData, error)
ExtractTransactionData
func (*NinjaBlockScanner) GetBalanceByAddress ¶
func (bs *NinjaBlockScanner) GetBalanceByAddress(address ...string) ([]*openwallet.Balance, error)
GetBalanceByAddress 查询地址余额
func (*NinjaBlockScanner) GetBlockByHeight ¶
func (bs *NinjaBlockScanner) GetBlockByHeight(height uint64) (*Block, error)
func (*NinjaBlockScanner) GetCurrentBlock ¶
func (bs *NinjaBlockScanner) GetCurrentBlock() (*WalletStatus, error)
GetBlockHeight 获取区块链高度
func (*NinjaBlockScanner) GetCurrentBlockHeader ¶
func (bs *NinjaBlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error)
GetCurrentBlockHeader 获取当前区块高度
func (*NinjaBlockScanner) GetGlobalMaxBlockHeight ¶
func (bs *NinjaBlockScanner) GetGlobalMaxBlockHeight() uint64
GetGlobalMaxBlockHeight 获取区块链全网最大高度
func (*NinjaBlockScanner) GetLocalBlock ¶
func (bs *NinjaBlockScanner) GetLocalBlock(height uint64) (*openwallet.BlockHeader, error)
GetLocalBlock 获取本地区块数据
func (*NinjaBlockScanner) GetLocalBlockHead ¶
func (bs *NinjaBlockScanner) GetLocalBlockHead() (uint64, string, error)
GetLocalBlockHead 获取本地记录的区块高度和hash
func (*NinjaBlockScanner) GetLocalNewBlock ¶
func (bs *NinjaBlockScanner) GetLocalNewBlock() (uint64, string, error)
GetLocalNewBlock 获取本地记录的区块高度和hash
func (*NinjaBlockScanner) GetScannedBlockHeader ¶
func (bs *NinjaBlockScanner) GetScannedBlockHeader() (*openwallet.BlockHeader, error)
GetScannedBlockHeader 获取已扫高度区块头
func (*NinjaBlockScanner) GetScannedBlockHeight ¶
func (bs *NinjaBlockScanner) GetScannedBlockHeight() uint64
GetScannedBlockHeight 获取已扫区块高度
func (*NinjaBlockScanner) GetUnscanRecords ¶
func (bs *NinjaBlockScanner) GetUnscanRecords() ([]*openwallet.UnscanRecord, error)
func (*NinjaBlockScanner) InitExtractResult ¶
func (bs *NinjaBlockScanner) InitExtractResult(tx walletapi.Transaction, feePayed string, blockHeight uint64, blockHash string, sourceKey string, result *ExtractResult, scanTargetFunc openwallet.BlockScanTargetFunc, operate int64)
InitTronExtractResult operate = 0: 输入输出提取,1: 输入提取,2:输出提取
func (*NinjaBlockScanner) RescanFailedRecord ¶
func (bs *NinjaBlockScanner) RescanFailedRecord()
rescanFailedRecord 重扫失败记录
func (*NinjaBlockScanner) SaveLocalBlock ¶
func (bs *NinjaBlockScanner) SaveLocalBlock(blockHeader *openwallet.BlockHeader) error
SaveLocalBlock 记录本地新区块
func (*NinjaBlockScanner) SaveLocalBlockHead ¶
func (bs *NinjaBlockScanner) SaveLocalBlockHead(blockHeight uint64, blockHash string) error
SaveLocalBlockHead 记录区块高度和hash到本地
func (*NinjaBlockScanner) SaveLocalNewBlock ¶
func (bs *NinjaBlockScanner) SaveLocalNewBlock(blockHeight uint64, blockHash string) error
GetTransaction
func (bs *NinjaBlockScanner) GetTransaction(hash string) (*Transaction, error) { r, err := bs.wm.client.TransactionByID(hash) if err != nil { return nil, err } return NewTransaction(r), nil }
SaveLocalNewBlock 记录区块高度和hash到本地
func (*NinjaBlockScanner) SaveUnscanRecord ¶
func (bs *NinjaBlockScanner) SaveUnscanRecord(record *openwallet.UnscanRecord) error
SaveUnscanRecord 保存交易记录到钱包数据库
func (*NinjaBlockScanner) ScanBlock ¶
func (bs *NinjaBlockScanner) ScanBlock(height uint64) error
ScanBlock 扫描指定高度区块
func (*NinjaBlockScanner) ScanBlockTask ¶
func (bs *NinjaBlockScanner) ScanBlockTask()
ScanBlockTask 扫描任务
func (*NinjaBlockScanner) SetRescanBlockHeight ¶
func (bs *NinjaBlockScanner) SetRescanBlockHeight(height uint64) error
SetRescanBlockHeight 重置区块链扫描高度
func (*NinjaBlockScanner) SupportBlockchainDAI ¶
func (bs *NinjaBlockScanner) SupportBlockchainDAI() bool
SupportBlockchainDAI 支持外部设置区块链数据访问接口 @optional
type SaveResult ¶
//SaveResult result
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(wm *WalletManager) (*Server, error)
func (*Server) GetAddressBalance ¶
获取地址余额
func (*Server) GetWalletStatus ¶
func (*Server) SetConnectHandler ¶
func (server *Server) SetConnectHandler(h func(node *Server, nodeInfo *TrustNodeInfo))
SetConnectHandler 设置托管节点断开连接后的通知
func (*Server) SetDisconnectHandler ¶
SetDisconnectHandler 设置托管节点连接成功的通知
type Transaction ¶
type Transaction struct { Comment string CreateTime int64 Fee uint64 TxID string Value uint64 Kernel string Receiver string Sender string Income bool Status int64 StatusString string Confirmations uint64 BlockHeight uint64 BlockHash string }
func NewTransaction ¶
func NewTransaction(result *gjson.Result) *Transaction
type TransactionDecoder ¶
type TransactionDecoder struct { openwallet.TransactionDecoderBase // contains filtered or unexported fields }
func NewTransactionDecoder ¶
func NewTransactionDecoder(wm *WalletManager) *TransactionDecoder
NewTransactionDecoder 交易单解析器
func (*TransactionDecoder) CreateRawTransaction ¶
func (decoder *TransactionDecoder) CreateRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
CreateRawTransaction 创建交易单
func (*TransactionDecoder) CreateSummaryRawTransaction ¶
func (decoder *TransactionDecoder) CreateSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransaction, error)
CreateSummaryRawTransaction 创建汇总交易
func (*TransactionDecoder) CreateSummaryRawTransactionWithError ¶
func (decoder *TransactionDecoder) CreateSummaryRawTransactionWithError(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)
CreateSummaryRawTransactionWithError 创建汇总交易,返回能原始交易单数组(包含带错误的原始交易单)
func (*TransactionDecoder) GetRawTransactionFeeRate ¶
func (decoder *TransactionDecoder) GetRawTransactionFeeRate() (feeRate string, unit string, err error)
GetRawTransactionFeeRate 获取交易单的费率
func (*TransactionDecoder) SignRawTransaction ¶
func (decoder *TransactionDecoder) SignRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
SignRawTransaction 签名交易单
func (*TransactionDecoder) SubmitRawTransaction ¶
func (decoder *TransactionDecoder) SubmitRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) (*openwallet.Transaction, error)
SendRawTransaction 广播交易单
func (*TransactionDecoder) VerifyRawTransaction ¶
func (decoder *TransactionDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
VerifyRawTransaction 验证交易单,验证交易单并返回加入签名后的交易单
type TrustNodeInfo ¶
type WalletConfig ¶
type WalletConfig struct { //币种 Symbol string //区块链数据文件 BlockchainFile string //默认配置内容 DefaultConfig string //曲线类型 CurveType uint32 // contains filtered or unexported fields }
func NewConfig ¶
func NewConfig(symbol string) *WalletConfig
type WalletManager ¶
type WalletManager struct { openwallet.AssetsAdapterBase Config *WalletConfig // 节点配置 Decoder openwallet.AddressDecoder //地址编码器 TxDecoder openwallet.TransactionDecoder //交易单编码器 Log *log.OWLogger //日志工具 ContractDecoder openwallet.SmartContractDecoder //智能合约解析器 Blockscanner *NinjaBlockScanner //区块扫描器 // contains filtered or unexported fields }
func NewWalletManager ¶
func NewWalletManager() *WalletManager
func (*WalletManager) BackupWalletData ¶
func (wm *WalletManager) BackupWalletData() error
BackupWalletData
func (*WalletManager) BalanceModelType ¶
func (wm *WalletManager) BalanceModelType() openwallet.BalanceModelType
BalanceModelType 余额模型类别
func (WalletManager) CreateLocalWalletAddress ¶
func (wm WalletManager) CreateLocalWalletAddress(count, workerSize uint64) ([]string, error)
func (WalletManager) CreateRemoteWalletAddress ¶
func (wm WalletManager) CreateRemoteWalletAddress(count, workerSize uint64) ([]string, error)
func (*WalletManager) GetAddressDecode ¶
func (wm *WalletManager) GetAddressDecode() openwallet.AddressDecoder
GetAddressDecode 地址解析器
func (*WalletManager) GetAssetsLogger ¶
func (wm *WalletManager) GetAssetsLogger() *log.OWLogger
GetAssetsLogger 获取资产账户日志工具
func (*WalletManager) GetBlockScanner ¶
func (wm *WalletManager) GetBlockScanner() openwallet.BlockScanner
GetBlockScanner 获取区块链
func (WalletManager) GetLocalWalletAddress ¶
func (wm WalletManager) GetLocalWalletAddress() ([]string, error)
func (WalletManager) GetLocalWalletBalance ¶
func (wm WalletManager) GetLocalWalletBalance() (*openwallet.Balance, error)
func (WalletManager) GetRemoteBlockByHeight ¶
func (wm WalletManager) GetRemoteBlockByHeight(height uint64) (*Block, error)
func (WalletManager) GetRemoteWalletAddress ¶
func (wm WalletManager) GetRemoteWalletAddress() ([]string, error)
func (WalletManager) GetRemoteWalletBalance ¶
func (wm WalletManager) GetRemoteWalletBalance() (*openwallet.Balance, error)
func (*WalletManager) GetSmartContractDecoder ¶
func (wm *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder
GetSmartContractDecoder 获取智能合约解析器
func (*WalletManager) GetTransaction ¶
func (wm *WalletManager) GetTransaction(txid string) (*Transaction, error)
GetTransactionsByHeight
func (*WalletManager) GetTransactionDecoder ¶
func (wm *WalletManager) GetTransactionDecoder() openwallet.TransactionDecoder
GetTransactionDecoder 交易单解析器
func (*WalletManager) GetTransactionsByHeight ¶
func (wm *WalletManager) GetTransactionsByHeight(height uint64) ([]*Transaction, error)
GetTransactionsByHeight
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) SetupLog ¶
func (wm *WalletManager) SetupLog(logDir, logFile string, debug bool)
SetupLog 配置日志
func (*WalletManager) StartSummaryWallet ¶
func (wm *WalletManager) StartSummaryWallet() error
func (*WalletManager) SummaryWalletProcess ¶
func (wm *WalletManager) SummaryWalletProcess(summaryToAddress string) (string, string, string, error)
汇总到目标地址 return txId,summaryAmount,feeAmount,err
func (*WalletManager) SummaryWalletProcessRemote ¶
func (wm *WalletManager) SummaryWalletProcessRemote(summaryToAddress string) (string, string, string, error)
汇总 远程调用
func (*WalletManager) SummaryWallets ¶
func (wm *WalletManager) SummaryWallets()
SummaryWallets 执行汇总流程
func (*WalletManager) TransferCoinRemote ¶
func (wm *WalletManager) TransferCoinRemote(toAddress, toAmount, paymentId string) (string, error)
打币 远程调用
func (*WalletManager) ValidateAddress ¶
func (wm *WalletManager) ValidateAddress(address string) bool
验证地址格式
func (*WalletManager) ValidateAddressRemote ¶
func (wm *WalletManager) ValidateAddressRemote(address string) (bool, error)
远程验证地址格式
type WalletStatus ¶
func NewWalletStatus ¶
func NewWalletStatus(result *gjson.Result) *WalletStatus