Versions in this module Expand all Collapse all v1 v1.1.1 Oct 3, 2026 Changes in this version type Config + ReceiptObserver ReceiptObserver + ReceiptOverflowPolicy string + SubscriptionReceiptCapacity int type Option + func WithSubscriptionReceiptBuffer(capacity int, policy string) Option + func WithSubscriptionReceiptObserver(observer ReceiptObserver) Option + type ReceiptObserver func(ctx context.Context, receipt Receipt) error v1.1.0 Oct 3, 2026 Changes in this version type Error + Receipts []Receipt + type Optional struct + Set bool + Value *T + func Null[T any]() Optional[T] + func Present[T any](value T) Optional[T] + func (o Optional[T]) SetVariable(variables map[string]any, name string) + type Receipt struct + CapturedAt time.Time + Direction ReceiptDirection + OperationSHA256 string + Source ReceiptSource + StatusCode int + Target string + func NewReceipt(source ReceiptSource, direction ReceiptDirection, target string, ...) Receipt + func (r Receipt) Operation() json.RawMessage + func (r Receipt) Raw() json.RawMessage + type ReceiptDirection string + const ReceiptReceived + const ReceiptSent + type ReceiptSource string + const ReceiptSourceHTTP + const ReceiptSourceWebSocket type Response + Receipts []Receipt v1.0.0 Sep 22, 2026 Changes in this version + const OAuthTokenEndpoint + const OverflowDropOldest + const OverflowFail + const V1EndpointAsia + const V1EndpointEurope + const V1EndpointUS + const V2EndpointAsia + const V2EndpointEurope + const V2EndpointUS + var ErrAuthentication = errors.New("bitquery: authentication failed (401)") + var ErrAuthorization = errors.New("bitquery: authorization failed (403)") + var ErrGraphQL = errors.New("bitquery: graphql errors in response") + var ErrInvalidConfig = errors.New("bitquery: invalid configuration") + var ErrPlanEntitlement = errors.New("bitquery: plan entitlement error (402)") + var ErrRateLimited = errors.New("bitquery: rate limited (429)") + var ErrServer = errors.New("bitquery: server error (5xx)") + var ErrSubscription = errors.New("bitquery: subscription error") + var ErrTransport = errors.New("bitquery: transport error") + func HTTPURL(version APIVersion, region Region, override string) (string, error) + func IsRetryable(err error) bool + func WebSocketURL(region Region, httpsOverride, wsOverride string) (string, error) + type APIVersion int + const V1 + const V2 + func ParseAPIVersion(s string) (APIVersion, error) + func (v APIVersion) String() string + type ClientCredentialsOption func(*ClientCredentialsProvider) + func WithOAuthHTTPClient(hc *http.Client) ClientCredentialsOption + func WithOAuthScope(scope string) ClientCredentialsOption + func WithOAuthTokenEndpoint(endpoint string) ClientCredentialsOption + type ClientCredentialsProvider struct + func NewClientCredentialsProvider(clientID, clientSecret string, opts ...ClientCredentialsOption) *ClientCredentialsProvider + func (p *ClientCredentialsProvider) Refresh(ctx context.Context) (string, error) + func (p *ClientCredentialsProvider) Token(ctx context.Context) (string, error) + type Config struct + BaseURL string + Dialer Dialer + HTTPClient *http.Client + Logger Logger + OverflowPolicy string + RateLimiter RateLimiter + Region Region + Retry *RetryPolicy + Strict bool + SubProtocol SubProtocol + SubscriptionMaxReconnects int + SubscriptionQueueCapacity int + Timeout time.Duration + TokenEndpoint string + TokenProvider TokenProvider + UserAgent string + WebSocketURL string + func NewConfig(opts ...Option) (*Config, error) + type Dialer func(ctx context.Context, url string, subprotocols []string) (WSConn, error) + type Error struct + Context map[string]any + GraphQLErrors []GraphQLError + Kind Kind + Message string + Response *Response + RetryAfter time.Duration + StatusCode int + Temporary bool + func Wrap(kind Kind, message string, cause error) *Error + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) Unwrap() error + type Executor struct + func NewExecutor(version APIVersion, opts ...Option) (*Executor, error) + func (e *Executor) Config() *Config + func (e *Executor) Endpoint() (string, error) + func (e *Executor) Execute(ctx context.Context, op Operation) (*Response, error) + func (e *Executor) ExecuteStrict(ctx context.Context, op Operation) (*Response, error) + func (e *Executor) Version() APIVersion + type GraphQLError struct + Extensions map[string]any + Locations []map[string]any + Message string + Path []any + Raw json.RawMessage + func (e GraphQLError) Error() string + type Kind int + const KindAuthentication + const KindAuthorization + const KindConfig + const KindGraphQL + const KindPlanEntitlement + const KindRateLimited + const KindServer + const KindSubscription + const KindTransport + type Logger interface + Debug func(msg string, args ...any) + Error func(msg string, args ...any) + Info func(msg string, args ...any) + Warn func(msg string, args ...any) + type Network string + const NetworkArbitrum + const NetworkBSC + const NetworkBase + const NetworkEthereum + const NetworkMatic + const NetworkOptimism + const NetworkSolana + const NetworkTron + type NopLogger struct + func (NopLogger) Debug(string, ...any) + func (NopLogger) Error(string, ...any) + func (NopLogger) Info(string, ...any) + func (NopLogger) Warn(string, ...any) + type NopRateLimiter struct + func (NopRateLimiter) Wait(context.Context) error + type Operation struct + OperationName string + Query string + Variables map[string]any + type Option func(*Config) + func WithBaseURL(u string) Option + func WithDialer(d Dialer) Option + func WithHTTPClient(hc *http.Client) Option + func WithLogger(l Logger) Option + func WithRateLimiter(l RateLimiter) Option + func WithRegion(r Region) Option + func WithRetryPolicy(p *RetryPolicy) Option + func WithStrict() Option + func WithSubProtocol(p SubProtocol) Option + func WithSubscriptionQueue(capacity int, policy string) Option + func WithSubscriptionReconnect(n int) Option + func WithTimeout(d time.Duration) Option + func WithTokenEndpoint(u string) Option + func WithTokenProvider(tp TokenProvider) Option + func WithUserAgent(ua string) Option + func WithWebSocketURL(u string) Option + type RateLimiter interface + Wait func(ctx context.Context) error + type Region string + const RegionAsia + const RegionEurope + const RegionUS + type Response struct + Data json.RawMessage + Errors []GraphQLError + Extensions json.RawMessage + Header map[string][]string + RawBody []byte + StatusCode int + func (r *Response) DecodeData(v any) error + func (r *Response) HasErrors() bool + func (r *Response) HasPartialData() bool + type RetryPolicy struct + BaseDelay time.Duration + Jitter float64 + MaxAttempts int + MaxDelay time.Duration + Rand interface{ ... } + RetryableStatuses []int + Sleep func(ctx context.Context, d time.Duration) error + func DefaultRetryPolicy() *RetryPolicy + func NoRetry() *RetryPolicy + func (p *RetryPolicy) Delay(attempt int, retryAfter time.Duration) time.Duration + type SlogAdapter struct + Log interface{ ... } + func (a SlogAdapter) Debug(msg string, args ...any) + func (a SlogAdapter) Error(msg string, args ...any) + func (a SlogAdapter) Info(msg string, args ...any) + func (a SlogAdapter) Warn(msg string, args ...any) + type StaticTokenProvider struct + func NewStaticTokenProvider(token string) *StaticTokenProvider + func (p *StaticTokenProvider) Refresh(ctx context.Context) (string, error) + func (p *StaticTokenProvider) Token(context.Context) (string, error) + type SubProtocol string + const SubProtocolGraphQLTransportWS + const SubProtocolGraphQLWS + func (p SubProtocol) DataType() string + func (p SubProtocol) KeepaliveType() string + func (p SubProtocol) SubscribeType() string + type TokenBucketRateLimiter struct + func NewRateLimiter(rpm int) *TokenBucketRateLimiter + func (l *TokenBucketRateLimiter) Wait(ctx context.Context) error + type TokenProvider interface + Refresh func(ctx context.Context) (string, error) + Token func(ctx context.Context) (string, error) + type WSConn interface + Close func(code uint32, reason string) error + Read func(ctx context.Context) (WSMessageType, []byte, error) + Write func(ctx context.Context, mt WSMessageType, data []byte) error + type WSMessageType int + const WSMessageBinary + const WSMessageText Other modules containing this package github.com/tigusigalpa/bitquery-go/v2