moralis

package
v0.0.0-...-828d3b4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MoralisUrl = "https://deep-index.moralis.io/api/v2.2"

Variables

This section is empty.

Functions

func GetNativeName

func GetNativeName(network string) string

func GetNativeTokenBalance

func GetNativeTokenBalance(accountAddress string, network string) decimal.Decimal

func GetUserAsset

func GetUserAsset(accountAddress string, network string) []*ent.UserAssetInfo

func SetConfig

func SetConfig(conf *cfg.Config)

Types

type NativePrice

type NativePrice struct {
	Value    string
	Decimals int32
	Name     string
	Symbol   string
}

type NativeTokenBalance

type NativeTokenBalance struct {
	Balance decimal.Decimal
}

type TokenBalance

type TokenBalance struct {
	TokenAddress string          `json:"token_address"`
	Symbol       string          `json:"symbol"`
	Name         string          `json:"name"`
	Thumbnail    string          `json:"thumbnail"`
	Decimals     int32           `json:"decimals"`
	Balance      decimal.Decimal `json:"balance,string"`
	PossibleSpam bool            `json:"possible_spam"`
}

func GetTokenBalance

func GetTokenBalance(address string, network string) []*TokenBalance

type TokenPrice

type TokenPrice struct {
	TokenName        string          `json:"tokenName"`
	TokenSymbol      string          `json:"tokenSymbol"`
	TokenDecimals    string          `json:"tokenDecimals"`
	NativePrice      NativePrice     `json:"nativePrice"`
	UsdPrice         decimal.Decimal `json:"usdPrice"`
	PercentChange24h string          `json:"24hrPercentChange"`
	ExchangeAddress  string          `json:"exchangeAddress"`
	ExchangeName     string          `json:"exchangeName"`
	TokenAddress     string          `json:"tokenAddress"`
}

func GetTokenPrice

func GetTokenPrice(token string, network string) *TokenPrice

func GetTokenPriceBatch

func GetTokenPriceBatch(tokens []string) []*TokenPrice

type TokenPriceInfo

type TokenPriceInfo struct {
	Id              int64
	ContractAddress string
	Symbol          string
	TokenPrice      decimal.Decimal
	LastTime        int64
	CreateTime      time.Time
	UpdateTime      time.Time
}

type UserAssetInfo

type UserAssetInfo struct {
	Id              int64
	AccountAddress  string
	ContractAddress string
	Symbol          string
	Network         string
	Amount          decimal.Decimal
	LastTime        int64
	CreateTime      time.Time
}

type WalletBalanceResp

type WalletBalanceResp struct {
	ContractAddress string
	Symbol          string
	Value           string
	Percent         string
}

Jump to

Keyboard shortcuts

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