tzstats

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Collapse1m = 1 * time.Minute
	Collapse1h = 1 * time.Hour
	Collapse1d = 24 * time.Hour
	Collapse1w = 7 * 24 * time.Hour
)

Variables

View Source
var (
	ClientVersion    = "0.17.0"
	DefaultLimit     = 50000
	DefaultCacheSize = 2048

	DefaultClient *Client
	IpfsClient    *Client
)
View Source
var Schemas = map[string]func() interface{}{
	"alias":    func() interface{} { return new(AliasMetadata) },
	"baker":    func() interface{} { return new(BakerMetadata) },
	"payout":   func() interface{} { return new(PayoutMetadata) },
	"asset":    func() interface{} { return new(AssetMetadata) },
	"dex":      func() interface{} { return new(DexMetadata) },
	"location": func() interface{} { return new(LocationMetadata) },
	"domain":   func() interface{} { return new(DomainMetadata) },
	"media":    func() interface{} { return new(MediaMetadata) },
	"rights":   func() interface{} { return new(RightsMetadata) },
	"social":   func() interface{} { return new(SocialMetadata) },
	"tz16":     func() interface{} { return new(contract.Tz16) },
	"tz21":     func() interface{} { return new(Tz21Metadata) },
	"updated":  func() interface{} { return new(UpdatedMetadata) },
}

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func ErrorStatus

func ErrorStatus(err error) int

func IsBase64

func IsBase64(s string) bool

func ParseU64 added in v0.15.0

func ParseU64(s string) (u uint64)

func ToRawString

func ToRawString(t interface{}) (string, error)

func ToString

func ToString(t interface{}) string

func UseLogger

