@breeztech/breez-sdk-spark-react-native 0.1.9-dev1 → 0.1.9-dev2
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 +54 -2
- package/cpp/generated/breez_sdk_spark.hpp +6 -0
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +118 -7
- 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 +117 -6
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +3 -1
- 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 +81 -3
- 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 +3 -1
- 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 +81 -3
- 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 +8 -1
- package/src/generated/breez_sdk_spark.ts +171 -5
|
@@ -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;;AA0dA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,mBAAmB;AACzC,eAAeF,MAAM;;AAErB;;AAkPA;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":[]}
|
|
@@ -303,7 +303,8 @@ const FfiConverterTypeConfig = (() => {
|
|
|
303
303
|
network: FfiConverterTypeNetwork.read(from),
|
|
304
304
|
syncIntervalSecs: FfiConverterUInt32.read(from),
|
|
305
305
|
maxDepositClaimFee: FfiConverterOptionalTypeFee.read(from),
|
|
306
|
-
lnurlDomain: FfiConverterOptionalString.read(from)
|
|
306
|
+
lnurlDomain: FfiConverterOptionalString.read(from),
|
|
307
|
+
preferSparkOverLightning: FfiConverterBool.read(from)
|
|
307
308
|
};
|
|
308
309
|
}
|
|
309
310
|
write(value, into) {
|
|
@@ -312,9 +313,10 @@ const FfiConverterTypeConfig = (() => {
|
|
|
312
313
|
FfiConverterUInt32.write(value.syncIntervalSecs, into);
|
|
313
314
|
FfiConverterOptionalTypeFee.write(value.maxDepositClaimFee, into);
|
|
314
315
|
FfiConverterOptionalString.write(value.lnurlDomain, into);
|
|
316
|
+
FfiConverterBool.write(value.preferSparkOverLightning, into);
|
|
315
317
|
}
|
|
316
318
|
allocationSize(value) {
|
|
317
|
-
return FfiConverterOptionalString.allocationSize(value.apiKey) + FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterUInt32.allocationSize(value.syncIntervalSecs) + FfiConverterOptionalTypeFee.allocationSize(value.maxDepositClaimFee) + FfiConverterOptionalString.allocationSize(value.lnurlDomain);
|
|
319
|
+
return FfiConverterOptionalString.allocationSize(value.apiKey) + FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterUInt32.allocationSize(value.syncIntervalSecs) + FfiConverterOptionalTypeFee.allocationSize(value.maxDepositClaimFee) + FfiConverterOptionalString.allocationSize(value.lnurlDomain) + FfiConverterBool.allocationSize(value.preferSparkOverLightning);
|
|
318
320
|
}
|
|
319
321
|
}
|
|
320
322
|
return new FFIConverter();
|
|
@@ -2352,6 +2354,53 @@ const FfiConverterTypeFee = (() => {
|
|
|
2352
2354
|
}
|
|
2353
2355
|
return new FFIConverter();
|
|
2354
2356
|
})();
|
|
2357
|
+
export let KeySetType = /*#__PURE__*/function (KeySetType) {
|
|
2358
|
+
KeySetType[KeySetType["Default"] = 0] = "Default";
|
|
2359
|
+
KeySetType[KeySetType["Taproot"] = 1] = "Taproot";
|
|
2360
|
+
KeySetType[KeySetType["NativeSegwit"] = 2] = "NativeSegwit";
|
|
2361
|
+
KeySetType[KeySetType["WrappedSegwit"] = 3] = "WrappedSegwit";
|
|
2362
|
+
KeySetType[KeySetType["Legacy"] = 4] = "Legacy";
|
|
2363
|
+
return KeySetType;
|
|
2364
|
+
}({});
|
|
2365
|
+
const FfiConverterTypeKeySetType = (() => {
|
|
2366
|
+
const ordinalConverter = FfiConverterInt32;
|
|
2367
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2368
|
+
read(from) {
|
|
2369
|
+
switch (ordinalConverter.read(from)) {
|
|
2370
|
+
case 1:
|
|
2371
|
+
return KeySetType.Default;
|
|
2372
|
+
case 2:
|
|
2373
|
+
return KeySetType.Taproot;
|
|
2374
|
+
case 3:
|
|
2375
|
+
return KeySetType.NativeSegwit;
|
|
2376
|
+
case 4:
|
|
2377
|
+
return KeySetType.WrappedSegwit;
|
|
2378
|
+
case 5:
|
|
2379
|
+
return KeySetType.Legacy;
|
|
2380
|
+
default:
|
|
2381
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
write(value, into) {
|
|
2385
|
+
switch (value) {
|
|
2386
|
+
case KeySetType.Default:
|
|
2387
|
+
return ordinalConverter.write(1, into);
|
|
2388
|
+
case KeySetType.Taproot:
|
|
2389
|
+
return ordinalConverter.write(2, into);
|
|
2390
|
+
case KeySetType.NativeSegwit:
|
|
2391
|
+
return ordinalConverter.write(3, into);
|
|
2392
|
+
case KeySetType.WrappedSegwit:
|
|
2393
|
+
return ordinalConverter.write(4, into);
|
|
2394
|
+
case KeySetType.Legacy:
|
|
2395
|
+
return ordinalConverter.write(5, into);
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
allocationSize(value) {
|
|
2399
|
+
return ordinalConverter.allocationSize(0);
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
return new FFIConverter();
|
|
2403
|
+
})();
|
|
2355
2404
|
export let Network = /*#__PURE__*/function (Network) {
|
|
2356
2405
|
Network[Network["Mainnet"] = 0] = "Mainnet";
|
|
2357
2406
|
Network[Network["Regtest"] = 1] = "Regtest";
|
|
@@ -3399,6 +3448,7 @@ export let SdkEvent_Tags = /*#__PURE__*/function (SdkEvent_Tags) {
|
|
|
3399
3448
|
SdkEvent_Tags["ClaimDepositsFailed"] = "ClaimDepositsFailed";
|
|
3400
3449
|
SdkEvent_Tags["ClaimDepositsSucceeded"] = "ClaimDepositsSucceeded";
|
|
3401
3450
|
SdkEvent_Tags["PaymentSucceeded"] = "PaymentSucceeded";
|
|
3451
|
+
SdkEvent_Tags["PaymentFailed"] = "PaymentFailed";
|
|
3402
3452
|
return SdkEvent_Tags;
|
|
3403
3453
|
}({});
|
|
3404
3454
|
/**
|
|
@@ -3482,6 +3532,24 @@ export const SdkEvent = (() => {
|
|
|
3482
3532
|
return obj.tag === SdkEvent_Tags.PaymentSucceeded;
|
|
3483
3533
|
}
|
|
3484
3534
|
}
|
|
3535
|
+
class PaymentFailed_ extends UniffiEnum {
|
|
3536
|
+
/**
|
|
3537
|
+
* @private
|
|
3538
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3539
|
+
*/
|
|
3540
|
+
[uniffiTypeNameSymbol] = 'SdkEvent';
|
|
3541
|
+
tag = SdkEvent_Tags.PaymentFailed;
|
|
3542
|
+
constructor(inner) {
|
|
3543
|
+
super('SdkEvent', 'PaymentFailed');
|
|
3544
|
+
this.inner = Object.freeze(inner);
|
|
3545
|
+
}
|
|
3546
|
+
static new(inner) {
|
|
3547
|
+
return new PaymentFailed_(inner);
|
|
3548
|
+
}
|
|
3549
|
+
static instanceOf(obj) {
|
|
3550
|
+
return obj.tag === SdkEvent_Tags.PaymentFailed;
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3485
3553
|
function instanceOf(obj) {
|
|
3486
3554
|
return obj[uniffiTypeNameSymbol] === 'SdkEvent';
|
|
3487
3555
|
}
|
|
@@ -3490,7 +3558,8 @@ export const SdkEvent = (() => {
|
|
|
3490
3558
|
Synced: Synced_,
|
|
3491
3559
|
ClaimDepositsFailed: ClaimDepositsFailed_,
|
|
3492
3560
|
ClaimDepositsSucceeded: ClaimDepositsSucceeded_,
|
|
3493
|
-
PaymentSucceeded: PaymentSucceeded_
|
|
3561
|
+
PaymentSucceeded: PaymentSucceeded_,
|
|
3562
|
+
PaymentFailed: PaymentFailed_
|
|
3494
3563
|
});
|
|
3495
3564
|
})();
|
|
3496
3565
|
|
|
@@ -3518,6 +3587,10 @@ const FfiConverterTypeSdkEvent = (() => {
|
|
|
3518
3587
|
return new SdkEvent.PaymentSucceeded({
|
|
3519
3588
|
payment: FfiConverterTypePayment.read(from)
|
|
3520
3589
|
});
|
|
3590
|
+
case 5:
|
|
3591
|
+
return new SdkEvent.PaymentFailed({
|
|
3592
|
+
payment: FfiConverterTypePayment.read(from)
|
|
3593
|
+
});
|
|
3521
3594
|
default:
|
|
3522
3595
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3523
3596
|
}
|
|
@@ -3550,6 +3623,13 @@ const FfiConverterTypeSdkEvent = (() => {
|
|
|
3550
3623
|
FfiConverterTypePayment.write(inner.payment, into);
|
|
3551
3624
|
return;
|
|
3552
3625
|
}
|
|
3626
|
+
case SdkEvent_Tags.PaymentFailed:
|
|
3627
|
+
{
|
|
3628
|
+
ordinalConverter.write(5, into);
|
|
3629
|
+
const inner = value.inner;
|
|
3630
|
+
FfiConverterTypePayment.write(inner.payment, into);
|
|
3631
|
+
return;
|
|
3632
|
+
}
|
|
3553
3633
|
default:
|
|
3554
3634
|
// Throwing from here means that SdkEvent_Tags hasn't matched an ordinal.
|
|
3555
3635
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
@@ -3582,6 +3662,13 @@ const FfiConverterTypeSdkEvent = (() => {
|
|
|
3582
3662
|
size += FfiConverterTypePayment.allocationSize(inner.payment);
|
|
3583
3663
|
return size;
|
|
3584
3664
|
}
|
|
3665
|
+
case SdkEvent_Tags.PaymentFailed:
|
|
3666
|
+
{
|
|
3667
|
+
const inner = value.inner;
|
|
3668
|
+
let size = ordinalConverter.allocationSize(5);
|
|
3669
|
+
size += FfiConverterTypePayment.allocationSize(inner.payment);
|
|
3670
|
+
return size;
|
|
3671
|
+
}
|
|
3585
3672
|
default:
|
|
3586
3673
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3587
3674
|
}
|
|
@@ -4543,9 +4630,9 @@ export class BreezSdk extends UniffiAbstractObject {
|
|
|
4543
4630
|
throw __error;
|
|
4544
4631
|
}
|
|
4545
4632
|
}
|
|
4546
|
-
pollLightningSendPayment(
|
|
4633
|
+
pollLightningSendPayment(payment, sspId) {
|
|
4547
4634
|
uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
4548
|
-
nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterString.lower(
|
|
4635
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypePayment.lower(payment), FfiConverterString.lower(sspId), callStatus);
|
|
4549
4636
|
}, /*liftString:*/FfiConverterString.lift);
|
|
4550
4637
|
}
|
|
4551
4638
|
async prepareLnurlPay(request, asyncOpts_) /*throws*/{
|
|
@@ -4793,6 +4880,26 @@ export class SdkBuilder extends UniffiAbstractObject {
|
|
|
4793
4880
|
throw __error;
|
|
4794
4881
|
}
|
|
4795
4882
|
}
|
|
4883
|
+
|
|
4884
|
+
/**
|
|
4885
|
+
* Sets the key set type to be used by the SDK.
|
|
4886
|
+
* Arguments:
|
|
4887
|
+
* - `key_set_type`: The key set type which determines the derivation path.
|
|
4888
|
+
* - `use_address_index`: Controls the structure of the BIP derivation path.
|
|
4889
|
+
*/
|
|
4890
|
+
async withKeySet(keySetType, useAddressIndex, asyncOpts_) {
|
|
4891
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
4892
|
+
try {
|
|
4893
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
4894
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(uniffiTypeSdkBuilderObjectFactory.clonePointer(this), FfiConverterTypeKeySetType.lower(keySetType), FfiConverterBool.lower(useAddressIndex));
|
|
4895
|
+
}, /*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_);
|
|
4896
|
+
} catch (__error) {
|
|
4897
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
4898
|
+
__error.stack = __stack;
|
|
4899
|
+
}
|
|
4900
|
+
throw __error;
|
|
4901
|
+
}
|
|
4902
|
+
}
|
|
4796
4903
|
async withLnurlClient(lnurlClient, asyncOpts_) {
|
|
4797
4904
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
4798
4905
|
try {
|
|
@@ -5595,7 +5702,7 @@ function uniffiEnsureInitialized() {
|
|
|
5595
5702
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() !== 10147) {
|
|
5596
5703
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay');
|
|
5597
5704
|
}
|
|
5598
|
-
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !==
|
|
5705
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !== 57601) {
|
|
5599
5706
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment');
|
|
5600
5707
|
}
|
|
5601
5708
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() !== 37691) {
|
|
@@ -5634,6 +5741,9 @@ function uniffiEnsureInitialized() {
|
|
|
5634
5741
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service() !== 2848) {
|
|
5635
5742
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service');
|
|
5636
5743
|
}
|
|
5744
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() !== 55523) {
|
|
5745
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set');
|
|
5746
|
+
}
|
|
5637
5747
|
if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() !== 61720) {
|
|
5638
5748
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client');
|
|
5639
5749
|
}
|
|
@@ -5705,6 +5815,7 @@ export default Object.freeze({
|
|
|
5705
5815
|
FfiConverterTypeGetInfoResponse,
|
|
5706
5816
|
FfiConverterTypeGetPaymentRequest,
|
|
5707
5817
|
FfiConverterTypeGetPaymentResponse,
|
|
5818
|
+
FfiConverterTypeKeySetType,
|
|
5708
5819
|
FfiConverterTypeLightningAddressInfo,
|
|
5709
5820
|
FfiConverterTypeListPaymentsRequest,
|
|
5710
5821
|
FfiConverterTypeListPaymentsResponse,
|