@secondts/bark-react-native 0.22.0 → 0.24.0
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 +436 -33
- package/cpp/generated/bark.hpp +14 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +508 -29
- package/lib/commonjs/generated/bark.js.map +1 -1
- package/lib/module/generated/bark-ffi.js.map +1 -1
- package/lib/module/generated/bark.js +505 -28
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +24 -8
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +424 -32
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +24 -8
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +424 -32
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/generated/bark-ffi.ts +46 -7
- package/src/generated/bark.ts +812 -42
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.WalletTransaction = exports.WalletProperties = exports.WalletOpenArgs = exports.WalletNotification_Tags = exports.WalletNotification = exports.Wallet = exports.VtxoState_Tags = exports.VtxoState = exports.VtxoLockHolder_Tags = exports.VtxoLockHolder = exports.Vtxo = exports.RoundState = exports.RefreshFees = exports.RecoveryReport = exports.RecoveryBucket = exports.PpmExpiryFeeEntry = exports.PendingBoard = exports.OutPoint = exports.OnchainWallet = exports.OnchainUtxo_Tags = exports.OnchainUtxo = exports.OnchainBalance = exports.OffboardResult = exports.OffboardFees = exports.NotificationHolder = exports.Network = exports.Movement = exports.LogLevel = exports.LightningSendStatus_Tags = exports.LightningSendStatus = exports.LightningSendFees = exports.LightningSend = exports.LightningReceiveFees = exports.LightningReceive = exports.LightningInvoice = exports.FeeSchedule = exports.FeeRates = exports.FeeEstimate = exports.ExitVtxo = exports.ExitTxStatus_Tags = exports.ExitTxStatus = exports.ExitTxOrigin_Tags = exports.ExitTxOrigin = exports.ExitTx = exports.ExitTransactionStatus = exports.ExitState_Tags = exports.ExitStateKind = exports.ExitState = exports.ExitProgressStatus = exports.ExitClaimTransaction = exports.ExitCancelResult = exports.ExitCancelFailure_Tags = exports.ExitCancelFailure = exports.Exception_Tags = exports.Exception = exports.EmergencyExitFeeEstimate = exports.Destination = exports.CustomOnchainWalletCallbacksImpl = exports.CpfpParams = exports.Config = exports.BoardFundingInfo = exports.BoardFees = exports.BlockRef = exports.BarkLoggerImpl = exports.Balance = exports.ArkInfo = exports.AddressWithIndex = void 0;
|
|
6
|
+
exports.default = exports.WalletTransaction = exports.WalletProperties = exports.WalletOpenArgs = exports.WalletNotification_Tags = exports.WalletNotification = exports.Wallet = exports.VtxoState_Tags = exports.VtxoState = exports.VtxoLockHolder_Tags = exports.VtxoLockHolder = exports.Vtxo = exports.RoundState = exports.RoundFlowKind = exports.RefreshFees = exports.RecoveryStatus_Tags = exports.RecoveryStatus = exports.RecoveryReport = exports.RecoveryBucket = exports.PpmExpiryFeeEntry = exports.PendingBoard = exports.OutPoint = exports.OnchainWallet = exports.OnchainUtxo_Tags = exports.OnchainUtxo = exports.OnchainBalance = exports.OffboardResult = exports.OffboardFees = exports.NotificationHolder = exports.Network = exports.Movement = exports.LogLevel = exports.LightningSendStatus_Tags = exports.LightningSendStatus = exports.LightningSendFees = exports.LightningSend = exports.LightningReceiveFees = exports.LightningReceive = exports.LightningInvoice = exports.ImportVtxoArgs = exports.FeeSchedule = exports.FeeRates = exports.FeeEstimate = exports.ExitVtxo = exports.ExitTxStatus_Tags = exports.ExitTxStatus = exports.ExitTxOrigin_Tags = exports.ExitTxOrigin = exports.ExitTx = exports.ExitTransactionStatus = exports.ExitState_Tags = exports.ExitStateKind = exports.ExitState = exports.ExitProgressStatus = exports.ExitClaimTransaction = exports.ExitCancelResult = exports.ExitCancelFailure_Tags = exports.ExitCancelFailure = exports.Exception_Tags = exports.Exception = exports.EmergencyExitFeeEstimate = exports.Destination = exports.CustomOnchainWalletCallbacksImpl = exports.CpfpParams = exports.Config = exports.BoardFundingInfo = exports.BoardFees = exports.BlockRef = exports.BarkLoggerImpl = exports.Balance = exports.ArkInfo = exports.AddressWithIndex = void 0;
|
|
7
|
+
exports.defaultVtxoKeyGapLimit = defaultVtxoKeyGapLimit;
|
|
7
8
|
exports.extractTxFromPsbt = extractTxFromPsbt;
|
|
8
9
|
exports.generateMnemonic = generateMnemonic;
|
|
9
10
|
exports.initWallet = initWallet;
|
|
11
|
+
exports.maxVtxoKeyGapLimit = maxVtxoKeyGapLimit;
|
|
10
12
|
exports.setLogger = setLogger;
|
|
11
13
|
exports.validateArkAddress = validateArkAddress;
|
|
12
14
|
exports.validateMnemonic = validateMnemonic;
|
|
@@ -31,6 +33,16 @@ typeof process !== "object" ||
|
|
|
31
33
|
process?.env?.NODE_ENV !== "production" || false;
|
|
32
34
|
// Public interface members begin here.
|
|
33
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Default for `Config.vtxo_key_gap_limit`: the run of consecutive unused
|
|
38
|
+
* seed-derived VTXO key indices a scan crosses before concluding a VTXO
|
|
39
|
+
* isn't ours.
|
|
40
|
+
*/
|
|
41
|
+
function defaultVtxoKeyGapLimit() {
|
|
42
|
+
return _uniffiBindgenReactNative.FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
43
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit(callStatus);
|
|
44
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
45
|
+
}
|
|
34
46
|
/**
|
|
35
47
|
* Extract a signed transaction from a PSBT
|
|
36
48
|
*
|
|
@@ -58,6 +70,16 @@ function generateMnemonic() /*throws*/{
|
|
|
58
70
|
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_func_generate_mnemonic(callStatus);
|
|
59
71
|
}, /*liftString:*/FfiConverterString.lift));
|
|
60
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Largest value `Config.vtxo_key_gap_limit` (or an import/recovery
|
|
75
|
+
* `gap_limit` override) accepts. A scan that matches nothing runs the limit
|
|
76
|
+
* to its end, so an unbounded limit is unbounded work.
|
|
77
|
+
*/
|
|
78
|
+
function maxVtxoKeyGapLimit() {
|
|
79
|
+
return _uniffiBindgenReactNative.FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
80
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit(callStatus);
|
|
81
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
82
|
+
}
|
|
61
83
|
/**
|
|
62
84
|
* Validate an Ark address (basic format check only)
|
|
63
85
|
*
|
|
@@ -384,7 +406,7 @@ const FfiConverterTypeConfig = (() => {
|
|
|
384
406
|
bitcoindCookiefile: FfiConverterOptionalString.read(from),
|
|
385
407
|
bitcoindUser: FfiConverterOptionalString.read(from),
|
|
386
408
|
bitcoindPass: FfiConverterOptionalString.read(from),
|
|
387
|
-
vtxoRefreshExpiryThreshold:
|
|
409
|
+
vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt16.read(from),
|
|
388
410
|
vtxoExitMargin: FfiConverterOptionalUInt16.read(from),
|
|
389
411
|
htlcRecvClaimDelta: FfiConverterOptionalUInt16.read(from),
|
|
390
412
|
fallbackFeeRate: FfiConverterOptionalUInt64.read(from),
|
|
@@ -393,7 +415,8 @@ const FfiConverterTypeConfig = (() => {
|
|
|
393
415
|
offboardRequiredConfirmations: FfiConverterOptionalUInt32.read(from),
|
|
394
416
|
daemonManualSync: FfiConverterOptionalBool.read(from),
|
|
395
417
|
lightningReceiveClaimRetries: FfiConverterOptionalUInt8.read(from),
|
|
396
|
-
userAgent: FfiConverterOptionalString.read(from)
|
|
418
|
+
userAgent: FfiConverterOptionalString.read(from),
|
|
419
|
+
vtxoKeyGapLimit: FfiConverterOptionalUInt32.read(from)
|
|
397
420
|
};
|
|
398
421
|
}
|
|
399
422
|
write(value, into) {
|
|
@@ -404,7 +427,7 @@ const FfiConverterTypeConfig = (() => {
|
|
|
404
427
|
FfiConverterOptionalString.write(value.bitcoindCookiefile, into);
|
|
405
428
|
FfiConverterOptionalString.write(value.bitcoindUser, into);
|
|
406
429
|
FfiConverterOptionalString.write(value.bitcoindPass, into);
|
|
407
|
-
|
|
430
|
+
FfiConverterOptionalUInt16.write(value.vtxoRefreshExpiryThreshold, into);
|
|
408
431
|
FfiConverterOptionalUInt16.write(value.vtxoExitMargin, into);
|
|
409
432
|
FfiConverterOptionalUInt16.write(value.htlcRecvClaimDelta, into);
|
|
410
433
|
FfiConverterOptionalUInt64.write(value.fallbackFeeRate, into);
|
|
@@ -414,9 +437,10 @@ const FfiConverterTypeConfig = (() => {
|
|
|
414
437
|
FfiConverterOptionalBool.write(value.daemonManualSync, into);
|
|
415
438
|
FfiConverterOptionalUInt8.write(value.lightningReceiveClaimRetries, into);
|
|
416
439
|
FfiConverterOptionalString.write(value.userAgent, into);
|
|
440
|
+
FfiConverterOptionalUInt32.write(value.vtxoKeyGapLimit, into);
|
|
417
441
|
}
|
|
418
442
|
allocationSize(value) {
|
|
419
|
-
return FfiConverterString.allocationSize(value.serverAddress) + FfiConverterOptionalString.allocationSize(value.serverAccessToken) + FfiConverterOptionalString.allocationSize(value.esploraAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindCookiefile) + FfiConverterOptionalString.allocationSize(value.bitcoindUser) + FfiConverterOptionalString.allocationSize(value.bitcoindPass) +
|
|
443
|
+
return FfiConverterString.allocationSize(value.serverAddress) + FfiConverterOptionalString.allocationSize(value.serverAccessToken) + FfiConverterOptionalString.allocationSize(value.esploraAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindCookiefile) + FfiConverterOptionalString.allocationSize(value.bitcoindUser) + FfiConverterOptionalString.allocationSize(value.bitcoindPass) + FfiConverterOptionalUInt16.allocationSize(value.vtxoRefreshExpiryThreshold) + FfiConverterOptionalUInt16.allocationSize(value.vtxoExitMargin) + FfiConverterOptionalUInt16.allocationSize(value.htlcRecvClaimDelta) + FfiConverterOptionalUInt64.allocationSize(value.fallbackFeeRate) + FfiConverterOptionalUInt32.allocationSize(value.roundTxRequiredConfirmations) + FfiConverterOptionalUInt64.allocationSize(value.daemonSyncIntervalSecs) + FfiConverterOptionalUInt32.allocationSize(value.offboardRequiredConfirmations) + FfiConverterOptionalBool.allocationSize(value.daemonManualSync) + FfiConverterOptionalUInt8.allocationSize(value.lightningReceiveClaimRetries) + FfiConverterOptionalString.allocationSize(value.userAgent) + FfiConverterOptionalUInt32.allocationSize(value.vtxoKeyGapLimit);
|
|
420
444
|
}
|
|
421
445
|
}
|
|
422
446
|
return new FFIConverter();
|
|
@@ -907,6 +931,52 @@ const FfiConverterTypeFeeSchedule = (() => {
|
|
|
907
931
|
}
|
|
908
932
|
return new FFIConverter();
|
|
909
933
|
})();
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Arguments for `Wallet::import_vtxo` / `Wallet::import_vtxos`, mirroring
|
|
937
|
+
* `bark::ImportVtxoArgs`.
|
|
938
|
+
*
|
|
939
|
+
* Every field has a default, so callers only set what they need.
|
|
940
|
+
*/
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Generated factory for {@link ImportVtxoArgs} record objects.
|
|
944
|
+
*/
|
|
945
|
+
const ImportVtxoArgs = exports.ImportVtxoArgs = (() => {
|
|
946
|
+
const defaults = () => ({
|
|
947
|
+
gapLimit: undefined,
|
|
948
|
+
skipStatusCheck: false,
|
|
949
|
+
allowPartial: false
|
|
950
|
+
});
|
|
951
|
+
const create = (() => {
|
|
952
|
+
return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
|
|
953
|
+
})();
|
|
954
|
+
return Object.freeze({
|
|
955
|
+
create,
|
|
956
|
+
new: create,
|
|
957
|
+
defaults: () => Object.freeze(defaults())
|
|
958
|
+
});
|
|
959
|
+
})();
|
|
960
|
+
const FfiConverterTypeImportVtxoArgs = (() => {
|
|
961
|
+
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
962
|
+
read(from) {
|
|
963
|
+
return {
|
|
964
|
+
gapLimit: FfiConverterOptionalUInt32.read(from),
|
|
965
|
+
skipStatusCheck: _uniffiBindgenReactNative.FfiConverterBool.read(from),
|
|
966
|
+
allowPartial: _uniffiBindgenReactNative.FfiConverterBool.read(from)
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
write(value, into) {
|
|
970
|
+
FfiConverterOptionalUInt32.write(value.gapLimit, into);
|
|
971
|
+
_uniffiBindgenReactNative.FfiConverterBool.write(value.skipStatusCheck, into);
|
|
972
|
+
_uniffiBindgenReactNative.FfiConverterBool.write(value.allowPartial, into);
|
|
973
|
+
}
|
|
974
|
+
allocationSize(value) {
|
|
975
|
+
return FfiConverterOptionalUInt32.allocationSize(value.gapLimit) + _uniffiBindgenReactNative.FfiConverterBool.allocationSize(value.skipStatusCheck) + _uniffiBindgenReactNative.FfiConverterBool.allocationSize(value.allowPartial);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
return new FFIConverter();
|
|
979
|
+
})();
|
|
910
980
|
/**
|
|
911
981
|
* Generated factory for {@link LightningInvoice} record objects.
|
|
912
982
|
*/
|
|
@@ -1532,15 +1602,19 @@ const FfiConverterTypeRoundState = (() => {
|
|
|
1532
1602
|
read(from) {
|
|
1533
1603
|
return {
|
|
1534
1604
|
id: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
|
|
1535
|
-
ongoing: _uniffiBindgenReactNative.FfiConverterBool.read(from)
|
|
1605
|
+
ongoing: _uniffiBindgenReactNative.FfiConverterBool.read(from),
|
|
1606
|
+
state: FfiConverterTypeRoundFlowKind.read(from),
|
|
1607
|
+
scheduledHeight: FfiConverterOptionalUInt32.read(from)
|
|
1536
1608
|
};
|
|
1537
1609
|
}
|
|
1538
1610
|
write(value, into) {
|
|
1539
1611
|
_uniffiBindgenReactNative.FfiConverterUInt32.write(value.id, into);
|
|
1540
1612
|
_uniffiBindgenReactNative.FfiConverterBool.write(value.ongoing, into);
|
|
1613
|
+
FfiConverterTypeRoundFlowKind.write(value.state, into);
|
|
1614
|
+
FfiConverterOptionalUInt32.write(value.scheduledHeight, into);
|
|
1541
1615
|
}
|
|
1542
1616
|
allocationSize(value) {
|
|
1543
|
-
return _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.id) + _uniffiBindgenReactNative.FfiConverterBool.allocationSize(value.ongoing);
|
|
1617
|
+
return _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.id) + _uniffiBindgenReactNative.FfiConverterBool.allocationSize(value.ongoing) + FfiConverterTypeRoundFlowKind.allocationSize(value.state) + FfiConverterOptionalUInt32.allocationSize(value.scheduledHeight);
|
|
1544
1618
|
}
|
|
1545
1619
|
}
|
|
1546
1620
|
return new FFIConverter();
|
|
@@ -1602,7 +1676,6 @@ const FfiConverterTypeVtxo = (() => {
|
|
|
1602
1676
|
const WalletOpenArgs = exports.WalletOpenArgs = (() => {
|
|
1603
1677
|
const defaults = () => ({
|
|
1604
1678
|
runDaemon: true,
|
|
1605
|
-
onchain: undefined,
|
|
1606
1679
|
createIfNotExists: true,
|
|
1607
1680
|
createWithoutServer: false,
|
|
1608
1681
|
skipRecovery: false
|
|
@@ -3281,6 +3354,266 @@ const FfiConverterTypeOnchainUtxo = (() => {
|
|
|
3281
3354
|
return new FFIConverter();
|
|
3282
3355
|
})();
|
|
3283
3356
|
|
|
3357
|
+
// Enum: RecoveryStatus
|
|
3358
|
+
let RecoveryStatus_Tags = exports.RecoveryStatus_Tags = /*#__PURE__*/function (RecoveryStatus_Tags) {
|
|
3359
|
+
RecoveryStatus_Tags["NotRun"] = "NotRun";
|
|
3360
|
+
RecoveryStatus_Tags["Failed"] = "Failed";
|
|
3361
|
+
RecoveryStatus_Tags["Completed"] = "Completed";
|
|
3362
|
+
return RecoveryStatus_Tags;
|
|
3363
|
+
}({});
|
|
3364
|
+
/**
|
|
3365
|
+
* Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
|
|
3366
|
+
* `bark::RecoveryStatus`.
|
|
3367
|
+
*
|
|
3368
|
+
* The three variants are distinguishable on purpose: `NotRun` means nothing
|
|
3369
|
+
* was attempted (wallet already existed locally, or `skip_recovery` was set),
|
|
3370
|
+
* `Failed` means the scan errored before producing a report so funds may be
|
|
3371
|
+
* missing until a retry succeeds, and `Completed` carries the report — whose
|
|
3372
|
+
* `is_complete` can still be `false` for individual VTXOs.
|
|
3373
|
+
*
|
|
3374
|
+
* Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
|
|
3375
|
+
*/
|
|
3376
|
+
const RecoveryStatus = exports.RecoveryStatus = (() => {
|
|
3377
|
+
/**
|
|
3378
|
+
* No scan was attempted.
|
|
3379
|
+
*/
|
|
3380
|
+
class NotRun_ extends _uniffiBindgenReactNative.UniffiEnum {
|
|
3381
|
+
/**
|
|
3382
|
+
* @private
|
|
3383
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3384
|
+
*/
|
|
3385
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "RecoveryStatus";
|
|
3386
|
+
tag = RecoveryStatus_Tags.NotRun;
|
|
3387
|
+
constructor() {
|
|
3388
|
+
super("RecoveryStatus", "NotRun");
|
|
3389
|
+
}
|
|
3390
|
+
static new() {
|
|
3391
|
+
return new NotRun_();
|
|
3392
|
+
}
|
|
3393
|
+
static instanceOf(obj) {
|
|
3394
|
+
return obj.tag === RecoveryStatus_Tags.NotRun;
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
/**
|
|
3398
|
+
* The scan errored before it could produce a report.
|
|
3399
|
+
*/
|
|
3400
|
+
class Failed_ extends _uniffiBindgenReactNative.UniffiEnum {
|
|
3401
|
+
/**
|
|
3402
|
+
* @private
|
|
3403
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3404
|
+
*/
|
|
3405
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "RecoveryStatus";
|
|
3406
|
+
tag = RecoveryStatus_Tags.Failed;
|
|
3407
|
+
constructor(inner) {
|
|
3408
|
+
super("RecoveryStatus", "Failed");
|
|
3409
|
+
this.inner = Object.freeze(inner);
|
|
3410
|
+
}
|
|
3411
|
+
static new(inner) {
|
|
3412
|
+
return new Failed_(inner);
|
|
3413
|
+
}
|
|
3414
|
+
static instanceOf(obj) {
|
|
3415
|
+
return obj.tag === RecoveryStatus_Tags.Failed;
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
/**
|
|
3419
|
+
* The scan ran to the end.
|
|
3420
|
+
*/
|
|
3421
|
+
class Completed_ extends _uniffiBindgenReactNative.UniffiEnum {
|
|
3422
|
+
/**
|
|
3423
|
+
* @private
|
|
3424
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3425
|
+
*/
|
|
3426
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "RecoveryStatus";
|
|
3427
|
+
tag = RecoveryStatus_Tags.Completed;
|
|
3428
|
+
constructor(inner) {
|
|
3429
|
+
super("RecoveryStatus", "Completed");
|
|
3430
|
+
this.inner = Object.freeze(inner);
|
|
3431
|
+
}
|
|
3432
|
+
static new(inner) {
|
|
3433
|
+
return new Completed_(inner);
|
|
3434
|
+
}
|
|
3435
|
+
static instanceOf(obj) {
|
|
3436
|
+
return obj.tag === RecoveryStatus_Tags.Completed;
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
function instanceOf(obj) {
|
|
3440
|
+
return obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "RecoveryStatus";
|
|
3441
|
+
}
|
|
3442
|
+
return Object.freeze({
|
|
3443
|
+
instanceOf,
|
|
3444
|
+
NotRun: NotRun_,
|
|
3445
|
+
Failed: Failed_,
|
|
3446
|
+
Completed: Completed_
|
|
3447
|
+
});
|
|
3448
|
+
})();
|
|
3449
|
+
|
|
3450
|
+
/**
|
|
3451
|
+
* Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
|
|
3452
|
+
* `bark::RecoveryStatus`.
|
|
3453
|
+
*
|
|
3454
|
+
* The three variants are distinguishable on purpose: `NotRun` means nothing
|
|
3455
|
+
* was attempted (wallet already existed locally, or `skip_recovery` was set),
|
|
3456
|
+
* `Failed` means the scan errored before producing a report so funds may be
|
|
3457
|
+
* missing until a retry succeeds, and `Completed` carries the report — whose
|
|
3458
|
+
* `is_complete` can still be `false` for individual VTXOs.
|
|
3459
|
+
*
|
|
3460
|
+
* Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
|
|
3461
|
+
*/
|
|
3462
|
+
|
|
3463
|
+
// FfiConverter for enum RecoveryStatus
|
|
3464
|
+
const FfiConverterTypeRecoveryStatus = (() => {
|
|
3465
|
+
const ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
3466
|
+
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
3467
|
+
read(from) {
|
|
3468
|
+
switch (ordinalConverter.read(from)) {
|
|
3469
|
+
case 1:
|
|
3470
|
+
return new RecoveryStatus.NotRun();
|
|
3471
|
+
case 2:
|
|
3472
|
+
return new RecoveryStatus.Failed({
|
|
3473
|
+
message: FfiConverterString.read(from)
|
|
3474
|
+
});
|
|
3475
|
+
case 3:
|
|
3476
|
+
return new RecoveryStatus.Completed({
|
|
3477
|
+
report: FfiConverterTypeRecoveryReport.read(from)
|
|
3478
|
+
});
|
|
3479
|
+
default:
|
|
3480
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
write(value, into) {
|
|
3484
|
+
switch (value.tag) {
|
|
3485
|
+
case RecoveryStatus_Tags.NotRun:
|
|
3486
|
+
{
|
|
3487
|
+
ordinalConverter.write(1, into);
|
|
3488
|
+
return;
|
|
3489
|
+
}
|
|
3490
|
+
case RecoveryStatus_Tags.Failed:
|
|
3491
|
+
{
|
|
3492
|
+
ordinalConverter.write(2, into);
|
|
3493
|
+
const inner = value.inner;
|
|
3494
|
+
FfiConverterString.write(inner.message, into);
|
|
3495
|
+
return;
|
|
3496
|
+
}
|
|
3497
|
+
case RecoveryStatus_Tags.Completed:
|
|
3498
|
+
{
|
|
3499
|
+
ordinalConverter.write(3, into);
|
|
3500
|
+
const inner = value.inner;
|
|
3501
|
+
FfiConverterTypeRecoveryReport.write(inner.report, into);
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
default:
|
|
3505
|
+
// Throwing from here means that RecoveryStatus_Tags hasn't matched an ordinal.
|
|
3506
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3509
|
+
allocationSize(value) {
|
|
3510
|
+
switch (value.tag) {
|
|
3511
|
+
case RecoveryStatus_Tags.NotRun:
|
|
3512
|
+
{
|
|
3513
|
+
return ordinalConverter.allocationSize(1);
|
|
3514
|
+
}
|
|
3515
|
+
case RecoveryStatus_Tags.Failed:
|
|
3516
|
+
{
|
|
3517
|
+
const inner = value.inner;
|
|
3518
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3519
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
3520
|
+
return size;
|
|
3521
|
+
}
|
|
3522
|
+
case RecoveryStatus_Tags.Completed:
|
|
3523
|
+
{
|
|
3524
|
+
const inner = value.inner;
|
|
3525
|
+
let size = ordinalConverter.allocationSize(3);
|
|
3526
|
+
size += FfiConverterTypeRecoveryReport.allocationSize(inner.report);
|
|
3527
|
+
return size;
|
|
3528
|
+
}
|
|
3529
|
+
default:
|
|
3530
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
return new FFIConverter();
|
|
3535
|
+
})();
|
|
3536
|
+
|
|
3537
|
+
/**
|
|
3538
|
+
* Lifecycle phase of a round participation, mirroring
|
|
3539
|
+
* `bark::round::RoundFlowKind`.
|
|
3540
|
+
*
|
|
3541
|
+
* Serde/TS tags match upstream's `Display` form: `"delegated-pending"` |
|
|
3542
|
+
* `"pending"` | `"ongoing"` | `"awaiting-confirmations"` | `"failed"` |
|
|
3543
|
+
* `"canceled"`.
|
|
3544
|
+
*/
|
|
3545
|
+
let RoundFlowKind = exports.RoundFlowKind = /*#__PURE__*/function (RoundFlowKind) {
|
|
3546
|
+
/**
|
|
3547
|
+
* Delegated participation waiting for its scheduled round. See
|
|
3548
|
+
* [`RoundState::scheduled_height`].
|
|
3549
|
+
*/
|
|
3550
|
+
RoundFlowKind[RoundFlowKind["DelegatedPending"] = 0] = "DelegatedPending";
|
|
3551
|
+
/**
|
|
3552
|
+
* Interactive participation waiting for its round.
|
|
3553
|
+
*/
|
|
3554
|
+
RoundFlowKind[RoundFlowKind["Pending"] = 1] = "Pending";
|
|
3555
|
+
/**
|
|
3556
|
+
* The interactive part is being played out with the server.
|
|
3557
|
+
*/
|
|
3558
|
+
RoundFlowKind[RoundFlowKind["Ongoing"] = 2] = "Ongoing";
|
|
3559
|
+
/**
|
|
3560
|
+
* The round finished; waiting for its funding tx to confirm.
|
|
3561
|
+
*/
|
|
3562
|
+
RoundFlowKind[RoundFlowKind["AwaitingConfirmations"] = 3] = "AwaitingConfirmations";
|
|
3563
|
+
/**
|
|
3564
|
+
* The participation failed.
|
|
3565
|
+
*/
|
|
3566
|
+
RoundFlowKind[RoundFlowKind["Failed"] = 4] = "Failed";
|
|
3567
|
+
/**
|
|
3568
|
+
* The user canceled the participation.
|
|
3569
|
+
*/
|
|
3570
|
+
RoundFlowKind[RoundFlowKind["Canceled"] = 5] = "Canceled";
|
|
3571
|
+
return RoundFlowKind;
|
|
3572
|
+
}({});
|
|
3573
|
+
const FfiConverterTypeRoundFlowKind = (() => {
|
|
3574
|
+
const ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
3575
|
+
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
3576
|
+
read(from) {
|
|
3577
|
+
switch (ordinalConverter.read(from)) {
|
|
3578
|
+
case 1:
|
|
3579
|
+
return RoundFlowKind.DelegatedPending;
|
|
3580
|
+
case 2:
|
|
3581
|
+
return RoundFlowKind.Pending;
|
|
3582
|
+
case 3:
|
|
3583
|
+
return RoundFlowKind.Ongoing;
|
|
3584
|
+
case 4:
|
|
3585
|
+
return RoundFlowKind.AwaitingConfirmations;
|
|
3586
|
+
case 5:
|
|
3587
|
+
return RoundFlowKind.Failed;
|
|
3588
|
+
case 6:
|
|
3589
|
+
return RoundFlowKind.Canceled;
|
|
3590
|
+
default:
|
|
3591
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3592
|
+
}
|
|
3593
|
+
}
|
|
3594
|
+
write(value, into) {
|
|
3595
|
+
switch (value) {
|
|
3596
|
+
case RoundFlowKind.DelegatedPending:
|
|
3597
|
+
return ordinalConverter.write(1, into);
|
|
3598
|
+
case RoundFlowKind.Pending:
|
|
3599
|
+
return ordinalConverter.write(2, into);
|
|
3600
|
+
case RoundFlowKind.Ongoing:
|
|
3601
|
+
return ordinalConverter.write(3, into);
|
|
3602
|
+
case RoundFlowKind.AwaitingConfirmations:
|
|
3603
|
+
return ordinalConverter.write(4, into);
|
|
3604
|
+
case RoundFlowKind.Failed:
|
|
3605
|
+
return ordinalConverter.write(5, into);
|
|
3606
|
+
case RoundFlowKind.Canceled:
|
|
3607
|
+
return ordinalConverter.write(6, into);
|
|
3608
|
+
}
|
|
3609
|
+
}
|
|
3610
|
+
allocationSize(value) {
|
|
3611
|
+
return ordinalConverter.allocationSize(0);
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
return new FFIConverter();
|
|
3615
|
+
})();
|
|
3616
|
+
|
|
3284
3617
|
// Enum: VtxoLockHolder
|
|
3285
3618
|
let VtxoLockHolder_Tags = exports.VtxoLockHolder_Tags = /*#__PURE__*/function (VtxoLockHolder_Tags) {
|
|
3286
3619
|
VtxoLockHolder_Tags["Action"] = "Action";
|
|
@@ -3998,6 +4331,23 @@ class CustomOnchainWalletCallbacksImpl extends _uniffiBindgenReactNative.UniffiA
|
|
|
3998
4331
|
}, /*liftString:*/FfiConverterString.lift);
|
|
3999
4332
|
}
|
|
4000
4333
|
|
|
4334
|
+
/**
|
|
4335
|
+
* Mark a wallet-known transaction as evicted from the mempool
|
|
4336
|
+
*
|
|
4337
|
+
* Bark calls this when a CPFP it broadcast was RBF-replaced by a competing
|
|
4338
|
+
* party, so the tx's inputs should return to coin selection immediately
|
|
4339
|
+
* instead of waiting for the sync eviction grace period. Only ever called
|
|
4340
|
+
* for a tx that has definitively been superseded on-chain.
|
|
4341
|
+
*
|
|
4342
|
+
* # Arguments
|
|
4343
|
+
* * `txid` - Hex-encoded transaction id
|
|
4344
|
+
*/
|
|
4345
|
+
evictTx(txid) /*throws*/{
|
|
4346
|
+
uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError), /*caller:*/callStatus => {
|
|
4347
|
+
(0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_evict_tx(uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer(this), FfiConverterString.lower(txid), callStatus);
|
|
4348
|
+
}, /*liftString:*/FfiConverterString.lift);
|
|
4349
|
+
}
|
|
4350
|
+
|
|
4001
4351
|
/**
|
|
4002
4352
|
* Create a signed P2A CPFP transaction
|
|
4003
4353
|
*
|
|
@@ -4187,6 +4537,19 @@ const uniffiCallbackInterfaceCustomOnchainWalletCallbacks = {
|
|
|
4187
4537
|
(0, _uniffiBindgenReactNative.uniffiTraitInterfaceCallWithError)(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/Exception.instanceOf, /*lowerError:*/FfiConverterTypeError.lower.bind(FfiConverterTypeError), /*lowerString:*/FfiConverterString.lower);
|
|
4188
4538
|
return uniffiResult;
|
|
4189
4539
|
},
|
|
4540
|
+
evictTx: (uniffiHandle, txid) => {
|
|
4541
|
+
const uniffiMakeCall = () => {
|
|
4542
|
+
const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
|
|
4543
|
+
return jsCallback.evictTx(FfiConverterString.lift(txid));
|
|
4544
|
+
};
|
|
4545
|
+
const uniffiResult = _uniffiBindgenReactNative.UniffiResult.ready();
|
|
4546
|
+
const uniffiHandleSuccess = obj => {};
|
|
4547
|
+
const uniffiHandleError = (code, errBuf) => {
|
|
4548
|
+
_uniffiBindgenReactNative.UniffiResult.writeError(uniffiResult, code, errBuf);
|
|
4549
|
+
};
|
|
4550
|
+
(0, _uniffiBindgenReactNative.uniffiTraitInterfaceCallWithError)(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/Exception.instanceOf, /*lowerError:*/FfiConverterTypeError.lower.bind(FfiConverterTypeError), /*lowerString:*/FfiConverterString.lower);
|
|
4551
|
+
return uniffiResult;
|
|
4552
|
+
},
|
|
4190
4553
|
makeSignedP2aCpfp: (uniffiHandle, params) => {
|
|
4191
4554
|
const uniffiMakeCall = () => {
|
|
4192
4555
|
const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
|
|
@@ -4442,6 +4805,26 @@ class OnchainWallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
4442
4805
|
}
|
|
4443
4806
|
}
|
|
4444
4807
|
|
|
4808
|
+
/**
|
|
4809
|
+
* Mark a wallet-known transaction as evicted from the mempool, so its
|
|
4810
|
+
* inputs return to coin selection immediately. Only for a tx that has
|
|
4811
|
+
* definitively been superseded on-chain (e.g. an RBF-replaced exit CPFP);
|
|
4812
|
+
* evicting a still-in-flight tx invites a self-inflicted double-spend.
|
|
4813
|
+
*/
|
|
4814
|
+
async evictTx(txid, asyncOpts_) /*throws*/{
|
|
4815
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
4816
|
+
try {
|
|
4817
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
4818
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_evict_tx(uniffiTypeOnchainWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txid));
|
|
4819
|
+
}, /*pollFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
|
|
4820
|
+
} catch (__error) {
|
|
4821
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
4822
|
+
__error.stack = __stack;
|
|
4823
|
+
}
|
|
4824
|
+
throw __error;
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
|
|
4445
4828
|
/**
|
|
4446
4829
|
* Cached network fee-rate estimates from the wallet's chain source.
|
|
4447
4830
|
*/
|
|
@@ -5244,15 +5627,20 @@ class Wallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5244
5627
|
/**
|
|
5245
5628
|
* Import a VTXO from its serialized form (hex or base64).
|
|
5246
5629
|
*
|
|
5247
|
-
* The
|
|
5630
|
+
* The VTXO is stored in the state the server reports for it, so one that
|
|
5631
|
+
* was already spent is recorded as spent rather than refused. Pass `args`
|
|
5632
|
+
* to widen the key-scan gap limit, skip the server status check, or allow
|
|
5633
|
+
* partial success; omit it for the defaults.
|
|
5634
|
+
*
|
|
5635
|
+
* The first parameter keeps its historical `vtxo_base64` name for foreign
|
|
5248
5636
|
* binding compatibility (uniffi exposes parameter names), but hex as
|
|
5249
5637
|
* returned by [`Wallet::vtxo_encoded`] is accepted too.
|
|
5250
5638
|
*/
|
|
5251
|
-
async importVtxo(vtxoBase64, asyncOpts_) /*throws*/{
|
|
5639
|
+
async importVtxo(vtxoBase64, args = undefined, asyncOpts_) /*throws*/{
|
|
5252
5640
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5253
5641
|
try {
|
|
5254
5642
|
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5255
|
-
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxo(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(vtxoBase64));
|
|
5643
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxo(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(vtxoBase64), FfiConverterOptionalTypeImportVtxoArgs.lower(args));
|
|
5256
5644
|
}, /*pollFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
|
|
5257
5645
|
} catch (__error) {
|
|
5258
5646
|
if (uniffiIsDebug && __error instanceof Error) {
|
|
@@ -5261,6 +5649,29 @@ class Wallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5261
5649
|
throw __error;
|
|
5262
5650
|
}
|
|
5263
5651
|
}
|
|
5652
|
+
|
|
5653
|
+
/**
|
|
5654
|
+
* Import several VTXOs (hex or base64) under a single key scan and a
|
|
5655
|
+
* single write, which is why this is not just a loop over `import_vtxo`.
|
|
5656
|
+
*
|
|
5657
|
+
* Returns the ids now held — whether this call stored them or found them
|
|
5658
|
+
* already present — so a failed batch can be retried. One VTXO that cannot
|
|
5659
|
+
* be imported discards the whole batch unless `args.allow_partial` is set,
|
|
5660
|
+
* in which case the ones that did import are kept.
|
|
5661
|
+
*/
|
|
5662
|
+
async importVtxos(encodedVtxos, args = undefined, asyncOpts_) /*throws*/{
|
|
5663
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5664
|
+
try {
|
|
5665
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5666
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(encodedVtxos), FfiConverterOptionalTypeImportVtxoArgs.lower(args));
|
|
5667
|
+
}, /*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:*/FfiConverterArrayString.lift.bind(FfiConverterArrayString), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
|
|
5668
|
+
} catch (__error) {
|
|
5669
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5670
|
+
__error.stack = __stack;
|
|
5671
|
+
}
|
|
5672
|
+
throw __error;
|
|
5673
|
+
}
|
|
5674
|
+
}
|
|
5264
5675
|
async isInvoicePaid(paymentHash, asyncOpts_) /*throws*/{
|
|
5265
5676
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5266
5677
|
try {
|
|
@@ -5687,12 +6098,16 @@ class Wallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5687
6098
|
* Recover the given VTXO ids from the server, importing the ones this
|
|
5688
6099
|
* wallet owns that are still spendable. Use it to retry ids a previous
|
|
5689
6100
|
* scan reported as `failed`.
|
|
6101
|
+
*
|
|
6102
|
+
* `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
|
|
6103
|
+
* decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
|
|
6104
|
+
* previous scan bucketed as `foreign`.
|
|
5690
6105
|
*/
|
|
5691
|
-
async recoverVtxos(vtxoIds, asyncOpts_) /*throws*/{
|
|
6106
|
+
async recoverVtxos(vtxoIds, gapLimit = undefined, asyncOpts_) /*throws*/{
|
|
5692
6107
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5693
6108
|
try {
|
|
5694
6109
|
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5695
|
-
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_recover_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds));
|
|
6110
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_recover_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), FfiConverterOptionalUInt32.lower(gapLimit));
|
|
5696
6111
|
}, /*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:*/FfiConverterTypeRecoveryReport.lift.bind(FfiConverterTypeRecoveryReport), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
|
|
5697
6112
|
} catch (__error) {
|
|
5698
6113
|
if (uniffiIsDebug && __error instanceof Error) {
|
|
@@ -5703,21 +6118,32 @@ class Wallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5703
6118
|
}
|
|
5704
6119
|
|
|
5705
6120
|
/**
|
|
5706
|
-
*
|
|
5707
|
-
* if
|
|
5708
|
-
*
|
|
5709
|
-
* Recovery only runs on the open that creates the wallet locally, and not
|
|
5710
|
-
* at all when `WalletOpenArgs.skip_recovery` is set, so this is empty on
|
|
5711
|
-
* every subsequent open. It is also empty when the scan itself failed
|
|
5712
|
-
* outright — bark logs that and lets open succeed, so an empty result does
|
|
5713
|
-
* not prove no funds are missing. `isComplete == false` means funds may
|
|
5714
|
-
* still be missing; retry the report's `failed` ids with `recoverVtxos`.
|
|
6121
|
+
* The report of the seed-recovery scan that ran during `Wallet::open`, or
|
|
6122
|
+
* none if the scan did not complete. Use `recovery_status` to tell a scan
|
|
6123
|
+
* that failed apart from one that never ran.
|
|
5715
6124
|
*/
|
|
5716
6125
|
recoveryReport() {
|
|
5717
6126
|
return FfiConverterOptionalTypeRecoveryReport.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
5718
6127
|
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_recovery_report(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
|
|
5719
6128
|
}, /*liftString:*/FfiConverterString.lift));
|
|
5720
6129
|
}
|
|
6130
|
+
|
|
6131
|
+
/**
|
|
6132
|
+
* Outcome of the seed-recovery scan that ran during `Wallet::open`.
|
|
6133
|
+
*
|
|
6134
|
+
* Recovery only runs on the open that creates the wallet locally, and not
|
|
6135
|
+
* at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
|
|
6136
|
+
* on every subsequent open. `Failed` means the scan errored before
|
|
6137
|
+
* producing a report — bark logs that and lets open succeed — so funds
|
|
6138
|
+
* may be missing until a retry; `Completed` carries the report, and
|
|
6139
|
+
* `isComplete == false` there means funds may still be missing. Retry the
|
|
6140
|
+
* report's `failed` ids with `recoverVtxos`.
|
|
6141
|
+
*/
|
|
6142
|
+
recoveryStatus() {
|
|
6143
|
+
return FfiConverterTypeRecoveryStatus.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
6144
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_recovery_status(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
|
|
6145
|
+
}, /*liftString:*/FfiConverterString.lift));
|
|
6146
|
+
}
|
|
5721
6147
|
async refreshServer(asyncOpts_) /*throws*/{
|
|
5722
6148
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5723
6149
|
try {
|
|
@@ -5899,6 +6325,25 @@ class Wallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5899
6325
|
throw __error;
|
|
5900
6326
|
}
|
|
5901
6327
|
}
|
|
6328
|
+
|
|
6329
|
+
/**
|
|
6330
|
+
* Stop the background daemon and wait until its tasks have finished, so
|
|
6331
|
+
* nothing runs in the background afterwards (e.g. before deleting the
|
|
6332
|
+
* wallet's datadir). No-op when no daemon is running.
|
|
6333
|
+
*/
|
|
6334
|
+
async stopDaemonWait(asyncOpts_) /*throws*/{
|
|
6335
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6336
|
+
try {
|
|
6337
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
6338
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_wallet_stop_daemon_wait(uniffiTypeWalletObjectFactory.clonePointer(this));
|
|
6339
|
+
}, /*pollFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
|
|
6340
|
+
} catch (__error) {
|
|
6341
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6342
|
+
__error.stack = __stack;
|
|
6343
|
+
}
|
|
6344
|
+
throw __error;
|
|
6345
|
+
}
|
|
6346
|
+
}
|
|
5902
6347
|
async stuckFailedLightningSends(asyncOpts_) /*throws*/{
|
|
5903
6348
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5904
6349
|
try {
|
|
@@ -6011,6 +6456,13 @@ class Wallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
6011
6456
|
throw __error;
|
|
6012
6457
|
}
|
|
6013
6458
|
}
|
|
6459
|
+
|
|
6460
|
+
/**
|
|
6461
|
+
* Whether this wallet can pay `address` out-of-round: same network and
|
|
6462
|
+
* server, a supported VTXO policy, and only delivery mechanisms this bark
|
|
6463
|
+
* supports. An address listing no delivery mechanism is valid. Errors only
|
|
6464
|
+
* when the address does not parse.
|
|
6465
|
+
*/
|
|
6014
6466
|
async validateArkoorAddress(address, asyncOpts_) /*throws*/{
|
|
6015
6467
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6016
6468
|
try {
|
|
@@ -6125,6 +6577,9 @@ const FfiConverterOptionalTypeBlockRef = new _uniffiBindgenReactNative.FfiConver
|
|
|
6125
6577
|
// FfiConverter for ExitTransactionStatus | undefined
|
|
6126
6578
|
const FfiConverterOptionalTypeExitTransactionStatus = new _uniffiBindgenReactNative.FfiConverterOptional(FfiConverterTypeExitTransactionStatus);
|
|
6127
6579
|
|
|
6580
|
+
// FfiConverter for ImportVtxoArgs | undefined
|
|
6581
|
+
const FfiConverterOptionalTypeImportVtxoArgs = new _uniffiBindgenReactNative.FfiConverterOptional(FfiConverterTypeImportVtxoArgs);
|
|
6582
|
+
|
|
6128
6583
|
// FfiConverter for RecoveryReport | undefined
|
|
6129
6584
|
const FfiConverterOptionalTypeRecoveryReport = new _uniffiBindgenReactNative.FfiConverterOptional(FfiConverterTypeRecoveryReport);
|
|
6130
6585
|
|
|
@@ -6224,12 +6679,18 @@ function uniffiEnsureInitialized() {
|
|
|
6224
6679
|
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
6225
6680
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
6226
6681
|
}
|
|
6682
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit() !== 3344) {
|
|
6683
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit");
|
|
6684
|
+
}
|
|
6227
6685
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt() !== 8893) {
|
|
6228
6686
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_extract_tx_from_psbt");
|
|
6229
6687
|
}
|
|
6230
6688
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_generate_mnemonic() !== 65033) {
|
|
6231
6689
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_generate_mnemonic");
|
|
6232
6690
|
}
|
|
6691
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit() !== 15808) {
|
|
6692
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit");
|
|
6693
|
+
}
|
|
6233
6694
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_func_validate_ark_address() !== 43084) {
|
|
6234
6695
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_validate_ark_address");
|
|
6235
6696
|
}
|
|
@@ -6266,13 +6727,16 @@ function uniffiEnsureInitialized() {
|
|
|
6266
6727
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_register_tx() !== 17970) {
|
|
6267
6728
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_register_tx");
|
|
6268
6729
|
}
|
|
6269
|
-
if ((0, _barkFfi.default)().
|
|
6730
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx() !== 36298) {
|
|
6731
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx");
|
|
6732
|
+
}
|
|
6733
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !== 58200) {
|
|
6270
6734
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp");
|
|
6271
6735
|
}
|
|
6272
|
-
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !==
|
|
6736
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !== 64815) {
|
|
6273
6737
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp");
|
|
6274
6738
|
}
|
|
6275
|
-
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync() !==
|
|
6739
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync() !== 29018) {
|
|
6276
6740
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync");
|
|
6277
6741
|
}
|
|
6278
6742
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_barklogger_log() !== 30279) {
|
|
@@ -6281,6 +6745,9 @@ function uniffiEnsureInitialized() {
|
|
|
6281
6745
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_balance() !== 39213) {
|
|
6282
6746
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_balance");
|
|
6283
6747
|
}
|
|
6748
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_evict_tx() !== 26786) {
|
|
6749
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_evict_tx");
|
|
6750
|
+
}
|
|
6284
6751
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates() !== 30741) {
|
|
6285
6752
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates");
|
|
6286
6753
|
}
|
|
@@ -6428,9 +6895,12 @@ function uniffiEnsureInitialized() {
|
|
|
6428
6895
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_history_by_payment_method() !== 11845) {
|
|
6429
6896
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_history_by_payment_method");
|
|
6430
6897
|
}
|
|
6431
|
-
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxo() !==
|
|
6898
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxo() !== 26027) {
|
|
6432
6899
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_import_vtxo");
|
|
6433
6900
|
}
|
|
6901
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxos() !== 13727) {
|
|
6902
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_import_vtxos");
|
|
6903
|
+
}
|
|
6434
6904
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid() !== 31079) {
|
|
6435
6905
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid");
|
|
6436
6906
|
}
|
|
@@ -6530,12 +7000,15 @@ function uniffiEnsureInitialized() {
|
|
|
6530
7000
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_properties() !== 9773) {
|
|
6531
7001
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_properties");
|
|
6532
7002
|
}
|
|
6533
|
-
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_recover_vtxos() !==
|
|
7003
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_recover_vtxos() !== 56476) {
|
|
6534
7004
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recover_vtxos");
|
|
6535
7005
|
}
|
|
6536
|
-
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_report() !==
|
|
7006
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_report() !== 10331) {
|
|
6537
7007
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recovery_report");
|
|
6538
7008
|
}
|
|
7009
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_status() !== 14132) {
|
|
7010
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recovery_status");
|
|
7011
|
+
}
|
|
6539
7012
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_server() !== 41162) {
|
|
6540
7013
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_refresh_server");
|
|
6541
7014
|
}
|
|
@@ -6575,6 +7048,9 @@ function uniffiEnsureInitialized() {
|
|
|
6575
7048
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon() !== 7109) {
|
|
6576
7049
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stop_daemon");
|
|
6577
7050
|
}
|
|
7051
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait() !== 1734) {
|
|
7052
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait");
|
|
7053
|
+
}
|
|
6578
7054
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends() !== 31451) {
|
|
6579
7055
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends");
|
|
6580
7056
|
}
|
|
@@ -6599,7 +7075,7 @@ function uniffiEnsureInitialized() {
|
|
|
6599
7075
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_unlock_vtxos() !== 42168) {
|
|
6600
7076
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_unlock_vtxos");
|
|
6601
7077
|
}
|
|
6602
|
-
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address() !==
|
|
7078
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address() !== 30498) {
|
|
6603
7079
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address");
|
|
6604
7080
|
}
|
|
6605
7081
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_wallet_vtxo_encoded() !== 25637) {
|
|
@@ -6650,6 +7126,7 @@ var _default = exports.default = Object.freeze({
|
|
|
6650
7126
|
FfiConverterTypeFeeEstimate,
|
|
6651
7127
|
FfiConverterTypeFeeRates,
|
|
6652
7128
|
FfiConverterTypeFeeSchedule,
|
|
7129
|
+
FfiConverterTypeImportVtxoArgs,
|
|
6653
7130
|
FfiConverterTypeLightningInvoice,
|
|
6654
7131
|
FfiConverterTypeLightningReceive,
|
|
6655
7132
|
FfiConverterTypeLightningReceiveFees,
|
|
@@ -6670,7 +7147,9 @@ var _default = exports.default = Object.freeze({
|
|
|
6670
7147
|
FfiConverterTypePpmExpiryFeeEntry,
|
|
6671
7148
|
FfiConverterTypeRecoveryBucket,
|
|
6672
7149
|
FfiConverterTypeRecoveryReport,
|
|
7150
|
+
FfiConverterTypeRecoveryStatus,
|
|
6673
7151
|
FfiConverterTypeRefreshFees,
|
|
7152
|
+
FfiConverterTypeRoundFlowKind,
|
|
6674
7153
|
FfiConverterTypeRoundState,
|
|
6675
7154
|
FfiConverterTypeVtxo,
|
|
6676
7155
|
FfiConverterTypeVtxoLockHolder,
|