func UseLogger(logger log.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type Account

type Account struct {
	RowId              uint64              `json:"row_id"`
	Address            tezos.Address       `json:"address"`
	AddressType        tezos.AddressType   `json:"address_type"`
	Pubkey             tezos.Key           `json:"pubkey"`
	Counter            int64               `json:"counter"`
	BakerId            uint64              `json:"baker_id,omitempty"`
	Baker              *tezos.Address      `json:"baker,omitempty"`
	CreatorId          uint64              `json:"creator_id,omitempty"`
	Creator            *tezos.Address      `json:"creator,omitempty"`
	FirstIn            int64               `json:"first_in"`
	FirstOut           int64               `json:"first_out"`
	FirstSeen          int64               `json:"first_seen"`
	LastIn             int64               `json:"last_in"`
	LastOut            int64               `json:"last_out"`
	LastSeen           int64               `json:"last_seen"`
	FirstSeenTime      time.Time           `json:"first_seen_time"`
	LastSeenTime       time.Time           `json:"last_seen_time"`
	FirstInTime        time.Time           `json:"first_in_time"`
	LastInTime         time.Time           `json:"last_in_time"`
	FirstOutTime       time.Time           `json:"first_out_time"`
	LastOutTime        time.Time           `json:"last_out_time"`
	DelegatedSince     int64               `json:"delegated_since"`
	DelegatedSinceTime time.Time           `json:"delegated_since_time"`
	TotalReceived      float64             `json:"total_received"`
	TotalSent          float64             `json:"total_sent"`
	TotalBurned        float64             `json:"total_burned"`
	TotalFeesPaid      float64             `json:"total_fees_paid"`
	TotalFeesUsed      float64             `json:"total_fees_used"`
	UnclaimedBalance   float64             `json:"unclaimed_balance,omitempty"`
	SpendableBalance   float64             `json:"spendable_balance"`
	FrozenBond         float64             `json:"frozen_bond"`
	LostBond           float64             `json:"lost_bond"`
	IsFunded           bool                `json:"is_funded"`
	IsActivated        bool                `json:"is_activated"`
	IsDelegated        bool                `json:"is_delegated"`
	IsRevealed         bool                `json:"is_revealed"`
	IsBaker            bool                `json:"is_baker"`
	IsContract         bool                `json:"is_contract"`
	NTxSuccess         int                 `json:"n_tx_success"`
	NTxFailed          int                 `json:"n_tx_failed"`
	NTxOut             int                 `json:"n_tx_out"`
	NTxIn              int                 `json:"n_tx_in"`
	LifetimeRewards    float64             `json:"lifetime_rewards,omitempty"`
	PendingRewards     float64             `json:"pending_rewards,omitempty"`
	Metadata           map[string]Metadata `json:"metadata,omitempty" tzpro:"notable"`
	// contains filtered or unexported fields
}

func (*Account) UnmarshalJSON

func (a *Account) UnmarshalJSON(data []byte) error

func (*Account) UnmarshalJSONBrief

func (a *Account) UnmarshalJSONBrief(data []byte) error

type AccountList

type AccountList struct {
	Rows []*Account
	// contains filtered or unexported fields
}

func (AccountList) Cursor

func (l AccountList) Cursor() uint64

func (AccountList) Len

func (l AccountList) Len() int

func (*AccountList) UnmarshalJSON

func (l *AccountList) UnmarshalJSON(data []byte) error

type AccountParams

type AccountParams struct {
	Params
}

func NewAccountParams

func NewAccountParams() AccountParams

func (AccountParams) WithCursor

func (p AccountParams) WithCursor(v uint64) AccountParams

func (AccountParams) WithLimit

func (p AccountParams) WithLimit(v uint) AccountParams

func (AccountParams) WithMeta

func (p AccountParams) WithMeta() AccountParams

func (AccountParams) WithOffset

func (p AccountParams) WithOffset(v uint) AccountParams

func (AccountParams) WithOrder

func (p AccountParams) WithOrder(v OrderType) AccountParams

type AccountQuery

type AccountQuery struct {
	// contains filtered or unexported fields
}

func (AccountQuery) Check

func (p AccountQuery) Check() error

func (*AccountQuery) ReplaceFilter

func (q *AccountQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*AccountQuery) ResetFilter

func (q *AccountQuery) ResetFilter() TableQuery

func (AccountQuery) Run

func (q AccountQuery) Run(ctx context.Context) (*AccountList, error)

func (AccountQuery) Url

func (p AccountQuery) Url() string

func (*AccountQuery) WithColumns

func (q *AccountQuery) WithColumns(cols ...string) TableQuery

func (*AccountQuery) WithCursor

func (q *AccountQuery) WithCursor(c uint64) TableQuery

func (*AccountQuery) WithDesc

func (q *AccountQuery) WithDesc() TableQuery

func (*AccountQuery) WithFilter

func (q *AccountQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*AccountQuery) WithFormat

func (q *AccountQuery) WithFormat(format FormatType) TableQuery

func (*AccountQuery) WithLimit

func (q *AccountQuery) WithLimit(limit int) TableQuery

func (*AccountQuery) WithOrder

func (q *AccountQuery) WithOrder(order OrderType) TableQuery

func (*AccountQuery) WithPrim

func (q *AccountQuery) WithPrim() TableQuery

func (*AccountQuery) WithQuiet

func (q *AccountQuery) WithQuiet() TableQuery

func (*AccountQuery) WithVerbose

func (q *AccountQuery) WithVerbose() TableQuery

type AliasMetadata

type AliasMetadata struct {
	Name        string   `json:"name"`
	Kind        string   `json:"kind"`
	Description string   `json:"description,omitempty"`
	Category    string   `json:"category,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

type ApiError

type ApiError struct {
	Code      int    `json:"code"`
	Status    int    `json:"status"`
	Message   string `json:"message"`
	Scope     string `json:"scope"`
	Detail    string `json:"detail"`
	RequestId string `json:"requestId"`
	Reason    string `json:"reason"`
}

func (ApiError) Error

func (e ApiError) Error() string

type ApiErrors

type ApiErrors struct {
	Errors []ApiError `json:"errors"`
}

func IsApiError

func IsApiError(err error) (ApiErrors, bool)

func (ApiErrors) Error

func (e ApiErrors) Error() string

func (*ApiErrors) UnmarshalJSON

func (e *ApiErrors) UnmarshalJSON(buf []byte) error

type AssetMetadata

type AssetMetadata struct {
	Standard string `json:"standard,omitempty"`
	Symbol   string `json:"symbol,omitempty"`
	Decimals int    `json:"decimals,omitempty"`
	Version  string `json:"version,omitempty"`
	Homepage string `json:"homepage,omitempty"`
}

type Baker

type Baker struct {
	Address           tezos.Address    `json:"address"`
	BakerSince        time.Time        `json:"baker_since_time"`
	BakerUntil        *time.Time       `json:"baker_until,omitempty"`
	GracePeriod       int64            `json:"grace_period"`
	BakerVersion      string           `json:"baker_version"`
	TotalBalance      float64          `json:"total_balance"`
	SpendableBalance  float64          `json:"spendable_balance"`
	FrozenBalance     float64          `json:"frozen_balance"`
	DelegatedBalance  float64          `json:"delegated_balance"`
	StakingBalance    float64          `json:"staking_balance"`
	StakingCapacity   float64          `json:"staking_capacity"`
	DepositsLimit     *float64         `json:"deposits_limit"`
	StakingShare      float64          `json:"staking_share"`
	ActiveDelegations int64            `json:"active_delegations"`
	IsFull            bool             `json:"is_full"`
	IsActive          bool             `json:"is_active"`
	Events            *BakerEvents     `json:"events,omitempty"`
	Stats             *BakerStatistics `json:"stats,omitempty"`
	Metadata          *Metadata        `json:"metadata,omitempty"`
}

type BakerEvents

type BakerEvents struct {
	LastBakeHeight    int64     `json:"last_bake_height"`
	LastBakeBlock     string    `json:"last_bake_block"`
	LastBakeTime      time.Time `json:"last_bake_time"`
	LastEndorseHeight int64     `json:"last_endorse_height"`
	LastEndorseBlock  string    `json:"last_endorse_block"`
	LastEndorseTime   time.Time `json:"last_endorse_time"`
	NextBakeHeight    int64     `json:"next_bake_height"`
	NextBakeTime      time.Time `json:"next_bake_time"`
	NextEndorseHeight int64     `json:"next_endorse_height"`
	NextEndorseTime   time.Time `json:"next_endorse_time"`
}

type BakerMetadata

type BakerMetadata struct {
	Status         string  `json:"status,omitempty"`
	Fee            float64 `json:"fee,omitempty"`
	PayoutDelay    bool    `json:"payout_delay,omitempty"`
	MinPayout      float64 `json:"min_payout,omitempty"`
	MinDelegation  float64 `json:"min_delegation,omitempty"`
	NonDelegatable bool    `json:"non_delegatable,omitempty"`
	Sponsored      bool    `json:"sponsored,omitempty"`
}

type BakerParams

type BakerParams struct {
	Params
}

func NewBakerParams

func NewBakerParams() BakerParams

func (BakerParams) WithCursor

func (p BakerParams) WithCursor(v uint) BakerParams

func (BakerParams) WithLimit

func (p BakerParams) WithLimit(v uint) BakerParams

func (BakerParams) WithMeta

func (p BakerParams) WithMeta() BakerParams

func (BakerParams) WithOffset

func (p BakerParams) WithOffset(v uint) BakerParams

type BakerStatistics

type BakerStatistics struct {
	TotalRewardsEarned float64 `json:"total_rewards_earned"`
	TotalFeesEarned    float64 `json:"total_fees_earned"`
	TotalLost          float64 `json:"total_lost"`
	BlocksBaked        int64   `json:"blocks_baked"`
	BlocksProposed     int64   `json:"blocks_proposed"`
	SlotsEndorsed      int64   `json:"slots_endorsed"`
	AvgLuck64          int64   `json:"avg_luck_64"`
	AvgPerformance64   int64   `json:"avg_performance_64"`
	AvgContribution64  int64   `json:"avg_contribution_64"`
	NBakerOps          int64   `json:"n_baker_ops"`
	NProposal          int64   `json:"n_proposals"`
	NBallot            int64   `json:"n_ballots"`
	NEndorsement       int64   `json:"n_endorsements"`
	NPreendorsement    int64   `json:"n_preendorsements"`
	NSeedNonce         int64   `json:"n_nonce_revelations"`
	N2Baking           int64   `json:"n_double_bakings"`
	N2Endorsement      int64   `json:"n_double_endorsements"`
	NSetDepositsLimit  int64   `json:"n_set_limits"`
}

type Ballot

type Ballot struct {
	RowId            uint64                 `json:"row_id"`
	Height           int64                  `json:"height"`
	Timestamp        time.Time              `json:"time"`
	ElectionId       int                    `json:"election_id"`
	VotingPeriod     int64                  `json:"voting_period"`
	VotingPeriodKind tezos.VotingPeriodKind `json:"voting_period_kind"`
	Proposal         tezos.ProtocolHash     `json:"proposal"`
	OpHash           tezos.OpHash           `json:"op"`
	Ballot           tezos.BallotVote       `json:"ballot"`
	Rolls            int64                  `json:"rolls"`
	Sender           tezos.Address          `json:"sender"`
}

type Bigmap

type Bigmap struct {
	Contract       tezos.Address     `json:"contract"`
	BigmapId       int64             `json:"bigmap_id"`
	NUpdates       int64             `json:"n_updates"`
	NKeys          int64             `json:"n_keys"`
	AllocateHeight int64             `json:"alloc_height"`
	AllocateBlock  tezos.BlockHash   `json:"alloc_block"`
	AllocateTime   time.Time         `json:"alloc_time"`
	UpdateHeight   int64             `json:"update_height"`
	UpdateBlock    tezos.BlockHash   `json:"update_block"`
	UpdateTime     time.Time         `json:"update_time"`
	DeleteHeight   int64             `json:"delete_height"`
	DeleteBlock    tezos.BlockHash   `json:"delete_block"`
	DeleteTime     time.Time         `json:"delete_time"`
	KeyType        micheline.Typedef `json:"key_type"`
	ValueType      micheline.Typedef `json:"value_type"`
	KeyTypePrim    micheline.Prim    `json:"key_type_prim"`
	ValueTypePrim  micheline.Prim    `json:"value_type_prim"`
}

func (Bigmap) MakeKeyType

func (b Bigmap) MakeKeyType() micheline.Type

func (Bigmap) MakeValueType

func (b Bigmap) MakeValueType() micheline.Type

type BigmapKey

type BigmapKey struct {
	Key     MultiKey        `json:"key"`
	KeyHash tezos.ExprHash  `json:"hash"`
	Meta    *BigmapMeta     `json:"meta"`
	Prim    *micheline.Prim `json:"prim"`
}

type BigmapMeta

type BigmapMeta struct {
	Contract     tezos.Address `json:"contract"`
	BigmapId     int64         `json:"bigmap_id"`
	UpdateTime   time.Time     `json:"time"`
	UpdateHeight int64         `json:"height"`
	UpdateOp     tezos.OpHash  `json:"op"`
	Sender       tezos.Address `json:"sender"`
	Source       tezos.Address `json:"source"`
}

type BigmapQuery

type BigmapQuery struct {
	// contains filtered or unexported fields
}

func (BigmapQuery) Check

func (p BigmapQuery) Check() error

func (*BigmapQuery) ReplaceFilter

func (q *BigmapQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BigmapQuery) ResetFilter

func (q *BigmapQuery) ResetFilter() TableQuery

func (BigmapQuery) Run

func (BigmapQuery) Url

func (p BigmapQuery) Url() string

func (*BigmapQuery) WithColumns

func (q *BigmapQuery) WithColumns(cols ...string) TableQuery

func (*BigmapQuery) WithCursor

func (q *BigmapQuery) WithCursor(c uint64) TableQuery

func (*BigmapQuery) WithDesc

func (q *BigmapQuery) WithDesc() TableQuery

func (*BigmapQuery) WithFilter

func (q *BigmapQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BigmapQuery) WithFormat

func (q *BigmapQuery) WithFormat(format FormatType) TableQuery

func (*BigmapQuery) WithLimit

func (q *BigmapQuery) WithLimit(limit int) TableQuery

func (*BigmapQuery) WithOrder

func (q *BigmapQuery) WithOrder(order OrderType) TableQuery

func (*BigmapQuery) WithPrim

func (q *BigmapQuery) WithPrim() TableQuery

func (*BigmapQuery) WithQuiet

func (q *BigmapQuery) WithQuiet() TableQuery

func (*BigmapQuery) WithVerbose

func (q *BigmapQuery) WithVerbose() TableQuery

type BigmapRow

type BigmapRow struct {
	RowId        uint64          `json:"row_id"`
	Contract     tezos.Address   `json:"contract"`
	AccountId    uint64          `json:"account_id"`
	BigmapId     int64           `json:"bigmap_id"`
	NUpdates     int64           `json:"n_updates"`
	NKeys        int64           `json:"n_keys"`
	AllocHeight  int64           `json:"alloc_height"`
	AllocTime    time.Time       `json:"alloc_time"`
	AllocBlock   tezos.BlockHash `json:"alloc_block"`
	UpdateHeight int64           `json:"update_height"`
	UpdateTime   time.Time       `json:"update_time"`
	UpdateBlock  tezos.BlockHash `json:"update_block"`
	DeleteHeight int64           `json:"delete_height"`
	DeleteBlock  tezos.BlockHash `json:"delete_block"`
	DeleteTime   time.Time       `json:"delete_time"`
	KeyType      string          `json:"key_type"`
	ValueType    string          `json:"value_type"`
	// contains filtered or unexported fields
}

func (BigmapRow) DecodeKeyType

func (r BigmapRow) DecodeKeyType() (micheline.Type, error)

func (BigmapRow) DecodeValueType

func (r BigmapRow) DecodeValueType() (micheline.Type, error)

func (*BigmapRow) UnmarshalJSON

func (b *BigmapRow) UnmarshalJSON(data []byte) error

func (*BigmapRow) UnmarshalJSONBrief

func (b *BigmapRow) UnmarshalJSONBrief(data []byte) error

type BigmapRowList

type BigmapRowList struct {
	Rows []*BigmapRow
	// contains filtered or unexported fields
}

func (BigmapRowList) Cursor

func (l BigmapRowList) Cursor() uint64

func (BigmapRowList) Len

func (l BigmapRowList) Len() int

func (*BigmapRowList) UnmarshalJSON

func (l *BigmapRowList) UnmarshalJSON(data []byte) error

type BigmapUpdate

type BigmapUpdate struct {
	BigmapValue
	Action        micheline.DiffAction `json:"action"`
	KeyType       *micheline.Typedef   `json:"key_type,omitempty"`
	ValueType     *micheline.Typedef   `json:"value_type,omitempty"`
	KeyTypePrim   *micheline.Prim      `json:"key_type_prim,omitempty"`
	ValueTypePrim *micheline.Prim      `json:"value_type_prim,omitempty"`
	BigmapId      int64                `json:"bigmap_id"`
	SourceId      int64                `json:"source_big_map,omitempty"`
	DestId        int64                `json:"destination_big_map,omitempty"`
}

func (BigmapUpdate) Event added in v0.15.0

func (u BigmapUpdate) Event() (ev micheline.BigmapEvent)

type BigmapUpdateQuery

type BigmapUpdateQuery struct {
	// contains filtered or unexported fields
}

func (BigmapUpdateQuery) Check

func (p BigmapUpdateQuery) Check() error

func (*BigmapUpdateQuery) ReplaceFilter

func (q *BigmapUpdateQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BigmapUpdateQuery) ResetFilter

func (q *BigmapUpdateQuery) ResetFilter() TableQuery

func (BigmapUpdateQuery) Run

func (BigmapUpdateQuery) Url

func (p BigmapUpdateQuery) Url() string

func (*BigmapUpdateQuery) WithColumns

func (q *BigmapUpdateQuery) WithColumns(cols ...string) TableQuery

func (*BigmapUpdateQuery) WithCursor

func (q *BigmapUpdateQuery) WithCursor(c uint64) TableQuery

func (*BigmapUpdateQuery) WithDesc

func (q *BigmapUpdateQuery) WithDesc() TableQuery

func (*BigmapUpdateQuery) WithFilter

func (q *BigmapUpdateQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BigmapUpdateQuery) WithFormat

func (q *BigmapUpdateQuery) WithFormat(format FormatType) TableQuery

func (*BigmapUpdateQuery) WithLimit

func (q *BigmapUpdateQuery) WithLimit(limit int) TableQuery

func (*BigmapUpdateQuery) WithOrder

func (q *BigmapUpdateQuery) WithOrder(order OrderType) TableQuery

func (*BigmapUpdateQuery) WithPrim

func (q *BigmapUpdateQuery) WithPrim() TableQuery

func (*BigmapUpdateQuery) WithQuiet

func (q *BigmapUpdateQuery) WithQuiet() TableQuery

func (*BigmapUpdateQuery) WithVerbose

func (q *BigmapUpdateQuery) WithVerbose() TableQuery

type BigmapUpdateRow

type BigmapUpdateRow struct {
	RowId    uint64               `json:"row_id"`
	BigmapId int64                `json:"bigmap_id"`
	Action   micheline.DiffAction `json:"action"`
	KeyId    uint64               `json:"key_id"`
	Hash     tezos.ExprHash       `json:"hash,omitempty"`
	Key      string               `json:"key,omitempty"`
	Value    string               `json:"value,omitempty"`
	Height   int64                `json:"height"`
	Time     time.Time            `json:"time"`
	// contains filtered or unexported fields
}

func (BigmapUpdateRow) DecodeKey

func (r BigmapUpdateRow) DecodeKey(typ micheline.Type) (micheline.Key, error)

Update/Remove only

func (BigmapUpdateRow) DecodeKeyType

func (r BigmapUpdateRow) DecodeKeyType() (micheline.Type, error)

Alloc/Copy only

func (BigmapUpdateRow) DecodeValue

func (r BigmapUpdateRow) DecodeValue(typ micheline.Type) (micheline.Value, error)

Update only

func (BigmapUpdateRow) DecodeValueType

func (r BigmapUpdateRow) DecodeValueType() (micheline.Type, error)

Alloc/Copy only

func (BigmapUpdateRow) Event added in v0.15.0

func (r BigmapUpdateRow) Event() (ev micheline.BigmapEvent)

func (*BigmapUpdateRow) UnmarshalJSON

func (b *BigmapUpdateRow) UnmarshalJSON(data []byte) error

func (*BigmapUpdateRow) UnmarshalJSONBrief

func (b *BigmapUpdateRow) UnmarshalJSONBrief(data []byte) error

type BigmapUpdateRowList

type BigmapUpdateRowList struct {
	Rows []*BigmapUpdateRow
	// contains filtered or unexported fields
}

func (BigmapUpdateRowList) Cursor

func (l BigmapUpdateRowList) Cursor() uint64

func (BigmapUpdateRowList) Events added in v0.15.0

func (BigmapUpdateRowList) Len

func (l BigmapUpdateRowList) Len() int

func (*BigmapUpdateRowList) UnmarshalJSON

func (l *BigmapUpdateRowList) UnmarshalJSON(data []byte) error

type BigmapUpdates added in v0.15.0

type BigmapUpdates []BigmapUpdate

func (BigmapUpdates) Events added in v0.15.0

func (l BigmapUpdates) Events() (ev micheline.BigmapEvents)

type BigmapValue

type BigmapValue struct {
	Key       MultiKey        `json:"key"`
	Hash      tezos.ExprHash  `json:"hash"`
	Meta      *BigmapMeta     `json:"meta,omitempty"`
	Value     interface{}     `json:"value,omitempty"`
	Height    int64           `json:"height"`
	Time      time.Time       `json:"time"`
	KeyPrim   *micheline.Prim `json:"key_prim,omitempty"`
	ValuePrim *micheline.Prim `json:"value_prim,omitempty"`
}

func (BigmapValue) GetAddress

func (v BigmapValue) GetAddress(path string) (tezos.Address, bool)

func (BigmapValue) GetBig

func (v BigmapValue) GetBig(path string) (*big.Int, bool)

func (BigmapValue) GetInt64

func (v BigmapValue) GetInt64(path string) (int64, bool)

func (BigmapValue) GetString

func (v BigmapValue) GetString(path string) (string, bool)

func (BigmapValue) GetTime

func (v BigmapValue) GetTime(path string) (time.Time, bool)

func (BigmapValue) GetValue

func (v BigmapValue) GetValue(path string) (interface{}, bool)

func (BigmapValue) GetZ added in v0.15.0

func (v BigmapValue) GetZ(path string) (tezos.Z, bool)

func (BigmapValue) Has

func (v BigmapValue) Has(path string) bool

func (BigmapValue) Unmarshal

func (v BigmapValue) Unmarshal(val interface{}) error

func (BigmapValue) Walk

func (v BigmapValue) Walk(path string, fn ValueWalkerFunc) error

type BigmapValueQuery

type BigmapValueQuery struct {
	// contains filtered or unexported fields
}

func (BigmapValueQuery) Check

func (p BigmapValueQuery) Check() error

func (*BigmapValueQuery) ReplaceFilter

func (q *BigmapValueQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BigmapValueQuery) ResetFilter

func (q *BigmapValueQuery) ResetFilter() TableQuery

func (BigmapValueQuery) Run

func (BigmapValueQuery) Url

func (p BigmapValueQuery) Url() string

func (*BigmapValueQuery) WithColumns

func (q *BigmapValueQuery) WithColumns(cols ...string) TableQuery

func (*BigmapValueQuery) WithCursor

func (q *BigmapValueQuery) WithCursor(c uint64) TableQuery

func (*BigmapValueQuery) WithDesc

func (q *BigmapValueQuery) WithDesc() TableQuery

func (*BigmapValueQuery) WithFilter

func (q *BigmapValueQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BigmapValueQuery) WithFormat

func (q *BigmapValueQuery) WithFormat(format FormatType) TableQuery

func (*BigmapValueQuery) WithLimit

func (q *BigmapValueQuery) WithLimit(limit int) TableQuery

func (*BigmapValueQuery) WithOrder

func (q *BigmapValueQuery) WithOrder(order OrderType) TableQuery

func (*BigmapValueQuery) WithPrim

func (q *BigmapValueQuery) WithPrim() TableQuery

func (*BigmapValueQuery) WithQuiet

func (q *BigmapValueQuery) WithQuiet() TableQuery

func (*BigmapValueQuery) WithVerbose

func (q *BigmapValueQuery) WithVerbose() TableQuery

type BigmapValueRow

type BigmapValueRow struct {
	RowId    uint64         `json:"row_id"`
	BigmapId int64          `json:"bigmap_id"`
	Height   int64          `json:"height"`
	Time     time.Time      `json:"time"`
	KeyId    uint64         `json:"key_id"`
	Hash     tezos.ExprHash `json:"hash,omitempty"`
	Key      string         `json:"key,omitempty"`
	Value    string         `json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (BigmapValueRow) DecodeKey

func (r BigmapValueRow) DecodeKey(typ micheline.Type) (micheline.Key, error)

func (BigmapValueRow) DecodeValue

func (r BigmapValueRow) DecodeValue(typ micheline.Type) (micheline.Value, error)

func (*BigmapValueRow) UnmarshalJSON

func (b *BigmapValueRow) UnmarshalJSON(data []byte) error

func (*BigmapValueRow) UnmarshalJSONBrief

func (b *BigmapValueRow) UnmarshalJSONBrief(data []byte) error

type BigmapValueRowList

type BigmapValueRowList struct {
	Rows []*BigmapValueRow
	// contains filtered or unexported fields
}

func (BigmapValueRowList) Cursor

func (l BigmapValueRowList) Cursor() uint64

func (BigmapValueRowList) Len

func (l BigmapValueRowList) Len() int

func (*BigmapValueRowList) UnmarshalJSON

func (l *BigmapValueRowList) UnmarshalJSON(data []byte) error

type Block

type Block struct {
	RowId            uint64                 `json:"row_id"`
	Hash             tezos.BlockHash        `json:"hash"`
	ParentHash       *tezos.BlockHash       `json:"predecessor,omitempty"`
	FollowerHash     *tezos.BlockHash       `json:"successor,omitempty"  tzstats:"notable"`
	Timestamp        time.Time              `json:"time"`
	Height           int64                  `json:"height"`
	Cycle            int64                  `json:"cycle"`
	IsCycleSnapshot  bool                   `json:"is_cycle_snapshot"`
	Solvetime        int                    `json:"solvetime"`
	Version          int                    `json:"version"`
	Round            int                    `json:"round"`
	Nonce            string                 `json:"nonce"`
	VotingPeriodKind tezos.VotingPeriodKind `json:"voting_period_kind"`
	BakerId          uint64                 `json:"baker_id"`
	Baker            tezos.Address          `json:"baker"`
	ProposerId       uint64                 `json:"proposer_id"`
	Proposer         tezos.Address          `json:"proposer"`
	NSlotsEndorsed   int                    `json:"n_endorsed_slots"`
	NOpsApplied      int                    `json:"n_ops_applied"`
	NOpsFailed       int                    `json:"n_ops_failed"`
	NContractCalls   int                    `json:"n_calls"`
	NRollupCalls     int                    `json:"n_rollup_calls"`
	NEvents          int                    `json:"n_events"`
	NTx              int                    `json:"n_tx"`
	NTickets         int                    `json:"n_tickets"`
	Volume           float64                `json:"volume"`
	Fee              float64                `json:"fee"`
	Reward           float64                `json:"reward"`
	Deposit          float64                `json:"deposit"`
	ActivatedSupply  float64                `json:"activated_supply"`
	MintedSupply     float64                `json:"minted_supply"`
	BurnedSupply     float64                `json:"burned_supply"`
	SeenAccounts     int                    `json:"n_accounts"`
	NewAccounts      int                    `json:"n_new_accounts"`
	NewContracts     int                    `json:"n_new_contracts"`
	ClearedAccounts  int                    `json:"n_cleared_accounts"`
	FundedAccounts   int                    `json:"n_funded_accounts"`
	GasLimit         int64                  `json:"gas_limit"`
	GasUsed          int64                  `json:"gas_used"`
	StoragePaid      int64                  `json:"storage_paid"`
	PctAccountReuse  float64                `json:"pct_account_reuse"`
	LbEscapeVote     string                 `json:"lb_esc_vote"`
	LbEscapeEma      int64                  `json:"lb_esc_ema"`
	Protocol         tezos.ProtocolHash     `json:"protocol"`
	Metadata         map[string]Metadata    `json:"metadata,omitempty"  tzstats:"notable"`
	Rights           []Right                `json:"rights,omitempty"    tzstats:"notable"`
	Ops              []*Op                  `json:"ops,omitempty"       tzstats:"notable"`
	// contains filtered or unexported fields
}

func (*Block) BlockId

func (b *Block) BlockId() BlockId

func (*Block) Head

func (b *Block) Head() *Head

func (*Block) UnmarshalJSON

func (b *Block) UnmarshalJSON(data []byte) error

func (*Block) UnmarshalJSONBrief

func (b *Block) UnmarshalJSONBrief(data []byte) error

func (*Block) WithColumns

func (b *Block) WithColumns(cols ...string) *Block

type BlockId

type BlockId struct {
	Height int64
	Hash   tezos.BlockHash
	Time   time.Time
}

func (BlockId) IsNextBlock

func (i BlockId) IsNextBlock(b *Block) bool

func (BlockId) IsSameBlock

func (i BlockId) IsSameBlock(b *Block) bool

type BlockList

type BlockList struct {
	Rows []*Block
	// contains filtered or unexported fields
}

func (BlockList) Cursor

func (l BlockList) Cursor() uint64

func (BlockList) Len

func (l BlockList) Len() int

func (*BlockList) UnmarshalJSON

func (l *BlockList) UnmarshalJSON(data []byte) error

type BlockParams

type BlockParams struct {
	Params
}

func NewBlockParams

func NewBlockParams() BlockParams

func (BlockParams) WithCursor

func (p BlockParams) WithCursor(v uint64) BlockParams

func (BlockParams) WithLimit

func (p BlockParams) WithLimit(v uint) BlockParams

func (BlockParams) WithMeta

func (p BlockParams) WithMeta() BlockParams

func (BlockParams) WithOffset

func (p BlockParams) WithOffset(v uint) BlockParams

func (BlockParams) WithOrder

func (p BlockParams) WithOrder(v OrderType) BlockParams

func (BlockParams) WithRights

func (p BlockParams) WithRights() BlockParams

type BlockQuery

type BlockQuery struct {
	// contains filtered or unexported fields
}

func (BlockQuery) Check

func (p BlockQuery) Check() error

func (*BlockQuery) ReplaceFilter

func (q *BlockQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BlockQuery) ResetFilter

func (q *BlockQuery) ResetFilter() TableQuery

func (BlockQuery) Run

func (q BlockQuery) Run(ctx context.Context) (*BlockList, error)

func (BlockQuery) Url

func (p BlockQuery) Url() string

func (*BlockQuery) WithColumns

func (q *BlockQuery) WithColumns(cols ...string) TableQuery

func (*BlockQuery) WithCursor

func (q *BlockQuery) WithCursor(c uint64) TableQuery

func (*BlockQuery) WithDesc

func (q *BlockQuery) WithDesc() TableQuery

func (*BlockQuery) WithFilter

func (q *BlockQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*BlockQuery) WithFormat

func (q *BlockQuery) WithFormat(format FormatType) TableQuery

func (*BlockQuery) WithLimit

func (q *BlockQuery) WithLimit(limit int) TableQuery

func (*BlockQuery) WithOrder

func (q *BlockQuery) WithOrder(order OrderType) TableQuery

func (*BlockQuery) WithPrim

func (q *BlockQuery) WithPrim() TableQuery

func (*BlockQuery) WithQuiet

func (q *BlockQuery) WithQuiet() TableQuery

func (*BlockQuery) WithVerbose

func (q *BlockQuery) WithVerbose() TableQuery

type BlockchainConfig

type BlockchainConfig struct {
	Name        string `json:"name"`
	Network     string `json:"network"`
	Symbol      string `json:"symbol"`
	ChainId     string `json:"chain_id"`
	Version     int    `json:"version"`
	Deployment  int    `json:"deployment"`
	Protocol    string `json:"protocol"`
	StartHeight int64  `json:"start_height"`
	EndHeight   int64  `json:"end_height"`
	Decimals    int    `json:"decimals"`
	Token       int64  `json:"units"`

	// blocks
	TokensPerRoll       float64 `json:"tokens_per_roll"`
	PreservedCycles     int64   `json:"preserved_cycles"`
	BlocksPerCommitment int64   `json:"blocks_per_commitment"`
	BlocksPerCycle      int64   `json:"blocks_per_cycle"`
	BlocksPerSnapshot   int64   `json:"blocks_per_snapshot,omitempty"`

	// timing
	TimeBetweenBlocks      *[2]int `json:"time_between_blocks,omitempty"`
	MinimalBlockDelay      int     `json:"minimal_block_delay"`
	DelayIncrementPerRound int     `json:"delay_increment_per_round,omitempty"`

	// rewards
	BlockReward              float64     `json:"block_reward"`
	EndorsementReward        float64     `json:"endorsement_reward"`
	BlockRewardV6            *[2]float64 `json:"block_rewards_v6,omitempty"`
	EndorsementRewardV6      *[2]float64 `json:"endorsement_rewards_v6,omitempty"`
	SeedNonceRevelationTip   float64     `json:"seed_nonce_revelation_tip"`
	BakingRewardFixedPortion int64       `json:"baking_reward_fixed_portion,omitempty"`
	BakingRewardBonusPerSlot int64       `json:"baking_reward_bonus_per_slot,omitempty"`
	EndorsingRewardPerSlot   int64       `json:"endorsing_reward_per_slot,omitempty"`

	// costs
	OriginationBurn            float64 `json:"origination_burn,omitempty"`
	OriginationSize            int64   `json:"origination_size,omitempty"`
	CostPerByte                int64   `json:"cost_per_byte"`
	BlockSecurityDeposit       float64 `json:"block_security_deposit,omitempty"`
	EndorsementSecurityDeposit float64 `json:"endorsement_security_deposit,omitempty"`
	FrozenDepositsPercentage   int     `json:"frozen_deposits_percentage,omitempty"`

	// limits
	MichelsonMaximumTypeSize     int   `json:"michelson_maximum_type_size"`
	EndorsersPerBlock            int   `json:"endorsers_per_block,omitempty"`
	HardGasLimitPerBlock         int64 `json:"hard_gas_limit_per_block"`
	HardGasLimitPerOperation     int64 `json:"hard_gas_limit_per_operation"`
	HardStorageLimitPerOperation int64 `json:"hard_storage_limit_per_operation"`
	MaxOperationDataLength       int   `json:"max_operation_data_length"`
	MaxOperationsTTL             int64 `json:"max_operations_ttl"`
	ConsensusCommitteeSize       int   `json:"consensus_committee_size,omitempty"`
	ConsensusThreshold           int   `json:"consensus_threshold,omitempty"`

	// voting
	NumVotingPeriods      int   `json:"num_voting_periods"`
	BlocksPerVotingPeriod int64 `json:"blocks_per_voting_period"`
	MinProposalQuorum     int64 `json:"min_proposal_quorum,omitempty"`
	QuorumMin             int64 `json:"quorum_min,omitempty"`
	QuorumMax             int64 `json:"quorum_max,omitempty"`
}

type Candle

type Candle struct {
	Timestamp       time.Time `json:"time"`
	Open            float64   `json:"open"`
	High            float64   `json:"high"`
	Low             float64   `json:"low"`
	Close           float64   `json:"close"`
	Vwap            float64   `json:"vwap"`
	NTrades         int64     `json:"n_trades"`
	NBuy            int64     `json:"n_buy"`
	NSell           int64     `json:"n_sell"`
	VolumeBase      float64   `json:"vol_base"`
	VolumeQuote     float64   `json:"vol_quote"`
	VolumeBuyBase   float64   `json:"vol_buy_base"`
	VolumeBuyQuote  float64   `json:"vol_buy_quote"`
	VolumeSellBase  float64   `json:"vol_sell_base"`
	VolumeSellQuote float64   `json:"vol_sell_quote"`
	// contains filtered or unexported fields
}

func (*Candle) UnmarshalJSON

func (c *Candle) UnmarshalJSON(data []byte) error

func (*Candle) UnmarshalJSONBrief

func (c *Candle) UnmarshalJSONBrief(data []byte) error

type CandleArgs

type CandleArgs struct {
	Market   string
	Pair     string
	Collapse time.Duration
	Fill     FillMode
	Columns  []string
	From     time.Time
	To       time.Time
	Limit    int
}

func (CandleArgs) Url

func (c CandleArgs) Url() string

type CandleList

type CandleList struct {
	Columns []string
	Rows    []Candle
}

func (CandleList) AsOf

func (l CandleList) AsOf(t time.Time) (c Candle)

func (CandleList) Len

func (l CandleList) Len() int

func (*CandleList) UnmarshalJSON

func (l *CandleList) UnmarshalJSON(data []byte) error

type Chain

type Chain struct {
	RowId                uint64    `json:"row_id"`
	Height               int64     `json:"height"`
	Cycle                int64     `json:"cycle"`
	Timestamp            time.Time `json:"time"`
	TotalAccounts        int64     `json:"total_accounts"`
	TotalContracts       int64     `json:"total_contracts"`
	TotalRollups         int64     `json:"total_rollups"`
	TotalOps             int64     `json:"total_ops"`
	TotalOpsFailed       int64     `json:"total_ops_failed"`
	TotalContractOps     int64     `json:"total_contract_ops"`
	TotalContractCalls   int64     `json:"total_contract_calls"`
	TotalRollupCalls     int64     `json:"total_rollup_calls"`
	TotalActivations     int64     `json:"total_activations"`
	TotalNonces          int64     `json:"total_nonce_revelations"`
	TotalEndorsements    int64     `json:"total_endorsements"`
	TotalPreendorsements int64     `json:"total_preendorsements"`
	TotalDoubleBake      int64     `json:"total_double_bakings"`
	TotalDoubleEndorse   int64     `json:"total_double_endorsements"`
	TotalDelegations     int64     `json:"total_delegations"`
	TotalReveals         int64     `json:"total_reveals"`
	TotalOriginations    int64     `json:"total_originations"`
	TotalTransactions    int64     `json:"total_transactions"`
	TotalProposals       int64     `json:"total_proposals"`
	TotalBallots         int64     `json:"total_ballots"`
	TotalConstants       int64     `json:"total_constants"`
	TotalSetLimits       int64     `json:"total_set_limits"`
	TotalStorageBytes    int64     `json:"total_storage_bytes"`
	TotalTicketTransfers int64     `json:"total_ticket_transfers"`
	FundedAccounts       int64     `json:"funded_accounts"`
	DustAccounts         int64     `json:"dust_accounts"`
	GhostAccounts        int64     `json:"ghost_accounts"`
	UnclaimedAccounts    int64     `json:"unclaimed_accounts"`
	TotalDelegators      int64     `json:"total_delegators"`
	ActiveDelegators     int64     `json:"active_delegators"`
	InactiveDelegators   int64     `json:"inactive_delegators"`
	DustDelegators       int64     `json:"dust_delegators"`
	TotalBakers          int64     `json:"total_bakers"`
	ActiveBakers         int64     `json:"active_bakers"`
	InactiveBakers       int64     `json:"inactive_bakers"`
	ZeroBakers           int64     `json:"zero_bakers"`
	SelfBakers           int64     `json:"self_bakers"`
	SingleBakers         int64     `json:"single_bakers"`
	MultiBakers          int64     `json:"multi_bakers"`
	Rolls                int64     `json:"rolls"`
	RollOwners           int64     `json:"roll_owners"`
	// contains filtered or unexported fields
}

func (*Chain) UnmarshalJSON

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

func (*Chain) UnmarshalJSONBrief

func (c *Chain) UnmarshalJSONBrief(data []byte) error

type ChainList

type ChainList struct {
	Rows []*Chain
	// contains filtered or unexported fields
}

func (ChainList) Cursor

func (l ChainList) Cursor() uint64

func (ChainList) Len

func (l ChainList) Len() int

func (*ChainList) UnmarshalJSON

func (l *ChainList) UnmarshalJSON(data []byte) error

type ChainQuery

type ChainQuery struct {
	// contains filtered or unexported fields
}

func (ChainQuery) Check

func (p ChainQuery) Check() error

func (*ChainQuery) ReplaceFilter

func (q *ChainQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*ChainQuery) ResetFilter

func (q *ChainQuery) ResetFilter() TableQuery

func (ChainQuery) Run

func (q ChainQuery) Run(ctx context.Context) (*ChainList, error)

func (ChainQuery) Url

func (p ChainQuery) Url() string

func (*ChainQuery) WithColumns

func (q *ChainQuery) WithColumns(cols ...string) TableQuery

func (*ChainQuery) WithCursor

func (q *ChainQuery) WithCursor(c uint64) TableQuery

func (*ChainQuery) WithDesc

func (q *ChainQuery) WithDesc() TableQuery

func (*ChainQuery) WithFilter

func (q *ChainQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*ChainQuery) WithFormat

func (q *ChainQuery) WithFormat(format FormatType) TableQuery

func (*ChainQuery) WithLimit

func (q *ChainQuery) WithLimit(limit int) TableQuery

func (*ChainQuery) WithOrder

func (q *ChainQuery) WithOrder(order OrderType) TableQuery

func (*ChainQuery) WithPrim

func (q *ChainQuery) WithPrim() TableQuery

func (*ChainQuery) WithQuiet

func (q *ChainQuery) WithQuiet() TableQuery

func (*ChainQuery) WithVerbose

func (q *ChainQuery) WithVerbose() TableQuery

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string, httpClient *http.Client) (*Client, error)

func (*Client) AddCachedScript

func (c *Client) AddCachedScript(addr tezos.Address, script *micheline.Script)

func (*Client) Async

func (c *Client) Async(ctx context.Context, path string, headers http.Header, result interface{}) FutureResult

func (*Client) CreateMetadata

func (c *Client) CreateMetadata(ctx context.Context, metadata []Metadata) ([]Metadata, error)

func (*Client) DefaultHeaders

func (c *Client) DefaultHeaders() http.Header

func (*Client) Describe

func (c *Client) Describe(ctx context.Context, ident string) (MetadataDescriptor, error)

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context, addr tezos.Address, params AccountParams) (*Account, error)

