Skip to content

Commit

Permalink
feat: added bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
yse committed Apr 21, 2024
1 parent 2a9bba4 commit e7c106b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ls-sdk-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ impl BindingWallet {
) -> Result<ReceivePaymentResponse, PaymentError> {
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<String>) -> Result<(), LsSdkError> {
self.ln_sdk.restore(backup_path).map_err(Into::into)
}
}

uniffi::include_scaffolding!("ls_sdk");
6 changes: 6 additions & 0 deletions lib/ls-sdk-bindings/src/ls_sdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,10 @@ interface BindingWallet {

[Throws=PaymentError]
ReceivePaymentResponse receive_payment(PrepareReceiveResponse req);

[Throws=LsSdkError]
void backup();

[Throws=LsSdkError]
void restore(string? backup_path);
};

0 comments on commit e7c106b

Please sign in to comment.