Skip to content

Commit 4ce0e9e

Browse files
author
Ludo Galabru
committed
feat: add post_transfer_output_value
1 parent a0fa1a9 commit 4ce0e9e

File tree

2 files changed

+5
-3
lines changed
  • components

2 files changed

+5
-3
lines changed

components/chainhook-event-observer/src/hord/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
338338
}
339339
};
340340

341-
let (outpoint_post_transfer, offset_post_transfer, updated_address) =
341+
let (outpoint_post_transfer, offset_post_transfer, updated_address, post_transfer_output_value) =
342342
match post_transfer_output {
343343
Some(index) => {
344344
let outpoint =
@@ -372,13 +372,13 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
372372
};
373373

374374
// let vout = new_tx.metadata.outputs[index];
375-
(outpoint, offset, updated_address)
375+
(outpoint, offset, updated_address, Some(new_tx.metadata.outputs[post_transfer_output_index].value))
376376
}
377377
None => {
378378
// Get Coinbase TX
379379
let offset = first_sat_post_subsidy + cumulated_fees;
380380
let outpoint = coinbase_txid.clone();
381-
(outpoint, offset, None)
381+
(outpoint, offset, None, None)
382382
}
383383
};
384384

@@ -432,6 +432,7 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
432432
updated_address,
433433
satpoint_pre_transfer,
434434
satpoint_post_transfer,
435+
post_transfer_output_value,
435436
};
436437

437438
// Attach transfer event

components/chainhook-types-rs/src/rosetta.rs

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ pub struct OrdinalInscriptionTransferData {
314314
pub updated_address: Option<String>,
315315
pub satpoint_pre_transfer: String,
316316
pub satpoint_post_transfer: String,
317+
pub post_transfer_output_value: Option<u64>,
317318
}
318319

319320
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]

0 commit comments

Comments
 (0)