Webhook Model for Satoshi Showdown. This model is pivotal for tracking and managing blockchain event webhooks within the platform. It enables real-time monitoring and updates related to blockchain transactions and significant events, thus playing a crucial role in timely and accurate event handling. The model includes fields for webhook configuration, response data, type, associated transactions, status, confirmation tracking, and lifecycle management.
- Source:
Requires
- module:mongoose
- module:uuid
Type Definitions
WebhookModel
WebhookModel: Represents a blockchain event webhook in Satoshi Showdown. Encapsulates configuration, status, transaction association, and lifecycle management. Essential for asynchronous event integration and notifications from blockchain services.
Type:
- mongoose.Model.<WebhookSchema>
- Source:
WebhookSchema
WebhookSchema: Defines the structure and rules for blockchain event webhook data. Includes fields for unique identifier, response data, headers, body, type, related transaction, status, confirmation tracking, and lifecycle information. This schema ensures comprehensive management of webhooks.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
urlId |
string | Unique identifier for the webhook. |
response |
Object | Response data received from the external service. |
headers |
Map | HTTP headers associated with the webhook request. |
body |
* | Webhook payload, flexible in data type. |
type |
string | Type of webhook, e.g., transaction confirmation. |
transactionRef |
mongoose.Schema.Types.ObjectId | Reference to associated Transaction model. |
status |
string | Current status of the webhook (pending, processing, success, failed). |
confirmationsReceived |
Array.<Object> | Array of objects, each tracking a received confirmation number along with its timestamp. |
lastProcessedConfirmation |
number | Last processed confirmation count. |
currentConfirmation |
number | Current confirmation count. |
isDeleted |
boolean | Indicates if the webhook is soft deleted. |
deletedAt |
Date | Timestamp of webhook soft deletion. |
lastAttempt |
Date | Timestamp of the last processing attempt. |
- Source: