Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(input string, alphabet *Alphabet) ([]byte, error)
- func Decrypt(password, encryptedKey string) (string, error)
- func Encode(input []byte, alphabet *Alphabet) string
- func Encrypt(password, key string) (string, error)
- type Alphabet
- type Client
- func (c *Client) CallForgeOps(chain_id string, head_hash string, body interface{}) string
- func (c *Client) CallGetCounter(pkh string) []byte
- func (c *Client) CallGetHeader() []byte
- func (c *Client) CallGetManagerKey(pkh string) []byte
- func (c *Client) CallGetbalance(addr string) []byte
- func (c *Client) CallInjectOps(body string) []byte
- func (c *Client) CallPreapplyOps(body interface{}) []byte
- type Key
- type WalletConfig
- type WalletManager
- func (wm *WalletManager) AddWalletInSummary(wid string, wallet *openwallet.Wallet)
- func (wm *WalletManager) BackupWalletFlow() error
- func (wm *WalletManager) CreateAddressFlow() error
- func (wm *WalletManager) CreateBatchAddress(walletId, password string, count uint64) (string, []*openwallet.Address, error)
- func (wm *WalletManager) CreateNewPrivateKey(key *hdkeystore.HDKey, start, index uint64) (*openwallet.Address, error)
- func (wm *WalletManager) CreateNewWallet(name, password string) (*openwallet.Wallet, string, error)
- func (wm *WalletManager) CreateWalletFlow() error
- func (wm *WalletManager) GetWalletByID(walletID string) (*openwallet.Wallet, error)
- func (wm *WalletManager) GetWalletList() error
- func (wm *WalletManager) GetWallets() ([]*openwallet.Wallet, error)
- func (wm *WalletManager) InitConfigFlow() error
- func (wm *WalletManager) LoadConfig() error
- func (wm *WalletManager) RestoreWallet(keyFile, dbFile, password string) error
- func (w *WalletManager) RestoreWalletFlow() error
- func (wm *WalletManager) ShowConfig() error
- func (wm *WalletManager) SummaryFollow() error
- func (wm *WalletManager) SummaryWallets()
- func (wm *WalletManager) Transfer(keys Key, dst string, fee, gas_limit, storage_limit, amount string) (string, string)
- func (wm *WalletManager) TransferFlow() error
Constants ¶
View Source
const ( //币种 Symbol = "XTZ" MasterKey = "Tezos seed" CurveType = owcrypt.ECC_CURVE_ED25519 )
Variables ¶
View Source
var ( BitcoinAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz") IPFSAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz") FlickrAlphabet = NewAlphabet("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ") RippleAlphabet = NewAlphabet("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz") )
Alphabet: copy from https://en.wikipedia.org/wiki/Base58
View Source
var (
ErrorInvalidBase58String = errors.New("invalid base58 string")
)
Errors
View Source
var (
SaltLen = 8
)
Functions ¶
Types ¶
type Alphabet ¶
type Alphabet struct {
// contains filtered or unexported fields
}
Alphabet The base58 alphabet object.
func NewAlphabet ¶
NewAlphabet create a custom alphabet from 58-length string. Note: len(rune(alphabet)) must be 58.
type Client ¶
func (*Client) CallForgeOps ¶
func (*Client) CallGetCounter ¶
func (*Client) CallGetHeader ¶
func (*Client) CallGetManagerKey ¶
func (*Client) CallGetbalance ¶
func (*Client) CallInjectOps ¶
func (*Client) CallPreapplyOps ¶
type WalletConfig ¶
type WalletConfig struct { //币种 Symbol string MasterKey string //是否测试网络 IsTestNet bool //钱包服务API ServerAPI string //gas limit & storage limit GasLimit decimal.Decimal StorageLimit decimal.Decimal //最小矿工费 MinFee decimal.Decimal //钱包安装的路径 NodeInstallPath string //钱包数据文件目录 WalletDataPath string //汇总阀值 Threshold decimal.Decimal //汇总地址 SumAddress string //汇总执行间隔时间 CycleSeconds time.Duration //默认配置内容 DefaultConfig string //曲线类型 CurveType uint32 // 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 //参与汇总的钱包 }
func NewWalletManager ¶
func NewWalletManager() *WalletManager
func (*WalletManager) AddWalletInSummary ¶
func (wm *WalletManager) AddWalletInSummary(wid string, wallet *openwallet.Wallet)
func (*WalletManager) CreateBatchAddress ¶
func (wm *WalletManager) CreateBatchAddress(walletId, password string, count uint64) (string, []*openwallet.Address, error)
func (*WalletManager) CreateNewPrivateKey ¶
func (wm *WalletManager) CreateNewPrivateKey(key *hdkeystore.HDKey, start, index uint64) (*openwallet.Address, error)
CreateNewPrivateKey 创建私钥,返回私钥wif格式字符串
func (*WalletManager) CreateNewWallet ¶
func (wm *WalletManager) CreateNewWallet(name, password string) (*openwallet.Wallet, string, error)
CreateNewWallet 创建钱包
func (*WalletManager) GetWalletByID ¶
func (wm *WalletManager) GetWalletByID(walletID string) (*openwallet.Wallet, error)
GetWalletByID 获取钱包
func (*WalletManager) GetWalletList ¶
func (wm *WalletManager) GetWalletList() error
GetWalletList 获取钱包列表
func (*WalletManager) GetWallets ¶
func (wm *WalletManager) GetWallets() ([]*openwallet.Wallet, error)
GetWalletKeys 通过给定的文件路径加载keystore文件得到钱包列表
func (*WalletManager) RestoreWallet ¶
func (wm *WalletManager) RestoreWallet(keyFile, dbFile, password string) error
RestoreWallet 恢复钱包
func (*WalletManager) RestoreWalletFlow ¶
func (w *WalletManager) RestoreWalletFlow() error
RestoreWalletFlow 恢复钱包
func (*WalletManager) SummaryFollow ¶
func (wm *WalletManager) SummaryFollow() error
SummaryFollow 汇总流程
Click to show internal directories.
Click to hide internal directories.