ord

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApiBase = "http://localhost:8080"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	BaseURL string
	Client  *http.Client
}

func NewAPIClient

func NewAPIClient(baseURL string) *APIClient

func (*APIClient) GetAllRunes

func (c *APIClient) GetAllRunes() ([]Entry, error)

func (*APIClient) GetBalances added in v0.0.9

func (c *APIClient) GetBalances() (RuneBalanceRespone, error)

type Details

type Details struct {
	Block        int64  `json:"block"`
	Burned       int64  `json:"burned"`
	Divisibility int    `json:"divisibility"`
	Etching      string `json:"etching"`
	Mints        int64  `json:"mints"`
	Number       int64  `json:"number"`
	Premine      int64  `json:"premine"`
	SpacedRune   string `json:"spaced_rune"`
	Symbol       string `json:"symbol"`
	Terms        Terms  `json:"terms"`
	TermsEnabled bool   `json:"termsenabled"`
	Timestamp    int64  `json:"timestamp"`
	Turbo        bool   `json:"turbo"`
}

type Entry

type Entry struct {
	ID       string  `json:"id"`
	Details  Details `json:"details"`
	Mintable bool    `json:"mintable"`
}

Define the structs according to the JSON structure

type Response

type Response struct {
	Entries [][]interface{} `json:"entries"` // Use interface{} because the first element is string and second is Details
	More    bool            `json:"more"`
	Prev    interface{}     `json:"prev"` // Use interface{} because it can be null or other types
	Next    interface{}     `json:"next"`
}

type RuneBalanceRespone added in v0.0.9

type RuneBalanceRespone map[string]map[string]float64

type Terms

type Terms struct {
	Amount int64         `json:"amount"`
	Cap    int64         `json:"cap"`
	Height []int         `json:"height"`
	Offset []interface{} `json:"offset"` // Use interface{} for mixed types (null, int)
}

Jump to

Keyboard shortcuts

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