Documentation ¶
Index ¶
- Constants
- func DecodeAddressToPublicKey(address string) (string, error)
- func EncodePublicKeyToAddress(publicKey string) (string, error)
- func IsValidAddress(address string) bool
- type Account
- func (a *Account) Address() string
- func (a *Account) DecodeAddressToPublicKey(address string) (string, error)
- func (a *Account) EncodePublicKeyToAddress(publicKey string) (string, error)
- func (a *Account) IsValidAddress(address string) bool
- func (a *Account) PrivateKey() ([]byte, error)
- func (a *Account) PrivateKeyHex() (string, error)
- func (a *Account) PublicKey() []byte
- func (a *Account) PublicKeyHex() string
- func (a *Account) Sign(message []byte, password string) ([]byte, error)
- func (a *Account) SignHex(messageHex string, password string) (*base.OptionalString, error)
- type Chain
- func (c *Chain) BalanceOfAccount(account base.Account) (*base.Balance, error)
- func (c *Chain) BalanceOfAddress(address string) (*base.Balance, error)
- func (c *Chain) BalanceOfPublicKey(publicKey string) (*base.Balance, error)
- func (c *Chain) BatchFetchTransactionStatus(hashListString string) string
- func (c *Chain) EstimateTransactionFee(transaction base.Transaction) (fee *base.OptionalString, err error)
- func (c *Chain) EstimateTransactionFeeUsePublicKey(transaction base.Transaction, pubkey string) (fee *base.OptionalString, err error)
- func (c *Chain) FetchTransactionDetail(hash string) (*base.TransactionDetail, error)
- func (c *Chain) FetchTransactionStatus(hash string) base.TransactionStatus
- func (c *Chain) MainToken() base.Token
- func (c *Chain) SendRawTransaction(signedTx string) (string, error)
- func (c *Chain) SendSignedTransaction(signedTxn base.SignedTransaction) (hash *base.OptionalString, err error)
- type SignedTransaction
- type Token
- func (t *Token) BalanceOfAccount(account base.Account) (*base.Balance, error)
- func (t *Token) BalanceOfAddress(address string) (*base.Balance, error)
- func (t *Token) BalanceOfPublicKey(publicKey string) (*base.Balance, error)
- func (t *Token) BuildTransfer(sender, receiver, amount string) (txn base.Transaction, err error)
- func (t *Token) BuildTransferAll(sender, receiver string) (txn base.Transaction, err error)
- func (t *Token) BuildTransferTx(privateKey, receiverAddress, amount string) (*base.OptionalString, error)
- func (t *Token) BuildTransferTxWithAccount(account *Account, receiverAddress, amount string) (*base.OptionalString, error)
- func (t *Token) CanTransferAll() bool
- func (t *Token) Chain() base.Chain
- func (t *Token) EstimateFees(receiverAddress, amount string) (*base.OptionalString, error)
- func (t *Token) TokenInfo() (*base.TokenInfo, error)
- type Transaction
- type Util
Constants ¶
View Source
const ( DevnetRPCEndpoint = rpc.DevnetRPCEndpoint TestnetRPCEndpoint = rpc.TestnetRPCEndpoint MainnetRPCEndpoint = rpc.MainnetRPCEndpoint )
Variables ¶
This section is empty.
Functions ¶
func IsValidAddress ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func AccountWithPrivateKey ¶
rename for support android. Android cant support both NewAccountWithMnemonic(string) and NewAccountWithPrivateKey(string)
func AsSolanaAccount ¶
func NewAccountWithMnemonic ¶
func (*Account) DecodeAddressToPublicKey ¶
@return publicKey that will start with 0x.
func (*Account) EncodePublicKeyToAddress ¶
@param publicKey can start with 0x or not.
func (*Account) IsValidAddress ¶
func (*Account) PrivateKeyHex ¶
@return privateKey string that will start with 0x.
func (*Account) PublicKeyHex ¶
@return publicKey string that will start with 0x.
type Chain ¶
func NewChainWithRpc ¶
func (*Chain) BalanceOfAccount ¶
func (*Chain) BalanceOfAddress ¶
func (*Chain) BalanceOfPublicKey ¶
func (*Chain) BatchFetchTransactionStatus ¶
func (*Chain) EstimateTransactionFee ¶
func (c *Chain) EstimateTransactionFee(transaction base.Transaction) (fee *base.OptionalString, err error)
func (*Chain) EstimateTransactionFeeUsePublicKey ¶
func (c *Chain) EstimateTransactionFeeUsePublicKey(transaction base.Transaction, pubkey string) (fee *base.OptionalString, err error)
func (*Chain) FetchTransactionDetail ¶
func (c *Chain) FetchTransactionDetail(hash string) (*base.TransactionDetail, error)
Fetch transaction details through transaction hash
func (*Chain) FetchTransactionStatus ¶
func (c *Chain) FetchTransactionStatus(hash string) base.TransactionStatus
func (*Chain) SendRawTransaction ¶
Send the raw transaction on-chain @return the hex hash string
func (*Chain) SendSignedTransaction ¶
func (c *Chain) SendSignedTransaction(signedTxn base.SignedTransaction) (hash *base.OptionalString, err error)
type SignedTransaction ¶
type SignedTransaction struct {
Transaction types.Transaction
}
func AsSignedTransaction ¶
func AsSignedTransaction(txn base.SignedTransaction) *SignedTransaction
func (*SignedTransaction) HexString ¶
func (txn *SignedTransaction) HexString() (res *base.OptionalString, err error)
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func (*Token) BalanceOfAccount ¶
func (*Token) BalanceOfAddress ¶
func (*Token) BalanceOfPublicKey ¶
func (*Token) BuildTransfer ¶
func (t *Token) BuildTransfer(sender, receiver, amount string) (txn base.Transaction, err error)
func (*Token) BuildTransferAll ¶
func (t *Token) BuildTransferAll(sender, receiver string) (txn base.Transaction, err error)
func (*Token) BuildTransferTx ¶
func (t *Token) BuildTransferTx(privateKey, receiverAddress, amount string) (*base.OptionalString, error)
func (*Token) BuildTransferTxWithAccount ¶
func (*Token) CanTransferAll ¶
func (*Token) EstimateFees ¶
func (t *Token) EstimateFees(receiverAddress, amount string) (*base.OptionalString, error)
type Transaction ¶
func (*Transaction) SignWithAccount ¶
func (t *Transaction) SignWithAccount(account base.Account) (signedTxn *base.OptionalString, err error)
func (*Transaction) SignedTransactionWithAccount ¶
func (t *Transaction) SignedTransactionWithAccount(account base.Account) (signedTxn base.SignedTransaction, err error)
type Util ¶
type Util struct { }
func (*Util) DecodeAddressToPublicKey ¶
Warning: eth cannot support decode address to public key
func (*Util) EncodePublicKeyToAddress ¶
func (*Util) IsValidAddress ¶
Check if address is 40 hexadecimal characters
Click to show internal directories.
Click to hide internal directories.