common

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainStrings

func ChainStrings() []string

ChainStrings returns a slice of all String values of the enum

func SmartMoneyActivitiesStrings added in v0.0.4

func SmartMoneyActivitiesStrings() []string

SmartMoneyActivitiesStrings returns a slice of all String values of the enum

func SourcePriceStrings

func SourcePriceStrings() []string

SourcePriceStrings returns a slice of all String values of the enum

Types

type BigTx added in v0.0.5

type BigTx struct {
	TokenAddress   string               `json:"token_address"`
	BlockTimestamp time.Time            `json:"block_timestamp"`
	BlockNumber    uint64               `json:"block_number"`
	Sender         string               `json:"sender"`
	Time           time.Time            `json:"time"`
	ValueInToken   float64              `json:"value_in_token"`
	ValueInUsdt    float64              `json:"value_in_usdt"`
	Price          float64              `json:"price"`
	Movement       string               `json:"movement"`
	Action         SmartMoneyActivities `json:"action"`
}

type Chain

type Chain uint64

enumer -type=Chain -linecomment -json=true -text=true -sql=true

const (
	ChainSolana Chain = iota + 1 // solana
)

func ChainString

func ChainString(s string) (Chain, error)

ChainString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ChainValues

func ChainValues() []Chain

ChainValues returns all values of the enum

func (Chain) IsAChain

func (i Chain) IsAChain() bool

IsAChain returns "true" if the value is listed in the enum definition. "false" otherwise

func (Chain) MarshalJSON

func (i Chain) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Chain

func (Chain) MarshalText

func (i Chain) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Chain

func (*Chain) Scan

func (i *Chain) Scan(value interface{}) error

func (Chain) String

func (i Chain) String() string

func (*Chain) UnmarshalJSON

func (i *Chain) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Chain

func (*Chain) UnmarshalText

func (i *Chain) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Chain

func (Chain) Value

func (i Chain) Value() (driver.Value, error)

type MoralisToken added in v0.0.11

type MoralisToken struct {
	TokenAddress string `json:"associatedTokenAddress"`
	Mint         string `json:"mint"`
	AmountRaw    string `json:"amountRaw"`
	Amount       string `json:"amount"`
	Decimals     string `json:"decimals"`
	Name         string `json:"name"`
	Symbol       string `json:"symbol"`
}

type SmartMoneyActivities added in v0.0.4

type SmartMoneyActivities uint64

enumer -type=SmartMoneyActivities -linecomment -json=true -text=true -sql=true

const (
	SmartMoneyActivitiesAll     SmartMoneyActivities = iota + 1 // all
	SmartMoneyActivitiesInFlow                                  // inflow
	SmartMoneyActivitiesOutFlow                                 // outflow
	SmartMoneyActivitiesBuying                                  // buying
	SmartMoneyActivitiesSelling                                 // selling
)

func SmartMoneyActivitiesString added in v0.0.4

func SmartMoneyActivitiesString(s string) (SmartMoneyActivities, error)

SmartMoneyActivitiesString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func SmartMoneyActivitiesValues added in v0.0.4

func SmartMoneyActivitiesValues() []SmartMoneyActivities

SmartMoneyActivitiesValues returns all values of the enum

func (SmartMoneyActivities) IsASmartMoneyActivities added in v0.0.4

func (i SmartMoneyActivities) IsASmartMoneyActivities() bool

IsASmartMoneyActivities returns "true" if the value is listed in the enum definition. "false" otherwise

func (SmartMoneyActivities) MarshalJSON added in v0.0.4

func (i SmartMoneyActivities) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for SmartMoneyActivities

func (SmartMoneyActivities) MarshalText added in v0.0.4

func (i SmartMoneyActivities) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for SmartMoneyActivities

func (*SmartMoneyActivities) Scan added in v0.0.4

func (i *SmartMoneyActivities) Scan(value interface{}) error

func (SmartMoneyActivities) String added in v0.0.4

func (i SmartMoneyActivities) String() string

func (*SmartMoneyActivities) UnmarshalJSON added in v0.0.4

func (i *SmartMoneyActivities) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SmartMoneyActivities

func (*SmartMoneyActivities) UnmarshalText added in v0.0.4

func (i *SmartMoneyActivities) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for SmartMoneyActivities

func (SmartMoneyActivities) Value added in v0.0.4

func (i SmartMoneyActivities) Value() (driver.Value, error)

type SolanaTradelog

type SolanaTradelog struct {
	BlockTimestamp time.Time `json:"timestamp"`
	BlockNumber    uint64    `json:"block_number"`
	TxHash         string    `json:"tx_hash"`
	Sender         string    `json:"sender"`

	TokenInAddress  string  `json:"token_in_address"`
	TokenInAmount   float64 `json:"token_in_amount"`
	TokenInUsdtRate float64 `json:"token_in_usdt_rate"`

	TokenOutAddress  string  `json:"token_out_address"`
	TokenOutAmount   float64 `json:"token_out_amount"`
	TokenOutUsdtRate float64 `json:"token_out_usdt_rate"`

	SolUsdtRate float64 `json:"sol_usdt_rate"`

	CurrentTokenInUsdtRate  float64
	CurrentTokenOutUsdtRate float64
	Profit                  float64 `json:"profit"`
	GetCurrentRateFail      bool
}

type SolanaTransferlog

type SolanaTransferlog struct {
	BlockTimestamp time.Time `json:"timestamp"`
	BlockNumber    uint64    `json:"block_number"`
	TxHash         string    `json:"tx_hash"`

	FromAddress string `json:"from_address"`
	ToAddress   string `json:"to_address"`

	TokenAddress string  `json:"token_in_address"`
	TokenAmount  float64 `json:"token_in_amount"`
	IsCexIn      bool    `json:"is_cex_in"`

	CurrentTokenUsdtRate float64
	GetCurrentRateFail   bool
}

type SourcePrice

type SourcePrice uint64

enumer -type=SourcePrice -linecomment -json=true -text=true -sql=true

const (
	SourcePriceCex SourcePrice = iota + 1 // cex
	SourcePriceDex                        // dex
)

func SourcePriceString

func SourcePriceString(s string) (SourcePrice, error)

SourcePriceString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func SourcePriceValues

func SourcePriceValues() []SourcePrice

SourcePriceValues returns all values of the enum

func (SourcePrice) IsASourcePrice

func (i SourcePrice) IsASourcePrice() bool

IsASourcePrice returns "true" if the value is listed in the enum definition. "false" otherwise

func (SourcePrice) MarshalJSON

func (i SourcePrice) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for SourcePrice

func (SourcePrice) MarshalText

func (i SourcePrice) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for SourcePrice

func (*SourcePrice) Scan

func (i *SourcePrice) Scan(value interface{}) error

func (SourcePrice) String

func (i SourcePrice) String() string

func (*SourcePrice) UnmarshalJSON

func (i *SourcePrice) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SourcePrice

func (*SourcePrice) UnmarshalText

func (i *SourcePrice) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for SourcePrice

func (SourcePrice) Value

func (i SourcePrice) Value() (driver.Value, error)

type Token

type Token struct {
	UsdPrice    float64     `json:"usdPrice"`
	Address     string      `json:"tokenAddress"`
	Symbol      string      `json:"symbol"`
	ChainID     string      `json:"chainId"`
	SourcePrice SourcePrice `json:"sourcePrice"`
	ImageUrl    string      `json:"imageUrl"`
}

Jump to

Keyboard shortcuts

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