Skip to content

Commit 741290d

Browse files
author
Ludo Galabru
committed
feat: merge "inscription_revealed" and "inscription_transferred" into "inscription_feed"
1 parent 45b9abd commit 741290d

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

README.md

+4-12
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,11 @@ The current `bitcoin` predicates supports the following `if_this` constructs:
160160
}
161161
}
162162

163-
// Get any transaction including a new Ordinal inscription
163+
// Get any transaction including a new Ordinal inscription (inscription revealed and transfered)
164164
{
165165
"if_this": {
166166
"protocol": "ordinals",
167-
"operation": "inscription_revealed"
168-
}
169-
}
170-
171-
// Get any transaction transferring a revealed Ordinal inscription
172-
{
173-
"if_this": {
174-
"protocol": "ordinals",
175-
"operation": "inscription_transferred"
167+
"operation": "inscription_feed"
176168
}
177169
}
178170

@@ -273,7 +265,7 @@ Putting all the pieces together:
273265
"testnet": {
274266
"if_this": {
275267
"protocol": "ordinals",
276-
"operation": "inscription_revealed"
268+
"operation": "inscription_feed"
277269
},
278270
"then_that": {
279271
"http_post": {
@@ -286,7 +278,7 @@ Putting all the pieces together:
286278
"mainnet": {
287279
"if_this": {
288280
"protocol": "ordinals",
289-
"operation": "inscription_revealed"
281+
"operation": "inscription_feed"
290282
},
291283
"then_that": {
292284
"http_post": {

components/chainhook-cli/src/cli/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
464464
start_block: Some(0),
465465
end_block: Some(100),
466466
predicate: BitcoinPredicateType::Protocol(Protocols::Ordinal(
467-
OrdinalOperations::InscriptionRevealed,
467+
OrdinalOperations::InscriptionFeed,
468468
)),
469469
expire_after_occurrence: None,
470470
action: HookAction::FileAppend(FileHook {

components/chainhook-event-observer/src/chainhooks/bitcoin/mod.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -418,19 +418,12 @@ impl BitcoinPredicateType {
418418
false
419419
}
420420
BitcoinPredicateType::Protocol(Protocols::Ordinal(
421-
OrdinalOperations::InscriptionRevealed,
421+
OrdinalOperations::InscriptionFeed,
422422
)) => {
423423
for op in tx.metadata.ordinal_operations.iter() {
424424
if let OrdinalOperation::InscriptionRevealed(_) = op {
425425
return true;
426426
}
427-
}
428-
false
429-
}
430-
BitcoinPredicateType::Protocol(Protocols::Ordinal(
431-
OrdinalOperations::InscriptionTransferred,
432-
)) => {
433-
for op in tx.metadata.ordinal_operations.iter() {
434427
if let OrdinalOperation::InscriptionTransferred(_) = op {
435428
return true;
436429
}

components/chainhook-event-observer/src/chainhooks/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,7 @@ pub enum StacksOperations {
509509
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
510510
#[serde(rename_all = "snake_case")]
511511
pub enum OrdinalOperations {
512-
InscriptionRevealed,
513-
InscriptionTransferred,
512+
InscriptionFeed,
514513
}
515514

516515
pub fn get_stacks_canonical_magic_bytes(network: &BitcoinNetwork) -> [u8; 2] {

docs/chainhook-openapi.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,7 @@
512512
"OrdinalOperations": {
513513
"type": "string",
514514
"enum": [
515-
"inscription_revealed",
516-
"inscription_transferred"
515+
"inscription_feed"
517516
]
518517
},
519518
"HookAction": {

0 commit comments

Comments
 (0)