webycash-sdk 0.2.5 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -7
- package/libwebycash_sdk.dylib +0 -0
- package/libwebycash_sdk.so +0 -0
- package/package.json +2 -1
- package/webycash_sdk.dll +0 -0
package/dist/index.js
CHANGED
|
@@ -31,8 +31,6 @@ function findLib() {
|
|
|
31
31
|
const lib = koffi_1.default.load(findLib());
|
|
32
32
|
// ── FFI declarations ────────────────────────────────────────────
|
|
33
33
|
const WebyWalletPtr = koffi_1.default.pointer("WebyWallet", koffi_1.default.opaque());
|
|
34
|
-
const WebyWalletPtrPtr = koffi_1.default.pointer(WebyWalletPtr);
|
|
35
|
-
const CharPtrPtr = koffi_1.default.pointer("char*", koffi_1.default.pointer(koffi_1.default.types.char));
|
|
36
34
|
const ffi = {
|
|
37
35
|
weby_wallet_open: lib.func("int32_t weby_wallet_open(const char*, _Out_ WebyWallet**)"),
|
|
38
36
|
weby_wallet_open_with_seed: lib.func("int32_t weby_wallet_open_with_seed(const char*, const uint8_t*, size_t, _Out_ WebyWallet**)"),
|
|
@@ -67,12 +65,11 @@ function check(rc) {
|
|
|
67
65
|
throw new WebycashError(rc, msg ?? `Error code ${rc}`);
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
|
-
function takeString(
|
|
71
|
-
|
|
68
|
+
function takeString(val) {
|
|
69
|
+
// koffi _Out_ char** returns the string directly in the output array
|
|
70
|
+
if (val == null)
|
|
72
71
|
return "";
|
|
73
|
-
|
|
74
|
-
ffi.weby_free_string(ptr);
|
|
75
|
-
return s;
|
|
72
|
+
return String(val);
|
|
76
73
|
}
|
|
77
74
|
// ── Public API ──────────────────────────────────────────────────
|
|
78
75
|
function version() {
|
package/libwebycash_sdk.dylib
CHANGED
|
Binary file
|
package/libwebycash_sdk.so
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webycash-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Webcash cross-platform SDK — Node.js/TypeScript bindings",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"files": ["dist", "*.so", "*.dylib", "*.dll"],
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
|
+
"test": "node --test test/sdk.test.cjs",
|
|
13
14
|
"prepublishOnly": "npm run build"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
package/webycash_sdk.dll
CHANGED
|
Binary file
|