func (*Client) GetAccountContracts

func (c *Client) GetAccountContracts(ctx context.Context, addr tezos.Address, params AccountParams) ([]*Account, error)

func (*Client) GetAccountMetadata

func (c *Client) GetAccountMetadata(ctx context.Context, addr tezos.Address) (Metadata, error)

func (*Client) GetAccountOps

func (c *Client) GetAccountOps(ctx context.Context, addr tezos.Address, params OpParams) ([]*Op, error)

func (*Client) GetAllMetadataSchemas

func (c *Client) GetAllMetadataSchemas(ctx context.Context) (map[string]json.RawMessage, error)

func (*Client) GetAssetMetadata

func (c *Client) GetAssetMetadata(ctx context.Context, addr tezos.Address, assetId int64) (Metadata, error)

func (*Client) GetBaker

func (c *Client) GetBaker(ctx context.Context, addr tezos.Address, params BakerParams) (*Baker, error)

func (*Client) GetBakerIncome

func (c *Client) GetBakerIncome(ctx context.Context, addr tezos.Address, cycle int64, params BakerParams) (*CycleIncome, error)

func (*Client) GetBakerSnapshot

func (c *Client) GetBakerSnapshot(ctx context.Context, addr tezos.Address, cycle int64, params BakerParams) (*CycleSnapshot, error)

