Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add enum to receive APIs to give more control over the received amount #36

Open
zoedberg opened this issue Nov 28, 2023 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@zoedberg
Copy link
Collaborator

Let's add an enum field to receive APIs (blind_receive and witness_receive) to allow the user to have more control over the transfer, based on the RGB amount being received.

The enum should be defined as:

/// Choice of policy to apply when receiving a transfer, based on the RGB amount
pub enum ReceiveAmount{
    /// Any received amount will be accepted, regardless of the amount that has been specified in the invoice
    Whatever,
    // If the received amount is different from the requested one the transfer should be refused. This value is possible only when setting an amount into the invoice
    Exact,
    /// If the received amount is lower than the requested one the transfer should be refused. This value is possible only when setting an amount into the invoice
    AtLeast,
}

As the enum documentation says, if the user specifies ReceiveAmount::Exact or ReceiveAmount::AtLeast then the optional amount field of the receive APIs should be set, otherwise an Error::NoReceiveAmount error (to be added) should be returned.

@zoedberg zoedberg added good first issue Good for newcomers enhancement New feature or request labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant