Documentation ¶
Index ¶
- Constants
- Variables
- func BasicAuth(username, password string) string
- func DecodeScript(script string) ([]byte, error)
- func GetTxId(rawTx string) (string, error)
- func NewAddressDecoder(wm *WalletManager) *addressDecoder
- func NewUnspentTxs(json []gjson.Result) *[]UnspentTx
- type AddressDecoder
- type Attribute
- type Block
- type BlockchainInfo
- type Client
- type ClientInterface
- type ContractDecoder
- type Explorer
- type ExtractResult
- type ExtractTxOriginResult
- type NEOBlockScanNotificationObject
- type NEOBlockScanner
- func (bs *NEOBlockScanner) AddBTCBlockObserver(obj NEOBlockScanNotificationObject) error
- func (bs *NEOBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []string) error
- func (bs *NEOBlockScanner) BatchExtractTransactionOrigin(block *Block) error
- func (bs *NEOBlockScanner) DeleteUnscanRecord(height uint64) error
- func (bs *NEOBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, txid string, ...) ExtractResult
- func (bs *NEOBlockScanner) ExtractTransactionData(txid string, scanTargetFunc openwallet.BlockScanTargetFunc) (map[string][]*openwallet.TxExtractData, error)
- func (bs *NEOBlockScanner) GetBalanceByAddress(address ...string) ([]*openwallet.Balance, error)
- func (bs *NEOBlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error)
- func (bs *NEOBlockScanner) GetGlobalMaxBlockHeight() uint64
- func (bs *NEOBlockScanner) GetLocalBlock(height uint64) (*Block, error)
- func (bs *NEOBlockScanner) GetLocalNewBlock() (uint64, string, error)
- func (bs *NEOBlockScanner) GetScannedBlockHeader() (*openwallet.BlockHeader, error)
- func (bs *NEOBlockScanner) GetScannedBlockHeaderOrigin() (*openwallet.BlockHeader, error)
- func (bs *NEOBlockScanner) GetScannedBlockHeight() uint64
- func (bs *NEOBlockScanner) GetTransactionsByAddress(offset, limit int, coin openwallet.Coin, address ...string) ([]*openwallet.TxExtractData, error)
- func (bs *NEOBlockScanner) GetUnscanRecords() ([]*openwallet.UnscanRecord, error)
- func (bs *NEOBlockScanner) NewBTCBlockNotify(block *Block, isFork bool)
- func (bs *NEOBlockScanner) Pause() error
- func (bs *NEOBlockScanner) RemoveBTCBlockObserver(obj NEOBlockScanNotificationObject) error
- func (bs *NEOBlockScanner) RescanFailedRecord()
- func (bs *NEOBlockScanner) Restart() error
- func (bs *NEOBlockScanner) Run() error
- func (bs *NEOBlockScanner) SaveLocalBlock(block *Block) error
- func (bs *NEOBlockScanner) SaveLocalNewBlock(blockHeight uint64, blockHash string) error
- func (bs *NEOBlockScanner) SaveUnscanRecord(record *UnscanRecord) error
- func (bs *NEOBlockScanner) ScanBlock(height uint64) error
- func (bs *NEOBlockScanner) ScanBlockTask()
- func (bs *NEOBlockScanner) ScanBlockTaskOrigin()
- func (bs *NEOBlockScanner) ScanTxMemPool()
- func (bs *NEOBlockScanner) ScanTxMemPoolOrigin()
- func (bs *NEOBlockScanner) SetRescanBlockHeight(height uint64) error
- func (bs *NEOBlockScanner) SetScanBlockTaskOrigin()
- func (bs *NEOBlockScanner) Stop() error
- func (bs *NEOBlockScanner) SupportBlockchainDAI() bool
- type OmniTransaction
- type Response
- type SaveResult
- type Transaction
- type TransactionDecoder
- func (decoder *TransactionDecoder) CreateNEORawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) CreateNEOSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)
- func (decoder *TransactionDecoder) CreateOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) CreateOmniSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)
- 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) SignNEORawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) SignOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) 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) VerifyNEORawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) VerifyOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- func (decoder *TransactionDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
- type UnscanRecord
- type Unspent
- type UnspentBalance
- type UnspentSort
- type UnspentTx
- type User
- type Vin
- type Vout
- type WalletConfig
- type WalletManager
- func (wm *WalletManager) AddMultiSigAddress(required uint64, addresses []string) (string, string, error)
- 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) ClaimGAS(address string) 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) 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) 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) GetAssetsLogger() *log.OWLogger
- func (wm *WalletManager) GetBestBlockHash() (string, error)
- func (wm *WalletManager) GetBlock(hash string) (*Block, error)
- func (wm *WalletManager) GetBlockByHeight(height uint64, format ...interface{}) (*Block, error)
- func (wm *WalletManager) GetBlockChainInfo() (*BlockchainInfo, 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) GetOmniBalance(propertyId uint64, address string) (decimal.Decimal, error)
- func (wm *WalletManager) GetOmniBestBlockHash() (string, error)
- func (wm *WalletManager) GetOmniBlockHash(height uint64) (string, error)
- func (wm *WalletManager) GetOmniBlockHeight() (uint64, error)
- func (wm *WalletManager) GetOmniInfo() (*gjson.Result, error)
- func (wm *WalletManager) GetOmniProperty(propertyId uint64) (*gjson.Result, error)
- func (wm *WalletManager) GetOmniTransaction(txid string) (*OmniTransaction, error)
- func (wm *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder
- func (wm *WalletManager) GetTransaction(txid string) (*Transaction, error)
- func (wm *WalletManager) GetTransactionDecoder() openwallet.TransactionDecoder
- func (wm *WalletManager) GetTxIDsInMemPool() ([]string, error)
- func (wm *WalletManager) GetTxOut(txid string, vout uint64) (*Vout, 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, account string) 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) InitAssetsConfig() (config.Configer, error)
- func (wm *WalletManager) InitConfigFlow() error
- func (wm *WalletManager) InitNodeConfigFlow() error
- func (wm *WalletManager) InstallNodeFlow() error
- func (wm *WalletManager) IsHaveOmniAssets(address string) bool
- func (wm *WalletManager) KeyPoolRefill(keyPoolSize uint64) error
- func (wm *WalletManager) ListUnspent(min uint64, addresses ...string) ([]*UnspentBalance, error)
- func (wm *WalletManager) ListUnspentFromLocalDB(walletID string) ([]*Unspent, error)
- func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error
- func (wm *WalletManager) LoadConfig() error
- func (wm *WalletManager) LockWallet() error
- func (wm *WalletManager) NewBlock(json *gjson.Result) *Block
- 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) SendRawTransaction(txHex string) (string, error)
- func (wm *WalletManager) SendToAddress(address string, amount uint64) (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 []*UnspentBalance) (string, error)
- func (wm *WalletManager) StartNodeFlow() error
- func (wm *WalletManager) StopNodeFlow() error
- func (wm *WalletManager) SummaryFollow() 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 ( RPCServerCore = 0 //RPC服务,bitcoin核心钱包 RPCServerExplorer = 1 //RPC服务,insight-API )
const ( //币种 Symbol = "NEO" MasterKey = "Neocoin seed" CurveType = owcrypt.ECC_CURVE_SECP256R1 Decimals = int32(8) AssetSymbolGAS = "GAS" // UTXO 中的 GAS 符号 AssetSymbolNEO = "NEO" // UTXO 中的 NEO 符号 )
Variables ¶
var ( MainNetAddressPrefix = neoTransaction.AddressPrefix{[]byte{0x17}, nil, nil, "neo"} TestNetAddressPrefix = neoTransaction.AddressPrefix{[]byte{0x17}, nil, nil, "neo"} )
将交易地址前缀信息移到适配器中
var ( NEO_mainnetAddressP2PKH = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "doubleSHA256", "h160", 20, []byte{0x17}, nil} NEO_mainnetPrivateWIFCompressed = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "doubleSHA256", "", 32, []byte{0x80}, []byte{0x01}} NEO_testnetAddressP2PKH = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "doubleSHA256", "h160", 20, []byte{0x17}, nil} NEO_testnetPrivateWIFCompressed = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "doubleSHA256", "", 32, []byte{0x80}, []byte{0x01}} )
将地址解析配置信息移入适配器中
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.
func DecodeScript ¶
func NewAddressDecoder ¶
func NewAddressDecoder(wm *WalletManager) *addressDecoder
NewAddressDecoder 地址解析器
func NewUnspentTxs ¶
Types ¶
type AddressDecoder ¶
type AddressDecoder interface { openwallet.AddressDecoder ScriptPubKeyToBech32Address(scriptPubKey []byte) (string, error) }
type Block ¶
type Block struct { Hash string Confirmations uint64 Merkleroot string Previousblockhash string Height uint64 `storm:"id"` Version uint64 Time uint64 Fork bool // contains filtered or unexported fields }
func (*Block) BlockHeader ¶
func (b *Block) BlockHeader(symbol string) *openwallet.BlockHeader
BlockHeader 区块链头
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 ClientInterface ¶
type ContractDecoder ¶
type ContractDecoder struct { *openwallet.SmartContractDecoderBase // contains filtered or unexported fields }
func NewContractDecoder ¶
func NewContractDecoder(wm *WalletManager) *ContractDecoder
NewContractDecoder 智能合约解析器
func (*ContractDecoder) GetTokenBalanceByAddress ¶
func (decoder *ContractDecoder) GetTokenBalanceByAddress(contract openwallet.SmartContract, address ...string) ([]*openwallet.TokenBalance, error)
type Explorer ¶
type Explorer struct { BaseURL string AccessToken string Debug bool // contains filtered or unexported fields }
Explorer是由bitpay的insight-API提供区块数据查询接口 具体接口说明查看https://github.com/bitpay/insight-api
func NewExplorer ¶
type ExtractResult ¶
type ExtractResult struct { TxID string BlockHeight uint64 Success bool IsOmniTransfer bool // contains filtered or unexported fields }
ExtractResult 扫描完成的提取结果
type ExtractTxOriginResult ¶
type ExtractTxOriginResult struct { Tx *Transaction Success bool }
ExtractTxOriginResult
type NEOBlockScanNotificationObject ¶
type NEOBlockScanNotificationObject interface { //BlockScanNotify 新区块扫描完成通知 //@required NEOBlockScanNotify(block *Block, txs []*Transaction) error }
BlockScanNotificationObject 扫描被通知对象
type NEOBlockScanner ¶
type NEOBlockScanner struct { *openwallet.BlockScannerBase CurrentBlockHeight uint64 //当前区块高度 IsScanMemPool bool //是否扫描交易池 RescanLastBlockCount uint64 //重扫上N个区块数量 //用于实现浏览器 IsSkipFailedBlock bool //是否跳过失败区块 NEOBlockObservers map[NEOBlockScanNotificationObject]bool //观察者 // contains filtered or unexported fields }
NEOBlockScanner bitcoin的区块链扫描器
func NewNEOBlockScanner ¶
func NewNEOBlockScanner(wm *WalletManager) *NEOBlockScanner
NewNEOBlockScanner 创建区块链扫描器
func (*NEOBlockScanner) AddBTCBlockObserver ¶
func (bs *NEOBlockScanner) AddBTCBlockObserver(obj NEOBlockScanNotificationObject) error
AddObserver 添加观测者
func (*NEOBlockScanner) BatchExtractTransaction ¶
func (bs *NEOBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []string) error
BatchExtractTransaction 批量提取交易单 bitcoin 1M的区块链可以容纳3000笔交易,批量多线程处理,速度更快
func (*NEOBlockScanner) BatchExtractTransactionOrigin ¶
func (bs *NEOBlockScanner) BatchExtractTransactionOrigin(block *Block) error
BatchExtractTransaction 批量提取交易单 bitcoin 1M的区块链可以容纳3000笔交易,批量多线程处理,速度更快
func (*NEOBlockScanner) DeleteUnscanRecord ¶ added in v1.0.3
func (bs *NEOBlockScanner) DeleteUnscanRecord(height uint64) error
DeleteUnscanRecord 删除指定高度的未扫记录
func (*NEOBlockScanner) ExtractTransaction ¶
func (bs *NEOBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, txid string, scanAddressFunc openwallet.BlockScanAddressFunc) ExtractResult
ExtractTransaction 提取交易单
func (*NEOBlockScanner) ExtractTransactionData ¶
func (bs *NEOBlockScanner) ExtractTransactionData(txid string, scanTargetFunc openwallet.BlockScanTargetFunc) (map[string][]*openwallet.TxExtractData, error)
func (*NEOBlockScanner) GetBalanceByAddress ¶
func (bs *NEOBlockScanner) GetBalanceByAddress(address ...string) ([]*openwallet.Balance, error)
GetAssetsAccountBalanceByAddress 查询账户相关地址的交易记录
func (*NEOBlockScanner) GetCurrentBlockHeader ¶
func (bs *NEOBlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error)
GetCurrentBlockHeader 获取当前区块高度
func (*NEOBlockScanner) GetGlobalMaxBlockHeight ¶
func (bs *NEOBlockScanner) GetGlobalMaxBlockHeight() uint64
func (*NEOBlockScanner) GetLocalBlock ¶ added in v1.0.3
func (bs *NEOBlockScanner) GetLocalBlock(height uint64) (*Block, error)
GetLocalBlock 获取本地区块数据
func (*NEOBlockScanner) GetLocalNewBlock ¶ added in v1.0.3
func (bs *NEOBlockScanner) GetLocalNewBlock() (uint64, string, error)
GetLocalNewBlock 获取本地记录的区块高度和hash
func (*NEOBlockScanner) GetScannedBlockHeader ¶
func (bs *NEOBlockScanner) GetScannedBlockHeader() (*openwallet.BlockHeader, error)
GetScannedBlockHeader 获取当前扫描的区块头
func (*NEOBlockScanner) GetScannedBlockHeaderOrigin ¶
func (bs *NEOBlockScanner) GetScannedBlockHeaderOrigin() (*openwallet.BlockHeader, error)
GetScannedBlockHeader 获取当前扫描的区块头
func (*NEOBlockScanner) GetScannedBlockHeight ¶
func (bs *NEOBlockScanner) GetScannedBlockHeight() uint64
GetScannedBlockHeight 获取已扫区块高度
func (*NEOBlockScanner) GetTransactionsByAddress ¶
func (bs *NEOBlockScanner) GetTransactionsByAddress(offset, limit int, coin openwallet.Coin, address ...string) ([]*openwallet.TxExtractData, error)
GetAssetsAccountTransactionsByAddress 查询账户相关地址的交易记录
func (*NEOBlockScanner) GetUnscanRecords ¶ added in v1.0.3
func (bs *NEOBlockScanner) GetUnscanRecords() ([]*openwallet.UnscanRecord, error)
获取未扫记录
func (*NEOBlockScanner) NewBTCBlockNotify ¶
func (bs *NEOBlockScanner) NewBTCBlockNotify(block *Block, isFork bool)
newBlockNotify 获得新区块后,通知给观测者
func (*NEOBlockScanner) RemoveBTCBlockObserver ¶
func (bs *NEOBlockScanner) RemoveBTCBlockObserver(obj NEOBlockScanNotificationObject) error
RemoveObserver 移除观测者
func (*NEOBlockScanner) RescanFailedRecord ¶
func (bs *NEOBlockScanner) RescanFailedRecord()
rescanFailedRecord 重扫失败记录
func (*NEOBlockScanner) Restart ¶ added in v1.0.3
func (bs *NEOBlockScanner) Restart() error
Restart 继续扫描
func (*NEOBlockScanner) SaveLocalBlock ¶ added in v1.0.3
func (bs *NEOBlockScanner) SaveLocalBlock(block *Block) error
SaveLocalBlock 记录本地新区块
func (*NEOBlockScanner) SaveLocalNewBlock ¶ added in v1.0.3
func (bs *NEOBlockScanner) SaveLocalNewBlock(blockHeight uint64, blockHash string) error
SaveLocalNewBlock 记录区块高度和hash到本地
func (*NEOBlockScanner) SaveUnscanRecord ¶
func (bs *NEOBlockScanner) SaveUnscanRecord(record *UnscanRecord) error
SaveTxToWalletDB 保存交易记录到钱包数据库
func (*NEOBlockScanner) ScanBlock ¶
func (bs *NEOBlockScanner) ScanBlock(height uint64) error
ScanBlock 扫描指定高度区块
func (*NEOBlockScanner) ScanBlockTask ¶
func (bs *NEOBlockScanner) ScanBlockTask()
ScanBlockTask 扫描任务
func (*NEOBlockScanner) ScanBlockTaskOrigin ¶
func (bs *NEOBlockScanner) ScanBlockTaskOrigin()
ScanBlockTask 扫描任务
func (*NEOBlockScanner) ScanTxMemPool ¶
func (bs *NEOBlockScanner) ScanTxMemPool()
ScanTxMemPool 扫描交易内存池
func (*NEOBlockScanner) ScanTxMemPoolOrigin ¶
func (bs *NEOBlockScanner) ScanTxMemPoolOrigin()
ScanTxMemPool 扫描交易内存池
func (*NEOBlockScanner) SetRescanBlockHeight ¶
func (bs *NEOBlockScanner) SetRescanBlockHeight(height uint64) error
SetRescanBlockHeight 重置区块链扫描高度
func (*NEOBlockScanner) SetScanBlockTaskOrigin ¶
func (bs *NEOBlockScanner) SetScanBlockTaskOrigin()
SetScanBlockTaskOrigin 扫描任务
func (*NEOBlockScanner) SupportBlockchainDAI ¶ added in v1.0.3
func (bs *NEOBlockScanner) SupportBlockchainDAI() bool
SupportBlockchainDAI 支持外部设置区块链数据访问接口 @optional
type OmniTransaction ¶
type OmniTransaction struct { TxID string `json:"txid"` Fees string `json:"fee"` SendingAddress string `json:"sendingaddress"` ReferenceAddress string `json:"referenceaddress"` IsMine string `json:"ismine"` Version uint64 `json:"version"` TypeInt uint64 `json:"type_int"` TypeStr string `json:"type"` PropertyId uint64 `json:"propertyid"` Divisible bool `json:"divisible"` Amount string `json:"amount"` Valid bool `json:"valid"` BlockTime int64 `json:"blocktime"` PositionInBlock uint64 `json:"positioninblock"` BlockHash string `json:"blockhash"` Block uint64 `json:"block"` Confirmations uint64 `json:"confirmations"` }
func NewOmniTx ¶
func NewOmniTx(json *gjson.Result) *OmniTransaction
type SaveResult ¶
SaveResult 保存结果
type Transaction ¶
type Transaction struct { TxID string Size uint64 Type string Version uint64 Attributes *[]Attribute Vins []*Vin Vouts []*Vout SysFee string // 系统交易费 每笔交易都有10GAS的免费额度 NetFee string // 网络交易费 交易大小<1024 byte时网络费是可选的,最低为0.001GAS,>1024 byte时需要支付0.001GAS作为基础费用,且额外收取每字节 0.00001 GAS 的网络费 BlockHash string BlockHeight uint64 Confirmations uint64 Blocktime int64 }
type TransactionDecoder ¶
type TransactionDecoder struct { openwallet.TransactionDecoderBase // contains filtered or unexported fields }
func NewTransactionDecoder ¶
func NewTransactionDecoder(wm *WalletManager) *TransactionDecoder
NewTransactionDecoder 交易单解析器
func (*TransactionDecoder) CreateNEORawTransaction ¶
func (decoder *TransactionDecoder) CreateNEORawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
CreateRawTransaction 创建交易单
func (*TransactionDecoder) CreateNEOSummaryRawTransaction ¶
func (decoder *TransactionDecoder) CreateNEOSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)
CreateNEOSummaryRawTransaction 创建NEO汇总交易
func (*TransactionDecoder) CreateOmniRawTransaction ¶
func (decoder *TransactionDecoder) CreateOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
CreateOmniRawTransaction 创建Omni交易单
func (*TransactionDecoder) CreateOmniSummaryRawTransaction ¶
func (decoder *TransactionDecoder) CreateOmniSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)
CreateOmniSummaryRawTransaction 创建Omni汇总交易
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) SignNEORawTransaction ¶
func (decoder *TransactionDecoder) SignNEORawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
SignRawTransaction 签名交易单
func (*TransactionDecoder) SignOmniRawTransaction ¶
func (decoder *TransactionDecoder) SignOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
SignOmniRawTransaction 签名交易单
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) VerifyNEORawTransaction ¶
func (decoder *TransactionDecoder) VerifyNEORawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
VerifyRawTransaction 验证交易单,验证交易单并返回加入签名后的交易单
func (*TransactionDecoder) VerifyOmniRawTransaction ¶
func (decoder *TransactionDecoder) VerifyOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error
VerifyOmniRawTransaction 验证交易单,验证交易单并返回加入签名后的交易单
func (*TransactionDecoder) VerifyRawTransaction ¶
func (decoder *TransactionDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, 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 { UnspentTxs *[]UnspentTx `json:"unspent_txs"` AssetHash string `json:"asset_hash"` Asset string `json:"asset"` AssetSymbol string `json:"asset_symbol"` Amount string `json:"amount"` }
Unspent 未花记录
func NewUnspent ¶
type UnspentBalance ¶
type UnspentBalance struct { /* "balance": [ { "unspent": [ { "txid": "bd454059e58da4221aaf4effa3278660b231e9af7cea97912f4ac5c4995bb7e4", "n": 0, "value": 600.41014479 } ], "asset_hash": "602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7", "asset": "GAS", "asset_symbol": "GAS", "amount": 29060.02316479 }, { "unspent": [ { "txid": "c3182952855314b3f4b1ecf01a03b891d4627d19426ce841275f6d4c186e729a", "n": 0, "value": 800000 } ], "asset_hash": "c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b", "asset": "NEO", "asset_symbol": "NEO", "amount": 800000 } ], "address": "AGofsxAUDwt52KjaB664GYsqVAkULYvKNt" */ Key string `storm:"id"` NEOUnspent *Unspent `json:"neo_unspent"` // 未花费的 NEO GASUnspent *Unspent `json:"gas_unspent"` // 未花费的 GAS AccountID string `json:"account_id" storm:"index"` Address string `json:"address"` // 地址 HDAddress openwallet.Address }
账户余额 包含 NEO 主币 与 交易费用 GAS
func NewUnspentBalance ¶
func NewUnspentBalance(json *gjson.Result) (*UnspentBalance, error)
type UnspentSort ¶
type UnspentSort struct { Values []*UnspentBalance Comparator func(a, b *UnspentBalance) int }
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 UnspentTx ¶
type UnspentTx struct { /* { "txid": "c3182952855314b3f4b1ecf01a03b891d4627d19426ce841275f6d4c186e729a", "n": 0, "value": 800000 } */ TxID string `json:"tx_id"` N uint64 `json:"n"` Value string `json:"value"` }
未花费交易信息
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 //本地数据库文件路径 DBPath string //钱包服务API ServerAPI string //钱包安装的路径 NodeInstallPath string //钱包数据文件目录 WalletDataPath string //汇总阀值 Threshold decimal.Decimal //汇总地址 SumAddress string //汇总执行间隔时间 CycleSeconds time.Duration //默认配置内容 DefaultConfig string //曲线类型 CurveType uint32 //核心钱包密码,配置有值用于自动解锁钱包 WalletPassword string //后台数据源类型 RPCServerType int //s是否支持隔离验证 SupportSegWit bool //Omni代币转账最低成本 OmniTransferCost string //OmniCore API OmniCoreAPI string //Omni rpc user OmniRPCUser string //Omni rpc password OmniRPCPassword string //是否支持omni OmniSupport bool //主网地址前缀 MainNetAddressPrefix neoTransaction.AddressPrefix //测试网地址前缀 TestNetAddressPrefix neoTransaction.AddressPrefix //小数位精度 Decimals int32 //最低手续费 MinFees decimal.Decimal //数据目录 DataDir string // contains filtered or unexported fields }
func (*WalletConfig) PrintConfig ¶
func (wc *WalletConfig) PrintConfig() error
printConfig Print config information
type WalletManager ¶
type WalletManager struct { openwallet.AssetsAdapterBase Storage *hdkeystore.HDKeystore //秘钥存取 WalletClient *Client // 节点客户端 OnmiClient *Client // Omni代币节点客户端 ExplorerClient *Explorer // 浏览器API客户端 Config *WalletConfig //钱包管理配置 WalletsInSum map[string]*openwallet.Wallet //参与汇总的钱包 Blockscanner *NEOBlockScanner //区块扫描器 Decoder AddressDecoder //地址编码器 TxDecoder openwallet.TransactionDecoder //交易单编码器 Log *log.OWLogger //日志工具 ContractDecoder *ContractDecoder //智能合约解析器 }
func NewWalletManager ¶
func NewWalletManager() *WalletManager
func (*WalletManager) AddMultiSigAddress ¶
func (wm *WalletManager) AddMultiSigAddress(required uint64, addresses []string) (string, string, error)
AddMultiSigAddress 创建多签地址
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) 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) 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) GetAssetsLogger ¶
func (wm *WalletManager) GetAssetsLogger() *log.OWLogger
GetAssetsLogger 获取资产账户日志工具
func (*WalletManager) GetBestBlockHash ¶
func (wm *WalletManager) GetBestBlockHash() (string, error)
GetBestBlockHash 获取主链中高度最大的区块的hash
func (*WalletManager) GetBlock ¶
func (wm *WalletManager) GetBlock(hash string) (*Block, error)
GetBlock 获取区块数据
func (*WalletManager) GetBlockByHeight ¶
func (wm *WalletManager) GetBlockByHeight(height uint64, format ...interface{}) (*Block, error)
GetBlockByHeight 获取指定区块高度的区块信息
func (*WalletManager) GetBlockChainInfo ¶
func (wm *WalletManager) GetBlockChainInfo() (*BlockchainInfo, error)
GetBlockChainInfo 获取钱包区块链信息
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) GetOmniBalance ¶
func (*WalletManager) GetOmniBestBlockHash ¶
func (wm *WalletManager) GetOmniBestBlockHash() (string, error)
GetOmniBestBlockHash
func (*WalletManager) GetOmniBlockHash ¶
func (wm *WalletManager) GetOmniBlockHash(height uint64) (string, error)
GetOmniBlockHash 根据区块高度获得区块hash
func (*WalletManager) GetOmniBlockHeight ¶
func (wm *WalletManager) GetOmniBlockHeight() (uint64, error)
GetOmniBlockHeight
func (*WalletManager) GetOmniInfo ¶
func (wm *WalletManager) GetOmniInfo() (*gjson.Result, error)
GetOmniInfo
func (*WalletManager) GetOmniProperty ¶
func (wm *WalletManager) GetOmniProperty(propertyId uint64) (*gjson.Result, error)
GetOmniProperty 获取Omni资产信息
func (*WalletManager) GetOmniTransaction ¶
func (wm *WalletManager) GetOmniTransaction(txid string) (*OmniTransaction, error)
func (*WalletManager) GetSmartContractDecoder ¶
func (wm *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder
GetSmartContractDecoder 获取智能合约解析器
func (*WalletManager) GetTransaction ¶
func (wm *WalletManager) GetTransaction(txid string) (*Transaction, error)
GetTransaction 获取交易单
func (*WalletManager) GetTransactionDecoder ¶
func (wm *WalletManager) GetTransactionDecoder() openwallet.TransactionDecoder
TransactionDecoder 交易单解析器
func (*WalletManager) GetTxIDsInMemPool ¶
func (wm *WalletManager) GetTxIDsInMemPool() ([]string, error)
GetTxIDsInMemPool 获取待处理的交易池中的交易单IDs
func (*WalletManager) GetTxOut ¶
func (wm *WalletManager) GetTxOut(txid string, vout uint64) (*Vout, error)
GetTxOut 获取交易单输出信息,用于追溯交易单输入源头
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, account string) 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) InitAssetsConfig ¶
func (wm *WalletManager) InitAssetsConfig() (config.Configer, error)
InitAssetsConfig 初始化默认配置
func (*WalletManager) InitNodeConfigFlow ¶
func (wm *WalletManager) InitNodeConfigFlow() error
InitNodeConfig 初始化节点配置文件
func (*WalletManager) InstallNodeFlow ¶
func (wm *WalletManager) InstallNodeFlow() error
InstallNode 安装节点
func (*WalletManager) IsHaveOmniAssets ¶
func (wm *WalletManager) IsHaveOmniAssets(address string) bool
IsHaveOmniAssets 是否拥有Omni资产
func (*WalletManager) KeyPoolRefill ¶
func (wm *WalletManager) KeyPoolRefill(keyPoolSize uint64) error
KeyPoolRefill 重新填充私钥池
func (*WalletManager) ListUnspent ¶
func (wm *WalletManager) ListUnspent(min uint64, addresses ...string) ([]*UnspentBalance, error)
ListUnspent 获取未花记录
func (*WalletManager) ListUnspentFromLocalDB ¶
func (wm *WalletManager) ListUnspentFromLocalDB(walletID string) ([]*Unspent, error)
ListUnspentFromLocalDB 查询本地数据库的未花记录
func (*WalletManager) LoadAssetsConfig ¶
func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error
LoadAssetsConfig 加载外部配置
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) SendRawTransaction ¶
func (wm *WalletManager) SendRawTransaction(txHex string) (string, error)
SendRawTransaction 广播交易
func (*WalletManager) SendToAddress ¶
func (wm *WalletManager) SendToAddress(address string, amount uint64) (string, error)
SendToAddress
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 []*UnspentBalance) (string, error)
SignRawTransactionInCoreWallet 钱包交易单
func (*WalletManager) StartNodeFlow ¶
func (wm *WalletManager) StartNodeFlow() error
StartNodeFlow 开启节点
func (*WalletManager) StopNodeFlow ¶
func (wm *WalletManager) StopNodeFlow() error
StopNodeFlow 关闭节点
func (*WalletManager) SummaryFollow ¶
func (wm *WalletManager) SummaryFollow() error
SummaryFollow 汇总流程
func (*WalletManager) SummaryWallets ¶
func (wm *WalletManager) SummaryWallets()
SummaryWallets 执行汇总流程
func (*WalletManager) UnlockWallet ¶
func (wm *WalletManager) UnlockWallet(passphrase string, seconds int) error
UnlockWallet 解锁钱包