client

package
v0.0.0-...-358e57e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlchemyAPI

type AlchemyAPI struct {
	URL string
}

func (AlchemyAPI) FetchEth

func (ac AlchemyAPI) FetchEth(addresses []string) (*[]EthBalance, error)

func (AlchemyAPI) FetchMetadata

func (ac AlchemyAPI) FetchMetadata(contractAddresses []string) (*map[string]FetchMetadataResponse, error)

func (AlchemyAPI) FetchTokens

func (ac AlchemyAPI) FetchTokens(addresses []string) (*[]Wallet, error)

type BlockClient

type BlockClient interface {
	FetchTokens(addresses []string) (*[]Wallet, error)
	FetchEth(addresses []string) (*[]EthBalance, error)
	FetchMetadata(contractAddresses []string) (*map[string]FetchMetadataResponse, error)
}

type EthBalance

type EthBalance struct {
	Address string `json:"address"`
	Balance string `json:"balance"` // hex
}

type FetchEthResponse

type FetchEthResponse struct {
	ID      int64  `json:"id"`
	JSONRPC string `json:"jsonrpc"`
	Result  string `json:"result"` // hex
}

type FetchMetadataResponse

type FetchMetadataResponse struct {
	ID      int64               `json:"id"`
	JSONRPC string              `json:"jsonrpc"`
	Result  model.TokenMetadata `json:"result"`
}

type TokenBalance

type TokenBalance struct {
	ContractAddress string `json:"contractAddress"`
	TokenBalance    string `json:"tokenBalance"` // hex
}

type TokenBalancesResponse

type TokenBalancesResponse struct {
	ID      int64  `json:"id"`
	JSONRPC string `json:"jsonrpc"`
	Result  Wallet `json:"result"`
}

type Wallet

type Wallet struct {
	Address       string         `json:"address"`
	TokenBalances []TokenBalance `json:"tokenBalances"`
	PageKey       string         `json:"pageKey"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL