Documentation ¶
Index ¶
- Variables
- type Ethereum
- func (e Ethereum) CreateWallet(cwp types.CWParam) (types.Wallet, error)
- func (e Ethereum) GetAddressFromPrivateKey(privateKey string) (types.Address, error)
- func (e Ethereum) GetBalance(bp types.BalanceParam) (types.Balance, error)
- func (e Ethereum) GetTokenBalance(tbp types.TBParam) (types.TokenBalance, error)
- func (e Ethereum) GetTokenInfo(tip types.TokenInfoParam) (types.TokenInfo, error)
- func (e Ethereum) GetTxByHash(hp types.HashParam) (types.TransactionByHash, error)
- func (e Ethereum) SmartContractCall(payload types.SmartContractCallPayload) ([]interface{}, error)
- func (e Ethereum) Transfer(tp types.TransferParam) (types.TransferData, error)
- func (e Ethereum) TransferToken(ttp types.TransferTokenParam) (types.TransferData, error)
- func (e Ethereum) WalletFromMnemonic(wp types.WalletParam) (types.Wallet, error)
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedOperation = errors.New("operation not supported for this blockchain")
Functions ¶
This section is empty.
Types ¶
type Ethereum ¶
type Ethereum struct {
EndpointURL string
}
func (Ethereum) CreateWallet ¶
CreateWallet generates a wallet from a given passphrase (password), and returns a Wallet struct containing the mnemonic, private key, public key, and Ethereum address.
func (Ethereum) GetAddressFromPrivateKey ¶
Get address from Private Key
func (Ethereum) GetBalance ¶
GetBalance checks for the balance of the native network token of an address It returns a Balance struct containing the address, balance (in wei) and the network
func (Ethereum) GetTokenBalance ¶
GetTokenBalance checks for the balance of an ERC20 token for an address. It takes in struct as argument `balancePayload` containing address, rpc url, network and contract address of the ERC 20 token. It returns a Balance struct containing the address, balance (in wei) and the network
func (Ethereum) GetTokenInfo ¶
Get Token Info provides the name, symbol, decimals, token supply and token address of a token.
func (Ethereum) GetTxByHash ¶
GetTxByHash retrieves the transaction and its pending status given its hash and an RPC URL. It returns the transaction object and a boolean indicating whether the transaction is pending.
func (Ethereum) SmartContractCall ¶
func (e Ethereum) SmartContractCall(payload types.SmartContractCallPayload) ([]interface{}, error)
SmartContractCalls performs a generic method call on a specified smart contract. It accepts the contract address, method name, parameters, and ABI, and returns the method results.
func (Ethereum) Transfer ¶
func (e Ethereum) Transfer(tp types.TransferParam) (types.TransferData, error)
TransferETH sends ETH from one wallet to a specified recipient address. It returns the transaction hash, sender address, recipient address, amount transferred and transaction info like gas limit, gas price and block number.
func (Ethereum) TransferToken ¶
func (e Ethereum) TransferToken(ttp types.TransferTokenParam) (types.TransferData, error)
TransferToken sends tokens from a wallet to a specified recipient address. It returns the transaction hash, sender address, recipient address, amount transferred and transaction info like gas limit, gas price and block number.
func (Ethereum) WalletFromMnemonic ¶
WalletFromMnemonic generates an Ethereum wallet from a given mnemonic and passphrase (password). It returns a Wallet struct containing the mnemonic, private key, public key, and address.