Documentation ¶
Index ¶
- func GetAddressFromPrivateKey(privateKey *secp256k1.PrivateKey) string
- type Account
- type ChainClient
- func (Self *ChainClient) Chain() common.Chain
- func (Self *ChainClient) GetBalance(address string, currency string, args any) (float64, error)
- func (Self *ChainClient) GetCurrentHeight() (uint64, error)
- func (Self *ChainClient) GetTransaction(txHash string) (*common.Transaction, error)
- func (Self *ChainClient) Transfer(privateKey *secp256k1.PrivateKey, to string, currency string, value float64, ...) (string, error)
- type Currency
- type GetBalanceParameter
- type TransferParameter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddressFromPrivateKey ¶
func GetAddressFromPrivateKey(privateKey *secp256k1.PrivateKey) string
@title 获取钱包地址 @param privateKey *secp256k1.PrivateKey 私钥 @return _ string 地址
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func NewAccountFromMnemonic ¶
@title 创建账户 @param mnemonic string 助记词 @param password string 密码 @param index int64 账户索引 @return _ *Account 账户 @return _ error 异常信息
func NewAccountFromSeed ¶
@title 创建账户 @param seed []byte 种子 @param index int64 账户索引 @return _ *Account 账户 @return _ error 异常信息
func (*Account) GetAddress ¶
@title 获取钱包地址 @param Self *Account @return _ string 地址 @return _ error 异常信息
func (*Account) GetPrivateKey ¶
@title 获取私钥 @param Self *Account @return _ *secp256k1.PrivateKey 私钥 @return _ error 异常信息
type ChainClient ¶
type ChainClient struct {
// contains filtered or unexported fields
}
func NewChainClient ¶
func NewChainClient(nodes map[string]int, apiKeys []string, currencies map[string]Currency) *ChainClient
@title 创建链客户端 @param nodes map[string]int 节点列表 @param apiKeys []string ApiKey列表 @param currencies map[string]Currency 币种列表 @return _ *ChainClient 链客户端
func (*ChainClient) Chain ¶
func (Self *ChainClient) Chain() common.Chain
@title 链类型 @param Self *ChainClient @return _ common.Chain 链类型
func (*ChainClient) GetBalance ¶
@title 查询余额 @param Self *ChainClient @param address string 地址 @param currency string 币种 @param args any 参数 @return _ float64 余额 @return _ error 异常信息
func (*ChainClient) GetCurrentHeight ¶
func (Self *ChainClient) GetCurrentHeight() (uint64, error)
@title 获取当前高度 @param Self *ChainClient @return _ uint64 当前高度 @return _ error 异常信息
func (*ChainClient) GetTransaction ¶
func (Self *ChainClient) GetTransaction(txHash string) (*common.Transaction, error)
@title 查询交易 @param Self *ChainClient @param txHash string 交易Hash @return _ *Transaction 交易信息 @return _ error 异常信息
func (*ChainClient) Transfer ¶
func (Self *ChainClient) Transfer(privateKey *secp256k1.PrivateKey, to string, currency string, value float64, args any) (string, error)
@title 转账 @param Self *ChainClient @param privateKey *secp256k1.PrivateKey 私钥 @param to string 接收方 @param currency string 币种 @param value float64 金额 @param args any 参数 @return _ string 交易哈希 @return _ error 异常信息
type GetBalanceParameter ¶
type GetBalanceParameter struct { }
type TransferParameter ¶
type TransferParameter struct { }