Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions handlers/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions models/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"-"`
}

Expand Down
8 changes: 6 additions & 2 deletions routes/fiber/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (r *Routes) handlePostTx(c *fiber.Ctx) error {
}

status.StatusCode = http.StatusOK
status.Title = "OK"
return c.JSON(status)
}

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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",
}
}

Expand Down
Loading