diff --git a/lib/ls-sdk-bindings/src/lib.rs b/lib/ls-sdk-bindings/src/lib.rs index a13212552..a519f4439 100644 --- a/lib/ls-sdk-bindings/src/lib.rs +++ b/lib/ls-sdk-bindings/src/lib.rs @@ -64,6 +64,14 @@ impl BindingWallet { ) -> Result { self.ln_sdk.receive_payment(&req) } + + pub fn backup(&self) -> Result<(), LsSdkError> { + self.ln_sdk.backup().map_err(Into::into) + } + + pub fn restore(&self, backup_path: Option) -> Result<(), LsSdkError> { + self.ln_sdk.restore(backup_path).map_err(Into::into) + } } uniffi::include_scaffolding!("ls_sdk"); diff --git a/lib/ls-sdk-bindings/src/ls_sdk.udl b/lib/ls-sdk-bindings/src/ls_sdk.udl index d6eafa16b..034cc01da 100644 --- a/lib/ls-sdk-bindings/src/ls_sdk.udl +++ b/lib/ls-sdk-bindings/src/ls_sdk.udl @@ -76,4 +76,10 @@ interface BindingWallet { [Throws=PaymentError] ReceivePaymentResponse receive_payment(PrepareReceiveResponse req); + + [Throws=LsSdkError] + void backup(); + + [Throws=LsSdkError] + void restore(string? backup_path); };