@breeztech/breez-sdk-spark-react-native 0.2.5-dev2 → 0.2.6
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/cpp/generated/breez_sdk_spark.cpp +452 -45
- package/cpp/generated/breez_sdk_spark.hpp +36 -0
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +338 -12
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +337 -11
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +21 -9
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +196 -2
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +21 -9
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +196 -2
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/breez_sdk_spark-ffi.ts +47 -10
- package/src/generated/breez_sdk_spark.ts +661 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getter","globalThis","NativeBreezSdkSpark","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;AAAA;AACA;;
|
|
1
|
+
{"version":3,"names":["getter","globalThis","NativeBreezSdkSpark","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;AAAA;AACA;;AAwgBA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,mBAAmB;AACzC,eAAeF,MAAM;;AAErB;;AAkQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
|
|
@@ -2015,6 +2015,88 @@ const FfiConverterTypeUtxo = (() => {
|
|
|
2015
2015
|
}
|
|
2016
2016
|
return new FFIConverter();
|
|
2017
2017
|
})();
|
|
2018
|
+
/**
|
|
2019
|
+
* Generated factory for {@link WaitForPaymentRequest} record objects.
|
|
2020
|
+
*/
|
|
2021
|
+
export const WaitForPaymentRequest = (() => {
|
|
2022
|
+
const defaults = () => ({});
|
|
2023
|
+
const create = (() => {
|
|
2024
|
+
return uniffiCreateRecord(defaults);
|
|
2025
|
+
})();
|
|
2026
|
+
return Object.freeze({
|
|
2027
|
+
/**
|
|
2028
|
+
* Create a frozen instance of {@link WaitForPaymentRequest}, with defaults specified
|
|
2029
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2030
|
+
*/
|
|
2031
|
+
create,
|
|
2032
|
+
/**
|
|
2033
|
+
* Create a frozen instance of {@link WaitForPaymentRequest}, with defaults specified
|
|
2034
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2035
|
+
*/
|
|
2036
|
+
new: create,
|
|
2037
|
+
/**
|
|
2038
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
2039
|
+
*/
|
|
2040
|
+
defaults: () => Object.freeze(defaults())
|
|
2041
|
+
});
|
|
2042
|
+
})();
|
|
2043
|
+
const FfiConverterTypeWaitForPaymentRequest = (() => {
|
|
2044
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2045
|
+
read(from) {
|
|
2046
|
+
return {
|
|
2047
|
+
identifier: FfiConverterTypeWaitForPaymentIdentifier.read(from)
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
write(value, into) {
|
|
2051
|
+
FfiConverterTypeWaitForPaymentIdentifier.write(value.identifier, into);
|
|
2052
|
+
}
|
|
2053
|
+
allocationSize(value) {
|
|
2054
|
+
return FfiConverterTypeWaitForPaymentIdentifier.allocationSize(value.identifier);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
return new FFIConverter();
|
|
2058
|
+
})();
|
|
2059
|
+
/**
|
|
2060
|
+
* Generated factory for {@link WaitForPaymentResponse} record objects.
|
|
2061
|
+
*/
|
|
2062
|
+
export const WaitForPaymentResponse = (() => {
|
|
2063
|
+
const defaults = () => ({});
|
|
2064
|
+
const create = (() => {
|
|
2065
|
+
return uniffiCreateRecord(defaults);
|
|
2066
|
+
})();
|
|
2067
|
+
return Object.freeze({
|
|
2068
|
+
/**
|
|
2069
|
+
* Create a frozen instance of {@link WaitForPaymentResponse}, with defaults specified
|
|
2070
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2071
|
+
*/
|
|
2072
|
+
create,
|
|
2073
|
+
/**
|
|
2074
|
+
* Create a frozen instance of {@link WaitForPaymentResponse}, with defaults specified
|
|
2075
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2076
|
+
*/
|
|
2077
|
+
new: create,
|
|
2078
|
+
/**
|
|
2079
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
2080
|
+
*/
|
|
2081
|
+
defaults: () => Object.freeze(defaults())
|
|
2082
|
+
});
|
|
2083
|
+
})();
|
|
2084
|
+
const FfiConverterTypeWaitForPaymentResponse = (() => {
|
|
2085
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2086
|
+
read(from) {
|
|
2087
|
+
return {
|
|
2088
|
+
payment: FfiConverterTypePayment.read(from)
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
write(value, into) {
|
|
2092
|
+
FfiConverterTypePayment.write(value.payment, into);
|
|
2093
|
+
}
|
|
2094
|
+
allocationSize(value) {
|
|
2095
|
+
return FfiConverterTypePayment.allocationSize(value.payment);
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
return new FFIConverter();
|
|
2099
|
+
})();
|
|
2018
2100
|
const stringConverter = {
|
|
2019
2101
|
stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
|
|
2020
2102
|
bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
|
|
@@ -4152,7 +4234,8 @@ const FfiConverterTypeSendPaymentOptions = (() => {
|
|
|
4152
4234
|
});
|
|
4153
4235
|
case 2:
|
|
4154
4236
|
return new SendPaymentOptions.Bolt11Invoice({
|
|
4155
|
-
preferSpark: FfiConverterBool.read(from)
|
|
4237
|
+
preferSpark: FfiConverterBool.read(from),
|
|
4238
|
+
completionTimeoutSecs: FfiConverterOptionalUInt32.read(from)
|
|
4156
4239
|
});
|
|
4157
4240
|
default:
|
|
4158
4241
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
@@ -4172,6 +4255,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
|
|
|
4172
4255
|
ordinalConverter.write(2, into);
|
|
4173
4256
|
const inner = value.inner;
|
|
4174
4257
|
FfiConverterBool.write(inner.preferSpark, into);
|
|
4258
|
+
FfiConverterOptionalUInt32.write(inner.completionTimeoutSecs, into);
|
|
4175
4259
|
return;
|
|
4176
4260
|
}
|
|
4177
4261
|
default:
|
|
@@ -4193,6 +4277,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
|
|
|
4193
4277
|
const inner = value.inner;
|
|
4194
4278
|
let size = ordinalConverter.allocationSize(2);
|
|
4195
4279
|
size += FfiConverterBool.allocationSize(inner.preferSpark);
|
|
4280
|
+
size += FfiConverterOptionalUInt32.allocationSize(inner.completionTimeoutSecs);
|
|
4196
4281
|
return size;
|
|
4197
4282
|
}
|
|
4198
4283
|
default:
|
|
@@ -4498,6 +4583,117 @@ const FfiConverterTypeUpdateDepositPayload = (() => {
|
|
|
4498
4583
|
}
|
|
4499
4584
|
return new FFIConverter();
|
|
4500
4585
|
})();
|
|
4586
|
+
|
|
4587
|
+
// Enum: WaitForPaymentIdentifier
|
|
4588
|
+
export let WaitForPaymentIdentifier_Tags = /*#__PURE__*/function (WaitForPaymentIdentifier_Tags) {
|
|
4589
|
+
WaitForPaymentIdentifier_Tags["PaymentId"] = "PaymentId";
|
|
4590
|
+
WaitForPaymentIdentifier_Tags["PaymentRequest"] = "PaymentRequest";
|
|
4591
|
+
return WaitForPaymentIdentifier_Tags;
|
|
4592
|
+
}({});
|
|
4593
|
+
export const WaitForPaymentIdentifier = (() => {
|
|
4594
|
+
class PaymentId_ extends UniffiEnum {
|
|
4595
|
+
/**
|
|
4596
|
+
* @private
|
|
4597
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4598
|
+
*/
|
|
4599
|
+
[uniffiTypeNameSymbol] = 'WaitForPaymentIdentifier';
|
|
4600
|
+
tag = WaitForPaymentIdentifier_Tags.PaymentId;
|
|
4601
|
+
constructor(v0) {
|
|
4602
|
+
super('WaitForPaymentIdentifier', 'PaymentId');
|
|
4603
|
+
this.inner = Object.freeze([v0]);
|
|
4604
|
+
}
|
|
4605
|
+
static new(v0) {
|
|
4606
|
+
return new PaymentId_(v0);
|
|
4607
|
+
}
|
|
4608
|
+
static instanceOf(obj) {
|
|
4609
|
+
return obj.tag === WaitForPaymentIdentifier_Tags.PaymentId;
|
|
4610
|
+
}
|
|
4611
|
+
}
|
|
4612
|
+
class PaymentRequest_ extends UniffiEnum {
|
|
4613
|
+
/**
|
|
4614
|
+
* @private
|
|
4615
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4616
|
+
*/
|
|
4617
|
+
[uniffiTypeNameSymbol] = 'WaitForPaymentIdentifier';
|
|
4618
|
+
tag = WaitForPaymentIdentifier_Tags.PaymentRequest;
|
|
4619
|
+
constructor(v0) {
|
|
4620
|
+
super('WaitForPaymentIdentifier', 'PaymentRequest');
|
|
4621
|
+
this.inner = Object.freeze([v0]);
|
|
4622
|
+
}
|
|
4623
|
+
static new(v0) {
|
|
4624
|
+
return new PaymentRequest_(v0);
|
|
4625
|
+
}
|
|
4626
|
+
static instanceOf(obj) {
|
|
4627
|
+
return obj.tag === WaitForPaymentIdentifier_Tags.PaymentRequest;
|
|
4628
|
+
}
|
|
4629
|
+
}
|
|
4630
|
+
function instanceOf(obj) {
|
|
4631
|
+
return obj[uniffiTypeNameSymbol] === 'WaitForPaymentIdentifier';
|
|
4632
|
+
}
|
|
4633
|
+
return Object.freeze({
|
|
4634
|
+
instanceOf,
|
|
4635
|
+
PaymentId: PaymentId_,
|
|
4636
|
+
PaymentRequest: PaymentRequest_
|
|
4637
|
+
});
|
|
4638
|
+
})();
|
|
4639
|
+
// FfiConverter for enum WaitForPaymentIdentifier
|
|
4640
|
+
const FfiConverterTypeWaitForPaymentIdentifier = (() => {
|
|
4641
|
+
const ordinalConverter = FfiConverterInt32;
|
|
4642
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
4643
|
+
read(from) {
|
|
4644
|
+
switch (ordinalConverter.read(from)) {
|
|
4645
|
+
case 1:
|
|
4646
|
+
return new WaitForPaymentIdentifier.PaymentId(FfiConverterString.read(from));
|
|
4647
|
+
case 2:
|
|
4648
|
+
return new WaitForPaymentIdentifier.PaymentRequest(FfiConverterString.read(from));
|
|
4649
|
+
default:
|
|
4650
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
write(value, into) {
|
|
4654
|
+
switch (value.tag) {
|
|
4655
|
+
case WaitForPaymentIdentifier_Tags.PaymentId:
|
|
4656
|
+
{
|
|
4657
|
+
ordinalConverter.write(1, into);
|
|
4658
|
+
const inner = value.inner;
|
|
4659
|
+
FfiConverterString.write(inner[0], into);
|
|
4660
|
+
return;
|
|
4661
|
+
}
|
|
4662
|
+
case WaitForPaymentIdentifier_Tags.PaymentRequest:
|
|
4663
|
+
{
|
|
4664
|
+
ordinalConverter.write(2, into);
|
|
4665
|
+
const inner = value.inner;
|
|
4666
|
+
FfiConverterString.write(inner[0], into);
|
|
4667
|
+
return;
|
|
4668
|
+
}
|
|
4669
|
+
default:
|
|
4670
|
+
// Throwing from here means that WaitForPaymentIdentifier_Tags hasn't matched an ordinal.
|
|
4671
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
allocationSize(value) {
|
|
4675
|
+
switch (value.tag) {
|
|
4676
|
+
case WaitForPaymentIdentifier_Tags.PaymentId:
|
|
4677
|
+
{
|
|
4678
|
+
const inner = value.inner;
|
|
4679
|
+
let size = ordinalConverter.allocationSize(1);
|
|
4680
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
4681
|
+
return size;
|
|
4682
|
+
}
|
|
4683
|
+
case WaitForPaymentIdentifier_Tags.PaymentRequest:
|
|
4684
|
+
{
|
|
4685
|
+
const inner = value.inner;
|
|
4686
|
+
let size = ordinalConverter.allocationSize(2);
|
|
4687
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
4688
|
+
return size;
|
|
4689
|
+
}
|
|
4690
|
+
default:
|
|
4691
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4692
|
+
}
|
|
4693
|
+
}
|
|
4694
|
+
}
|
|
4695
|
+
return new FFIConverter();
|
|
4696
|
+
})();
|
|
4501
4697
|
export class BitcoinChainServiceImpl extends UniffiAbstractObject {
|
|
4502
4698
|
[uniffiTypeNameSymbol] = 'BitcoinChainServiceImpl';
|
|
4503
4699
|
// No primary constructor declared for this class.
|
|
@@ -4820,10 +5016,18 @@ export class BreezSdk extends UniffiAbstractObject {
|
|
|
4820
5016
|
*
|
|
4821
5017
|
* Result containing either success or an `SdkError` if the background task couldn't be stopped
|
|
4822
5018
|
*/
|
|
4823
|
-
disconnect() /*throws*/{
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
5019
|
+
async disconnect(asyncOpts_) /*throws*/{
|
|
5020
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5021
|
+
try {
|
|
5022
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5023
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect(uniffiTypeBreezSdkObjectFactory.clonePointer(this));
|
|
5024
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
5025
|
+
} catch (__error) {
|
|
5026
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5027
|
+
__error.stack = __stack;
|
|
5028
|
+
}
|
|
5029
|
+
throw __error;
|
|
5030
|
+
}
|
|
4827
5031
|
}
|
|
4828
5032
|
|
|
4829
5033
|
/**
|
|
@@ -5070,6 +5274,32 @@ export class BreezSdk extends UniffiAbstractObject {
|
|
|
5070
5274
|
throw __error;
|
|
5071
5275
|
}
|
|
5072
5276
|
}
|
|
5277
|
+
async sendBitcoinAddress(address, feeQuote, request, asyncOpts_) /*throws*/{
|
|
5278
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5279
|
+
try {
|
|
5280
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5281
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_bitcoin_address(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeBitcoinAddressDetails.lower(address), FfiConverterTypeSendOnchainFeeQuote.lower(feeQuote), FfiConverterTypeSendPaymentRequest.lower(request));
|
|
5282
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeSendPaymentResponse.lift.bind(FfiConverterTypeSendPaymentResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
5283
|
+
} catch (__error) {
|
|
5284
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5285
|
+
__error.stack = __stack;
|
|
5286
|
+
}
|
|
5287
|
+
throw __error;
|
|
5288
|
+
}
|
|
5289
|
+
}
|
|
5290
|
+
async sendBolt11Invoice(invoiceDetails, sparkTransferFeeSats, lightningFeeSats, request, asyncOpts_) /*throws*/{
|
|
5291
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5292
|
+
try {
|
|
5293
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5294
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_bolt11_invoice(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeBolt11InvoiceDetails.lower(invoiceDetails), FfiConverterOptionalUInt64.lower(sparkTransferFeeSats), FfiConverterUInt64.lower(lightningFeeSats), FfiConverterTypeSendPaymentRequest.lower(request));
|
|
5295
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeSendPaymentResponse.lift.bind(FfiConverterTypeSendPaymentResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
5296
|
+
} catch (__error) {
|
|
5297
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5298
|
+
__error.stack = __stack;
|
|
5299
|
+
}
|
|
5300
|
+
throw __error;
|
|
5301
|
+
}
|
|
5302
|
+
}
|
|
5073
5303
|
async sendPayment(request, asyncOpts_) /*throws*/{
|
|
5074
5304
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5075
5305
|
try {
|
|
@@ -5096,6 +5326,19 @@ export class BreezSdk extends UniffiAbstractObject {
|
|
|
5096
5326
|
throw __error;
|
|
5097
5327
|
}
|
|
5098
5328
|
}
|
|
5329
|
+
async sendSparkAddress(address, request, asyncOpts_) /*throws*/{
|
|
5330
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5331
|
+
try {
|
|
5332
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5333
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_spark_address(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterTypeSendPaymentRequest.lower(request));
|
|
5334
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeSendPaymentResponse.lift.bind(FfiConverterTypeSendPaymentResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
5335
|
+
} catch (__error) {
|
|
5336
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5337
|
+
__error.stack = __stack;
|
|
5338
|
+
}
|
|
5339
|
+
throw __error;
|
|
5340
|
+
}
|
|
5341
|
+
}
|
|
5099
5342
|
|
|
5100
5343
|
/**
|
|
5101
5344
|
* Synchronizes the wallet with the Spark network
|
|
@@ -5113,6 +5356,19 @@ export class BreezSdk extends UniffiAbstractObject {
|
|
|
5113
5356
|
throw __error;
|
|
5114
5357
|
}
|
|
5115
5358
|
}
|
|
5359
|
+
async waitForPayment(request, asyncOpts_) /*throws*/{
|
|
5360
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5361
|
+
try {
|
|
5362
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5363
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeWaitForPaymentRequest.lower(request));
|
|
5364
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeWaitForPaymentResponse.lift.bind(FfiConverterTypeWaitForPaymentResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
5365
|
+
} catch (__error) {
|
|
5366
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5367
|
+
__error.stack = __stack;
|
|
5368
|
+
}
|
|
5369
|
+
throw __error;
|
|
5370
|
+
}
|
|
5371
|
+
}
|
|
5116
5372
|
|
|
5117
5373
|
/**
|
|
5118
5374
|
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
@@ -5503,6 +5759,29 @@ export class StorageImpl extends UniffiAbstractObject {
|
|
|
5503
5759
|
}
|
|
5504
5760
|
}
|
|
5505
5761
|
|
|
5762
|
+
/**
|
|
5763
|
+
* Gets a payment by its invoice
|
|
5764
|
+
* # Arguments
|
|
5765
|
+
*
|
|
5766
|
+
* * `invoice` - The invoice of the payment to retrieve
|
|
5767
|
+
* # Returns
|
|
5768
|
+
*
|
|
5769
|
+
* The payment if found or None if not found
|
|
5770
|
+
*/
|
|
5771
|
+
async getPaymentByInvoice(invoice, asyncOpts_) /*throws*/{
|
|
5772
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5773
|
+
try {
|
|
5774
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5775
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_invoice(uniffiTypeStorageImplObjectFactory.clonePointer(this), FfiConverterString.lower(invoice));
|
|
5776
|
+
}, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterOptionalTypePayment.lift.bind(FfiConverterOptionalTypePayment), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeStorageError.lift.bind(FfiConverterTypeStorageError));
|
|
5777
|
+
} catch (__error) {
|
|
5778
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5779
|
+
__error.stack = __stack;
|
|
5780
|
+
}
|
|
5781
|
+
throw __error;
|
|
5782
|
+
}
|
|
5783
|
+
}
|
|
5784
|
+
|
|
5506
5785
|
/**
|
|
5507
5786
|
* Add a deposit to storage
|
|
5508
5787
|
* # Arguments
|
|
@@ -5831,6 +6110,32 @@ const uniffiCallbackInterfaceStorage = {
|
|
|
5831
6110
|
const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/StorageError.instanceOf, /*lowerError:*/FfiConverterTypeStorageError.lower.bind(FfiConverterTypeStorageError), /*lowerString:*/FfiConverterString.lower);
|
|
5832
6111
|
return UniffiResult.success(uniffiForeignFuture);
|
|
5833
6112
|
},
|
|
6113
|
+
getPaymentByInvoice: (uniffiHandle, invoice, uniffiFutureCallback, uniffiCallbackData) => {
|
|
6114
|
+
const uniffiMakeCall = async signal => {
|
|
6115
|
+
const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
|
|
6116
|
+
return await jsCallback.getPaymentByInvoice(FfiConverterString.lift(invoice), {
|
|
6117
|
+
signal
|
|
6118
|
+
});
|
|
6119
|
+
};
|
|
6120
|
+
const uniffiHandleSuccess = returnValue => {
|
|
6121
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
|
|
6122
|
+
returnValue: FfiConverterOptionalTypePayment.lower(returnValue),
|
|
6123
|
+
callStatus: uniffiCaller.createCallStatus()
|
|
6124
|
+
});
|
|
6125
|
+
};
|
|
6126
|
+
const uniffiHandleError = (code, errorBuf) => {
|
|
6127
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
|
|
6128
|
+
returnValue: /*empty*/new Uint8Array(0),
|
|
6129
|
+
// TODO create callstatus with error.
|
|
6130
|
+
callStatus: {
|
|
6131
|
+
code,
|
|
6132
|
+
errorBuf
|
|
6133
|
+
}
|
|
6134
|
+
});
|
|
6135
|
+
};
|
|
6136
|
+
const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/StorageError.instanceOf, /*lowerError:*/FfiConverterTypeStorageError.lower.bind(FfiConverterTypeStorageError), /*lowerString:*/FfiConverterString.lower);
|
|
6137
|
+
return UniffiResult.success(uniffiForeignFuture);
|
|
6138
|
+
},
|
|
5834
6139
|
addDeposit: (uniffiHandle, txid, vout, amountSats, uniffiFutureCallback, uniffiCallbackData) => {
|
|
5835
6140
|
const uniffiMakeCall = async signal => {
|
|
5836
6141
|
const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
|
|
@@ -5960,6 +6265,9 @@ const FfiConverterOptionalTypeLightningAddressInfo = new FfiConverterOptional(Ff
|
|
|
5960
6265
|
// FfiConverter for LnurlPayInfo | undefined
|
|
5961
6266
|
const FfiConverterOptionalTypeLnurlPayInfo = new FfiConverterOptional(FfiConverterTypeLnurlPayInfo);
|
|
5962
6267
|
|
|
6268
|
+
// FfiConverter for Payment | undefined
|
|
6269
|
+
const FfiConverterOptionalTypePayment = new FfiConverterOptional(FfiConverterTypePayment);
|
|
6270
|
+
|
|
5963
6271
|
// FfiConverter for string | undefined
|
|
5964
6272
|
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
5965
6273
|
|
|
@@ -6053,7 +6361,7 @@ function uniffiEnsureInitialized() {
|
|
|
6053
6361
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address() !== 44132) {
|
|
6054
6362
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address');
|
|
6055
6363
|
}
|
|
6056
|
-
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect() !==
|
|
6364
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect() !== 330) {
|
|
6057
6365
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect');
|
|
6058
6366
|
}
|
|
6059
6367
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_info() !== 6771) {
|
|
@@ -6104,15 +6412,27 @@ function uniffiEnsureInitialized() {
|
|
|
6104
6412
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener() !== 41066) {
|
|
6105
6413
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener');
|
|
6106
6414
|
}
|
|
6415
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bitcoin_address() !== 5926) {
|
|
6416
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bitcoin_address');
|
|
6417
|
+
}
|
|
6418
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bolt11_invoice() !== 21785) {
|
|
6419
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bolt11_invoice');
|
|
6420
|
+
}
|
|
6107
6421
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() !== 54349) {
|
|
6108
6422
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment');
|
|
6109
6423
|
}
|
|
6110
6424
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal() !== 37855) {
|
|
6111
6425
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal');
|
|
6112
6426
|
}
|
|
6427
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_spark_address() !== 63147) {
|
|
6428
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_spark_address');
|
|
6429
|
+
}
|
|
6113
6430
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() !== 30368) {
|
|
6114
6431
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet');
|
|
6115
6432
|
}
|
|
6433
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() !== 64922) {
|
|
6434
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment');
|
|
6435
|
+
}
|
|
6116
6436
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build() !== 8126) {
|
|
6117
6437
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build');
|
|
6118
6438
|
}
|
|
@@ -6152,16 +6472,19 @@ function uniffiEnsureInitialized() {
|
|
|
6152
6472
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id() !== 35394) {
|
|
6153
6473
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id');
|
|
6154
6474
|
}
|
|
6155
|
-
if (nativeModule().
|
|
6475
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice() !== 57075) {
|
|
6476
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice');
|
|
6477
|
+
}
|
|
6478
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_add_deposit() !== 60240) {
|
|
6156
6479
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_add_deposit');
|
|
6157
6480
|
}
|
|
6158
|
-
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() !==
|
|
6481
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() !== 60586) {
|
|
6159
6482
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit');
|
|
6160
6483
|
}
|
|
6161
|
-
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() !==
|
|
6484
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() !== 54118) {
|
|
6162
6485
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_list_deposits');
|
|
6163
6486
|
}
|
|
6164
|
-
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !==
|
|
6487
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !== 39803) {
|
|
6165
6488
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_update_deposit');
|
|
6166
6489
|
}
|
|
6167
6490
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() !== 53882) {
|
|
@@ -6240,7 +6563,10 @@ export default Object.freeze({
|
|
|
6240
6563
|
FfiConverterTypeSyncWalletResponse,
|
|
6241
6564
|
FfiConverterTypeTxStatus,
|
|
6242
6565
|
FfiConverterTypeUpdateDepositPayload,
|
|
6243
|
-
FfiConverterTypeUtxo
|
|
6566
|
+
FfiConverterTypeUtxo,
|
|
6567
|
+
FfiConverterTypeWaitForPaymentIdentifier,
|
|
6568
|
+
FfiConverterTypeWaitForPaymentRequest,
|
|
6569
|
+
FfiConverterTypeWaitForPaymentResponse
|
|
6244
6570
|
}
|
|
6245
6571
|
});
|
|
6246
6572
|
//# sourceMappingURL=breez_sdk_spark.js.map
|