Register a webhook to track Northstake validator marketplace events

Registers a webhook URL for receiving push notifications from Northstake regarding events in the Validator Marketplace. When registered events occur, webhooks are triggered, and JSON payloads are sent as POST requests to the specified URL.

A webhook can subscribe to different event types. Here are descriptions and example payloads for each supported event. These payloads are what will be POST'ed to your Webhook endpoint.

(For more details regarding webhook payloads, refer to the schemas for the WebhookPayload_XXXX types in documentation)

  • RFQAvailable: Triggered when a new RFQ document becomes available. The payload includes detailed information about validators, their balances, exit estimates, and other RFQ-specific details.

    {
      "document_id": "rfq123",
      "event": "RFQAvailable",
      "details": {
        "id": "rfq123",
        "validators": [
          {
            "validator_index": 1,
            "balance": 32,
            "exit_estimates": [
              {
                "estimated_exit_time": "2025-03-01T12:00:00Z",
                "estimated_exit_transaction_deadline": "2025-03-01T12:00:00Z",
                "timestamp": "2024-03-01T12:00:00Z"
              }
            ]
          }
        ],
        "total_balance": 32,
        "payment_address": "0xabcd",
        "estimated_exit_transaction_deadline": "2025-03-01T12:00:00Z",
        "estimated_all_validators_exited_at": "2025-03-01T12:00:00Z",
        "unique_escrow_vault": "vault123"
      }
    }
    
  • RFQBidReceived: Triggered when a new bid is received on an RFQ. Includes the latest quote ID and the bid amount.

    {
      "document_id": "rfq123",
      "event": "RFQBidReceived",
      "details": {
        "quote_id": "quote789",
        "amount": 5000,
        "timestamp": "2024-03-01T13:00:00Z"
      }
    }
    
  • RFQBidAccepted: Triggered when a bid is accepted. Includes the quote ID and the accepted amount.

    {
      "document_id": "rfq123",
      "event": "RFQBidAccepted",
      "details": {
        "quote_id": "quote789",
        "amount": 5000,
        "timestamp": "2024-03-02T14:30:00Z",
        "escrow_address": "0x12345"
      }
    }
    
  • RFQEscrowEvent: Triggered when an escrow payment is made. Includes transaction hash and payment amount.

    {
      "document_id": "rfq123",
      "event": "RFQEscrowEvent",
      "details": {
        "transaction_hash": "0xabc123",
        "amount": 5000,
        "timestamp": "2024-03-03T15:45:00Z"
      }
    }
    
  • RFQTransferProposalReceived: Notifies an RFQ seller of a new transfer proposal on their RFQ

    {
      "document_id": "rfq123",
      "event": "RFQTransferProposalReceived",
      "details": {
        "transaction_hash": "0xabc123",
        "timestamp": "2024-03-03T15:45:00Z"
        "proposal_id": "0x12345""
      }
    }
    
  • RFQValidatorWithdrawalChange: Triggered when a validator withdrawal status changes. Includes transaction hash and validator index.

    {
      "document_id": "rfq123",
      "event": "RFQValidatorWithdrawalChange",
      "details": [{
        "transaction_hash": "0xdef456",
        "validator_index": 1,
        "timestamp": "2024-03-04T16:50:00Z"
      },
      {
        "transaction_hash": "0xdef457",
        "validator_index": 2,
        "timestamp": "2024-03-04T16:50:00Z"
      },
                  {
        "transaction_hash": "0xdef458",
        "validator_index": 3,
        "timestamp": "2024-03-04T16:50:00Z"
      },
      ]
    }
    
  • RFQEscrowReleased: Triggered when escrow funds are released. Includes transaction hash and the released amount.

    {
      "document_id": "rfq123",
      "event": "RFQEscrowReleased",
      "details": {
        "transaction_hash": "0xghi789",
        "amount": 5000,
        "timestamp": "2024-03-05T17:55:00Z"
      }
    }
    
  • RFQValidatorExited : Notifies the owner whenever a validator exits the ethereum network

    {
      "document_id": "rfq123",
      "event": "RFQValidatorExited",
      "details": {
        "validator_index": "0xghi789",
        "timestamp": "2024-03-05T17:55:00Z"
      }
    }
    

Webhook Security Note:
All webhook requests include a Bearer token in the Authorization header. Recipients must validate this token to ensure the notifications are from a trusted source.

import { NorthstakeApi } from '@northstake/northstakeapi'
const api = new NorthstakeApi('apiKey', 'privateKey')

const bidReceivedWebhook: WebhookRegistration = {
  url: 'https://webhook.site/1b1b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b',
  eventType: 'RFQBidReceived',
  secret: 'secret', //bearer token secret which should be validated by the webhook
}

await api.validatorMarketplaceWebhooks.registerWebhook(bidReceivedWebhook)

console.log('Webhook registered')
Language
Click Try It! to start a request and see the response here!