diff --git a/openapi.yaml b/openapi.yaml index a630b18..edb50ad 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1593,6 +1593,9 @@ components: asset_id: type: string example: rgb:2dkSTbr-jFhznbPmo-TQafzswCN-av4gTsJjX-ttx6CNou5-M98k8Zd + duration_seconds: + type: integer + example: 86400 RgbInvoiceResponse: type: object properties: diff --git a/src/rgb.rs b/src/rgb.rs index 85e4a26..f915ecd 100644 --- a/src/rgb.rs +++ b/src/rgb.rs @@ -34,11 +34,16 @@ impl UnlockedAppState { pub(crate) fn rgb_blind_receive( &self, asset_id: Option, + duration_seconds: Option, transport_endpoints: Vec, min_confirmations: u8, ) -> Result { - self.rgb_wallet_wrapper - .blind_receive(asset_id, transport_endpoints, min_confirmations) + self.rgb_wallet_wrapper.blind_receive( + asset_id, + duration_seconds, + transport_endpoints, + min_confirmations, + ) } pub(crate) fn rgb_create_utxos( @@ -245,13 +250,14 @@ impl RgbLibWalletWrapper { pub(crate) fn blind_receive( &self, asset_id: Option, + duration_seconds: Option, transport_endpoints: Vec, min_confirmations: u8, ) -> Result { self.get_rgb_wallet().blind_receive( asset_id, None, - None, + duration_seconds, transport_endpoints, min_confirmations, ) diff --git a/src/routes.rs b/src/routes.rs index 982020a..c1462f4 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -699,8 +699,9 @@ pub(crate) struct RgbAllocation { #[derive(Deserialize, Serialize)] pub(crate) struct RgbInvoiceRequest { - pub(crate) min_confirmations: u8, pub(crate) asset_id: Option, + pub(crate) duration_seconds: Option, + pub(crate) min_confirmations: u8, } #[derive(Deserialize, Serialize)] @@ -2585,6 +2586,7 @@ pub(crate) async fn rgb_invoice( let receive_data = unlocked_state.rgb_blind_receive( payload.asset_id, + payload.duration_seconds, vec![state.static_state.proxy_endpoint.clone()], payload.min_confirmations, )?; diff --git a/src/test/mod.rs b/src/test/mod.rs index d5ed2ba..3d1dd73 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -1125,6 +1125,7 @@ async fn rgb_invoice(node_address: SocketAddr, asset_id: Option) -> RgbI let payload = RgbInvoiceRequest { min_confirmations: 1, asset_id, + duration_seconds: None, }; let res = reqwest::Client::new() .post(format!("http://{}/rgbinvoice", node_address))