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.
Let's add an enum field to receive APIs (
blind_receiveandwitness_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:
As the enum documentation says, if the user specifies
ReceiveAmount::ExactorReceiveAmount::AtLeastthen the optionalamountfield of the receive APIs should be set, otherwise anError::NoReceiveAmounterror (to be added) should be returned.