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) CreateAccountOnServer(name, password, symbol string, wallet *openwsdk.Wallet) (*openwsdk.Account, []*openwsdk.Address, error)
- func (cli *CLI) CreateAddressOnServer(walletID, accountID 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(accountID string) (*openwsdk.Account, error)
- func (cli *CLI) GetAccountsOnServer(walletID string) ([]*openwsdk.Account, error)
- func (cli *CLI) GetAddressesOnServer(walletID, accountID string, offset, limit int) ([]*openwsdk.Address, error)
- func (cli *CLI) GetAllTokenContractBalance(accountID string, symbol string) ([]*openwsdk.TokenBalance, error)
- func (cli *CLI) GetAllTokenContractBalanceByAddress(accountID, address, symbol string) ([]*openwsdk.TokenBalance, 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, address string) (*openwsdk.TokenBalance, 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) 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(address string) (*openwsdk.Address, error)
- func (cli *CLI) SelectWalletStep() (*openwsdk.Wallet, error)
- func (cli *CLI) ServeTransmitNode(autoReconnect bool) error
- func (cli *CLI) SetSignRawTransactionFunc(txSigner SignRawTransactionFunc) error
- func (cli *CLI) SetSumFlow() error
- func (cli *CLI) SetSummaryInfo(obj *openwsdk.SummarySetting) 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) TransferFlow() 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 SignRawTransactionFunc
- type StormDB
Constants ¶
const ( CLIBucket = "CLIBucket" CurrentKeychainKey = "current_keychain" EnableTrustAddress = "enable_trust_address" InitTrustAddress = "init_trust_address" )
Variables ¶
var ( // 固定应用信息 FixAppID = "" FixAppKey = "" Version = "" GitRev = "" BuildTime = "" )
var ( ErrorAppIDIncorrect = uint64(20001) ErrorSummaryTaskTimerIsRunning = uint64(20002) ErrorSummaryTaskTimerIsNotStart = uint64(20003) ErrorNodeAbilityDisabled = uint64(20004) )
Functions ¶
func CheckBackgroundProcess ¶ added in v1.6.0
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 ¶ added in v1.3.17
func (cli *CLI) AddTrustAddress(trustAddress *openwsdk.TrustAddress) error
AddTrustAddress 添加白名单地址
func (*CLI) AddTrustAddressFlow ¶ added in v1.3.17
AddTrustAddressFlow
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) DisableTrustAddress ¶ added in v1.3.17
DisableTrustAddress
func (*CLI) DisableTrustAddressFlow ¶ added in v1.3.17
DisableTrustAddressFlow
func (*CLI) EnableTrustAddress ¶ added in v1.3.17
EnableTrustAddress
func (*CLI) EnableTrustAddressFlow ¶ added in v1.3.17
EnableTrustAddressFlow
func (*CLI) GetAccountByAccountID ¶
GetAccountOnServerByAccountID 从服务器获取账户
func (*CLI) GetAccountsOnServer ¶
GetAccountsOnServer 从服务器获取账户列表
func (*CLI) GetAddressesOnServer ¶
func (cli *CLI) GetAddressesOnServer(walletID, accountID string, offset, limit int) ([]*openwsdk.Address, error)
GetAddressesOnServer
func (*CLI) GetAllTokenContractBalance ¶
func (cli *CLI) GetAllTokenContractBalance(accountID string, symbol string) ([]*openwsdk.TokenBalance, error)
GetAllTokenContractBalance 查询账户合约余额
func (*CLI) GetAllTokenContractBalanceByAddress ¶ added in v1.3.0
func (cli *CLI) GetAllTokenContractBalanceByAddress(accountID, address, symbol string) ([]*openwsdk.TokenBalance, 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 ¶ added in v1.2.10
func (cli *CLI) GetTokenBalanceByContractAddress(account *openwsdk.Account, address string) (*openwsdk.TokenBalance, 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 ¶ added in v1.3.17
IsTrustAddress
func (*CLI) ListTokenBalanceFlow ¶
ListTokenBalanceFlow
func (*CLI) ListTokenContractFlow ¶
ListTokenContractFlow
func (*CLI) ListTrustAddress ¶ added in v1.3.17
func (cli *CLI) ListTrustAddress(symbol string) ([]*openwsdk.TrustAddress, error)
ListTrustAddress 白名单地址列表
func (*CLI) ListTrustAddressFlow ¶ added in v1.3.17
ListTrustAddressFlow
func (*CLI) RegisterOnServer ¶
RegisterOnServer 注册节点到openw-server
func (*CLI) SaveCurrentKeychain ¶
SaveCurrentKeychain 保存新密钥对到本地缓存
func (*CLI) SearchAddressOnServer ¶
SearchAddressOnServer
func (*CLI) SelectWalletStep ¶ added in v1.3.13
SelectWalletStep 选择钱包操作
func (*CLI) ServeTransmitNode ¶
func (*CLI) SetSignRawTransactionFunc ¶ added in v1.3.13
func (cli *CLI) SetSignRawTransactionFunc(txSigner SignRawTransactionFunc) error
SetSignRawTransactionFunc 设置签名方法
func (*CLI) SetSummaryInfo ¶
func (cli *CLI) SetSummaryInfo(obj *openwsdk.SummarySetting) error
SetSummaryInfo 设置账户的汇总设置
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, contractAddress, to, amount, sid, feeRate, memo, password string) ([]*openwsdk.Transaction, []*openwsdk.FailedRawTransaction, *openwallet.Error)
Transfer 转账交易
func (*CLI) TransferAll ¶ added in v1.2.15
func (*CLI) TransferAllFlow ¶ added in v1.2.15
TransferAllFlow
func (*CLI) TrustAddressStatus ¶ added in v1.3.17
TrustAddressStatus
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 SignRawTransactionFunc ¶ added in v1.3.13
type SignRawTransactionFunc func(rawTx *openwsdk.RawTransaction, key *hdkeystore.HDKey) error
type StormDB ¶ added in v1.2.3
func OpenStormDB ¶ added in v1.2.3
OpenStormDB