@breeztech/breez-sdk-spark-react-native 0.7.2 → 0.7.4
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 +385 -129
- package/cpp/generated/breez_sdk_spark.hpp +15 -2
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +226 -71
- 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 +225 -70
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +29 -23
- 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 +729 -250
- 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 +29 -23
- 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 +729 -250
- 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-ffi.ts +40 -21
- package/src/generated/breez_sdk_spark.ts +1397 -532
|
@@ -2116,6 +2116,253 @@ const FfiConverterTypeConnectWithSignerRequest = (() => {
|
|
|
2116
2116
|
return new FFIConverter();
|
|
2117
2117
|
})();
|
|
2118
2118
|
|
|
2119
|
+
/**
|
|
2120
|
+
* Response from estimating a conversion, used when preparing a payment that requires conversion
|
|
2121
|
+
*/
|
|
2122
|
+
export type ConversionEstimate = {
|
|
2123
|
+
/**
|
|
2124
|
+
* The conversion options used for the estimate
|
|
2125
|
+
*/
|
|
2126
|
+
options: ConversionOptions;
|
|
2127
|
+
/**
|
|
2128
|
+
* The estimated amount to be received from the conversion
|
|
2129
|
+
* Denominated in satoshis if converting from Bitcoin, otherwise in the token base units.
|
|
2130
|
+
*/
|
|
2131
|
+
amount: U128;
|
|
2132
|
+
/**
|
|
2133
|
+
* The fee estimated for the conversion
|
|
2134
|
+
* Denominated in satoshis if converting from Bitcoin, otherwise in the token base units.
|
|
2135
|
+
*/
|
|
2136
|
+
fee: U128;
|
|
2137
|
+
};
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* Generated factory for {@link ConversionEstimate} record objects.
|
|
2141
|
+
*/
|
|
2142
|
+
export const ConversionEstimate = (() => {
|
|
2143
|
+
const defaults = () => ({});
|
|
2144
|
+
const create = (() => {
|
|
2145
|
+
return uniffiCreateRecord<ConversionEstimate, ReturnType<typeof defaults>>(
|
|
2146
|
+
defaults
|
|
2147
|
+
);
|
|
2148
|
+
})();
|
|
2149
|
+
return Object.freeze({
|
|
2150
|
+
/**
|
|
2151
|
+
* Create a frozen instance of {@link ConversionEstimate}, with defaults specified
|
|
2152
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2153
|
+
*/
|
|
2154
|
+
create,
|
|
2155
|
+
|
|
2156
|
+
/**
|
|
2157
|
+
* Create a frozen instance of {@link ConversionEstimate}, with defaults specified
|
|
2158
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2159
|
+
*/
|
|
2160
|
+
new: create,
|
|
2161
|
+
|
|
2162
|
+
/**
|
|
2163
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
2164
|
+
*/
|
|
2165
|
+
defaults: () => Object.freeze(defaults()) as Partial<ConversionEstimate>,
|
|
2166
|
+
});
|
|
2167
|
+
})();
|
|
2168
|
+
|
|
2169
|
+
const FfiConverterTypeConversionEstimate = (() => {
|
|
2170
|
+
type TypeName = ConversionEstimate;
|
|
2171
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2172
|
+
read(from: RustBuffer): TypeName {
|
|
2173
|
+
return {
|
|
2174
|
+
options: FfiConverterTypeConversionOptions.read(from),
|
|
2175
|
+
amount: FfiConverterTypeu128.read(from),
|
|
2176
|
+
fee: FfiConverterTypeu128.read(from),
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
2180
|
+
FfiConverterTypeConversionOptions.write(value.options, into);
|
|
2181
|
+
FfiConverterTypeu128.write(value.amount, into);
|
|
2182
|
+
FfiConverterTypeu128.write(value.fee, into);
|
|
2183
|
+
}
|
|
2184
|
+
allocationSize(value: TypeName): number {
|
|
2185
|
+
return (
|
|
2186
|
+
FfiConverterTypeConversionOptions.allocationSize(value.options) +
|
|
2187
|
+
FfiConverterTypeu128.allocationSize(value.amount) +
|
|
2188
|
+
FfiConverterTypeu128.allocationSize(value.fee)
|
|
2189
|
+
);
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
return new FFIConverter();
|
|
2193
|
+
})();
|
|
2194
|
+
|
|
2195
|
+
export type ConversionInfo = {
|
|
2196
|
+
/**
|
|
2197
|
+
* The pool id associated with the conversion
|
|
2198
|
+
*/
|
|
2199
|
+
poolId: string;
|
|
2200
|
+
/**
|
|
2201
|
+
* The conversion id shared by both sides of the conversion
|
|
2202
|
+
*/
|
|
2203
|
+
conversionId: string;
|
|
2204
|
+
/**
|
|
2205
|
+
* The status of the conversion
|
|
2206
|
+
*/
|
|
2207
|
+
status: ConversionStatus;
|
|
2208
|
+
/**
|
|
2209
|
+
* The fee paid for the conversion
|
|
2210
|
+
* Denominated in satoshis if converting from Bitcoin, otherwise in the token base units.
|
|
2211
|
+
*/
|
|
2212
|
+
fee: U128 | undefined;
|
|
2213
|
+
/**
|
|
2214
|
+
* The purpose of the conversion
|
|
2215
|
+
*/
|
|
2216
|
+
purpose: ConversionPurpose | undefined;
|
|
2217
|
+
};
|
|
2218
|
+
|
|
2219
|
+
/**
|
|
2220
|
+
* Generated factory for {@link ConversionInfo} record objects.
|
|
2221
|
+
*/
|
|
2222
|
+
export const ConversionInfo = (() => {
|
|
2223
|
+
const defaults = () => ({});
|
|
2224
|
+
const create = (() => {
|
|
2225
|
+
return uniffiCreateRecord<ConversionInfo, ReturnType<typeof defaults>>(
|
|
2226
|
+
defaults
|
|
2227
|
+
);
|
|
2228
|
+
})();
|
|
2229
|
+
return Object.freeze({
|
|
2230
|
+
/**
|
|
2231
|
+
* Create a frozen instance of {@link ConversionInfo}, with defaults specified
|
|
2232
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2233
|
+
*/
|
|
2234
|
+
create,
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* Create a frozen instance of {@link ConversionInfo}, with defaults specified
|
|
2238
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2239
|
+
*/
|
|
2240
|
+
new: create,
|
|
2241
|
+
|
|
2242
|
+
/**
|
|
2243
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
2244
|
+
*/
|
|
2245
|
+
defaults: () => Object.freeze(defaults()) as Partial<ConversionInfo>,
|
|
2246
|
+
});
|
|
2247
|
+
})();
|
|
2248
|
+
|
|
2249
|
+
const FfiConverterTypeConversionInfo = (() => {
|
|
2250
|
+
type TypeName = ConversionInfo;
|
|
2251
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2252
|
+
read(from: RustBuffer): TypeName {
|
|
2253
|
+
return {
|
|
2254
|
+
poolId: FfiConverterString.read(from),
|
|
2255
|
+
conversionId: FfiConverterString.read(from),
|
|
2256
|
+
status: FfiConverterTypeConversionStatus.read(from),
|
|
2257
|
+
fee: FfiConverterOptionalTypeu128.read(from),
|
|
2258
|
+
purpose: FfiConverterOptionalTypeConversionPurpose.read(from),
|
|
2259
|
+
};
|
|
2260
|
+
}
|
|
2261
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
2262
|
+
FfiConverterString.write(value.poolId, into);
|
|
2263
|
+
FfiConverterString.write(value.conversionId, into);
|
|
2264
|
+
FfiConverterTypeConversionStatus.write(value.status, into);
|
|
2265
|
+
FfiConverterOptionalTypeu128.write(value.fee, into);
|
|
2266
|
+
FfiConverterOptionalTypeConversionPurpose.write(value.purpose, into);
|
|
2267
|
+
}
|
|
2268
|
+
allocationSize(value: TypeName): number {
|
|
2269
|
+
return (
|
|
2270
|
+
FfiConverterString.allocationSize(value.poolId) +
|
|
2271
|
+
FfiConverterString.allocationSize(value.conversionId) +
|
|
2272
|
+
FfiConverterTypeConversionStatus.allocationSize(value.status) +
|
|
2273
|
+
FfiConverterOptionalTypeu128.allocationSize(value.fee) +
|
|
2274
|
+
FfiConverterOptionalTypeConversionPurpose.allocationSize(value.purpose)
|
|
2275
|
+
);
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
return new FFIConverter();
|
|
2279
|
+
})();
|
|
2280
|
+
|
|
2281
|
+
/**
|
|
2282
|
+
* Options for conversion when fulfilling a payment. When set, the SDK will
|
|
2283
|
+
* perform a conversion before fulfilling the payment. If not set, the payment
|
|
2284
|
+
* will only be fulfilled if the wallet has sufficient balance of the required asset.
|
|
2285
|
+
*/
|
|
2286
|
+
export type ConversionOptions = {
|
|
2287
|
+
/**
|
|
2288
|
+
* The type of conversion to perform when fulfilling the payment
|
|
2289
|
+
*/
|
|
2290
|
+
conversionType: ConversionType;
|
|
2291
|
+
/**
|
|
2292
|
+
* The optional maximum slippage in basis points (1/100 of a percent) allowed when
|
|
2293
|
+
* a conversion is needed to fulfill the payment. Defaults to 50 bps (0.5%) if not set.
|
|
2294
|
+
* The conversion will fail if the actual amount received is less than
|
|
2295
|
+
* `estimated_amount * (1 - max_slippage_bps / 10_000)`.
|
|
2296
|
+
*/
|
|
2297
|
+
maxSlippageBps: /*u32*/ number | undefined;
|
|
2298
|
+
/**
|
|
2299
|
+
* The optional timeout in seconds to wait for the conversion to complete
|
|
2300
|
+
* when fulfilling the payment. This timeout only concerns waiting for the received
|
|
2301
|
+
* payment of the conversion. If the timeout is reached before the conversion
|
|
2302
|
+
* is complete, the payment will fail. Defaults to 30 seconds if not set.
|
|
2303
|
+
*/
|
|
2304
|
+
completionTimeoutSecs: /*u32*/ number | undefined;
|
|
2305
|
+
};
|
|
2306
|
+
|
|
2307
|
+
/**
|
|
2308
|
+
* Generated factory for {@link ConversionOptions} record objects.
|
|
2309
|
+
*/
|
|
2310
|
+
export const ConversionOptions = (() => {
|
|
2311
|
+
const defaults = () => ({
|
|
2312
|
+
maxSlippageBps: undefined,
|
|
2313
|
+
completionTimeoutSecs: undefined,
|
|
2314
|
+
});
|
|
2315
|
+
const create = (() => {
|
|
2316
|
+
return uniffiCreateRecord<ConversionOptions, ReturnType<typeof defaults>>(
|
|
2317
|
+
defaults
|
|
2318
|
+
);
|
|
2319
|
+
})();
|
|
2320
|
+
return Object.freeze({
|
|
2321
|
+
/**
|
|
2322
|
+
* Create a frozen instance of {@link ConversionOptions}, with defaults specified
|
|
2323
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2324
|
+
*/
|
|
2325
|
+
create,
|
|
2326
|
+
|
|
2327
|
+
/**
|
|
2328
|
+
* Create a frozen instance of {@link ConversionOptions}, with defaults specified
|
|
2329
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
2330
|
+
*/
|
|
2331
|
+
new: create,
|
|
2332
|
+
|
|
2333
|
+
/**
|
|
2334
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
2335
|
+
*/
|
|
2336
|
+
defaults: () => Object.freeze(defaults()) as Partial<ConversionOptions>,
|
|
2337
|
+
});
|
|
2338
|
+
})();
|
|
2339
|
+
|
|
2340
|
+
const FfiConverterTypeConversionOptions = (() => {
|
|
2341
|
+
type TypeName = ConversionOptions;
|
|
2342
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2343
|
+
read(from: RustBuffer): TypeName {
|
|
2344
|
+
return {
|
|
2345
|
+
conversionType: FfiConverterTypeConversionType.read(from),
|
|
2346
|
+
maxSlippageBps: FfiConverterOptionalUInt32.read(from),
|
|
2347
|
+
completionTimeoutSecs: FfiConverterOptionalUInt32.read(from),
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
2351
|
+
FfiConverterTypeConversionType.write(value.conversionType, into);
|
|
2352
|
+
FfiConverterOptionalUInt32.write(value.maxSlippageBps, into);
|
|
2353
|
+
FfiConverterOptionalUInt32.write(value.completionTimeoutSecs, into);
|
|
2354
|
+
}
|
|
2355
|
+
allocationSize(value: TypeName): number {
|
|
2356
|
+
return (
|
|
2357
|
+
FfiConverterTypeConversionType.allocationSize(value.conversionType) +
|
|
2358
|
+
FfiConverterOptionalUInt32.allocationSize(value.maxSlippageBps) +
|
|
2359
|
+
FfiConverterOptionalUInt32.allocationSize(value.completionTimeoutSecs)
|
|
2360
|
+
);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
return new FFIConverter();
|
|
2364
|
+
})();
|
|
2365
|
+
|
|
2119
2366
|
export type CreateIssuerTokenRequest = {
|
|
2120
2367
|
name: string;
|
|
2121
2368
|
ticker: string;
|
|
@@ -3441,11 +3688,11 @@ const FfiConverterTypeExternalVerifiableSecretShare = (() => {
|
|
|
3441
3688
|
return new FFIConverter();
|
|
3442
3689
|
})();
|
|
3443
3690
|
|
|
3444
|
-
export type
|
|
3691
|
+
export type FetchConversionLimitsRequest = {
|
|
3445
3692
|
/**
|
|
3446
3693
|
* The type of conversion, either from or to Bitcoin.
|
|
3447
3694
|
*/
|
|
3448
|
-
conversionType:
|
|
3695
|
+
conversionType: ConversionType;
|
|
3449
3696
|
/**
|
|
3450
3697
|
* The token identifier when converting to a token.
|
|
3451
3698
|
*/
|
|
@@ -3453,25 +3700,25 @@ export type FetchTokenConversionLimitsRequest = {
|
|
|
3453
3700
|
};
|
|
3454
3701
|
|
|
3455
3702
|
/**
|
|
3456
|
-
* Generated factory for {@link
|
|
3703
|
+
* Generated factory for {@link FetchConversionLimitsRequest} record objects.
|
|
3457
3704
|
*/
|
|
3458
|
-
export const
|
|
3705
|
+
export const FetchConversionLimitsRequest = (() => {
|
|
3459
3706
|
const defaults = () => ({ tokenIdentifier: undefined });
|
|
3460
3707
|
const create = (() => {
|
|
3461
3708
|
return uniffiCreateRecord<
|
|
3462
|
-
|
|
3709
|
+
FetchConversionLimitsRequest,
|
|
3463
3710
|
ReturnType<typeof defaults>
|
|
3464
3711
|
>(defaults);
|
|
3465
3712
|
})();
|
|
3466
3713
|
return Object.freeze({
|
|
3467
3714
|
/**
|
|
3468
|
-
* Create a frozen instance of {@link
|
|
3715
|
+
* Create a frozen instance of {@link FetchConversionLimitsRequest}, with defaults specified
|
|
3469
3716
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
3470
3717
|
*/
|
|
3471
3718
|
create,
|
|
3472
3719
|
|
|
3473
3720
|
/**
|
|
3474
|
-
* Create a frozen instance of {@link
|
|
3721
|
+
* Create a frozen instance of {@link FetchConversionLimitsRequest}, with defaults specified
|
|
3475
3722
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
3476
3723
|
*/
|
|
3477
3724
|
new: create,
|
|
@@ -3480,35 +3727,34 @@ export const FetchTokenConversionLimitsRequest = (() => {
|
|
|
3480
3727
|
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
3481
3728
|
*/
|
|
3482
3729
|
defaults: () =>
|
|
3483
|
-
Object.freeze(defaults()) as Partial<
|
|
3730
|
+
Object.freeze(defaults()) as Partial<FetchConversionLimitsRequest>,
|
|
3484
3731
|
});
|
|
3485
3732
|
})();
|
|
3486
3733
|
|
|
3487
|
-
const
|
|
3488
|
-
type TypeName =
|
|
3734
|
+
const FfiConverterTypeFetchConversionLimitsRequest = (() => {
|
|
3735
|
+
type TypeName = FetchConversionLimitsRequest;
|
|
3489
3736
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
3490
3737
|
read(from: RustBuffer): TypeName {
|
|
3491
3738
|
return {
|
|
3492
|
-
conversionType:
|
|
3739
|
+
conversionType: FfiConverterTypeConversionType.read(from),
|
|
3493
3740
|
tokenIdentifier: FfiConverterOptionalString.read(from),
|
|
3494
3741
|
};
|
|
3495
3742
|
}
|
|
3496
3743
|
write(value: TypeName, into: RustBuffer): void {
|
|
3497
|
-
|
|
3744
|
+
FfiConverterTypeConversionType.write(value.conversionType, into);
|
|
3498
3745
|
FfiConverterOptionalString.write(value.tokenIdentifier, into);
|
|
3499
3746
|
}
|
|
3500
3747
|
allocationSize(value: TypeName): number {
|
|
3501
3748
|
return (
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
) + FfiConverterOptionalString.allocationSize(value.tokenIdentifier)
|
|
3749
|
+
FfiConverterTypeConversionType.allocationSize(value.conversionType) +
|
|
3750
|
+
FfiConverterOptionalString.allocationSize(value.tokenIdentifier)
|
|
3505
3751
|
);
|
|
3506
3752
|
}
|
|
3507
3753
|
}
|
|
3508
3754
|
return new FFIConverter();
|
|
3509
3755
|
})();
|
|
3510
3756
|
|
|
3511
|
-
export type
|
|
3757
|
+
export type FetchConversionLimitsResponse = {
|
|
3512
3758
|
/**
|
|
3513
3759
|
* The minimum amount to be converted.
|
|
3514
3760
|
* Denominated in satoshis if converting from Bitcoin, otherwise in the token base units.
|
|
@@ -3522,25 +3768,25 @@ export type FetchTokenConversionLimitsResponse = {
|
|
|
3522
3768
|
};
|
|
3523
3769
|
|
|
3524
3770
|
/**
|
|
3525
|
-
* Generated factory for {@link
|
|
3771
|
+
* Generated factory for {@link FetchConversionLimitsResponse} record objects.
|
|
3526
3772
|
*/
|
|
3527
|
-
export const
|
|
3773
|
+
export const FetchConversionLimitsResponse = (() => {
|
|
3528
3774
|
const defaults = () => ({});
|
|
3529
3775
|
const create = (() => {
|
|
3530
3776
|
return uniffiCreateRecord<
|
|
3531
|
-
|
|
3777
|
+
FetchConversionLimitsResponse,
|
|
3532
3778
|
ReturnType<typeof defaults>
|
|
3533
3779
|
>(defaults);
|
|
3534
3780
|
})();
|
|
3535
3781
|
return Object.freeze({
|
|
3536
3782
|
/**
|
|
3537
|
-
* Create a frozen instance of {@link
|
|
3783
|
+
* Create a frozen instance of {@link FetchConversionLimitsResponse}, with defaults specified
|
|
3538
3784
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
3539
3785
|
*/
|
|
3540
3786
|
create,
|
|
3541
3787
|
|
|
3542
3788
|
/**
|
|
3543
|
-
* Create a frozen instance of {@link
|
|
3789
|
+
* Create a frozen instance of {@link FetchConversionLimitsResponse}, with defaults specified
|
|
3544
3790
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
3545
3791
|
*/
|
|
3546
3792
|
new: create,
|
|
@@ -3549,12 +3795,12 @@ export const FetchTokenConversionLimitsResponse = (() => {
|
|
|
3549
3795
|
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
3550
3796
|
*/
|
|
3551
3797
|
defaults: () =>
|
|
3552
|
-
Object.freeze(defaults()) as Partial<
|
|
3798
|
+
Object.freeze(defaults()) as Partial<FetchConversionLimitsResponse>,
|
|
3553
3799
|
});
|
|
3554
3800
|
})();
|
|
3555
3801
|
|
|
3556
|
-
const
|
|
3557
|
-
type TypeName =
|
|
3802
|
+
const FfiConverterTypeFetchConversionLimitsResponse = (() => {
|
|
3803
|
+
type TypeName = FetchConversionLimitsResponse;
|
|
3558
3804
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
3559
3805
|
read(from: RustBuffer): TypeName {
|
|
3560
3806
|
return {
|
|
@@ -4089,6 +4335,58 @@ const FfiConverterTypeGetTokensMetadataResponse = (() => {
|
|
|
4089
4335
|
return new FFIConverter();
|
|
4090
4336
|
})();
|
|
4091
4337
|
|
|
4338
|
+
export type HashedMessageBytes = {
|
|
4339
|
+
bytes: ArrayBuffer;
|
|
4340
|
+
};
|
|
4341
|
+
|
|
4342
|
+
/**
|
|
4343
|
+
* Generated factory for {@link HashedMessageBytes} record objects.
|
|
4344
|
+
*/
|
|
4345
|
+
export const HashedMessageBytes = (() => {
|
|
4346
|
+
const defaults = () => ({});
|
|
4347
|
+
const create = (() => {
|
|
4348
|
+
return uniffiCreateRecord<HashedMessageBytes, ReturnType<typeof defaults>>(
|
|
4349
|
+
defaults
|
|
4350
|
+
);
|
|
4351
|
+
})();
|
|
4352
|
+
return Object.freeze({
|
|
4353
|
+
/**
|
|
4354
|
+
* Create a frozen instance of {@link HashedMessageBytes}, with defaults specified
|
|
4355
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
4356
|
+
*/
|
|
4357
|
+
create,
|
|
4358
|
+
|
|
4359
|
+
/**
|
|
4360
|
+
* Create a frozen instance of {@link HashedMessageBytes}, with defaults specified
|
|
4361
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
4362
|
+
*/
|
|
4363
|
+
new: create,
|
|
4364
|
+
|
|
4365
|
+
/**
|
|
4366
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
4367
|
+
*/
|
|
4368
|
+
defaults: () => Object.freeze(defaults()) as Partial<HashedMessageBytes>,
|
|
4369
|
+
});
|
|
4370
|
+
})();
|
|
4371
|
+
|
|
4372
|
+
const FfiConverterTypeHashedMessageBytes = (() => {
|
|
4373
|
+
type TypeName = HashedMessageBytes;
|
|
4374
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
4375
|
+
read(from: RustBuffer): TypeName {
|
|
4376
|
+
return {
|
|
4377
|
+
bytes: FfiConverterArrayBuffer.read(from),
|
|
4378
|
+
};
|
|
4379
|
+
}
|
|
4380
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
4381
|
+
FfiConverterArrayBuffer.write(value.bytes, into);
|
|
4382
|
+
}
|
|
4383
|
+
allocationSize(value: TypeName): number {
|
|
4384
|
+
return FfiConverterArrayBuffer.allocationSize(value.bytes);
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
return new FFIConverter();
|
|
4388
|
+
})();
|
|
4389
|
+
|
|
4092
4390
|
/**
|
|
4093
4391
|
* FFI-safe wrapper for (Identifier, `SigningCommitments`) pair
|
|
4094
4392
|
*/
|
|
@@ -5040,36 +5338,31 @@ const FfiConverterTypeLnurlAuthRequestDetails = (() => {
|
|
|
5040
5338
|
})();
|
|
5041
5339
|
|
|
5042
5340
|
/**
|
|
5043
|
-
*
|
|
5341
|
+
* LNURL error details
|
|
5044
5342
|
*/
|
|
5045
|
-
export type
|
|
5046
|
-
|
|
5047
|
-
comment: string | undefined;
|
|
5048
|
-
domain: string | undefined;
|
|
5049
|
-
metadata: string | undefined;
|
|
5050
|
-
processedSuccessAction: SuccessActionProcessed | undefined;
|
|
5051
|
-
rawSuccessAction: SuccessAction | undefined;
|
|
5343
|
+
export type LnurlErrorDetails = {
|
|
5344
|
+
reason: string;
|
|
5052
5345
|
};
|
|
5053
5346
|
|
|
5054
5347
|
/**
|
|
5055
|
-
* Generated factory for {@link
|
|
5348
|
+
* Generated factory for {@link LnurlErrorDetails} record objects.
|
|
5056
5349
|
*/
|
|
5057
|
-
export const
|
|
5350
|
+
export const LnurlErrorDetails = (() => {
|
|
5058
5351
|
const defaults = () => ({});
|
|
5059
5352
|
const create = (() => {
|
|
5060
|
-
return uniffiCreateRecord<
|
|
5353
|
+
return uniffiCreateRecord<LnurlErrorDetails, ReturnType<typeof defaults>>(
|
|
5061
5354
|
defaults
|
|
5062
5355
|
);
|
|
5063
5356
|
})();
|
|
5064
5357
|
return Object.freeze({
|
|
5065
5358
|
/**
|
|
5066
|
-
* Create a frozen instance of {@link
|
|
5359
|
+
* Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
|
|
5067
5360
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
5068
5361
|
*/
|
|
5069
5362
|
create,
|
|
5070
5363
|
|
|
5071
5364
|
/**
|
|
5072
|
-
* Create a frozen instance of {@link
|
|
5365
|
+
* Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
|
|
5073
5366
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
5074
5367
|
*/
|
|
5075
5368
|
new: create,
|
|
@@ -5077,29 +5370,89 @@ export const LnurlPayInfo = (() => {
|
|
|
5077
5370
|
/**
|
|
5078
5371
|
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
5079
5372
|
*/
|
|
5080
|
-
defaults: () => Object.freeze(defaults()) as Partial<
|
|
5373
|
+
defaults: () => Object.freeze(defaults()) as Partial<LnurlErrorDetails>,
|
|
5081
5374
|
});
|
|
5082
5375
|
})();
|
|
5083
5376
|
|
|
5084
|
-
const
|
|
5085
|
-
type TypeName =
|
|
5377
|
+
const FfiConverterTypeLnurlErrorDetails = (() => {
|
|
5378
|
+
type TypeName = LnurlErrorDetails;
|
|
5086
5379
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5087
5380
|
read(from: RustBuffer): TypeName {
|
|
5088
5381
|
return {
|
|
5089
|
-
|
|
5090
|
-
comment: FfiConverterOptionalString.read(from),
|
|
5091
|
-
domain: FfiConverterOptionalString.read(from),
|
|
5092
|
-
metadata: FfiConverterOptionalString.read(from),
|
|
5093
|
-
processedSuccessAction:
|
|
5094
|
-
FfiConverterOptionalTypeSuccessActionProcessed.read(from),
|
|
5095
|
-
rawSuccessAction: FfiConverterOptionalTypeSuccessAction.read(from),
|
|
5382
|
+
reason: FfiConverterString.read(from),
|
|
5096
5383
|
};
|
|
5097
5384
|
}
|
|
5098
5385
|
write(value: TypeName, into: RustBuffer): void {
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5386
|
+
FfiConverterString.write(value.reason, into);
|
|
5387
|
+
}
|
|
5388
|
+
allocationSize(value: TypeName): number {
|
|
5389
|
+
return FfiConverterString.allocationSize(value.reason);
|
|
5390
|
+
}
|
|
5391
|
+
}
|
|
5392
|
+
return new FFIConverter();
|
|
5393
|
+
})();
|
|
5394
|
+
|
|
5395
|
+
/**
|
|
5396
|
+
* Represents the payment LNURL info
|
|
5397
|
+
*/
|
|
5398
|
+
export type LnurlPayInfo = {
|
|
5399
|
+
lnAddress: string | undefined;
|
|
5400
|
+
comment: string | undefined;
|
|
5401
|
+
domain: string | undefined;
|
|
5402
|
+
metadata: string | undefined;
|
|
5403
|
+
processedSuccessAction: SuccessActionProcessed | undefined;
|
|
5404
|
+
rawSuccessAction: SuccessAction | undefined;
|
|
5405
|
+
};
|
|
5406
|
+
|
|
5407
|
+
/**
|
|
5408
|
+
* Generated factory for {@link LnurlPayInfo} record objects.
|
|
5409
|
+
*/
|
|
5410
|
+
export const LnurlPayInfo = (() => {
|
|
5411
|
+
const defaults = () => ({});
|
|
5412
|
+
const create = (() => {
|
|
5413
|
+
return uniffiCreateRecord<LnurlPayInfo, ReturnType<typeof defaults>>(
|
|
5414
|
+
defaults
|
|
5415
|
+
);
|
|
5416
|
+
})();
|
|
5417
|
+
return Object.freeze({
|
|
5418
|
+
/**
|
|
5419
|
+
* Create a frozen instance of {@link LnurlPayInfo}, with defaults specified
|
|
5420
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
5421
|
+
*/
|
|
5422
|
+
create,
|
|
5423
|
+
|
|
5424
|
+
/**
|
|
5425
|
+
* Create a frozen instance of {@link LnurlPayInfo}, with defaults specified
|
|
5426
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
5427
|
+
*/
|
|
5428
|
+
new: create,
|
|
5429
|
+
|
|
5430
|
+
/**
|
|
5431
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
5432
|
+
*/
|
|
5433
|
+
defaults: () => Object.freeze(defaults()) as Partial<LnurlPayInfo>,
|
|
5434
|
+
});
|
|
5435
|
+
})();
|
|
5436
|
+
|
|
5437
|
+
const FfiConverterTypeLnurlPayInfo = (() => {
|
|
5438
|
+
type TypeName = LnurlPayInfo;
|
|
5439
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5440
|
+
read(from: RustBuffer): TypeName {
|
|
5441
|
+
return {
|
|
5442
|
+
lnAddress: FfiConverterOptionalString.read(from),
|
|
5443
|
+
comment: FfiConverterOptionalString.read(from),
|
|
5444
|
+
domain: FfiConverterOptionalString.read(from),
|
|
5445
|
+
metadata: FfiConverterOptionalString.read(from),
|
|
5446
|
+
processedSuccessAction:
|
|
5447
|
+
FfiConverterOptionalTypeSuccessActionProcessed.read(from),
|
|
5448
|
+
rawSuccessAction: FfiConverterOptionalTypeSuccessAction.read(from),
|
|
5449
|
+
};
|
|
5450
|
+
}
|
|
5451
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
5452
|
+
FfiConverterOptionalString.write(value.lnAddress, into);
|
|
5453
|
+
FfiConverterOptionalString.write(value.comment, into);
|
|
5454
|
+
FfiConverterOptionalString.write(value.domain, into);
|
|
5455
|
+
FfiConverterOptionalString.write(value.metadata, into);
|
|
5103
5456
|
FfiConverterOptionalTypeSuccessActionProcessed.write(
|
|
5104
5457
|
value.processedSuccessAction,
|
|
5105
5458
|
into
|
|
@@ -5900,6 +6253,61 @@ const FfiConverterTypeLogEntry = (() => {
|
|
|
5900
6253
|
return new FFIConverter();
|
|
5901
6254
|
})();
|
|
5902
6255
|
|
|
6256
|
+
/**
|
|
6257
|
+
* FFI-safe representation of a 32-byte message digest for ECDSA signing
|
|
6258
|
+
*/
|
|
6259
|
+
export type MessageBytes = {
|
|
6260
|
+
bytes: ArrayBuffer;
|
|
6261
|
+
};
|
|
6262
|
+
|
|
6263
|
+
/**
|
|
6264
|
+
* Generated factory for {@link MessageBytes} record objects.
|
|
6265
|
+
*/
|
|
6266
|
+
export const MessageBytes = (() => {
|
|
6267
|
+
const defaults = () => ({});
|
|
6268
|
+
const create = (() => {
|
|
6269
|
+
return uniffiCreateRecord<MessageBytes, ReturnType<typeof defaults>>(
|
|
6270
|
+
defaults
|
|
6271
|
+
);
|
|
6272
|
+
})();
|
|
6273
|
+
return Object.freeze({
|
|
6274
|
+
/**
|
|
6275
|
+
* Create a frozen instance of {@link MessageBytes}, with defaults specified
|
|
6276
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
6277
|
+
*/
|
|
6278
|
+
create,
|
|
6279
|
+
|
|
6280
|
+
/**
|
|
6281
|
+
* Create a frozen instance of {@link MessageBytes}, with defaults specified
|
|
6282
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
6283
|
+
*/
|
|
6284
|
+
new: create,
|
|
6285
|
+
|
|
6286
|
+
/**
|
|
6287
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
6288
|
+
*/
|
|
6289
|
+
defaults: () => Object.freeze(defaults()) as Partial<MessageBytes>,
|
|
6290
|
+
});
|
|
6291
|
+
})();
|
|
6292
|
+
|
|
6293
|
+
const FfiConverterTypeMessageBytes = (() => {
|
|
6294
|
+
type TypeName = MessageBytes;
|
|
6295
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
6296
|
+
read(from: RustBuffer): TypeName {
|
|
6297
|
+
return {
|
|
6298
|
+
bytes: FfiConverterArrayBuffer.read(from),
|
|
6299
|
+
};
|
|
6300
|
+
}
|
|
6301
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
6302
|
+
FfiConverterArrayBuffer.write(value.bytes, into);
|
|
6303
|
+
}
|
|
6304
|
+
allocationSize(value: TypeName): number {
|
|
6305
|
+
return FfiConverterArrayBuffer.allocationSize(value.bytes);
|
|
6306
|
+
}
|
|
6307
|
+
}
|
|
6308
|
+
return new FFIConverter();
|
|
6309
|
+
})();
|
|
6310
|
+
|
|
5903
6311
|
export type MessageSuccessActionData = {
|
|
5904
6312
|
message: string;
|
|
5905
6313
|
};
|
|
@@ -6320,7 +6728,7 @@ export type PaymentMetadata = {
|
|
|
6320
6728
|
lnurlPayInfo: LnurlPayInfo | undefined;
|
|
6321
6729
|
lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
|
|
6322
6730
|
lnurlDescription: string | undefined;
|
|
6323
|
-
|
|
6731
|
+
conversionInfo: ConversionInfo | undefined;
|
|
6324
6732
|
};
|
|
6325
6733
|
|
|
6326
6734
|
/**
|
|
@@ -6362,8 +6770,7 @@ const FfiConverterTypePaymentMetadata = (() => {
|
|
|
6362
6770
|
lnurlPayInfo: FfiConverterOptionalTypeLnurlPayInfo.read(from),
|
|
6363
6771
|
lnurlWithdrawInfo: FfiConverterOptionalTypeLnurlWithdrawInfo.read(from),
|
|
6364
6772
|
lnurlDescription: FfiConverterOptionalString.read(from),
|
|
6365
|
-
|
|
6366
|
-
FfiConverterOptionalTypeTokenConversionInfo.read(from),
|
|
6773
|
+
conversionInfo: FfiConverterOptionalTypeConversionInfo.read(from),
|
|
6367
6774
|
};
|
|
6368
6775
|
}
|
|
6369
6776
|
write(value: TypeName, into: RustBuffer): void {
|
|
@@ -6374,10 +6781,7 @@ const FfiConverterTypePaymentMetadata = (() => {
|
|
|
6374
6781
|
into
|
|
6375
6782
|
);
|
|
6376
6783
|
FfiConverterOptionalString.write(value.lnurlDescription, into);
|
|
6377
|
-
|
|
6378
|
-
value.tokenConversionInfo,
|
|
6379
|
-
into
|
|
6380
|
-
);
|
|
6784
|
+
FfiConverterOptionalTypeConversionInfo.write(value.conversionInfo, into);
|
|
6381
6785
|
}
|
|
6382
6786
|
allocationSize(value: TypeName): number {
|
|
6383
6787
|
return (
|
|
@@ -6389,8 +6793,8 @@ const FfiConverterTypePaymentMetadata = (() => {
|
|
|
6389
6793
|
value.lnurlWithdrawInfo
|
|
6390
6794
|
) +
|
|
6391
6795
|
FfiConverterOptionalString.allocationSize(value.lnurlDescription) +
|
|
6392
|
-
|
|
6393
|
-
value.
|
|
6796
|
+
FfiConverterOptionalTypeConversionInfo.allocationSize(
|
|
6797
|
+
value.conversionInfo
|
|
6394
6798
|
)
|
|
6395
6799
|
);
|
|
6396
6800
|
}
|
|
@@ -6625,9 +7029,9 @@ export type PrepareSendPaymentRequest = {
|
|
|
6625
7029
|
*/
|
|
6626
7030
|
tokenIdentifier: string | undefined;
|
|
6627
7031
|
/**
|
|
6628
|
-
* If provided, the payment will include a
|
|
7032
|
+
* If provided, the payment will include a conversion step before sending the payment
|
|
6629
7033
|
*/
|
|
6630
|
-
|
|
7034
|
+
conversionOptions: ConversionOptions | undefined;
|
|
6631
7035
|
};
|
|
6632
7036
|
|
|
6633
7037
|
/**
|
|
@@ -6637,7 +7041,7 @@ export const PrepareSendPaymentRequest = (() => {
|
|
|
6637
7041
|
const defaults = () => ({
|
|
6638
7042
|
amount: undefined,
|
|
6639
7043
|
tokenIdentifier: undefined,
|
|
6640
|
-
|
|
7044
|
+
conversionOptions: undefined,
|
|
6641
7045
|
});
|
|
6642
7046
|
const create = (() => {
|
|
6643
7047
|
return uniffiCreateRecord<
|
|
@@ -6674,16 +7078,15 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
|
|
|
6674
7078
|
paymentRequest: FfiConverterString.read(from),
|
|
6675
7079
|
amount: FfiConverterOptionalTypeu128.read(from),
|
|
6676
7080
|
tokenIdentifier: FfiConverterOptionalString.read(from),
|
|
6677
|
-
|
|
6678
|
-
FfiConverterOptionalTypeTokenConversionOptions.read(from),
|
|
7081
|
+
conversionOptions: FfiConverterOptionalTypeConversionOptions.read(from),
|
|
6679
7082
|
};
|
|
6680
7083
|
}
|
|
6681
7084
|
write(value: TypeName, into: RustBuffer): void {
|
|
6682
7085
|
FfiConverterString.write(value.paymentRequest, into);
|
|
6683
7086
|
FfiConverterOptionalTypeu128.write(value.amount, into);
|
|
6684
7087
|
FfiConverterOptionalString.write(value.tokenIdentifier, into);
|
|
6685
|
-
|
|
6686
|
-
value.
|
|
7088
|
+
FfiConverterOptionalTypeConversionOptions.write(
|
|
7089
|
+
value.conversionOptions,
|
|
6687
7090
|
into
|
|
6688
7091
|
);
|
|
6689
7092
|
}
|
|
@@ -6692,8 +7095,8 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
|
|
|
6692
7095
|
FfiConverterString.allocationSize(value.paymentRequest) +
|
|
6693
7096
|
FfiConverterOptionalTypeu128.allocationSize(value.amount) +
|
|
6694
7097
|
FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
|
|
6695
|
-
|
|
6696
|
-
value.
|
|
7098
|
+
FfiConverterOptionalTypeConversionOptions.allocationSize(
|
|
7099
|
+
value.conversionOptions
|
|
6697
7100
|
)
|
|
6698
7101
|
);
|
|
6699
7102
|
}
|
|
@@ -6714,13 +7117,9 @@ export type PrepareSendPaymentResponse = {
|
|
|
6714
7117
|
*/
|
|
6715
7118
|
tokenIdentifier: string | undefined;
|
|
6716
7119
|
/**
|
|
6717
|
-
* When set, the payment will include a
|
|
7120
|
+
* When set, the payment will include a conversion step before sending the payment
|
|
6718
7121
|
*/
|
|
6719
|
-
|
|
6720
|
-
/**
|
|
6721
|
-
* The estimated token conversion fee if the payment involves a token conversion
|
|
6722
|
-
*/
|
|
6723
|
-
tokenConversionFee: U128 | undefined;
|
|
7122
|
+
conversionEstimate: ConversionEstimate | undefined;
|
|
6724
7123
|
};
|
|
6725
7124
|
|
|
6726
7125
|
/**
|
|
@@ -6763,30 +7162,27 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
|
|
|
6763
7162
|
paymentMethod: FfiConverterTypeSendPaymentMethod.read(from),
|
|
6764
7163
|
amount: FfiConverterTypeu128.read(from),
|
|
6765
7164
|
tokenIdentifier: FfiConverterOptionalString.read(from),
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
tokenConversionFee: FfiConverterOptionalTypeu128.read(from),
|
|
7165
|
+
conversionEstimate:
|
|
7166
|
+
FfiConverterOptionalTypeConversionEstimate.read(from),
|
|
6769
7167
|
};
|
|
6770
7168
|
}
|
|
6771
7169
|
write(value: TypeName, into: RustBuffer): void {
|
|
6772
7170
|
FfiConverterTypeSendPaymentMethod.write(value.paymentMethod, into);
|
|
6773
7171
|
FfiConverterTypeu128.write(value.amount, into);
|
|
6774
7172
|
FfiConverterOptionalString.write(value.tokenIdentifier, into);
|
|
6775
|
-
|
|
6776
|
-
value.
|
|
7173
|
+
FfiConverterOptionalTypeConversionEstimate.write(
|
|
7174
|
+
value.conversionEstimate,
|
|
6777
7175
|
into
|
|
6778
7176
|
);
|
|
6779
|
-
FfiConverterOptionalTypeu128.write(value.tokenConversionFee, into);
|
|
6780
7177
|
}
|
|
6781
7178
|
allocationSize(value: TypeName): number {
|
|
6782
7179
|
return (
|
|
6783
7180
|
FfiConverterTypeSendPaymentMethod.allocationSize(value.paymentMethod) +
|
|
6784
7181
|
FfiConverterTypeu128.allocationSize(value.amount) +
|
|
6785
7182
|
FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
|
|
6786
|
-
|
|
6787
|
-
value.
|
|
6788
|
-
)
|
|
6789
|
-
FfiConverterOptionalTypeu128.allocationSize(value.tokenConversionFee)
|
|
7183
|
+
FfiConverterOptionalTypeConversionEstimate.allocationSize(
|
|
7184
|
+
value.conversionEstimate
|
|
7185
|
+
)
|
|
6790
7186
|
);
|
|
6791
7187
|
}
|
|
6792
7188
|
}
|
|
@@ -8361,7 +8757,7 @@ export type SparkHtlcDetails = {
|
|
|
8361
8757
|
*/
|
|
8362
8758
|
preimage: string | undefined;
|
|
8363
8759
|
/**
|
|
8364
|
-
* The expiry time of the HTLC
|
|
8760
|
+
* The expiry time of the HTLC as a unix timestamp in seconds
|
|
8365
8761
|
*/
|
|
8366
8762
|
expiryTime: /*u64*/ bigint;
|
|
8367
8763
|
/**
|
|
@@ -8513,7 +8909,7 @@ export type SparkInvoiceDetails = {
|
|
|
8513
8909
|
*/
|
|
8514
8910
|
tokenIdentifier: string | undefined;
|
|
8515
8911
|
/**
|
|
8516
|
-
* Optional expiry time. If not provided, the invoice will never expire.
|
|
8912
|
+
* Optional expiry time as a unix timestamp in seconds. If not provided, the invoice will never expire.
|
|
8517
8913
|
*/
|
|
8518
8914
|
expiryTime: /*u64*/ bigint | undefined;
|
|
8519
8915
|
/**
|
|
@@ -8886,174 +9282,6 @@ const FfiConverterTypeTokenBalance = (() => {
|
|
|
8886
9282
|
return new FFIConverter();
|
|
8887
9283
|
})();
|
|
8888
9284
|
|
|
8889
|
-
export type TokenConversionInfo = {
|
|
8890
|
-
/**
|
|
8891
|
-
* The pool id associated with the conversion
|
|
8892
|
-
*/
|
|
8893
|
-
poolId: string;
|
|
8894
|
-
/**
|
|
8895
|
-
* The receiving payment id associated with the conversion
|
|
8896
|
-
*/
|
|
8897
|
-
paymentId: string | undefined;
|
|
8898
|
-
/**
|
|
8899
|
-
* The fee paid for the conversion
|
|
8900
|
-
* Denominated in satoshis if converting from Bitcoin, otherwise in the token base units.
|
|
8901
|
-
*/
|
|
8902
|
-
fee: U128 | undefined;
|
|
8903
|
-
/**
|
|
8904
|
-
* The refund payment id if a refund payment was made
|
|
8905
|
-
*/
|
|
8906
|
-
refundIdentifier: string | undefined;
|
|
8907
|
-
};
|
|
8908
|
-
|
|
8909
|
-
/**
|
|
8910
|
-
* Generated factory for {@link TokenConversionInfo} record objects.
|
|
8911
|
-
*/
|
|
8912
|
-
export const TokenConversionInfo = (() => {
|
|
8913
|
-
const defaults = () => ({});
|
|
8914
|
-
const create = (() => {
|
|
8915
|
-
return uniffiCreateRecord<TokenConversionInfo, ReturnType<typeof defaults>>(
|
|
8916
|
-
defaults
|
|
8917
|
-
);
|
|
8918
|
-
})();
|
|
8919
|
-
return Object.freeze({
|
|
8920
|
-
/**
|
|
8921
|
-
* Create a frozen instance of {@link TokenConversionInfo}, with defaults specified
|
|
8922
|
-
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
8923
|
-
*/
|
|
8924
|
-
create,
|
|
8925
|
-
|
|
8926
|
-
/**
|
|
8927
|
-
* Create a frozen instance of {@link TokenConversionInfo}, with defaults specified
|
|
8928
|
-
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
8929
|
-
*/
|
|
8930
|
-
new: create,
|
|
8931
|
-
|
|
8932
|
-
/**
|
|
8933
|
-
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
8934
|
-
*/
|
|
8935
|
-
defaults: () => Object.freeze(defaults()) as Partial<TokenConversionInfo>,
|
|
8936
|
-
});
|
|
8937
|
-
})();
|
|
8938
|
-
|
|
8939
|
-
const FfiConverterTypeTokenConversionInfo = (() => {
|
|
8940
|
-
type TypeName = TokenConversionInfo;
|
|
8941
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
8942
|
-
read(from: RustBuffer): TypeName {
|
|
8943
|
-
return {
|
|
8944
|
-
poolId: FfiConverterString.read(from),
|
|
8945
|
-
paymentId: FfiConverterOptionalString.read(from),
|
|
8946
|
-
fee: FfiConverterOptionalTypeu128.read(from),
|
|
8947
|
-
refundIdentifier: FfiConverterOptionalString.read(from),
|
|
8948
|
-
};
|
|
8949
|
-
}
|
|
8950
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
8951
|
-
FfiConverterString.write(value.poolId, into);
|
|
8952
|
-
FfiConverterOptionalString.write(value.paymentId, into);
|
|
8953
|
-
FfiConverterOptionalTypeu128.write(value.fee, into);
|
|
8954
|
-
FfiConverterOptionalString.write(value.refundIdentifier, into);
|
|
8955
|
-
}
|
|
8956
|
-
allocationSize(value: TypeName): number {
|
|
8957
|
-
return (
|
|
8958
|
-
FfiConverterString.allocationSize(value.poolId) +
|
|
8959
|
-
FfiConverterOptionalString.allocationSize(value.paymentId) +
|
|
8960
|
-
FfiConverterOptionalTypeu128.allocationSize(value.fee) +
|
|
8961
|
-
FfiConverterOptionalString.allocationSize(value.refundIdentifier)
|
|
8962
|
-
);
|
|
8963
|
-
}
|
|
8964
|
-
}
|
|
8965
|
-
return new FFIConverter();
|
|
8966
|
-
})();
|
|
8967
|
-
|
|
8968
|
-
/**
|
|
8969
|
-
* Options for token conversion when fulfilling a payment. When set, the SDK will
|
|
8970
|
-
* perform a token conversion before fulfilling the payment. If not set, the payment
|
|
8971
|
-
* will only be fulfilled if the wallet has sufficient balance of the required asset.
|
|
8972
|
-
*/
|
|
8973
|
-
export type TokenConversionOptions = {
|
|
8974
|
-
/**
|
|
8975
|
-
* The type of token conversion to perform when fulfilling the payment
|
|
8976
|
-
*/
|
|
8977
|
-
conversionType: TokenConversionType;
|
|
8978
|
-
/**
|
|
8979
|
-
* The optional maximum slippage in basis points (1/100 of a percent) allowed when
|
|
8980
|
-
* a token conversion is needed to fulfill the payment. Defaults to 50 bps (0.5%) if not set.
|
|
8981
|
-
* The token conversion will fail if the actual amount received is less than
|
|
8982
|
-
* `estimated_amount * (1 - max_slippage_bps / 10_000)`.
|
|
8983
|
-
*/
|
|
8984
|
-
maxSlippageBps: /*u32*/ number | undefined;
|
|
8985
|
-
/**
|
|
8986
|
-
* The optional timeout in seconds to wait for the token conversion to complete
|
|
8987
|
-
* when fulfilling the payment. This timeout only concerns waiting for the received
|
|
8988
|
-
* payment of the token conversion. If the timeout is reached before the conversion
|
|
8989
|
-
* is complete, the payment will fail. Defaults to 30 seconds if not set.
|
|
8990
|
-
*/
|
|
8991
|
-
completionTimeoutSecs: /*u32*/ number | undefined;
|
|
8992
|
-
};
|
|
8993
|
-
|
|
8994
|
-
/**
|
|
8995
|
-
* Generated factory for {@link TokenConversionOptions} record objects.
|
|
8996
|
-
*/
|
|
8997
|
-
export const TokenConversionOptions = (() => {
|
|
8998
|
-
const defaults = () => ({
|
|
8999
|
-
maxSlippageBps: undefined,
|
|
9000
|
-
completionTimeoutSecs: undefined,
|
|
9001
|
-
});
|
|
9002
|
-
const create = (() => {
|
|
9003
|
-
return uniffiCreateRecord<
|
|
9004
|
-
TokenConversionOptions,
|
|
9005
|
-
ReturnType<typeof defaults>
|
|
9006
|
-
>(defaults);
|
|
9007
|
-
})();
|
|
9008
|
-
return Object.freeze({
|
|
9009
|
-
/**
|
|
9010
|
-
* Create a frozen instance of {@link TokenConversionOptions}, with defaults specified
|
|
9011
|
-
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
9012
|
-
*/
|
|
9013
|
-
create,
|
|
9014
|
-
|
|
9015
|
-
/**
|
|
9016
|
-
* Create a frozen instance of {@link TokenConversionOptions}, with defaults specified
|
|
9017
|
-
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
9018
|
-
*/
|
|
9019
|
-
new: create,
|
|
9020
|
-
|
|
9021
|
-
/**
|
|
9022
|
-
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
9023
|
-
*/
|
|
9024
|
-
defaults: () =>
|
|
9025
|
-
Object.freeze(defaults()) as Partial<TokenConversionOptions>,
|
|
9026
|
-
});
|
|
9027
|
-
})();
|
|
9028
|
-
|
|
9029
|
-
const FfiConverterTypeTokenConversionOptions = (() => {
|
|
9030
|
-
type TypeName = TokenConversionOptions;
|
|
9031
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
9032
|
-
read(from: RustBuffer): TypeName {
|
|
9033
|
-
return {
|
|
9034
|
-
conversionType: FfiConverterTypeTokenConversionType.read(from),
|
|
9035
|
-
maxSlippageBps: FfiConverterOptionalUInt32.read(from),
|
|
9036
|
-
completionTimeoutSecs: FfiConverterOptionalUInt32.read(from),
|
|
9037
|
-
};
|
|
9038
|
-
}
|
|
9039
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
9040
|
-
FfiConverterTypeTokenConversionType.write(value.conversionType, into);
|
|
9041
|
-
FfiConverterOptionalUInt32.write(value.maxSlippageBps, into);
|
|
9042
|
-
FfiConverterOptionalUInt32.write(value.completionTimeoutSecs, into);
|
|
9043
|
-
}
|
|
9044
|
-
allocationSize(value: TypeName): number {
|
|
9045
|
-
return (
|
|
9046
|
-
FfiConverterTypeTokenConversionType.allocationSize(
|
|
9047
|
-
value.conversionType
|
|
9048
|
-
) +
|
|
9049
|
-
FfiConverterOptionalUInt32.allocationSize(value.maxSlippageBps) +
|
|
9050
|
-
FfiConverterOptionalUInt32.allocationSize(value.completionTimeoutSecs)
|
|
9051
|
-
);
|
|
9052
|
-
}
|
|
9053
|
-
}
|
|
9054
|
-
return new FFIConverter();
|
|
9055
|
-
})();
|
|
9056
|
-
|
|
9057
9285
|
export type TokenMetadata = {
|
|
9058
9286
|
identifier: string;
|
|
9059
9287
|
/**
|
|
@@ -10407,16 +10635,350 @@ const FfiConverterTypeChainServiceError = (() => {
|
|
|
10407
10635
|
size += FfiConverterString.allocationSize(inner[0]);
|
|
10408
10636
|
return size;
|
|
10409
10637
|
}
|
|
10410
|
-
case ChainServiceError_Tags.ServiceConnectivity: {
|
|
10638
|
+
case ChainServiceError_Tags.ServiceConnectivity: {
|
|
10639
|
+
const inner = value.inner;
|
|
10640
|
+
let size = ordinalConverter.allocationSize(2);
|
|
10641
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
10642
|
+
return size;
|
|
10643
|
+
}
|
|
10644
|
+
case ChainServiceError_Tags.Generic: {
|
|
10645
|
+
const inner = value.inner;
|
|
10646
|
+
let size = ordinalConverter.allocationSize(3);
|
|
10647
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
10648
|
+
return size;
|
|
10649
|
+
}
|
|
10650
|
+
default:
|
|
10651
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10652
|
+
}
|
|
10653
|
+
}
|
|
10654
|
+
}
|
|
10655
|
+
return new FFIConverter();
|
|
10656
|
+
})();
|
|
10657
|
+
|
|
10658
|
+
// Enum: ConversionPurpose
|
|
10659
|
+
export enum ConversionPurpose_Tags {
|
|
10660
|
+
OngoingPayment = 'OngoingPayment',
|
|
10661
|
+
SelfTransfer = 'SelfTransfer',
|
|
10662
|
+
}
|
|
10663
|
+
/**
|
|
10664
|
+
* The purpose of the conversion, which is used to provide context for the conversion
|
|
10665
|
+
* if its related to an ongoing payment or a self-transfer.
|
|
10666
|
+
*/
|
|
10667
|
+
export const ConversionPurpose = (() => {
|
|
10668
|
+
type OngoingPayment__interface = {
|
|
10669
|
+
tag: ConversionPurpose_Tags.OngoingPayment;
|
|
10670
|
+
inner: Readonly<{ paymentRequest: string }>;
|
|
10671
|
+
};
|
|
10672
|
+
|
|
10673
|
+
/**
|
|
10674
|
+
* Conversion is associated with an ongoing payment
|
|
10675
|
+
*/
|
|
10676
|
+
class OngoingPayment_
|
|
10677
|
+
extends UniffiEnum
|
|
10678
|
+
implements OngoingPayment__interface
|
|
10679
|
+
{
|
|
10680
|
+
/**
|
|
10681
|
+
* @private
|
|
10682
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10683
|
+
*/
|
|
10684
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionPurpose';
|
|
10685
|
+
readonly tag = ConversionPurpose_Tags.OngoingPayment;
|
|
10686
|
+
readonly inner: Readonly<{ paymentRequest: string }>;
|
|
10687
|
+
constructor(inner: {
|
|
10688
|
+
/**
|
|
10689
|
+
* The payment request of the ongoing payment
|
|
10690
|
+
*/ paymentRequest: string;
|
|
10691
|
+
}) {
|
|
10692
|
+
super('ConversionPurpose', 'OngoingPayment');
|
|
10693
|
+
this.inner = Object.freeze(inner);
|
|
10694
|
+
}
|
|
10695
|
+
|
|
10696
|
+
static new(inner: {
|
|
10697
|
+
/**
|
|
10698
|
+
* The payment request of the ongoing payment
|
|
10699
|
+
*/ paymentRequest: string;
|
|
10700
|
+
}): OngoingPayment_ {
|
|
10701
|
+
return new OngoingPayment_(inner);
|
|
10702
|
+
}
|
|
10703
|
+
|
|
10704
|
+
static instanceOf(obj: any): obj is OngoingPayment_ {
|
|
10705
|
+
return obj.tag === ConversionPurpose_Tags.OngoingPayment;
|
|
10706
|
+
}
|
|
10707
|
+
}
|
|
10708
|
+
|
|
10709
|
+
type SelfTransfer__interface = {
|
|
10710
|
+
tag: ConversionPurpose_Tags.SelfTransfer;
|
|
10711
|
+
};
|
|
10712
|
+
|
|
10713
|
+
/**
|
|
10714
|
+
* Conversion is for self-transfer
|
|
10715
|
+
*/
|
|
10716
|
+
class SelfTransfer_ extends UniffiEnum implements SelfTransfer__interface {
|
|
10717
|
+
/**
|
|
10718
|
+
* @private
|
|
10719
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10720
|
+
*/
|
|
10721
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionPurpose';
|
|
10722
|
+
readonly tag = ConversionPurpose_Tags.SelfTransfer;
|
|
10723
|
+
constructor() {
|
|
10724
|
+
super('ConversionPurpose', 'SelfTransfer');
|
|
10725
|
+
}
|
|
10726
|
+
|
|
10727
|
+
static new(): SelfTransfer_ {
|
|
10728
|
+
return new SelfTransfer_();
|
|
10729
|
+
}
|
|
10730
|
+
|
|
10731
|
+
static instanceOf(obj: any): obj is SelfTransfer_ {
|
|
10732
|
+
return obj.tag === ConversionPurpose_Tags.SelfTransfer;
|
|
10733
|
+
}
|
|
10734
|
+
}
|
|
10735
|
+
|
|
10736
|
+
function instanceOf(obj: any): obj is ConversionPurpose {
|
|
10737
|
+
return obj[uniffiTypeNameSymbol] === 'ConversionPurpose';
|
|
10738
|
+
}
|
|
10739
|
+
|
|
10740
|
+
return Object.freeze({
|
|
10741
|
+
instanceOf,
|
|
10742
|
+
OngoingPayment: OngoingPayment_,
|
|
10743
|
+
SelfTransfer: SelfTransfer_,
|
|
10744
|
+
});
|
|
10745
|
+
})();
|
|
10746
|
+
|
|
10747
|
+
/**
|
|
10748
|
+
* The purpose of the conversion, which is used to provide context for the conversion
|
|
10749
|
+
* if its related to an ongoing payment or a self-transfer.
|
|
10750
|
+
*/
|
|
10751
|
+
|
|
10752
|
+
export type ConversionPurpose = InstanceType<
|
|
10753
|
+
(typeof ConversionPurpose)[keyof Omit<typeof ConversionPurpose, 'instanceOf'>]
|
|
10754
|
+
>;
|
|
10755
|
+
|
|
10756
|
+
// FfiConverter for enum ConversionPurpose
|
|
10757
|
+
const FfiConverterTypeConversionPurpose = (() => {
|
|
10758
|
+
const ordinalConverter = FfiConverterInt32;
|
|
10759
|
+
type TypeName = ConversionPurpose;
|
|
10760
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
10761
|
+
read(from: RustBuffer): TypeName {
|
|
10762
|
+
switch (ordinalConverter.read(from)) {
|
|
10763
|
+
case 1:
|
|
10764
|
+
return new ConversionPurpose.OngoingPayment({
|
|
10765
|
+
paymentRequest: FfiConverterString.read(from),
|
|
10766
|
+
});
|
|
10767
|
+
case 2:
|
|
10768
|
+
return new ConversionPurpose.SelfTransfer();
|
|
10769
|
+
default:
|
|
10770
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10771
|
+
}
|
|
10772
|
+
}
|
|
10773
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
10774
|
+
switch (value.tag) {
|
|
10775
|
+
case ConversionPurpose_Tags.OngoingPayment: {
|
|
10776
|
+
ordinalConverter.write(1, into);
|
|
10777
|
+
const inner = value.inner;
|
|
10778
|
+
FfiConverterString.write(inner.paymentRequest, into);
|
|
10779
|
+
return;
|
|
10780
|
+
}
|
|
10781
|
+
case ConversionPurpose_Tags.SelfTransfer: {
|
|
10782
|
+
ordinalConverter.write(2, into);
|
|
10783
|
+
return;
|
|
10784
|
+
}
|
|
10785
|
+
default:
|
|
10786
|
+
// Throwing from here means that ConversionPurpose_Tags hasn't matched an ordinal.
|
|
10787
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10788
|
+
}
|
|
10789
|
+
}
|
|
10790
|
+
allocationSize(value: TypeName): number {
|
|
10791
|
+
switch (value.tag) {
|
|
10792
|
+
case ConversionPurpose_Tags.OngoingPayment: {
|
|
10793
|
+
const inner = value.inner;
|
|
10794
|
+
let size = ordinalConverter.allocationSize(1);
|
|
10795
|
+
size += FfiConverterString.allocationSize(inner.paymentRequest);
|
|
10796
|
+
return size;
|
|
10797
|
+
}
|
|
10798
|
+
case ConversionPurpose_Tags.SelfTransfer: {
|
|
10799
|
+
return ordinalConverter.allocationSize(2);
|
|
10800
|
+
}
|
|
10801
|
+
default:
|
|
10802
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10803
|
+
}
|
|
10804
|
+
}
|
|
10805
|
+
}
|
|
10806
|
+
return new FFIConverter();
|
|
10807
|
+
})();
|
|
10808
|
+
|
|
10809
|
+
/**
|
|
10810
|
+
* The status of the conversion
|
|
10811
|
+
*/
|
|
10812
|
+
export enum ConversionStatus {
|
|
10813
|
+
/**
|
|
10814
|
+
* The conversion was successful
|
|
10815
|
+
*/
|
|
10816
|
+
Completed,
|
|
10817
|
+
/**
|
|
10818
|
+
* The conversion failed and no refund was made yet, which requires action by the SDK to
|
|
10819
|
+
* perform the refund. This can happen if there was a failure during the conversion process.
|
|
10820
|
+
*/
|
|
10821
|
+
RefundNeeded,
|
|
10822
|
+
/**
|
|
10823
|
+
* The conversion failed and a refund was made
|
|
10824
|
+
*/
|
|
10825
|
+
Refunded,
|
|
10826
|
+
}
|
|
10827
|
+
|
|
10828
|
+
const FfiConverterTypeConversionStatus = (() => {
|
|
10829
|
+
const ordinalConverter = FfiConverterInt32;
|
|
10830
|
+
type TypeName = ConversionStatus;
|
|
10831
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
10832
|
+
read(from: RustBuffer): TypeName {
|
|
10833
|
+
switch (ordinalConverter.read(from)) {
|
|
10834
|
+
case 1:
|
|
10835
|
+
return ConversionStatus.Completed;
|
|
10836
|
+
case 2:
|
|
10837
|
+
return ConversionStatus.RefundNeeded;
|
|
10838
|
+
case 3:
|
|
10839
|
+
return ConversionStatus.Refunded;
|
|
10840
|
+
default:
|
|
10841
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10842
|
+
}
|
|
10843
|
+
}
|
|
10844
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
10845
|
+
switch (value) {
|
|
10846
|
+
case ConversionStatus.Completed:
|
|
10847
|
+
return ordinalConverter.write(1, into);
|
|
10848
|
+
case ConversionStatus.RefundNeeded:
|
|
10849
|
+
return ordinalConverter.write(2, into);
|
|
10850
|
+
case ConversionStatus.Refunded:
|
|
10851
|
+
return ordinalConverter.write(3, into);
|
|
10852
|
+
}
|
|
10853
|
+
}
|
|
10854
|
+
allocationSize(value: TypeName): number {
|
|
10855
|
+
return ordinalConverter.allocationSize(0);
|
|
10856
|
+
}
|
|
10857
|
+
}
|
|
10858
|
+
return new FFIConverter();
|
|
10859
|
+
})();
|
|
10860
|
+
|
|
10861
|
+
// Enum: ConversionType
|
|
10862
|
+
export enum ConversionType_Tags {
|
|
10863
|
+
FromBitcoin = 'FromBitcoin',
|
|
10864
|
+
ToBitcoin = 'ToBitcoin',
|
|
10865
|
+
}
|
|
10866
|
+
export const ConversionType = (() => {
|
|
10867
|
+
type FromBitcoin__interface = {
|
|
10868
|
+
tag: ConversionType_Tags.FromBitcoin;
|
|
10869
|
+
};
|
|
10870
|
+
|
|
10871
|
+
/**
|
|
10872
|
+
* Converting from Bitcoin to a token
|
|
10873
|
+
*/
|
|
10874
|
+
class FromBitcoin_ extends UniffiEnum implements FromBitcoin__interface {
|
|
10875
|
+
/**
|
|
10876
|
+
* @private
|
|
10877
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10878
|
+
*/
|
|
10879
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionType';
|
|
10880
|
+
readonly tag = ConversionType_Tags.FromBitcoin;
|
|
10881
|
+
constructor() {
|
|
10882
|
+
super('ConversionType', 'FromBitcoin');
|
|
10883
|
+
}
|
|
10884
|
+
|
|
10885
|
+
static new(): FromBitcoin_ {
|
|
10886
|
+
return new FromBitcoin_();
|
|
10887
|
+
}
|
|
10888
|
+
|
|
10889
|
+
static instanceOf(obj: any): obj is FromBitcoin_ {
|
|
10890
|
+
return obj.tag === ConversionType_Tags.FromBitcoin;
|
|
10891
|
+
}
|
|
10892
|
+
}
|
|
10893
|
+
|
|
10894
|
+
type ToBitcoin__interface = {
|
|
10895
|
+
tag: ConversionType_Tags.ToBitcoin;
|
|
10896
|
+
inner: Readonly<{ fromTokenIdentifier: string }>;
|
|
10897
|
+
};
|
|
10898
|
+
|
|
10899
|
+
/**
|
|
10900
|
+
* Converting from a token to Bitcoin
|
|
10901
|
+
*/
|
|
10902
|
+
class ToBitcoin_ extends UniffiEnum implements ToBitcoin__interface {
|
|
10903
|
+
/**
|
|
10904
|
+
* @private
|
|
10905
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10906
|
+
*/
|
|
10907
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionType';
|
|
10908
|
+
readonly tag = ConversionType_Tags.ToBitcoin;
|
|
10909
|
+
readonly inner: Readonly<{ fromTokenIdentifier: string }>;
|
|
10910
|
+
constructor(inner: { fromTokenIdentifier: string }) {
|
|
10911
|
+
super('ConversionType', 'ToBitcoin');
|
|
10912
|
+
this.inner = Object.freeze(inner);
|
|
10913
|
+
}
|
|
10914
|
+
|
|
10915
|
+
static new(inner: { fromTokenIdentifier: string }): ToBitcoin_ {
|
|
10916
|
+
return new ToBitcoin_(inner);
|
|
10917
|
+
}
|
|
10918
|
+
|
|
10919
|
+
static instanceOf(obj: any): obj is ToBitcoin_ {
|
|
10920
|
+
return obj.tag === ConversionType_Tags.ToBitcoin;
|
|
10921
|
+
}
|
|
10922
|
+
}
|
|
10923
|
+
|
|
10924
|
+
function instanceOf(obj: any): obj is ConversionType {
|
|
10925
|
+
return obj[uniffiTypeNameSymbol] === 'ConversionType';
|
|
10926
|
+
}
|
|
10927
|
+
|
|
10928
|
+
return Object.freeze({
|
|
10929
|
+
instanceOf,
|
|
10930
|
+
FromBitcoin: FromBitcoin_,
|
|
10931
|
+
ToBitcoin: ToBitcoin_,
|
|
10932
|
+
});
|
|
10933
|
+
})();
|
|
10934
|
+
|
|
10935
|
+
export type ConversionType = InstanceType<
|
|
10936
|
+
(typeof ConversionType)[keyof Omit<typeof ConversionType, 'instanceOf'>]
|
|
10937
|
+
>;
|
|
10938
|
+
|
|
10939
|
+
// FfiConverter for enum ConversionType
|
|
10940
|
+
const FfiConverterTypeConversionType = (() => {
|
|
10941
|
+
const ordinalConverter = FfiConverterInt32;
|
|
10942
|
+
type TypeName = ConversionType;
|
|
10943
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
10944
|
+
read(from: RustBuffer): TypeName {
|
|
10945
|
+
switch (ordinalConverter.read(from)) {
|
|
10946
|
+
case 1:
|
|
10947
|
+
return new ConversionType.FromBitcoin();
|
|
10948
|
+
case 2:
|
|
10949
|
+
return new ConversionType.ToBitcoin({
|
|
10950
|
+
fromTokenIdentifier: FfiConverterString.read(from),
|
|
10951
|
+
});
|
|
10952
|
+
default:
|
|
10953
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10954
|
+
}
|
|
10955
|
+
}
|
|
10956
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
10957
|
+
switch (value.tag) {
|
|
10958
|
+
case ConversionType_Tags.FromBitcoin: {
|
|
10959
|
+
ordinalConverter.write(1, into);
|
|
10960
|
+
return;
|
|
10961
|
+
}
|
|
10962
|
+
case ConversionType_Tags.ToBitcoin: {
|
|
10963
|
+
ordinalConverter.write(2, into);
|
|
10964
|
+
const inner = value.inner;
|
|
10965
|
+
FfiConverterString.write(inner.fromTokenIdentifier, into);
|
|
10966
|
+
return;
|
|
10967
|
+
}
|
|
10968
|
+
default:
|
|
10969
|
+
// Throwing from here means that ConversionType_Tags hasn't matched an ordinal.
|
|
10970
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10971
|
+
}
|
|
10972
|
+
}
|
|
10973
|
+
allocationSize(value: TypeName): number {
|
|
10974
|
+
switch (value.tag) {
|
|
10975
|
+
case ConversionType_Tags.FromBitcoin: {
|
|
10976
|
+
return ordinalConverter.allocationSize(1);
|
|
10977
|
+
}
|
|
10978
|
+
case ConversionType_Tags.ToBitcoin: {
|
|
10411
10979
|
const inner = value.inner;
|
|
10412
10980
|
let size = ordinalConverter.allocationSize(2);
|
|
10413
|
-
size += FfiConverterString.allocationSize(inner
|
|
10414
|
-
return size;
|
|
10415
|
-
}
|
|
10416
|
-
case ChainServiceError_Tags.Generic: {
|
|
10417
|
-
const inner = value.inner;
|
|
10418
|
-
let size = ordinalConverter.allocationSize(3);
|
|
10419
|
-
size += FfiConverterString.allocationSize(inner[0]);
|
|
10981
|
+
size += FfiConverterString.allocationSize(inner.fromTokenIdentifier);
|
|
10420
10982
|
return size;
|
|
10421
10983
|
}
|
|
10422
10984
|
default:
|
|
@@ -11836,6 +12398,149 @@ const FfiConverterTypeKeySetType = (() => {
|
|
|
11836
12398
|
return new FFIConverter();
|
|
11837
12399
|
})();
|
|
11838
12400
|
|
|
12401
|
+
// Enum: LnurlCallbackStatus
|
|
12402
|
+
export enum LnurlCallbackStatus_Tags {
|
|
12403
|
+
Ok = 'Ok',
|
|
12404
|
+
ErrorStatus = 'ErrorStatus',
|
|
12405
|
+
}
|
|
12406
|
+
/**
|
|
12407
|
+
* The response from a LNURL-auth callback, indicating success or failure.
|
|
12408
|
+
*/
|
|
12409
|
+
export const LnurlCallbackStatus = (() => {
|
|
12410
|
+
type Ok__interface = {
|
|
12411
|
+
tag: LnurlCallbackStatus_Tags.Ok;
|
|
12412
|
+
};
|
|
12413
|
+
|
|
12414
|
+
/**
|
|
12415
|
+
* On-wire format is: `{"status": "OK"}`
|
|
12416
|
+
*/
|
|
12417
|
+
class Ok_ extends UniffiEnum implements Ok__interface {
|
|
12418
|
+
/**
|
|
12419
|
+
* @private
|
|
12420
|
+
* This field is private and should not be used, use `tag` instead.
|
|
12421
|
+
*/
|
|
12422
|
+
readonly [uniffiTypeNameSymbol] = 'LnurlCallbackStatus';
|
|
12423
|
+
readonly tag = LnurlCallbackStatus_Tags.Ok;
|
|
12424
|
+
constructor() {
|
|
12425
|
+
super('LnurlCallbackStatus', 'Ok');
|
|
12426
|
+
}
|
|
12427
|
+
|
|
12428
|
+
static new(): Ok_ {
|
|
12429
|
+
return new Ok_();
|
|
12430
|
+
}
|
|
12431
|
+
|
|
12432
|
+
static instanceOf(obj: any): obj is Ok_ {
|
|
12433
|
+
return obj.tag === LnurlCallbackStatus_Tags.Ok;
|
|
12434
|
+
}
|
|
12435
|
+
}
|
|
12436
|
+
|
|
12437
|
+
type ErrorStatus__interface = {
|
|
12438
|
+
tag: LnurlCallbackStatus_Tags.ErrorStatus;
|
|
12439
|
+
inner: Readonly<{ errorDetails: LnurlErrorDetails }>;
|
|
12440
|
+
};
|
|
12441
|
+
|
|
12442
|
+
/**
|
|
12443
|
+
* On-wire format is: `{"status": "ERROR", "reason": "error details..."}`
|
|
12444
|
+
*/
|
|
12445
|
+
class ErrorStatus_ extends UniffiEnum implements ErrorStatus__interface {
|
|
12446
|
+
/**
|
|
12447
|
+
* @private
|
|
12448
|
+
* This field is private and should not be used, use `tag` instead.
|
|
12449
|
+
*/
|
|
12450
|
+
readonly [uniffiTypeNameSymbol] = 'LnurlCallbackStatus';
|
|
12451
|
+
readonly tag = LnurlCallbackStatus_Tags.ErrorStatus;
|
|
12452
|
+
readonly inner: Readonly<{ errorDetails: LnurlErrorDetails }>;
|
|
12453
|
+
constructor(inner: { errorDetails: LnurlErrorDetails }) {
|
|
12454
|
+
super('LnurlCallbackStatus', 'ErrorStatus');
|
|
12455
|
+
this.inner = Object.freeze(inner);
|
|
12456
|
+
}
|
|
12457
|
+
|
|
12458
|
+
static new(inner: { errorDetails: LnurlErrorDetails }): ErrorStatus_ {
|
|
12459
|
+
return new ErrorStatus_(inner);
|
|
12460
|
+
}
|
|
12461
|
+
|
|
12462
|
+
static instanceOf(obj: any): obj is ErrorStatus_ {
|
|
12463
|
+
return obj.tag === LnurlCallbackStatus_Tags.ErrorStatus;
|
|
12464
|
+
}
|
|
12465
|
+
}
|
|
12466
|
+
|
|
12467
|
+
function instanceOf(obj: any): obj is LnurlCallbackStatus {
|
|
12468
|
+
return obj[uniffiTypeNameSymbol] === 'LnurlCallbackStatus';
|
|
12469
|
+
}
|
|
12470
|
+
|
|
12471
|
+
return Object.freeze({
|
|
12472
|
+
instanceOf,
|
|
12473
|
+
Ok: Ok_,
|
|
12474
|
+
ErrorStatus: ErrorStatus_,
|
|
12475
|
+
});
|
|
12476
|
+
})();
|
|
12477
|
+
|
|
12478
|
+
/**
|
|
12479
|
+
* The response from a LNURL-auth callback, indicating success or failure.
|
|
12480
|
+
*/
|
|
12481
|
+
|
|
12482
|
+
export type LnurlCallbackStatus = InstanceType<
|
|
12483
|
+
(typeof LnurlCallbackStatus)[keyof Omit<
|
|
12484
|
+
typeof LnurlCallbackStatus,
|
|
12485
|
+
'instanceOf'
|
|
12486
|
+
>]
|
|
12487
|
+
>;
|
|
12488
|
+
|
|
12489
|
+
// FfiConverter for enum LnurlCallbackStatus
|
|
12490
|
+
const FfiConverterTypeLnurlCallbackStatus = (() => {
|
|
12491
|
+
const ordinalConverter = FfiConverterInt32;
|
|
12492
|
+
type TypeName = LnurlCallbackStatus;
|
|
12493
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
12494
|
+
read(from: RustBuffer): TypeName {
|
|
12495
|
+
switch (ordinalConverter.read(from)) {
|
|
12496
|
+
case 1:
|
|
12497
|
+
return new LnurlCallbackStatus.Ok();
|
|
12498
|
+
case 2:
|
|
12499
|
+
return new LnurlCallbackStatus.ErrorStatus({
|
|
12500
|
+
errorDetails: FfiConverterTypeLnurlErrorDetails.read(from),
|
|
12501
|
+
});
|
|
12502
|
+
default:
|
|
12503
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
12504
|
+
}
|
|
12505
|
+
}
|
|
12506
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
12507
|
+
switch (value.tag) {
|
|
12508
|
+
case LnurlCallbackStatus_Tags.Ok: {
|
|
12509
|
+
ordinalConverter.write(1, into);
|
|
12510
|
+
return;
|
|
12511
|
+
}
|
|
12512
|
+
case LnurlCallbackStatus_Tags.ErrorStatus: {
|
|
12513
|
+
ordinalConverter.write(2, into);
|
|
12514
|
+
const inner = value.inner;
|
|
12515
|
+
FfiConverterTypeLnurlErrorDetails.write(inner.errorDetails, into);
|
|
12516
|
+
return;
|
|
12517
|
+
}
|
|
12518
|
+
default:
|
|
12519
|
+
// Throwing from here means that LnurlCallbackStatus_Tags hasn't matched an ordinal.
|
|
12520
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
12521
|
+
}
|
|
12522
|
+
}
|
|
12523
|
+
allocationSize(value: TypeName): number {
|
|
12524
|
+
switch (value.tag) {
|
|
12525
|
+
case LnurlCallbackStatus_Tags.Ok: {
|
|
12526
|
+
return ordinalConverter.allocationSize(1);
|
|
12527
|
+
}
|
|
12528
|
+
case LnurlCallbackStatus_Tags.ErrorStatus: {
|
|
12529
|
+
const inner = value.inner;
|
|
12530
|
+
let size = ordinalConverter.allocationSize(2);
|
|
12531
|
+
size += FfiConverterTypeLnurlErrorDetails.allocationSize(
|
|
12532
|
+
inner.errorDetails
|
|
12533
|
+
);
|
|
12534
|
+
return size;
|
|
12535
|
+
}
|
|
12536
|
+
default:
|
|
12537
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
12538
|
+
}
|
|
12539
|
+
}
|
|
12540
|
+
}
|
|
12541
|
+
return new FFIConverter();
|
|
12542
|
+
})();
|
|
12543
|
+
|
|
11839
12544
|
// Enum: MaxFee
|
|
11840
12545
|
export enum MaxFee_Tags {
|
|
11841
12546
|
Fixed = 'Fixed',
|
|
@@ -12427,7 +13132,7 @@ export const PaymentDetails = (() => {
|
|
|
12427
13132
|
inner: Readonly<{
|
|
12428
13133
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12429
13134
|
htlcDetails: SparkHtlcDetails | undefined;
|
|
12430
|
-
|
|
13135
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12431
13136
|
}>;
|
|
12432
13137
|
};
|
|
12433
13138
|
|
|
@@ -12441,7 +13146,7 @@ export const PaymentDetails = (() => {
|
|
|
12441
13146
|
readonly inner: Readonly<{
|
|
12442
13147
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12443
13148
|
htlcDetails: SparkHtlcDetails | undefined;
|
|
12444
|
-
|
|
13149
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12445
13150
|
}>;
|
|
12446
13151
|
constructor(inner: {
|
|
12447
13152
|
/**
|
|
@@ -12451,8 +13156,8 @@ export const PaymentDetails = (() => {
|
|
|
12451
13156
|
* The HTLC transfer details if the payment fulfilled an HTLC transfer
|
|
12452
13157
|
*/ htlcDetails: SparkHtlcDetails | undefined;
|
|
12453
13158
|
/**
|
|
12454
|
-
* The information for a
|
|
12455
|
-
*/
|
|
13159
|
+
* The information for a conversion
|
|
13160
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12456
13161
|
}) {
|
|
12457
13162
|
super('PaymentDetails', 'Spark');
|
|
12458
13163
|
this.inner = Object.freeze(inner);
|
|
@@ -12466,8 +13171,8 @@ export const PaymentDetails = (() => {
|
|
|
12466
13171
|
* The HTLC transfer details if the payment fulfilled an HTLC transfer
|
|
12467
13172
|
*/ htlcDetails: SparkHtlcDetails | undefined;
|
|
12468
13173
|
/**
|
|
12469
|
-
* The information for a
|
|
12470
|
-
*/
|
|
13174
|
+
* The information for a conversion
|
|
13175
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12471
13176
|
}): Spark_ {
|
|
12472
13177
|
return new Spark_(inner);
|
|
12473
13178
|
}
|
|
@@ -12483,7 +13188,7 @@ export const PaymentDetails = (() => {
|
|
|
12483
13188
|
metadata: TokenMetadata;
|
|
12484
13189
|
txHash: string;
|
|
12485
13190
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12486
|
-
|
|
13191
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12487
13192
|
}>;
|
|
12488
13193
|
};
|
|
12489
13194
|
|
|
@@ -12498,7 +13203,7 @@ export const PaymentDetails = (() => {
|
|
|
12498
13203
|
metadata: TokenMetadata;
|
|
12499
13204
|
txHash: string;
|
|
12500
13205
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12501
|
-
|
|
13206
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12502
13207
|
}>;
|
|
12503
13208
|
constructor(inner: {
|
|
12504
13209
|
metadata: TokenMetadata;
|
|
@@ -12507,8 +13212,8 @@ export const PaymentDetails = (() => {
|
|
|
12507
13212
|
* The invoice details if the payment fulfilled a spark invoice
|
|
12508
13213
|
*/ invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12509
13214
|
/**
|
|
12510
|
-
* The information for a
|
|
12511
|
-
*/
|
|
13215
|
+
* The information for a conversion
|
|
13216
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12512
13217
|
}) {
|
|
12513
13218
|
super('PaymentDetails', 'Token');
|
|
12514
13219
|
this.inner = Object.freeze(inner);
|
|
@@ -12521,8 +13226,8 @@ export const PaymentDetails = (() => {
|
|
|
12521
13226
|
* The invoice details if the payment fulfilled a spark invoice
|
|
12522
13227
|
*/ invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12523
13228
|
/**
|
|
12524
|
-
* The information for a
|
|
12525
|
-
*/
|
|
13229
|
+
* The information for a conversion
|
|
13230
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12526
13231
|
}): Token_ {
|
|
12527
13232
|
return new Token_(inner);
|
|
12528
13233
|
}
|
|
@@ -12715,8 +13420,7 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12715
13420
|
invoiceDetails:
|
|
12716
13421
|
FfiConverterOptionalTypeSparkInvoicePaymentDetails.read(from),
|
|
12717
13422
|
htlcDetails: FfiConverterOptionalTypeSparkHtlcDetails.read(from),
|
|
12718
|
-
|
|
12719
|
-
FfiConverterOptionalTypeTokenConversionInfo.read(from),
|
|
13423
|
+
conversionInfo: FfiConverterOptionalTypeConversionInfo.read(from),
|
|
12720
13424
|
});
|
|
12721
13425
|
case 2:
|
|
12722
13426
|
return new PaymentDetails.Token({
|
|
@@ -12724,8 +13428,7 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12724
13428
|
txHash: FfiConverterString.read(from),
|
|
12725
13429
|
invoiceDetails:
|
|
12726
13430
|
FfiConverterOptionalTypeSparkInvoicePaymentDetails.read(from),
|
|
12727
|
-
|
|
12728
|
-
FfiConverterOptionalTypeTokenConversionInfo.read(from),
|
|
13431
|
+
conversionInfo: FfiConverterOptionalTypeConversionInfo.read(from),
|
|
12729
13432
|
});
|
|
12730
13433
|
case 3:
|
|
12731
13434
|
return new PaymentDetails.Lightning({
|
|
@@ -12765,8 +13468,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12765
13468
|
inner.htlcDetails,
|
|
12766
13469
|
into
|
|
12767
13470
|
);
|
|
12768
|
-
|
|
12769
|
-
inner.
|
|
13471
|
+
FfiConverterOptionalTypeConversionInfo.write(
|
|
13472
|
+
inner.conversionInfo,
|
|
12770
13473
|
into
|
|
12771
13474
|
);
|
|
12772
13475
|
return;
|
|
@@ -12780,8 +13483,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12780
13483
|
inner.invoiceDetails,
|
|
12781
13484
|
into
|
|
12782
13485
|
);
|
|
12783
|
-
|
|
12784
|
-
inner.
|
|
13486
|
+
FfiConverterOptionalTypeConversionInfo.write(
|
|
13487
|
+
inner.conversionInfo,
|
|
12785
13488
|
into
|
|
12786
13489
|
);
|
|
12787
13490
|
return;
|
|
@@ -12834,8 +13537,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12834
13537
|
size += FfiConverterOptionalTypeSparkHtlcDetails.allocationSize(
|
|
12835
13538
|
inner.htlcDetails
|
|
12836
13539
|
);
|
|
12837
|
-
size +=
|
|
12838
|
-
inner.
|
|
13540
|
+
size += FfiConverterOptionalTypeConversionInfo.allocationSize(
|
|
13541
|
+
inner.conversionInfo
|
|
12839
13542
|
);
|
|
12840
13543
|
return size;
|
|
12841
13544
|
}
|
|
@@ -12848,8 +13551,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12848
13551
|
FfiConverterOptionalTypeSparkInvoicePaymentDetails.allocationSize(
|
|
12849
13552
|
inner.invoiceDetails
|
|
12850
13553
|
);
|
|
12851
|
-
size +=
|
|
12852
|
-
inner.
|
|
13554
|
+
size += FfiConverterOptionalTypeConversionInfo.allocationSize(
|
|
13555
|
+
inner.conversionInfo
|
|
12853
13556
|
);
|
|
12854
13557
|
return size;
|
|
12855
13558
|
}
|
|
@@ -13727,7 +14430,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13727
14430
|
* If empty, it is a Bitcoin payment
|
|
13728
14431
|
*/ tokenIdentifier: string | undefined;
|
|
13729
14432
|
/**
|
|
13730
|
-
* The expiry time of the invoice
|
|
14433
|
+
* The expiry time of the invoice as a unix timestamp in seconds
|
|
13731
14434
|
*/ expiryTime: /*u64*/ bigint | undefined;
|
|
13732
14435
|
/**
|
|
13733
14436
|
* A description to embed in the invoice.
|
|
@@ -13749,7 +14452,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13749
14452
|
* If empty, it is a Bitcoin payment
|
|
13750
14453
|
*/ tokenIdentifier: string | undefined;
|
|
13751
14454
|
/**
|
|
13752
|
-
* The expiry time of the invoice
|
|
14455
|
+
* The expiry time of the invoice as a unix timestamp in seconds
|
|
13753
14456
|
*/ expiryTime: /*u64*/ bigint | undefined;
|
|
13754
14457
|
/**
|
|
13755
14458
|
* A description to embed in the invoice.
|
|
@@ -13818,7 +14521,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13818
14521
|
description: string;
|
|
13819
14522
|
amountSats: /*u64*/ bigint | undefined;
|
|
13820
14523
|
/**
|
|
13821
|
-
* The expiry
|
|
14524
|
+
* The expiry of the invoice as a duration in seconds
|
|
13822
14525
|
*/ expirySecs: /*u32*/ number | undefined;
|
|
13823
14526
|
}) {
|
|
13824
14527
|
super('ReceivePaymentMethod', 'Bolt11Invoice');
|
|
@@ -13829,7 +14532,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13829
14532
|
description: string;
|
|
13830
14533
|
amountSats: /*u64*/ bigint | undefined;
|
|
13831
14534
|
/**
|
|
13832
|
-
* The expiry
|
|
14535
|
+
* The expiry of the invoice as a duration in seconds
|
|
13833
14536
|
*/ expirySecs: /*u32*/ number | undefined;
|
|
13834
14537
|
}): Bolt11Invoice_ {
|
|
13835
14538
|
return new Bolt11Invoice_(inner);
|
|
@@ -17626,235 +18329,101 @@ export const SyncStorageError = (() => {
|
|
|
17626
18329
|
return obj.tag === SyncStorageError_Tags.Serialization;
|
|
17627
18330
|
}
|
|
17628
18331
|
|
|
17629
|
-
static hasInner(obj: any): obj is Serialization_ {
|
|
17630
|
-
return Serialization_.instanceOf(obj);
|
|
17631
|
-
}
|
|
17632
|
-
|
|
17633
|
-
static getInner(obj: Serialization_): Readonly<[string]> {
|
|
17634
|
-
return obj.inner;
|
|
17635
|
-
}
|
|
17636
|
-
}
|
|
17637
|
-
|
|
17638
|
-
function instanceOf(obj: any): obj is SyncStorageError {
|
|
17639
|
-
return obj[uniffiTypeNameSymbol] === 'SyncStorageError';
|
|
17640
|
-
}
|
|
17641
|
-
|
|
17642
|
-
return Object.freeze({
|
|
17643
|
-
instanceOf,
|
|
17644
|
-
Implementation: Implementation_,
|
|
17645
|
-
InitializationError: InitializationError_,
|
|
17646
|
-
Serialization: Serialization_,
|
|
17647
|
-
});
|
|
17648
|
-
})();
|
|
17649
|
-
|
|
17650
|
-
/**
|
|
17651
|
-
* Errors that can occur during storage operations
|
|
17652
|
-
*/
|
|
17653
|
-
|
|
17654
|
-
export type SyncStorageError = InstanceType<
|
|
17655
|
-
(typeof SyncStorageError)[keyof Omit<typeof SyncStorageError, 'instanceOf'>]
|
|
17656
|
-
>;
|
|
17657
|
-
|
|
17658
|
-
// FfiConverter for enum SyncStorageError
|
|
17659
|
-
const FfiConverterTypeSyncStorageError = (() => {
|
|
17660
|
-
const ordinalConverter = FfiConverterInt32;
|
|
17661
|
-
type TypeName = SyncStorageError;
|
|
17662
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
17663
|
-
read(from: RustBuffer): TypeName {
|
|
17664
|
-
switch (ordinalConverter.read(from)) {
|
|
17665
|
-
case 1:
|
|
17666
|
-
return new SyncStorageError.Implementation(
|
|
17667
|
-
FfiConverterString.read(from)
|
|
17668
|
-
);
|
|
17669
|
-
case 2:
|
|
17670
|
-
return new SyncStorageError.InitializationError(
|
|
17671
|
-
FfiConverterString.read(from)
|
|
17672
|
-
);
|
|
17673
|
-
case 3:
|
|
17674
|
-
return new SyncStorageError.Serialization(
|
|
17675
|
-
FfiConverterString.read(from)
|
|
17676
|
-
);
|
|
17677
|
-
default:
|
|
17678
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17679
|
-
}
|
|
17680
|
-
}
|
|
17681
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
17682
|
-
switch (value.tag) {
|
|
17683
|
-
case SyncStorageError_Tags.Implementation: {
|
|
17684
|
-
ordinalConverter.write(1, into);
|
|
17685
|
-
const inner = value.inner;
|
|
17686
|
-
FfiConverterString.write(inner[0], into);
|
|
17687
|
-
return;
|
|
17688
|
-
}
|
|
17689
|
-
case SyncStorageError_Tags.InitializationError: {
|
|
17690
|
-
ordinalConverter.write(2, into);
|
|
17691
|
-
const inner = value.inner;
|
|
17692
|
-
FfiConverterString.write(inner[0], into);
|
|
17693
|
-
return;
|
|
17694
|
-
}
|
|
17695
|
-
case SyncStorageError_Tags.Serialization: {
|
|
17696
|
-
ordinalConverter.write(3, into);
|
|
17697
|
-
const inner = value.inner;
|
|
17698
|
-
FfiConverterString.write(inner[0], into);
|
|
17699
|
-
return;
|
|
17700
|
-
}
|
|
17701
|
-
default:
|
|
17702
|
-
// Throwing from here means that SyncStorageError_Tags hasn't matched an ordinal.
|
|
17703
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17704
|
-
}
|
|
17705
|
-
}
|
|
17706
|
-
allocationSize(value: TypeName): number {
|
|
17707
|
-
switch (value.tag) {
|
|
17708
|
-
case SyncStorageError_Tags.Implementation: {
|
|
17709
|
-
const inner = value.inner;
|
|
17710
|
-
let size = ordinalConverter.allocationSize(1);
|
|
17711
|
-
size += FfiConverterString.allocationSize(inner[0]);
|
|
17712
|
-
return size;
|
|
17713
|
-
}
|
|
17714
|
-
case SyncStorageError_Tags.InitializationError: {
|
|
17715
|
-
const inner = value.inner;
|
|
17716
|
-
let size = ordinalConverter.allocationSize(2);
|
|
17717
|
-
size += FfiConverterString.allocationSize(inner[0]);
|
|
17718
|
-
return size;
|
|
17719
|
-
}
|
|
17720
|
-
case SyncStorageError_Tags.Serialization: {
|
|
17721
|
-
const inner = value.inner;
|
|
17722
|
-
let size = ordinalConverter.allocationSize(3);
|
|
17723
|
-
size += FfiConverterString.allocationSize(inner[0]);
|
|
17724
|
-
return size;
|
|
17725
|
-
}
|
|
17726
|
-
default:
|
|
17727
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17728
|
-
}
|
|
17729
|
-
}
|
|
17730
|
-
}
|
|
17731
|
-
return new FFIConverter();
|
|
17732
|
-
})();
|
|
17733
|
-
|
|
17734
|
-
// Enum: TokenConversionType
|
|
17735
|
-
export enum TokenConversionType_Tags {
|
|
17736
|
-
FromBitcoin = 'FromBitcoin',
|
|
17737
|
-
ToBitcoin = 'ToBitcoin',
|
|
17738
|
-
}
|
|
17739
|
-
export const TokenConversionType = (() => {
|
|
17740
|
-
type FromBitcoin__interface = {
|
|
17741
|
-
tag: TokenConversionType_Tags.FromBitcoin;
|
|
17742
|
-
};
|
|
17743
|
-
|
|
17744
|
-
/**
|
|
17745
|
-
* Converting from Bitcoin to a token
|
|
17746
|
-
*/
|
|
17747
|
-
class FromBitcoin_ extends UniffiEnum implements FromBitcoin__interface {
|
|
17748
|
-
/**
|
|
17749
|
-
* @private
|
|
17750
|
-
* This field is private and should not be used, use `tag` instead.
|
|
17751
|
-
*/
|
|
17752
|
-
readonly [uniffiTypeNameSymbol] = 'TokenConversionType';
|
|
17753
|
-
readonly tag = TokenConversionType_Tags.FromBitcoin;
|
|
17754
|
-
constructor() {
|
|
17755
|
-
super('TokenConversionType', 'FromBitcoin');
|
|
17756
|
-
}
|
|
17757
|
-
|
|
17758
|
-
static new(): FromBitcoin_ {
|
|
17759
|
-
return new FromBitcoin_();
|
|
17760
|
-
}
|
|
17761
|
-
|
|
17762
|
-
static instanceOf(obj: any): obj is FromBitcoin_ {
|
|
17763
|
-
return obj.tag === TokenConversionType_Tags.FromBitcoin;
|
|
17764
|
-
}
|
|
17765
|
-
}
|
|
17766
|
-
|
|
17767
|
-
type ToBitcoin__interface = {
|
|
17768
|
-
tag: TokenConversionType_Tags.ToBitcoin;
|
|
17769
|
-
inner: Readonly<{ fromTokenIdentifier: string }>;
|
|
17770
|
-
};
|
|
17771
|
-
|
|
17772
|
-
/**
|
|
17773
|
-
* Converting from a token to Bitcoin
|
|
17774
|
-
*/
|
|
17775
|
-
class ToBitcoin_ extends UniffiEnum implements ToBitcoin__interface {
|
|
17776
|
-
/**
|
|
17777
|
-
* @private
|
|
17778
|
-
* This field is private and should not be used, use `tag` instead.
|
|
17779
|
-
*/
|
|
17780
|
-
readonly [uniffiTypeNameSymbol] = 'TokenConversionType';
|
|
17781
|
-
readonly tag = TokenConversionType_Tags.ToBitcoin;
|
|
17782
|
-
readonly inner: Readonly<{ fromTokenIdentifier: string }>;
|
|
17783
|
-
constructor(inner: { fromTokenIdentifier: string }) {
|
|
17784
|
-
super('TokenConversionType', 'ToBitcoin');
|
|
17785
|
-
this.inner = Object.freeze(inner);
|
|
17786
|
-
}
|
|
17787
|
-
|
|
17788
|
-
static new(inner: { fromTokenIdentifier: string }): ToBitcoin_ {
|
|
17789
|
-
return new ToBitcoin_(inner);
|
|
18332
|
+
static hasInner(obj: any): obj is Serialization_ {
|
|
18333
|
+
return Serialization_.instanceOf(obj);
|
|
17790
18334
|
}
|
|
17791
18335
|
|
|
17792
|
-
static
|
|
17793
|
-
return obj.
|
|
18336
|
+
static getInner(obj: Serialization_): Readonly<[string]> {
|
|
18337
|
+
return obj.inner;
|
|
17794
18338
|
}
|
|
17795
18339
|
}
|
|
17796
18340
|
|
|
17797
|
-
function instanceOf(obj: any): obj is
|
|
17798
|
-
return obj[uniffiTypeNameSymbol] === '
|
|
18341
|
+
function instanceOf(obj: any): obj is SyncStorageError {
|
|
18342
|
+
return obj[uniffiTypeNameSymbol] === 'SyncStorageError';
|
|
17799
18343
|
}
|
|
17800
18344
|
|
|
17801
18345
|
return Object.freeze({
|
|
17802
18346
|
instanceOf,
|
|
17803
|
-
|
|
17804
|
-
|
|
18347
|
+
Implementation: Implementation_,
|
|
18348
|
+
InitializationError: InitializationError_,
|
|
18349
|
+
Serialization: Serialization_,
|
|
17805
18350
|
});
|
|
17806
18351
|
})();
|
|
17807
18352
|
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
|
|
18353
|
+
/**
|
|
18354
|
+
* Errors that can occur during storage operations
|
|
18355
|
+
*/
|
|
18356
|
+
|
|
18357
|
+
export type SyncStorageError = InstanceType<
|
|
18358
|
+
(typeof SyncStorageError)[keyof Omit<typeof SyncStorageError, 'instanceOf'>]
|
|
17813
18359
|
>;
|
|
17814
18360
|
|
|
17815
|
-
// FfiConverter for enum
|
|
17816
|
-
const
|
|
18361
|
+
// FfiConverter for enum SyncStorageError
|
|
18362
|
+
const FfiConverterTypeSyncStorageError = (() => {
|
|
17817
18363
|
const ordinalConverter = FfiConverterInt32;
|
|
17818
|
-
type TypeName =
|
|
18364
|
+
type TypeName = SyncStorageError;
|
|
17819
18365
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
17820
18366
|
read(from: RustBuffer): TypeName {
|
|
17821
18367
|
switch (ordinalConverter.read(from)) {
|
|
17822
18368
|
case 1:
|
|
17823
|
-
return new
|
|
18369
|
+
return new SyncStorageError.Implementation(
|
|
18370
|
+
FfiConverterString.read(from)
|
|
18371
|
+
);
|
|
17824
18372
|
case 2:
|
|
17825
|
-
return new
|
|
17826
|
-
|
|
17827
|
-
|
|
18373
|
+
return new SyncStorageError.InitializationError(
|
|
18374
|
+
FfiConverterString.read(from)
|
|
18375
|
+
);
|
|
18376
|
+
case 3:
|
|
18377
|
+
return new SyncStorageError.Serialization(
|
|
18378
|
+
FfiConverterString.read(from)
|
|
18379
|
+
);
|
|
17828
18380
|
default:
|
|
17829
18381
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17830
18382
|
}
|
|
17831
18383
|
}
|
|
17832
18384
|
write(value: TypeName, into: RustBuffer): void {
|
|
17833
18385
|
switch (value.tag) {
|
|
17834
|
-
case
|
|
18386
|
+
case SyncStorageError_Tags.Implementation: {
|
|
17835
18387
|
ordinalConverter.write(1, into);
|
|
18388
|
+
const inner = value.inner;
|
|
18389
|
+
FfiConverterString.write(inner[0], into);
|
|
17836
18390
|
return;
|
|
17837
18391
|
}
|
|
17838
|
-
case
|
|
18392
|
+
case SyncStorageError_Tags.InitializationError: {
|
|
17839
18393
|
ordinalConverter.write(2, into);
|
|
17840
18394
|
const inner = value.inner;
|
|
17841
|
-
FfiConverterString.write(inner
|
|
18395
|
+
FfiConverterString.write(inner[0], into);
|
|
18396
|
+
return;
|
|
18397
|
+
}
|
|
18398
|
+
case SyncStorageError_Tags.Serialization: {
|
|
18399
|
+
ordinalConverter.write(3, into);
|
|
18400
|
+
const inner = value.inner;
|
|
18401
|
+
FfiConverterString.write(inner[0], into);
|
|
17842
18402
|
return;
|
|
17843
18403
|
}
|
|
17844
18404
|
default:
|
|
17845
|
-
// Throwing from here means that
|
|
18405
|
+
// Throwing from here means that SyncStorageError_Tags hasn't matched an ordinal.
|
|
17846
18406
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17847
18407
|
}
|
|
17848
18408
|
}
|
|
17849
18409
|
allocationSize(value: TypeName): number {
|
|
17850
18410
|
switch (value.tag) {
|
|
17851
|
-
case
|
|
17852
|
-
|
|
18411
|
+
case SyncStorageError_Tags.Implementation: {
|
|
18412
|
+
const inner = value.inner;
|
|
18413
|
+
let size = ordinalConverter.allocationSize(1);
|
|
18414
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
18415
|
+
return size;
|
|
17853
18416
|
}
|
|
17854
|
-
case
|
|
18417
|
+
case SyncStorageError_Tags.InitializationError: {
|
|
17855
18418
|
const inner = value.inner;
|
|
17856
18419
|
let size = ordinalConverter.allocationSize(2);
|
|
17857
|
-
size += FfiConverterString.allocationSize(inner
|
|
18420
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
18421
|
+
return size;
|
|
18422
|
+
}
|
|
18423
|
+
case SyncStorageError_Tags.Serialization: {
|
|
18424
|
+
const inner = value.inner;
|
|
18425
|
+
let size = ordinalConverter.allocationSize(3);
|
|
18426
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
17858
18427
|
return size;
|
|
17859
18428
|
}
|
|
17860
18429
|
default:
|
|
@@ -18643,10 +19212,10 @@ export interface BreezSdkInterface {
|
|
|
18643
19212
|
* Result containing either success or an `SdkError` if the background task couldn't be stopped
|
|
18644
19213
|
*/
|
|
18645
19214
|
disconnect(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
|
|
18646
|
-
|
|
18647
|
-
request:
|
|
19215
|
+
fetchConversionLimits(
|
|
19216
|
+
request: FetchConversionLimitsRequest,
|
|
18648
19217
|
asyncOpts_?: { signal: AbortSignal }
|
|
18649
|
-
): /*throws*/ Promise<
|
|
19218
|
+
): /*throws*/ Promise<FetchConversionLimitsResponse>;
|
|
18650
19219
|
/**
|
|
18651
19220
|
* Returns the balance of the wallet in satoshis
|
|
18652
19221
|
*/
|
|
@@ -18726,6 +19295,59 @@ export interface BreezSdkInterface {
|
|
|
18726
19295
|
request: ListUnclaimedDepositsRequest,
|
|
18727
19296
|
asyncOpts_?: { signal: AbortSignal }
|
|
18728
19297
|
): /*throws*/ Promise<ListUnclaimedDepositsResponse>;
|
|
19298
|
+
/**
|
|
19299
|
+
* Performs LNURL-auth with the service.
|
|
19300
|
+
*
|
|
19301
|
+
* This method implements the LNURL-auth protocol as specified in LUD-04 and LUD-05.
|
|
19302
|
+
* It derives a domain-specific linking key, signs the challenge, and sends the
|
|
19303
|
+
* authentication request to the service.
|
|
19304
|
+
*
|
|
19305
|
+
* # Arguments
|
|
19306
|
+
*
|
|
19307
|
+
* * `request_data` - The parsed LNURL-auth request details obtained from [`parse`]
|
|
19308
|
+
*
|
|
19309
|
+
* # Returns
|
|
19310
|
+
*
|
|
19311
|
+
* * `Ok(LnurlCallbackStatus::Ok)` - Authentication was successful
|
|
19312
|
+
* * `Ok(LnurlCallbackStatus::ErrorStatus{reason})` - Service returned an error
|
|
19313
|
+
* * `Err(SdkError)` - An error occurred during the authentication process
|
|
19314
|
+
*
|
|
19315
|
+
* # Example
|
|
19316
|
+
*
|
|
19317
|
+
* ```rust,no_run
|
|
19318
|
+
* # use breez_sdk_spark::{BreezSdk, InputType};
|
|
19319
|
+
* # async fn example(sdk: BreezSdk) -> Result<(), Box<dyn std::error::Error>> {
|
|
19320
|
+
* // 1. Parse the LNURL-auth string
|
|
19321
|
+
* let input = sdk.parse("lnurl1...").await?;
|
|
19322
|
+
* let auth_request = match input {
|
|
19323
|
+
* InputType::LnurlAuth(data) => data,
|
|
19324
|
+
* _ => return Err("Not an auth request".into()),
|
|
19325
|
+
* };
|
|
19326
|
+
*
|
|
19327
|
+
* // 2. Show user the domain and get confirmation
|
|
19328
|
+
* println!("Authenticate with {}?", auth_request.domain);
|
|
19329
|
+
*
|
|
19330
|
+
* // 3. Perform authentication
|
|
19331
|
+
* let status = sdk.lnurl_auth(auth_request).await?;
|
|
19332
|
+
* match status {
|
|
19333
|
+
* breez_sdk_spark::LnurlCallbackStatus::Ok => println!("Success!"),
|
|
19334
|
+
* breez_sdk_spark::LnurlCallbackStatus::ErrorStatus { error_details } => {
|
|
19335
|
+
* println!("Error: {}", error_details.reason)
|
|
19336
|
+
* }
|
|
19337
|
+
* }
|
|
19338
|
+
* # Ok(())
|
|
19339
|
+
* # }
|
|
19340
|
+
* ```
|
|
19341
|
+
*
|
|
19342
|
+
* # See Also
|
|
19343
|
+
*
|
|
19344
|
+
* * LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
|
|
19345
|
+
* * LUD-05: <https://github.com/lnurl/luds/blob/luds/05.md>
|
|
19346
|
+
*/
|
|
19347
|
+
lnurlAuth(
|
|
19348
|
+
requestData: LnurlAuthRequestDetails,
|
|
19349
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
19350
|
+
): /*throws*/ Promise<LnurlCallbackStatus>;
|
|
18729
19351
|
lnurlPay(
|
|
18730
19352
|
request: LnurlPayRequest,
|
|
18731
19353
|
asyncOpts_?: { signal: AbortSignal }
|
|
@@ -19193,18 +19815,18 @@ export class BreezSdk
|
|
|
19193
19815
|
}
|
|
19194
19816
|
}
|
|
19195
19817
|
|
|
19196
|
-
public async
|
|
19197
|
-
request:
|
|
19818
|
+
public async fetchConversionLimits(
|
|
19819
|
+
request: FetchConversionLimitsRequest,
|
|
19198
19820
|
asyncOpts_?: { signal: AbortSignal }
|
|
19199
|
-
): Promise<
|
|
19821
|
+
): Promise<FetchConversionLimitsResponse> /*throws*/ {
|
|
19200
19822
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
19201
19823
|
try {
|
|
19202
19824
|
return await uniffiRustCallAsync(
|
|
19203
19825
|
/*rustCaller:*/ uniffiCaller,
|
|
19204
19826
|
/*rustFutureFunc:*/ () => {
|
|
19205
|
-
return nativeModule().
|
|
19827
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_fetch_conversion_limits(
|
|
19206
19828
|
uniffiTypeBreezSdkObjectFactory.clonePointer(this),
|
|
19207
|
-
|
|
19829
|
+
FfiConverterTypeFetchConversionLimitsRequest.lower(request)
|
|
19208
19830
|
);
|
|
19209
19831
|
},
|
|
19210
19832
|
/*pollFunc:*/ nativeModule()
|
|
@@ -19215,8 +19837,8 @@ export class BreezSdk
|
|
|
19215
19837
|
.ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
19216
19838
|
/*freeFunc:*/ nativeModule()
|
|
19217
19839
|
.ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
19218
|
-
/*liftFunc:*/
|
|
19219
|
-
|
|
19840
|
+
/*liftFunc:*/ FfiConverterTypeFetchConversionLimitsResponse.lift.bind(
|
|
19841
|
+
FfiConverterTypeFetchConversionLimitsResponse
|
|
19220
19842
|
),
|
|
19221
19843
|
/*liftString:*/ FfiConverterString.lift,
|
|
19222
19844
|
/*asyncOpts:*/ asyncOpts_,
|
|
@@ -19648,6 +20270,94 @@ export class BreezSdk
|
|
|
19648
20270
|
}
|
|
19649
20271
|
}
|
|
19650
20272
|
|
|
20273
|
+
/**
|
|
20274
|
+
* Performs LNURL-auth with the service.
|
|
20275
|
+
*
|
|
20276
|
+
* This method implements the LNURL-auth protocol as specified in LUD-04 and LUD-05.
|
|
20277
|
+
* It derives a domain-specific linking key, signs the challenge, and sends the
|
|
20278
|
+
* authentication request to the service.
|
|
20279
|
+
*
|
|
20280
|
+
* # Arguments
|
|
20281
|
+
*
|
|
20282
|
+
* * `request_data` - The parsed LNURL-auth request details obtained from [`parse`]
|
|
20283
|
+
*
|
|
20284
|
+
* # Returns
|
|
20285
|
+
*
|
|
20286
|
+
* * `Ok(LnurlCallbackStatus::Ok)` - Authentication was successful
|
|
20287
|
+
* * `Ok(LnurlCallbackStatus::ErrorStatus{reason})` - Service returned an error
|
|
20288
|
+
* * `Err(SdkError)` - An error occurred during the authentication process
|
|
20289
|
+
*
|
|
20290
|
+
* # Example
|
|
20291
|
+
*
|
|
20292
|
+
* ```rust,no_run
|
|
20293
|
+
* # use breez_sdk_spark::{BreezSdk, InputType};
|
|
20294
|
+
* # async fn example(sdk: BreezSdk) -> Result<(), Box<dyn std::error::Error>> {
|
|
20295
|
+
* // 1. Parse the LNURL-auth string
|
|
20296
|
+
* let input = sdk.parse("lnurl1...").await?;
|
|
20297
|
+
* let auth_request = match input {
|
|
20298
|
+
* InputType::LnurlAuth(data) => data,
|
|
20299
|
+
* _ => return Err("Not an auth request".into()),
|
|
20300
|
+
* };
|
|
20301
|
+
*
|
|
20302
|
+
* // 2. Show user the domain and get confirmation
|
|
20303
|
+
* println!("Authenticate with {}?", auth_request.domain);
|
|
20304
|
+
*
|
|
20305
|
+
* // 3. Perform authentication
|
|
20306
|
+
* let status = sdk.lnurl_auth(auth_request).await?;
|
|
20307
|
+
* match status {
|
|
20308
|
+
* breez_sdk_spark::LnurlCallbackStatus::Ok => println!("Success!"),
|
|
20309
|
+
* breez_sdk_spark::LnurlCallbackStatus::ErrorStatus { error_details } => {
|
|
20310
|
+
* println!("Error: {}", error_details.reason)
|
|
20311
|
+
* }
|
|
20312
|
+
* }
|
|
20313
|
+
* # Ok(())
|
|
20314
|
+
* # }
|
|
20315
|
+
* ```
|
|
20316
|
+
*
|
|
20317
|
+
* # See Also
|
|
20318
|
+
*
|
|
20319
|
+
* * LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
|
|
20320
|
+
* * LUD-05: <https://github.com/lnurl/luds/blob/luds/05.md>
|
|
20321
|
+
*/
|
|
20322
|
+
public async lnurlAuth(
|
|
20323
|
+
requestData: LnurlAuthRequestDetails,
|
|
20324
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
20325
|
+
): Promise<LnurlCallbackStatus> /*throws*/ {
|
|
20326
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
20327
|
+
try {
|
|
20328
|
+
return await uniffiRustCallAsync(
|
|
20329
|
+
/*rustCaller:*/ uniffiCaller,
|
|
20330
|
+
/*rustFutureFunc:*/ () => {
|
|
20331
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_auth(
|
|
20332
|
+
uniffiTypeBreezSdkObjectFactory.clonePointer(this),
|
|
20333
|
+
FfiConverterTypeLnurlAuthRequestDetails.lower(requestData)
|
|
20334
|
+
);
|
|
20335
|
+
},
|
|
20336
|
+
/*pollFunc:*/ nativeModule()
|
|
20337
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
20338
|
+
/*cancelFunc:*/ nativeModule()
|
|
20339
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
|
|
20340
|
+
/*completeFunc:*/ nativeModule()
|
|
20341
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
20342
|
+
/*freeFunc:*/ nativeModule()
|
|
20343
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
20344
|
+
/*liftFunc:*/ FfiConverterTypeLnurlCallbackStatus.lift.bind(
|
|
20345
|
+
FfiConverterTypeLnurlCallbackStatus
|
|
20346
|
+
),
|
|
20347
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
20348
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
20349
|
+
/*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
|
|
20350
|
+
FfiConverterTypeSdkError
|
|
20351
|
+
)
|
|
20352
|
+
);
|
|
20353
|
+
} catch (__error: any) {
|
|
20354
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
20355
|
+
__error.stack = __stack;
|
|
20356
|
+
}
|
|
20357
|
+
throw __error;
|
|
20358
|
+
}
|
|
20359
|
+
}
|
|
20360
|
+
|
|
19651
20361
|
public async lnurlPay(
|
|
19652
20362
|
request: LnurlPayRequest,
|
|
19653
20363
|
asyncOpts_?: { signal: AbortSignal }
|
|
@@ -20376,30 +21086,34 @@ export interface ExternalSigner {
|
|
|
20376
21086
|
/**
|
|
20377
21087
|
* Signs a message using ECDSA at the given derivation path.
|
|
20378
21088
|
*
|
|
21089
|
+
* The message should be a 32-byte digest (typically a hash of the original data).
|
|
21090
|
+
*
|
|
20379
21091
|
* # Arguments
|
|
20380
|
-
* * `message` - The message to sign
|
|
21092
|
+
* * `message` - The 32-byte message digest to sign
|
|
20381
21093
|
* * `path` - BIP32 derivation path as a string
|
|
20382
21094
|
*
|
|
20383
21095
|
* # Returns
|
|
20384
21096
|
* 64-byte compact ECDSA signature, or a `SignerError`
|
|
20385
21097
|
*/
|
|
20386
21098
|
signEcdsa(
|
|
20387
|
-
message:
|
|
21099
|
+
message: MessageBytes,
|
|
20388
21100
|
path: string,
|
|
20389
21101
|
asyncOpts_?: { signal: AbortSignal }
|
|
20390
21102
|
): /*throws*/ Promise<EcdsaSignatureBytes>;
|
|
20391
21103
|
/**
|
|
20392
21104
|
* Signs a message using recoverable ECDSA at the given derivation path.
|
|
20393
21105
|
*
|
|
21106
|
+
* The message should be a 32-byte digest (typically a hash of the original data).
|
|
21107
|
+
*
|
|
20394
21108
|
* # Arguments
|
|
20395
|
-
* * `message` - The message to sign
|
|
21109
|
+
* * `message` - The 32-byte message digest to sign
|
|
20396
21110
|
* * `path` - BIP32 derivation path as a string
|
|
20397
21111
|
*
|
|
20398
21112
|
* # Returns
|
|
20399
21113
|
* 65 bytes: recovery ID (31 + `recovery_id`) + 64-byte signature, or a `SignerError`
|
|
20400
21114
|
*/
|
|
20401
21115
|
signEcdsaRecoverable(
|
|
20402
|
-
message:
|
|
21116
|
+
message: MessageBytes,
|
|
20403
21117
|
path: string,
|
|
20404
21118
|
asyncOpts_?: { signal: AbortSignal }
|
|
20405
21119
|
): /*throws*/ Promise<RecoverableEcdsaSignatureBytes>;
|
|
@@ -20448,6 +21162,21 @@ export interface ExternalSigner {
|
|
|
20448
21162
|
path: string,
|
|
20449
21163
|
asyncOpts_?: { signal: AbortSignal }
|
|
20450
21164
|
): /*throws*/ Promise<SchnorrSignatureBytes>;
|
|
21165
|
+
/**
|
|
21166
|
+
* HMAC-SHA256 of a message at the given derivation path.
|
|
21167
|
+
*
|
|
21168
|
+
* # Arguments
|
|
21169
|
+
* * `message` - The message to hash
|
|
21170
|
+
* * `path` - BIP32 derivation path as a string
|
|
21171
|
+
*
|
|
21172
|
+
* # Returns
|
|
21173
|
+
* 32-byte HMAC-SHA256, or a `SignerError`
|
|
21174
|
+
*/
|
|
21175
|
+
hmacSha256(
|
|
21176
|
+
message: ArrayBuffer,
|
|
21177
|
+
path: string,
|
|
21178
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
21179
|
+
): /*throws*/ Promise<HashedMessageBytes>;
|
|
20451
21180
|
/**
|
|
20452
21181
|
* Generates Frost signing commitments for multi-party signing.
|
|
20453
21182
|
*
|
|
@@ -20705,15 +21434,17 @@ export class ExternalSignerImpl
|
|
|
20705
21434
|
/**
|
|
20706
21435
|
* Signs a message using ECDSA at the given derivation path.
|
|
20707
21436
|
*
|
|
21437
|
+
* The message should be a 32-byte digest (typically a hash of the original data).
|
|
21438
|
+
*
|
|
20708
21439
|
* # Arguments
|
|
20709
|
-
* * `message` - The message to sign
|
|
21440
|
+
* * `message` - The 32-byte message digest to sign
|
|
20710
21441
|
* * `path` - BIP32 derivation path as a string
|
|
20711
21442
|
*
|
|
20712
21443
|
* # Returns
|
|
20713
21444
|
* 64-byte compact ECDSA signature, or a `SignerError`
|
|
20714
21445
|
*/
|
|
20715
21446
|
public async signEcdsa(
|
|
20716
|
-
message:
|
|
21447
|
+
message: MessageBytes,
|
|
20717
21448
|
path: string,
|
|
20718
21449
|
asyncOpts_?: { signal: AbortSignal }
|
|
20719
21450
|
): Promise<EcdsaSignatureBytes> /*throws*/ {
|
|
@@ -20724,7 +21455,7 @@ export class ExternalSignerImpl
|
|
|
20724
21455
|
/*rustFutureFunc:*/ () => {
|
|
20725
21456
|
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_sign_ecdsa(
|
|
20726
21457
|
uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
|
|
20727
|
-
|
|
21458
|
+
FfiConverterTypeMessageBytes.lower(message),
|
|
20728
21459
|
FfiConverterString.lower(path)
|
|
20729
21460
|
);
|
|
20730
21461
|
},
|
|
@@ -20756,15 +21487,17 @@ export class ExternalSignerImpl
|
|
|
20756
21487
|
/**
|
|
20757
21488
|
* Signs a message using recoverable ECDSA at the given derivation path.
|
|
20758
21489
|
*
|
|
21490
|
+
* The message should be a 32-byte digest (typically a hash of the original data).
|
|
21491
|
+
*
|
|
20759
21492
|
* # Arguments
|
|
20760
|
-
* * `message` - The message to sign
|
|
21493
|
+
* * `message` - The 32-byte message digest to sign
|
|
20761
21494
|
* * `path` - BIP32 derivation path as a string
|
|
20762
21495
|
*
|
|
20763
21496
|
* # Returns
|
|
20764
21497
|
* 65 bytes: recovery ID (31 + `recovery_id`) + 64-byte signature, or a `SignerError`
|
|
20765
21498
|
*/
|
|
20766
21499
|
public async signEcdsaRecoverable(
|
|
20767
|
-
message:
|
|
21500
|
+
message: MessageBytes,
|
|
20768
21501
|
path: string,
|
|
20769
21502
|
asyncOpts_?: { signal: AbortSignal }
|
|
20770
21503
|
): Promise<RecoverableEcdsaSignatureBytes> /*throws*/ {
|
|
@@ -20775,7 +21508,7 @@ export class ExternalSignerImpl
|
|
|
20775
21508
|
/*rustFutureFunc:*/ () => {
|
|
20776
21509
|
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_sign_ecdsa_recoverable(
|
|
20777
21510
|
uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
|
|
20778
|
-
|
|
21511
|
+
FfiConverterTypeMessageBytes.lower(message),
|
|
20779
21512
|
FfiConverterString.lower(path)
|
|
20780
21513
|
);
|
|
20781
21514
|
},
|
|
@@ -20957,6 +21690,57 @@ export class ExternalSignerImpl
|
|
|
20957
21690
|
}
|
|
20958
21691
|
}
|
|
20959
21692
|
|
|
21693
|
+
/**
|
|
21694
|
+
* HMAC-SHA256 of a message at the given derivation path.
|
|
21695
|
+
*
|
|
21696
|
+
* # Arguments
|
|
21697
|
+
* * `message` - The message to hash
|
|
21698
|
+
* * `path` - BIP32 derivation path as a string
|
|
21699
|
+
*
|
|
21700
|
+
* # Returns
|
|
21701
|
+
* 32-byte HMAC-SHA256, or a `SignerError`
|
|
21702
|
+
*/
|
|
21703
|
+
public async hmacSha256(
|
|
21704
|
+
message: ArrayBuffer,
|
|
21705
|
+
path: string,
|
|
21706
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
21707
|
+
): Promise<HashedMessageBytes> /*throws*/ {
|
|
21708
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
21709
|
+
try {
|
|
21710
|
+
return await uniffiRustCallAsync(
|
|
21711
|
+
/*rustCaller:*/ uniffiCaller,
|
|
21712
|
+
/*rustFutureFunc:*/ () => {
|
|
21713
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_hmac_sha256(
|
|
21714
|
+
uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
|
|
21715
|
+
FfiConverterArrayBuffer.lower(message),
|
|
21716
|
+
FfiConverterString.lower(path)
|
|
21717
|
+
);
|
|
21718
|
+
},
|
|
21719
|
+
/*pollFunc:*/ nativeModule()
|
|
21720
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
21721
|
+
/*cancelFunc:*/ nativeModule()
|
|
21722
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
|
|
21723
|
+
/*completeFunc:*/ nativeModule()
|
|
21724
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
21725
|
+
/*freeFunc:*/ nativeModule()
|
|
21726
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
21727
|
+
/*liftFunc:*/ FfiConverterTypeHashedMessageBytes.lift.bind(
|
|
21728
|
+
FfiConverterTypeHashedMessageBytes
|
|
21729
|
+
),
|
|
21730
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
21731
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
21732
|
+
/*errorHandler:*/ FfiConverterTypeSignerError.lift.bind(
|
|
21733
|
+
FfiConverterTypeSignerError
|
|
21734
|
+
)
|
|
21735
|
+
);
|
|
21736
|
+
} catch (__error: any) {
|
|
21737
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
21738
|
+
__error.stack = __stack;
|
|
21739
|
+
}
|
|
21740
|
+
throw __error;
|
|
21741
|
+
}
|
|
21742
|
+
}
|
|
21743
|
+
|
|
20960
21744
|
/**
|
|
20961
21745
|
* Generates Frost signing commitments for multi-party signing.
|
|
20962
21746
|
*
|
|
@@ -21714,7 +22498,7 @@ const uniffiCallbackInterfaceExternalSigner: {
|
|
|
21714
22498
|
): Promise<EcdsaSignatureBytes> => {
|
|
21715
22499
|
const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
|
|
21716
22500
|
return await jsCallback.signEcdsa(
|
|
21717
|
-
|
|
22501
|
+
FfiConverterTypeMessageBytes.lift(message),
|
|
21718
22502
|
FfiConverterString.lift(path),
|
|
21719
22503
|
{ signal }
|
|
21720
22504
|
);
|
|
@@ -21762,7 +22546,7 @@ const uniffiCallbackInterfaceExternalSigner: {
|
|
|
21762
22546
|
): Promise<RecoverableEcdsaSignatureBytes> => {
|
|
21763
22547
|
const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
|
|
21764
22548
|
return await jsCallback.signEcdsaRecoverable(
|
|
21765
|
-
|
|
22549
|
+
FfiConverterTypeMessageBytes.lift(message),
|
|
21766
22550
|
FfiConverterString.lift(path),
|
|
21767
22551
|
{ signal }
|
|
21768
22552
|
);
|
|
@@ -21946,6 +22730,54 @@ const uniffiCallbackInterfaceExternalSigner: {
|
|
|
21946
22730
|
);
|
|
21947
22731
|
return UniffiResult.success(uniffiForeignFuture);
|
|
21948
22732
|
},
|
|
22733
|
+
hmacSha256: (
|
|
22734
|
+
uniffiHandle: bigint,
|
|
22735
|
+
message: Uint8Array,
|
|
22736
|
+
path: Uint8Array,
|
|
22737
|
+
uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
|
|
22738
|
+
uniffiCallbackData: bigint
|
|
22739
|
+
) => {
|
|
22740
|
+
const uniffiMakeCall = async (
|
|
22741
|
+
signal: AbortSignal
|
|
22742
|
+
): Promise<HashedMessageBytes> => {
|
|
22743
|
+
const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
|
|
22744
|
+
return await jsCallback.hmacSha256(
|
|
22745
|
+
FfiConverterArrayBuffer.lift(message),
|
|
22746
|
+
FfiConverterString.lift(path),
|
|
22747
|
+
{ signal }
|
|
22748
|
+
);
|
|
22749
|
+
};
|
|
22750
|
+
const uniffiHandleSuccess = (returnValue: HashedMessageBytes) => {
|
|
22751
|
+
uniffiFutureCallback(
|
|
22752
|
+
uniffiCallbackData,
|
|
22753
|
+
/* UniffiForeignFutureStructRustBuffer */ {
|
|
22754
|
+
returnValue: FfiConverterTypeHashedMessageBytes.lower(returnValue),
|
|
22755
|
+
callStatus: uniffiCaller.createCallStatus(),
|
|
22756
|
+
}
|
|
22757
|
+
);
|
|
22758
|
+
};
|
|
22759
|
+
const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
|
|
22760
|
+
uniffiFutureCallback(
|
|
22761
|
+
uniffiCallbackData,
|
|
22762
|
+
/* UniffiForeignFutureStructRustBuffer */ {
|
|
22763
|
+
returnValue: /*empty*/ new Uint8Array(0),
|
|
22764
|
+
// TODO create callstatus with error.
|
|
22765
|
+
callStatus: { code, errorBuf },
|
|
22766
|
+
}
|
|
22767
|
+
);
|
|
22768
|
+
};
|
|
22769
|
+
const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
|
|
22770
|
+
/*makeCall:*/ uniffiMakeCall,
|
|
22771
|
+
/*handleSuccess:*/ uniffiHandleSuccess,
|
|
22772
|
+
/*handleError:*/ uniffiHandleError,
|
|
22773
|
+
/*isErrorType:*/ SignerError.instanceOf,
|
|
22774
|
+
/*lowerError:*/ FfiConverterTypeSignerError.lower.bind(
|
|
22775
|
+
FfiConverterTypeSignerError
|
|
22776
|
+
),
|
|
22777
|
+
/*lowerString:*/ FfiConverterString.lower
|
|
22778
|
+
);
|
|
22779
|
+
return UniffiResult.success(uniffiForeignFuture);
|
|
22780
|
+
},
|
|
21949
22781
|
generateFrostSigningCommitments: (
|
|
21950
22782
|
uniffiHandle: bigint,
|
|
21951
22783
|
uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
|
|
@@ -27143,6 +27975,21 @@ const FfiConverterOptionalTypeLogger = new FfiConverterOptional(
|
|
|
27143
27975
|
FfiConverterTypeLogger
|
|
27144
27976
|
);
|
|
27145
27977
|
|
|
27978
|
+
// FfiConverter for ConversionEstimate | undefined
|
|
27979
|
+
const FfiConverterOptionalTypeConversionEstimate = new FfiConverterOptional(
|
|
27980
|
+
FfiConverterTypeConversionEstimate
|
|
27981
|
+
);
|
|
27982
|
+
|
|
27983
|
+
// FfiConverter for ConversionInfo | undefined
|
|
27984
|
+
const FfiConverterOptionalTypeConversionInfo = new FfiConverterOptional(
|
|
27985
|
+
FfiConverterTypeConversionInfo
|
|
27986
|
+
);
|
|
27987
|
+
|
|
27988
|
+
// FfiConverter for ConversionOptions | undefined
|
|
27989
|
+
const FfiConverterOptionalTypeConversionOptions = new FfiConverterOptional(
|
|
27990
|
+
FfiConverterTypeConversionOptions
|
|
27991
|
+
);
|
|
27992
|
+
|
|
27146
27993
|
// FfiConverter for Credentials | undefined
|
|
27147
27994
|
const FfiConverterOptionalTypeCredentials = new FfiConverterOptional(
|
|
27148
27995
|
FfiConverterTypeCredentials
|
|
@@ -27207,16 +28054,6 @@ const FfiConverterOptionalTypeSymbol = new FfiConverterOptional(
|
|
|
27207
28054
|
FfiConverterTypeSymbol
|
|
27208
28055
|
);
|
|
27209
28056
|
|
|
27210
|
-
// FfiConverter for TokenConversionInfo | undefined
|
|
27211
|
-
const FfiConverterOptionalTypeTokenConversionInfo = new FfiConverterOptional(
|
|
27212
|
-
FfiConverterTypeTokenConversionInfo
|
|
27213
|
-
);
|
|
27214
|
-
|
|
27215
|
-
// FfiConverter for TokenConversionOptions | undefined
|
|
27216
|
-
const FfiConverterOptionalTypeTokenConversionOptions = new FfiConverterOptional(
|
|
27217
|
-
FfiConverterTypeTokenConversionOptions
|
|
27218
|
-
);
|
|
27219
|
-
|
|
27220
28057
|
// FfiConverter for string | undefined
|
|
27221
28058
|
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
27222
28059
|
|
|
@@ -27354,6 +28191,11 @@ const FfiConverterOptionalTypeAssetFilter = new FfiConverterOptional(
|
|
|
27354
28191
|
FfiConverterTypeAssetFilter
|
|
27355
28192
|
);
|
|
27356
28193
|
|
|
28194
|
+
// FfiConverter for ConversionPurpose | undefined
|
|
28195
|
+
const FfiConverterOptionalTypeConversionPurpose = new FfiConverterOptional(
|
|
28196
|
+
FfiConverterTypeConversionPurpose
|
|
28197
|
+
);
|
|
28198
|
+
|
|
27357
28199
|
// FfiConverter for DepositClaimError | undefined
|
|
27358
28200
|
const FfiConverterOptionalTypeDepositClaimError = new FfiConverterOptional(
|
|
27359
28201
|
FfiConverterTypeDepositClaimError
|
|
@@ -27608,11 +28450,11 @@ function uniffiEnsureInitialized() {
|
|
|
27608
28450
|
);
|
|
27609
28451
|
}
|
|
27610
28452
|
if (
|
|
27611
|
-
nativeModule().
|
|
27612
|
-
|
|
28453
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_fetch_conversion_limits() !==
|
|
28454
|
+
50958
|
|
27613
28455
|
) {
|
|
27614
28456
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27615
|
-
'
|
|
28457
|
+
'uniffi_breez_sdk_spark_checksum_method_breezsdk_fetch_conversion_limits'
|
|
27616
28458
|
);
|
|
27617
28459
|
}
|
|
27618
28460
|
if (
|
|
@@ -27703,6 +28545,14 @@ function uniffiEnsureInitialized() {
|
|
|
27703
28545
|
'uniffi_breez_sdk_spark_checksum_method_breezsdk_list_unclaimed_deposits'
|
|
27704
28546
|
);
|
|
27705
28547
|
}
|
|
28548
|
+
if (
|
|
28549
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_auth() !==
|
|
28550
|
+
37942
|
|
28551
|
+
) {
|
|
28552
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
28553
|
+
'uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_auth'
|
|
28554
|
+
);
|
|
28555
|
+
}
|
|
27706
28556
|
if (
|
|
27707
28557
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() !==
|
|
27708
28558
|
10147
|
|
@@ -27841,7 +28691,7 @@ function uniffiEnsureInitialized() {
|
|
|
27841
28691
|
}
|
|
27842
28692
|
if (
|
|
27843
28693
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_ecdsa() !==
|
|
27844
|
-
|
|
28694
|
+
37648
|
|
27845
28695
|
) {
|
|
27846
28696
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27847
28697
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_ecdsa'
|
|
@@ -27849,7 +28699,7 @@ function uniffiEnsureInitialized() {
|
|
|
27849
28699
|
}
|
|
27850
28700
|
if (
|
|
27851
28701
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_ecdsa_recoverable() !==
|
|
27852
|
-
|
|
28702
|
+
3107
|
|
27853
28703
|
) {
|
|
27854
28704
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27855
28705
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_ecdsa_recoverable'
|
|
@@ -27879,9 +28729,17 @@ function uniffiEnsureInitialized() {
|
|
|
27879
28729
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_hash_schnorr'
|
|
27880
28730
|
);
|
|
27881
28731
|
}
|
|
28732
|
+
if (
|
|
28733
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_hmac_sha256() !==
|
|
28734
|
+
19799
|
|
28735
|
+
) {
|
|
28736
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
28737
|
+
'uniffi_breez_sdk_spark_checksum_method_externalsigner_hmac_sha256'
|
|
28738
|
+
);
|
|
28739
|
+
}
|
|
27882
28740
|
if (
|
|
27883
28741
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_frost_signing_commitments() !==
|
|
27884
|
-
|
|
28742
|
+
24833
|
|
27885
28743
|
) {
|
|
27886
28744
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27887
28745
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_frost_signing_commitments'
|
|
@@ -27889,7 +28747,7 @@ function uniffiEnsureInitialized() {
|
|
|
27889
28747
|
}
|
|
27890
28748
|
if (
|
|
27891
28749
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_get_public_key_for_node() !==
|
|
27892
|
-
|
|
28750
|
+
62425
|
|
27893
28751
|
) {
|
|
27894
28752
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27895
28753
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_get_public_key_for_node'
|
|
@@ -27897,7 +28755,7 @@ function uniffiEnsureInitialized() {
|
|
|
27897
28755
|
}
|
|
27898
28756
|
if (
|
|
27899
28757
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_random_key() !==
|
|
27900
|
-
|
|
28758
|
+
21363
|
|
27901
28759
|
) {
|
|
27902
28760
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27903
28761
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_random_key'
|
|
@@ -27905,7 +28763,7 @@ function uniffiEnsureInitialized() {
|
|
|
27905
28763
|
}
|
|
27906
28764
|
if (
|
|
27907
28765
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_get_static_deposit_private_key_source() !==
|
|
27908
|
-
|
|
28766
|
+
61352
|
|
27909
28767
|
) {
|
|
27910
28768
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27911
28769
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_get_static_deposit_private_key_source'
|
|
@@ -27913,7 +28771,7 @@ function uniffiEnsureInitialized() {
|
|
|
27913
28771
|
}
|
|
27914
28772
|
if (
|
|
27915
28773
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_get_static_deposit_private_key() !==
|
|
27916
|
-
|
|
28774
|
+
57038
|
|
27917
28775
|
) {
|
|
27918
28776
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27919
28777
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_get_static_deposit_private_key'
|
|
@@ -27921,7 +28779,7 @@ function uniffiEnsureInitialized() {
|
|
|
27921
28779
|
}
|
|
27922
28780
|
if (
|
|
27923
28781
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_get_static_deposit_public_key() !==
|
|
27924
|
-
|
|
28782
|
+
47081
|
|
27925
28783
|
) {
|
|
27926
28784
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27927
28785
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_get_static_deposit_public_key'
|
|
@@ -27929,7 +28787,7 @@ function uniffiEnsureInitialized() {
|
|
|
27929
28787
|
}
|
|
27930
28788
|
if (
|
|
27931
28789
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_private_keys() !==
|
|
27932
|
-
|
|
28790
|
+
63060
|
|
27933
28791
|
) {
|
|
27934
28792
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27935
28793
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_private_keys'
|
|
@@ -27937,7 +28795,7 @@ function uniffiEnsureInitialized() {
|
|
|
27937
28795
|
}
|
|
27938
28796
|
if (
|
|
27939
28797
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_split_secret() !==
|
|
27940
|
-
|
|
28798
|
+
22937
|
|
27941
28799
|
) {
|
|
27942
28800
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27943
28801
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_split_secret'
|
|
@@ -27945,7 +28803,7 @@ function uniffiEnsureInitialized() {
|
|
|
27945
28803
|
}
|
|
27946
28804
|
if (
|
|
27947
28805
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_encrypt_private_key_for_receiver() !==
|
|
27948
|
-
|
|
28806
|
+
52786
|
|
27949
28807
|
) {
|
|
27950
28808
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27951
28809
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_encrypt_private_key_for_receiver'
|
|
@@ -27953,7 +28811,7 @@ function uniffiEnsureInitialized() {
|
|
|
27953
28811
|
}
|
|
27954
28812
|
if (
|
|
27955
28813
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_get_public_key_from_private_key_source() !==
|
|
27956
|
-
|
|
28814
|
+
58178
|
|
27957
28815
|
) {
|
|
27958
28816
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27959
28817
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_get_public_key_from_private_key_source'
|
|
@@ -27961,7 +28819,7 @@ function uniffiEnsureInitialized() {
|
|
|
27961
28819
|
}
|
|
27962
28820
|
if (
|
|
27963
28821
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_frost() !==
|
|
27964
|
-
|
|
28822
|
+
44847
|
|
27965
28823
|
) {
|
|
27966
28824
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27967
28825
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_frost'
|
|
@@ -27969,7 +28827,7 @@ function uniffiEnsureInitialized() {
|
|
|
27969
28827
|
}
|
|
27970
28828
|
if (
|
|
27971
28829
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_aggregate_frost_signatures() !==
|
|
27972
|
-
|
|
28830
|
+
61746
|
|
27973
28831
|
) {
|
|
27974
28832
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27975
28833
|
'uniffi_breez_sdk_spark_checksum_method_externalsigner_aggregate_frost_signatures'
|
|
@@ -28415,6 +29273,12 @@ export default Object.freeze({
|
|
|
28415
29273
|
FfiConverterTypeConfig,
|
|
28416
29274
|
FfiConverterTypeConnectRequest,
|
|
28417
29275
|
FfiConverterTypeConnectWithSignerRequest,
|
|
29276
|
+
FfiConverterTypeConversionEstimate,
|
|
29277
|
+
FfiConverterTypeConversionInfo,
|
|
29278
|
+
FfiConverterTypeConversionOptions,
|
|
29279
|
+
FfiConverterTypeConversionPurpose,
|
|
29280
|
+
FfiConverterTypeConversionStatus,
|
|
29281
|
+
FfiConverterTypeConversionType,
|
|
28418
29282
|
FfiConverterTypeCreateIssuerTokenRequest,
|
|
28419
29283
|
FfiConverterTypeCredentials,
|
|
28420
29284
|
FfiConverterTypeCurrencyInfo,
|
|
@@ -28438,8 +29302,8 @@ export default Object.freeze({
|
|
|
28438
29302
|
FfiConverterTypeExternalTreeNodeId,
|
|
28439
29303
|
FfiConverterTypeExternalVerifiableSecretShare,
|
|
28440
29304
|
FfiConverterTypeFee,
|
|
28441
|
-
|
|
28442
|
-
|
|
29305
|
+
FfiConverterTypeFetchConversionLimitsRequest,
|
|
29306
|
+
FfiConverterTypeFetchConversionLimitsResponse,
|
|
28443
29307
|
FfiConverterTypeFiatCurrency,
|
|
28444
29308
|
FfiConverterTypeFiatService,
|
|
28445
29309
|
FfiConverterTypeFreezeIssuerTokenRequest,
|
|
@@ -28450,6 +29314,7 @@ export default Object.freeze({
|
|
|
28450
29314
|
FfiConverterTypeGetPaymentResponse,
|
|
28451
29315
|
FfiConverterTypeGetTokensMetadataRequest,
|
|
28452
29316
|
FfiConverterTypeGetTokensMetadataResponse,
|
|
29317
|
+
FfiConverterTypeHashedMessageBytes,
|
|
28453
29318
|
FfiConverterTypeIdentifierCommitmentPair,
|
|
28454
29319
|
FfiConverterTypeIdentifierPublicKeyPair,
|
|
28455
29320
|
FfiConverterTypeIdentifierSignaturePair,
|
|
@@ -28466,6 +29331,8 @@ export default Object.freeze({
|
|
|
28466
29331
|
FfiConverterTypeListUnclaimedDepositsRequest,
|
|
28467
29332
|
FfiConverterTypeListUnclaimedDepositsResponse,
|
|
28468
29333
|
FfiConverterTypeLnurlAuthRequestDetails,
|
|
29334
|
+
FfiConverterTypeLnurlCallbackStatus,
|
|
29335
|
+
FfiConverterTypeLnurlErrorDetails,
|
|
28469
29336
|
FfiConverterTypeLnurlPayInfo,
|
|
28470
29337
|
FfiConverterTypeLnurlPayRequest,
|
|
28471
29338
|
FfiConverterTypeLnurlPayRequestDetails,
|
|
@@ -28479,6 +29346,7 @@ export default Object.freeze({
|
|
|
28479
29346
|
FfiConverterTypeLocalizedName,
|
|
28480
29347
|
FfiConverterTypeLogEntry,
|
|
28481
29348
|
FfiConverterTypeMaxFee,
|
|
29349
|
+
FfiConverterTypeMessageBytes,
|
|
28482
29350
|
FfiConverterTypeMessageSuccessActionData,
|
|
28483
29351
|
FfiConverterTypeMintIssuerTokenRequest,
|
|
28484
29352
|
FfiConverterTypeNetwork,
|
|
@@ -28546,9 +29414,6 @@ export default Object.freeze({
|
|
|
28546
29414
|
FfiConverterTypeSyncWalletRequest,
|
|
28547
29415
|
FfiConverterTypeSyncWalletResponse,
|
|
28548
29416
|
FfiConverterTypeTokenBalance,
|
|
28549
|
-
FfiConverterTypeTokenConversionInfo,
|
|
28550
|
-
FfiConverterTypeTokenConversionOptions,
|
|
28551
|
-
FfiConverterTypeTokenConversionType,
|
|
28552
29417
|
FfiConverterTypeTokenIssuer,
|
|
28553
29418
|
FfiConverterTypeTokenMetadata,
|
|
28554
29419
|
FfiConverterTypeTxStatus,
|