notinchain

package
v0.0.0-...-0939e29 Latest Latest
Warning

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

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

Documentation

Overview

Package notinchain provides a temporary sollution for missing data in the blockchain. Remove the THOR node REST URL from the configuration once removed.

Index

Constants

This section is empty.

Variables

View Source
var BaseURL string

BaseURL defines the REST root.

View Source
var Client http.Client

Functions

func AsgardVaultsLookup

func AsgardVaultsLookup() (*[]AsgardVaults, error)

Get asgard vault data from the thorchain api

func AsyncAsgardVaultsLookup

func AsyncAsgardVaultsLookup(wg *sync.WaitGroup, ch chan<- interface{})

func AsyncNetworkLookup

func AsyncNetworkLookup(wg *sync.WaitGroup, ch chan<- interface{})

func AsyncNodeAccountsLookup

func AsyncNodeAccountsLookup(wg *sync.WaitGroup, ch chan<- interface{})

func LoadConstants

func LoadConstants() error

Types

type AsgardVaults

type AsgardVaults struct {
	Coins  []Coin `json:"coins"`
	Status string `json:"status"`
}

type Coin

type Coin struct {
	Asset    string `json:"asset"`
	Amount   string `json:"amount"`
	Decimals *int64 `json:"decimals,omitempty"`
}

type Constants

type Constants struct {
	Int64Values map[string]int64 `json:"int_64_values"`
}

func GetConstants

func GetConstants() *Constants

Looks up thorchain constants, query is run once then cached in memory

type JailInfo

type JailInfo struct {
	NodeAddr      string `json:"node_address"`
	ReleaseHeight int64  `json:"release_height"`
	Reason        string `json:"reason"`
}

type Network

type Network struct {
	TotalReserve          int64 `json:"total_reserve,string"`
	EffectiveSecurityBond int64 `json:"effective_security_bond,string"`
}

func NetworkLookup

func NetworkLookup() (*Network, error)

Get vault data from the thorchain api

type NodeAccount

type NodeAccount struct {
	NodeAddr         string     `json:"node_address"`
	Status           string     `json:"status"`
	TotalBond        int64      `json:"total_bond,string"`
	PublicKeys       PublicKeys `json:"pub_key_set"`
	RequestedToLeave bool       `json:"requested_to_leave"`
	ForcedToLeave    bool       `json:"forced_to_leave"`
	LeaveHeight      int64      `json:"leave_height"`
	IpAddress        string     `json:"ip_address"`
	Version          string     `json:"version"`
	SlashPoints      int64      `json:"slash_points"`
	Jail             JailInfo   `json:"jail"`
	CurrentAward     int64      `json:"current_award,string"`
}

func CachedNodeAccountLookup

func CachedNodeAccountLookup(address string) (*NodeAccount, error)

Return a cached version of nodeaccount to reduce load on thorchain nodes

func CachedNodeAccountsLookup

func CachedNodeAccountsLookup() ([]*NodeAccount, error)

Return a cached version of nodeaccounts to reduce load on thorchain nodes

func NodeAccountLookup

func NodeAccountLookup(addr string) (*NodeAccount, error)

Get node details by address from the thorchain api

func NodeAccountsLookup

func NodeAccountsLookup() ([]*NodeAccount, error)

Get all nodes from the thorchain api

type NodeCache

type NodeCache struct {
	Node     *NodeAccount
	CachedAt time.Time
}

type PublicKeys

type PublicKeys struct {
	Secp256k1 string `json:"secp256k1"`
	Ed25519   string `json:"ed25519"`
}

Jump to

Keyboard shortcuts

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