net

package
v0.0.0-...-05dbd35 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrencyList = []string{
	"ARS", "AUD", "BRL", "BTC", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "USD", "ZAR", "SAR", "AED", "KWD", "UAH",
}

Functions

func MakeGetRequest

func MakeGetRequest(url string) ([]byte, error)

Base request

func StartNanoWSClient

func StartNanoWSClient(wsUrl string, callbackChan *chan *WSCallbackMsg)

func UpdateBananoCoingeckoPrices

func UpdateBananoCoingeckoPrices() error

func UpdateDolarSiPrice

func UpdateDolarSiPrice() error

func UpdateDolarTodayPrice

func UpdateDolarTodayPrice() error

DolarTodayResponse structure based on expected JSON response

func UpdateNanoCoingeckoPrices

func UpdateNanoCoingeckoPrices() error

Types

type ConfirmationResponse

type ConfirmationResponse struct {
	Topic   string                 `json:"topic"`
	Time    string                 `json:"time"`
	Message map[string]interface{} `json:"message"`
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}
var (
	Client HTTPClient
)

type RPCClient

type RPCClient struct {
	Url        string
	BpowClient *gql.BpowClient
}

func (*RPCClient) GetReceivableCount

func (client *RPCClient) GetReceivableCount(account string, bananoMode bool) (int, error)

This returns how many pending blocks an account has, up to 51, for anti-spam measures

func (*RPCClient) MakeAccountInfoRequest

func (client *RPCClient) MakeAccountInfoRequest(account string) (map[string]interface{}, error)

func (*RPCClient) MakeBlockRequest

func (client *RPCClient) MakeBlockRequest(hash string) (models.BlockResponse, error)

func (*RPCClient) MakeRequest

func (client *RPCClient) MakeRequest(request interface{}) ([]byte, error)

Base request

func (*RPCClient) WorkGenerate

func (client *RPCClient) WorkGenerate(hash string, difficultyMultiplier int) (string, error)

type WSCallbackBlock

type WSCallbackBlock struct {
	Type           string `json:"type"`
	Account        string `json:"account"`
	Previous       string `json:"previous"`
	Representative string `json:"representative"`
	Balance        string `json:"balance"`
	Link           string `json:"link"`
	LinkAsAccount  string `json:"link_as_account"`
	Work           string `json:"work"`
	Signature      string `json:"signature"`
	Destination    string `json:"destination"`
	Source         string `json:"source"`
	Subtype        string `json:"subtype"`
}

type WSCallbackMsg

type WSCallbackMsg struct {
	IsSend  string          `json:"is_send"`
	Block   WSCallbackBlock `json:"block"`
	Account string          `json:"account"`
	Hash    string          `json:"hash"`
	Amount  string          `json:"amount"`
}

Jump to

Keyboard shortcuts

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