func (*Client) GetBigmap

func (c *Client) GetBigmap(ctx context.Context, id int64, params ContractParams) (*Bigmap, error)

func (*Client) GetBigmapValue

func (c *Client) GetBigmapValue(ctx context.Context, id int64, key string, params ContractParams) (*BigmapValue, error)

func (*Client) GetBlock

func (c *Client) GetBlock(ctx context.Context, hash tezos.BlockHash, params BlockParams) (*Block, error)

func (*Client) GetBlockHeight

func (c *Client) GetBlockHeight(ctx context.Context, height int64, params BlockParams) (*Block, error)

func (*Client) GetBlockOps

func (c *Client) GetBlockOps(ctx context.Context, hash tezos.BlockHash, params OpParams) ([]*Op, error)

func (*Client) GetBlockWithOps

func (c *Client) GetBlockWithOps(ctx context.Context, hash tezos.BlockHash, params BlockParams) (*Block, error)

func (*Client) GetConfig

func (c *Client) GetConfig(ctx context.Context) (*BlockchainConfig, error)

func (*Client) GetConfigHeight

func (c *Client) GetConfigHeight(ctx context.Context, height int64) (*BlockchainConfig, error)

func (*Client) GetConstant

func (c *Client) GetConstant(ctx context.Context, addr tezos.ExprHash, params ConstantParams) (*Constant, error)

func (*Client) GetContract

func (c *Client) GetContract(ctx context.Context, addr tezos.Address, params ContractParams) (*Contract, error)

func (*Client) GetContractScript

func (c *Client) GetContractScript(ctx context.Context, addr tezos.Address, params ContractParams) (*ContractScript, error)

func (*Client) GetContractStorage

func (c *Client) GetContractStorage(ctx context.Context, addr tezos.Address, params ContractParams) (*ContractValue, error)

func (*Client) GetElection

func (c *Client) GetElection(ctx context.Context, id int) (*Election, error)

func (*Client) GetHead

func (c *Client) GetHead(ctx context.Context, params BlockParams) (*Block, error)

func (*Client) GetIpfsData

func (c *Client) GetIpfsData(ctx context.Context, uri string, val interface{}) error

func (*Client) GetIpfsImage

func (c *Client) GetIpfsImage(ctx context.Context, uri, mime string, w io.Writer) error

func (*Client) GetMetadataSchema

func (c *Client) GetMetadataSchema(ctx context.Context, name string) (json.RawMessage, error)

func (*Client) GetOp

func (c *Client) GetOp(ctx context.Context, hash tezos.OpHash, params OpParams) (OpGroup, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context) (*Status, error)

func (*Client) GetTicker added in v0.15.0

func (c *Client) GetTicker(ctx context.Context, market, pair string) (*Ticker, error)

func (*Client) GetTickers

func (c *Client) GetTickers(ctx context.Context) ([]Ticker, error)

func (*Client) GetTip

func (c *Client) GetTip(ctx context.Context) (*Tip, error)

func (*Client) ListBakerDelegations

func (c *Client) ListBakerDelegations(ctx context.Context, addr tezos.Address, params OpParams) ([]*Op, error)

func (*Client) ListBakerEndorsements

func (c *Client) ListBakerEndorsements(ctx context.Context, addr tezos.Address, params OpParams) ([]*Op, error)

func (*Client) ListBakerRights

func (c *Client) ListBakerRights(ctx context.Context, addr tezos.Address, cycle int64, params BakerParams) (*CycleRights, error)

func (*Client) ListBakerVotes

func (c *Client) ListBakerVotes(ctx context.Context, addr tezos.Address, params OpParams) ([]*Ballot, error)

func (*Client) ListBakers

func (c *Client) ListBakers(ctx context.Context, params BakerParams) ([]*Baker, error)

func (*Client) ListBallots

func (c *Client) ListBallots(ctx context.Context, id int, stage int) ([]Ballot, error)

func (*Client) ListBigmapKeyUpdates

func (c *Client) ListBigmapKeyUpdates(ctx context.Context, id int64, key string, params ContractParams) ([]BigmapUpdate, error)

func (*Client) ListBigmapKeys

func (c *Client) ListBigmapKeys(ctx context.Context, id int64, params ContractParams) ([]BigmapKey, error)

func (*Client) ListBigmapUpdates

func (c *Client) ListBigmapUpdates(ctx context.Context, id int64, params ContractParams) ([]BigmapUpdate, error)

func (*Client) ListBigmapValues

func (c *Client) ListBigmapValues(ctx context.Context, id int64, params ContractParams) ([]BigmapValue, error)

func (*Client) ListCandles

func (c *Client) ListCandles(ctx context.Context, args CandleArgs) (*CandleList, error)

func (*Client) ListContractCalls

func (c *Client) ListContractCalls(ctx context.Context, addr tezos.Address, params ContractParams) ([]*Op, error)

func (*Client) ListMetadata

func (c *Client) ListMetadata(ctx context.Context) ([]Metadata, error)

func (*Client) ListProtocols

func (c *Client) ListProtocols(ctx context.Context) ([]Deployment, error)

func (*Client) ListVoters

func (c *Client) ListVoters(ctx context.Context, id int, stage int) ([]Voter, error)

func (*Client) NewAccountQuery

func (c *Client) NewAccountQuery() AccountQuery

func (*Client) NewBigmapQuery

func (c *Client) NewBigmapQuery() BigmapQuery

func (*Client) NewBigmapUpdateQuery

func (c *Client) NewBigmapUpdateQuery() BigmapUpdateQuery

func (*Client) NewBigmapValueQuery

func (c *Client) NewBigmapValueQuery() BigmapValueQuery

func (*Client) NewBlockQuery

func (c *Client) NewBlockQuery() BlockQuery

func (*Client) NewChainQuery

func (c *Client) NewChainQuery() ChainQuery

func (*Client) NewConstantQuery

func (c *Client) NewConstantQuery() ConstantQuery

func (*Client) NewContractQuery

func (c *Client) NewContractQuery() ContractQuery

func (*Client) NewCycleRightsQuery

func (c *Client) NewCycleRightsQuery() CycleRightsQuery

func (*Client) NewEventQuery

func (c *Client) NewEventQuery() EventQuery

func (*Client) NewIncomeQuery added in v0.15.0

func (c *Client) NewIncomeQuery() IncomeQuery

func (*Client) NewOpQuery

func (c *Client) NewOpQuery() OpQuery

func (*Client) NewSnapshotQuery

func (c *Client) NewSnapshotQuery() SnapshotQuery

func (*Client) PurgeMetadata

func (c *Client) PurgeMetadata(ctx context.Context) error

func (*Client) QueryAccounts

func (c *Client) QueryAccounts(ctx context.Context, filter FilterList, cols []string) (*AccountList, error)

func (*Client) QueryBigmapUpdates

func (c *Client) QueryBigmapUpdates(ctx context.Context, filter FilterList, cols []string) (*BigmapUpdateRowList, error)

func (*Client) QueryBigmapValues

func (c *Client) QueryBigmapValues(ctx context.Context, filter FilterList, cols []string) (*BigmapValueRowList, error)

func (*Client) QueryBigmaps

func (c *Client) QueryBigmaps(ctx context.Context, filter FilterList, cols []string) (*BigmapRowList, error)

func (*Client) QueryBlocks

func (c *Client) QueryBlocks(ctx context.Context, filter FilterList, cols []string) (*BlockList, error)

func (*Client) QueryChains

func (c *Client) QueryChains(ctx context.Context, filter FilterList, cols []string) (*ChainList, error)

func (*Client) QueryConstants

func (c *Client) QueryConstants(ctx context.Context, filter FilterList, cols []string) (*ConstantList, error)

func (*Client) QueryContracts

func (c *Client) QueryContracts(ctx context.Context, filter FilterList, cols []string) (*ContractList, error)

func (*Client) QueryCycleRights

func (c *Client) QueryCycleRights(ctx context.Context, filter FilterList, cols []string) (*CycleRightsList, error)

func (*Client) QueryEvents

func (c *Client) QueryEvents(ctx context.Context, filter FilterList, cols []string) (*EventList, error)

func (*Client) QueryIncome added in v0.15.0

func (c *Client) QueryIncome(ctx context.Context, filter FilterList, cols []string) (*IncomeList, error)

func (*Client) QueryOps

func (c *Client) QueryOps(ctx context.Context, filter FilterList, cols []string) (*OpList, error)

func (*Client) QuerySnapshots

func (c *Client) QuerySnapshots(ctx context.Context, filter FilterList, cols []string) (*SnapshotList, error)

func (*Client) QueryTable

func (c *Client) QueryTable(ctx context.Context, q TableQuery, result interface{}) error

func (*Client) RemoveAccountMetadata

func (c *Client) RemoveAccountMetadata(ctx context.Context, addr tezos.Address) error

func (*Client) RemoveAssetMetadata

func (c *Client) RemoveAssetMetadata(ctx context.Context, addr tezos.Address, assetId int64) error

func (Client) Retries added in v0.15.0

func (c Client) Retries() int

func (Client) RetryDelay added in v0.15.0

func (c Client) RetryDelay() time.Duration

func (*Client) StreamTable

func (c *Client) StreamTable(ctx context.Context, q TableQuery, w io.Writer) (StreamResponse, error)

func (*Client) UpdateMetadata

func (c *Client) UpdateMetadata(ctx context.Context, alias Metadata) (Metadata, error)

func (*Client) UseScriptCache

func (c *Client) UseScriptCache(cache *lru.TwoQueueCache)

func (*Client) WithApiKey added in v0.15.0

func (c *Client) WithApiKey(s string) *Client

func (*Client) WithCacheSize added in v0.15.0

func (c *Client) WithCacheSize(sz int) *Client

func (*Client) WithHeader added in v0.15.0

func (c *Client) WithHeader(key, value string) *Client

func (*Client) WithLogger added in v0.15.0

func (c *Client) WithLogger(log log.Logger) *Client

func (*Client) WithMarketUrl added in v0.15.0

func (c *Client) WithMarketUrl(url string) *Client

func (*Client) WithRetry added in v0.15.0

func (c *Client) WithRetry(num int, delay time.Duration) *Client

func (*Client) WithTLS

func (c *Client) WithTLS(tc *tls.Config) *Client

func (*Client) WithTimeout added in v0.15.0

func (c *Client) WithTimeout(d time.Duration) *Client

func (*Client) WithUserAgent added in v0.15.0

func (c *Client) WithUserAgent(s string) *Client

type Constant

type Constant struct {
	RowId       uint64         `json:"row_id"`
	Address     tezos.ExprHash `json:"address"`
	CreatorId   uint64         `json:"creator_id"`
	Creator     tezos.Address  `json:"creator"`
	Height      int64          `json:"height"`
	Time        time.Time      `json:"time"`
	StorageSize int64          `json:"storage_size"`
	Value       micheline.Prim `json:"value"`
	Features    []string       `json:"features"`
	// contains filtered or unexported fields
}

func (*Constant) UnmarshalJSON

func (a *Constant) UnmarshalJSON(data []byte) error

func (*Constant) UnmarshalJSONBrief

func (c *Constant) UnmarshalJSONBrief(data []byte) error

type ConstantList

type ConstantList struct {
	Rows []*Constant
	// contains filtered or unexported fields
}

func (ConstantList) Cursor

func (l ConstantList) Cursor() uint64

func (ConstantList) Len

func (l ConstantList) Len() int

func (*ConstantList) UnmarshalJSON

func (l *ConstantList) UnmarshalJSON(data []byte) error

type ConstantParams

type ConstantParams struct {
	Params
}

func NewConstantParams

func NewConstantParams() ConstantParams

func (ConstantParams) WithCursor

func (p ConstantParams) WithCursor(v uint64) ConstantParams

func (ConstantParams) WithLimit

func (p ConstantParams) WithLimit(v uint) ConstantParams

func (ConstantParams) WithOffset

func (p ConstantParams) WithOffset(v uint) ConstantParams

func (ConstantParams) WithOrder

func (p ConstantParams) WithOrder(v OrderType) ConstantParams

type ConstantQuery

type ConstantQuery struct {
	// contains filtered or unexported fields
}

func (ConstantQuery) Check

func (p ConstantQuery) Check() error

func (*ConstantQuery) ReplaceFilter

func (q *ConstantQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*ConstantQuery) ResetFilter

func (q *ConstantQuery) ResetFilter() TableQuery

func (ConstantQuery) Run

func (ConstantQuery) Url

func (p ConstantQuery) Url() string

func (*ConstantQuery) WithColumns

func (q *ConstantQuery) WithColumns(cols ...string) TableQuery

func (*ConstantQuery) WithCursor

func (q *ConstantQuery) WithCursor(c uint64) TableQuery

func (*ConstantQuery) WithDesc

func (q *ConstantQuery) WithDesc() TableQuery

func (*ConstantQuery) WithFilter

func (q *ConstantQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*ConstantQuery) WithFormat

func (q *ConstantQuery) WithFormat(format FormatType) TableQuery

func (*ConstantQuery) WithLimit

func (q *ConstantQuery) WithLimit(limit int) TableQuery

func (*ConstantQuery) WithOrder

func (q *ConstantQuery) WithOrder(order OrderType) TableQuery

func (*ConstantQuery) WithPrim

func (q *ConstantQuery) WithPrim() TableQuery

func (*ConstantQuery) WithQuiet

func (q *ConstantQuery) WithQuiet() TableQuery

func (*ConstantQuery) WithVerbose

func (q *ConstantQuery) WithVerbose() TableQuery

type Contract

type Contract struct {
	RowId         uint64               `json:"row_id,omitempty"`
	AccountId     uint64               `json:"account_id,omitempty"`
	Address       tezos.Address        `json:"address"`
	CreatorId     uint64               `json:"creator_id,omitempty"`
	Creator       tezos.Address        `json:"creator"`
	BakerId       uint64               `json:"baker_id,omitempty" tzstats:"notable"`
	Baker         tezos.Address        `json:"baker"              tzstats:"notable"`
	FirstSeen     int64                `json:"first_seen"`
	LastSeen      int64                `json:"last_seen"`
	FirstSeenTime time.Time            `json:"first_seen_time"`
	LastSeenTime  time.Time            `json:"last_seen_time"`
	StorageSize   int64                `json:"storage_size"`
	StoragePaid   int64                `json:"storage_paid"`
	TotalFeesUsed float64              `json:"total_fees_used"    tzstats:"notable"`
	Script        *micheline.Script    `json:"script,omitempty"`
	Storage       *micheline.Prim      `json:"storage,omitempty"`
	InterfaceHash string               `json:"iface_hash"`
	CodeHash      string               `json:"code_hash"`
	StorageHash   string               `json:"storage_hash"`
	Features      []string             `json:"features"`
	Interfaces    []string             `json:"interfaces"`
	CallStats     map[string]int       `json:"call_stats"`
	NCallsIn      int                  `json:"n_calls_in"          tzstats:"notable"`
	NCallsOut     int                  `json:"n_calls_out"         tzstats:"notable"`
	NCallsFailed  int                  `json:"n_calls_failed"      tzstats:"notable"`
	Bigmaps       map[string]int64     `json:"bigmaps,omitempty"   tzstats:"notable"`
	Metadata      map[string]*Metadata `json:"metadata,omitempty"  tzstats:"notable"`
	// contains filtered or unexported fields
}

