api

package
v0.0.0-...-ffaf892 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(msg string) *oas.ErrorStatusCode

func InternalError

func InternalError(err error) *oas.ErrorStatusCode

func Unauthorized

func Unauthorized(err error) *oas.ErrorStatusCode

Types

type Config

type Config struct {
	TonConnectSecret  string
	TelegramBotSecret string
}

type Handler

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

Handler handles operations described by OpenAPI v3 specification of this service. It implements oas.Handler interface and every API operation is implemented as a method on Handler.

func NewHandler

func NewHandler(logger *zap.Logger, notificator *core.AccountEventsNotificator, bridge *core.Bridge, config Config) (*Handler, error)

func (*Handler) AccountEventsSubscriptionStatus

func (h *Handler) AccountEventsSubscriptionStatus(ctx context.Context, req *oas.AccountEventsSubscriptionStatusReq) (*oas.AccountEventsSubscriptionStatusOK, error)

AccountEventsSubscriptionStatus returns a status of an account-events subscription.

func (*Handler) BridgeWebhook

func (h *Handler) BridgeWebhook(ctx context.Context, req *oas.BridgeWebhookReq, params oas.BridgeWebhookParams) error

BridgeWebhook is called by the HTTP Bridge when an event occurs.

func (*Handler) GetTonConnectPayload

func (h *Handler) GetTonConnectPayload(ctx context.Context) (*oas.GetTonConnectPayloadOK, error)

GetTonConnectPayload returns a challenge for TON Connect.

func (*Handler) NewError

func (h *Handler) NewError(ctx context.Context, err error) *oas.ErrorStatusCode

func (*Handler) SubscribeToAccountEvents

func (h *Handler) SubscribeToAccountEvents(ctx context.Context, req *oas.SubscribeToAccountEventsReq) error

SubscribeToAccountEvents subscribes to notifications about events in the TON blockchain for a specific address.

func (*Handler) SubscribeToBridgeEvents

func (h *Handler) SubscribeToBridgeEvents(ctx context.Context, req *oas.SubscribeToBridgeEventsReq) error

SubscribeToBridgeEvents subscribes to notifications from the HTTP Bridge regarding a specific smart contract or wallet.

func (*Handler) UnsubscribeFromAccountEvents

func (h *Handler) UnsubscribeFromAccountEvents(ctx context.Context, req *oas.UnsubscribeFromAccountEventsReq) error

UnsubscribeFromAccountEvents unsubscribes from notifications about events in the TON blockchain for a specific address.

func (*Handler) UnsubscribeFromBridgeEvents

func (h *Handler) UnsubscribeFromBridgeEvents(ctx context.Context, req *oas.UnsubscribeFromBridgeEventsReq) error

UnsubscribeFromBridgeEvents unsubscribes from bridge notifications.

type Server

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

Server is an HTTP server that serves the API described in api/tonkeeper-twa-api.yaml.

func NewServer

func NewServer(log *zap.Logger, pool *pgxpool.Pool, handler *Handler, address string) (*Server, error)

func (*Server) Run

func (s *Server) Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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