Documentation ¶
Index ¶
- Constants
- Variables
- func CheckBackgroundProcess(processName string) error
- func FindExistedSummaryAccountTask(accountID string, tasks []*openwsdk.SummaryAccountTask) (int, *openwsdk.SummaryAccountTask)
- func FindExistedSummaryWalletTask(walletID string, tasks []*openwsdk.SummaryWalletTask) (int, *openwsdk.SummaryWalletTask)
- func GenKeychainFlow() error
- func ProcExsit(filePath string, processName string) error
- func SetupLog(logDir, logFile string, debug bool)
- type CLI
- func (cli *CLI) APINode() *openwsdk.APINode
- func (cli *CLI) AddTrustAddress(trustAddress *openwsdk.TrustAddress) error
- func (cli *CLI) AddTrustAddressFlow() error
- func (cli *CLI) CallABI(account *openwsdk.Account, contractAddress string, abiParam []string) (*openwsdk.SmartContractCallResult, *openwallet.Error)
- func (cli *CLI) CallABIFlow() error
- func (cli *CLI) ChangePwdFlow() error
- func (cli *CLI) CreateAccountOnServer(name, password, symbol string, wallet *openwsdk.Wallet) (*openwsdk.Account, []*openwsdk.Address, error)
- func (cli *CLI) CreateAddressOnServer(walletID, accountID, symbol string, count uint64) error
- func (cli *CLI) CreateWalletOnServer(name, password string) (*openwsdk.Wallet, error)
- func (cli *CLI) DisableTrustAddress() error
- func (cli *CLI) DisableTrustAddressFlow() error
- func (cli *CLI) EnableTrustAddress() error
- func (cli *CLI) EnableTrustAddressFlow() error
- func (cli *CLI) GetAccountByAccountID(symbol, accountID string) (*openwsdk.Account, error)
- func (cli *CLI) GetAccountsOnServer(walletID string) ([]*openwsdk.Account, error)
- func (cli *CLI) GetAddressesBalance(walletID, accountID, symbol string, opType, lastId, limit int) ([]*openwsdk.BalanceResult, error)
- func (cli *CLI) GetAddressesOnServer(walletID, accountID, symbol string, lastId, limit int64) ([]*openwsdk.Address, error)
- func (cli *CLI) GetAllTokenContractBalance(walletID, accountID string, symbol string) ([]*openwsdk.BalanceResult, error)
- func (cli *CLI) GetAllTokenContractBalanceByAddress(walletID, accountID, address, symbol string) ([]*openwsdk.BalanceResult, error)
- func (cli *CLI) GetConfig() *Config
- func (cli *CLI) GetKeychain() (*Keychain, error)
- func (cli *CLI) GetNodeInfoFlow() error
- func (cli *CLI) GetSummaryTaskLog(offset, limit int64) ([]*openwsdk.SummaryTaskLog, error)
- func (cli *CLI) GetSymbolInfo(symbol string) (*openwsdk.Symbol, error)
- func (cli *CLI) GetSymbolList() ([]*openwsdk.Symbol, error)
- func (cli *CLI) GetTokenBalance(account *openwsdk.Account, contractID string) string
- func (cli *CLI) GetTokenBalanceByContractAddress(account *openwsdk.Account, symbol, address string) (*openwsdk.BalanceResult, error)
- func (cli *CLI) GetTokenContractInfo(contractID string) (*openwsdk.TokenContract, error)
- func (cli *CLI) GetTokenContractList(cols ...interface{}) ([]*openwsdk.TokenContract, error)
- func (cli *CLI) GetWalletByWalletID(walletID string) (*openwsdk.Wallet, error)
- func (cli *CLI) GetWalletByWalletIDOnLocal(walletID string) (*openwsdk.Wallet, error)
- func (cli *CLI) GetWalletsOnServer() ([]*openwsdk.Wallet, error)
- func (cli *CLI) IsTrustAddress(address, symbol string) bool
- func (cli *CLI) ListAccountFlow() error
- func (cli *CLI) ListAddressBalanceFlow() error
- func (cli *CLI) ListAddressFlow() error
- func (cli *CLI) ListSumInfoFlow() error
- func (cli *CLI) ListSymbolFlow() error
- func (cli *CLI) ListTokenBalanceFlow() error
- func (cli *CLI) ListTokenContractFlow() error
- func (cli *CLI) ListTrustAddress(symbol string) ([]*openwsdk.TrustAddress, error)
- func (cli *CLI) ListTrustAddressFlow() error
- func (cli *CLI) ListWalletFlow() error
- func (cli *CLI) NewAccountFlow() error
- func (cli *CLI) NewAddressFlow() error
- func (cli *CLI) NewWalletFlow() error
- func (cli *CLI) RegisterFlow() error
- func (cli *CLI) RegisterOnServer() error
- func (cli *CLI) SaveCurrentKeychain(keychain *Keychain) error
- func (cli *CLI) SearchAddressFlow() error
- func (cli *CLI) SearchAddressOnServer(symbol, address string) (*openwsdk.Address, error)
- func (cli *CLI) SelectAccountStep(walletID string) (*openwsdk.Account, error)
- func (cli *CLI) SelectWalletStep() (*openwsdk.Wallet, error)
- func (cli *CLI) ServeTransmitNode(autoReconnect bool) error
- func (cli *CLI) SetSignTxHashFunc(txSigner SignTxHashFunc) error
- func (cli *CLI) SetSumFlow() error
- func (cli *CLI) SetSummaryInfo(obj *openwsdk.SummarySetting) error
- func (cli *CLI) SignHash(address *openwsdk.Address, symbol, message, password string, appendV bool) (string, error)
- func (cli *CLI) SignHashFlow() error
- func (cli *CLI) StartSumFlow(file string) error
- func (cli *CLI) StartTrustServerFlow() error
- func (cli *CLI) SummaryAccountMainCoin(accountTask *openwsdk.SummaryAccountTask, account *openwsdk.Account, ...) error
- func (cli *CLI) SummaryAccountTokenContracts(accountTask *openwsdk.SummaryAccountTask, account *openwsdk.Account, ...) error
- func (cli *CLI) SummaryTask()
- func (cli *CLI) Transfer(wallet *openwsdk.Wallet, account *openwsdk.Account, ...) ([]*openwsdk.Transaction, []*openwsdk.FailedRawTransaction, *openwallet.Error)
- func (cli *CLI) TransferAll(wallet *openwsdk.Wallet, account *openwsdk.Account, ...) error
- func (cli *CLI) TransferAllFlow() error
- func (cli *CLI) TransferExt(wallet *openwsdk.Wallet, account *openwsdk.Account, ...) ([]*openwsdk.Transaction, []*openwsdk.FailedRawTransaction, *openwallet.Error)
- func (cli *CLI) TransferFlow() error
- func (cli *CLI) TriggerABI(wallet *openwsdk.Wallet, account *openwsdk.Account, ...) (*openwsdk.SmartContractReceipt, *openwallet.Error)
- func (cli *CLI) TriggerABIFlow() error
- func (cli *CLI) TrustAddressStatus() bool
- func (cli *CLI) UpdateInfoFlow() error
- func (cli *CLI) UpdateSymbols() error
- func (cli *CLI) UpdateTokenContracts(symbol string) error
- type Config
- type Keychain
- type SignTxHashFunc
- type StormDB
Constants ¶
const ( CLIBucket = "CLIBucket" CurrentKeychainKey = "current_keychain" EnableTrustAddress = "enable_trust_address" InitTrustAddress = "init_trust_address" )
Variables ¶
var ( // 固定应用信息 FixAppID = "" FixAppKey = "" Version = "" GitRev = "" BuildTime = "" )
Functions ¶
func CheckBackgroundProcess ¶
func FindExistedSummaryAccountTask ¶
func FindExistedSummaryAccountTask(accountID string, tasks []*openwsdk.SummaryAccountTask) (int, *openwsdk.SummaryAccountTask)
func FindExistedSummaryWalletTask ¶
func FindExistedSummaryWalletTask(walletID string, tasks []*openwsdk.SummaryWalletTask) (int, *openwsdk.SummaryWalletTask)
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
func (*CLI) AddTrustAddress ¶
func (cli *CLI) AddTrustAddress(trustAddress *openwsdk.TrustAddress) error
AddTrustAddress 添加白名单地址
func (*CLI) CallABI ¶
func (cli *CLI) CallABI(account *openwsdk.Account, contractAddress string, abiParam []string) (*openwsdk.SmartContractCallResult, *openwallet.Error)
CallABI 直接调用ABI方法
func (*CLI) CreateAccountOnServer ¶
func (cli *CLI) CreateAccountOnServer(name, password, symbol string, wallet *openwsdk.Wallet) (*openwsdk.Account, []*openwsdk.Address, error)
CreateAccountOnServer
func (*CLI) CreateAddressOnServer ¶
CreateAddressOnServer
func (*CLI) CreateWalletOnServer ¶
CreateWalletOnServer
func (*CLI) DisableTrustAddressFlow ¶
DisableTrustAddressFlow
func (*CLI) EnableTrustAddressFlow ¶
EnableTrustAddressFlow
func (*CLI) GetAccountByAccountID ¶
GetAccountOnServerByAccountID 从服务器获取账户
func (*CLI) GetAccountsOnServer ¶
GetAccountsOnServer 从服务器获取账户列表
func (*CLI) GetAddressesBalance ¶ added in v2.4.6
func (cli *CLI) GetAddressesBalance(walletID, accountID, symbol string, opType, lastId, limit int) ([]*openwsdk.BalanceResult, error)
GetAddressesBalance
func (*CLI) GetAddressesOnServer ¶
func (cli *CLI) GetAddressesOnServer(walletID, accountID, symbol string, lastId, limit int64) ([]*openwsdk.Address, error)
GetAddressesOnServer
func (*CLI) GetAllTokenContractBalance ¶
func (cli *CLI) GetAllTokenContractBalance(walletID, accountID string, symbol string) ([]*openwsdk.BalanceResult, error)
GetAllTokenContractBalance 查询账户合约余额
func (*CLI) GetAllTokenContractBalanceByAddress ¶
func (cli *CLI) GetAllTokenContractBalanceByAddress(walletID, accountID, address, symbol string) ([]*openwsdk.BalanceResult, error)
GetAllTokenContractBalanceByAddress 查询地址合约余额
func (*CLI) GetSummaryTaskLog ¶
func (cli *CLI) GetSummaryTaskLog(offset, limit int64) ([]*openwsdk.SummaryTaskLog, error)
func (*CLI) GetSymbolInfo ¶
GetLocalSymbolInfo 查询本地主链信息
func (*CLI) GetSymbolList ¶
GetLocalSymbolList 查询本地保存主链
func (*CLI) GetTokenBalance ¶
GetTokenBalance 获取代币余额
func (*CLI) GetTokenBalanceByContractAddress ¶
func (cli *CLI) GetTokenBalanceByContractAddress(account *openwsdk.Account, symbol, address string) (*openwsdk.BalanceResult, error)
GetTokenBalanceByContractAddress 通过代币合约的地址获取代币余额
func (*CLI) GetTokenContractInfo ¶
func (cli *CLI) GetTokenContractInfo(contractID string) (*openwsdk.TokenContract, error)
GetTokenContractInfo 查询单个合约信息
func (*CLI) GetTokenContractList ¶
func (cli *CLI) GetTokenContractList(cols ...interface{}) ([]*openwsdk.TokenContract, error)
GetContractList 查询本地保存代币合约信息
func (*CLI) GetWalletByWalletID ¶
GetWalletByWalletID 查找本地且线上有的钱包对象
func (*CLI) GetWalletByWalletIDOnLocal ¶
GetWalletByWalletIDOnLocal 查找本地种子目录的钱包对象
func (*CLI) GetWalletsOnServer ¶
GetWalletsByKeyDir 通过给定的文件路径加载keystore文件得到钱包列表
func (*CLI) IsTrustAddress ¶
IsTrustAddress
func (*CLI) ListAddressBalanceFlow ¶ added in v2.4.6
ListAddressBalanceFlow
func (*CLI) ListTokenBalanceFlow ¶
ListTokenBalanceFlow
func (*CLI) ListTokenContractFlow ¶
ListTokenContractFlow
func (*CLI) ListTrustAddress ¶
func (cli *CLI) ListTrustAddress(symbol string) ([]*openwsdk.TrustAddress, error)
ListTrustAddress 白名单地址列表
func (*CLI) ListTrustAddressFlow ¶
ListTrustAddressFlow
func (*CLI) RegisterOnServer ¶
RegisterOnServer 注册节点到openw-server
func (*CLI) SaveCurrentKeychain ¶
SaveCurrentKeychain 保存新密钥对到本地缓存
func (*CLI) SearchAddressOnServer ¶
SearchAddressOnServer
func (*CLI) SelectAccountStep ¶ added in v2.3.2
SelectAccountStep 选择资产账户操作
func (*CLI) SelectWalletStep ¶
SelectWalletStep 选择钱包操作
func (*CLI) ServeTransmitNode ¶
func (*CLI) SetSignTxHashFunc ¶
func (cli *CLI) SetSignTxHashFunc(txSigner SignTxHashFunc) error
SetSignTxHashFunc 设置签名方法
func (*CLI) SetSummaryInfo ¶
func (cli *CLI) SetSummaryInfo(obj *openwsdk.SummarySetting) error
SetSummaryInfo 设置账户的汇总设置
func (*CLI) SignHash ¶ added in v2.2.2
func (cli *CLI) SignHash(address *openwsdk.Address, symbol, message, password string, appendV bool) (string, error)
SignHash 哈希消息签名
func (*CLI) StartTrustServerFlow ¶
StartTrustServerFlow
func (*CLI) SummaryAccountMainCoin ¶
func (cli *CLI) SummaryAccountMainCoin(accountTask *openwsdk.SummaryAccountTask, account *openwsdk.Account, key *hdkeystore.HDKey) error
SummaryAccountMainCoin 汇总账户主币
func (*CLI) SummaryAccountTokenContracts ¶
func (cli *CLI) SummaryAccountTokenContracts(accountTask *openwsdk.SummaryAccountTask, account *openwsdk.Account, key *hdkeystore.HDKey) error
SummaryAccountTokenContracts 汇总账户代币合约
func (*CLI) Transfer ¶
func (cli *CLI) Transfer(wallet *openwsdk.Wallet, account *openwsdk.Account, symbol, contractAddress, to, amount, sid, feeRate, memo, password string) ([]*openwsdk.Transaction, []*openwsdk.FailedRawTransaction, *openwallet.Error)
Transfer 转账交易
func (*CLI) TransferAll ¶
func (*CLI) TransferExt ¶ added in v2.1.1
func (cli *CLI) TransferExt(wallet *openwsdk.Wallet, account *openwsdk.Account, symbol, contractAddress, to, amount, sid, feeRate, memo, extParam, password string) ([]*openwsdk.Transaction, []*openwsdk.FailedRawTransaction, *openwallet.Error)
TransferExt 转账交易 + 扩展参数
func (*CLI) TriggerABI ¶
func (cli *CLI) TriggerABI(wallet *openwsdk.Wallet, account *openwsdk.Account, symbol, contractAddress, contractABI, amount, sid, feeRate, password string, abiParam []string, raw string, rawType uint64, awaitResult bool) (*openwsdk.SmartContractReceipt, *openwallet.Error)
TriggerABI 触发合约ABI接口
func (*CLI) UpdateTokenContracts ¶
UpdateSymbols 更新主链
type Keychain ¶
type Keychain struct { NodeID string `json:"nodeID" storm:"id"` PrivateKey string `json:"privateKey"` PublicKey string `json:"publicKey"` // contains filtered or unexported fields }
密钥对
func (*Keychain) Certificate ¶
func (keychain *Keychain) Certificate() (owtp.Certificate, error)
type SignTxHashFunc ¶
type SignTxHashFunc func(signatures map[string][]*openwsdk.KeySignature, key *hdkeystore.HDKey) (map[string][]*openwsdk.KeySignature, error)
type SignRawTransactionFunc func(rawTx *openwsdk.RawTransaction, key *hdkeystore.HDKey) error