@secondts/bark-react-native 0.4.2 → 0.5.3
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/README.md +1 -1
- package/cpp/generated/bark.cpp +523 -5
- package/cpp/generated/bark.hpp +4 -0
- package/lib/commonjs/Logger.js +48 -0
- package/lib/commonjs/Logger.js.map +1 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +113 -4
- package/lib/commonjs/generated/bark.js.map +1 -1
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Logger.js +43 -0
- package/lib/module/Logger.js.map +1 -0
- package/lib/module/generated/bark-ffi.js.map +1 -1
- package/lib/module/generated/bark.js +112 -4
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/Logger.d.ts +18 -0
- package/lib/typescript/commonjs/src/Logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +11 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +32 -2
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/Logger.d.ts +18 -0
- package/lib/typescript/module/src/Logger.d.ts.map +1 -0
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +11 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +32 -2
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/Logger.ts +42 -0
- package/src/generated/bark-ffi.ts +23 -1
- package/src/generated/bark.ts +160 -2
- package/src/index.tsx +3 -0
package/cpp/generated/bark.hpp
CHANGED
|
@@ -126,9 +126,11 @@ class NativeBark : public jsi::HostObject {
|
|
|
126
126
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_wallet_try_claim_lightning_receive(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
127
127
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_wallet_validate_arkoor_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
128
128
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_wallet_vtxos(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
129
|
+
jsi::Value cpp_uniffi_bark_ffi_fn_init_callback_vtable_barklogger(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
129
130
|
jsi::Value cpp_uniffi_bark_ffi_fn_init_callback_vtable_customonchainwalletcallbacks(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
130
131
|
jsi::Value cpp_uniffi_bark_ffi_fn_func_extract_tx_from_psbt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
131
132
|
jsi::Value cpp_uniffi_bark_ffi_fn_func_generate_mnemonic(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
133
|
+
jsi::Value cpp_uniffi_bark_ffi_fn_func_set_logger(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
132
134
|
jsi::Value cpp_uniffi_bark_ffi_fn_func_validate_ark_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
133
135
|
jsi::Value cpp_uniffi_bark_ffi_fn_func_validate_mnemonic(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
134
136
|
jsi::Value cpp_ffi_bark_ffi_rust_future_poll_u8(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
@@ -181,6 +183,7 @@ class NativeBark : public jsi::HostObject {
|
|
|
181
183
|
jsi::Value cpp_ffi_bark_ffi_rust_future_complete_void(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
182
184
|
jsi::Value cpp_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
183
185
|
jsi::Value cpp_uniffi_bark_ffi_checksum_func_generate_mnemonic(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
186
|
+
jsi::Value cpp_uniffi_bark_ffi_checksum_func_set_logger(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
184
187
|
jsi::Value cpp_uniffi_bark_ffi_checksum_func_validate_ark_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
185
188
|
jsi::Value cpp_uniffi_bark_ffi_checksum_func_validate_mnemonic(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
186
189
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_notificationholder_cancel_next_notification_wait(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
@@ -282,6 +285,7 @@ class NativeBark : public jsi::HostObject {
|
|
|
282
285
|
jsi::Value cpp_uniffi_bark_ffi_checksum_constructor_wallet_open(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
283
286
|
jsi::Value cpp_uniffi_bark_ffi_checksum_constructor_wallet_open_with_daemon(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
284
287
|
jsi::Value cpp_uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
288
|
+
jsi::Value cpp_uniffi_bark_ffi_checksum_method_barklogger_log(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
285
289
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_balance(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
286
290
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_tx(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
287
291
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_drain_tx(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ConsoleBarkLogger = void 0;
|
|
7
|
+
exports.barkAttachConsoleLogger = barkAttachConsoleLogger;
|
|
8
|
+
var _bark = require("./generated/bark.js");
|
|
9
|
+
/**
|
|
10
|
+
* A `BarkLogger` that forwards records to the JS `console`.
|
|
11
|
+
*
|
|
12
|
+
* Useful as a default during development. For production, implement
|
|
13
|
+
* `BarkLogger` yourself to forward to Sentry, Reactotron, etc.
|
|
14
|
+
*/
|
|
15
|
+
class ConsoleBarkLogger {
|
|
16
|
+
log(level, target, message) {
|
|
17
|
+
const line = `[bark][${_bark.LogLevel[level]}][${target}] ${message}`;
|
|
18
|
+
switch (level) {
|
|
19
|
+
case _bark.LogLevel.Error:
|
|
20
|
+
console.error(line);
|
|
21
|
+
break;
|
|
22
|
+
case _bark.LogLevel.Warn:
|
|
23
|
+
console.warn(line);
|
|
24
|
+
break;
|
|
25
|
+
case _bark.LogLevel.Info:
|
|
26
|
+
console.info(line);
|
|
27
|
+
break;
|
|
28
|
+
case _bark.LogLevel.Debug:
|
|
29
|
+
case _bark.LogLevel.Trace:
|
|
30
|
+
console.log(line);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Install a default `ConsoleBarkLogger`. Returns the logger so callers can
|
|
38
|
+
* later detach it via `clearLogger()`.
|
|
39
|
+
*
|
|
40
|
+
* Calling this multiple times replaces the previous logger in-place.
|
|
41
|
+
*/
|
|
42
|
+
exports.ConsoleBarkLogger = ConsoleBarkLogger;
|
|
43
|
+
function barkAttachConsoleLogger(maxLevel = _bark.LogLevel.Info) {
|
|
44
|
+
const logger = new ConsoleBarkLogger();
|
|
45
|
+
(0, _bark.setLogger)(logger, maxLevel);
|
|
46
|
+
return logger;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_bark","require","ConsoleBarkLogger","log","level","target","message","line","LogLevel","Error","console","error","Warn","warn","Info","info","Debug","Trace","exports","barkAttachConsoleLogger","maxLevel","logger","setLogger"],"sourceRoot":"../../src","sources":["Logger.ts"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,CAAuB;EACnDC,GAAGA,CAACC,KAAe,EAAEC,MAAc,EAAEC,OAAe,EAAQ;IAC1D,MAAMC,IAAI,GAAG,UAAUC,cAAQ,CAACJ,KAAK,CAAC,KAAKC,MAAM,KAAKC,OAAO,EAAE;IAC/D,QAAQF,KAAK;MACX,KAAKI,cAAQ,CAACC,KAAK;QACjBC,OAAO,CAACC,KAAK,CAACJ,IAAI,CAAC;QACnB;MACF,KAAKC,cAAQ,CAACI,IAAI;QAChBF,OAAO,CAACG,IAAI,CAACN,IAAI,CAAC;QAClB;MACF,KAAKC,cAAQ,CAACM,IAAI;QAChBJ,OAAO,CAACK,IAAI,CAACR,IAAI,CAAC;QAClB;MACF,KAAKC,cAAQ,CAACQ,KAAK;MACnB,KAAKR,cAAQ,CAACS,KAAK;QACjBP,OAAO,CAACP,GAAG,CAACI,IAAI,CAAC;QACjB;IACJ;EACF;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AALAW,OAAA,CAAAhB,iBAAA,GAAAA,iBAAA;AAMO,SAASiB,uBAAuBA,CACrCC,QAAkB,GAAGZ,cAAQ,CAACM,IAAI,EACtB;EACZ,MAAMO,MAAM,GAAG,IAAInB,iBAAiB,CAAC,CAAC;EACtC,IAAAoB,eAAS,EAACD,MAAM,EAAED,QAAQ,CAAC;EAC3B,OAAOC,MAAM;AACf","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getter","globalThis","NativeBark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["getter","globalThis","NativeBark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;;AAwqBA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAClBL,MAAM,EAErB;AAyKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.WalletProperties = exports.WalletNotification_Tags = exports.WalletNotification = exports.Wallet = exports.Vtxo = exports.RoundState = exports.PendingBoard = exports.OutPoint = exports.OnchainWallet = exports.OnchainBalance = exports.OffboardResult = exports.NotificationHolder = exports.Network = exports.Movement = exports.LightningSend = exports.LightningReceive = exports.LightningInvoice = exports.FeeEstimate = exports.ExitVtxo = exports.ExitTransactionStatus = exports.ExitProgressStatus = exports.ExitClaimTransaction = exports.Destination = exports.CpfpParams = exports.Config = exports.BlockRef = exports.BarkError_Tags = exports.BarkError = exports.Balance = exports.ArkInfo = exports.AddressWithIndex = void 0;
|
|
6
|
+
exports.default = exports.WalletProperties = exports.WalletNotification_Tags = exports.WalletNotification = exports.Wallet = exports.Vtxo = exports.RoundState = exports.PendingBoard = exports.OutPoint = exports.OnchainWallet = exports.OnchainBalance = exports.OffboardResult = exports.NotificationHolder = exports.Network = exports.Movement = exports.LogLevel = exports.LightningSend = exports.LightningReceive = exports.LightningInvoice = exports.FeeEstimate = exports.ExitVtxo = exports.ExitTransactionStatus = exports.ExitProgressStatus = exports.ExitClaimTransaction = exports.Destination = exports.CpfpParams = exports.Config = exports.BlockRef = exports.BarkError_Tags = exports.BarkError = exports.Balance = exports.ArkInfo = exports.AddressWithIndex = void 0;
|
|
7
7
|
exports.extractTxFromPsbt = extractTxFromPsbt;
|
|
8
8
|
exports.generateMnemonic = generateMnemonic;
|
|
9
|
+
exports.setLogger = setLogger;
|
|
9
10
|
exports.validateArkAddress = validateArkAddress;
|
|
10
11
|
exports.validateMnemonic = validateMnemonic;
|
|
11
12
|
var _barkFfi = _interopRequireDefault(require("./bark-ffi.js"));
|
|
@@ -39,6 +40,15 @@ function generateMnemonic() /*throws*/{
|
|
|
39
40
|
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_func_generate_mnemonic(callStatus);
|
|
40
41
|
}, /*liftString:*/FfiConverterString.lift));
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Install the foreign log sink. Must be called at most once,
|
|
45
|
+
* subsequent calls return an error
|
|
46
|
+
*/
|
|
47
|
+
function setLogger(logger, maxLevel) /*throws*/{
|
|
48
|
+
uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
|
|
49
|
+
(0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_func_set_logger(FfiConverterTypeBarkLogger.lower(logger), FfiConverterTypeLogLevel.lower(maxLevel), callStatus);
|
|
50
|
+
}, /*liftString:*/FfiConverterString.lift);
|
|
51
|
+
}
|
|
42
52
|
function validateArkAddress(address) /*throws*/{
|
|
43
53
|
return _uniffiBindgenReactNative.FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
|
|
44
54
|
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_func_validate_ark_address(FfiConverterString.lower(address), callStatus);
|
|
@@ -50,6 +60,46 @@ function validateMnemonic(mnemonic) /*throws*/{
|
|
|
50
60
|
}, /*liftString:*/FfiConverterString.lift));
|
|
51
61
|
}
|
|
52
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Foreign sink for log records. Implement in Dart/Swift/Kotlin and pass to
|
|
65
|
+
* [set_logger]. The `log()` method must not call back into bark APIs that
|
|
66
|
+
* emit log records.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
// Put the implementation in a struct so we don't pollute the top-level namespace
|
|
70
|
+
const uniffiCallbackInterfaceBarkLogger = {
|
|
71
|
+
// Create the VTable using a series of closures.
|
|
72
|
+
// ts automatically converts these into C callback functions.
|
|
73
|
+
vtable: {
|
|
74
|
+
log: (uniffiHandle, level, target, message) => {
|
|
75
|
+
const uniffiMakeCall = () => {
|
|
76
|
+
const jsCallback = FfiConverterTypeBarkLogger.lift(uniffiHandle);
|
|
77
|
+
return jsCallback.log(FfiConverterTypeLogLevel.lift(level), FfiConverterString.lift(target), FfiConverterString.lift(message));
|
|
78
|
+
};
|
|
79
|
+
const uniffiResult = _uniffiBindgenReactNative.UniffiResult.ready();
|
|
80
|
+
const uniffiHandleSuccess = obj => {};
|
|
81
|
+
const uniffiHandleError = (code, errBuf) => {
|
|
82
|
+
_uniffiBindgenReactNative.UniffiResult.writeError(uniffiResult, code, errBuf);
|
|
83
|
+
};
|
|
84
|
+
(0, _uniffiBindgenReactNative.uniffiTraitInterfaceCall)(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*lowerString:*/FfiConverterString.lower);
|
|
85
|
+
return uniffiResult;
|
|
86
|
+
},
|
|
87
|
+
uniffiFree: uniffiHandle => {
|
|
88
|
+
// BarkLogger: this will throw a stale handle error if the handle isn't found.
|
|
89
|
+
FfiConverterTypeBarkLogger.drop(uniffiHandle);
|
|
90
|
+
},
|
|
91
|
+
uniffiClone: uniffiHandle => {
|
|
92
|
+
return FfiConverterTypeBarkLogger.clone(uniffiHandle);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
register: () => {
|
|
96
|
+
(0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_init_callback_vtable_barklogger(uniffiCallbackInterfaceBarkLogger.vtable);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// FfiConverter protocol for callback interfaces
|
|
101
|
+
const FfiConverterTypeBarkLogger = new _uniffiBindgenReactNative.FfiConverterCallback();
|
|
102
|
+
|
|
53
103
|
/**
|
|
54
104
|
* Callback interface for custom onchain wallet implementations
|
|
55
105
|
*
|
|
@@ -1856,6 +1906,57 @@ const FfiConverterTypeBarkError = (() => {
|
|
|
1856
1906
|
return new FFIConverter();
|
|
1857
1907
|
})();
|
|
1858
1908
|
|
|
1909
|
+
/**
|
|
1910
|
+
* Severity of a log record forwarded to a foreign [BarkLogger].
|
|
1911
|
+
*/
|
|
1912
|
+
let LogLevel = exports.LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
1913
|
+
LogLevel[LogLevel["Error"] = 0] = "Error";
|
|
1914
|
+
LogLevel[LogLevel["Warn"] = 1] = "Warn";
|
|
1915
|
+
LogLevel[LogLevel["Info"] = 2] = "Info";
|
|
1916
|
+
LogLevel[LogLevel["Debug"] = 3] = "Debug";
|
|
1917
|
+
LogLevel[LogLevel["Trace"] = 4] = "Trace";
|
|
1918
|
+
return LogLevel;
|
|
1919
|
+
}({});
|
|
1920
|
+
const FfiConverterTypeLogLevel = (() => {
|
|
1921
|
+
const ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
1922
|
+
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
1923
|
+
read(from) {
|
|
1924
|
+
switch (ordinalConverter.read(from)) {
|
|
1925
|
+
case 1:
|
|
1926
|
+
return LogLevel.Error;
|
|
1927
|
+
case 2:
|
|
1928
|
+
return LogLevel.Warn;
|
|
1929
|
+
case 3:
|
|
1930
|
+
return LogLevel.Info;
|
|
1931
|
+
case 4:
|
|
1932
|
+
return LogLevel.Debug;
|
|
1933
|
+
case 5:
|
|
1934
|
+
return LogLevel.Trace;
|
|
1935
|
+
default:
|
|
1936
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
write(value, into) {
|
|
1940
|
+
switch (value) {
|
|
1941
|
+
case LogLevel.Error:
|
|
1942
|
+
return ordinalConverter.write(1, into);
|
|
1943
|
+
case LogLevel.Warn:
|
|
1944
|
+
return ordinalConverter.write(2, into);
|
|
1945
|
+
case LogLevel.Info:
|
|
1946
|
+
return ordinalConverter.write(3, into);
|
|
1947
|
+
case LogLevel.Debug:
|
|
1948
|
+
return ordinalConverter.write(4, into);
|
|
1949
|
+
case LogLevel.Trace:
|
|
1950
|
+
return ordinalConverter.write(5, into);
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
allocationSize(value) {
|
|
1954
|
+
return ordinalConverter.allocationSize(0);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
return new FFIConverter();
|
|
1958
|
+
})();
|
|
1959
|
+
|
|
1859
1960
|
/**
|
|
1860
1961
|
* Bitcoin network types
|
|
1861
1962
|
*/
|
|
@@ -2584,11 +2685,11 @@ class Wallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
2584
2685
|
throw __error;
|
|
2585
2686
|
}
|
|
2586
2687
|
}
|
|
2587
|
-
async bolt11Invoice(amountSats, asyncOpts_) /*throws*/{
|
|
2688
|
+
async bolt11Invoice(amountSats, description, asyncOpts_) /*throws*/{
|
|
2588
2689
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
2589
2690
|
try {
|
|
2590
2691
|
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
2591
|
-
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice(uniffiTypeWalletObjectFactory.clonePointer(this), _uniffiBindgenReactNative.FfiConverterUInt64.lower(amountSats));
|
|
2692
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice(uniffiTypeWalletObjectFactory.clonePointer(this), _uniffiBindgenReactNative.FfiConverterUInt64.lower(amountSats), FfiConverterOptionalString.lower(description));
|
|
2592
2693
|
}, /*pollFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeLightningInvoice.lift.bind(FfiConverterTypeLightningInvoice), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError));
|
|
2593
2694
|
} catch (__error) {
|
|
2594
2695
|
if (uniffiIsDebug && __error instanceof Error) {
|
|
@@ -4184,6 +4285,9 @@ function uniffiEnsureInitialized() {
|
|
|
4184
4285
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_generate_mnemonic() !== 49933) {
|
|
4185
4286
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_generate_mnemonic");
|
|
4186
4287
|
}
|
|
4288
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_set_logger() !== 62790) {
|
|
4289
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_set_logger");
|
|
4290
|
+
}
|
|
4187
4291
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_validate_ark_address() !== 49932) {
|
|
4188
4292
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_validate_ark_address");
|
|
4189
4293
|
}
|
|
@@ -4226,7 +4330,7 @@ function uniffiEnsureInitialized() {
|
|
|
4226
4330
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_amount() !== 57213) {
|
|
4227
4331
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_amount");
|
|
4228
4332
|
}
|
|
4229
|
-
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !==
|
|
4333
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 47558) {
|
|
4230
4334
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice");
|
|
4231
4335
|
}
|
|
4232
4336
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_broadcast_tx() !== 10756) {
|
|
@@ -4487,6 +4591,9 @@ function uniffiEnsureInitialized() {
|
|
|
4487
4591
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain() !== 22896) {
|
|
4488
4592
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain");
|
|
4489
4593
|
}
|
|
4594
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_barklogger_log() !== 1414) {
|
|
4595
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_barklogger_log");
|
|
4596
|
+
}
|
|
4490
4597
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_balance() !== 16407) {
|
|
4491
4598
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_balance");
|
|
4492
4599
|
}
|
|
@@ -4514,6 +4621,7 @@ function uniffiEnsureInitialized() {
|
|
|
4514
4621
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !== 41685) {
|
|
4515
4622
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp");
|
|
4516
4623
|
}
|
|
4624
|
+
uniffiCallbackInterfaceBarkLogger.register();
|
|
4517
4625
|
uniffiCallbackInterfaceCustomOnchainWalletCallbacks.register();
|
|
4518
4626
|
}
|
|
4519
4627
|
var _default = exports.default = Object.freeze({
|
|
@@ -4535,6 +4643,7 @@ var _default = exports.default = Object.freeze({
|
|
|
4535
4643
|
FfiConverterTypeLightningInvoice,
|
|
4536
4644
|
FfiConverterTypeLightningReceive,
|
|
4537
4645
|
FfiConverterTypeLightningSend,
|
|
4646
|
+
FfiConverterTypeLogLevel,
|
|
4538
4647
|
FfiConverterTypeMovement,
|
|
4539
4648
|
FfiConverterTypeNetwork,
|
|
4540
4649
|
FfiConverterTypeNotificationHolder,
|