feat: add frigate electrum based RPC methods - #16
Conversation
server.version, blockchain.silentpayments.subscribe and blockchain.silentpayments.unsubscribe225fc0c to
885cd2f
Compare
|
Thanks for the PR! Note that it needs a rebase now with the recent merges. |
… `blockchain.silentpayments.unsubscribe`
oleonardolima
left a comment
There was a problem hiding this comment.
In https://github.com/sparrowwallet/frigate#serverfeatures it mentions the new field in server.features, is it not needed by bdk-sp ?
|
@sdmg15 I just thought this now during the call, but you could also try adding support for these in https://github.com/bitcoindevkit/rust-electrum-client, not sure if the architecture there supports it though. |
noahjoeris
left a comment
There was a problem hiding this comment.
Thanks for updating @sdmg15 !
I left a few more comments
|
@noahjoeris Thanks for the reviews. I've applied the changes. |
noahjoeris
left a comment
There was a problem hiding this comment.
Thanks again for updating man. Almost there 🚀
Could you also add doc comments to the pub fields you added?
| pub struct SpSubscribeResp { | ||
| pub address: String, | ||
| pub labels: Vec<u32>, | ||
| pub start_height: u32, |
| pub struct TxTweak { | ||
| pub height: u32, | ||
| pub tx_hash: bitcoin::Txid, | ||
| pub tweak_key: bitcoin::secp256k1::PublicKey, | ||
| } |
| // A 64 character string containing the hex of the scan private key. | ||
| pub scan_priv_key: bitcoin::secp256k1::SecretKey, | ||
|
|
||
| // A 66 character string containing the hex of the spend public key. |
| pub struct SpNotification { | ||
| pub subscription: response::SpSubscribeResp, | ||
| pub progress: f32, | ||
| pub history: Vec<response::TxTweak>, |
| // A 64 character string containing the hex of the scan private key. | ||
| pub scan_priv_key: bitcoin::secp256k1::SecretKey, | ||
|
|
||
| // A 66 character string containing the hex of the spend public key. | ||
| pub spend_pub_key: bitcoin::secp256k1::PublicKey, | ||
|
|
||
| // Block height or timestamp to start scanning from. Values above 500,000,000 are treated as seconds from the start of the epoch. |
|
Thanks @sdmg15 . I left some final nits. And I ran a quick manual test and it was looking good. |
This PR adds supports for additional RPC methods provided by Frigate electrum based RPC server.
The added methods are:
server.version: This is the first message sent to establish connection with serverblockchain.silentpayments.subscribe: This takes a spend public key and a scan private key and return outputs belonging to the them.blockchain.silentpayments.unsubscribe: This takes a spend public key and a scan private key and unsubscribe from notifications.Some context:
This is useful for the PR opened at bitcoindevkit/bdk-sp#48 which is doing integration of frigate ephemeral scanning.
Opening this PR in order to receive feedback.
Reference:
https://github.com/sparrowwallet/frigate/
Supported Frigate version 1.3.2