func (*Contract) Meta

func (c *Contract) Meta() *Metadata

func (*Contract) UnmarshalJSON

func (a *Contract) UnmarshalJSON(data []byte) error

func (*Contract) UnmarshalJSONBrief

func (c *Contract) UnmarshalJSONBrief(data []byte) error

type ContractList

type ContractList struct {
	Rows []*Contract
	// contains filtered or unexported fields
}

func (ContractList) Cursor

func (l ContractList) Cursor() uint64

func (ContractList) Len

func (l ContractList) Len() int

func (*ContractList) UnmarshalJSON

func (l *ContractList) UnmarshalJSON(data []byte) error

type ContractMeta

type ContractMeta struct {
	Address string    `json:"contract"`
	Time    time.Time `json:"time"`
	Height  int64     `json:"height"`
	Block   string    `json:"block"`
}

type ContractParameters

type ContractParameters struct {
	ContractValue                 // contract
	Entrypoint    string          `json:"entrypoint"`           // contract
	L2Address     *tezos.Address  `json:"l2_address,omitempty"` // rollup
	Method        string          `json:"method,omitempty"`     // rollup
	Arguments     json.RawMessage `json:"arguments,omitempty"`  // rollup
}

type ContractParams

type ContractParams struct {
	Params
}

func NewContractParams

func NewContractParams() ContractParams

func (ContractParams) WithBlock

func (p ContractParams) WithBlock(v string) ContractParams

func (ContractParams) WithCursor

func (p ContractParams) WithCursor(v uint64) ContractParams

func (ContractParams) WithLimit

func (p ContractParams) WithLimit(v uint) ContractParams

func (ContractParams) WithMerge

func (p ContractParams) WithMerge() ContractParams

func (ContractParams) WithMeta

func (p ContractParams) WithMeta() ContractParams

func (ContractParams) WithOffset

func (p ContractParams) WithOffset(v uint) ContractParams

func (ContractParams) WithOrder

func (p ContractParams) WithOrder(v OrderType) ContractParams

func (ContractParams) WithPrim

func (p ContractParams) WithPrim() ContractParams

func (ContractParams) WithSince

func (p ContractParams) WithSince(v string) ContractParams

func (ContractParams) WithStorage

func (p ContractParams) WithStorage() ContractParams

func (ContractParams) WithUnpack

func (p ContractParams) WithUnpack() ContractParams

type ContractQuery

type ContractQuery struct {
	// contains filtered or unexported fields
}

func (ContractQuery) Check

func (p ContractQuery) Check() error

func (*ContractQuery) ReplaceFilter

func (q *ContractQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*ContractQuery) ResetFilter

func (q *ContractQuery) ResetFilter() TableQuery

func (ContractQuery) Run

func (ContractQuery) Url

func (p ContractQuery) Url() string

func (*ContractQuery) WithColumns

func (q *ContractQuery) WithColumns(cols ...string) TableQuery

func (*ContractQuery) WithCursor

func (q *ContractQuery) WithCursor(c uint64) TableQuery

func (*ContractQuery) WithDesc

func (q *ContractQuery) WithDesc() TableQuery

func (*ContractQuery) WithFilter

func (q *ContractQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*ContractQuery) WithFormat

func (q *ContractQuery) WithFormat(format FormatType) TableQuery

func (*ContractQuery) WithLimit

func (q *ContractQuery) WithLimit(limit int) TableQuery

func (*ContractQuery) WithOrder

func (q *ContractQuery) WithOrder(order OrderType) TableQuery

func (*ContractQuery) WithPrim

func (q *ContractQuery) WithPrim() TableQuery

func (*ContractQuery) WithQuiet

func (q *ContractQuery) WithQuiet() TableQuery

func (*ContractQuery) WithVerbose

func (q *ContractQuery) WithVerbose() TableQuery

type ContractScript

type ContractScript struct {
	Script          *micheline.Script         `json:"script,omitempty"`
	StorageType     micheline.Typedef         `json:"storage_type"`
	Entrypoints     micheline.Entrypoints     `json:"entrypoints"`
	Views           micheline.Views           `json:"views,omitempty"`
	BigmapNames     map[string]int64          `json:"bigmaps,omitempty"`
	BigmapTypes     map[string]micheline.Type `json:"bigmap_types,omitempty"`
	BigmapTypesById map[int64]micheline.Type  `json:"-"`
}

func (ContractScript) Types

func (s ContractScript) Types() (param, store micheline.Type, eps micheline.Entrypoints, bigmaps map[int64]micheline.Type)

type ContractValue

type ContractValue struct {
	Value interface{}     `json:"value,omitempty"`
	Prim  *micheline.Prim `json:"prim,omitempty"`
}

func (ContractValue) AsPrim

func (v ContractValue) AsPrim() (micheline.Prim, bool)

func (ContractValue) GetAddress

func (v ContractValue) GetAddress(path string) (tezos.Address, bool)

func (ContractValue) GetBig

func (v ContractValue) GetBig(path string) (*big.Int, bool)

func (ContractValue) GetInt64

func (v ContractValue) GetInt64(path string) (int64, bool)

func (ContractValue) GetString

func (v ContractValue) GetString(path string) (string, bool)

func (ContractValue) GetTime

func (v ContractValue) GetTime(path string) (time.Time, bool)

func (ContractValue) GetValue

func (v ContractValue) GetValue(path string) (interface{}, bool)

func (ContractValue) GetZ added in v0.15.0

func (v ContractValue) GetZ(path string) (tezos.Z, bool)

func (ContractValue) Has

func (v ContractValue) Has(path string) bool

func (ContractValue) IsPrim

func (v ContractValue) IsPrim() bool

func (ContractValue) Unmarshal

func (v ContractValue) Unmarshal(val interface{}) error

func (ContractValue) Walk

func (v ContractValue) Walk(path string, fn ValueWalkerFunc) error

type Costs

type Costs struct {
	Fee            float64 // the total fee paid
	Burn           float64 // total amount burned (not included in fee)
	GasUsed        int64   // gas used
	StorageUsed    int64   // new storage bytes allocated
	StorageBurn    float64 // burned for allocating new storage (not included in fee)
	AllocationBurn float64 // burned for allocating a new account (not included in fee)
}

func (Costs) Add

func (x Costs) Add(y Costs) Costs

func (Costs) Sum

func (x Costs) Sum() float64

type CycleIncome

type CycleIncome struct {
	Cycle                  int64   `json:"cycle"`
	Rolls                  int64   `json:"snapshot_rolls"`
	Balance                float64 `json:"own_balance"`
	Delegated              float64 `json:"delegated_balance"`
	Staking                float64 `json:"staking_balance"`
	NDelegations           int64   `json:"n_delegations"`
	NBakingRights          int64   `json:"n_baking_rights"`
	NEndorsingRights       int64   `json:"n_endorsing_rights"`
	Luck                   float64 `json:"luck"`
	LuckPct                int64   `json:"luck_percent"`
	ContributionPct        int64   `json:"contribution_percent"`
	PerformancePct         int64   `json:"performance_percent"`
	NBlocksBaked           int64   `json:"n_blocks_baked"`
	NBlocksProposed        int64   `json:"n_blocks_proposed"`
	NBlocksNotBaked        int64   `json:"n_blocks_not_baked"`
	NBlocksEndorsed        int64   `json:"n_blocks_endorsed"`
	NBlocksNotEndorsed     int64   `json:"n_blocks_not_endorsed"`
	NSlotsEndorsed         int64   `json:"n_slots_endorsed"`
	NSeedsRevealed         int64   `json:"n_seeds_revealed"`
	ExpectedIncome         float64 `json:"expected_income"`
	TotalIncome            float64 `json:"total_income"`
	TotalDeposits          float64 `json:"total_deposits"`
	BakingIncome           float64 `json:"baking_income"`
	EndorsingIncome        float64 `json:"endorsing_income"`
	AccusationIncome       float64 `json:"accusation_income"`
	SeedIncome             float64 `json:"seed_income"`
	FeesIncome             float64 `json:"fees_income"`
	TotalLoss              float64 `json:"total_loss"`
	AccusationLoss         float64 `json:"accusation_loss"`
	SeedLoss               float64 `json:"seed_loss"`
	EndorsingLoss          float64 `json:"endorsing_loss"`
	LostAccusationFees     float64 `json:"lost_accusation_fees"`
	LostAccusationRewards  float64 `json:"lost_accusation_rewards"`
	LostAccusationDeposits float64 `json:"lost_accusation_deposits"`
	LostSeedFees           float64 `json:"lost_seed_fees"`
	LostSeedRewards        float64 `json:"lost_seed_rewards"`
}

type CycleRights

type CycleRights struct {
	RowId     uint64         `json:"row_id"`
	Cycle     int64          `json:"cycle"`
	Height    int64          `json:"height"`
	AccountId uint64         `json:"account_id"`
	Address   tezos.Address  `json:"address"`
	Bake      tezos.HexBytes `json:"baking_rights"`
	Endorse   tezos.HexBytes `json:"endorsing_rights"`
	Baked     tezos.HexBytes `json:"blocks_baked"`
	Endorsed  tezos.HexBytes `json:"blocks_endorsed"`
	Seed      tezos.HexBytes `json:"seeds_required"`
	Seeded    tezos.HexBytes `json:"seeds_revealed"`
	// contains filtered or unexported fields
}

func (CycleRights) IsLost

func (r CycleRights) IsLost(pos int) bool

func (CycleRights) IsMissed

func (r CycleRights) IsMissed(pos int) bool

func (CycleRights) IsSeedRequired

func (r CycleRights) IsSeedRequired(pos int) bool

func (CycleRights) IsSeedRevealed

func (r CycleRights) IsSeedRevealed(pos int) bool

func (CycleRights) IsStolen

func (r CycleRights) IsStolen(pos int) bool

func (CycleRights) IsUsed

func (r CycleRights) IsUsed(pos int) bool

func (CycleRights) Pos

func (r CycleRights) Pos(height int64) int

func (CycleRights) RightAt

func (r CycleRights) RightAt(height int64, typ tezos.RightType) (Right, bool)

func (*CycleRights) UnmarshalJSON

func (r *CycleRights) UnmarshalJSON(data []byte) error

func (*CycleRights) UnmarshalJSONBrief

func (r *CycleRights) UnmarshalJSONBrief(data []byte) error

type CycleRightsList

type CycleRightsList struct {
	Rows []*CycleRights
	// contains filtered or unexported fields
}

func (CycleRightsList) Cursor

func (l CycleRightsList) Cursor() uint64

func (CycleRightsList) Len

func (l CycleRightsList) Len() int

func (*CycleRightsList) UnmarshalJSON

func (l *CycleRightsList) UnmarshalJSON(data []byte) error

type CycleRightsQuery

type CycleRightsQuery struct {
	// contains filtered or unexported fields
}

func (CycleRightsQuery) Check

func (p CycleRightsQuery) Check() error

func (*CycleRightsQuery) ReplaceFilter

func (q *CycleRightsQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*CycleRightsQuery) ResetFilter

func (q *CycleRightsQuery) ResetFilter() TableQuery

func (CycleRightsQuery) Run

func (CycleRightsQuery) Url

func (p CycleRightsQuery) Url() string

func (*CycleRightsQuery) WithColumns

func (q *CycleRightsQuery) WithColumns(cols ...string) TableQuery

func (*CycleRightsQuery) WithCursor

func (q *CycleRightsQuery) WithCursor(c uint64) TableQuery

func (*CycleRightsQuery) WithDesc

func (q *CycleRightsQuery) WithDesc() TableQuery

func (*CycleRightsQuery) WithFilter

func (q *CycleRightsQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*CycleRightsQuery) WithFormat

func (q *CycleRightsQuery) WithFormat(format FormatType) TableQuery

func (*CycleRightsQuery) WithLimit

func (q *CycleRightsQuery) WithLimit(limit int) TableQuery

func (*CycleRightsQuery) WithOrder

func (q *CycleRightsQuery) WithOrder(order OrderType) TableQuery

func (*CycleRightsQuery) WithPrim

func (q *CycleRightsQuery) WithPrim() TableQuery

func (*CycleRightsQuery) WithQuiet

func (q *CycleRightsQuery) WithQuiet() TableQuery

func (*CycleRightsQuery) WithVerbose

func (q *CycleRightsQuery) WithVerbose() TableQuery

type CycleSnapshot

type CycleSnapshot struct {
	BakeCycle              int64       `json:"baking_cycle"`
	Height                 int64       `json:"snapshot_height"`
	Cycle                  int64       `json:"snapshot_cycle"`
	Timestamp              time.Time   `json:"snapshot_time"`
	Index                  int         `json:"snapshot_index"`
	Rolls                  int64       `json:"snapshot_rolls"`
	ActiveStake            int64       `json:"active_stake"`
	StakingBalance         int64       `json:"staking_balance"`
	OwnBalance             int64       `json:"own_balance"`
	DelegatedBalance       int64       `json:"delegated_balance"`
	NDelegations           int64       `json:"n_delegations"`
	ExpectedIncome         int64       `json:"expected_income"`
	TotalIncome            int64       `json:"total_income"`
	TotalDeposits          int64       `json:"total_deposits"`
	BakingIncome           int64       `json:"baking_income"`
	EndorsingIncome        int64       `json:"endorsing_income"`
	AccusationIncome       int64       `json:"accusation_income"`
	SeedIncome             int64       `json:"seed_income"`
	FeesIncome             int64       `json:"fees_income"`
	TotalLoss              int64       `json:"total_loss"`
	AccusationLoss         int64       `json:"accusation_loss"`
	SeedLoss               int64       `json:"seed_loss"`
	EndorsingLoss          int64       `json:"endorsing_loss"`
	LostAccusationFees     int64       `json:"lost_accusation_fees"`
	LostAccusationRewards  int64       `json:"lost_accusation_rewards"`
	LostAccusationDeposits int64       `json:"lost_accusation_deposits"`
	LostSeedFees           int64       `json:"lost_seed_fees"`
	LostSeedRewards        int64       `json:"lost_seed_rewards"`
	Delegators             []Delegator `json:"delegators"`
}

type Delegator

type Delegator struct {
	Address  tezos.Address `json:"address"`
	Balance  int64         `json:"balance"`
	IsFunded bool          `json:"is_funded"`
}

