glassnodeapi

package
v1.31.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressesRequest

type AddressesRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*AddressesRequest) Do

func (*AddressesRequest) GetParameters

func (a *AddressesRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*AddressesRequest) GetParametersJSON

func (a *AddressesRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*AddressesRequest) GetParametersQuery

func (a *AddressesRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*AddressesRequest) GetQueryParameters

func (a *AddressesRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*AddressesRequest) GetSlugParameters

func (a *AddressesRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*AddressesRequest) GetSlugsMap

func (a *AddressesRequest) GetSlugsMap() (map[string]string, error)

func (*AddressesRequest) SetAsset

func (a *AddressesRequest) SetAsset(Asset string) *AddressesRequest

func (*AddressesRequest) SetFormat

func (a *AddressesRequest) SetFormat(Format Format) *AddressesRequest

func (*AddressesRequest) SetInterval

func (a *AddressesRequest) SetInterval(Interval Interval) *AddressesRequest

func (*AddressesRequest) SetMetric

func (a *AddressesRequest) SetMetric(Metric string) *AddressesRequest

func (*AddressesRequest) SetSince

func (a *AddressesRequest) SetSince(Since int64) *AddressesRequest

func (*AddressesRequest) SetTimestampFormat

func (a *AddressesRequest) SetTimestampFormat(TimestampFormat string) *AddressesRequest

func (*AddressesRequest) SetUntil

func (a *AddressesRequest) SetUntil(Until int64) *AddressesRequest

type BlockchainRequest

type BlockchainRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*BlockchainRequest) Do

func (*BlockchainRequest) GetParameters

func (b *BlockchainRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*BlockchainRequest) GetParametersJSON

func (b *BlockchainRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*BlockchainRequest) GetParametersQuery

func (b *BlockchainRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*BlockchainRequest) GetQueryParameters

func (b *BlockchainRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*BlockchainRequest) GetSlugParameters

func (b *BlockchainRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*BlockchainRequest) GetSlugsMap

func (b *BlockchainRequest) GetSlugsMap() (map[string]string, error)

func (*BlockchainRequest) SetAsset

func (b *BlockchainRequest) SetAsset(Asset string) *BlockchainRequest

func (*BlockchainRequest) SetFormat

func (b *BlockchainRequest) SetFormat(Format Format) *BlockchainRequest

func (*BlockchainRequest) SetInterval

func (b *BlockchainRequest) SetInterval(Interval Interval) *BlockchainRequest

func (*BlockchainRequest) SetMetric

func (b *BlockchainRequest) SetMetric(Metric string) *BlockchainRequest

func (*BlockchainRequest) SetSince

func (b *BlockchainRequest) SetSince(Since int64) *BlockchainRequest

func (*BlockchainRequest) SetTimestampFormat

func (b *BlockchainRequest) SetTimestampFormat(TimestampFormat string) *BlockchainRequest

func (*BlockchainRequest) SetUntil

func (b *BlockchainRequest) SetUntil(Until int64) *BlockchainRequest

type Data

type Data struct {
	Timestamp Timestamp          `json:"t"`
	Value     float64            `json:"v"`
	Options   map[string]float64 `json:"o"`
}

type DefiRequest

type DefiRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*DefiRequest) Do

func (d *DefiRequest) Do(ctx context.Context) (Response, error)

func (*DefiRequest) GetParameters

func (d *DefiRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*DefiRequest) GetParametersJSON

func (d *DefiRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*DefiRequest) GetParametersQuery

func (d *DefiRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*DefiRequest) GetQueryParameters

func (d *DefiRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*DefiRequest) GetSlugParameters

func (d *DefiRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*DefiRequest) GetSlugsMap

func (d *DefiRequest) GetSlugsMap() (map[string]string, error)

func (*DefiRequest) SetAsset

func (d *DefiRequest) SetAsset(Asset string) *DefiRequest

func (*DefiRequest) SetFormat

func (d *DefiRequest) SetFormat(Format Format) *DefiRequest

func (*DefiRequest) SetInterval

func (d *DefiRequest) SetInterval(Interval Interval) *DefiRequest

