@breeztech/breez-sdk-spark-react-native 0.3.1 → 0.3.2
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 +556 -41
- package/cpp/generated/breez_sdk_spark.hpp +33 -7
- package/lib/commonjs/generated/breez_sdk_common.js +52 -1
- package/lib/commonjs/generated/breez_sdk_common.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +553 -20
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/generated/breez_sdk_common.js +51 -0
- package/lib/module/generated/breez_sdk_common.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +551 -18
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +44 -0
- package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +15 -2
- 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 +459 -6
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_common.d.ts +44 -0
- package/lib/typescript/module/src/generated/breez_sdk_common.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +15 -2
- 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 +459 -6
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/breez_sdk_common.ts +76 -0
- package/src/generated/breez_sdk_spark-ffi.ts +40 -2
- package/src/generated/breez_sdk_spark.ts +907 -70
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WaitForPaymentResponse = exports.WaitForPaymentRequest = exports.WaitForPaymentIdentifier_Tags = exports.WaitForPaymentIdentifier = exports.Utxo = exports.UpdateDepositPayload_Tags = exports.UpdateDepositPayload = exports.TxStatus = exports.TokenMetadata = exports.TokenBalance = exports.SyncWalletResponse = exports.SyncWalletRequest = exports.StorageImpl = exports.StorageError_Tags = exports.StorageError = exports.SendPaymentResponse = exports.SendPaymentRequest = exports.SendPaymentOptions_Tags = exports.SendPaymentOptions = exports.SendPaymentMethod_Tags = exports.SendPaymentMethod = exports.SendOnchainSpeedFeeQuote = exports.SendOnchainFeeQuote = exports.Seed_Tags = exports.Seed = exports.SdkEvent_Tags = exports.SdkEvent = exports.SdkError_Tags = exports.SdkError = exports.SdkBuilder = exports.RegisterLightningAddressRequest = exports.RefundDepositResponse = exports.RefundDepositRequest = exports.ReceivePaymentResponse = exports.ReceivePaymentRequest = exports.ReceivePaymentMethod_Tags = exports.ReceivePaymentMethod = exports.PrepareSendPaymentResponse = exports.PrepareSendPaymentRequest = exports.PrepareLnurlPayResponse = exports.PrepareLnurlPayRequest = exports.PaymentType = exports.PaymentStatus = exports.PaymentMethod = exports.PaymentMetadata = exports.PaymentDetails_Tags = exports.PaymentDetails = exports.Payment = exports.OnchainConfirmationSpeed = exports.Network = exports.LogEntry = exports.LnurlPayResponse = exports.LnurlPayRequest = exports.LnurlPayInfo = exports.ListUnclaimedDepositsResponse = exports.ListUnclaimedDepositsRequest = exports.ListPaymentsResponse = exports.ListPaymentsRequest = exports.ListFiatRatesResponse = exports.ListFiatCurrenciesResponse = exports.LightningAddressInfo = exports.KeySetType = exports.GetTokensMetadataResponse = exports.GetTokensMetadataRequest = exports.GetPaymentResponse = exports.GetPaymentRequest = exports.GetInfoResponse = exports.GetInfoRequest = exports.Fee_Tags = exports.Fee = exports.DepositInfo = exports.DepositClaimError_Tags = exports.DepositClaimError = exports.Credentials = exports.ConnectRequest = exports.Config = exports.ClaimDepositResponse = exports.ClaimDepositRequest = exports.CheckLightningAddressRequest = exports.ChainServiceError_Tags = exports.ChainServiceError = exports.BreezSdk = exports.BitcoinChainServiceImpl = exports.AssetFilter_Tags = exports.AssetFilter = void 0;
|
|
6
|
+
exports.WaitForPaymentResponse = exports.WaitForPaymentRequest = exports.WaitForPaymentIdentifier_Tags = exports.WaitForPaymentIdentifier = exports.Utxo = exports.UpdateDepositPayload_Tags = exports.UpdateDepositPayload = exports.TxStatus = exports.TokenMetadata = exports.TokenBalance = exports.SyncWalletResponse = exports.SyncWalletRequest = exports.StorageImpl = exports.StorageError_Tags = exports.StorageError = exports.SendPaymentResponse = exports.SendPaymentRequest = exports.SendPaymentOptions_Tags = exports.SendPaymentOptions = exports.SendPaymentMethod_Tags = exports.SendPaymentMethod = exports.SendOnchainSpeedFeeQuote = exports.SendOnchainFeeQuote = exports.Seed_Tags = exports.Seed = exports.SdkEvent_Tags = exports.SdkEvent = exports.SdkError_Tags = exports.SdkError = exports.SdkBuilder = exports.RegisterLightningAddressRequest = exports.RefundDepositResponse = exports.RefundDepositRequest = exports.ReceivePaymentResponse = exports.ReceivePaymentRequest = exports.ReceivePaymentMethod_Tags = exports.ReceivePaymentMethod = exports.ProvisionalPaymentDetails_Tags = exports.ProvisionalPaymentDetails = exports.ProvisionalPayment = exports.PrepareSendPaymentResponse = exports.PrepareSendPaymentRequest = exports.PrepareLnurlPayResponse = exports.PrepareLnurlPayRequest = exports.PaymentType = exports.PaymentStatus = exports.PaymentObserverImpl = exports.PaymentObserverError_Tags = exports.PaymentObserverError = exports.PaymentMethod = exports.PaymentMetadata = exports.PaymentDetails_Tags = exports.PaymentDetails = exports.Payment = exports.OnchainConfirmationSpeed = exports.Network = exports.LogEntry = exports.LnurlPayResponse = exports.LnurlPayRequest = exports.LnurlPayInfo = exports.ListUnclaimedDepositsResponse = exports.ListUnclaimedDepositsRequest = exports.ListPaymentsResponse = exports.ListPaymentsRequest = exports.ListFiatRatesResponse = exports.ListFiatCurrenciesResponse = exports.LightningAddressInfo = exports.KeySetType = exports.GetTokensMetadataResponse = exports.GetTokensMetadataRequest = exports.GetPaymentResponse = exports.GetPaymentRequest = exports.GetInfoResponse = exports.GetInfoRequest = exports.Fee_Tags = exports.Fee = exports.DepositInfo = exports.DepositClaimError_Tags = exports.DepositClaimError = exports.Credentials = exports.ConnectRequest = exports.Config = exports.ClaimDepositResponse = exports.ClaimDepositRequest = exports.CheckLightningAddressRequest = exports.ChainServiceError_Tags = exports.ChainServiceError = exports.BreezSdk = exports.BitcoinChainServiceImpl = exports.AssetFilter_Tags = exports.AssetFilter = void 0;
|
|
7
7
|
exports.connect = connect;
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
exports.defaultConfig = defaultConfig;
|
|
10
10
|
exports.defaultStorage = defaultStorage;
|
|
11
11
|
exports.initLogging = initLogging;
|
|
12
|
-
exports.parse = parse;
|
|
13
12
|
var _breez_sdk_sparkFfi = _interopRequireDefault(require("./breez_sdk_spark-ffi.js"));
|
|
14
13
|
var _uniffiBindgenReactNative = require("uniffi-bindgen-react-native");
|
|
15
14
|
var _breez_sdk_common = _interopRequireDefault(require("./breez_sdk_common.js"));
|
|
@@ -22,6 +21,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
22
21
|
const {
|
|
23
22
|
FfiConverterTypeBitcoinAddressDetails,
|
|
24
23
|
FfiConverterTypeBolt11InvoiceDetails,
|
|
24
|
+
FfiConverterTypeExternalInputParser,
|
|
25
25
|
FfiConverterTypeFiatCurrency,
|
|
26
26
|
FfiConverterTypeFiatService,
|
|
27
27
|
FfiConverterTypeInputType,
|
|
@@ -78,19 +78,6 @@ function initLogging(logDir, appLogger, logFilter) /*throws*/{
|
|
|
78
78
|
(0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_func_init_logging(FfiConverterOptionalString.lower(logDir), FfiConverterOptionalTypeLogger.lower(appLogger), FfiConverterOptionalString.lower(logFilter), callStatus);
|
|
79
79
|
}, /*liftString:*/FfiConverterString.lift);
|
|
80
80
|
}
|
|
81
|
-
async function parse(input, asyncOpts_) /*throws*/{
|
|
82
|
-
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
83
|
-
try {
|
|
84
|
-
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
85
|
-
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_func_parse(FfiConverterString.lower(input));
|
|
86
|
-
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeInputType.lift.bind(FfiConverterTypeInputType), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
87
|
-
} catch (__error) {
|
|
88
|
-
if (uniffiIsDebug && __error instanceof Error) {
|
|
89
|
-
__error.stack = __stack;
|
|
90
|
-
}
|
|
91
|
-
throw __error;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
81
|
|
|
95
82
|
/**
|
|
96
83
|
* Trait for event listeners
|
|
@@ -330,7 +317,9 @@ const FfiConverterTypeConfig = (() => {
|
|
|
330
317
|
syncIntervalSecs: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
|
|
331
318
|
maxDepositClaimFee: FfiConverterOptionalTypeFee.read(from),
|
|
332
319
|
lnurlDomain: FfiConverterOptionalString.read(from),
|
|
333
|
-
preferSparkOverLightning: _uniffiBindgenReactNative.FfiConverterBool.read(from)
|
|
320
|
+
preferSparkOverLightning: _uniffiBindgenReactNative.FfiConverterBool.read(from),
|
|
321
|
+
externalInputParsers: FfiConverterOptionalArrayTypeExternalInputParser.read(from),
|
|
322
|
+
useDefaultExternalInputParsers: _uniffiBindgenReactNative.FfiConverterBool.read(from)
|
|
334
323
|
};
|
|
335
324
|
}
|
|
336
325
|
write(value, into) {
|
|
@@ -340,9 +329,11 @@ const FfiConverterTypeConfig = (() => {
|
|
|
340
329
|
FfiConverterOptionalTypeFee.write(value.maxDepositClaimFee, into);
|
|
341
330
|
FfiConverterOptionalString.write(value.lnurlDomain, into);
|
|
342
331
|
_uniffiBindgenReactNative.FfiConverterBool.write(value.preferSparkOverLightning, into);
|
|
332
|
+
FfiConverterOptionalArrayTypeExternalInputParser.write(value.externalInputParsers, into);
|
|
333
|
+
_uniffiBindgenReactNative.FfiConverterBool.write(value.useDefaultExternalInputParsers, into);
|
|
343
334
|
}
|
|
344
335
|
allocationSize(value) {
|
|
345
|
-
return FfiConverterOptionalString.allocationSize(value.apiKey) + FfiConverterTypeNetwork.allocationSize(value.network) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.syncIntervalSecs) + FfiConverterOptionalTypeFee.allocationSize(value.maxDepositClaimFee) + FfiConverterOptionalString.allocationSize(value.lnurlDomain) + _uniffiBindgenReactNative.FfiConverterBool.allocationSize(value.preferSparkOverLightning);
|
|
336
|
+
return FfiConverterOptionalString.allocationSize(value.apiKey) + FfiConverterTypeNetwork.allocationSize(value.network) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.syncIntervalSecs) + FfiConverterOptionalTypeFee.allocationSize(value.maxDepositClaimFee) + FfiConverterOptionalString.allocationSize(value.lnurlDomain) + _uniffiBindgenReactNative.FfiConverterBool.allocationSize(value.preferSparkOverLightning) + FfiConverterOptionalArrayTypeExternalInputParser.allocationSize(value.externalInputParsers) + _uniffiBindgenReactNative.FfiConverterBool.allocationSize(value.useDefaultExternalInputParsers);
|
|
346
337
|
}
|
|
347
338
|
}
|
|
348
339
|
return new FFIConverter();
|
|
@@ -1561,6 +1552,51 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
|
|
|
1561
1552
|
}
|
|
1562
1553
|
return new FFIConverter();
|
|
1563
1554
|
})();
|
|
1555
|
+
/**
|
|
1556
|
+
* Generated factory for {@link ProvisionalPayment} record objects.
|
|
1557
|
+
*/
|
|
1558
|
+
const ProvisionalPayment = exports.ProvisionalPayment = (() => {
|
|
1559
|
+
const defaults = () => ({});
|
|
1560
|
+
const create = (() => {
|
|
1561
|
+
return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
|
|
1562
|
+
})();
|
|
1563
|
+
return Object.freeze({
|
|
1564
|
+
/**
|
|
1565
|
+
* Create a frozen instance of {@link ProvisionalPayment}, with defaults specified
|
|
1566
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
1567
|
+
*/
|
|
1568
|
+
create,
|
|
1569
|
+
/**
|
|
1570
|
+
* Create a frozen instance of {@link ProvisionalPayment}, with defaults specified
|
|
1571
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
1572
|
+
*/
|
|
1573
|
+
new: create,
|
|
1574
|
+
/**
|
|
1575
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
1576
|
+
*/
|
|
1577
|
+
defaults: () => Object.freeze(defaults())
|
|
1578
|
+
});
|
|
1579
|
+
})();
|
|
1580
|
+
const FfiConverterTypeProvisionalPayment = (() => {
|
|
1581
|
+
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
1582
|
+
read(from) {
|
|
1583
|
+
return {
|
|
1584
|
+
paymentId: FfiConverterString.read(from),
|
|
1585
|
+
amount: FfiConverterTypeu128.read(from),
|
|
1586
|
+
details: FfiConverterTypeProvisionalPaymentDetails.read(from)
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
write(value, into) {
|
|
1590
|
+
FfiConverterString.write(value.paymentId, into);
|
|
1591
|
+
FfiConverterTypeu128.write(value.amount, into);
|
|
1592
|
+
FfiConverterTypeProvisionalPaymentDetails.write(value.details, into);
|
|
1593
|
+
}
|
|
1594
|
+
allocationSize(value) {
|
|
1595
|
+
return FfiConverterString.allocationSize(value.paymentId) + FfiConverterTypeu128.allocationSize(value.amount) + FfiConverterTypeProvisionalPaymentDetails.allocationSize(value.details);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
return new FFIConverter();
|
|
1599
|
+
})();
|
|
1564
1600
|
/**
|
|
1565
1601
|
* Generated factory for {@link ReceivePaymentRequest} record objects.
|
|
1566
1602
|
*/
|
|
@@ -3321,6 +3357,131 @@ const FfiConverterTypePaymentMethod = (() => {
|
|
|
3321
3357
|
return new FFIConverter();
|
|
3322
3358
|
})();
|
|
3323
3359
|
|
|
3360
|
+
// Error type: PaymentObserverError
|
|
3361
|
+
|
|
3362
|
+
// Enum: PaymentObserverError
|
|
3363
|
+
let PaymentObserverError_Tags = exports.PaymentObserverError_Tags = /*#__PURE__*/function (PaymentObserverError_Tags) {
|
|
3364
|
+
PaymentObserverError_Tags["ServiceConnectivity"] = "ServiceConnectivity";
|
|
3365
|
+
PaymentObserverError_Tags["Generic"] = "Generic";
|
|
3366
|
+
return PaymentObserverError_Tags;
|
|
3367
|
+
}({});
|
|
3368
|
+
const PaymentObserverError = exports.PaymentObserverError = (() => {
|
|
3369
|
+
class ServiceConnectivity_ extends _uniffiBindgenReactNative.UniffiError {
|
|
3370
|
+
/**
|
|
3371
|
+
* @private
|
|
3372
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3373
|
+
*/
|
|
3374
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'PaymentObserverError';
|
|
3375
|
+
tag = PaymentObserverError_Tags.ServiceConnectivity;
|
|
3376
|
+
constructor(v0) {
|
|
3377
|
+
super('PaymentObserverError', 'ServiceConnectivity');
|
|
3378
|
+
this.inner = Object.freeze([v0]);
|
|
3379
|
+
}
|
|
3380
|
+
static new(v0) {
|
|
3381
|
+
return new ServiceConnectivity_(v0);
|
|
3382
|
+
}
|
|
3383
|
+
static instanceOf(obj) {
|
|
3384
|
+
return obj.tag === PaymentObserverError_Tags.ServiceConnectivity;
|
|
3385
|
+
}
|
|
3386
|
+
static hasInner(obj) {
|
|
3387
|
+
return ServiceConnectivity_.instanceOf(obj);
|
|
3388
|
+
}
|
|
3389
|
+
static getInner(obj) {
|
|
3390
|
+
return obj.inner;
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
class Generic_ extends _uniffiBindgenReactNative.UniffiError {
|
|
3394
|
+
/**
|
|
3395
|
+
* @private
|
|
3396
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3397
|
+
*/
|
|
3398
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'PaymentObserverError';
|
|
3399
|
+
tag = PaymentObserverError_Tags.Generic;
|
|
3400
|
+
constructor(v0) {
|
|
3401
|
+
super('PaymentObserverError', 'Generic');
|
|
3402
|
+
this.inner = Object.freeze([v0]);
|
|
3403
|
+
}
|
|
3404
|
+
static new(v0) {
|
|
3405
|
+
return new Generic_(v0);
|
|
3406
|
+
}
|
|
3407
|
+
static instanceOf(obj) {
|
|
3408
|
+
return obj.tag === PaymentObserverError_Tags.Generic;
|
|
3409
|
+
}
|
|
3410
|
+
static hasInner(obj) {
|
|
3411
|
+
return Generic_.instanceOf(obj);
|
|
3412
|
+
}
|
|
3413
|
+
static getInner(obj) {
|
|
3414
|
+
return obj.inner;
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
function instanceOf(obj) {
|
|
3418
|
+
return obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === 'PaymentObserverError';
|
|
3419
|
+
}
|
|
3420
|
+
return Object.freeze({
|
|
3421
|
+
instanceOf,
|
|
3422
|
+
ServiceConnectivity: ServiceConnectivity_,
|
|
3423
|
+
Generic: Generic_
|
|
3424
|
+
});
|
|
3425
|
+
})();
|
|
3426
|
+
// FfiConverter for enum PaymentObserverError
|
|
3427
|
+
const FfiConverterTypePaymentObserverError = (() => {
|
|
3428
|
+
const ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
3429
|
+
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
3430
|
+
read(from) {
|
|
3431
|
+
switch (ordinalConverter.read(from)) {
|
|
3432
|
+
case 1:
|
|
3433
|
+
return new PaymentObserverError.ServiceConnectivity(FfiConverterString.read(from));
|
|
3434
|
+
case 2:
|
|
3435
|
+
return new PaymentObserverError.Generic(FfiConverterString.read(from));
|
|
3436
|
+
default:
|
|
3437
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
write(value, into) {
|
|
3441
|
+
switch (value.tag) {
|
|
3442
|
+
case PaymentObserverError_Tags.ServiceConnectivity:
|
|
3443
|
+
{
|
|
3444
|
+
ordinalConverter.write(1, into);
|
|
3445
|
+
const inner = value.inner;
|
|
3446
|
+
FfiConverterString.write(inner[0], into);
|
|
3447
|
+
return;
|
|
3448
|
+
}
|
|
3449
|
+
case PaymentObserverError_Tags.Generic:
|
|
3450
|
+
{
|
|
3451
|
+
ordinalConverter.write(2, into);
|
|
3452
|
+
const inner = value.inner;
|
|
3453
|
+
FfiConverterString.write(inner[0], into);
|
|
3454
|
+
return;
|
|
3455
|
+
}
|
|
3456
|
+
default:
|
|
3457
|
+
// Throwing from here means that PaymentObserverError_Tags hasn't matched an ordinal.
|
|
3458
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
allocationSize(value) {
|
|
3462
|
+
switch (value.tag) {
|
|
3463
|
+
case PaymentObserverError_Tags.ServiceConnectivity:
|
|
3464
|
+
{
|
|
3465
|
+
const inner = value.inner;
|
|
3466
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3467
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3468
|
+
return size;
|
|
3469
|
+
}
|
|
3470
|
+
case PaymentObserverError_Tags.Generic:
|
|
3471
|
+
{
|
|
3472
|
+
const inner = value.inner;
|
|
3473
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3474
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3475
|
+
return size;
|
|
3476
|
+
}
|
|
3477
|
+
default:
|
|
3478
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
return new FFIConverter();
|
|
3483
|
+
})();
|
|
3484
|
+
|
|
3324
3485
|
/**
|
|
3325
3486
|
* The status of a payment
|
|
3326
3487
|
*/
|
|
@@ -3413,6 +3574,200 @@ const FfiConverterTypePaymentType = (() => {
|
|
|
3413
3574
|
return new FFIConverter();
|
|
3414
3575
|
})();
|
|
3415
3576
|
|
|
3577
|
+
// Enum: ProvisionalPaymentDetails
|
|
3578
|
+
let ProvisionalPaymentDetails_Tags = exports.ProvisionalPaymentDetails_Tags = /*#__PURE__*/function (ProvisionalPaymentDetails_Tags) {
|
|
3579
|
+
ProvisionalPaymentDetails_Tags["Bitcoin"] = "Bitcoin";
|
|
3580
|
+
ProvisionalPaymentDetails_Tags["Lightning"] = "Lightning";
|
|
3581
|
+
ProvisionalPaymentDetails_Tags["Spark"] = "Spark";
|
|
3582
|
+
ProvisionalPaymentDetails_Tags["Token"] = "Token";
|
|
3583
|
+
return ProvisionalPaymentDetails_Tags;
|
|
3584
|
+
}({});
|
|
3585
|
+
const ProvisionalPaymentDetails = exports.ProvisionalPaymentDetails = (() => {
|
|
3586
|
+
class Bitcoin_ extends _uniffiBindgenReactNative.UniffiEnum {
|
|
3587
|
+
/**
|
|
3588
|
+
* @private
|
|
3589
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3590
|
+
*/
|
|
3591
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'ProvisionalPaymentDetails';
|
|
3592
|
+
tag = ProvisionalPaymentDetails_Tags.Bitcoin;
|
|
3593
|
+
constructor(inner) {
|
|
3594
|
+
super('ProvisionalPaymentDetails', 'Bitcoin');
|
|
3595
|
+
this.inner = Object.freeze(inner);
|
|
3596
|
+
}
|
|
3597
|
+
static new(inner) {
|
|
3598
|
+
return new Bitcoin_(inner);
|
|
3599
|
+
}
|
|
3600
|
+
static instanceOf(obj) {
|
|
3601
|
+
return obj.tag === ProvisionalPaymentDetails_Tags.Bitcoin;
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
class Lightning_ extends _uniffiBindgenReactNative.UniffiEnum {
|
|
3605
|
+
/**
|
|
3606
|
+
* @private
|
|
3607
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3608
|
+
*/
|
|
3609
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'ProvisionalPaymentDetails';
|
|
3610
|
+
tag = ProvisionalPaymentDetails_Tags.Lightning;
|
|
3611
|
+
constructor(inner) {
|
|
3612
|
+
super('ProvisionalPaymentDetails', 'Lightning');
|
|
3613
|
+
this.inner = Object.freeze(inner);
|
|
3614
|
+
}
|
|
3615
|
+
static new(inner) {
|
|
3616
|
+
return new Lightning_(inner);
|
|
3617
|
+
}
|
|
3618
|
+
static instanceOf(obj) {
|
|
3619
|
+
return obj.tag === ProvisionalPaymentDetails_Tags.Lightning;
|
|
3620
|
+
}
|
|
3621
|
+
}
|
|
3622
|
+
class Spark_ extends _uniffiBindgenReactNative.UniffiEnum {
|
|
3623
|
+
/**
|
|
3624
|
+
* @private
|
|
3625
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3626
|
+
*/
|
|
3627
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'ProvisionalPaymentDetails';
|
|
3628
|
+
tag = ProvisionalPaymentDetails_Tags.Spark;
|
|
3629
|
+
constructor(inner) {
|
|
3630
|
+
super('ProvisionalPaymentDetails', 'Spark');
|
|
3631
|
+
this.inner = Object.freeze(inner);
|
|
3632
|
+
}
|
|
3633
|
+
static new(inner) {
|
|
3634
|
+
return new Spark_(inner);
|
|
3635
|
+
}
|
|
3636
|
+
static instanceOf(obj) {
|
|
3637
|
+
return obj.tag === ProvisionalPaymentDetails_Tags.Spark;
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
class Token_ extends _uniffiBindgenReactNative.UniffiEnum {
|
|
3641
|
+
/**
|
|
3642
|
+
* @private
|
|
3643
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3644
|
+
*/
|
|
3645
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'ProvisionalPaymentDetails';
|
|
3646
|
+
tag = ProvisionalPaymentDetails_Tags.Token;
|
|
3647
|
+
constructor(inner) {
|
|
3648
|
+
super('ProvisionalPaymentDetails', 'Token');
|
|
3649
|
+
this.inner = Object.freeze(inner);
|
|
3650
|
+
}
|
|
3651
|
+
static new(inner) {
|
|
3652
|
+
return new Token_(inner);
|
|
3653
|
+
}
|
|
3654
|
+
static instanceOf(obj) {
|
|
3655
|
+
return obj.tag === ProvisionalPaymentDetails_Tags.Token;
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
function instanceOf(obj) {
|
|
3659
|
+
return obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === 'ProvisionalPaymentDetails';
|
|
3660
|
+
}
|
|
3661
|
+
return Object.freeze({
|
|
3662
|
+
instanceOf,
|
|
3663
|
+
Bitcoin: Bitcoin_,
|
|
3664
|
+
Lightning: Lightning_,
|
|
3665
|
+
Spark: Spark_,
|
|
3666
|
+
Token: Token_
|
|
3667
|
+
});
|
|
3668
|
+
})();
|
|
3669
|
+
// FfiConverter for enum ProvisionalPaymentDetails
|
|
3670
|
+
const FfiConverterTypeProvisionalPaymentDetails = (() => {
|
|
3671
|
+
const ordinalConverter = _uniffiBindgenReactNative.FfiConverterInt32;
|
|
3672
|
+
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
3673
|
+
read(from) {
|
|
3674
|
+
switch (ordinalConverter.read(from)) {
|
|
3675
|
+
case 1:
|
|
3676
|
+
return new ProvisionalPaymentDetails.Bitcoin({
|
|
3677
|
+
withdrawalAddress: FfiConverterString.read(from)
|
|
3678
|
+
});
|
|
3679
|
+
case 2:
|
|
3680
|
+
return new ProvisionalPaymentDetails.Lightning({
|
|
3681
|
+
invoice: FfiConverterString.read(from)
|
|
3682
|
+
});
|
|
3683
|
+
case 3:
|
|
3684
|
+
return new ProvisionalPaymentDetails.Spark({
|
|
3685
|
+
receiverAddress: FfiConverterString.read(from)
|
|
3686
|
+
});
|
|
3687
|
+
case 4:
|
|
3688
|
+
return new ProvisionalPaymentDetails.Token({
|
|
3689
|
+
tokenId: FfiConverterString.read(from),
|
|
3690
|
+
receiverAddress: FfiConverterString.read(from)
|
|
3691
|
+
});
|
|
3692
|
+
default:
|
|
3693
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
write(value, into) {
|
|
3697
|
+
switch (value.tag) {
|
|
3698
|
+
case ProvisionalPaymentDetails_Tags.Bitcoin:
|
|
3699
|
+
{
|
|
3700
|
+
ordinalConverter.write(1, into);
|
|
3701
|
+
const inner = value.inner;
|
|
3702
|
+
FfiConverterString.write(inner.withdrawalAddress, into);
|
|
3703
|
+
return;
|
|
3704
|
+
}
|
|
3705
|
+
case ProvisionalPaymentDetails_Tags.Lightning:
|
|
3706
|
+
{
|
|
3707
|
+
ordinalConverter.write(2, into);
|
|
3708
|
+
const inner = value.inner;
|
|
3709
|
+
FfiConverterString.write(inner.invoice, into);
|
|
3710
|
+
return;
|
|
3711
|
+
}
|
|
3712
|
+
case ProvisionalPaymentDetails_Tags.Spark:
|
|
3713
|
+
{
|
|
3714
|
+
ordinalConverter.write(3, into);
|
|
3715
|
+
const inner = value.inner;
|
|
3716
|
+
FfiConverterString.write(inner.receiverAddress, into);
|
|
3717
|
+
return;
|
|
3718
|
+
}
|
|
3719
|
+
case ProvisionalPaymentDetails_Tags.Token:
|
|
3720
|
+
{
|
|
3721
|
+
ordinalConverter.write(4, into);
|
|
3722
|
+
const inner = value.inner;
|
|
3723
|
+
FfiConverterString.write(inner.tokenId, into);
|
|
3724
|
+
FfiConverterString.write(inner.receiverAddress, into);
|
|
3725
|
+
return;
|
|
3726
|
+
}
|
|
3727
|
+
default:
|
|
3728
|
+
// Throwing from here means that ProvisionalPaymentDetails_Tags hasn't matched an ordinal.
|
|
3729
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
allocationSize(value) {
|
|
3733
|
+
switch (value.tag) {
|
|
3734
|
+
case ProvisionalPaymentDetails_Tags.Bitcoin:
|
|
3735
|
+
{
|
|
3736
|
+
const inner = value.inner;
|
|
3737
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3738
|
+
size += FfiConverterString.allocationSize(inner.withdrawalAddress);
|
|
3739
|
+
return size;
|
|
3740
|
+
}
|
|
3741
|
+
case ProvisionalPaymentDetails_Tags.Lightning:
|
|
3742
|
+
{
|
|
3743
|
+
const inner = value.inner;
|
|
3744
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3745
|
+
size += FfiConverterString.allocationSize(inner.invoice);
|
|
3746
|
+
return size;
|
|
3747
|
+
}
|
|
3748
|
+
case ProvisionalPaymentDetails_Tags.Spark:
|
|
3749
|
+
{
|
|
3750
|
+
const inner = value.inner;
|
|
3751
|
+
let size = ordinalConverter.allocationSize(3);
|
|
3752
|
+
size += FfiConverterString.allocationSize(inner.receiverAddress);
|
|
3753
|
+
return size;
|
|
3754
|
+
}
|
|
3755
|
+
case ProvisionalPaymentDetails_Tags.Token:
|
|
3756
|
+
{
|
|
3757
|
+
const inner = value.inner;
|
|
3758
|
+
let size = ordinalConverter.allocationSize(4);
|
|
3759
|
+
size += FfiConverterString.allocationSize(inner.tokenId);
|
|
3760
|
+
size += FfiConverterString.allocationSize(inner.receiverAddress);
|
|
3761
|
+
return size;
|
|
3762
|
+
}
|
|
3763
|
+
default:
|
|
3764
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
return new FFIConverter();
|
|
3769
|
+
})();
|
|
3770
|
+
|
|
3416
3771
|
// Enum: ReceivePaymentMethod
|
|
3417
3772
|
let ReceivePaymentMethod_Tags = exports.ReceivePaymentMethod_Tags = /*#__PURE__*/function (ReceivePaymentMethod_Tags) {
|
|
3418
3773
|
ReceivePaymentMethod_Tags["SparkAddress"] = "SparkAddress";
|
|
@@ -5600,6 +5955,19 @@ class BreezSdk extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5600
5955
|
throw __error;
|
|
5601
5956
|
}
|
|
5602
5957
|
}
|
|
5958
|
+
async parse(input, asyncOpts_) /*throws*/{
|
|
5959
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5960
|
+
try {
|
|
5961
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5962
|
+
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_parse(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterString.lower(input));
|
|
5963
|
+
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeInputType.lift.bind(FfiConverterTypeInputType), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
5964
|
+
} catch (__error) {
|
|
5965
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5966
|
+
__error.stack = __stack;
|
|
5967
|
+
}
|
|
5968
|
+
throw __error;
|
|
5969
|
+
}
|
|
5970
|
+
}
|
|
5603
5971
|
async prepareLnurlPay(request, asyncOpts_) /*throws*/{
|
|
5604
5972
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5605
5973
|
try {
|
|
@@ -5785,6 +6153,133 @@ const uniffiTypeBreezSdkObjectFactory = {
|
|
|
5785
6153
|
// FfiConverter for BreezSdkInterface
|
|
5786
6154
|
const FfiConverterTypeBreezSdk = new _uniffiBindgenReactNative.FfiConverterObject(uniffiTypeBreezSdkObjectFactory);
|
|
5787
6155
|
|
|
6156
|
+
/**
|
|
6157
|
+
* This interface is used to observe outgoing payments before Lightning, Spark and onchain Bitcoin payments.
|
|
6158
|
+
* If the implementation returns an error, the payment is cancelled.
|
|
6159
|
+
*/
|
|
6160
|
+
|
|
6161
|
+
/**
|
|
6162
|
+
* This interface is used to observe outgoing payments before Lightning, Spark and onchain Bitcoin payments.
|
|
6163
|
+
* If the implementation returns an error, the payment is cancelled.
|
|
6164
|
+
*/
|
|
6165
|
+
class PaymentObserverImpl extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
6166
|
+
[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'PaymentObserverImpl';
|
|
6167
|
+
// No primary constructor declared for this class.
|
|
6168
|
+
constructor(pointer) {
|
|
6169
|
+
super();
|
|
6170
|
+
this[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
|
|
6171
|
+
this[_uniffiBindgenReactNative.destructorGuardSymbol] = uniffiTypePaymentObserverImplObjectFactory.bless(pointer);
|
|
6172
|
+
}
|
|
6173
|
+
|
|
6174
|
+
/**
|
|
6175
|
+
* Called before Lightning, Spark or onchain Bitcoin payments are made
|
|
6176
|
+
*/
|
|
6177
|
+
async beforeSend(payments, asyncOpts_) /*throws*/{
|
|
6178
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6179
|
+
try {
|
|
6180
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
6181
|
+
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send(uniffiTypePaymentObserverImplObjectFactory.clonePointer(this), FfiConverterArrayTypeProvisionalPayment.lower(payments));
|
|
6182
|
+
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_void, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_void, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_void, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypePaymentObserverError.lift.bind(FfiConverterTypePaymentObserverError));
|
|
6183
|
+
} catch (__error) {
|
|
6184
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6185
|
+
__error.stack = __stack;
|
|
6186
|
+
}
|
|
6187
|
+
throw __error;
|
|
6188
|
+
}
|
|
6189
|
+
}
|
|
6190
|
+
|
|
6191
|
+
/**
|
|
6192
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
6193
|
+
*/
|
|
6194
|
+
uniffiDestroy() {
|
|
6195
|
+
const ptr = this[_uniffiBindgenReactNative.destructorGuardSymbol];
|
|
6196
|
+
if (ptr !== undefined) {
|
|
6197
|
+
const pointer = uniffiTypePaymentObserverImplObjectFactory.pointer(this);
|
|
6198
|
+
uniffiTypePaymentObserverImplObjectFactory.freePointer(pointer);
|
|
6199
|
+
uniffiTypePaymentObserverImplObjectFactory.unbless(ptr);
|
|
6200
|
+
delete this[_uniffiBindgenReactNative.destructorGuardSymbol];
|
|
6201
|
+
}
|
|
6202
|
+
}
|
|
6203
|
+
static instanceOf(obj) {
|
|
6204
|
+
return uniffiTypePaymentObserverImplObjectFactory.isConcreteType(obj);
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
exports.PaymentObserverImpl = PaymentObserverImpl;
|
|
6208
|
+
const uniffiTypePaymentObserverImplObjectFactory = {
|
|
6209
|
+
create(pointer) {
|
|
6210
|
+
const instance = Object.create(PaymentObserverImpl.prototype);
|
|
6211
|
+
instance[_uniffiBindgenReactNative.pointerLiteralSymbol] = pointer;
|
|
6212
|
+
instance[_uniffiBindgenReactNative.destructorGuardSymbol] = this.bless(pointer);
|
|
6213
|
+
instance[_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'PaymentObserverImpl';
|
|
6214
|
+
return instance;
|
|
6215
|
+
},
|
|
6216
|
+
bless(p) {
|
|
6217
|
+
return uniffiCaller.rustCall(/*caller:*/status => (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_internal_fn_method_paymentobserver_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
|
|
6218
|
+
},
|
|
6219
|
+
unbless(ptr) {
|
|
6220
|
+
ptr.markDestroyed();
|
|
6221
|
+
},
|
|
6222
|
+
pointer(obj) {
|
|
6223
|
+
if (obj[_uniffiBindgenReactNative.destructorGuardSymbol] === undefined) {
|
|
6224
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedNullPointer();
|
|
6225
|
+
}
|
|
6226
|
+
return obj[_uniffiBindgenReactNative.pointerLiteralSymbol];
|
|
6227
|
+
},
|
|
6228
|
+
clonePointer(obj) {
|
|
6229
|
+
const pointer = this.pointer(obj);
|
|
6230
|
+
return uniffiCaller.rustCall(/*caller:*/callStatus => (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_clone_paymentobserver(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
6231
|
+
},
|
|
6232
|
+
freePointer(pointer) {
|
|
6233
|
+
uniffiCaller.rustCall(/*caller:*/callStatus => (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_free_paymentobserver(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
6234
|
+
},
|
|
6235
|
+
isConcreteType(obj) {
|
|
6236
|
+
return obj[_uniffiBindgenReactNative.destructorGuardSymbol] && obj[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === 'PaymentObserverImpl';
|
|
6237
|
+
}
|
|
6238
|
+
};
|
|
6239
|
+
// FfiConverter for PaymentObserver
|
|
6240
|
+
const FfiConverterTypePaymentObserver = new _uniffiBindgenReactNative.FfiConverterObjectWithCallbacks(uniffiTypePaymentObserverImplObjectFactory);
|
|
6241
|
+
|
|
6242
|
+
// Add a vtavble for the callbacks that go in PaymentObserver.
|
|
6243
|
+
|
|
6244
|
+
// Put the implementation in a struct so we don't pollute the top-level namespace
|
|
6245
|
+
const uniffiCallbackInterfacePaymentObserver = {
|
|
6246
|
+
// Create the VTable using a series of closures.
|
|
6247
|
+
// ts automatically converts these into C callback functions.
|
|
6248
|
+
vtable: {
|
|
6249
|
+
beforeSend: (uniffiHandle, payments, uniffiFutureCallback, uniffiCallbackData) => {
|
|
6250
|
+
const uniffiMakeCall = async signal => {
|
|
6251
|
+
const jsCallback = FfiConverterTypePaymentObserver.lift(uniffiHandle);
|
|
6252
|
+
return await jsCallback.beforeSend(FfiConverterArrayTypeProvisionalPayment.lift(payments), {
|
|
6253
|
+
signal
|
|
6254
|
+
});
|
|
6255
|
+
};
|
|
6256
|
+
const uniffiHandleSuccess = returnValue => {
|
|
6257
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructVoid */{
|
|
6258
|
+
callStatus: uniffiCaller.createCallStatus()
|
|
6259
|
+
});
|
|
6260
|
+
};
|
|
6261
|
+
const uniffiHandleError = (code, errorBuf) => {
|
|
6262
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructVoid */{
|
|
6263
|
+
// TODO create callstatus with error.
|
|
6264
|
+
callStatus: {
|
|
6265
|
+
code,
|
|
6266
|
+
errorBuf
|
|
6267
|
+
}
|
|
6268
|
+
});
|
|
6269
|
+
};
|
|
6270
|
+
const uniffiForeignFuture = (0, _uniffiBindgenReactNative.uniffiTraitInterfaceCallAsyncWithError)(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/PaymentObserverError.instanceOf, /*lowerError:*/FfiConverterTypePaymentObserverError.lower.bind(FfiConverterTypePaymentObserverError), /*lowerString:*/FfiConverterString.lower);
|
|
6271
|
+
return _uniffiBindgenReactNative.UniffiResult.success(uniffiForeignFuture);
|
|
6272
|
+
},
|
|
6273
|
+
uniffiFree: uniffiHandle => {
|
|
6274
|
+
// PaymentObserver: this will throw a stale handle error if the handle isn't found.
|
|
6275
|
+
FfiConverterTypePaymentObserver.drop(uniffiHandle);
|
|
6276
|
+
}
|
|
6277
|
+
},
|
|
6278
|
+
register: () => {
|
|
6279
|
+
(0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver(uniffiCallbackInterfacePaymentObserver.vtable);
|
|
6280
|
+
}
|
|
6281
|
+
};
|
|
6282
|
+
|
|
5788
6283
|
/**
|
|
5789
6284
|
* Builder for creating `BreezSdk` instances with customizable components.
|
|
5790
6285
|
*/
|
|
@@ -5898,6 +6393,25 @@ class SdkBuilder extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5898
6393
|
}
|
|
5899
6394
|
}
|
|
5900
6395
|
|
|
6396
|
+
/**
|
|
6397
|
+
* Sets the payment observer to be used by the SDK.
|
|
6398
|
+
* Arguments:
|
|
6399
|
+
* - `payment_observer`: The payment observer to be used.
|
|
6400
|
+
*/
|
|
6401
|
+
async withPaymentObserver(paymentObserver, asyncOpts_) {
|
|
6402
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6403
|
+
try {
|
|
6404
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
6405
|
+
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(uniffiTypeSdkBuilderObjectFactory.clonePointer(this), FfiConverterTypePaymentObserver.lower(paymentObserver));
|
|
6406
|
+
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_void, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_void, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_void, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_);
|
|
6407
|
+
} catch (__error) {
|
|
6408
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6409
|
+
__error.stack = __stack;
|
|
6410
|
+
}
|
|
6411
|
+
throw __error;
|
|
6412
|
+
}
|
|
6413
|
+
}
|
|
6414
|
+
|
|
5901
6415
|
/**
|
|
5902
6416
|
* Sets the REST chain service to be used by the SDK.
|
|
5903
6417
|
* Arguments:
|
|
@@ -6643,6 +7157,9 @@ const FfiConverterOptionalUInt32 = new _uniffiBindgenReactNative.FfiConverterOpt
|
|
|
6643
7157
|
// FfiConverter for /*u64*/bigint | undefined
|
|
6644
7158
|
const FfiConverterOptionalUInt64 = new _uniffiBindgenReactNative.FfiConverterOptional(_uniffiBindgenReactNative.FfiConverterUInt64);
|
|
6645
7159
|
|
|
7160
|
+
// FfiConverter for Array<ExternalInputParser>
|
|
7161
|
+
const FfiConverterArrayTypeExternalInputParser = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeExternalInputParser);
|
|
7162
|
+
|
|
6646
7163
|
// FfiConverter for Array<FiatCurrency>
|
|
6647
7164
|
const FfiConverterArrayTypeFiatCurrency = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeFiatCurrency);
|
|
6648
7165
|
|
|
@@ -6655,6 +7172,9 @@ const FfiConverterArrayTypeDepositInfo = new _uniffiBindgenReactNative.FfiConver
|
|
|
6655
7172
|
// FfiConverter for Array<Payment>
|
|
6656
7173
|
const FfiConverterArrayTypePayment = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypePayment);
|
|
6657
7174
|
|
|
7175
|
+
// FfiConverter for Array<ProvisionalPayment>
|
|
7176
|
+
const FfiConverterArrayTypeProvisionalPayment = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeProvisionalPayment);
|
|
7177
|
+
|
|
6658
7178
|
// FfiConverter for Array<TokenMetadata>
|
|
6659
7179
|
const FfiConverterArrayTypeTokenMetadata = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTokenMetadata);
|
|
6660
7180
|
|
|
@@ -6682,6 +7202,9 @@ const FfiConverterOptionalTypePaymentDetails = new _uniffiBindgenReactNative.Ffi
|
|
|
6682
7202
|
// FfiConverter for SendPaymentOptions | undefined
|
|
6683
7203
|
const FfiConverterOptionalTypeSendPaymentOptions = new _uniffiBindgenReactNative.FfiConverterOptional(FfiConverterTypeSendPaymentOptions);
|
|
6684
7204
|
|
|
7205
|
+
// FfiConverter for Array<ExternalInputParser> | undefined
|
|
7206
|
+
const FfiConverterOptionalArrayTypeExternalInputParser = new _uniffiBindgenReactNative.FfiConverterOptional(FfiConverterArrayTypeExternalInputParser);
|
|
7207
|
+
|
|
6685
7208
|
// FfiConverter for Array<PaymentStatus>
|
|
6686
7209
|
const FfiConverterArrayTypePaymentStatus = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypePaymentStatus);
|
|
6687
7210
|
|
|
@@ -6724,9 +7247,6 @@ function uniffiEnsureInitialized() {
|
|
|
6724
7247
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_func_init_logging() !== 8518) {
|
|
6725
7248
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_func_init_logging');
|
|
6726
7249
|
}
|
|
6727
|
-
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_func_parse() !== 58372) {
|
|
6728
|
-
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_func_parse');
|
|
6729
|
-
}
|
|
6730
7250
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos() !== 20959) {
|
|
6731
7251
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos');
|
|
6732
7252
|
}
|
|
@@ -6781,6 +7301,9 @@ function uniffiEnsureInitialized() {
|
|
|
6781
7301
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() !== 10147) {
|
|
6782
7302
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay');
|
|
6783
7303
|
}
|
|
7304
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_parse() !== 195) {
|
|
7305
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_parse');
|
|
7306
|
+
}
|
|
6784
7307
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() !== 37691) {
|
|
6785
7308
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay');
|
|
6786
7309
|
}
|
|
@@ -6808,6 +7331,9 @@ function uniffiEnsureInitialized() {
|
|
|
6808
7331
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() !== 64922) {
|
|
6809
7332
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment');
|
|
6810
7333
|
}
|
|
7334
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send() !== 30686) {
|
|
7335
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send');
|
|
7336
|
+
}
|
|
6811
7337
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build() !== 8126) {
|
|
6812
7338
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build');
|
|
6813
7339
|
}
|
|
@@ -6823,6 +7349,9 @@ function uniffiEnsureInitialized() {
|
|
|
6823
7349
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() !== 61720) {
|
|
6824
7350
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client');
|
|
6825
7351
|
}
|
|
7352
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer() !== 21617) {
|
|
7353
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer');
|
|
7354
|
+
}
|
|
6826
7355
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service() !== 56288) {
|
|
6827
7356
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service');
|
|
6828
7357
|
}
|
|
@@ -6874,6 +7403,7 @@ function uniffiEnsureInitialized() {
|
|
|
6874
7403
|
uniffiCallbackInterfaceEventListener.register();
|
|
6875
7404
|
uniffiCallbackInterfaceLogger.register();
|
|
6876
7405
|
uniffiCallbackInterfaceBitcoinChainService.register();
|
|
7406
|
+
uniffiCallbackInterfacePaymentObserver.register();
|
|
6877
7407
|
uniffiCallbackInterfaceStorage.register();
|
|
6878
7408
|
}
|
|
6879
7409
|
var _default = exports.default = Object.freeze({
|
|
@@ -6915,12 +7445,15 @@ var _default = exports.default = Object.freeze({
|
|
|
6915
7445
|
FfiConverterTypePaymentDetails,
|
|
6916
7446
|
FfiConverterTypePaymentMetadata,
|
|
6917
7447
|
FfiConverterTypePaymentMethod,
|
|
7448
|
+
FfiConverterTypePaymentObserver,
|
|
6918
7449
|
FfiConverterTypePaymentStatus,
|
|
6919
7450
|
FfiConverterTypePaymentType,
|
|
6920
7451
|
FfiConverterTypePrepareLnurlPayRequest,
|
|
6921
7452
|
FfiConverterTypePrepareLnurlPayResponse,
|
|
6922
7453
|
FfiConverterTypePrepareSendPaymentRequest,
|
|
6923
7454
|
FfiConverterTypePrepareSendPaymentResponse,
|
|
7455
|
+
FfiConverterTypeProvisionalPayment,
|
|
7456
|
+
FfiConverterTypeProvisionalPaymentDetails,
|
|
6924
7457
|
FfiConverterTypeReceivePaymentMethod,
|
|
6925
7458
|
FfiConverterTypeReceivePaymentRequest,
|
|
6926
7459
|
FfiConverterTypeReceivePaymentResponse,
|