type Deployment

type Deployment struct {
	Protocol    string `json:"protocol"`
	Version     int    `json:"version"`      // protocol version sequence on indexed chain
	StartHeight int64  `json:"start_height"` // first block on indexed chain
	EndHeight   int64  `json:"end_height"`   // last block on indexed chain or -1
}

type DexMetadata

type DexMetadata struct {
	Kind       string    `json:"kind"`                  // quipu_v1, quipu_token, quipu_v2, vortex, ..
	TradingFee float64   `json:"trading_fee,omitempty"` // trading fee
	ExitFee    float64   `json:"exit_fee,omitempty"`    // remove liquidity fee
	Url        string    `json:"url,omitempty"`         // homepage
	Pairs      []DexPair `json:"pairs"`                 // trading pairs
}

AMM and other decentralized exchanges

type DexPair

type DexPair struct {
	PairId *int64   `json:"pair_id,omitempty"` // 0 when single pool dex
	TokenA DexToken `json:"token_a"`
	TokenB DexToken `json:"token_b"`
	Url    string   `json:"url,omitempty"` // deep link
}

type DexToken

type DexToken struct {
	Type    string `json:"type"`               // tez, fa12, fa2
	Address string `json:"address,omitempty"`  // token ledger, only used for FA*
	TokenId *int64 `json:"token_id,omitempty"` // only used for FA2
}

type DomainMetadata

type DomainMetadata struct {
	Name    string         `json:"name"`
	Records []DomainRecord `json:"records,omitempty"`
}

type DomainRecord

type DomainRecord struct {
	Address tezos.Address     `json:"address"`
	Name    string            `json:"name"`
	Owner   tezos.Address     `json:"owner"`
	Expiry  time.Time         `json:"expiry"`
	Data    map[string]string `json:"data,omitempty"`
}

type Election

type Election struct {
	Id                int                    `json:"election_id"`
	NumPeriods        int                    `json:"num_periods"`
	NumProposals      int                    `json:"num_proposals"`
	StartTime         time.Time              `json:"start_time"`
	EndTime           time.Time              `json:"end_time"`
	StartHeight       int64                  `json:"start_height"`
	EndHeight         int64                  `json:"end_height"`
	IsEmpty           bool                   `json:"is_empty"`
	IsOpen            bool                   `json:"is_open"`
	IsFailed          bool                   `json:"is_failed"`
	NoQuorum          bool                   `json:"no_quorum"`
	NoMajority        bool                   `json:"no_majority"`
	NoProposal        bool                   `json:"no_proposal"`
	VotingPeriodKind  tezos.VotingPeriodKind `json:"voting_period"`
	ProposalPeriod    *Vote                  `json:"proposal"`
	ExplorationPeriod *Vote                  `json:"exploration"`
	CooldownPeriod    *Vote                  `json:"cooldown"`
	PromotionPeriod   *Vote                  `json:"promotion"`
	AdoptionPeriod    *Vote                  `json:"adoption"`
}

func (Election) Period

func (e Election) Period(p tezos.VotingPeriodKind) *Vote

type ErrRateLimited

type ErrRateLimited struct {
	Status          int
	IsResponseError bool

	Header http.Header
	// contains filtered or unexported fields
}

func IsErrRateLimited

func IsErrRateLimited(err error) (ErrRateLimited, bool)

func NewErrRateLimited

func NewErrRateLimited(d time.Duration, isResponse bool) ErrRateLimited

func (ErrRateLimited) Deadline

func (e ErrRateLimited) Deadline() time.Duration

func (ErrRateLimited) Done

func (e ErrRateLimited) Done() <-chan struct{}

func (ErrRateLimited) Error

func (e ErrRateLimited) Error() string

func (ErrRateLimited) Wait

func (e ErrRateLimited) Wait(ctx context.Context) error

type Event

type Event struct {
	// table API only
	RowId     uint64 `json:"row_id"`
	AccountId uint64 `json:"account_id"`
	Height    int64  `json:"height"`
	OpId      uint64 `json:"op_id"`

	// table and explorer API
	Contract tezos.Address  `json:"contract"`
	Type     micheline.Prim `json:"type"`
	Payload  micheline.Prim `json:"payload"`
	Tag      string         `json:"tag"`
	TypeHash string         `json:"type_hash"`
	// contains filtered or unexported fields
}

func (*Event) UnmarshalJSON

func (a *Event) UnmarshalJSON(data []byte) error

func (*Event) UnmarshalJSONBrief

func (e *Event) UnmarshalJSONBrief(data []byte) error

type EventList

type EventList struct {
	Rows []*Event
	// contains filtered or unexported fields
}

func (EventList) Cursor

func (l EventList) Cursor() uint64

func (EventList) Len

func (l EventList) Len() int

func (*EventList) UnmarshalJSON

func (l *EventList) UnmarshalJSON(data []byte) error

type EventQuery

type EventQuery struct {
	// contains filtered or unexported fields
}

func (EventQuery) Check

func (p EventQuery) Check() error

func (*EventQuery) ReplaceFilter

func (q *EventQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*EventQuery) ResetFilter

func (q *EventQuery) ResetFilter() TableQuery

func (EventQuery) Run

func (q EventQuery) Run(ctx context.Context) (*EventList, error)

func (EventQuery) Url

func (p EventQuery) Url() string

func (*EventQuery) WithColumns

func (q *EventQuery) WithColumns(cols ...string) TableQuery

func (*EventQuery) WithCursor

func (q *EventQuery) WithCursor(c uint64) TableQuery

func (*EventQuery) WithDesc

func (q *EventQuery) WithDesc() TableQuery

func (*EventQuery) WithFilter

func (q *EventQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*EventQuery) WithFormat

func (q *EventQuery) WithFormat(format FormatType) TableQuery

func (*EventQuery) WithLimit

func (q *EventQuery) WithLimit(limit int) TableQuery

func (*EventQuery) WithOrder

func (q *EventQuery) WithOrder(order OrderType) TableQuery

func (*EventQuery) WithPrim

func (q *EventQuery) WithPrim() TableQuery

func (*EventQuery) WithQuiet

func (q *EventQuery) WithQuiet() TableQuery

func (*EventQuery) WithVerbose

func (q *EventQuery) WithVerbose() TableQuery

type FieldInfo

type FieldInfo struct {
	Idx      []int
	Name     string
	Alias    string
	Flags    []string
	TypeName string
}

FieldInfo holds details for the representation of a single field.

func (FieldInfo) ContainsFlag

func (f FieldInfo) ContainsFlag(flag string) bool

func (*FieldInfo) DerefIndirect

func (finfo *FieldInfo) DerefIndirect(v interface{}) reflect.Value

Load value from interface, but only if the result will be usefully addressable.

func (FieldInfo) String

func (f FieldInfo) String() string

func (*FieldInfo) Value

func (finfo *FieldInfo) Value(v reflect.Value) reflect.Value

value returns v's field value corresponding to finfo. It's equivalent to v.FieldByIndex(finfo.idx), but initializes and dereferences pointers as necessary.

type FillMode

type FillMode string
const (
	FillModeInvalid FillMode = ""
	FillModeNone    FillMode = "none"
	FillModeNull    FillMode = "null"
	FillModeLast    FillMode = "last"
	FillModeLinear  FillMode = "linear"
	FillModeZero    FillMode = "zero"
)

type Filter

type Filter struct {
	Mode   FilterMode
	Column string
	Value  interface{}
}

type FilterList

type FilterList []Filter

func (*FilterList) Add

func (l *FilterList) Add(mode FilterMode, col string, val ...interface{})

type FilterMode

type FilterMode string
const (
	FilterModeEqual    FilterMode = "eq"
	FilterModeNotEqual FilterMode = "ne"
	FilterModeGt       FilterMode = "gt"
	FilterModeGte      FilterMode = "gte"
	FilterModeLt       FilterMode = "lt"
	FilterModeLte      FilterMode = "lte"
	FilterModeIn       FilterMode = "in"
	FilterModeNotIn    FilterMode = "nin"
	FilterModeRange    FilterMode = "rg"
	FilterModeRegexp   FilterMode = "re"
)

type FormatType

type FormatType string
const (
	FormatJSON FormatType = "json"
	FormatCSV  FormatType = "csv"
)

type FutureResult

type FutureResult chan *response

func (FutureResult) Done

func (r FutureResult) Done() bool

func (FutureResult) Receive

func (r FutureResult) Receive(ctx context.Context) error
type Head struct {
	Hash        tezos.BlockHash `json:"hash"`
	ParentHash  tezos.BlockHash `json:"predecessor"`
	Height      int64           `json:"height"`
	Cycle       int64           `json:"cycle"`
	Timestamp   time.Time       `json:"time"`
	Baker       tezos.Address   `json:"baker"`
	Proposer    tezos.Address   `json:"proposer"`
	Round       int             `json:"round"`
	Nonce       string          `json:"nonce"`
	NOpsApplied int             `json:"n_ops_applied"`
	NOpsFailed  int             `json:"n_ops_failed"`
	Volume      float64         `json:"volume"`
	Fee         float64         `json:"fee"`
	Reward      float64         `json:"reward"`
	GasUsed     int64           `json:"gas_used"`
}

type HttpError

type HttpError struct {
	Status  int
	Data    string
	Request string
	Header  http.Header
}

func IsHttpError

func IsHttpError(err error) (HttpError, bool)

func (HttpError) Error

func (e HttpError) Error() string

type Income added in v0.15.0

type Income struct {
	RowId                  uint64        `json:"row_id"`
	Cycle                  int64         `json:"cycle"`
	Address                tezos.Address `json:"address"`
	AccountId              uint64        `json:"account_id"`
	Rolls                  int64         `json:"rolls"`
	Balance                float64       `json:"balance"`
	Delegated              float64       `json:"delegated"`
	ActiveStake            float64       `json:"active_stake"`
	NDelegations           int64         `json:"n_delegations"`
	NBakingRights          int64         `json:"n_baking_rights"`
	NEndorsingRights       int64         `json:"n_endorsing_rights"`
	Luck                   float64       `json:"luck"`
	LuckPct                float64       `json:"luck_percent"`
	ContributionPct        float64       `json:"contribution_percent"`
	PerformancePct         float64       `json:"performance_percent"`
	NBlocksBaked           int64         `json:"n_blocks_baked"`
	NBlocksProposed        int64         `json:"n_blocks_proposed"`
	NBlocksNotBaked        int64         `json:"n_blocks_not_baked"`
	NBlocksEndorsed        int64         `json:"n_blocks_endorsed"`
	NBlocksNotEndorsed     int64         `json:"n_blocks_not_endorsed"`
	NSlotsEndorsed         int64         `json:"n_slots_endorsed"`
	NSeedsRevealed         int64         `json:"n_seeds_revealed"`
	ExpectedIncome         float64       `json:"expected_income"`
	TotalIncome            float64       `json:"total_income"`
	TotalDeposits          float64       `json:"total_deposits"`
	BakingIncome           float64       `json:"baking_income"`
	EndorsingIncome        float64       `json:"endorsing_income"`
	AccusationIncome       float64       `json:"accusation_income"`
	SeedIncome             float64       `json:"seed_income"`
	FeesIncome             float64       `json:"fees_income"`
	TotalLoss              float64       `json:"total_loss"`
	AccusationLoss         float64       `json:"accusation_loss"`
	SeedLoss               float64       `json:"seed_loss"`
	EndorsingLoss          float64       `json:"endorsing_loss"`
	LostAccusationFees     float64       `json:"lost_accusation_fees"`
	LostAccusationRewards  float64       `json:"lost_accusation_rewards"`
	LostAccusationDeposits float64       `json:"lost_accusation_deposits"`
	LostSeedFees           float64       `json:"lost_seed_fees"`
	LostSeedRewards        float64       `json:"lost_seed_rewards"`
	StartTime              time.Time     `json:"start_time"`
	EndTime                time.Time     `json:"end_time"`
	// contains filtered or unexported fields
}

func (*Income) UnmarshalJSON added in v0.15.0

func (s *Income) UnmarshalJSON(data []byte) error

func (*Income) UnmarshalJSONBrief added in v0.15.0

func (s *Income) UnmarshalJSONBrief(data []byte) error

type IncomeList added in v0.15.0

type IncomeList struct {
	Rows []*Income
	// contains filtered or unexported fields
}

func (IncomeList) Cursor added in v0.15.0

func (l IncomeList) Cursor() uint64

func (IncomeList) Len added in v0.15.0

func (l IncomeList) Len() int

func (*IncomeList) UnmarshalJSON added in v0.15.0

func (l *IncomeList) UnmarshalJSON(data []byte) error

type IncomeQuery added in v0.15.0

type IncomeQuery struct {
	// contains filtered or unexported fields
}

func (IncomeQuery) Check added in v0.15.0

func (p IncomeQuery) Check() error

func (*IncomeQuery) ReplaceFilter added in v0.15.0

func (q *IncomeQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*IncomeQuery) ResetFilter added in v0.15.0

func (q *IncomeQuery) ResetFilter() TableQuery

func (IncomeQuery) Run added in v0.15.0

func (q IncomeQuery) Run(ctx context.Context) (*IncomeList, error)

func (IncomeQuery) Url added in v0.15.0

func (p IncomeQuery) Url() string

func (*IncomeQuery) WithColumns added in v0.15.0

func (q *IncomeQuery) WithColumns(cols ...string) TableQuery

func (*IncomeQuery) WithCursor added in v0.15.0

func (q *IncomeQuery) WithCursor(c uint64) TableQuery

func (*IncomeQuery) WithDesc added in v0.15.0

func (q *IncomeQuery) WithDesc() TableQuery

func (*IncomeQuery) WithFilter added in v0.15.0

func (q *IncomeQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*IncomeQuery) WithFormat added in v0.15.0

func (q *IncomeQuery) WithFormat(format FormatType) TableQuery

func (*IncomeQuery) WithLimit added in v0.15.0

func (q *IncomeQuery) WithLimit(limit int) TableQuery

func (*IncomeQuery) WithOrder added in v0.15.0

func (q *IncomeQuery) WithOrder(order OrderType) TableQuery

func (*IncomeQuery) WithPrim added in v0.15.0

func (q *IncomeQuery) WithPrim() TableQuery

func (*IncomeQuery) WithQuiet added in v0.15.0

func (q *IncomeQuery) WithQuiet() TableQuery

func (*IncomeQuery) WithVerbose added in v0.15.0

func (q *IncomeQuery) WithVerbose() TableQuery

type LocationMetadata

type LocationMetadata struct {
	Country   iso.Country      `json:"country,omitempty"`
	City      iata.AirportCode `json:"city,omitempty"`
	Latitude  float64          `json:"lon,omitempty"`
	Longitude float64          `json:"lat,omitempty"`
	Altitude  float64          `json:"alt,omitempty"`
}

type MediaMetadata

type MediaMetadata struct {
	ThumbnailUri string `json:"thumbnail_uri,omitempty"`
	ArtifactUri  string `json:"artifact_uri,omitempty"`
	Format       string `json:"format,omitempty"`
	Language     string `json:"language,omitempty"`
}