func (*DefiRequest) SetMetric

func (d *DefiRequest) SetMetric(Metric string) *DefiRequest

func (*DefiRequest) SetSince

func (d *DefiRequest) SetSince(Since int64) *DefiRequest

func (*DefiRequest) SetTimestampFormat

func (d *DefiRequest) SetTimestampFormat(TimestampFormat string) *DefiRequest

func (*DefiRequest) SetUntil

func (d *DefiRequest) SetUntil(Until int64) *DefiRequest

type DerivativesRequest

type DerivativesRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*DerivativesRequest) Do

func (*DerivativesRequest) GetParameters

func (d *DerivativesRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*DerivativesRequest) GetParametersJSON

func (d *DerivativesRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*DerivativesRequest) GetParametersQuery

func (d *DerivativesRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*DerivativesRequest) GetQueryParameters

func (d *DerivativesRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*DerivativesRequest) GetSlugParameters

func (d *DerivativesRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*DerivativesRequest) GetSlugsMap

func (d *DerivativesRequest) GetSlugsMap() (map[string]string, error)

func (*DerivativesRequest) SetAsset

func (d *DerivativesRequest) SetAsset(Asset string) *DerivativesRequest

func (*DerivativesRequest) SetFormat

func (d *DerivativesRequest) SetFormat(Format Format) *DerivativesRequest

func (*DerivativesRequest) SetInterval

func (d *DerivativesRequest) SetInterval(Interval Interval) *DerivativesRequest

func (*DerivativesRequest) SetMetric

func (d *DerivativesRequest) SetMetric(Metric string) *DerivativesRequest

func (*DerivativesRequest) SetSince

func (d *DerivativesRequest) SetSince(Since int64) *DerivativesRequest

func (*DerivativesRequest) SetTimestampFormat

func (d *DerivativesRequest) SetTimestampFormat(TimestampFormat string) *DerivativesRequest

func (*DerivativesRequest) SetUntil

func (d *DerivativesRequest) SetUntil(Until int64) *DerivativesRequest

type DistributionRequest

type DistributionRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*DistributionRequest) Do

func (*DistributionRequest) GetParameters

func (d *DistributionRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*DistributionRequest) GetParametersJSON

func (d *DistributionRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*DistributionRequest) GetParametersQuery

func (d *DistributionRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*DistributionRequest) GetQueryParameters

func (d *DistributionRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*DistributionRequest) GetSlugParameters

func (d *DistributionRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*DistributionRequest) GetSlugsMap

func (d *DistributionRequest) GetSlugsMap() (map[string]string, error)

func (*DistributionRequest) SetAsset

func (d *DistributionRequest) SetAsset(Asset string) *DistributionRequest

func (*DistributionRequest) SetFormat

func (d *DistributionRequest) SetFormat(Format Format) *DistributionRequest

func (*DistributionRequest) SetInterval

func (d *DistributionRequest) SetInterval(Interval Interval) *DistributionRequest

func (*DistributionRequest) SetMetric

func (d *DistributionRequest) SetMetric(Metric string) *DistributionRequest

func (*DistributionRequest) SetSince

func (d *DistributionRequest) SetSince(Since int64) *DistributionRequest

func (*DistributionRequest) SetTimestampFormat

func (d *DistributionRequest) SetTimestampFormat(TimestampFormat string) *DistributionRequest

func (*DistributionRequest) SetUntil

func (d *DistributionRequest) SetUntil(Until int64) *DistributionRequest

type ETH2Request

type ETH2Request struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*ETH2Request) Do

func (e *ETH2Request) Do(ctx context.Context) (Response, error)

func (*ETH2Request) GetParameters

func (e *ETH2Request) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*ETH2Request) GetParametersJSON

func (e *ETH2Request) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*ETH2Request) GetParametersQuery

func (e *ETH2Request) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*ETH2Request) GetQueryParameters

func (e *ETH2Request) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*ETH2Request) GetSlugParameters

func (e *ETH2Request) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*ETH2Request) GetSlugsMap

