From 1118a2958fee95be662553a2d22e5063240aaeab Mon Sep 17 00:00:00 2001 From: nym21 Date: Sun, 9 Aug 2026 09:35:25 +0200 Subject: [PATCH] fix normalized P2A output type --- crates/brk_mcp/generated/manifest.json | 42 +++++++++++++------------- crates/brk_types/src/output_type.rs | 6 +++- crates/brk_types/src/txout.rs | 4 +++ website/llms-full.txt | 4 +-- website_next/llms-full.txt | 4 +-- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/crates/brk_mcp/generated/manifest.json b/crates/brk_mcp/generated/manifest.json index 68a943bc5..155f1f6fc 100644 --- a/crates/brk_mcp/generated/manifest.json +++ b/crates/brk_mcp/generated/manifest.json @@ -204,15 +204,15 @@ }, "OutputType": { "enum": [ - "p2pk", - "p2pk", + "p2pk65", + "p2pk33", "p2pkh", - "multisig", + "p2ms", "p2sh", - "op_return", - "v0_p2wpkh", - "v0_p2wsh", - "v1_p2tr", + "opreturn", + "p2wpkh", + "p2wsh", + "p2tr", "p2a", "empty", "unknown" @@ -964,15 +964,15 @@ "description": "Type (P2PKH, P2WPKH, P2SH, P2TR, etc.)", "type": "string", "enum": [ - "p2pk", - "p2pk", + "p2pk65", + "p2pk33", "p2pkh", - "multisig", + "p2ms", "p2sh", - "op_return", - "v0_p2wpkh", - "v0_p2wsh", - "v1_p2tr", + "opreturn", + "p2wpkh", + "p2wsh", + "p2tr", "p2a", "empty", "unknown" @@ -1015,15 +1015,15 @@ }, "OutputType": { "enum": [ - "p2pk", - "p2pk", + "p2pk65", + "p2pk33", "p2pkh", - "multisig", + "p2ms", "p2sh", - "op_return", - "v0_p2wpkh", - "v0_p2wsh", - "v1_p2tr", + "opreturn", + "p2wpkh", + "p2wsh", + "p2tr", "p2a", "empty", "unknown" diff --git a/crates/brk_types/src/output_type.rs b/crates/brk_types/src/output_type.rs index b24d65fe5..98e88f2b5 100644 --- a/crates/brk_types/src/output_type.rs +++ b/crates/brk_types/src/output_type.rs @@ -70,6 +70,8 @@ pub enum OutputTypeNormalized { #[serde(rename = "v1_p2tr")] #[strum(serialize = "v1_p2tr")] P2TR, + #[serde(rename = "anchor")] + #[strum(serialize = "anchor")] P2A, Empty, Unknown, @@ -369,7 +371,7 @@ mod tests { OutputTypeNormalized::P2TR, "v1_p2tr", ), - (OutputType::P2A, "p2a", OutputTypeNormalized::P2A, "p2a"), + (OutputType::P2A, "p2a", OutputTypeNormalized::P2A, "anchor"), ( OutputType::Empty, "empty", @@ -408,5 +410,7 @@ mod tests { } assert!(serde_json::from_str::(r#""p2pk""#).is_err()); + assert!(serde_json::from_str::(r#""anchor""#).is_err()); + assert!(serde_json::from_str::(r#""p2a""#).is_err()); } } diff --git a/crates/brk_types/src/txout.rs b/crates/brk_types/src/txout.rs index c6ed563e2..59b0aecd0 100644 --- a/crates/brk_types/src/txout.rs +++ b/crates/brk_types/src/txout.rs @@ -160,6 +160,10 @@ mod tests { script_type(p2pk_script(&p2pk65)), (OutputType::P2PK65, "p2pk".to_string()) ); + assert_eq!( + script_type(ScriptBuf::from_bytes(vec![0x51, 0x02, 0x4e, 0x73])), + (OutputType::P2A, "anchor".to_string()) + ); let mut p2wpkh = vec![0; 22]; p2wpkh[1] = 0x14; assert_eq!( diff --git a/website/llms-full.txt b/website/llms-full.txt index 7a5ed2cdc..209244f10 100644 --- a/website/llms-full.txt +++ b/website/llms-full.txt @@ -1482,7 +1482,7 @@ curl -s "https://bitview.space/version" ### `AddrStats` - `address`: `Addr` (required) — Bitcoin address string -- `addr_type`: `OutputType` (required) — Address type (p2pkh, p2sh, v0_p2wpkh, v0_p2wsh, v1_p2tr, etc.) +- `addr_type`: `OutputType` (required) — BRK address type (p2pk33, p2pk65, p2pkh, p2sh, p2wpkh, p2wsh, p2tr, etc.) - `chain_stats`: `AddrChainStats` (required) — Statistics for confirmed transactions on the blockchain - `mempool_stats`: `AddrMempoolStats` (required) — Statistics for unconfirmed transactions in the mempool - `balance`: `Sats` (required) — Total current balance in satoshis, including pending (unconfirmed) mempool changes @@ -1794,7 +1794,7 @@ curl -s "https://bitview.space/version" ### `OutputType` -`p2pk | p2pk | p2pkh | multisig | p2sh | op_return | v0_p2wpkh | v0_p2wsh | v1_p2tr | p2a | empty | unknown` +`p2pk65 | p2pk33 | p2pkh | p2ms | p2sh | opreturn | p2wpkh | p2wsh | p2tr | p2a | empty | unknown` ### `PaginatedSeries` diff --git a/website_next/llms-full.txt b/website_next/llms-full.txt index 7a5ed2cdc..209244f10 100644 --- a/website_next/llms-full.txt +++ b/website_next/llms-full.txt @@ -1482,7 +1482,7 @@ curl -s "https://bitview.space/version" ### `AddrStats` - `address`: `Addr` (required) — Bitcoin address string -- `addr_type`: `OutputType` (required) — Address type (p2pkh, p2sh, v0_p2wpkh, v0_p2wsh, v1_p2tr, etc.) +- `addr_type`: `OutputType` (required) — BRK address type (p2pk33, p2pk65, p2pkh, p2sh, p2wpkh, p2wsh, p2tr, etc.) - `chain_stats`: `AddrChainStats` (required) — Statistics for confirmed transactions on the blockchain - `mempool_stats`: `AddrMempoolStats` (required) — Statistics for unconfirmed transactions in the mempool - `balance`: `Sats` (required) — Total current balance in satoshis, including pending (unconfirmed) mempool changes @@ -1794,7 +1794,7 @@ curl -s "https://bitview.space/version" ### `OutputType` -`p2pk | p2pk | p2pkh | multisig | p2sh | op_return | v0_p2wpkh | v0_p2wsh | v1_p2tr | p2a | empty | unknown` +`p2pk65 | p2pk33 | p2pkh | p2ms | p2sh | opreturn | p2wpkh | p2wsh | p2tr | p2a | empty | unknown` ### `PaginatedSeries`