httphandler

package
v0.0.0-...-43207eb Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSONAndValidate

func DecodeJSONAndValidate(ctx context.Context, req *http.Request, reqBody interface{}, appTracker apptracker.AppTracker) *httperror.ErrorResponse

func DecodePathAndValidate

func DecodePathAndValidate(ctx context.Context, req *http.Request, reqPath interface{}, appTracker apptracker.AppTracker) *httperror.ErrorResponse

func DecodeQueryAndValidate

func DecodeQueryAndValidate(ctx context.Context, req *http.Request, reqQuery interface{}, appTracker apptracker.AppTracker) *httperror.ErrorResponse

func ValidateRequestParams

func ValidateRequestParams(ctx context.Context, reqParams interface{}, appTracker apptracker.AppTracker) *httperror.ErrorResponse

Types

type AccountHandler

type AccountHandler struct {
	AccountService            services.AccountService
	AccountSponsorshipService services.AccountSponsorshipService
	SupportedAssets           []entities.Asset
	AppTracker                apptracker.AppTracker
}

func (AccountHandler) CreateFeeBumpTransaction

func (h AccountHandler) CreateFeeBumpTransaction(rw http.ResponseWriter, req *http.Request)

func (AccountHandler) DeregisterAccount

func (h AccountHandler) DeregisterAccount(w http.ResponseWriter, r *http.Request)

func (AccountHandler) RegisterAccount

func (h AccountHandler) RegisterAccount(w http.ResponseWriter, r *http.Request)

func (AccountHandler) SponsorAccountCreation

func (h AccountHandler) SponsorAccountCreation(rw http.ResponseWriter, req *http.Request)

type AccountRegistrationRequest

type AccountRegistrationRequest struct {
	Address string `json:"address" validate:"required,public_key"`
}

type CreateFeeBumpTransactionRequest

type CreateFeeBumpTransactionRequest struct {
	Transaction string `json:"transaction" validate:"required"`
}

type GetTransactionRequest

type GetTransactionRequest struct {
	TransactionHash string `json:"transactionhash" validate:"required"`
}

type GetTransactionResponse

type GetTransactionResponse struct {
	Hash   string `json:"transactionhash"`
	XDR    string `json:"transactionxdr"`
	Status string `json:"status"`
}

type PaymentHandler

type PaymentHandler struct {
	PaymentService services.PaymentService
	AppTracker     apptracker.AppTracker
}

func (PaymentHandler) GetPayments

func (h PaymentHandler) GetPayments(w http.ResponseWriter, r *http.Request)

type PaymentsRequest

type PaymentsRequest struct {
	Address  string         `query:"address" validate:"public_key"`
	AfterID  string         `query:"afterId"`
	BeforeID string         `query:"beforeId"`
	Sort     data.SortOrder `query:"sort" validate:"oneof=ASC DESC"`
	Limit    int            `query:"limit" validate:"gt=0,lte=200"`
}

type PaymentsResponse

type PaymentsResponse struct {
	Payments []data.Payment `json:"payments"`
	entities.Pagination
}

type SponsorAccountCreationRequest

type SponsorAccountCreationRequest struct {
	Address string            `json:"address" validate:"required,public_key"`
	Signers []entities.Signer `json:"signers" validate:"required,gt=0,dive"`
}

type TSSHandler

type TSSHandler struct {
	Router            router.Router
	Store             store.Store
	AppTracker        apptracker.AppTracker
	NetworkPassphrase string
}

func (*TSSHandler) GetTransaction

func (t *TSSHandler) GetTransaction(w http.ResponseWriter, r *http.Request)

func (*TSSHandler) SubmitTransactions

func (t *TSSHandler) SubmitTransactions(w http.ResponseWriter, r *http.Request)

type Transaction

type Transaction struct {
	Operations []string `json:"operations" validate:"required"`
}

type TransactionEnvelopeResponse

type TransactionEnvelopeResponse struct {
	Transaction       string `json:"transaction"`
	NetworkPassphrase string `json:"networkPassphrase"`
}

type TransactionSubmissionRequest

type TransactionSubmissionRequest struct {
	WebhookURL   string        `json:"webhook" validate:"required"`
	Transactions []Transaction `json:"transactions" validate:"required,gt=0"`
}

type TransactionSubmissionResponse

type TransactionSubmissionResponse struct {
	TransactionHashes []string `json:"transactionhashes"`
}

Jump to

Keyboard shortcuts

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