func (e *ETH2Request) GetSlugsMap() (map[string]string, error)

func (*ETH2Request) SetAsset

func (e *ETH2Request) SetAsset(Asset string) *ETH2Request

func (*ETH2Request) SetFormat

func (e *ETH2Request) SetFormat(Format Format) *ETH2Request

func (*ETH2Request) SetInterval

func (e *ETH2Request) SetInterval(Interval Interval) *ETH2Request

func (*ETH2Request) SetMetric

func (e *ETH2Request) SetMetric(Metric string) *ETH2Request

func (*ETH2Request) SetSince

func (e *ETH2Request) SetSince(Since int64) *ETH2Request

func (*ETH2Request) SetTimestampFormat

func (e *ETH2Request) SetTimestampFormat(TimestampFormat string) *ETH2Request

func (*ETH2Request) SetUntil

func (e *ETH2Request) SetUntil(Until int64) *ETH2Request

type EntitiesRequest

type EntitiesRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*EntitiesRequest) Do

func (*EntitiesRequest) GetParameters

func (e *EntitiesRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*EntitiesRequest) GetParametersJSON

func (e *EntitiesRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*EntitiesRequest) GetParametersQuery

func (e *EntitiesRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*EntitiesRequest) GetQueryParameters

func (e *EntitiesRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*EntitiesRequest) GetSlugParameters

func (e *EntitiesRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*EntitiesRequest) GetSlugsMap

func (e *EntitiesRequest) GetSlugsMap() (map[string]string, error)

func (*EntitiesRequest) SetAsset

func (e *EntitiesRequest) SetAsset(Asset string) *EntitiesRequest

func (*EntitiesRequest) SetFormat

func (e *EntitiesRequest) SetFormat(Format Format) *EntitiesRequest

func (*EntitiesRequest) SetInterval

func (e *EntitiesRequest) SetInterval(Interval Interval) *EntitiesRequest

func (*EntitiesRequest) SetMetric

func (e *EntitiesRequest) SetMetric(Metric string) *EntitiesRequest

func (*EntitiesRequest) SetSince

func (e *EntitiesRequest) SetSince(Since int64) *EntitiesRequest

func (*EntitiesRequest) SetTimestampFormat

func (e *EntitiesRequest) SetTimestampFormat(TimestampFormat string) *EntitiesRequest

func (*EntitiesRequest) SetUntil

func (e *EntitiesRequest) SetUntil(Until int64) *EntitiesRequest

type FeesRequest

type FeesRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*FeesRequest) Do

func (f *FeesRequest) Do(ctx context.Context) (Response, error)

func (*FeesRequest) GetParameters

func (f *FeesRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*FeesRequest) GetParametersJSON

func (f *FeesRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*FeesRequest) GetParametersQuery

func (f *FeesRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*FeesRequest) GetQueryParameters

func (f *FeesRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*FeesRequest) GetSlugParameters

func (f *FeesRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*FeesRequest) GetSlugsMap

func (f *FeesRequest) GetSlugsMap() (map[string]string, error)

func (*FeesRequest) SetAsset

func (f *FeesRequest) SetAsset(Asset string) *FeesRequest

func (*FeesRequest) SetFormat

func (f *FeesRequest) SetFormat(Format Format) *FeesRequest

func (*FeesRequest) SetInterval

func (f *FeesRequest) SetInterval(Interval Interval) *FeesRequest

func (*FeesRequest) SetMetric

func (f *FeesRequest) SetMetric(Metric string) *FeesRequest

func (*FeesRequest) SetSince

func (f *FeesRequest) SetSince(Since int64) *FeesRequest

func (*FeesRequest) SetTimestampFormat

func (f *FeesRequest) SetTimestampFormat(TimestampFormat string) *FeesRequest

func (*FeesRequest) SetUntil

func (f *FeesRequest) SetUntil(Until int64) *FeesRequest

type Format

type Format string
const (
	FormatJSON Format = "JSON"
	FormatCSV  Format = "CSV"
)

type IndicatorsRequest

type IndicatorsRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*IndicatorsRequest) Do

