Documentation ¶
Index ¶
- Constants
- func BasicAuth(username, password string) string
- type Client
- func (c *Client) Call(path string, request map[string]interface{}) (*gjson.Result, error)
- func (c *Client) Call_icx_getBalance(address string) (string, error)
- func (c *Client) Call_icx_getTransactionByHash(txhash string) (string, error)
- func (c *Client) Call_icx_sendTransaction(request map[string]interface{}) (string, error)
- type Key
- type Transaction
- type WalletConfig
- type WalletManager
- func (wm *WalletManager) AddWalletInSummary(wid string, wallet *openwallet.Wallet)
- func (wm *WalletManager) BackupWalletFlow() error
- func (wm *WalletManager) CalculateTxHash(from, to, value string, stepLimit, nonce int64) (map[string]interface{}, [32]byte)
- 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) GetLastBlock() (*gjson.Result, 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(sk []byte, from, to, value string, stepLimit, nonce int64) (string, error)
- func (wm *WalletManager) TransferFlow() error
Constants ¶
View Source
const ( //币种 Symbol = "ICX" MasterKey = "Icon seed" CurveType = owcrypt.ECC_CURVE_SECP256K1 )
Variables ¶
This section is empty.
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.
Types ¶
type Client ¶
func (*Client) Call_icx_getBalance ¶
func (*Client) Call_icx_getTransactionByHash ¶
type Transaction ¶
type WalletConfig ¶
type WalletConfig struct { //币种 Symbol string MasterKey string //钱包服务API ServerAPI string //汇总阀值 Threshold decimal.Decimal //汇总地址 SumAddress string //汇总执行间隔时间 CycleSeconds time.Duration //默认配置内容 DefaultConfig string //曲线类型 CurveType uint32 //stepLimit 矿工费上限 StepLimit int64 // 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) CalculateTxHash ¶
func (wm *WalletManager) CalculateTxHash(from, to, value string, stepLimit, nonce int64) (map[string]interface{}, [32]byte)
计算交易体hash
{ "version": "0x3", "from": "hx2006f91de4cd0b9ce74cb00a06e66eaeb44c70b1", "stepLimit": "0xf4240", "timestamp": "0x5796c0695145c", "nid": "0x1", "to": "hxb12addba58c934ff924aa87ee65d06ee20f89eb8", "value": "0x8f0d180", "nonce": "0x64", "signature": "9G7dKZx1KcdTAwbwtSlnlNklB3EQRpGBUK5kb5nqW1MyM9RxmiVvODbD9HaCuERKbf/KN5tlL1T5V95kN6x+RAE=", }
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) GetLastBlock ¶
func (wm *WalletManager) GetLastBlock() (*gjson.Result, error)
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.