Versions in this module Expand all Collapse all v0 v0.2.0 Jul 20, 2026 Changes in this version + type ApiToken struct + CreatedAt time.Time + ID string + LastUsedAt *time.Time + Name *string + Prefix string + Scope string type Client + func (c *Client) ListTokens(ctx context.Context) ([]ApiToken, error) + func (c *Client) RevokeToken(ctx context.Context, id string) error v0.1.0 Jul 20, 2026 Changes in this version + const DefaultTolerance + var ErrInvalidSignature = errors.New("tokentip: invalid webhook signature") + func IsConflict(err error) bool + func IsForbidden(err error) bool + func IsNotFound(err error) bool + func IsUnauthorized(err error) bool + func IsUpstream(err error) bool + type Ack struct + Message string + OK bool + type Balance struct + Credit Money + Disabled *bool + KeyClaimed bool + LiveLimit *Money + LiveUsage *Money + type Client struct + func New(token string, opts ...Option) *Client + func (c *Client) Balance(ctx context.Context) (*Balance, error) + func (c *Client) CreateWebhook(ctx context.Context, in NewWebhook) (*WebhookEndpointCreated, error) + func (c *Client) DeleteWebhook(ctx context.Context, id string) error + func (c *Client) GetKey(ctx context.Context) (*Key, error) + func (c *Client) GetTip(ctx context.Context, id string) (*Tip, error) + func (c *Client) ListTips(ctx context.Context, opts *ListOptions) (*TipList, error) + func (c *Client) ListWebhooks(ctx context.Context) ([]WebhookEndpoint, error) + func (c *Client) Me(ctx context.Context) (*Me, error) + func (c *Client) OperatorDisableKey(ctx context.Context, handle string) (*Ack, error) + func (c *Client) OperatorListCreators(ctx context.Context, opts *ListOptions) (*CreatorList, error) + func (c *Client) OperatorListTips(ctx context.Context, opts *ListOptions) (*TipList, error) + func (c *Client) OperatorOverview(ctx context.Context) (*Overview, error) + func (c *Client) OperatorSettle(ctx context.Context, tipID, idempotencyKey string) (*ForceSettleResult, error) + func (c *Client) RotateKey(ctx context.Context, idempotencyKey string) (*MintedKey, error) + func (c *Client) Stats(ctx context.Context) (*Stats, error) + func (c *Client) StreamEvents(ctx context.Context, operator bool) (*EventStream, error) + type CreatorList struct + Data []CreatorSummary + NextCursor *string + type CreatorSummary struct + Balance Money + Disabled *bool + DisplayName *string + Fingerprint *string + Handle string + Joined *time.Time + KeyClaimed bool + LiveLimit *Money + LiveUsage *Money + SettledGross *Money + SettledTips *int + type Error struct + Detail string + Instance string + Status int + Title string + Type string + func (e *Error) Error() string + type Event struct + APIVersion string + Created time.Time + Data json.RawMessage + ID string + Scope string + Type string + func VerifyWebhook(payload []byte, signatureHeader, secret string, tolerance time.Duration) (*Event, error) + func (e *Event) Balance() *Money + func (e *Event) Decode(v any) error + func (e *Event) Tip() *Tip + type EventStream struct + func (s *EventStream) Close() error + func (s *EventStream) Next() (*Event, error) + type ForceSettleResult struct + Message string + Status string + type Key struct + Disabled bool + Fingerprint string + Limit *Money + MintedAt *time.Time + Usage *Money + type ListOptions struct + Cursor string + Limit int + Status string + type Me struct + CreatedAt *time.Time + Credit Money + DisplayName string + Handle string + KeyClaimed bool + KeyFingerprint *string + type MintedKey struct + Fingerprint string + Limit Money + MintedAt *time.Time + Secret string + type Money string + type NewWebhook struct + Description string + Events []string + URL string + type Option func(*Client) + func WithBaseURL(u string) Option + func WithHTTPClient(h *http.Client) Option + type Overview struct + Counts map[string]int + Money map[string]Money + Pool Pool + TipsByStatus map[string]int + type Pool struct + Available *Money + Committed Money + Headroom *Money + State string + type Stats struct + LifetimeGross Money + SettledGross Money + SettledNet Money + TipsHeld int + TipsSettled int + TipsTotal int + type Tip struct + CreatedAt time.Time + CreatorHandle string + Gross Money + HeldAt *time.Time + ID string + NetToTokens Money + SettledAt *time.Time + Status string + TipperName *string + TipperNote *string + type TipList struct + Data []Tip + NextCursor *string + type WebhookEndpoint struct + CreatedAt *time.Time + Disabled bool + Events []string + ID string + URL string + type WebhookEndpointCreated struct + Secret string