func (*IndicatorsRequest) GetParameters

func (i *IndicatorsRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*IndicatorsRequest) GetParametersJSON

func (i *IndicatorsRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*IndicatorsRequest) GetParametersQuery

func (i *IndicatorsRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*IndicatorsRequest) GetQueryParameters

func (i *IndicatorsRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*IndicatorsRequest) GetSlugParameters

func (i *IndicatorsRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*IndicatorsRequest) GetSlugsMap

func (i *IndicatorsRequest) GetSlugsMap() (map[string]string, error)

func (*IndicatorsRequest) SetAsset

func (i *IndicatorsRequest) SetAsset(Asset string) *IndicatorsRequest

func (*IndicatorsRequest) SetFormat

func (i *IndicatorsRequest) SetFormat(Format Format) *IndicatorsRequest

func (*IndicatorsRequest) SetInterval

func (i *IndicatorsRequest) SetInterval(Interval Interval) *IndicatorsRequest

func (*IndicatorsRequest) SetMetric

func (i *IndicatorsRequest) SetMetric(Metric string) *IndicatorsRequest

func (*IndicatorsRequest) SetSince

func (i *IndicatorsRequest) SetSince(Since int64) *IndicatorsRequest

func (*IndicatorsRequest) SetTimestampFormat

func (i *IndicatorsRequest) SetTimestampFormat(TimestampFormat string) *IndicatorsRequest

func (*IndicatorsRequest) SetUntil

func (i *IndicatorsRequest) SetUntil(Until int64) *IndicatorsRequest

type InstitutionsRequest

type InstitutionsRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*InstitutionsRequest) Do

func (*InstitutionsRequest) GetParameters

func (i *InstitutionsRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*InstitutionsRequest) GetParametersJSON

func (i *InstitutionsRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*InstitutionsRequest) GetParametersQuery

func (i *InstitutionsRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*InstitutionsRequest) GetQueryParameters

func (i *InstitutionsRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*InstitutionsRequest) GetSlugParameters

func (i *InstitutionsRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*InstitutionsRequest) GetSlugsMap

func (i *InstitutionsRequest) GetSlugsMap() (map[string]string, error)

func (*InstitutionsRequest) SetAsset

func (i *InstitutionsRequest) SetAsset(Asset string) *InstitutionsRequest

func (*InstitutionsRequest) SetFormat

func (i *InstitutionsRequest) SetFormat(Format Format) *InstitutionsRequest

func (*InstitutionsRequest) SetInterval

func (i *InstitutionsRequest) SetInterval(Interval Interval) *InstitutionsRequest

func (*InstitutionsRequest) SetMetric

func (i *InstitutionsRequest) SetMetric(Metric string) *InstitutionsRequest

func (*InstitutionsRequest) SetSince

func (i *InstitutionsRequest) SetSince(Since int64) *InstitutionsRequest

func (*InstitutionsRequest) SetTimestampFormat

func (i *InstitutionsRequest) SetTimestampFormat(TimestampFormat string) *InstitutionsRequest

func (*InstitutionsRequest) SetUntil

func (i *InstitutionsRequest) SetUntil(Until int64) *InstitutionsRequest

type Interval

type Interval string
const (
	Interval1h  Interval = "1h"
	Interval24h Interval = "24h"
	Interval10m Interval = "10m"
	Interval1w  Interval = "1w"
	Interval1m  Interval = "1month"
)

type LightningRequest

type LightningRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*LightningRequest) Do

func (*LightningRequest) GetParameters

func (l *LightningRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*LightningRequest) GetParametersJSON

func (l *LightningRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*LightningRequest) GetParametersQuery

func (l *LightningRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*LightningRequest) GetQueryParameters

func (l *LightningRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*LightningRequest) GetSlugParameters

func (l *LightningRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*LightningRequest) GetSlugsMap

func (l *LightningRequest) GetSlugsMap() (map[string]string, error)

func (*LightningRequest) SetAsset

func (l *LightningRequest) SetAsset(Asset string) *LightningRequest

func (*LightningRequest) SetFormat

