feat: payment processor #597

Merged
thesimplekid merged 1 commit from refactor_payment_processor into main 2025-03-10 15:10:42 +00:00
thesimplekid commented 2025-02-11 13:37:33 +00:00 (Migrated from github.com)

Description


  • Remove strike and phd from readme

Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

### Description <!-- Describe the purpose of this PR, what's being adding and/or fixed --> ----- - [x] Remove strike and phd from readme ### Notes to the reviewers <!-- In this section you can include notes directed to the reviewers, like explaining why some parts of the PR were done in a specific way --> ----- ### Suggested [CHANGELOG](https://github.com/cashubtc/cdk/blob/main/CHANGELOG.md) Updates <!-- Please do not edit the actual changelog but note what you changed here. --> #### CHANGED #### ADDED #### REMOVED #### FIXED ---- ### Checklist * [x] I followed the [code style guidelines](https://github.com/cashubtc/cdk/blob/main/CODE_STYLE.md) * [x] I ran `just final-check` before committing
crodas (Migrated from github.com) reviewed 2025-02-11 13:37:33 +00:00
ok300 (Migrated from github.com) reviewed 2025-02-24 16:20:35 +00:00
@ -265,3 +265,3 @@
#[error(transparent)]
Database(#[from] crate::database::Error),
/// Lightning Error
/// Payment Error
ok300 (Migrated from github.com) commented 2025-02-24 15:58:59 +00:00
    /// Payment Error
```suggestion /// Payment Error ```
ok300 (Migrated from github.com) commented 2025-02-24 14:03:27 +00:00

unwrap() -> ?

`unwrap()` -> `?`
@ -0,0 +1,5 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
ok300 (Migrated from github.com) commented 2025-02-24 14:19:05 +00:00
    println!("cargo:rerun-if-changed=src/proto/payment_processor.proto");
```suggestion println!("cargo:rerun-if-changed=src/proto/payment_processor.proto"); ```
@ -0,0 +1,299 @@
use std::path::PathBuf;
ok300 (Migrated from github.com) commented 2025-02-24 14:01:40 +00:00

unwrap() should be replaced with ?

`unwrap()` should be replaced with `?`
@ -0,0 +1,345 @@
use std::net::SocketAddr;
ok300 (Migrated from github.com) commented 2025-02-24 14:02:05 +00:00

unwrap() -> ?

`unwrap()` -> `?`
codingpeanut157 (Migrated from github.com) reviewed 2025-02-27 17:00:13 +00:00
@ -0,0 +1,113 @@
syntax = "proto3";
codingpeanut157 (Migrated from github.com) commented 2025-02-27 17:00:13 +00:00

\n missing

`\n` missing
davidcaseria (Migrated from github.com) reviewed 2025-03-01 12:33:30 +00:00
@ -27,7 +29,9 @@ pub struct MintBuilder {
/// Mint Storage backend
davidcaseria (Migrated from github.com) commented 2025-03-01 12:33:24 +00:00

Do you plan to make this more generic with on-chain?

Do you plan to make this more generic with on-chain?
thesimplekid (Migrated from github.com) reviewed 2025-03-02 08:33:45 +00:00
@ -27,7 +29,9 @@ pub struct MintBuilder {
/// Mint Storage backend
thesimplekid (Migrated from github.com) commented 2025-03-02 08:33:45 +00:00

Yes, the plan is to use this trait for all payment backends. If we looks at the ones I created for bolt12 and onchain. I think we can use what we have here without modify it but there would be some unused fields. The problem as I see it is to make it really general for everything we could just use Value but this loses typing so Ideally we don't do this though I did use it for the settings endpoint. But if we try to create types now to make it more general for things we dont support yet (onchain, bolt11) we may need to end up chaining them later anyway. So I think its best to keep the grpc api pretty close to what we know we need and currently support, bolt11, and then make changes when we know we need them and what changes we need to support bolt12, and onchain or whatever else.

That being said I'm certainly open if you have suggestions to the api at this point as I mostly just reused what we had in the previous trait.

Yes, the plan is to use this trait for all payment backends. If we looks at the ones I created for [bolt12](https://github.com/cashubtc/cdk/blob/cc4a63bd2bdd7c9b1bd592bb4f1c9bd03d6c9d3f/crates/cdk/src/cdk_lightning/bolt12.rs#L17) and [onchain](https://github.com/cashubtc/cdk/blob/8dc537a18ea3a30b7d24c7f69d7d1de006b0111a/crates/cdk/src/cdk_onchain/mod.rs#L33). I think we can use what we have here without modify it but there would be some unused fields. The problem as I see it is to make it really general for everything we could just use `Value` but this loses typing so Ideally we don't do this though I did use it for the settings endpoint. But if we try to create types now to make it more general for things we dont support yet (onchain, bolt11) we may need to end up chaining them later anyway. So I think its best to keep the grpc api pretty close to what we know we need and currently support, bolt11, and then make changes when we know we need them and what changes we need to support bolt12, and onchain or whatever else. That being said I'm certainly open if you have suggestions to the api at this point as I mostly just reused what we had in the previous trait.
davidcaseria (Migrated from github.com) reviewed 2025-03-03 15:18:07 +00:00
@ -27,7 +29,9 @@ pub struct MintBuilder {
/// Mint Storage backend
davidcaseria (Migrated from github.com) commented 2025-03-03 15:18:07 +00:00

The trait is well-defined. Should the LnKey struct be made more generic now or later?

The trait is well-defined. Should the `LnKey` struct be made more generic now or later?
thesimplekid (Migrated from github.com) reviewed 2025-03-04 08:54:54 +00:00
@ -27,7 +29,9 @@ pub struct MintBuilder {
/// Mint Storage backend
thesimplekid (Migrated from github.com) commented 2025-03-04 08:54:54 +00:00

Should the LnKey struct be made more generic now or later?

Good catch f46d84e631148bd4ebe5c8343c63ee405f8913e0

> Should the LnKey struct be made more generic now or later? Good catch f46d84e631148bd4ebe5c8343c63ee405f8913e0
ok300 (Migrated from github.com) approved these changes 2025-03-10 10:03:14 +00:00
ok300 (Migrated from github.com) left a comment

Had another look at it, looks good.

Had another look at it, looks good.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk!597
No description provided.