type Metadata

type Metadata struct {
	// address + id together are used as unique identifier
	Address  tezos.Address          `json:"address"`
	AssetId  *int64                 `json:"asset_id,omitempty"`
	Contents map[string]interface{} `json:"-"`
}

func NewMetadata added in v0.15.0

func NewMetadata(a tezos.Address) *Metadata

func (*Metadata) Alias

func (m *Metadata) Alias() *AliasMetadata

func (*Metadata) Asset

func (m *Metadata) Asset() *AssetMetadata

func (*Metadata) Baker

func (m *Metadata) Baker() *BakerMetadata

func (Metadata) Clone

func (m Metadata) Clone() Metadata

func (*Metadata) Delete

func (m *Metadata) Delete(name string)

func (*Metadata) Dex

func (m *Metadata) Dex() *DexMetadata

func (*Metadata) Domain

func (m *Metadata) Domain() *DomainMetadata

func (Metadata) Get

func (m Metadata) Get(name string) interface{}

func (Metadata) Has

func (m Metadata) Has(name string) bool

func (Metadata) ID

func (m Metadata) ID() string

func (Metadata) IsEmpty

func (m Metadata) IsEmpty() bool

func (*Metadata) Location

func (m *Metadata) Location() *LocationMetadata

func (Metadata) MarshalJSON

func (m Metadata) MarshalJSON() ([]byte, error)

func (*Metadata) Media

func (m *Metadata) Media() *MediaMetadata

func (Metadata) Merge

func (m Metadata) Merge(d Metadata) Metadata

func (*Metadata) Payout

func (m *Metadata) Payout() *PayoutMetadata

func (*Metadata) Rights

func (m *Metadata) Rights() *RightsMetadata

func (*Metadata) Set

func (m *Metadata) Set(name string, data interface{})

func (*Metadata) Social

func (m *Metadata) Social() *SocialMetadata

func (*Metadata) Tz16

func (m *Metadata) Tz16() *contract.Tz16

func (*Metadata) Tz21

func (m *Metadata) Tz21() *Tz21Metadata

func (*Metadata) UnmarshalJSON

func (m *Metadata) UnmarshalJSON(buf []byte) error

func (*Metadata) Updated

func (m *Metadata) Updated() *UpdatedMetadata

type MetadataDescriptor

type MetadataDescriptor struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Image       string `json:"image"`
}

type MultiKey

type MultiKey struct {
	// contains filtered or unexported fields
}

func DecodeMultiKey

func DecodeMultiKey(key micheline.Key) (MultiKey, error)

func (MultiKey) GetAddress

func (k MultiKey) GetAddress(path string) (tezos.Address, bool)

func (MultiKey) GetBig

func (k MultiKey) GetBig(path string) (*big.Int, bool)

func (MultiKey) GetInt64

func (k MultiKey) GetInt64(path string) (int64, bool)

func (MultiKey) GetString

func (k MultiKey) GetString(path string) (string, bool)

func (MultiKey) GetTime

func (k MultiKey) GetTime(path string) (time.Time, bool)

func (MultiKey) GetValue

func (k MultiKey) GetValue(path string) (interface{}, bool)

func (MultiKey) Len

func (k MultiKey) Len() int

func (MultiKey) MarshalJSON

func (k MultiKey) MarshalJSON() ([]byte, error)

func (MultiKey) String

func (k MultiKey) String() string

func (MultiKey) Unmarshal

func (k MultiKey) Unmarshal(val interface{}) error

func (*MultiKey) UnmarshalJSON

func (k *MultiKey) UnmarshalJSON(buf []byte) error

func (MultiKey) Walk

func (k MultiKey) Walk(path string, fn ValueWalkerFunc) error

type Op

type Op struct {
	Id           uint64                 `json:"id"`
	Type         OpType                 `json:"type"`
	Hash         tezos.OpHash           `json:"hash"`
	Height       int64                  `json:"height"`
	Cycle        int64                  `json:"cycle"`
	Timestamp    time.Time              `json:"time"`
	OpN          int                    `json:"op_n"`
	OpP          int                    `json:"op_p"`
	Status       tezos.OpStatus         `json:"status"`
	IsSuccess    bool                   `json:"is_success"`
	IsContract   bool                   `json:"is_contract"`
	IsInternal   bool                   `json:"is_internal"`
	IsEvent      bool                   `json:"is_event"`
	IsRollup     bool                   `json:"is_rollup"`
	Counter      int64                  `json:"counter"`
	GasLimit     int64                  `json:"gas_limit"`
	GasUsed      int64                  `json:"gas_used"`
	StorageLimit int64                  `json:"storage_limit"`
	StoragePaid  int64                  `json:"storage_paid"`
	Volume       float64                `json:"volume"`
	Fee          float64                `json:"fee"`
	Reward       float64                `json:"reward"`
	Deposit      float64                `json:"deposit"`
	Burned       float64                `json:"burned"`
	SenderId     uint64                 `json:"sender_id"`
	ReceiverId   uint64                 `json:"receiver_id"`
	CreatorId    uint64                 `json:"creator_id"`
	BakerId      uint64                 `json:"baker_id"`
	Data         json.RawMessage        `json:"data,omitempty"`
	Parameters   *ContractParameters    `json:"parameters,omitempty"` // transaction
	StorageHash  uint64                 `json:"storage_hash,omitempty"`
	CodeHash     string                 `json:"code_hash,omitempty"`
	Errors       json.RawMessage        `json:"errors,omitempty"`
	Sender       tezos.Address          `json:"sender"`
	Receiver     tezos.Address          `json:"receiver"`
	Creator      tezos.Address          `json:"creator"` // origination
	Baker        tezos.Address          `json:"baker"`   // delegation, origination
	Block        tezos.BlockHash        `json:"block"`
	Entrypoint   string                 `json:"entrypoint,omitempty"`
	BigmapDiff   BigmapUpdates          `json:"big_map_diff,omitempty"` // transaction, origination
	BigmapEvents micheline.BigmapEvents `json:"-"`                      // raw, transaction, origination

	// explorer or ZMQ APIs only
	PrevBaker     tezos.Address       `json:"previous_baker"     tzstats:"notable"` // delegation
	Source        tezos.Address       `json:"source"             tzstats:"notable"` // internal operations
	Offender      tezos.Address       `json:"offender"           tzstats:"notable"` // double_x
	Accuser       tezos.Address       `json:"accuser"            tzstats:"notable"` // double_x
	Storage       *ContractValue      `json:"storage,omitempty"  tzstats:"notable"` // transaction, origination
	Script        *micheline.Script   `json:"script,omitempty"   tzstats:"notable"` // origination
	Power         int                 `json:"power,omitempty"    tzstats:"notable"` // endorsement
	Limit         *float64            `json:"limit,omitempty"    tzstats:"notable"` // set deposits limit
	Confirmations int64               `json:"confirmations"      tzstats:"notable"`
	NOps          int                 `json:"n_ops,omitempty"    tzstats:"notable"`
	Batch         []*Op               `json:"batch,omitempty"    tzstats:"notable"`
	Internal      []*Op               `json:"internal,omitempty" tzstats:"notable"`
	Metadata      map[string]Metadata `json:"metadata,omitempty" tzstats:"notable"`
	Events        []Event             `json:"events,omitempty"   tzstats:"notable"`
	// contains filtered or unexported fields
}

func (*Op) Addresses added in v0.15.0

func (o *Op) Addresses() *tezos.AddressSet

func (*Op) BlockId

func (o *Op) BlockId() BlockId

func (*Op) Content

func (o *Op) Content() []*Op

func (Op) Costs

func (o Op) Costs() Costs

func (*Op) Cursor

func (o *Op) Cursor() uint64

func (*Op) OnError

func (o *Op) OnError(action int) *Op

func (*Op) UnmarshalJSON

func (o *Op) UnmarshalJSON(data []byte) error

func (*Op) UnmarshalJSONBrief

func (o *Op) UnmarshalJSONBrief(data []byte) error

func (*Op) WithColumns

func (o *Op) WithColumns(cols ...string) *Op

func (*Op) WithMeta

func (o *Op) WithMeta(b bool) *Op

func (*Op) WithPrim

func (o *Op) WithPrim(b bool) *Op

func (*Op) WithScript

func (o *Op) WithScript(s *ContractScript) *Op

func (*Op) WithTypes

func (o *Op) WithTypes(param, store micheline.Type, eps micheline.Entrypoints, b map[int64]micheline.Type) *Op

type OpGroup

type OpGroup []*Op

func (OpGroup) Costs

func (og OpGroup) Costs() Costs

type OpList

type OpList struct {
	Rows []*Op
	// contains filtered or unexported fields
}

func (OpList) Cursor

func (l OpList) Cursor() uint64

func (OpList) Len

func (l OpList) Len() int

func (*OpList) UnmarshalJSON

func (l *OpList) UnmarshalJSON(data []byte) error

type OpParams

type OpParams struct {
	Params
}

func NewOpParams

func NewOpParams() OpParams

func (OpParams) WithBlock

func (p OpParams) WithBlock(v string) OpParams

func (OpParams) WithCursor

func (p OpParams) WithCursor(v uint64) OpParams

func (OpParams) WithLimit

func (p OpParams) WithLimit(v uint) OpParams

func (OpParams) WithMerge

func (p OpParams) WithMerge() OpParams

func (OpParams) WithMeta

func (p OpParams) WithMeta() OpParams

func (OpParams) WithOffset

func (p OpParams) WithOffset(v uint) OpParams

func (OpParams) WithOrder

func (p OpParams) WithOrder(v OrderType) OpParams

func (OpParams) WithPrim

func (p OpParams) WithPrim() OpParams

func (OpParams) WithRights

func (p OpParams) WithRights() OpParams

func (OpParams) WithSince

func (p OpParams) WithSince(v string) OpParams

func (OpParams) WithStorage

func (p OpParams) WithStorage() OpParams

func (OpParams) WithType

func (p OpParams) WithType(mode FilterMode, typs ...string) OpParams

func (OpParams) WithUnpack

func (p OpParams) WithUnpack() OpParams

type OpQuery

type OpQuery struct {
	NoFail bool
	// contains filtered or unexported fields
}

func (OpQuery) Check

func (p OpQuery) Check() error

func (*OpQuery) ReplaceFilter

func (q *OpQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*OpQuery) ResetFilter

func (q *OpQuery) ResetFilter() TableQuery

func (OpQuery) Run

func (q OpQuery) Run(ctx context.Context) (*OpList, error)

func (OpQuery) Url

func (p OpQuery) Url() string

func (*OpQuery) WithColumns

func (q *OpQuery) WithColumns(cols ...string) TableQuery

func (*OpQuery) WithCursor

func (q *OpQuery) WithCursor(c uint64) TableQuery

func (*OpQuery) WithDesc

func (q *OpQuery) WithDesc() TableQuery

func (*OpQuery) WithFilter

func (q *OpQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*OpQuery) WithFormat

func (q *OpQuery) WithFormat(format FormatType) TableQuery

func (*OpQuery) WithLimit

func (q *OpQuery) WithLimit(limit int) TableQuery

func (OpQuery) WithNoFail added in v0.15.0

func (q OpQuery) WithNoFail() OpQuery

func (*OpQuery) WithOrder

func (q *OpQuery) WithOrder(order OrderType) TableQuery

func (*OpQuery) WithPrim

func (q *OpQuery) WithPrim() TableQuery

func (*OpQuery) WithQuiet

func (q *OpQuery) WithQuiet() TableQuery

func (*OpQuery) WithVerbose

func (q *OpQuery) WithVerbose() TableQuery

type OpType

type OpType byte

Indexer operation and event type

const (
	OpTypeBake                 OpType = iota // 0
	OpTypeEndorsement                        // 1
	OpTypeTransaction                        // 2
	OpTypeReveal                             // 3
	OpTypeDelegation                         // 4
	OpTypeOrigination                        // 5
	OpTypeNonceRevelation                    // 6
	OpTypeActivation                         // 7
	OpTypeBallot                             // 8
	OpTypeProposal                           // 9
	OpTypeDoubleBaking                       // 10
	OpTypeDoubleEndorsement                  // 11
	OpTypeUnfreeze                           // 12 implicit event
	OpTypeInvoice                            // 13 implicit event
	OpTypeAirdrop                            // 14 implicit event
	OpTypeSeedSlash                          // 15 implicit event
	OpTypeMigration                          // 16 implicit event
	OpTypeSubsidy                            // 17 v010 liquidity baking
	OpTypeRegisterConstant                   // 18 v011
	OpTypePreendorsement                     // 19 v012
	OpTypeDoublePreendorsement               // 20 v012
	OpTypeDepositsLimit                      // 21 v012
	OpTypeDeposit                            // 22 v012 implicit event (baker deposit)
	OpTypeBonus                              // 23 v012 implicit event (baker extra bonus)
	OpTypeReward                             // 24 v012 implicit event (endorsement reward pay/burn)
	OpTypeRollupOrigination                  // 25 v013 rollup
	OpTypeRollupTransaction                  // 26 v013 rollup
	OpTypeVdfRevelation                      // 27 v014
	OpTypeIncreasePaidStorage                // 28 v014
	OpTypeDrainDelegate                      // 29 v015
	OpTypeUpdateConsensusKey                 // 30 v015
	OpTypeBatch                = 254         // API output only
	OpTypeInvalid              = 255
)

enums are allocated in chronological order with most often used ops first

func ParseOpType

func ParseOpType(s string) OpType

func (OpType) IsValid

func (t OpType) IsValid() bool

func (*OpType) MarshalText

func (t *OpType) MarshalText() ([]byte, error)

func (OpType) String

func (t OpType) String() string

func (*OpType) UnmarshalText

func (t *OpType) UnmarshalText(data []byte) error

type OrderType

type OrderType string
const (
	OrderAsc  OrderType = "asc"
	OrderDesc OrderType = "desc"
)

type Params

type Params struct {
	Server string
	Prefix string
	Query  url.Values
}

func NewParams

func NewParams() Params

func ParseParams

func ParseParams(urlString string) (Params, error)

parse from http://server:port/prefix server:port/prefix server/prefix /prefix

func (Params) AppendQuery

func (p Params) AppendQuery(path string) string

func (Params) Check

func (p Params) Check() error

func (Params) Copy

func (p Params) Copy() Params

func (Params) Url

func (p Params) Url(actions ...string) string

type PayoutMetadata

type PayoutMetadata []tezos.Address

type Proposal

type Proposal struct {
	Hash          tezos.ProtocolHash `json:"hash"`
	SourceAddress tezos.Address      `json:"source"`
	BlockHash     tezos.BlockHash    `json:"block_hash"`
	OpHash        tezos.OpHash       `json:"op_hash"`
	Height        int64              `json:"height"`
	Time          time.Time          `json:"time"`
	Rolls         int64              `json:"rolls"`
	Voters        int64              `json:"voters"`
}
type Right struct {
	Type           tezos.RightType `json:"type"`
	Address        tezos.Address   `json:"address"`
	Round          int             `json:"round"`
	IsUsed         bool            `json:"is_used"`
	IsLost         bool            `json:"is_lost"`
	IsStolen       bool            `json:"is_stolen"`
	IsMissed       bool            `json:"is_missed"`
	IsSeedRequired bool            `json:"is_seed_required"`
	IsSeedRevealed bool            `json:"is_seed_revealed"`
}