func (l *LightningRequest) SetFormat(Format Format) *LightningRequest

func (*LightningRequest) SetInterval

func (l *LightningRequest) SetInterval(Interval Interval) *LightningRequest

func (*LightningRequest) SetMetric

func (l *LightningRequest) SetMetric(Metric string) *LightningRequest

func (*LightningRequest) SetSince

func (l *LightningRequest) SetSince(Since int64) *LightningRequest

func (*LightningRequest) SetTimestampFormat

func (l *LightningRequest) SetTimestampFormat(TimestampFormat string) *LightningRequest

func (*LightningRequest) SetUntil

func (l *LightningRequest) SetUntil(Until int64) *LightningRequest

type MarketRequest

type MarketRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*MarketRequest) Do

func (m *MarketRequest) Do(ctx context.Context) (Response, error)

func (*MarketRequest) GetParameters

func (m *MarketRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*MarketRequest) GetParametersJSON

func (m *MarketRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*MarketRequest) GetParametersQuery

func (m *MarketRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*MarketRequest) GetQueryParameters

func (m *MarketRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*MarketRequest) GetSlugParameters

func (m *MarketRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*MarketRequest) GetSlugsMap

func (m *MarketRequest) GetSlugsMap() (map[string]string, error)

func (*MarketRequest) SetAsset

func (m *MarketRequest) SetAsset(Asset string) *MarketRequest

func (*MarketRequest) SetFormat

func (m *MarketRequest) SetFormat(Format Format) *MarketRequest

func (*MarketRequest) SetInterval

func (m *MarketRequest) SetInterval(Interval Interval) *MarketRequest

func (*MarketRequest) SetMetric

func (m *MarketRequest) SetMetric(Metric string) *MarketRequest

func (*MarketRequest) SetSince

func (m *MarketRequest) SetSince(Since int64) *MarketRequest

func (*MarketRequest) SetTimestampFormat

func (m *MarketRequest) SetTimestampFormat(TimestampFormat string) *MarketRequest

func (*MarketRequest) SetUntil

func (m *MarketRequest) SetUntil(Until int64) *MarketRequest

type MempoolRequest

type MempoolRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*MempoolRequest) Do

func (*MempoolRequest) GetParameters

func (m *MempoolRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*MempoolRequest) GetParametersJSON

func (m *MempoolRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*MempoolRequest) GetParametersQuery

func (m *MempoolRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*MempoolRequest) GetQueryParameters

func (m *MempoolRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*MempoolRequest) GetSlugParameters

func (m *MempoolRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*MempoolRequest) GetSlugsMap

func (m *MempoolRequest) GetSlugsMap() (map[string]string, error)

func (*MempoolRequest) SetAsset

func (m *MempoolRequest) SetAsset(Asset string) *MempoolRequest

func (*MempoolRequest) SetFormat

func (m *MempoolRequest) SetFormat(Format Format) *MempoolRequest

func (*MempoolRequest) SetInterval

func (m *MempoolRequest) SetInterval(Interval Interval) *MempoolRequest

func (*MempoolRequest) SetMetric

func (m *MempoolRequest) SetMetric(Metric string) *MempoolRequest

func (*MempoolRequest) SetSince

func (m *MempoolRequest) SetSince(Since int64) *MempoolRequest

func (*MempoolRequest) SetTimestampFormat

func (m *MempoolRequest) SetTimestampFormat(TimestampFormat string) *MempoolRequest

func (*MempoolRequest) SetUntil

func (m *MempoolRequest) SetUntil(Until int64) *MempoolRequest

type MiningRequest

type MiningRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*MiningRequest) Do

func (m *MiningRequest) Do(ctx context.Context) (Response, error)

func (*MiningRequest) GetParameters

func (m *MiningRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*MiningRequest) GetParametersJSON

func (m *MiningRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*MiningRequest) GetParametersQuery

func (m *MiningRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*MiningRequest) GetQueryParameters

func (m *MiningRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*MiningRequest) GetSlugParameters

func (m *MiningRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*MiningRequest) GetSlugsMap

func (m *MiningRequest) GetSlugsMap() (map[string]string, error)

