@breeztech/breez-sdk-spark-react-native 0.8.2 → 0.9.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/lib/commonjs/generated/breez_sdk_spark.js +60 -17
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +59 -16
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +181 -20
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +181 -20
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/generated/breez_sdk_spark.ts +268 -22
|
@@ -778,6 +778,13 @@ export type Config = {
|
|
|
778
778
|
* More leaves allow payments to be made without needing a swap, reducing payment latency.
|
|
779
779
|
*/
|
|
780
780
|
optimizationConfig: OptimizationConfig;
|
|
781
|
+
/**
|
|
782
|
+
* Configuration for automatic conversion of Bitcoin to stable tokens.
|
|
783
|
+
*
|
|
784
|
+
* When set, received sats will be automatically converted to the specified token
|
|
785
|
+
* once the balance exceeds the threshold.
|
|
786
|
+
*/
|
|
787
|
+
stableBalanceConfig: StableBalanceConfig | undefined;
|
|
781
788
|
};
|
|
782
789
|
/**
|
|
783
790
|
* Generated factory for {@link Config} record objects.
|
|
@@ -3999,6 +4006,64 @@ export declare const SparkStatus: Readonly<{
|
|
|
3999
4006
|
*/
|
|
4000
4007
|
defaults: () => Partial<SparkStatus>;
|
|
4001
4008
|
}>;
|
|
4009
|
+
/**
|
|
4010
|
+
* Configuration for automatic conversion of Bitcoin to stable tokens.
|
|
4011
|
+
*
|
|
4012
|
+
* When configured, the SDK automatically monitors the Bitcoin balance after each
|
|
4013
|
+
* wallet sync. When the balance exceeds the configured threshold plus the reserved
|
|
4014
|
+
* amount, the SDK automatically converts the excess balance (above the reserve)
|
|
4015
|
+
* to the specified stable token.
|
|
4016
|
+
*
|
|
4017
|
+
* When the balance is held in a stable token, Bitcoin payments can still be sent.
|
|
4018
|
+
* The SDK automatically detects when there's not enough Bitcoin balance to cover a
|
|
4019
|
+
* payment and auto-populates the token-to-Bitcoin conversion options to facilitate
|
|
4020
|
+
* the payment.
|
|
4021
|
+
*/
|
|
4022
|
+
export type StableBalanceConfig = {
|
|
4023
|
+
/**
|
|
4024
|
+
* The token identifier to convert Bitcoin to (required).
|
|
4025
|
+
*/
|
|
4026
|
+
tokenIdentifier: string;
|
|
4027
|
+
/**
|
|
4028
|
+
* The minimum sats balance that triggers auto-conversion.
|
|
4029
|
+
*
|
|
4030
|
+
* If not provided, uses the minimum from conversion limits.
|
|
4031
|
+
* If provided but less than the conversion limit minimum, the limit minimum is used.
|
|
4032
|
+
*/
|
|
4033
|
+
thresholdSats: /*u64*/ bigint | undefined;
|
|
4034
|
+
/**
|
|
4035
|
+
* Maximum slippage in basis points (1/100 of a percent).
|
|
4036
|
+
*
|
|
4037
|
+
* Defaults to 50 bps (0.5%) if not set.
|
|
4038
|
+
*/
|
|
4039
|
+
maxSlippageBps: /*u32*/ number | undefined;
|
|
4040
|
+
/**
|
|
4041
|
+
* Amount of sats to keep as Bitcoin and not convert to stable tokens.
|
|
4042
|
+
*
|
|
4043
|
+
* This reserve ensures you can send Bitcoin payments without hitting
|
|
4044
|
+
* the minimum conversion limit. Defaults to the conversion minimum if not set.
|
|
4045
|
+
*/
|
|
4046
|
+
reservedSats: /*u64*/ bigint | undefined;
|
|
4047
|
+
};
|
|
4048
|
+
/**
|
|
4049
|
+
* Generated factory for {@link StableBalanceConfig} record objects.
|
|
4050
|
+
*/
|
|
4051
|
+
export declare const StableBalanceConfig: Readonly<{
|
|
4052
|
+
/**
|
|
4053
|
+
* Create a frozen instance of {@link StableBalanceConfig}, with defaults specified
|
|
4054
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
4055
|
+
*/
|
|
4056
|
+
create: (partial: Partial<StableBalanceConfig> & Required<Omit<StableBalanceConfig, "maxSlippageBps" | "thresholdSats" | "reservedSats">>) => StableBalanceConfig;
|
|
4057
|
+
/**
|
|
4058
|
+
* Create a frozen instance of {@link StableBalanceConfig}, with defaults specified
|
|
4059
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
4060
|
+
*/
|
|
4061
|
+
new: (partial: Partial<StableBalanceConfig> & Required<Omit<StableBalanceConfig, "maxSlippageBps" | "thresholdSats" | "reservedSats">>) => StableBalanceConfig;
|
|
4062
|
+
/**
|
|
4063
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
4064
|
+
*/
|
|
4065
|
+
defaults: () => Partial<StableBalanceConfig>;
|
|
4066
|
+
}>;
|
|
4002
4067
|
/**
|
|
4003
4068
|
* Settings for the symbol representation of a currency
|
|
4004
4069
|
*/
|
|
@@ -4844,7 +4909,8 @@ export declare const ChainServiceError: Readonly<{
|
|
|
4844
4909
|
export type ChainServiceError = InstanceType<(typeof ChainServiceError)[keyof Omit<typeof ChainServiceError, 'instanceOf'>]>;
|
|
4845
4910
|
export declare enum ConversionPurpose_Tags {
|
|
4846
4911
|
OngoingPayment = "OngoingPayment",
|
|
4847
|
-
SelfTransfer = "SelfTransfer"
|
|
4912
|
+
SelfTransfer = "SelfTransfer",
|
|
4913
|
+
AutoConversion = "AutoConversion"
|
|
4848
4914
|
}
|
|
4849
4915
|
/**
|
|
4850
4916
|
* The purpose of the conversion, which is used to provide context for the conversion
|
|
@@ -4921,6 +4987,32 @@ export declare const ConversionPurpose: Readonly<{
|
|
|
4921
4987
|
readonly [uniffiTypeNameSymbol]: "ConversionPurpose";
|
|
4922
4988
|
};
|
|
4923
4989
|
};
|
|
4990
|
+
AutoConversion: {
|
|
4991
|
+
new (): {
|
|
4992
|
+
readonly tag: ConversionPurpose_Tags.AutoConversion;
|
|
4993
|
+
/**
|
|
4994
|
+
* @private
|
|
4995
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4996
|
+
*/
|
|
4997
|
+
readonly [uniffiTypeNameSymbol]: "ConversionPurpose";
|
|
4998
|
+
};
|
|
4999
|
+
"new"(): {
|
|
5000
|
+
readonly tag: ConversionPurpose_Tags.AutoConversion;
|
|
5001
|
+
/**
|
|
5002
|
+
* @private
|
|
5003
|
+
* This field is private and should not be used, use `tag` instead.
|
|
5004
|
+
*/
|
|
5005
|
+
readonly [uniffiTypeNameSymbol]: "ConversionPurpose";
|
|
5006
|
+
};
|
|
5007
|
+
instanceOf(obj: any): obj is {
|
|
5008
|
+
readonly tag: ConversionPurpose_Tags.AutoConversion;
|
|
5009
|
+
/**
|
|
5010
|
+
* @private
|
|
5011
|
+
* This field is private and should not be used, use `tag` instead.
|
|
5012
|
+
*/
|
|
5013
|
+
readonly [uniffiTypeNameSymbol]: "ConversionPurpose";
|
|
5014
|
+
};
|
|
5015
|
+
};
|
|
4924
5016
|
}>;
|
|
4925
5017
|
/**
|
|
4926
5018
|
* The purpose of the conversion, which is used to provide context for the conversion
|
|
@@ -6455,20 +6547,17 @@ export declare const PaymentDetails: Readonly<{
|
|
|
6455
6547
|
/**
|
|
6456
6548
|
* Represents the invoice description
|
|
6457
6549
|
*/ description: string | undefined;
|
|
6458
|
-
/**
|
|
6459
|
-
* The preimage of the paid invoice (proof of payment).
|
|
6460
|
-
*/ preimage: string | undefined;
|
|
6461
6550
|
/**
|
|
6462
6551
|
* Represents the Bolt11/Bolt12 invoice associated with a payment
|
|
6463
6552
|
* In the case of a Send payment, this is the invoice paid by the user
|
|
6464
6553
|
* In the case of a Receive payment, this is the invoice paid to the user
|
|
6465
6554
|
*/ invoice: string;
|
|
6466
|
-
/**
|
|
6467
|
-
* The payment hash of the invoice
|
|
6468
|
-
*/ paymentHash: string;
|
|
6469
6555
|
/**
|
|
6470
6556
|
* The invoice destination/payee pubkey
|
|
6471
6557
|
*/ destinationPubkey: string;
|
|
6558
|
+
/**
|
|
6559
|
+
* The HTLC transfer details
|
|
6560
|
+
*/ htlcDetails: SparkHtlcDetails;
|
|
6472
6561
|
/**
|
|
6473
6562
|
* Lnurl payment information if this was an lnurl payment.
|
|
6474
6563
|
*/ lnurlPayInfo: LnurlPayInfo | undefined;
|
|
@@ -6482,10 +6571,9 @@ export declare const PaymentDetails: Readonly<{
|
|
|
6482
6571
|
readonly tag: PaymentDetails_Tags.Lightning;
|
|
6483
6572
|
readonly inner: Readonly<{
|
|
6484
6573
|
description: string | undefined;
|
|
6485
|
-
preimage: string | undefined;
|
|
6486
6574
|
invoice: string;
|
|
6487
|
-
paymentHash: string;
|
|
6488
6575
|
destinationPubkey: string;
|
|
6576
|
+
htlcDetails: SparkHtlcDetails;
|
|
6489
6577
|
lnurlPayInfo: LnurlPayInfo | undefined;
|
|
6490
6578
|
lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
|
|
6491
6579
|
lnurlReceiveMetadata: LnurlReceiveMetadata | undefined;
|
|
@@ -6500,20 +6588,17 @@ export declare const PaymentDetails: Readonly<{
|
|
|
6500
6588
|
/**
|
|
6501
6589
|
* Represents the invoice description
|
|
6502
6590
|
*/ description: string | undefined;
|
|
6503
|
-
/**
|
|
6504
|
-
* The preimage of the paid invoice (proof of payment).
|
|
6505
|
-
*/ preimage: string | undefined;
|
|
6506
6591
|
/**
|
|
6507
6592
|
* Represents the Bolt11/Bolt12 invoice associated with a payment
|
|
6508
6593
|
* In the case of a Send payment, this is the invoice paid by the user
|
|
6509
6594
|
* In the case of a Receive payment, this is the invoice paid to the user
|
|
6510
6595
|
*/ invoice: string;
|
|
6511
|
-
/**
|
|
6512
|
-
* The payment hash of the invoice
|
|
6513
|
-
*/ paymentHash: string;
|
|
6514
6596
|
/**
|
|
6515
6597
|
* The invoice destination/payee pubkey
|
|
6516
6598
|
*/ destinationPubkey: string;
|
|
6599
|
+
/**
|
|
6600
|
+
* The HTLC transfer details
|
|
6601
|
+
*/ htlcDetails: SparkHtlcDetails;
|
|
6517
6602
|
/**
|
|
6518
6603
|
* Lnurl payment information if this was an lnurl payment.
|
|
6519
6604
|
*/ lnurlPayInfo: LnurlPayInfo | undefined;
|
|
@@ -6527,10 +6612,9 @@ export declare const PaymentDetails: Readonly<{
|
|
|
6527
6612
|
readonly tag: PaymentDetails_Tags.Lightning;
|
|
6528
6613
|
readonly inner: Readonly<{
|
|
6529
6614
|
description: string | undefined;
|
|
6530
|
-
preimage: string | undefined;
|
|
6531
6615
|
invoice: string;
|
|
6532
|
-
paymentHash: string;
|
|
6533
6616
|
destinationPubkey: string;
|
|
6617
|
+
htlcDetails: SparkHtlcDetails;
|
|
6534
6618
|
lnurlPayInfo: LnurlPayInfo | undefined;
|
|
6535
6619
|
lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
|
|
6536
6620
|
lnurlReceiveMetadata: LnurlReceiveMetadata | undefined;
|
|
@@ -6545,10 +6629,9 @@ export declare const PaymentDetails: Readonly<{
|
|
|
6545
6629
|
readonly tag: PaymentDetails_Tags.Lightning;
|
|
6546
6630
|
readonly inner: Readonly<{
|
|
6547
6631
|
description: string | undefined;
|
|
6548
|
-
preimage: string | undefined;
|
|
6549
6632
|
invoice: string;
|
|
6550
|
-
paymentHash: string;
|
|
6551
6633
|
destinationPubkey: string;
|
|
6634
|
+
htlcDetails: SparkHtlcDetails;
|
|
6552
6635
|
lnurlPayInfo: LnurlPayInfo | undefined;
|
|
6553
6636
|
lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
|
|
6554
6637
|
lnurlReceiveMetadata: LnurlReceiveMetadata | undefined;
|
|
@@ -6642,7 +6725,8 @@ export declare const PaymentDetails: Readonly<{
|
|
|
6642
6725
|
export type PaymentDetails = InstanceType<(typeof PaymentDetails)[keyof Omit<typeof PaymentDetails, 'instanceOf'>]>;
|
|
6643
6726
|
export declare enum PaymentDetailsFilter_Tags {
|
|
6644
6727
|
Spark = "Spark",
|
|
6645
|
-
Token = "Token"
|
|
6728
|
+
Token = "Token",
|
|
6729
|
+
Lightning = "Lightning"
|
|
6646
6730
|
}
|
|
6647
6731
|
export declare const PaymentDetailsFilter: Readonly<{
|
|
6648
6732
|
instanceOf: (obj: any) => obj is PaymentDetailsFilter;
|
|
@@ -6759,6 +6843,49 @@ export declare const PaymentDetailsFilter: Readonly<{
|
|
|
6759
6843
|
readonly [uniffiTypeNameSymbol]: "PaymentDetailsFilter";
|
|
6760
6844
|
};
|
|
6761
6845
|
};
|
|
6846
|
+
Lightning: {
|
|
6847
|
+
new (inner: {
|
|
6848
|
+
/**
|
|
6849
|
+
* Filter specific Spark HTLC statuses
|
|
6850
|
+
*/ htlcStatus: Array<SparkHtlcStatus> | undefined;
|
|
6851
|
+
}): {
|
|
6852
|
+
readonly tag: PaymentDetailsFilter_Tags.Lightning;
|
|
6853
|
+
readonly inner: Readonly<{
|
|
6854
|
+
htlcStatus: Array<SparkHtlcStatus> | undefined;
|
|
6855
|
+
}>;
|
|
6856
|
+
/**
|
|
6857
|
+
* @private
|
|
6858
|
+
* This field is private and should not be used, use `tag` instead.
|
|
6859
|
+
*/
|
|
6860
|
+
readonly [uniffiTypeNameSymbol]: "PaymentDetailsFilter";
|
|
6861
|
+
};
|
|
6862
|
+
"new"(inner: {
|
|
6863
|
+
/**
|
|
6864
|
+
* Filter specific Spark HTLC statuses
|
|
6865
|
+
*/ htlcStatus: Array<SparkHtlcStatus> | undefined;
|
|
6866
|
+
}): {
|
|
6867
|
+
readonly tag: PaymentDetailsFilter_Tags.Lightning;
|
|
6868
|
+
readonly inner: Readonly<{
|
|
6869
|
+
htlcStatus: Array<SparkHtlcStatus> | undefined;
|
|
6870
|
+
}>;
|
|
6871
|
+
/**
|
|
6872
|
+
* @private
|
|
6873
|
+
* This field is private and should not be used, use `tag` instead.
|
|
6874
|
+
*/
|
|
6875
|
+
readonly [uniffiTypeNameSymbol]: "PaymentDetailsFilter";
|
|
6876
|
+
};
|
|
6877
|
+
instanceOf(obj: any): obj is {
|
|
6878
|
+
readonly tag: PaymentDetailsFilter_Tags.Lightning;
|
|
6879
|
+
readonly inner: Readonly<{
|
|
6880
|
+
htlcStatus: Array<SparkHtlcStatus> | undefined;
|
|
6881
|
+
}>;
|
|
6882
|
+
/**
|
|
6883
|
+
* @private
|
|
6884
|
+
* This field is private and should not be used, use `tag` instead.
|
|
6885
|
+
*/
|
|
6886
|
+
readonly [uniffiTypeNameSymbol]: "PaymentDetailsFilter";
|
|
6887
|
+
};
|
|
6888
|
+
};
|
|
6762
6889
|
}>;
|
|
6763
6890
|
export type PaymentDetailsFilter = InstanceType<(typeof PaymentDetailsFilter)[keyof Omit<typeof PaymentDetailsFilter, 'instanceOf'>]>;
|
|
6764
6891
|
export declare enum PaymentMethod {
|
|
@@ -7288,12 +7415,18 @@ export declare const ReceivePaymentMethod: Readonly<{
|
|
|
7288
7415
|
/**
|
|
7289
7416
|
* The expiry of the invoice as a duration in seconds
|
|
7290
7417
|
*/ expirySecs: /*u32*/ number | undefined;
|
|
7418
|
+
/**
|
|
7419
|
+
* If set, creates a HODL invoice with this payment hash (hex-encoded).
|
|
7420
|
+
* The payer's HTLC will be held until the preimage is provided via
|
|
7421
|
+
* `claim_htlc_payment` or the HTLC expires.
|
|
7422
|
+
*/ paymentHash: string | undefined;
|
|
7291
7423
|
}): {
|
|
7292
7424
|
readonly tag: ReceivePaymentMethod_Tags.Bolt11Invoice;
|
|
7293
7425
|
readonly inner: Readonly<{
|
|
7294
7426
|
description: string;
|
|
7295
7427
|
amountSats: /*u64*/ bigint | undefined;
|
|
7296
7428
|
expirySecs: /*u32*/ number | undefined;
|
|
7429
|
+
paymentHash: string | undefined;
|
|
7297
7430
|
}>;
|
|
7298
7431
|
/**
|
|
7299
7432
|
* @private
|
|
@@ -7307,12 +7440,18 @@ export declare const ReceivePaymentMethod: Readonly<{
|
|
|
7307
7440
|
/**
|
|
7308
7441
|
* The expiry of the invoice as a duration in seconds
|
|
7309
7442
|
*/ expirySecs: /*u32*/ number | undefined;
|
|
7443
|
+
/**
|
|
7444
|
+
* If set, creates a HODL invoice with this payment hash (hex-encoded).
|
|
7445
|
+
* The payer's HTLC will be held until the preimage is provided via
|
|
7446
|
+
* `claim_htlc_payment` or the HTLC expires.
|
|
7447
|
+
*/ paymentHash: string | undefined;
|
|
7310
7448
|
}): {
|
|
7311
7449
|
readonly tag: ReceivePaymentMethod_Tags.Bolt11Invoice;
|
|
7312
7450
|
readonly inner: Readonly<{
|
|
7313
7451
|
description: string;
|
|
7314
7452
|
amountSats: /*u64*/ bigint | undefined;
|
|
7315
7453
|
expirySecs: /*u32*/ number | undefined;
|
|
7454
|
+
paymentHash: string | undefined;
|
|
7316
7455
|
}>;
|
|
7317
7456
|
/**
|
|
7318
7457
|
* @private
|
|
@@ -7326,6 +7465,7 @@ export declare const ReceivePaymentMethod: Readonly<{
|
|
|
7326
7465
|
description: string;
|
|
7327
7466
|
amountSats: /*u64*/ bigint | undefined;
|
|
7328
7467
|
expirySecs: /*u32*/ number | undefined;
|
|
7468
|
+
paymentHash: string | undefined;
|
|
7329
7469
|
}>;
|
|
7330
7470
|
/**
|
|
7331
7471
|
* @private
|
|
@@ -12269,6 +12409,13 @@ export declare class PaymentObserverImpl extends UniffiAbstractObject implements
|
|
|
12269
12409
|
uniffiDestroy(): void;
|
|
12270
12410
|
static instanceOf(obj: any): obj is PaymentObserverImpl;
|
|
12271
12411
|
}
|
|
12412
|
+
/**
|
|
12413
|
+
* REST client trait for making HTTP requests.
|
|
12414
|
+
*
|
|
12415
|
+
* This trait provides a way for users to supply their own HTTP client implementation
|
|
12416
|
+
* for use with the SDK. The SDK will use this client for all HTTP operations including
|
|
12417
|
+
* LNURL flows and chain service requests.
|
|
12418
|
+
*/
|
|
12272
12419
|
export interface RestClient {
|
|
12273
12420
|
/**
|
|
12274
12421
|
* Makes a GET request and logs on DEBUG.
|
|
@@ -12300,6 +12447,13 @@ export interface RestClient {
|
|
|
12300
12447
|
signal: AbortSignal;
|
|
12301
12448
|
}): Promise<RestResponse>;
|
|
12302
12449
|
}
|
|
12450
|
+
/**
|
|
12451
|
+
* REST client trait for making HTTP requests.
|
|
12452
|
+
*
|
|
12453
|
+
* This trait provides a way for users to supply their own HTTP client implementation
|
|
12454
|
+
* for use with the SDK. The SDK will use this client for all HTTP operations including
|
|
12455
|
+
* LNURL flows and chain service requests.
|
|
12456
|
+
*/
|
|
12303
12457
|
export declare class RestClientImpl extends UniffiAbstractObject implements RestClient {
|
|
12304
12458
|
readonly [uniffiTypeNameSymbol] = "RestClientImpl";
|
|
12305
12459
|
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
@@ -14329,6 +14483,13 @@ declare const _default: Readonly<{
|
|
|
14329
14483
|
lift(value: UniffiByteArray): SparkStatus;
|
|
14330
14484
|
lower(value: SparkStatus): UniffiByteArray;
|
|
14331
14485
|
};
|
|
14486
|
+
FfiConverterTypeStableBalanceConfig: {
|
|
14487
|
+
read(from: RustBuffer): StableBalanceConfig;
|
|
14488
|
+
write(value: StableBalanceConfig, into: RustBuffer): void;
|
|
14489
|
+
allocationSize(value: StableBalanceConfig): number;
|
|
14490
|
+
lift(value: UniffiByteArray): StableBalanceConfig;
|
|
14491
|
+
lower(value: StableBalanceConfig): UniffiByteArray;
|
|
14492
|
+
};
|
|
14332
14493
|
FfiConverterTypeStorage: FfiConverterObjectWithCallbacks<Storage>;
|
|
14333
14494
|
FfiConverterTypeSuccessAction: {
|
|
14334
14495
|
read(from: RustBuffer): SuccessAction;
|