Skip to content

Commit d7cc5a4

Browse files
committed
feat: support cursed inscriptions in chainhook client
1 parent ea1ff9a commit d7cc5a4

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

components/client/typescript/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/client/typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hirosystems/chainhook-client",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Chainhook TypeScript client",
55
"main": "./dist/index.js",
66
"typings": "./dist/index.d.ts",

components/client/typescript/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class ChainhookEventObserver {
3333
* @param predicates - Predicates to register
3434
* @param callback - Function to handle every Chainhook event payload sent by the node
3535
*/
36-
async start(predicates: [ServerPredicate], callback: OnEventCallback): Promise<void> {
36+
async start(predicates: ServerPredicate[], callback: OnEventCallback): Promise<void> {
3737
if (this.fastify) return;
3838
this.fastify = await buildServer(this.serverOpts, this.chainhookOpts, predicates, callback);
3939
await this.fastify.listen({ host: this.serverOpts.hostname, port: this.serverOpts.port });

components/client/typescript/src/schemas/bitcoin/payload.ts

+20
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,27 @@ export const BitcoinInscriptionTransferredSchema = Type.Object({
3333
});
3434
export type BitcoinInscriptionTransferred = Static<typeof BitcoinInscriptionTransferredSchema>;
3535

36+
export const BitcoinCursedInscriptionRevealedSchema = Type.Object({
37+
content_bytes: Type.String(),
38+
content_type: Type.String(),
39+
content_length: Type.Integer(),
40+
inscription_number: Type.Integer(),
41+
inscription_fee: Type.Integer(),
42+
inscription_id: Type.String(),
43+
inscription_output_value: Type.Integer(),
44+
inscriber_address: Type.String(),
45+
ordinal_number: Type.Integer(),
46+
ordinal_block_height: Type.Integer(),
47+
ordinal_offset: Type.Integer(),
48+
satpoint_post_inscription: Type.String(),
49+
curse_type: Type.String(),
50+
});
51+
export type BitcoinCursedInscriptionRevealed = Static<
52+
typeof BitcoinCursedInscriptionRevealedSchema
53+
>;
54+
3655
export const BitcoinOrdinalOperationSchema = Type.Object({
56+
cursed_inscription_revealed: Type.Optional(BitcoinCursedInscriptionRevealedSchema),
3757
inscription_revealed: Type.Optional(BitcoinInscriptionRevealedSchema),
3858
inscription_transferred: Type.Optional(BitcoinInscriptionTransferredSchema),
3959
});

components/client/typescript/src/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export type ServerPredicate = Static<typeof ServerPredicateSchema>;
7373
export async function buildServer(
7474
serverOpts: ServerOptions,
7575
chainhookOpts: ChainhookNodeOptions,
76-
predicates: [ServerPredicate],
76+
predicates: ServerPredicate[],
7777
callback: OnEventCallback
7878
) {
7979
async function waitForNode(this: FastifyInstance) {

0 commit comments

Comments
 (0)