func (*MiningRequest) SetAsset

func (m *MiningRequest) SetAsset(Asset string) *MiningRequest

func (*MiningRequest) SetFormat

func (m *MiningRequest) SetFormat(Format Format) *MiningRequest

func (*MiningRequest) SetInterval

func (m *MiningRequest) SetInterval(Interval Interval) *MiningRequest

func (*MiningRequest) SetMetric

func (m *MiningRequest) SetMetric(Metric string) *MiningRequest

func (*MiningRequest) SetSince

func (m *MiningRequest) SetSince(Since int64) *MiningRequest

func (*MiningRequest) SetTimestampFormat

func (m *MiningRequest) SetTimestampFormat(TimestampFormat string) *MiningRequest

func (*MiningRequest) SetUntil

func (m *MiningRequest) SetUntil(Until int64) *MiningRequest

type ProtocolsRequest

type ProtocolsRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*ProtocolsRequest) Do

func (*ProtocolsRequest) GetParameters

func (p *ProtocolsRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*ProtocolsRequest) GetParametersJSON

func (p *ProtocolsRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*ProtocolsRequest) GetParametersQuery

func (p *ProtocolsRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*ProtocolsRequest) GetQueryParameters

func (p *ProtocolsRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*ProtocolsRequest) GetSlugParameters

func (p *ProtocolsRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*ProtocolsRequest) GetSlugsMap

func (p *ProtocolsRequest) GetSlugsMap() (map[string]string, error)

func (*ProtocolsRequest) SetAsset

func (p *ProtocolsRequest) SetAsset(Asset string) *ProtocolsRequest

func (*ProtocolsRequest) SetFormat

func (p *ProtocolsRequest) SetFormat(Format Format) *ProtocolsRequest

func (*ProtocolsRequest) SetInterval

func (p *ProtocolsRequest) SetInterval(Interval Interval) *ProtocolsRequest

func (*ProtocolsRequest) SetMetric

func (p *ProtocolsRequest) SetMetric(Metric string) *ProtocolsRequest

func (*ProtocolsRequest) SetSince

func (p *ProtocolsRequest) SetSince(Since int64) *ProtocolsRequest

func (*ProtocolsRequest) SetTimestampFormat

func (p *ProtocolsRequest) SetTimestampFormat(TimestampFormat string) *ProtocolsRequest

func (*ProtocolsRequest) SetUntil

func (p *ProtocolsRequest) SetUntil(Until int64) *ProtocolsRequest

type Response

type Response []Data

In Glassnode API, there are two types of response, for example:

/v1/metrics/market/marketcap_usd

[
	{
		"t": 1614556800,
		"v": 927789865185.0476
	},
	...
]

and

/v1/metrics/market/price_usd_ohlc

[
	{
		"t": 1614556800,
		"o": {
			"c": 49768.16035012147,
			"h": 49773.18922304233,
			"l": 45159.50305252744,
			"o": 45159.50305252744
		}
	},
	...
]

both can be stored into the Response structure.

Note: use `HasOptions` to verify the type of response.

func (Response) First

func (s Response) First() Data

func (Response) FirstOptions

func (s Response) FirstOptions() map[string]float64

func (Response) FirstValue

func (s Response) FirstValue() float64

func (Response) HasOptions

func (s Response) HasOptions() bool

func (Response) IsEmpty

func (s Response) IsEmpty() bool

func (Response) Last

func (s Response) Last() Data

func (Response) LastOptions

func (s Response) LastOptions() map[string]float64

func (Response) LastValue

func (s Response) LastValue() float64

type RestClient

type RestClient struct {
	BaseURL *url.URL
	Client  *http.Client
	// contains filtered or unexported fields
}

func NewRestClient

func NewRestClient() *RestClient

func (*RestClient) Auth

func (c *RestClient) Auth(apiKey string)

func (*RestClient) NewAuthenticatedRequest

func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)

func (*RestClient) NewRequest

func (c *RestClient) NewRequest(ctx context.Context, method string, refURL string, params url.Values, payload interface{}) (*http.Request, error)

