Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hirosystems/chainhook-client

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hirosystems/chainhook-client - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

7

dist/server.d.ts

@@ -27,2 +27,9 @@ /// <reference types="node" />

export type ChainhookNodeOptions = Static<typeof ChainhookNodeOptionsSchema>;
/**
* Throw this error when processing a Chainhook Payload if you believe it is a bad request. This
* will cause the server to return a `400` status code.
*/
export declare class BadPayloadRequestError extends Error {
constructor(message: string);
}
declare const ServerPredicateSchema: import("@sinclair/typebox").TObject<{

@@ -29,0 +36,0 @@ uuid: import("@sinclair/typebox").TString;

23

dist/server.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildServer = void 0;
exports.buildServer = exports.BadPayloadRequestError = void 0;
const type_provider_typebox_1 = require("@fastify/type-provider-typebox");

@@ -29,2 +29,13 @@ const compiler_1 = require("@sinclair/typebox/compiler");

});
/**
* Throw this error when processing a Chainhook Payload if you believe it is a bad request. This
* will cause the server to return a `400` status code.
*/
class BadPayloadRequestError extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
}
}
exports.BadPayloadRequestError = BadPayloadRequestError;
const IfThisThenNothingSchema = type_provider_typebox_1.Type.Union([

@@ -163,4 +174,10 @@ type_provider_typebox_1.Type.Composite([

catch (error) {
logger_1.logger.error(error, `ChainhookEventObserver error processing payload`);
await reply.code(500).send();
if (error instanceof BadPayloadRequestError) {
logger_1.logger.error(error, `ChainhookEventObserver bad payload`);
await reply.code(400).send();
}
else {
logger_1.logger.error(error, `ChainhookEventObserver error processing payload`);
await reply.code(500).send();
}
}

@@ -167,0 +184,0 @@ });

2

package.json
{
"name": "@hirosystems/chainhook-client",
"version": "1.4.0",
"version": "1.4.1",
"description": "Chainhook TypeScript client",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc