File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,11 @@ pub extern "C" fn rgblib_inflate(
242242 . into ( )
243243}
244244
245+ #[ unsafe( no_mangle) ]
246+ pub extern "C" fn rgblib_invoice_data ( invoice_string : * const c_char ) -> CResultString {
247+ invoice_data ( invoice_string) . into ( )
248+ }
249+
245250#[ unsafe( no_mangle) ]
246251pub extern "C" fn rgblib_issue_asset_cfa (
247252 wallet : & COpaqueStruct ,
Original file line number Diff line number Diff line change @@ -380,6 +380,12 @@ pub(crate) fn inflate(
380380 Ok ( serde_json:: to_string ( & res) ?)
381381}
382382
383+ pub ( crate ) fn invoice_data ( invoice_string : * const c_char ) -> Result < String , Error > {
384+ let invoice_string = ptr_to_string ( invoice_string) ;
385+ let invoice = rgb_lib:: wallet:: Invoice :: new ( invoice_string) ?;
386+ Ok ( serde_json:: to_string ( & invoice. invoice_data ( ) ) ?)
387+ }
388+
383389pub ( crate ) fn issue_asset_cfa (
384390 wallet : & COpaqueStruct ,
385391 name : * const c_char ,
You can’t perform that action at this time.
0 commit comments