type RightsMetadata

type RightsMetadata struct {
	Date         time.Time     `json:"date,omitempty"`
	Rights       string        `json:"rights,omitempty"`
	License      string        `json:"license,omitempty"`
	Minter       tezos.Address `json:"minter,omitempty"`
	Authors      []string      `json:"authors,omitempty"`
	Creators     []string      `json:"creators,omitempty"`
	Contributors []string      `json:"contributors,omitempty"`
	Publishers   []string      `json:"publishers,omitempty"`
}

type Snapshot

type Snapshot struct {
	RowId        uint64        `json:"row_id"`
	Height       int64         `json:"height"`
	Cycle        int64         `json:"cycle"`
	IsSelected   bool          `json:"is_selected"`
	Timestamp    time.Time     `json:"time"`
	Index        int64         `json:"index"`
	Rolls        int64         `json:"rolls"`
	AccountId    uint64        `json:"account_id"`
	Address      tezos.Address `json:"address"`
	BakerId      uint64        `json:"baker_id"`
	Baker        tezos.Address `json:"baker"`
	IsBaker      bool          `json:"is_baker"`
	IsActive     bool          `json:"is_active"`
	Balance      float64       `json:"balance"`
	Delegated    float64       `json:"delegated"`
	NDelegations int64         `json:"n_delegations"`
	Since        int64         `json:"since"`
	SinceTime    time.Time     `json:"since_time"`
	// contains filtered or unexported fields
}

func (*Snapshot) UnmarshalJSON

func (s *Snapshot) UnmarshalJSON(data []byte) error

func (*Snapshot) UnmarshalJSONBrief

func (s *Snapshot) UnmarshalJSONBrief(data []byte) error

type SnapshotList

type SnapshotList struct {
	Rows []*Snapshot
	// contains filtered or unexported fields
}

func (SnapshotList) Cursor

func (l SnapshotList) Cursor() uint64

func (SnapshotList) Len

func (l SnapshotList) Len() int

func (*SnapshotList) UnmarshalJSON

func (l *SnapshotList) UnmarshalJSON(data []byte) error

type SnapshotQuery

type SnapshotQuery struct {
	// contains filtered or unexported fields
}

func (SnapshotQuery) Check

func (p SnapshotQuery) Check() error

func (*SnapshotQuery) ReplaceFilter

func (q *SnapshotQuery) ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*SnapshotQuery) ResetFilter

func (q *SnapshotQuery) ResetFilter() TableQuery

func (SnapshotQuery) Run

func (SnapshotQuery) Url

func (p SnapshotQuery) Url() string

func (*SnapshotQuery) WithColumns

func (q *SnapshotQuery) WithColumns(cols ...string) TableQuery

func (*SnapshotQuery) WithCursor

func (q *SnapshotQuery) WithCursor(c uint64) TableQuery

func (*SnapshotQuery) WithDesc

func (q *SnapshotQuery) WithDesc() TableQuery

func (*SnapshotQuery) WithFilter

func (q *SnapshotQuery) WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery

func (*SnapshotQuery) WithFormat

func (q *SnapshotQuery) WithFormat(format FormatType) TableQuery

func (*SnapshotQuery) WithLimit

func (q *SnapshotQuery) WithLimit(limit int) TableQuery

func (*SnapshotQuery) WithOrder

func (q *SnapshotQuery) WithOrder(order OrderType) TableQuery

func (*SnapshotQuery) WithPrim

func (q *SnapshotQuery) WithPrim() TableQuery

func (*SnapshotQuery) WithQuiet

func (q *SnapshotQuery) WithQuiet() TableQuery

func (*SnapshotQuery) WithVerbose

func (q *SnapshotQuery) WithVerbose() TableQuery

type SocialMetadata

type SocialMetadata struct {
	Twitter   string `json:"twitter,omitempty"`
	Instagram string `json:"instagram,omitempty"`
	Reddit    string `json:"reddit,omitempty"`
	Github    string `json:"github,omitempty"`
	Website   string `json:"website,omitempty"`
}

type Status

type Status struct {
	Status    string  `json:"status"` // loading, connecting, stopping, stopped, waiting, syncing, synced, failed
	Blocks    int64   `json:"blocks"`
	Finalized int64   `json:"finalized"`
	Indexed   int64   `json:"indexed"`
	Progress  float64 `json:"progress"`
	// contains filtered or unexported fields
}

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(data []byte) error

func (*Status) UnmarshalJSONBrief

func (s *Status) UnmarshalJSONBrief(data []byte) error

func (*Status) WithColumns

func (s *Status) WithColumns(cols ...string) *Status

type StreamResponse

type StreamResponse struct {
	Runtime time.Duration
	Cursor  string
	Count   int
}

func NewStreamResponse

func NewStreamResponse(header http.Header) (StreamResponse, error)

type Supply

type Supply struct {
	RowId               uint64    `json:"row_id"`
	Height              int64     `json:"height"`
	Cycle               int64     `json:"cycle"`
	Timestamp           time.Time `json:"time"`
	Total               float64   `json:"total"`
	Activated           float64   `json:"activated"`
	Unclaimed           float64   `json:"unclaimed"`
	Circulating         float64   `json:"circulating"`
	Liquid              float64   `json:"liquid"`
	Delegated           float64   `json:"delegated"`
	Staking             float64   `json:"staking"`
	Shielded            float64   `json:"shielded"`
	ActiveStake         float64   `json:"active_stake"`
	ActiveDelegated     float64   `json:"active_delegated"`
	ActiveStaking       float64   `json:"active_staking"`
	InactiveDelegated   float64   `json:"inactive_delegated"`
	InactiveStaking     float64   `json:"inactive_staking"`
	Minted              float64   `json:"minted"`
	MintedBaking        float64   `json:"minted_baking"`
	MintedEndorsing     float64   `json:"minted_endorsing"`
	MintedSeeding       float64   `json:"minted_seeding"`
	MintedAirdrop       float64   `json:"minted_airdrop"`
	MintedSubsidy       float64   `json:"minted_subsidy"`
	Burned              float64   `json:"burned"`
	BurnedDoubleBaking  float64   `json:"burned_double_baking"`
	BurnedDoubleEndorse float64   `json:"burned_double_endorse"`
	BurnedOrigination   float64   `json:"burned_origination"`
	BurnedAllocation    float64   `json:"burned_allocation"`
	BurnedStorage       float64   `json:"burned_storage"`
	BurnedExplicit      float64   `json:"burned_explicit"`
	BurnedSeedMiss      float64   `json:"burned_seed_miss"`
	BurnedAbsence       float64   `json:"burned_absence"`
	BurnedRollup        float64   `json:"burned_rollup"`
	Frozen              float64   `json:"frozen"`
	FrozenDeposits      float64   `json:"frozen_deposits"`
	FrozenRewards       float64   `json:"frozen_rewards"`
	FrozenFees          float64   `json:"frozen_fees"`
	FrozenBonds         float64   `json:"frozen_bonds"`
}

type TableQuery

type TableQuery interface {
	WithFilter(mode FilterMode, col string, val ...interface{}) TableQuery
	ReplaceFilter(mode FilterMode, col string, val ...interface{}) TableQuery
	ResetFilter() TableQuery
	WithLimit(limit int) TableQuery
	WithColumns(cols ...string) TableQuery
	WithOrder(order OrderType) TableQuery
	WithDesc() TableQuery
	WithVerbose() TableQuery
	WithQuiet() TableQuery
	WithFormat(format FormatType) TableQuery
	WithPrim() TableQuery
	Check() error
	Url() string
}

type Ticker

type Ticker struct {
	Pair        string    `json:"pair"`
	Base        string    `json:"base"`
	Quote       string    `json:"quote"`
	Exchange    string    `json:"exchange"`
	Open        float64   `json:"open"`
	High        float64   `json:"high"`
	Low         float64   `json:"low"`
	Last        float64   `json:"last"`
	Change      float64   `json:"change"`
	Vwap        float64   `json:"vwap"`
	NTrades     int64     `json:"n_trades"`
	VolumeBase  float64   `json:"volume_base"`
	VolumeQuote float64   `json:"volume_quote"`
	Time        time.Time `json:"timestamp"`
}

type Tip

type Tip struct {
	Name               string             `json:"name"`
	Network            string             `json:"network"`
	Symbol             string             `json:"symbol"`
	ChainId            tezos.ChainIdHash  `json:"chain_id"`
	GenesisTime        time.Time          `json:"genesis_time"`
	Hash               tezos.BlockHash    `json:"block_hash"`
	Height             int64              `json:"height"`
	Cycle              int64              `json:"cycle"`
	Timestamp          time.Time          `json:"timestamp"`
	Protocol           tezos.ProtocolHash `json:"protocol"`
	TotalAccounts      int64              `json:"total_accounts"`
	TotalContracts     int64              `json:"total_contracts"`
	TotalRollups       int64              `json:"total_rollups"`
	FundedAccounts     int64              `json:"funded_accounts"`
	DustAccounts       int64              `json:"dust_accounts"`
	DustDelegators     int64              `json:"dust_delegators"`
	TotalOps           int64              `json:"total_ops"`
	Delegators         int64              `json:"delegators"`
	Bakers             int64              `json:"bakers"`
	Rolls              int64              `json:"rolls"`
	RollOwners         int64              `json:"roll_owners"`
	NewAccounts30d     int64              `json:"new_accounts_30d"`
	ClearedAccounts30d int64              `json:"cleared_accounts_30d"`
	FundedAccounts30d  int64              `json:"funded_accounts_30d"`
	Inflation1Y        float64            `json:"inflation_1y"`
	InflationRate1Y    float64            `json:"inflation_rate_1y"`
	Health             int                `json:"health"`
	Supply             *Supply            `json:"supply"`
	Status             Status             `json:"status"`
}

type TypeInfo

type TypeInfo struct {
	Name     string
	Fields   []FieldInfo
	IsGoType bool
	TagName  string
}

TypeInfo holds details for the representation of a type.

func GetTypeInfo

func GetTypeInfo(v interface{}) (*TypeInfo, error)

GetTypeInfo returns the typeInfo structure with details necessary for marshaling and unmarshaling typ.

func (TypeInfo) Aliases

func (t TypeInfo) Aliases() []string

func (TypeInfo) FieldNames

func (t TypeInfo) FieldNames() []string

func (TypeInfo) FilteredAliases

func (t TypeInfo) FilteredAliases(f string) []string

type Tz21Attribute

type Tz21Attribute struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Type  string `json:"type,omitempty"`
}

type Tz21DataRate

type Tz21DataRate struct {
	Value string `json:"value"`
	Unit  string `json:"unit"`
}

type Tz21Dimension

type Tz21Dimension struct {
	Value string `json:"value"`
	Unit  string `json:"unit"`
}

type Tz21Format

type Tz21Format struct {
	Uri        string        `json:"uri"`
	Hash       string        `json:"hash"`
	MimeType   string        `json:"mimeType"`
	FileSize   int64         `json:"fileSize"`
	FileName   string        `json:"fileName"`
	Duration   string        `json:"duration"`
	Dimensions Tz21Dimension `json:"dimensions"`
	DataRate   Tz21DataRate  `json:"dataRate"`
}

type Tz21Metadata

type Tz21Metadata struct {
	Description        string          `json:"description"`
	Minter             tezos.Address   `json:"minter"`
	Creators           []string        `json:"creators"`
	Contributors       []string        `json:"contributors"`
	Publishers         []string        `json:"publishers"`
	Date               time.Time       `json:"date"`
	BlockLevel         int64           `json:"blockLevel"`
	Type               string          `json:"type"`
	Tags               []string        `json:"tags"`
	Genres             []string        `json:"genres"`
	Language           string          `json:"language"`
	Identifier         string          `json:"identifier"`
	Rights             string          `json:"rights"`
	RightUri           string          `json:"rightUri"`
	ArtifactUri        string          `json:"artifactUri"`
	DisplayUri         string          `json:"displayUri"`
	ThumbnailUri       string          `json:"thumbnailUri"`
	ExternalUri        string          `json:"externalUri"`
	IsTransferable     bool            `json:"isTransferable"`
	IsBooleanAmount    bool            `json:"isBooleanAmount"`
	ShouldPreferSymbol bool            `json:"shouldPreferSymbol"`
	Formats            []Tz21Format    `json:"formats"`
	Attributes         []Tz21Attribute `json:"attributes"`
	Assets             []Tz21Metadata  `json:"assets"`
}

type UpdatedMetadata

type UpdatedMetadata struct {
	Hash   tezos.BlockHash `json:"hash"`
	Height int64           `json:"height"`
	Time   time.Time       `json:"time"`
}

type ValueWalkerFunc

type ValueWalkerFunc func(path string, value interface{}) error

type Vote

type Vote struct {
	VotingPeriod     int64                  `json:"voting_period"`
	VotingPeriodKind tezos.VotingPeriodKind `json:"voting_period_kind"`
	StartTime        time.Time              `json:"period_start_time"`
	EndTime          time.Time              `json:"period_end_time"`
	StartHeight      int64                  `json:"period_start_block"`
	EndHeight        int64                  `json:"period_end_block"`
	EligibleRolls    int                    `json:"eligible_rolls"`
	EligibleVoters   int                    `json:"eligible_voters"`
	QuorumPct        int                    `json:"quorum_pct"`
	QuorumRolls      int                    `json:"quorum_rolls"`
	TurnoutRolls     int                    `json:"turnout_rolls"`
	TurnoutVoters    int                    `json:"turnout_voters"`
	TurnoutPct       int                    `json:"turnout_pct"`
	TurnoutEma       int                    `json:"turnout_ema"`
	YayRolls         int                    `json:"yay_rolls"`
	YayVoters        int                    `json:"yay_voters"`
	NayRolls         int                    `json:"nay_rolls"`
	NayVoters        int                    `json:"nay_voters"`
	PassRolls        int                    `json:"pass_rolls"`
	PassVoters       int                    `json:"pass_voters"`
	IsOpen           bool                   `json:"is_open"`
	IsFailed         bool                   `json:"is_failed"`
	IsDraw           bool                   `json:"is_draw"`
	NoProposal       bool                   `json:"no_proposal"`
	NoQuorum         bool                   `json:"no_quorum"`
	NoMajority       bool                   `json:"no_majority"`
	Proposals        []*Proposal            `json:"proposals"`
}

type Voter

type Voter struct {
	RowId     uint64               `json:"row_id"`
	Address   tezos.Address        `json:"address"`
	Rolls     int64                `json:"rolls"`
	Stake     float64              `json:"stake"`
	Ballot    tezos.BallotVote     `json:"ballot"`
	HasVoted  bool                 `json:"has_voted"`
	Proposals []tezos.ProtocolHash `json:"proposals"`
}

Jump to

Keyboard shortcuts

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