forked from iotaledger/iota-sdk-native-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c503cd5
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# IOTA SDK Native | ||
|
||
## TODO | ||
|
||
This binding wraps the IOTA SDK into a native, shared library. | ||
|
||
It can be referenced by other languages such as Go, C/C++ or C#. | ||
|
||
It exports the following functions: | ||
|
||
``` | ||
init_logger | ||
binding_get_last_error | ||
call_client_method | ||
call_secret_manager_method | ||
call_utils_method | ||
call_wallet_method | ||
create_client | ||
create_secret_manager | ||
create_wallet | ||
listen_wallet | ||
destroy_client | ||
destroy_secret_manager | ||
destroy_string | ||
destroy_wallet | ||
get_client_from_wallet | ||
get_secret_manager_from_wallet | ||
``` | ||
|
||
Generated C/C++ headers can be found under `bindings/native/headers`. | ||
|
||
Headers can be regenerated by running `bindings/native/bindgen.sh`. This requires [cbindgen](https://github.com/mozilla/cbindgen/). | ||
|
||
An example implementation in Go can be found [here](https://github.com/iotaledger/wasp-wallet-sdk/blob/main/wrapper.go). | ||
|
||
# Usage | ||
|
||
All strings need to be null terminated. | ||
|
||
All strings coming from the library need to be free'd by calling `destroy_string` after receiving and copying them. | ||
|
||
Any function that either returns a `NULL` pointer or `false` might have catched an error. | ||
|
||
This error can be obtained via `get_last_error`. |