mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-06-13 16:19:01 +08:00
feat: merge "inscription_revealed" and "inscription_transferred" into "inscription_feed"
This commit is contained in:
16
README.md
16
README.md
@@ -160,19 +160,11 @@ The current `bitcoin` predicates supports the following `if_this` constructs:
|
||||
}
|
||||
}
|
||||
|
||||
// Get any transaction including a new Ordinal inscription
|
||||
// Get any transaction including a new Ordinal inscription (inscription revealed and transfered)
|
||||
{
|
||||
"if_this": {
|
||||
"protocol": "ordinals",
|
||||
"operation": "inscription_revealed"
|
||||
}
|
||||
}
|
||||
|
||||
// Get any transaction transferring a revealed Ordinal inscription
|
||||
{
|
||||
"if_this": {
|
||||
"protocol": "ordinals",
|
||||
"operation": "inscription_transferred"
|
||||
"operation": "inscription_feed"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +265,7 @@ Putting all the pieces together:
|
||||
"testnet": {
|
||||
"if_this": {
|
||||
"protocol": "ordinals",
|
||||
"operation": "inscription_revealed"
|
||||
"operation": "inscription_feed"
|
||||
},
|
||||
"then_that": {
|
||||
"http_post": {
|
||||
@@ -286,7 +278,7 @@ Putting all the pieces together:
|
||||
"mainnet": {
|
||||
"if_this": {
|
||||
"protocol": "ordinals",
|
||||
"operation": "inscription_revealed"
|
||||
"operation": "inscription_feed"
|
||||
},
|
||||
"then_that": {
|
||||
"http_post": {
|
||||
|
||||
@@ -464,7 +464,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
|
||||
start_block: Some(0),
|
||||
end_block: Some(100),
|
||||
predicate: BitcoinPredicateType::Protocol(Protocols::Ordinal(
|
||||
OrdinalOperations::InscriptionRevealed,
|
||||
OrdinalOperations::InscriptionFeed,
|
||||
)),
|
||||
expire_after_occurrence: None,
|
||||
action: HookAction::FileAppend(FileHook {
|
||||
|
||||
@@ -418,19 +418,12 @@ impl BitcoinPredicateType {
|
||||
false
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Ordinal(
|
||||
OrdinalOperations::InscriptionRevealed,
|
||||
OrdinalOperations::InscriptionFeed,
|
||||
)) => {
|
||||
for op in tx.metadata.ordinal_operations.iter() {
|
||||
if let OrdinalOperation::InscriptionRevealed(_) = op {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Ordinal(
|
||||
OrdinalOperations::InscriptionTransferred,
|
||||
)) => {
|
||||
for op in tx.metadata.ordinal_operations.iter() {
|
||||
if let OrdinalOperation::InscriptionTransferred(_) = op {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -509,8 +509,7 @@ pub enum StacksOperations {
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum OrdinalOperations {
|
||||
InscriptionRevealed,
|
||||
InscriptionTransferred,
|
||||
InscriptionFeed,
|
||||
}
|
||||
|
||||
pub fn get_stacks_canonical_magic_bytes(network: &BitcoinNetwork) -> [u8; 2] {
|
||||
|
||||
@@ -512,8 +512,7 @@
|
||||
"OrdinalOperations": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"inscription_revealed",
|
||||
"inscription_transferred"
|
||||
"inscription_feed"
|
||||
]
|
||||
},
|
||||
"HookAction": {
|
||||
|
||||
Reference in New Issue
Block a user