@secondts/bark-react-native 0.26.1 → 0.27.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 +86 -32
- package/cpp/generated/bark.cpp +81 -6
- package/cpp/generated/bark.hpp +4 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +156 -10
- 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 +155 -9
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +6 -2
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +513 -6
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +6 -2
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +513 -6
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -9
- package/src/generated/bark-ffi.ts +6 -2
- package/src/generated/bark.ts +984 -84
package/src/generated/bark.ts
CHANGED
|
@@ -126,6 +126,8 @@ export function generateMnemonic(): string /*throws*/ {
|
|
|
126
126
|
* Low-level function to initialize a wallet
|
|
127
127
|
*
|
|
128
128
|
* You probably want to use [`Wallet::open`] instead.
|
|
129
|
+
*
|
|
130
|
+
* `datadir` is a filesystem path or a `file://` URI.
|
|
129
131
|
*/
|
|
130
132
|
export async function initWallet(network: Network, mnemonicOrSeed: string, config: Config, datadir: string, allowUnreachableServer: boolean, asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
|
|
131
133
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
@@ -250,6 +252,8 @@ export function validateMnemonic(mnemonic: string): boolean /*throws*/ {
|
|
|
250
252
|
/**
|
|
251
253
|
* Whether `datadir` holds an initialized bark wallet.
|
|
252
254
|
*
|
|
255
|
+
* `datadir` is a filesystem path or a `file://` URI.
|
|
256
|
+
*
|
|
253
257
|
* Answers without side effects: the database is opened read-only, no
|
|
254
258
|
* migration runs and no file or directory is created. Returns `false` for a
|
|
255
259
|
* missing or empty directory and for a database that never got its wallet
|
|
@@ -3281,6 +3285,60 @@ const FfiConverterTypeExitClaimTransaction = (() => {
|
|
|
3281
3285
|
return new FFIConverter();
|
|
3282
3286
|
})();
|
|
3283
3287
|
|
|
3288
|
+
/**
|
|
3289
|
+
* Fee a transaction commits together with its unconfirmed ancestors,
|
|
3290
|
+
* mirroring `bark::exit::FeeInfo`.
|
|
3291
|
+
*/
|
|
3292
|
+
export type ExitFeeInfo = {
|
|
3293
|
+
/**
|
|
3294
|
+
* Effective fee rate, in sat/kwu (lossless; divide by 250 for sat/vB).
|
|
3295
|
+
*/
|
|
3296
|
+
feeRateSatPerKwu: bigint,
|
|
3297
|
+
/**
|
|
3298
|
+
* Sum of the transaction's own fee and the fees of its unconfirmed
|
|
3299
|
+
* ancestors.
|
|
3300
|
+
*/
|
|
3301
|
+
totalFeeSats: bigint
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
/**
|
|
3305
|
+
* Generated factory for {@link ExitFeeInfo} record objects.
|
|
3306
|
+
*/
|
|
3307
|
+
export const ExitFeeInfo = (() => {
|
|
3308
|
+
const defaults = () => ({
|
|
3309
|
+
});
|
|
3310
|
+
const create = (() => {
|
|
3311
|
+
return uniffiCreateRecord<ExitFeeInfo, ReturnType<typeof defaults>>(defaults);
|
|
3312
|
+
})();
|
|
3313
|
+
return Object.freeze({
|
|
3314
|
+
create,
|
|
3315
|
+
new: create,
|
|
3316
|
+
defaults: () => Object.freeze(defaults()) as Partial<ExitFeeInfo>,
|
|
3317
|
+
});
|
|
3318
|
+
})();
|
|
3319
|
+
|
|
3320
|
+
const FfiConverterTypeExitFeeInfo = (() => {
|
|
3321
|
+
type TypeName = ExitFeeInfo;
|
|
3322
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
3323
|
+
readFromCursor(c: Cursor): TypeName {
|
|
3324
|
+
return {
|
|
3325
|
+
feeRateSatPerKwu: FfiConverterUInt64.readFromCursor(c),
|
|
3326
|
+
totalFeeSats: FfiConverterUInt64.readFromCursor(c)
|
|
3327
|
+
};
|
|
3328
|
+
}
|
|
3329
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
3330
|
+
FfiConverterUInt64.writeIntoCursor(value.feeRateSatPerKwu, c);
|
|
3331
|
+
FfiConverterUInt64.writeIntoCursor(value.totalFeeSats, c);
|
|
3332
|
+
}
|
|
3333
|
+
allocationSize(value: TypeName): number {
|
|
3334
|
+
return FfiConverterUInt64.allocationSize(value.feeRateSatPerKwu) +
|
|
3335
|
+
FfiConverterUInt64.allocationSize(value.totalFeeSats);
|
|
3336
|
+
|
|
3337
|
+
}
|
|
3338
|
+
};
|
|
3339
|
+
return new FFIConverter();
|
|
3340
|
+
})();
|
|
3341
|
+
|
|
3284
3342
|
|
|
3285
3343
|
// Enum: ExitTxStatus
|
|
3286
3344
|
export enum ExitTxStatus_Tags {
|
|
@@ -4229,6 +4287,55 @@ const FfiConverterTypeExitProgressStatus = (() => {
|
|
|
4229
4287
|
return new FFIConverter();
|
|
4230
4288
|
})();
|
|
4231
4289
|
|
|
4290
|
+
/**
|
|
4291
|
+
* A transaction of an exit chain, mirroring `bark::exit::TransactionInfo`.
|
|
4292
|
+
*/
|
|
4293
|
+
export type ExitTransactionInfo = {
|
|
4294
|
+
txid: string,
|
|
4295
|
+
/**
|
|
4296
|
+
* Consensus-encoded transaction, hex.
|
|
4297
|
+
*/
|
|
4298
|
+
txHex: string
|
|
4299
|
+
}
|
|
4300
|
+
|
|
4301
|
+
/**
|
|
4302
|
+
* Generated factory for {@link ExitTransactionInfo} record objects.
|
|
4303
|
+
*/
|
|
4304
|
+
export const ExitTransactionInfo = (() => {
|
|
4305
|
+
const defaults = () => ({
|
|
4306
|
+
});
|
|
4307
|
+
const create = (() => {
|
|
4308
|
+
return uniffiCreateRecord<ExitTransactionInfo, ReturnType<typeof defaults>>(defaults);
|
|
4309
|
+
})();
|
|
4310
|
+
return Object.freeze({
|
|
4311
|
+
create,
|
|
4312
|
+
new: create,
|
|
4313
|
+
defaults: () => Object.freeze(defaults()) as Partial<ExitTransactionInfo>,
|
|
4314
|
+
});
|
|
4315
|
+
})();
|
|
4316
|
+
|
|
4317
|
+
const FfiConverterTypeExitTransactionInfo = (() => {
|
|
4318
|
+
type TypeName = ExitTransactionInfo;
|
|
4319
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
4320
|
+
readFromCursor(c: Cursor): TypeName {
|
|
4321
|
+
return {
|
|
4322
|
+
txid: FfiConverterString.readFromCursor(c),
|
|
4323
|
+
txHex: FfiConverterString.readFromCursor(c)
|
|
4324
|
+
};
|
|
4325
|
+
}
|
|
4326
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
4327
|
+
FfiConverterString.writeIntoCursor(value.txid, c);
|
|
4328
|
+
FfiConverterString.writeIntoCursor(value.txHex, c);
|
|
4329
|
+
}
|
|
4330
|
+
allocationSize(value: TypeName): number {
|
|
4331
|
+
return FfiConverterString.allocationSize(value.txid) +
|
|
4332
|
+
FfiConverterString.allocationSize(value.txHex);
|
|
4333
|
+
|
|
4334
|
+
}
|
|
4335
|
+
};
|
|
4336
|
+
return new FFIConverter();
|
|
4337
|
+
})();
|
|
4338
|
+
|
|
4232
4339
|
/**
|
|
4233
4340
|
* One transaction of an exit: the exit transaction itself and, once it was
|
|
4234
4341
|
* fee-bumped, the child that confirms it. A unilateral exit is a chain of
|
|
@@ -4935,25 +5042,518 @@ export const OnchainBalance = (() => {
|
|
|
4935
5042
|
});
|
|
4936
5043
|
})();
|
|
4937
5044
|
|
|
4938
|
-
const FfiConverterTypeOnchainBalance = (() => {
|
|
4939
|
-
type TypeName = OnchainBalance;
|
|
5045
|
+
const FfiConverterTypeOnchainBalance = (() => {
|
|
5046
|
+
type TypeName = OnchainBalance;
|
|
5047
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5048
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5049
|
+
return {
|
|
5050
|
+
confirmedSats: FfiConverterUInt64.readFromCursor(c),
|
|
5051
|
+
pendingSats: FfiConverterUInt64.readFromCursor(c),
|
|
5052
|
+
totalSats: FfiConverterUInt64.readFromCursor(c)
|
|
5053
|
+
};
|
|
5054
|
+
}
|
|
5055
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5056
|
+
FfiConverterUInt64.writeIntoCursor(value.confirmedSats, c);
|
|
5057
|
+
FfiConverterUInt64.writeIntoCursor(value.pendingSats, c);
|
|
5058
|
+
FfiConverterUInt64.writeIntoCursor(value.totalSats, c);
|
|
5059
|
+
}
|
|
5060
|
+
allocationSize(value: TypeName): number {
|
|
5061
|
+
return FfiConverterUInt64.allocationSize(value.confirmedSats) +
|
|
5062
|
+
FfiConverterUInt64.allocationSize(value.pendingSats) +
|
|
5063
|
+
FfiConverterUInt64.allocationSize(value.totalSats);
|
|
5064
|
+
|
|
5065
|
+
}
|
|
5066
|
+
};
|
|
5067
|
+
return new FFIConverter();
|
|
5068
|
+
})();
|
|
5069
|
+
|
|
5070
|
+
/**
|
|
5071
|
+
* A parsed payment string, mirroring `bark::PaymentRequest`.
|
|
5072
|
+
*
|
|
5073
|
+
* `label` and `message` come from a BIP 321 URI. For a bare BOLT11 invoice
|
|
5074
|
+
* or BOLT12 offer, `amount_sats` is its amount and `message` its
|
|
5075
|
+
* description.
|
|
5076
|
+
*/
|
|
5077
|
+
export type PaymentRequest = {
|
|
5078
|
+
amountSats?: bigint,
|
|
5079
|
+
label?: string,
|
|
5080
|
+
message?: string,
|
|
5081
|
+
/**
|
|
5082
|
+
* Every destination found, in the order bark parsed them.
|
|
5083
|
+
*/
|
|
5084
|
+
options: Array<AvailablePaymentMethod>,
|
|
5085
|
+
/**
|
|
5086
|
+
* The option to pay when the user doesn't pick one: Ark, then
|
|
5087
|
+
* lightning, then onchain, skipping options with errors. `None` when
|
|
5088
|
+
* every option has errors.
|
|
5089
|
+
*/
|
|
5090
|
+
defaultOption?: AvailablePaymentMethod
|
|
5091
|
+
}
|
|
5092
|
+
|
|
5093
|
+
/**
|
|
5094
|
+
* Generated factory for {@link PaymentRequest} record objects.
|
|
5095
|
+
*/
|
|
5096
|
+
export const PaymentRequest = (() => {
|
|
5097
|
+
const defaults = () => ({
|
|
5098
|
+
});
|
|
5099
|
+
const create = (() => {
|
|
5100
|
+
return uniffiCreateRecord<PaymentRequest, ReturnType<typeof defaults>>(defaults);
|
|
5101
|
+
})();
|
|
5102
|
+
return Object.freeze({
|
|
5103
|
+
create,
|
|
5104
|
+
new: create,
|
|
5105
|
+
defaults: () => Object.freeze(defaults()) as Partial<PaymentRequest>,
|
|
5106
|
+
});
|
|
5107
|
+
})();
|
|
5108
|
+
|
|
5109
|
+
const FfiConverterTypePaymentRequest = (() => {
|
|
5110
|
+
type TypeName = PaymentRequest;
|
|
5111
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5112
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5113
|
+
return {
|
|
5114
|
+
amountSats: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
5115
|
+
label: FfiConverterOptionalString.readFromCursor(c),
|
|
5116
|
+
message: FfiConverterOptionalString.readFromCursor(c),
|
|
5117
|
+
options: FfiConverterSequenceTypeAvailablePaymentMethod.readFromCursor(c),
|
|
5118
|
+
defaultOption: FfiConverterOptionalTypeAvailablePaymentMethod.readFromCursor(c)
|
|
5119
|
+
};
|
|
5120
|
+
}
|
|
5121
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5122
|
+
FfiConverterOptionalUInt64.writeIntoCursor(value.amountSats, c);
|
|
5123
|
+
FfiConverterOptionalString.writeIntoCursor(value.label, c);
|
|
5124
|
+
FfiConverterOptionalString.writeIntoCursor(value.message, c);
|
|
5125
|
+
FfiConverterSequenceTypeAvailablePaymentMethod.writeIntoCursor(value.options, c);
|
|
5126
|
+
FfiConverterOptionalTypeAvailablePaymentMethod.writeIntoCursor(value.defaultOption, c);
|
|
5127
|
+
}
|
|
5128
|
+
allocationSize(value: TypeName): number {
|
|
5129
|
+
return FfiConverterOptionalUInt64.allocationSize(value.amountSats) +
|
|
5130
|
+
FfiConverterOptionalString.allocationSize(value.label) +
|
|
5131
|
+
FfiConverterOptionalString.allocationSize(value.message) +
|
|
5132
|
+
FfiConverterSequenceTypeAvailablePaymentMethod.allocationSize(value.options) +
|
|
5133
|
+
FfiConverterOptionalTypeAvailablePaymentMethod.allocationSize(value.defaultOption);
|
|
5134
|
+
|
|
5135
|
+
}
|
|
5136
|
+
};
|
|
5137
|
+
return new FFIConverter();
|
|
5138
|
+
})();
|
|
5139
|
+
|
|
5140
|
+
export type PendingBoard = {
|
|
5141
|
+
vtxoId: string,
|
|
5142
|
+
amountSats: bigint,
|
|
5143
|
+
txid: string,
|
|
5144
|
+
/**
|
|
5145
|
+
* Id of the `Movement` that records this board.
|
|
5146
|
+
*/
|
|
5147
|
+
movementId: number
|
|
5148
|
+
}
|
|
5149
|
+
|
|
5150
|
+
/**
|
|
5151
|
+
* Generated factory for {@link PendingBoard} record objects.
|
|
5152
|
+
*/
|
|
5153
|
+
export const PendingBoard = (() => {
|
|
5154
|
+
const defaults = () => ({
|
|
5155
|
+
});
|
|
5156
|
+
const create = (() => {
|
|
5157
|
+
return uniffiCreateRecord<PendingBoard, ReturnType<typeof defaults>>(defaults);
|
|
5158
|
+
})();
|
|
5159
|
+
return Object.freeze({
|
|
5160
|
+
create,
|
|
5161
|
+
new: create,
|
|
5162
|
+
defaults: () => Object.freeze(defaults()) as Partial<PendingBoard>,
|
|
5163
|
+
});
|
|
5164
|
+
})();
|
|
5165
|
+
|
|
5166
|
+
const FfiConverterTypePendingBoard = (() => {
|
|
5167
|
+
type TypeName = PendingBoard;
|
|
5168
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5169
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5170
|
+
return {
|
|
5171
|
+
vtxoId: FfiConverterString.readFromCursor(c),
|
|
5172
|
+
amountSats: FfiConverterUInt64.readFromCursor(c),
|
|
5173
|
+
txid: FfiConverterString.readFromCursor(c),
|
|
5174
|
+
movementId: FfiConverterUInt32.readFromCursor(c)
|
|
5175
|
+
};
|
|
5176
|
+
}
|
|
5177
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5178
|
+
FfiConverterString.writeIntoCursor(value.vtxoId, c);
|
|
5179
|
+
FfiConverterUInt64.writeIntoCursor(value.amountSats, c);
|
|
5180
|
+
FfiConverterString.writeIntoCursor(value.txid, c);
|
|
5181
|
+
FfiConverterUInt32.writeIntoCursor(value.movementId, c);
|
|
5182
|
+
}
|
|
5183
|
+
allocationSize(value: TypeName): number {
|
|
5184
|
+
return FfiConverterString.allocationSize(value.vtxoId) +
|
|
5185
|
+
FfiConverterUInt64.allocationSize(value.amountSats) +
|
|
5186
|
+
FfiConverterString.allocationSize(value.txid) +
|
|
5187
|
+
FfiConverterUInt32.allocationSize(value.movementId);
|
|
5188
|
+
|
|
5189
|
+
}
|
|
5190
|
+
};
|
|
5191
|
+
return new FFIConverter();
|
|
5192
|
+
})();
|
|
5193
|
+
|
|
5194
|
+
|
|
5195
|
+
// Enum: PresignedExitStatus
|
|
5196
|
+
export enum PresignedExitStatus_Tags {
|
|
5197
|
+
FullySigned = "FullySigned",
|
|
5198
|
+
PartiallySigned = "PartiallySigned",
|
|
5199
|
+
Unsigned = "Unsigned"
|
|
5200
|
+
}
|
|
5201
|
+
/**
|
|
5202
|
+
* How much of a [`PresignedExit`]'s remaining broadcast work could be funded
|
|
5203
|
+
* and signed, mirroring `bark::exit::PresignedExitStatus`.
|
|
5204
|
+
*/
|
|
5205
|
+
export const PresignedExitStatus = (() => {
|
|
5206
|
+
|
|
5207
|
+
type FullySigned__interface = {
|
|
5208
|
+
tag: PresignedExitStatus_Tags.FullySigned;
|
|
5209
|
+
inner:
|
|
5210
|
+
Readonly<{exitedInWave?: number; feeInfo: ExitFeeInfo}>
|
|
5211
|
+
};
|
|
5212
|
+
/**
|
|
5213
|
+
* Every package has a signed child. The exit's broadcast completes once
|
|
5214
|
+
* wave `exited_in_wave` (an index into [`PresignedExits::waves`])
|
|
5215
|
+
* confirms; `None` when the chain is already confirmed and there is
|
|
5216
|
+
* nothing to broadcast. `fee_info` totals the children's fees over the
|
|
5217
|
+
* combined weight of this exit's packages.
|
|
5218
|
+
*/
|
|
5219
|
+
class FullySigned_ extends UniffiEnum implements FullySigned__interface {
|
|
5220
|
+
/**
|
|
5221
|
+
* @private
|
|
5222
|
+
* This field is private and should not be used, use `tag` instead.
|
|
5223
|
+
*/
|
|
5224
|
+
readonly [uniffiTypeNameSymbol] = "PresignedExitStatus";
|
|
5225
|
+
readonly tag = PresignedExitStatus_Tags.FullySigned;
|
|
5226
|
+
readonly inner:
|
|
5227
|
+
Readonly<{exitedInWave?: number; feeInfo: ExitFeeInfo}>;
|
|
5228
|
+
constructor(
|
|
5229
|
+
inner: {exitedInWave?: number; feeInfo: ExitFeeInfo }) {
|
|
5230
|
+
super("PresignedExitStatus", "FullySigned");
|
|
5231
|
+
|
|
5232
|
+
this.inner = Object.freeze(inner);
|
|
5233
|
+
}
|
|
5234
|
+
static new(
|
|
5235
|
+
inner: {exitedInWave?: number; feeInfo: ExitFeeInfo }): FullySigned_ {
|
|
5236
|
+
return new FullySigned_(inner);
|
|
5237
|
+
}
|
|
5238
|
+
|
|
5239
|
+
static instanceOf(obj: any): obj is FullySigned_ {
|
|
5240
|
+
return obj.tag === PresignedExitStatus_Tags.FullySigned;
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
}
|
|
5244
|
+
|
|
5245
|
+
type PartiallySigned__interface = {
|
|
5246
|
+
tag: PresignedExitStatus_Tags.PartiallySigned;
|
|
5247
|
+
inner:
|
|
5248
|
+
Readonly<{lastWave: number}>
|
|
5249
|
+
};
|
|
5250
|
+
/**
|
|
5251
|
+
* Confirmed onchain funds ran out mid-chain: wave `last_wave` holds this
|
|
5252
|
+
* exit's last signed package and [`PresignedExit::unsigned`] continues
|
|
5253
|
+
* right after it.
|
|
5254
|
+
*/
|
|
5255
|
+
class PartiallySigned_ extends UniffiEnum implements PartiallySigned__interface {
|
|
5256
|
+
/**
|
|
5257
|
+
* @private
|
|
5258
|
+
* This field is private and should not be used, use `tag` instead.
|
|
5259
|
+
*/
|
|
5260
|
+
readonly [uniffiTypeNameSymbol] = "PresignedExitStatus";
|
|
5261
|
+
readonly tag = PresignedExitStatus_Tags.PartiallySigned;
|
|
5262
|
+
readonly inner:
|
|
5263
|
+
Readonly<{lastWave: number}>;
|
|
5264
|
+
constructor(
|
|
5265
|
+
inner: {lastWave: number }) {
|
|
5266
|
+
super("PresignedExitStatus", "PartiallySigned");
|
|
5267
|
+
|
|
5268
|
+
this.inner = Object.freeze(inner);
|
|
5269
|
+
}
|
|
5270
|
+
static new(
|
|
5271
|
+
inner: {lastWave: number }): PartiallySigned_ {
|
|
5272
|
+
return new PartiallySigned_(inner);
|
|
5273
|
+
}
|
|
5274
|
+
|
|
5275
|
+
static instanceOf(obj: any): obj is PartiallySigned_ {
|
|
5276
|
+
return obj.tag === PresignedExitStatus_Tags.PartiallySigned;
|
|
5277
|
+
}
|
|
5278
|
+
|
|
5279
|
+
}
|
|
5280
|
+
|
|
5281
|
+
type Unsigned__interface = {
|
|
5282
|
+
tag: PresignedExitStatus_Tags.Unsigned
|
|
5283
|
+
};
|
|
5284
|
+
/**
|
|
5285
|
+
* No package could be funded.
|
|
5286
|
+
*/
|
|
5287
|
+
class Unsigned_ extends UniffiEnum implements Unsigned__interface {
|
|
5288
|
+
/**
|
|
5289
|
+
* @private
|
|
5290
|
+
* This field is private and should not be used, use `tag` instead.
|
|
5291
|
+
*/
|
|
5292
|
+
readonly [uniffiTypeNameSymbol] = "PresignedExitStatus";
|
|
5293
|
+
readonly tag = PresignedExitStatus_Tags.Unsigned;
|
|
5294
|
+
constructor() {
|
|
5295
|
+
super("PresignedExitStatus", "Unsigned");
|
|
5296
|
+
}
|
|
5297
|
+
|
|
5298
|
+
static new(): Unsigned_ {
|
|
5299
|
+
return new Unsigned_();
|
|
5300
|
+
}
|
|
5301
|
+
|
|
5302
|
+
static instanceOf(obj: any): obj is Unsigned_ {
|
|
5303
|
+
return obj.tag === PresignedExitStatus_Tags.Unsigned;
|
|
5304
|
+
}
|
|
5305
|
+
|
|
5306
|
+
}
|
|
5307
|
+
|
|
5308
|
+
function instanceOf(obj: any): obj is PresignedExitStatus {
|
|
5309
|
+
return obj[uniffiTypeNameSymbol] === "PresignedExitStatus";
|
|
5310
|
+
}
|
|
5311
|
+
|
|
5312
|
+
return Object.freeze({
|
|
5313
|
+
instanceOf,
|
|
5314
|
+
FullySigned: FullySigned_,
|
|
5315
|
+
PartiallySigned: PartiallySigned_,
|
|
5316
|
+
Unsigned: Unsigned_
|
|
5317
|
+
});
|
|
5318
|
+
|
|
5319
|
+
})();
|
|
5320
|
+
/**
|
|
5321
|
+
* How much of a [`PresignedExit`]'s remaining broadcast work could be funded
|
|
5322
|
+
* and signed, mirroring `bark::exit::PresignedExitStatus`.
|
|
5323
|
+
*/
|
|
5324
|
+
export type PresignedExitStatus = InstanceType<
|
|
5325
|
+
typeof PresignedExitStatus['FullySigned' | 'PartiallySigned' | 'Unsigned']
|
|
5326
|
+
>;
|
|
5327
|
+
|
|
5328
|
+
// FfiConverter for enum PresignedExitStatus
|
|
5329
|
+
const FfiConverterTypePresignedExitStatus = (() => {
|
|
5330
|
+
type TypeName = PresignedExitStatus;
|
|
5331
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5332
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5333
|
+
switch (c.readI32()) {
|
|
5334
|
+
case 1: return new PresignedExitStatus.FullySigned({exitedInWave: FfiConverterOptionalUInt32.readFromCursor(c), feeInfo: FfiConverterTypeExitFeeInfo.readFromCursor(c) });
|
|
5335
|
+
case 2: return new PresignedExitStatus.PartiallySigned({lastWave: FfiConverterUInt32.readFromCursor(c) });
|
|
5336
|
+
case 3: return new PresignedExitStatus.Unsigned();
|
|
5337
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
5338
|
+
}
|
|
5339
|
+
}
|
|
5340
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5341
|
+
switch (value.tag) {
|
|
5342
|
+
case PresignedExitStatus_Tags.FullySigned: {
|
|
5343
|
+
c.writeI32(1);
|
|
5344
|
+
const inner = value.inner;
|
|
5345
|
+
FfiConverterOptionalUInt32.writeIntoCursor(inner.exitedInWave, c);
|
|
5346
|
+
FfiConverterTypeExitFeeInfo.writeIntoCursor(inner.feeInfo, c);
|
|
5347
|
+
return;
|
|
5348
|
+
}
|
|
5349
|
+
case PresignedExitStatus_Tags.PartiallySigned: {
|
|
5350
|
+
c.writeI32(2);
|
|
5351
|
+
const inner = value.inner;
|
|
5352
|
+
FfiConverterUInt32.writeIntoCursor(inner.lastWave, c);
|
|
5353
|
+
return;
|
|
5354
|
+
}
|
|
5355
|
+
case PresignedExitStatus_Tags.Unsigned: {
|
|
5356
|
+
c.writeI32(3);
|
|
5357
|
+
return;
|
|
5358
|
+
}
|
|
5359
|
+
default:
|
|
5360
|
+
// Throwing from here means that PresignedExitStatus_Tags hasn't matched an ordinal.
|
|
5361
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
5362
|
+
}
|
|
5363
|
+
}
|
|
5364
|
+
allocationSize(value: TypeName): number {
|
|
5365
|
+
switch (value.tag) {
|
|
5366
|
+
case PresignedExitStatus_Tags.FullySigned: {
|
|
5367
|
+
const inner = value.inner;
|
|
5368
|
+
let size = 4;
|
|
5369
|
+
size += FfiConverterOptionalUInt32.allocationSize(inner.exitedInWave);
|
|
5370
|
+
size += FfiConverterTypeExitFeeInfo.allocationSize(inner.feeInfo);
|
|
5371
|
+
return size;
|
|
5372
|
+
}
|
|
5373
|
+
case PresignedExitStatus_Tags.PartiallySigned: {
|
|
5374
|
+
const inner = value.inner;
|
|
5375
|
+
let size = 4;
|
|
5376
|
+
size += FfiConverterUInt32.allocationSize(inner.lastWave);
|
|
5377
|
+
return size;
|
|
5378
|
+
}
|
|
5379
|
+
case PresignedExitStatus_Tags.Unsigned: {
|
|
5380
|
+
return 4;
|
|
5381
|
+
}
|
|
5382
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
5383
|
+
}
|
|
5384
|
+
}
|
|
5385
|
+
}
|
|
5386
|
+
return new FFIConverter();
|
|
5387
|
+
})();
|
|
5388
|
+
|
|
5389
|
+
/**
|
|
5390
|
+
* The presigned broadcast work for one VTXO, mirroring
|
|
5391
|
+
* `bark::exit::PresignedExit`.
|
|
5392
|
+
*/
|
|
5393
|
+
export type PresignedExit = {
|
|
5394
|
+
vtxoId: string,
|
|
5395
|
+
status: PresignedExitStatus,
|
|
5396
|
+
/**
|
|
5397
|
+
* The remaining tail of this exit's chain that could not be funded, in
|
|
5398
|
+
* broadcast order; its first transaction spends this exit's last signed
|
|
5399
|
+
* one. Empty when fully signed.
|
|
5400
|
+
*/
|
|
5401
|
+
unsigned: Array<ExitTransactionInfo>
|
|
5402
|
+
}
|
|
5403
|
+
|
|
5404
|
+
/**
|
|
5405
|
+
* Generated factory for {@link PresignedExit} record objects.
|
|
5406
|
+
*/
|
|
5407
|
+
export const PresignedExit = (() => {
|
|
5408
|
+
const defaults = () => ({
|
|
5409
|
+
});
|
|
5410
|
+
const create = (() => {
|
|
5411
|
+
return uniffiCreateRecord<PresignedExit, ReturnType<typeof defaults>>(defaults);
|
|
5412
|
+
})();
|
|
5413
|
+
return Object.freeze({
|
|
5414
|
+
create,
|
|
5415
|
+
new: create,
|
|
5416
|
+
defaults: () => Object.freeze(defaults()) as Partial<PresignedExit>,
|
|
5417
|
+
});
|
|
5418
|
+
})();
|
|
5419
|
+
|
|
5420
|
+
const FfiConverterTypePresignedExit = (() => {
|
|
5421
|
+
type TypeName = PresignedExit;
|
|
5422
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5423
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5424
|
+
return {
|
|
5425
|
+
vtxoId: FfiConverterString.readFromCursor(c),
|
|
5426
|
+
status: FfiConverterTypePresignedExitStatus.readFromCursor(c),
|
|
5427
|
+
unsigned: FfiConverterSequenceTypeExitTransactionInfo.readFromCursor(c)
|
|
5428
|
+
};
|
|
5429
|
+
}
|
|
5430
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5431
|
+
FfiConverterString.writeIntoCursor(value.vtxoId, c);
|
|
5432
|
+
FfiConverterTypePresignedExitStatus.writeIntoCursor(value.status, c);
|
|
5433
|
+
FfiConverterSequenceTypeExitTransactionInfo.writeIntoCursor(value.unsigned, c);
|
|
5434
|
+
}
|
|
5435
|
+
allocationSize(value: TypeName): number {
|
|
5436
|
+
return FfiConverterString.allocationSize(value.vtxoId) +
|
|
5437
|
+
FfiConverterTypePresignedExitStatus.allocationSize(value.status) +
|
|
5438
|
+
FfiConverterSequenceTypeExitTransactionInfo.allocationSize(value.unsigned);
|
|
5439
|
+
|
|
5440
|
+
}
|
|
5441
|
+
};
|
|
5442
|
+
return new FFIConverter();
|
|
5443
|
+
})();
|
|
5444
|
+
|
|
5445
|
+
/**
|
|
5446
|
+
* A signed CPFP child and the fee it commits, mirroring
|
|
5447
|
+
* `bark::exit::PresignedExitChildInfo`.
|
|
5448
|
+
*/
|
|
5449
|
+
export type PresignedExitChild = {
|
|
5450
|
+
txid: string,
|
|
5451
|
+
/**
|
|
5452
|
+
* Consensus-encoded signed transaction, hex.
|
|
5453
|
+
*/
|
|
5454
|
+
txHex: string,
|
|
5455
|
+
/**
|
|
5456
|
+
* The exit transaction is zero-fee, so this is the fee of the whole
|
|
5457
|
+
* package.
|
|
5458
|
+
*/
|
|
5459
|
+
feeInfo: ExitFeeInfo
|
|
5460
|
+
}
|
|
5461
|
+
|
|
5462
|
+
/**
|
|
5463
|
+
* Generated factory for {@link PresignedExitChild} record objects.
|
|
5464
|
+
*/
|
|
5465
|
+
export const PresignedExitChild = (() => {
|
|
5466
|
+
const defaults = () => ({
|
|
5467
|
+
});
|
|
5468
|
+
const create = (() => {
|
|
5469
|
+
return uniffiCreateRecord<PresignedExitChild, ReturnType<typeof defaults>>(defaults);
|
|
5470
|
+
})();
|
|
5471
|
+
return Object.freeze({
|
|
5472
|
+
create,
|
|
5473
|
+
new: create,
|
|
5474
|
+
defaults: () => Object.freeze(defaults()) as Partial<PresignedExitChild>,
|
|
5475
|
+
});
|
|
5476
|
+
})();
|
|
5477
|
+
|
|
5478
|
+
const FfiConverterTypePresignedExitChild = (() => {
|
|
5479
|
+
type TypeName = PresignedExitChild;
|
|
5480
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5481
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5482
|
+
return {
|
|
5483
|
+
txid: FfiConverterString.readFromCursor(c),
|
|
5484
|
+
txHex: FfiConverterString.readFromCursor(c),
|
|
5485
|
+
feeInfo: FfiConverterTypeExitFeeInfo.readFromCursor(c)
|
|
5486
|
+
};
|
|
5487
|
+
}
|
|
5488
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5489
|
+
FfiConverterString.writeIntoCursor(value.txid, c);
|
|
5490
|
+
FfiConverterString.writeIntoCursor(value.txHex, c);
|
|
5491
|
+
FfiConverterTypeExitFeeInfo.writeIntoCursor(value.feeInfo, c);
|
|
5492
|
+
}
|
|
5493
|
+
allocationSize(value: TypeName): number {
|
|
5494
|
+
return FfiConverterString.allocationSize(value.txid) +
|
|
5495
|
+
FfiConverterString.allocationSize(value.txHex) +
|
|
5496
|
+
FfiConverterTypeExitFeeInfo.allocationSize(value.feeInfo);
|
|
5497
|
+
|
|
5498
|
+
}
|
|
5499
|
+
};
|
|
5500
|
+
return new FFIConverter();
|
|
5501
|
+
})();
|
|
5502
|
+
|
|
5503
|
+
/**
|
|
5504
|
+
* An `(exit, child)` transaction package, broadcast as one unit (e.g. with
|
|
5505
|
+
* `submitpackage`), mirroring `bark::exit::PresignedExitPackage`.
|
|
5506
|
+
*/
|
|
5507
|
+
export type PresignedExitPackage = {
|
|
5508
|
+
/**
|
|
5509
|
+
* The VTXO whose exit this package advances.
|
|
5510
|
+
*/
|
|
5511
|
+
vtxoId: string,
|
|
5512
|
+
/**
|
|
5513
|
+
* The zero-fee exit transaction.
|
|
5514
|
+
*/
|
|
5515
|
+
exit: ExitTransactionInfo,
|
|
5516
|
+
/**
|
|
5517
|
+
* The signed CPFP child paying for `exit`.
|
|
5518
|
+
*/
|
|
5519
|
+
child: PresignedExitChild
|
|
5520
|
+
}
|
|
5521
|
+
|
|
5522
|
+
/**
|
|
5523
|
+
* Generated factory for {@link PresignedExitPackage} record objects.
|
|
5524
|
+
*/
|
|
5525
|
+
export const PresignedExitPackage = (() => {
|
|
5526
|
+
const defaults = () => ({
|
|
5527
|
+
});
|
|
5528
|
+
const create = (() => {
|
|
5529
|
+
return uniffiCreateRecord<PresignedExitPackage, ReturnType<typeof defaults>>(defaults);
|
|
5530
|
+
})();
|
|
5531
|
+
return Object.freeze({
|
|
5532
|
+
create,
|
|
5533
|
+
new: create,
|
|
5534
|
+
defaults: () => Object.freeze(defaults()) as Partial<PresignedExitPackage>,
|
|
5535
|
+
});
|
|
5536
|
+
})();
|
|
5537
|
+
|
|
5538
|
+
const FfiConverterTypePresignedExitPackage = (() => {
|
|
5539
|
+
type TypeName = PresignedExitPackage;
|
|
4940
5540
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
4941
5541
|
readFromCursor(c: Cursor): TypeName {
|
|
4942
5542
|
return {
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
5543
|
+
vtxoId: FfiConverterString.readFromCursor(c),
|
|
5544
|
+
exit: FfiConverterTypeExitTransactionInfo.readFromCursor(c),
|
|
5545
|
+
child: FfiConverterTypePresignedExitChild.readFromCursor(c)
|
|
4946
5546
|
};
|
|
4947
5547
|
}
|
|
4948
5548
|
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
5549
|
+
FfiConverterString.writeIntoCursor(value.vtxoId, c);
|
|
5550
|
+
FfiConverterTypeExitTransactionInfo.writeIntoCursor(value.exit, c);
|
|
5551
|
+
FfiConverterTypePresignedExitChild.writeIntoCursor(value.child, c);
|
|
4952
5552
|
}
|
|
4953
5553
|
allocationSize(value: TypeName): number {
|
|
4954
|
-
return
|
|
4955
|
-
|
|
4956
|
-
|
|
5554
|
+
return FfiConverterString.allocationSize(value.vtxoId) +
|
|
5555
|
+
FfiConverterTypeExitTransactionInfo.allocationSize(value.exit) +
|
|
5556
|
+
FfiConverterTypePresignedExitChild.allocationSize(value.child);
|
|
4957
5557
|
|
|
4958
5558
|
}
|
|
4959
5559
|
};
|
|
@@ -4961,123 +5561,120 @@ const FfiConverterTypeOnchainBalance = (() => {
|
|
|
4961
5561
|
})();
|
|
4962
5562
|
|
|
4963
5563
|
/**
|
|
4964
|
-
*
|
|
4965
|
-
*
|
|
4966
|
-
* `label` and `message` come from a BIP 321 URI. For a bare BOLT11 invoice
|
|
4967
|
-
* or BOLT12 offer, `amount_sats` is its amount and `message` its
|
|
4968
|
-
* description.
|
|
5564
|
+
* One step of a presigned broadcast plan, mirroring
|
|
5565
|
+
* `bark::exit::PresignedWave`. See [`PresignedExits`] for the rules.
|
|
4969
5566
|
*/
|
|
4970
|
-
export type
|
|
4971
|
-
amountSats?: bigint,
|
|
4972
|
-
label?: string,
|
|
4973
|
-
message?: string,
|
|
5567
|
+
export type PresignedWave = {
|
|
4974
5568
|
/**
|
|
4975
|
-
*
|
|
5569
|
+
* Packages funded independently of each other, broadcast together.
|
|
4976
5570
|
*/
|
|
4977
|
-
|
|
5571
|
+
packages: Array<PresignedExitPackage>,
|
|
4978
5572
|
/**
|
|
4979
|
-
*
|
|
4980
|
-
*
|
|
4981
|
-
* every option has errors.
|
|
5573
|
+
* Exit transactions already in the mempool; they confirm with this wave.
|
|
5574
|
+
* Only the first wave has any.
|
|
4982
5575
|
*/
|
|
4983
|
-
|
|
5576
|
+
inMempool: Array<ExitTransactionInfo>
|
|
4984
5577
|
}
|
|
4985
5578
|
|
|
4986
5579
|
/**
|
|
4987
|
-
* Generated factory for {@link
|
|
5580
|
+
* Generated factory for {@link PresignedWave} record objects.
|
|
4988
5581
|
*/
|
|
4989
|
-
export const
|
|
5582
|
+
export const PresignedWave = (() => {
|
|
4990
5583
|
const defaults = () => ({
|
|
4991
5584
|
});
|
|
4992
5585
|
const create = (() => {
|
|
4993
|
-
return uniffiCreateRecord<
|
|
5586
|
+
return uniffiCreateRecord<PresignedWave, ReturnType<typeof defaults>>(defaults);
|
|
4994
5587
|
})();
|
|
4995
5588
|
return Object.freeze({
|
|
4996
5589
|
create,
|
|
4997
5590
|
new: create,
|
|
4998
|
-
defaults: () => Object.freeze(defaults()) as Partial<
|
|
5591
|
+
defaults: () => Object.freeze(defaults()) as Partial<PresignedWave>,
|
|
4999
5592
|
});
|
|
5000
5593
|
})();
|
|
5001
5594
|
|
|
5002
|
-
const
|
|
5003
|
-
type TypeName =
|
|
5595
|
+
const FfiConverterTypePresignedWave = (() => {
|
|
5596
|
+
type TypeName = PresignedWave;
|
|
5004
5597
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5005
5598
|
readFromCursor(c: Cursor): TypeName {
|
|
5006
5599
|
return {
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
message: FfiConverterOptionalString.readFromCursor(c),
|
|
5010
|
-
options: FfiConverterSequenceTypeAvailablePaymentMethod.readFromCursor(c),
|
|
5011
|
-
defaultOption: FfiConverterOptionalTypeAvailablePaymentMethod.readFromCursor(c)
|
|
5600
|
+
packages: FfiConverterSequenceTypePresignedExitPackage.readFromCursor(c),
|
|
5601
|
+
inMempool: FfiConverterSequenceTypeExitTransactionInfo.readFromCursor(c)
|
|
5012
5602
|
};
|
|
5013
5603
|
}
|
|
5014
5604
|
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
FfiConverterOptionalString.writeIntoCursor(value.message, c);
|
|
5018
|
-
FfiConverterSequenceTypeAvailablePaymentMethod.writeIntoCursor(value.options, c);
|
|
5019
|
-
FfiConverterOptionalTypeAvailablePaymentMethod.writeIntoCursor(value.defaultOption, c);
|
|
5605
|
+
FfiConverterSequenceTypePresignedExitPackage.writeIntoCursor(value.packages, c);
|
|
5606
|
+
FfiConverterSequenceTypeExitTransactionInfo.writeIntoCursor(value.inMempool, c);
|
|
5020
5607
|
}
|
|
5021
5608
|
allocationSize(value: TypeName): number {
|
|
5022
|
-
return
|
|
5023
|
-
|
|
5024
|
-
FfiConverterOptionalString.allocationSize(value.message) +
|
|
5025
|
-
FfiConverterSequenceTypeAvailablePaymentMethod.allocationSize(value.options) +
|
|
5026
|
-
FfiConverterOptionalTypeAvailablePaymentMethod.allocationSize(value.defaultOption);
|
|
5609
|
+
return FfiConverterSequenceTypePresignedExitPackage.allocationSize(value.packages) +
|
|
5610
|
+
FfiConverterSequenceTypeExitTransactionInfo.allocationSize(value.inMempool);
|
|
5027
5611
|
|
|
5028
5612
|
}
|
|
5029
5613
|
};
|
|
5030
5614
|
return new FFIConverter();
|
|
5031
5615
|
})();
|
|
5032
5616
|
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5617
|
+
/**
|
|
5618
|
+
* Presigned emergency-exit chains for a set of VTXOs: a wave-by-wave
|
|
5619
|
+
* broadcast plan plus a per-VTXO summary, mirroring
|
|
5620
|
+
* `bark::exit::PresignedExits`.
|
|
5621
|
+
*
|
|
5622
|
+
* Execute the plan in wave order: broadcast all of a wave's packages
|
|
5623
|
+
* together, then wait for every one, and its `in_mempool` transactions, to
|
|
5624
|
+
* confirm before the next wave. Each wave's children spend change confirmed
|
|
5625
|
+
* by the previous wave.
|
|
5626
|
+
*
|
|
5627
|
+
* Presigning reserves no funds, so a later spend from the onchain wallet can
|
|
5628
|
+
* invalidate the remaining children. It does reveal the change addresses
|
|
5629
|
+
* those children pay to. The children are fully signed: treat the result as
|
|
5630
|
+
* sensitive and store it accordingly.
|
|
5631
|
+
*/
|
|
5632
|
+
export type PresignedExits = {
|
|
5037
5633
|
/**
|
|
5038
|
-
*
|
|
5634
|
+
* One entry per requested VTXO, in request order (duplicates resolve to
|
|
5635
|
+
* their first occurrence).
|
|
5039
5636
|
*/
|
|
5040
|
-
|
|
5637
|
+
exits: Array<PresignedExit>,
|
|
5638
|
+
/**
|
|
5639
|
+
* The broadcast plan. Confirmed transactions are omitted, relayed ones are
|
|
5640
|
+
* listed in [`PresignedWave::in_mempool`], and a package shared by several
|
|
5641
|
+
* exits appears once, under the first exit that references it.
|
|
5642
|
+
*/
|
|
5643
|
+
waves: Array<PresignedWave>
|
|
5041
5644
|
}
|
|
5042
5645
|
|
|
5043
5646
|
/**
|
|
5044
|
-
* Generated factory for {@link
|
|
5647
|
+
* Generated factory for {@link PresignedExits} record objects.
|
|
5045
5648
|
*/
|
|
5046
|
-
export const
|
|
5649
|
+
export const PresignedExits = (() => {
|
|
5047
5650
|
const defaults = () => ({
|
|
5048
5651
|
});
|
|
5049
5652
|
const create = (() => {
|
|
5050
|
-
return uniffiCreateRecord<
|
|
5653
|
+
return uniffiCreateRecord<PresignedExits, ReturnType<typeof defaults>>(defaults);
|
|
5051
5654
|
})();
|
|
5052
5655
|
return Object.freeze({
|
|
5053
5656
|
create,
|
|
5054
5657
|
new: create,
|
|
5055
|
-
defaults: () => Object.freeze(defaults()) as Partial<
|
|
5658
|
+
defaults: () => Object.freeze(defaults()) as Partial<PresignedExits>,
|
|
5056
5659
|
});
|
|
5057
5660
|
})();
|
|
5058
5661
|
|
|
5059
|
-
const
|
|
5060
|
-
type TypeName =
|
|
5662
|
+
const FfiConverterTypePresignedExits = (() => {
|
|
5663
|
+
type TypeName = PresignedExits;
|
|
5061
5664
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5062
5665
|
readFromCursor(c: Cursor): TypeName {
|
|
5063
5666
|
return {
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
txid: FfiConverterString.readFromCursor(c),
|
|
5067
|
-
movementId: FfiConverterUInt32.readFromCursor(c)
|
|
5667
|
+
exits: FfiConverterSequenceTypePresignedExit.readFromCursor(c),
|
|
5668
|
+
waves: FfiConverterSequenceTypePresignedWave.readFromCursor(c)
|
|
5068
5669
|
};
|
|
5069
5670
|
}
|
|
5070
5671
|
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
FfiConverterString.writeIntoCursor(value.txid, c);
|
|
5074
|
-
FfiConverterUInt32.writeIntoCursor(value.movementId, c);
|
|
5672
|
+
FfiConverterSequenceTypePresignedExit.writeIntoCursor(value.exits, c);
|
|
5673
|
+
FfiConverterSequenceTypePresignedWave.writeIntoCursor(value.waves, c);
|
|
5075
5674
|
}
|
|
5076
5675
|
allocationSize(value: TypeName): number {
|
|
5077
|
-
return
|
|
5078
|
-
|
|
5079
|
-
FfiConverterString.allocationSize(value.txid) +
|
|
5080
|
-
FfiConverterUInt32.allocationSize(value.movementId);
|
|
5676
|
+
return FfiConverterSequenceTypePresignedExit.allocationSize(value.exits) +
|
|
5677
|
+
FfiConverterSequenceTypePresignedWave.allocationSize(value.waves);
|
|
5081
5678
|
|
|
5082
5679
|
}
|
|
5083
5680
|
};
|
|
@@ -5228,6 +5825,113 @@ const FfiConverterTypeRecoveryReport = (() => {
|
|
|
5228
5825
|
return new FFIConverter();
|
|
5229
5826
|
})();
|
|
5230
5827
|
|
|
5828
|
+
/**
|
|
5829
|
+
* The exit transactions one VTXO still needs confirmed to be exited.
|
|
5830
|
+
*/
|
|
5831
|
+
export type RemainingExit = {
|
|
5832
|
+
vtxoId: string,
|
|
5833
|
+
/**
|
|
5834
|
+
* Txids in broadcast order. Each one's transaction is in
|
|
5835
|
+
* [`RemainingExitTransactions::transactions`]. Empty when the chain is
|
|
5836
|
+
* already confirmed.
|
|
5837
|
+
*/
|
|
5838
|
+
txids: Array<string>
|
|
5839
|
+
}
|
|
5840
|
+
|
|
5841
|
+
/**
|
|
5842
|
+
* Generated factory for {@link RemainingExit} record objects.
|
|
5843
|
+
*/
|
|
5844
|
+
export const RemainingExit = (() => {
|
|
5845
|
+
const defaults = () => ({
|
|
5846
|
+
});
|
|
5847
|
+
const create = (() => {
|
|
5848
|
+
return uniffiCreateRecord<RemainingExit, ReturnType<typeof defaults>>(defaults);
|
|
5849
|
+
})();
|
|
5850
|
+
return Object.freeze({
|
|
5851
|
+
create,
|
|
5852
|
+
new: create,
|
|
5853
|
+
defaults: () => Object.freeze(defaults()) as Partial<RemainingExit>,
|
|
5854
|
+
});
|
|
5855
|
+
})();
|
|
5856
|
+
|
|
5857
|
+
const FfiConverterTypeRemainingExit = (() => {
|
|
5858
|
+
type TypeName = RemainingExit;
|
|
5859
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5860
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5861
|
+
return {
|
|
5862
|
+
vtxoId: FfiConverterString.readFromCursor(c),
|
|
5863
|
+
txids: FfiConverterSequenceString.readFromCursor(c)
|
|
5864
|
+
};
|
|
5865
|
+
}
|
|
5866
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5867
|
+
FfiConverterString.writeIntoCursor(value.vtxoId, c);
|
|
5868
|
+
FfiConverterSequenceString.writeIntoCursor(value.txids, c);
|
|
5869
|
+
}
|
|
5870
|
+
allocationSize(value: TypeName): number {
|
|
5871
|
+
return FfiConverterString.allocationSize(value.vtxoId) +
|
|
5872
|
+
FfiConverterSequenceString.allocationSize(value.txids);
|
|
5873
|
+
|
|
5874
|
+
}
|
|
5875
|
+
};
|
|
5876
|
+
return new FFIConverter();
|
|
5877
|
+
})();
|
|
5878
|
+
|
|
5879
|
+
/**
|
|
5880
|
+
* The exit transactions of a set of VTXOs still awaiting confirmation,
|
|
5881
|
+
* mirroring `bark::exit::RemainingExitTransactions`.
|
|
5882
|
+
*/
|
|
5883
|
+
export type RemainingExitTransactions = {
|
|
5884
|
+
/**
|
|
5885
|
+
* One entry per requested VTXO, in request order (duplicates resolve to
|
|
5886
|
+
* their first occurrence). Upstream returns a map; it is a list here so
|
|
5887
|
+
* the order is stable across bindings.
|
|
5888
|
+
*/
|
|
5889
|
+
exits: Array<RemainingExit>,
|
|
5890
|
+
/**
|
|
5891
|
+
* Every transaction referenced by `exits` exactly once, parents before
|
|
5892
|
+
* children.
|
|
5893
|
+
*/
|
|
5894
|
+
transactions: Array<ExitTransactionInfo>
|
|
5895
|
+
}
|
|
5896
|
+
|
|
5897
|
+
/**
|
|
5898
|
+
* Generated factory for {@link RemainingExitTransactions} record objects.
|
|
5899
|
+
*/
|
|
5900
|
+
export const RemainingExitTransactions = (() => {
|
|
5901
|
+
const defaults = () => ({
|
|
5902
|
+
});
|
|
5903
|
+
const create = (() => {
|
|
5904
|
+
return uniffiCreateRecord<RemainingExitTransactions, ReturnType<typeof defaults>>(defaults);
|
|
5905
|
+
})();
|
|
5906
|
+
return Object.freeze({
|
|
5907
|
+
create,
|
|
5908
|
+
new: create,
|
|
5909
|
+
defaults: () => Object.freeze(defaults()) as Partial<RemainingExitTransactions>,
|
|
5910
|
+
});
|
|
5911
|
+
})();
|
|
5912
|
+
|
|
5913
|
+
const FfiConverterTypeRemainingExitTransactions = (() => {
|
|
5914
|
+
type TypeName = RemainingExitTransactions;
|
|
5915
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5916
|
+
readFromCursor(c: Cursor): TypeName {
|
|
5917
|
+
return {
|
|
5918
|
+
exits: FfiConverterSequenceTypeRemainingExit.readFromCursor(c),
|
|
5919
|
+
transactions: FfiConverterSequenceTypeExitTransactionInfo.readFromCursor(c)
|
|
5920
|
+
};
|
|
5921
|
+
}
|
|
5922
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
5923
|
+
FfiConverterSequenceTypeRemainingExit.writeIntoCursor(value.exits, c);
|
|
5924
|
+
FfiConverterSequenceTypeExitTransactionInfo.writeIntoCursor(value.transactions, c);
|
|
5925
|
+
}
|
|
5926
|
+
allocationSize(value: TypeName): number {
|
|
5927
|
+
return FfiConverterSequenceTypeRemainingExit.allocationSize(value.exits) +
|
|
5928
|
+
FfiConverterSequenceTypeExitTransactionInfo.allocationSize(value.transactions);
|
|
5929
|
+
|
|
5930
|
+
}
|
|
5931
|
+
};
|
|
5932
|
+
return new FFIConverter();
|
|
5933
|
+
})();
|
|
5934
|
+
|
|
5231
5935
|
/**
|
|
5232
5936
|
* Lifecycle phase of a round participation, mirroring
|
|
5233
5937
|
* `bark::round::RoundFlowKind`.
|
|
@@ -6234,7 +6938,8 @@ private constructor(pointer: UniffiHandle) {
|
|
|
6234
6938
|
}
|
|
6235
6939
|
|
|
6236
6940
|
/**
|
|
6237
|
-
* BDK-backed wallet. Opens the shared sqlite cache
|
|
6941
|
+
* BDK-backed wallet. Opens the shared sqlite cache in `datadir`, a
|
|
6942
|
+
* filesystem path or a `file://` URI.
|
|
6238
6943
|
*/
|
|
6239
6944
|
static async default_(network: Network, mnemonic: string, config: Config, datadir: string, asyncOpts_?: { signal: AbortSignal }): Promise<OnchainWalletLike> /*throws*/ {
|
|
6240
6945
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
@@ -6750,7 +7455,8 @@ export type WalletOpenArgs = {
|
|
|
6750
7455
|
*/
|
|
6751
7456
|
runDaemon: boolean,
|
|
6752
7457
|
/**
|
|
6753
|
-
* The data directory to use for this wallet
|
|
7458
|
+
* The data directory to use for this wallet: a filesystem path or a
|
|
7459
|
+
* `file://` URI (such as Expo's `Directory.uri`)
|
|
6754
7460
|
*/
|
|
6755
7461
|
datadir: string,
|
|
6756
7462
|
/**
|
|
@@ -8862,7 +9568,14 @@ export interface WalletLike {
|
|
|
8862
9568
|
boardAmount(amountSats: bigint, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
|
|
8863
9569
|
boardFundingAddress(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<BoardFundingInfo>;
|
|
8864
9570
|
boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
|
|
8865
|
-
|
|
9571
|
+
/**
|
|
9572
|
+
* Create an invoice for an incoming lightning payment.
|
|
9573
|
+
*
|
|
9574
|
+
* `expiry_secs` is how long the invoice can be paid for. It defaults to,
|
|
9575
|
+
* and cannot exceed, the Ark server's invoice expiry; creating the invoice
|
|
9576
|
+
* fails if the server does not honour it. Must be at least 1.
|
|
9577
|
+
*/
|
|
9578
|
+
bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningInvoice>;
|
|
8866
9579
|
/**
|
|
8867
9580
|
* Create an invoice whose claimed VTXO is delivered to `claim_destination`
|
|
8868
9581
|
* (an Ark address), letting that wallet receive while offline.
|
|
@@ -8878,8 +9591,10 @@ export interface WalletLike {
|
|
|
8878
9591
|
*
|
|
8879
9592
|
* A `claim_destination` owned by this wallet is claimed locally instead of
|
|
8880
9593
|
* going through its mailbox.
|
|
9594
|
+
*
|
|
9595
|
+
* `expiry_secs` works as in [`Self::bolt11_invoice`].
|
|
8881
9596
|
*/
|
|
8882
|
-
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningInvoice>;
|
|
9597
|
+
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningInvoice>;
|
|
8883
9598
|
broadcastTx(txHex: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<string>;
|
|
8884
9599
|
cancelAllPendingRounds(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
|
|
8885
9600
|
/**
|
|
@@ -9077,6 +9792,26 @@ export interface WalletLike {
|
|
|
9077
9792
|
pendingLightningSends(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<LightningSend>>;
|
|
9078
9793
|
pendingRoundInputVtxos(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<Vtxo>>;
|
|
9079
9794
|
pendingRoundStates(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<RoundState>>;
|
|
9795
|
+
/**
|
|
9796
|
+
* Sign, without broadcasting, the CPFP child of every exit transaction
|
|
9797
|
+
* that still needs broadcasting to emergency-exit the given VTXOs, for as
|
|
9798
|
+
* long as confirmed onchain funds last. Mirrors bark-rest
|
|
9799
|
+
* `POST /exits/presign`.
|
|
9800
|
+
*
|
|
9801
|
+
* Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
|
|
9802
|
+
* nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
|
|
9803
|
+
* the onchain wallet and exits first.
|
|
9804
|
+
*
|
|
9805
|
+
* Execute the result wave by wave: broadcast a wave's packages together
|
|
9806
|
+
* and wait for them, and its `in_mempool` transactions, to confirm before
|
|
9807
|
+
* the next. No funds are reserved, so a later onchain spend can
|
|
9808
|
+
* invalidate the children. The children are signed: store the result
|
|
9809
|
+
* securely.
|
|
9810
|
+
*
|
|
9811
|
+
* Needs the built-in onchain wallet; with callback wallets
|
|
9812
|
+
* (`CustomOnchainWalletCallbacks`) it fails.
|
|
9813
|
+
*/
|
|
9814
|
+
presignEmergencyExit(vtxoIds: Array<string> | undefined, feeRateSatPerVb: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PresignedExits>;
|
|
9080
9815
|
progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<ExitProgressStatus>>;
|
|
9081
9816
|
progressPendingRounds(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
|
|
9082
9817
|
properties(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<WalletProperties>;
|
|
@@ -9118,6 +9853,17 @@ export interface WalletLike {
|
|
|
9118
9853
|
* so scheduling further out never costs more than refreshing now.
|
|
9119
9854
|
*/
|
|
9120
9855
|
refreshVtxosScheduled(vtxoIds: Array<string>, scheduledHeight: number, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<RoundState | undefined>;
|
|
9856
|
+
/**
|
|
9857
|
+
* List every exit transaction of the given VTXOs still awaiting
|
|
9858
|
+
* confirmation, so anyone can broadcast the exits on the user's behalf.
|
|
9859
|
+
* Mirrors bark-rest `GET /exits/remaining`.
|
|
9860
|
+
*
|
|
9861
|
+
* Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
|
|
9862
|
+
* nothing. Read-only: signs nothing and never touches the onchain wallet,
|
|
9863
|
+
* so it works with callback wallets too. Statuses of started exits reflect
|
|
9864
|
+
* the last `sync_exits`.
|
|
9865
|
+
*/
|
|
9866
|
+
remainingExitTransactions(vtxoIds: Array<string> | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<RemainingExitTransactions>;
|
|
9121
9867
|
/**
|
|
9122
9868
|
* Start the background daemon. The onchain wallet used by the daemon is
|
|
9123
9869
|
* the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
|
|
@@ -9758,14 +10504,21 @@ private constructor(pointer: UniffiHandle) {
|
|
|
9758
10504
|
}
|
|
9759
10505
|
}
|
|
9760
10506
|
|
|
9761
|
-
|
|
10507
|
+
/**
|
|
10508
|
+
* Create an invoice for an incoming lightning payment.
|
|
10509
|
+
*
|
|
10510
|
+
* `expiry_secs` is how long the invoice can be paid for. It defaults to,
|
|
10511
|
+
* and cannot exceed, the Ark server's invoice expiry; creating the invoice
|
|
10512
|
+
* fails if the server does not honour it. Must be at least 1.
|
|
10513
|
+
*/
|
|
10514
|
+
async bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined = undefined, expirySecs: bigint | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<LightningInvoice> /*throws*/ {
|
|
9762
10515
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
9763
10516
|
try {
|
|
9764
10517
|
return await uniffiRustCallAsync(
|
|
9765
10518
|
/*rustCaller:*/ uniffiCaller,
|
|
9766
10519
|
/*rustFutureFunc:*/ () => {
|
|
9767
10520
|
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice(
|
|
9768
|
-
uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc)
|
|
10521
|
+
uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(expirySecs, nativeModule().rustbuffer_alloc)
|
|
9769
10522
|
);
|
|
9770
10523
|
},
|
|
9771
10524
|
/*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
@@ -9814,15 +10567,17 @@ private constructor(pointer: UniffiHandle) {
|
|
|
9814
10567
|
*
|
|
9815
10568
|
* A `claim_destination` owned by this wallet is claimed locally instead of
|
|
9816
10569
|
* going through its mailbox.
|
|
10570
|
+
*
|
|
10571
|
+
* `expiry_secs` works as in [`Self::bolt11_invoice`].
|
|
9817
10572
|
*/
|
|
9818
|
-
async bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined = undefined, token: string | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<LightningInvoice> /*throws*/ {
|
|
10573
|
+
async bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined = undefined, token: string | undefined = undefined, expirySecs: bigint | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<LightningInvoice> /*throws*/ {
|
|
9819
10574
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
9820
10575
|
try {
|
|
9821
10576
|
return await uniffiRustCallAsync(
|
|
9822
10577
|
/*rustCaller:*/ uniffiCaller,
|
|
9823
10578
|
/*rustFutureFunc:*/ () => {
|
|
9824
10579
|
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice_for_address(
|
|
9825
|
-
uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterString.lower(claimDestination, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc)
|
|
10580
|
+
uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterString.lower(claimDestination, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(expirySecs, nativeModule().rustbuffer_alloc)
|
|
9826
10581
|
);
|
|
9827
10582
|
},
|
|
9828
10583
|
/*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
@@ -12488,6 +13243,66 @@ private constructor(pointer: UniffiHandle) {
|
|
|
12488
13243
|
}
|
|
12489
13244
|
}
|
|
12490
13245
|
|
|
13246
|
+
/**
|
|
13247
|
+
* Sign, without broadcasting, the CPFP child of every exit transaction
|
|
13248
|
+
* that still needs broadcasting to emergency-exit the given VTXOs, for as
|
|
13249
|
+
* long as confirmed onchain funds last. Mirrors bark-rest
|
|
13250
|
+
* `POST /exits/presign`.
|
|
13251
|
+
*
|
|
13252
|
+
* Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
|
|
13253
|
+
* nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
|
|
13254
|
+
* the onchain wallet and exits first.
|
|
13255
|
+
*
|
|
13256
|
+
* Execute the result wave by wave: broadcast a wave's packages together
|
|
13257
|
+
* and wait for them, and its `in_mempool` transactions, to confirm before
|
|
13258
|
+
* the next. No funds are reserved, so a later onchain spend can
|
|
13259
|
+
* invalidate the children. The children are signed: store the result
|
|
13260
|
+
* securely.
|
|
13261
|
+
*
|
|
13262
|
+
* Needs the built-in onchain wallet; with callback wallets
|
|
13263
|
+
* (`CustomOnchainWalletCallbacks`) it fails.
|
|
13264
|
+
*/
|
|
13265
|
+
async presignEmergencyExit(vtxoIds: Array<string> | undefined = undefined, feeRateSatPerVb: bigint | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<PresignedExits> /*throws*/ {
|
|
13266
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
13267
|
+
try {
|
|
13268
|
+
return await uniffiRustCallAsync(
|
|
13269
|
+
/*rustCaller:*/ uniffiCaller,
|
|
13270
|
+
/*rustFutureFunc:*/ () => {
|
|
13271
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_presign_emergency_exit(
|
|
13272
|
+
uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalSequenceString.lower(vtxoIds, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(feeRateSatPerVb, nativeModule().rustbuffer_alloc)
|
|
13273
|
+
);
|
|
13274
|
+
},
|
|
13275
|
+
/*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
13276
|
+
/*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
|
|
13277
|
+
/*completeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
|
|
13278
|
+
/*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
|
|
13279
|
+
// Async returns always go through the JS-side converter: the
|
|
13280
|
+
// FFI symbol returns the future handle (u64), and the user-level
|
|
13281
|
+
// RustBuffer comes back via the shared `rust_future_complete_*`
|
|
13282
|
+
// export. The bytes the runtime hands back must be deserialized
|
|
13283
|
+
// here using the per-callable return-type converter.
|
|
13284
|
+
// Borrowed view over foreign memory: the call site owns the free,
|
|
13285
|
+
// as on the sync paths. Unconditional — a no-op where buffers are
|
|
13286
|
+
// already JS-owned.
|
|
13287
|
+
/*liftFunc:*/ (__rb) => {
|
|
13288
|
+
try {
|
|
13289
|
+
return FfiConverterTypePresignedExits.lift(__rb);
|
|
13290
|
+
} finally {
|
|
13291
|
+
nativeModule().rustbuffer_free(__rb);
|
|
13292
|
+
}
|
|
13293
|
+
},
|
|
13294
|
+
/*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
|
|
13295
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
13296
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
13297
|
+
);
|
|
13298
|
+
} catch (__error: any) {
|
|
13299
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
13300
|
+
__error.stack = __stack;
|
|
13301
|
+
}
|
|
13302
|
+
throw __error;
|
|
13303
|
+
}
|
|
13304
|
+
}
|
|
13305
|
+
|
|
12491
13306
|
async progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: { signal: AbortSignal }): Promise<Array<ExitProgressStatus>> /*throws*/ {
|
|
12492
13307
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
12493
13308
|
try {
|
|
@@ -12851,6 +13666,57 @@ private constructor(pointer: UniffiHandle) {
|
|
|
12851
13666
|
}
|
|
12852
13667
|
}
|
|
12853
13668
|
|
|
13669
|
+
/**
|
|
13670
|
+
* List every exit transaction of the given VTXOs still awaiting
|
|
13671
|
+
* confirmation, so anyone can broadcast the exits on the user's behalf.
|
|
13672
|
+
* Mirrors bark-rest `GET /exits/remaining`.
|
|
13673
|
+
*
|
|
13674
|
+
* Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
|
|
13675
|
+
* nothing. Read-only: signs nothing and never touches the onchain wallet,
|
|
13676
|
+
* so it works with callback wallets too. Statuses of started exits reflect
|
|
13677
|
+
* the last `sync_exits`.
|
|
13678
|
+
*/
|
|
13679
|
+
async remainingExitTransactions(vtxoIds: Array<string> | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<RemainingExitTransactions> /*throws*/ {
|
|
13680
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
13681
|
+
try {
|
|
13682
|
+
return await uniffiRustCallAsync(
|
|
13683
|
+
/*rustCaller:*/ uniffiCaller,
|
|
13684
|
+
/*rustFutureFunc:*/ () => {
|
|
13685
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_remaining_exit_transactions(
|
|
13686
|
+
uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalSequenceString.lower(vtxoIds, nativeModule().rustbuffer_alloc)
|
|
13687
|
+
);
|
|
13688
|
+
},
|
|
13689
|
+
/*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
13690
|
+
/*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
|
|
13691
|
+
/*completeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
|
|
13692
|
+
/*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
|
|
13693
|
+
// Async returns always go through the JS-side converter: the
|
|
13694
|
+
// FFI symbol returns the future handle (u64), and the user-level
|
|
13695
|
+
// RustBuffer comes back via the shared `rust_future_complete_*`
|
|
13696
|
+
// export. The bytes the runtime hands back must be deserialized
|
|
13697
|
+
// here using the per-callable return-type converter.
|
|
13698
|
+
// Borrowed view over foreign memory: the call site owns the free,
|
|
13699
|
+
// as on the sync paths. Unconditional — a no-op where buffers are
|
|
13700
|
+
// already JS-owned.
|
|
13701
|
+
/*liftFunc:*/ (__rb) => {
|
|
13702
|
+
try {
|
|
13703
|
+
return FfiConverterTypeRemainingExitTransactions.lift(__rb);
|
|
13704
|
+
} finally {
|
|
13705
|
+
nativeModule().rustbuffer_free(__rb);
|
|
13706
|
+
}
|
|
13707
|
+
},
|
|
13708
|
+
/*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
|
|
13709
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
13710
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
13711
|
+
);
|
|
13712
|
+
} catch (__error: any) {
|
|
13713
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
13714
|
+
__error.stack = __stack;
|
|
13715
|
+
}
|
|
13716
|
+
throw __error;
|
|
13717
|
+
}
|
|
13718
|
+
}
|
|
13719
|
+
|
|
12854
13720
|
/**
|
|
12855
13721
|
* Start the background daemon. The onchain wallet used by the daemon is
|
|
12856
13722
|
* the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
|
|
@@ -13780,6 +14646,21 @@ const FfiConverterSequenceTypeAvailablePaymentMethod = new FfiConverterArray(Ffi
|
|
|
13780
14646
|
// FfiConverter for AvailablePaymentMethod | undefined
|
|
13781
14647
|
const FfiConverterOptionalTypeAvailablePaymentMethod = new FfiConverterOptional(FfiConverterTypeAvailablePaymentMethod);
|
|
13782
14648
|
|
|
14649
|
+
// FfiConverter for Array<ExitTransactionInfo>
|
|
14650
|
+
const FfiConverterSequenceTypeExitTransactionInfo = new FfiConverterArray(FfiConverterTypeExitTransactionInfo);
|
|
14651
|
+
|
|
14652
|
+
// FfiConverter for Array<PresignedExit>
|
|
14653
|
+
const FfiConverterSequenceTypePresignedExit = new FfiConverterArray(FfiConverterTypePresignedExit);
|
|
14654
|
+
|
|
14655
|
+
// FfiConverter for Array<PresignedExitPackage>
|
|
14656
|
+
const FfiConverterSequenceTypePresignedExitPackage = new FfiConverterArray(FfiConverterTypePresignedExitPackage);
|
|
14657
|
+
|
|
14658
|
+
// FfiConverter for Array<PresignedWave>
|
|
14659
|
+
const FfiConverterSequenceTypePresignedWave = new FfiConverterArray(FfiConverterTypePresignedWave);
|
|
14660
|
+
|
|
14661
|
+
// FfiConverter for Array<RemainingExit>
|
|
14662
|
+
const FfiConverterSequenceTypeRemainingExit = new FfiConverterArray(FfiConverterTypeRemainingExit);
|
|
14663
|
+
|
|
13783
14664
|
// FfiConverter for VtxoLockHolder | undefined
|
|
13784
14665
|
const FfiConverterOptionalTypeVtxoLockHolder = new FfiConverterOptional(FfiConverterTypeVtxoLockHolder);
|
|
13785
14666
|
|
|
@@ -13834,6 +14715,9 @@ const FfiConverterSequenceTypeLightningSend = new FfiConverterArray(FfiConverter
|
|
|
13834
14715
|
// FfiConverter for Array<RoundState>
|
|
13835
14716
|
const FfiConverterSequenceTypeRoundState = new FfiConverterArray(FfiConverterTypeRoundState);
|
|
13836
14717
|
|
|
14718
|
+
// FfiConverter for Array<string> | undefined
|
|
14719
|
+
const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
|
|
14720
|
+
|
|
13837
14721
|
// FfiConverter for Array<ExitProgressStatus>
|
|
13838
14722
|
const FfiConverterSequenceTypeExitProgressStatus = new FfiConverterArray(FfiConverterTypeExitProgressStatus);
|
|
13839
14723
|
|
|
@@ -13880,7 +14764,7 @@ function uniffiEnsureInitialized() {
|
|
|
13880
14764
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_generate_mnemonic() !== 65033) {
|
|
13881
14765
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_generate_mnemonic");
|
|
13882
14766
|
}
|
|
13883
|
-
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_init_wallet() !==
|
|
14767
|
+
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_init_wallet() !== 2602) {
|
|
13884
14768
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_init_wallet");
|
|
13885
14769
|
}
|
|
13886
14770
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit() !== 15808) {
|
|
@@ -13898,7 +14782,7 @@ function uniffiEnsureInitialized() {
|
|
|
13898
14782
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_validate_mnemonic() !== 33507) {
|
|
13899
14783
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_validate_mnemonic");
|
|
13900
14784
|
}
|
|
13901
|
-
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_wallet_exists() !==
|
|
14785
|
+
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_wallet_exists() !== 29370) {
|
|
13902
14786
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_wallet_exists");
|
|
13903
14787
|
}
|
|
13904
14788
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_barklogger_log() !== 3468) {
|
|
@@ -13943,7 +14827,7 @@ function uniffiEnsureInitialized() {
|
|
|
13943
14827
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_custom() !== 33645) {
|
|
13944
14828
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_onchainwallet_custom");
|
|
13945
14829
|
}
|
|
13946
|
-
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_default() !==
|
|
14830
|
+
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_default() !== 23070) {
|
|
13947
14831
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_onchainwallet_default");
|
|
13948
14832
|
}
|
|
13949
14833
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_balance() !== 39213) {
|
|
@@ -14015,10 +14899,10 @@ function uniffiEnsureInitialized() {
|
|
|
14015
14899
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_psbt() !== 28300) {
|
|
14016
14900
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_psbt");
|
|
14017
14901
|
}
|
|
14018
|
-
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !==
|
|
14902
|
+
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 32731) {
|
|
14019
14903
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice");
|
|
14020
14904
|
}
|
|
14021
|
-
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice_for_address() !==
|
|
14905
|
+
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice_for_address() !== 25554) {
|
|
14022
14906
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice_for_address");
|
|
14023
14907
|
}
|
|
14024
14908
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_broadcast_tx() !== 46367) {
|
|
@@ -14222,6 +15106,9 @@ function uniffiEnsureInitialized() {
|
|
|
14222
15106
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_round_states() !== 11480) {
|
|
14223
15107
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_round_states");
|
|
14224
15108
|
}
|
|
15109
|
+
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_presign_emergency_exit() !== 32185) {
|
|
15110
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_presign_emergency_exit");
|
|
15111
|
+
}
|
|
14225
15112
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_progress_exits() !== 6255) {
|
|
14226
15113
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_progress_exits");
|
|
14227
15114
|
}
|
|
@@ -14252,6 +15139,9 @@ function uniffiEnsureInitialized() {
|
|
|
14252
15139
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_scheduled() !== 50488) {
|
|
14253
15140
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_scheduled");
|
|
14254
15141
|
}
|
|
15142
|
+
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_remaining_exit_transactions() !== 44959) {
|
|
15143
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_remaining_exit_transactions");
|
|
15144
|
+
}
|
|
14255
15145
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_run_daemon() !== 9520) {
|
|
14256
15146
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_run_daemon");
|
|
14257
15147
|
}
|
|
@@ -14350,9 +15240,11 @@ export default Object.freeze({
|
|
|
14350
15240
|
FfiConverterTypeExitCancelResult,
|
|
14351
15241
|
FfiConverterTypeExitChildTransaction,
|
|
14352
15242
|
FfiConverterTypeExitClaimTransaction,
|
|
15243
|
+
FfiConverterTypeExitFeeInfo,
|
|
14353
15244
|
FfiConverterTypeExitProgressStatus,
|
|
14354
15245
|
FfiConverterTypeExitState,
|
|
14355
15246
|
FfiConverterTypeExitStateKind,
|
|
15247
|
+
FfiConverterTypeExitTransactionInfo,
|
|
14356
15248
|
FfiConverterTypeExitTransactionPackage,
|
|
14357
15249
|
FfiConverterTypeExitTransactionStatus,
|
|
14358
15250
|
FfiConverterTypeExitTx,
|
|
@@ -14385,10 +15277,18 @@ export default Object.freeze({
|
|
|
14385
15277
|
FfiConverterTypePaymentResult,
|
|
14386
15278
|
FfiConverterTypePendingBoard,
|
|
14387
15279
|
FfiConverterTypePpmExpiryFeeEntry,
|
|
15280
|
+
FfiConverterTypePresignedExit,
|
|
15281
|
+
FfiConverterTypePresignedExitChild,
|
|
15282
|
+
FfiConverterTypePresignedExitPackage,
|
|
15283
|
+
FfiConverterTypePresignedExitStatus,
|
|
15284
|
+
FfiConverterTypePresignedExits,
|
|
15285
|
+
FfiConverterTypePresignedWave,
|
|
14388
15286
|
FfiConverterTypeRecoveryBucket,
|
|
14389
15287
|
FfiConverterTypeRecoveryReport,
|
|
14390
15288
|
FfiConverterTypeRecoveryStatus,
|
|
14391
15289
|
FfiConverterTypeRefreshFees,
|
|
15290
|
+
FfiConverterTypeRemainingExit,
|
|
15291
|
+
FfiConverterTypeRemainingExitTransactions,
|
|
14392
15292
|
FfiConverterTypeRoundFlowKind,
|
|
14393
15293
|
FfiConverterTypeRoundState,
|
|
14394
15294
|
FfiConverterTypeVtxo,
|