Documentation
¶
Index ¶
- Constants
- Variables
- func ParseJSON(r *http.Request, v interface{}) error
- func SendJSON(w http.ResponseWriter, v interface{})
- func SendWebhook(uri string, v interface{})
- type Client
- func (c *Client) Close(ctx context.Context)
- func (c *Client) CreatePayment(w http.ResponseWriter, r *http.Request)
- func (c *Client) ForwardFunds(ctx context.Context, pr *PaymentCreateResponse) error
- func (c *Client) HandleCreatePayment(w http.ResponseWriter, r *http.Request, b *PaymentCreateBody)
- func (c *Client) HandleWebhookCall(ctx context.Context, b *PaymentCreateBody, r *ws.LogResult, ...) bool
- func (c *Client) Listen()
- func (c Client) UpgradeWS(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)
- type PaymentCreateBody
- type PaymentCreateResponse
- type WebhookResponse
Constants ¶
View Source
const (
DeadlineContext = time.Second * 30
)
Variables ¶
View Source
var ( ALLOW_LOCAL_HOST = false CryptoDeadline = time.Minute * 30 MinForward = types.Config.Forwarder.MinForward // Minimum amount to forward in SOL TransactionThreshold = big.NewFloat(1 - types.Config.Forwarder.TransactionThreshold) // Threshold for transaction values IgnoreIotaTxThreshold = big.NewFloat(0.02) // If the amount is 2% or less, ignore the transaction. This is to ignore bots. )
Functions ¶
func SendJSON ¶
func SendJSON(w http.ResponseWriter, v interface{})
func SendWebhook ¶
func SendWebhook(uri string, v interface{})
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreatePayment ¶
func (c *Client) CreatePayment(w http.ResponseWriter, r *http.Request)
func (*Client) ForwardFunds ¶
func (c *Client) ForwardFunds(ctx context.Context, pr *PaymentCreateResponse) error
func (*Client) HandleCreatePayment ¶
func (c *Client) HandleCreatePayment(w http.ResponseWriter, r *http.Request, b *PaymentCreateBody)
func (*Client) HandleWebhookCall ¶
func (c *Client) HandleWebhookCall(ctx context.Context, b *PaymentCreateBody, r *ws.LogResult, pr *PaymentCreateResponse) bool
type PaymentCreateBody ¶
type PaymentCreateResponse ¶
type WebhookResponse ¶
type WebhookResponse struct { Success bool `json:"success" bson:"success"` ID string `json:"id" bson:"id"` Error any `json:"error" bson:"error"` DesiredAmount float64 `json:"desired_amount" bson:"desired_amount"` AmountSent float64 `json:"amount_sent" bson:"amount_sent"` TransactionID string `json:"transaction_id" bson:"transaction_id"` Address string `json:"address" bson:"address"` TimeSent uint64 `json:"time_sent" bson:"time_sent"` PercentOfTotal float64 `json:"percent_of_total" bson:"percent_of_total"` }
Click to show internal directories.
Click to hide internal directories.