Module breez_sdk_core::binding
source · Expand description
Bindings for the Dart integration
§Error handling
Since the integration requires the methods to return anyhow::Result
, but the SDK service methods
are being converted to return SdkResult
, we have two ways to handle errors:
- by using
Into::into
, which converts theSdkError
enum to a genericanyhow::Error
- by wrapping the
SdkError
in ananyhow::Error
The first option loses the SdkError
type. The second option keeps the type, which we can retrieve
with anyhow::Error::downcast_ref
(or equivalent Dart method). We therefore use the second approach.
Functions§
- If used, this must be called before
connect
. It can only be called once. - If used, this must be called before
connect
. It can only be called once. - Wrapper around BreezServices::connect which also initializes SDK logging
- Cleanup node resources and stop the signer.
- Check whether node service is initialized or not