diff --git a/config.example.yaml b/config.example.yaml index 048cba3..661c355 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -2,6 +2,7 @@ # Environment variables can override any setting using ARCADE_ prefix # Example: ARCADE_SERVER_ADDRESS=:9090 overrides server.address network: main +log_level: info # debug, info, warn, error storage_path: ~/.arcade server: address: ":3011" diff --git a/handlers/webhook.go b/handlers/webhook.go index ae0a975..0c460ff 100644 --- a/handlers/webhook.go +++ b/handlers/webhook.go @@ -162,6 +162,7 @@ func (h *WebhookHandler) deliverWebhook(ctx context.Context, sub models.Submissi slog.String("status", string(status.Status))) status.StatusCode = http.StatusOK + status.Title = "OK" payloadBytes, err := json.Marshal(status) if err != nil { h.logger.Error("Failed to marshal payload", diff --git a/models/transaction.go b/models/transaction.go index 6b04b71..54ab302 100644 --- a/models/transaction.go +++ b/models/transaction.go @@ -39,13 +39,14 @@ func (h *HexBytes) UnmarshalJSON(data []byte) error { type TransactionStatus struct { TxID string `json:"txid"` Status Status `json:"txStatus"` - StatusCode int `json:"status,omitempty"` + StatusCode int `json:"status"` + Title string `json:"title"` Timestamp time.Time `json:"timestamp"` BlockHash string `json:"blockHash,omitempty"` BlockHeight uint64 `json:"blockHeight,omitempty"` MerklePath HexBytes `json:"merklePath,omitempty"` ExtraInfo string `json:"extraInfo,omitempty"` - CompetingTxs []string `json:"competingTxs,omitempty"` + CompetingTxs []string `json:"competingTxs"` CreatedAt time.Time `json:"-"` } diff --git a/routes/fiber/routes.go b/routes/fiber/routes.go index b600e56..2452a30 100644 --- a/routes/fiber/routes.go +++ b/routes/fiber/routes.go @@ -128,6 +128,7 @@ func (r *Routes) handlePostTx(c *fiber.Ctx) error { } status.StatusCode = http.StatusOK + status.Title = "OK" return c.JSON(status) } @@ -176,6 +177,7 @@ func (r *Routes) handlePostTxs(c *fiber.Ctx) error { for _, s := range statuses { s.StatusCode = http.StatusOK + s.Title = "OK" } return c.JSON(statuses) } @@ -216,6 +218,7 @@ func (r *Routes) handleGetTx(c *fiber.Ctx) error { return c.Status(http.StatusInternalServerError).JSON(fiber.Map{"error": "Failed to get status"}) } status.StatusCode = http.StatusOK + status.Title = "OK" return c.JSON(status) } @@ -319,12 +322,13 @@ func (r *Routes) parseTransactionBody(c *fiber.Ctx) ([]byte, error) { // extractSubmitOptions extracts SubmitOptions from HTTP headers. func (r *Routes) extractSubmitOptions(c *fiber.Ctx) *models.SubmitOptions { + skipAll := c.Get("X-SkipTxValidation") == "true" return &models.SubmitOptions{ CallbackURL: c.Get("X-CallbackUrl"), CallbackToken: c.Get("X-CallbackToken"), FullStatusUpdates: c.Get("X-FullStatusUpdates") == "true", - SkipFeeValidation: c.Get("X-SkipFeeValidation") == "true", - SkipScriptValidation: c.Get("X-SkipScriptValidation") == "true", + SkipFeeValidation: skipAll || c.Get("X-SkipFeeValidation") == "true", + SkipScriptValidation: skipAll || c.Get("X-SkipScriptValidation") == "true", } }