func (*RestClient) SendRequest

func (c *RestClient) SendRequest(req *http.Request) (*requestgen.Response, error)

type SupplyRequest

type SupplyRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*SupplyRequest) Do

func (s *SupplyRequest) Do(ctx context.Context) (Response, error)

func (*SupplyRequest) GetParameters

func (s *SupplyRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*SupplyRequest) GetParametersJSON

func (s *SupplyRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*SupplyRequest) GetParametersQuery

func (s *SupplyRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*SupplyRequest) GetQueryParameters

func (s *SupplyRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*SupplyRequest) GetSlugParameters

func (s *SupplyRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*SupplyRequest) GetSlugsMap

func (s *SupplyRequest) GetSlugsMap() (map[string]string, error)

func (*SupplyRequest) SetAsset

func (s *SupplyRequest) SetAsset(Asset string) *SupplyRequest

func (*SupplyRequest) SetFormat

func (s *SupplyRequest) SetFormat(Format Format) *SupplyRequest

func (*SupplyRequest) SetInterval

func (s *SupplyRequest) SetInterval(Interval Interval) *SupplyRequest

func (*SupplyRequest) SetMetric

func (s *SupplyRequest) SetMetric(Metric string) *SupplyRequest

func (*SupplyRequest) SetSince

func (s *SupplyRequest) SetSince(Since int64) *SupplyRequest

func (*SupplyRequest) SetTimestampFormat

func (s *SupplyRequest) SetTimestampFormat(TimestampFormat string) *SupplyRequest

func (*SupplyRequest) SetUntil

func (s *SupplyRequest) SetUntil(Until int64) *SupplyRequest

type Timestamp

type Timestamp time.Time

func (Timestamp) String

func (t Timestamp) String() string

func (Timestamp) Unix

func (t Timestamp) Unix() float64

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(o []byte) error

type TransactionsRequest

type TransactionsRequest struct {
	Client requestgen.AuthenticatedAPIClient

	Asset           string   `param:"a,required,query"`
	Since           int64    `param:"s,query"`
	Until           int64    `param:"u,query"`
	Interval        Interval `param:"i,query"`
	Format          Format   `param:"f,query"`
	TimestampFormat string   `param:"timestamp_format,query"`

	Metric string `param:"metric,slug"`
}

func (*TransactionsRequest) Do

func (*TransactionsRequest) GetParameters

func (t *TransactionsRequest) GetParameters() (map[string]interface{}, error)

GetParameters builds and checks the parameters and return the result in a map object

func (*TransactionsRequest) GetParametersJSON

func (t *TransactionsRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*TransactionsRequest) GetParametersQuery

func (t *TransactionsRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*TransactionsRequest) GetQueryParameters

func (t *TransactionsRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*TransactionsRequest) GetSlugParameters

func (t *TransactionsRequest) GetSlugParameters() (map[string]interface{}, error)

GetSlugParameters builds and checks the slug parameters and return the result in a map object

func (*TransactionsRequest) GetSlugsMap

func (t *TransactionsRequest) GetSlugsMap() (map[string]string, error)

func (*TransactionsRequest) SetAsset

func (t *TransactionsRequest) SetAsset(Asset string) *TransactionsRequest

func (*TransactionsRequest) SetFormat

func (t *TransactionsRequest) SetFormat(Format Format) *TransactionsRequest

func (*TransactionsRequest) SetInterval

func (t *TransactionsRequest) SetInterval(Interval Interval) *TransactionsRequest

func (*TransactionsRequest) SetMetric

func (t *TransactionsRequest) SetMetric(Metric string) *TransactionsRequest

func (*TransactionsRequest) SetSince

func (t *TransactionsRequest) SetSince(Since int64) *TransactionsRequest

func (*TransactionsRequest) SetTimestampFormat

func (t *TransactionsRequest) SetTimestampFormat(TimestampFormat string) *TransactionsRequest

func (*TransactionsRequest) SetUntil

func (t *TransactionsRequest) SetUntil(Until int64) *TransactionsRequest

Jump to

Keyboard shortcuts

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