Documentation ¶
Index ¶
- Constants
- type Account
- type Address
- type Client
- type Transaction
- type Wallet
- type WalletConfig
- type WalletManager
- func (wm *WalletManager) AddWalletInSummary(wid string, wallet *Wallet)
- func (wm *WalletManager) BackupWalletFlow() error
- func (wm *WalletManager) CreateAddress(wid string, aid int64, passphrase string) (*Address, error)
- func (wm *WalletManager) CreateAddressFlow() error
- func (wm *WalletManager) CreateBatchAddress(wid string, aid int64, password string, count uint) ([]*Address, string, error)
- func (wm *WalletManager) CreateNewAccount(name, wid, passphrase string) (*Account, error)
- func (wm *WalletManager) CreateNewWallet(name, mnemonic, password string) error
- func (wm *WalletManager) CreateWalletFlow() error
- func (wm *WalletManager) EstimateFees(wid string, aid int64, to string, amount uint64, passphrase string) (uint64, error)
- func (wm *WalletManager) GetAccountInfo(wid string, aid ...string) ([]*Account, error)
- func (wm *WalletManager) GetAddressInfo(wid, aid string) ([]*Address, error)
- func (wm *WalletManager) GetWalletInfo(wid ...string) ([]*Wallet, error)
- func (wm *WalletManager) GetWalletList() error
- func (wm *WalletManager) InitConfigFlow() error
- func (wm *WalletManager) LoadConfig() error
- func (w *WalletManager) RestoreWalletFlow() error
- func (wm *WalletManager) SendTx(wid string, aid int64, to string, amount uint64, password string) (*Transaction, error)
- func (wm *WalletManager) ShowConfig() error
- func (wm *WalletManager) SummaryFollow() error
- func (wm *WalletManager) SummaryWallets()
- func (wm *WalletManager) TransferFlow() error
Constants ¶
View Source
const ( //币种 Symbol = "ADA" MasterKey = "ada seed" CurveType = owcrypt.ECC_CURVE_SECP256K1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Index int64 Name string AddressNumber uint64 Amount string WId string AddressId string Used bool ChangeAddress bool }
func NewAccountV1 ¶
type Address ¶
func NewAddressV1 ¶
type Transaction ¶
func NewTransactionV1 ¶
func NewTransactionV1(json gjson.Result) *Transaction
type Wallet ¶
type Wallet struct { WalletID string `json:"walletID"` Name string `json:"name"` Balance string `json:"balance"` AccountsNumber uint64 `json:"accountsNumber"` Password string `json:"password"` Mnemonic string `json:"mnemonic"` }
Wallet ada的钱包模型
func NewWalletForV1 ¶
NewWalletForV1 通过API/V1的结构实例化钱包
type WalletConfig ¶
type WalletConfig struct { //币种 Symbol string MasterKey string //证书路径 CertsDir string //是否测试网络 IsTestNet bool //钱包服务API ServerAPI string //钱包安装的路径 NodeInstallPath string //钱包数据文件目录 WalletDataPath string //汇总阀值 Threshold decimal.Decimal //汇总地址 SumAddress string //汇总执行间隔时间 CycleSeconds time.Duration //默认配置内容 DefaultConfig string //曲线类型 CurveType uint32 //转账最小额度 MinSendAmount decimal.Decimal //最小矿工费 MinFees decimal.Decimal // 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 { WalletClient *Client // 节点客户端 Config *WalletConfig //钱包管理配置 WalletsInSum map[string]*Wallet //参与汇总的钱包 }
func NewWalletManager ¶
func NewWalletManager() *WalletManager
func (*WalletManager) AddWalletInSummary ¶
func (wm *WalletManager) AddWalletInSummary(wid string, wallet *Wallet)
func (*WalletManager) CreateAddress ¶
CreateAddress 给指定账户创建地址
func (*WalletManager) CreateBatchAddress ¶
func (wm *WalletManager) CreateBatchAddress(wid string, aid int64, password string, count uint) ([]*Address, string, error)
CreateBatchAddress 批量创建地址
func (*WalletManager) CreateNewAccount ¶
func (wm *WalletManager) CreateNewAccount(name, wid, passphrase string) (*Account, error)
CreateNewAccount 根据钱包wid创建单个账户
func (*WalletManager) CreateNewWallet ¶
func (wm *WalletManager) CreateNewWallet(name, mnemonic, password string) error
CreateNewWallet 创建新钱包
func (*WalletManager) EstimateFees ¶
func (wm *WalletManager) EstimateFees(wid string, aid int64, to string, amount uint64, passphrase string) (uint64, error)
EstimateFees 计算预估手续费
func (*WalletManager) GetAccountInfo ¶
func (wm *WalletManager) GetAccountInfo(wid string, aid ...string) ([]*Account, error)
GetAccountInfo 获取用户信息
func (*WalletManager) GetAddressInfo ¶
func (wm *WalletManager) GetAddressInfo(wid, aid string) ([]*Address, error)
GetAddressInfo 获取指定aid用户的地址组
func (*WalletManager) GetWalletInfo ¶
func (wm *WalletManager) GetWalletInfo(wid ...string) ([]*Wallet, error)
GetWalletInfo 获取钱包信息 wid 钱包id,可选
func (*WalletManager) GetWalletList ¶
func (wm *WalletManager) GetWalletList() error
GetWalletList 获取钱包列表
func (*WalletManager) RestoreWalletFlow ¶
func (w *WalletManager) RestoreWalletFlow() error
RestoreWalletFlow 恢复钱包
func (*WalletManager) SendTx ¶
func (wm *WalletManager) SendTx(wid string, aid int64, to string, amount uint64, password string) (*Transaction, error)
SendTx 发送交易
func (*WalletManager) SummaryFollow ¶
func (wm *WalletManager) SummaryFollow() error
SummaryFollow 汇总流程
func (*WalletManager) SummaryWallets ¶
func (wm *WalletManager) SummaryWallets()
SummaryTxFlow 执行汇总流程
Click to show internal directories.
Click to hide internal directories.