@breeztech/breez-sdk-spark-react-native 0.7.1 → 0.7.3
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 +14 -15
- package/cpp/generated/breez_sdk_spark.hpp +2 -2
- package/lib/commonjs/generated/breez_sdk_spark.js +105 -63
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +104 -62
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +2 -2
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +404 -242
- 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 +2 -2
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +404 -242
- 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 +2 -2
- package/src/generated/breez_sdk_spark.ts +837 -560
|
@@ -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 {
|
|
@@ -6320,7 +6566,7 @@ export type PaymentMetadata = {
|
|
|
6320
6566
|
lnurlPayInfo: LnurlPayInfo | undefined;
|
|
6321
6567
|
lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
|
|
6322
6568
|
lnurlDescription: string | undefined;
|
|
6323
|
-
|
|
6569
|
+
conversionInfo: ConversionInfo | undefined;
|
|
6324
6570
|
};
|
|
6325
6571
|
|
|
6326
6572
|
/**
|
|
@@ -6362,8 +6608,7 @@ const FfiConverterTypePaymentMetadata = (() => {
|
|
|
6362
6608
|
lnurlPayInfo: FfiConverterOptionalTypeLnurlPayInfo.read(from),
|
|
6363
6609
|
lnurlWithdrawInfo: FfiConverterOptionalTypeLnurlWithdrawInfo.read(from),
|
|
6364
6610
|
lnurlDescription: FfiConverterOptionalString.read(from),
|
|
6365
|
-
|
|
6366
|
-
FfiConverterOptionalTypeTokenConversionInfo.read(from),
|
|
6611
|
+
conversionInfo: FfiConverterOptionalTypeConversionInfo.read(from),
|
|
6367
6612
|
};
|
|
6368
6613
|
}
|
|
6369
6614
|
write(value: TypeName, into: RustBuffer): void {
|
|
@@ -6374,10 +6619,7 @@ const FfiConverterTypePaymentMetadata = (() => {
|
|
|
6374
6619
|
into
|
|
6375
6620
|
);
|
|
6376
6621
|
FfiConverterOptionalString.write(value.lnurlDescription, into);
|
|
6377
|
-
|
|
6378
|
-
value.tokenConversionInfo,
|
|
6379
|
-
into
|
|
6380
|
-
);
|
|
6622
|
+
FfiConverterOptionalTypeConversionInfo.write(value.conversionInfo, into);
|
|
6381
6623
|
}
|
|
6382
6624
|
allocationSize(value: TypeName): number {
|
|
6383
6625
|
return (
|
|
@@ -6389,8 +6631,8 @@ const FfiConverterTypePaymentMetadata = (() => {
|
|
|
6389
6631
|
value.lnurlWithdrawInfo
|
|
6390
6632
|
) +
|
|
6391
6633
|
FfiConverterOptionalString.allocationSize(value.lnurlDescription) +
|
|
6392
|
-
|
|
6393
|
-
value.
|
|
6634
|
+
FfiConverterOptionalTypeConversionInfo.allocationSize(
|
|
6635
|
+
value.conversionInfo
|
|
6394
6636
|
)
|
|
6395
6637
|
);
|
|
6396
6638
|
}
|
|
@@ -6625,9 +6867,9 @@ export type PrepareSendPaymentRequest = {
|
|
|
6625
6867
|
*/
|
|
6626
6868
|
tokenIdentifier: string | undefined;
|
|
6627
6869
|
/**
|
|
6628
|
-
* If provided, the payment will include a
|
|
6870
|
+
* If provided, the payment will include a conversion step before sending the payment
|
|
6629
6871
|
*/
|
|
6630
|
-
|
|
6872
|
+
conversionOptions: ConversionOptions | undefined;
|
|
6631
6873
|
};
|
|
6632
6874
|
|
|
6633
6875
|
/**
|
|
@@ -6637,7 +6879,7 @@ export const PrepareSendPaymentRequest = (() => {
|
|
|
6637
6879
|
const defaults = () => ({
|
|
6638
6880
|
amount: undefined,
|
|
6639
6881
|
tokenIdentifier: undefined,
|
|
6640
|
-
|
|
6882
|
+
conversionOptions: undefined,
|
|
6641
6883
|
});
|
|
6642
6884
|
const create = (() => {
|
|
6643
6885
|
return uniffiCreateRecord<
|
|
@@ -6674,16 +6916,15 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
|
|
|
6674
6916
|
paymentRequest: FfiConverterString.read(from),
|
|
6675
6917
|
amount: FfiConverterOptionalTypeu128.read(from),
|
|
6676
6918
|
tokenIdentifier: FfiConverterOptionalString.read(from),
|
|
6677
|
-
|
|
6678
|
-
FfiConverterOptionalTypeTokenConversionOptions.read(from),
|
|
6919
|
+
conversionOptions: FfiConverterOptionalTypeConversionOptions.read(from),
|
|
6679
6920
|
};
|
|
6680
6921
|
}
|
|
6681
6922
|
write(value: TypeName, into: RustBuffer): void {
|
|
6682
6923
|
FfiConverterString.write(value.paymentRequest, into);
|
|
6683
6924
|
FfiConverterOptionalTypeu128.write(value.amount, into);
|
|
6684
6925
|
FfiConverterOptionalString.write(value.tokenIdentifier, into);
|
|
6685
|
-
|
|
6686
|
-
value.
|
|
6926
|
+
FfiConverterOptionalTypeConversionOptions.write(
|
|
6927
|
+
value.conversionOptions,
|
|
6687
6928
|
into
|
|
6688
6929
|
);
|
|
6689
6930
|
}
|
|
@@ -6692,8 +6933,8 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
|
|
|
6692
6933
|
FfiConverterString.allocationSize(value.paymentRequest) +
|
|
6693
6934
|
FfiConverterOptionalTypeu128.allocationSize(value.amount) +
|
|
6694
6935
|
FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
|
|
6695
|
-
|
|
6696
|
-
value.
|
|
6936
|
+
FfiConverterOptionalTypeConversionOptions.allocationSize(
|
|
6937
|
+
value.conversionOptions
|
|
6697
6938
|
)
|
|
6698
6939
|
);
|
|
6699
6940
|
}
|
|
@@ -6714,13 +6955,9 @@ export type PrepareSendPaymentResponse = {
|
|
|
6714
6955
|
*/
|
|
6715
6956
|
tokenIdentifier: string | undefined;
|
|
6716
6957
|
/**
|
|
6717
|
-
* When set, the payment will include a
|
|
6958
|
+
* When set, the payment will include a conversion step before sending the payment
|
|
6718
6959
|
*/
|
|
6719
|
-
|
|
6720
|
-
/**
|
|
6721
|
-
* The estimated token conversion fee if the payment involves a token conversion
|
|
6722
|
-
*/
|
|
6723
|
-
tokenConversionFee: U128 | undefined;
|
|
6960
|
+
conversionEstimate: ConversionEstimate | undefined;
|
|
6724
6961
|
};
|
|
6725
6962
|
|
|
6726
6963
|
/**
|
|
@@ -6763,30 +7000,27 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
|
|
|
6763
7000
|
paymentMethod: FfiConverterTypeSendPaymentMethod.read(from),
|
|
6764
7001
|
amount: FfiConverterTypeu128.read(from),
|
|
6765
7002
|
tokenIdentifier: FfiConverterOptionalString.read(from),
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
tokenConversionFee: FfiConverterOptionalTypeu128.read(from),
|
|
7003
|
+
conversionEstimate:
|
|
7004
|
+
FfiConverterOptionalTypeConversionEstimate.read(from),
|
|
6769
7005
|
};
|
|
6770
7006
|
}
|
|
6771
7007
|
write(value: TypeName, into: RustBuffer): void {
|
|
6772
7008
|
FfiConverterTypeSendPaymentMethod.write(value.paymentMethod, into);
|
|
6773
7009
|
FfiConverterTypeu128.write(value.amount, into);
|
|
6774
7010
|
FfiConverterOptionalString.write(value.tokenIdentifier, into);
|
|
6775
|
-
|
|
6776
|
-
value.
|
|
7011
|
+
FfiConverterOptionalTypeConversionEstimate.write(
|
|
7012
|
+
value.conversionEstimate,
|
|
6777
7013
|
into
|
|
6778
7014
|
);
|
|
6779
|
-
FfiConverterOptionalTypeu128.write(value.tokenConversionFee, into);
|
|
6780
7015
|
}
|
|
6781
7016
|
allocationSize(value: TypeName): number {
|
|
6782
7017
|
return (
|
|
6783
7018
|
FfiConverterTypeSendPaymentMethod.allocationSize(value.paymentMethod) +
|
|
6784
7019
|
FfiConverterTypeu128.allocationSize(value.amount) +
|
|
6785
7020
|
FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
|
|
6786
|
-
|
|
6787
|
-
value.
|
|
6788
|
-
)
|
|
6789
|
-
FfiConverterOptionalTypeu128.allocationSize(value.tokenConversionFee)
|
|
7021
|
+
FfiConverterOptionalTypeConversionEstimate.allocationSize(
|
|
7022
|
+
value.conversionEstimate
|
|
7023
|
+
)
|
|
6790
7024
|
);
|
|
6791
7025
|
}
|
|
6792
7026
|
}
|
|
@@ -8361,7 +8595,7 @@ export type SparkHtlcDetails = {
|
|
|
8361
8595
|
*/
|
|
8362
8596
|
preimage: string | undefined;
|
|
8363
8597
|
/**
|
|
8364
|
-
* The expiry time of the HTLC
|
|
8598
|
+
* The expiry time of the HTLC as a unix timestamp in seconds
|
|
8365
8599
|
*/
|
|
8366
8600
|
expiryTime: /*u64*/ bigint;
|
|
8367
8601
|
/**
|
|
@@ -8513,7 +8747,7 @@ export type SparkInvoiceDetails = {
|
|
|
8513
8747
|
*/
|
|
8514
8748
|
tokenIdentifier: string | undefined;
|
|
8515
8749
|
/**
|
|
8516
|
-
* Optional expiry time. If not provided, the invoice will never expire.
|
|
8750
|
+
* Optional expiry time as a unix timestamp in seconds. If not provided, the invoice will never expire.
|
|
8517
8751
|
*/
|
|
8518
8752
|
expiryTime: /*u64*/ bigint | undefined;
|
|
8519
8753
|
/**
|
|
@@ -8886,45 +9120,41 @@ const FfiConverterTypeTokenBalance = (() => {
|
|
|
8886
9120
|
return new FFIConverter();
|
|
8887
9121
|
})();
|
|
8888
9122
|
|
|
8889
|
-
export type
|
|
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;
|
|
9123
|
+
export type TokenMetadata = {
|
|
9124
|
+
identifier: string;
|
|
8898
9125
|
/**
|
|
8899
|
-
*
|
|
8900
|
-
* Denominated in satoshis if converting from Bitcoin, otherwise in the token base units.
|
|
9126
|
+
* Hex representation of the issuer public key
|
|
8901
9127
|
*/
|
|
8902
|
-
|
|
9128
|
+
issuerPublicKey: string;
|
|
9129
|
+
name: string;
|
|
9130
|
+
ticker: string;
|
|
8903
9131
|
/**
|
|
8904
|
-
*
|
|
9132
|
+
* Number of decimals the token uses
|
|
8905
9133
|
*/
|
|
8906
|
-
|
|
9134
|
+
decimals: /*u32*/ number;
|
|
9135
|
+
maxSupply: U128;
|
|
9136
|
+
isFreezable: boolean;
|
|
8907
9137
|
};
|
|
8908
9138
|
|
|
8909
9139
|
/**
|
|
8910
|
-
* Generated factory for {@link
|
|
9140
|
+
* Generated factory for {@link TokenMetadata} record objects.
|
|
8911
9141
|
*/
|
|
8912
|
-
export const
|
|
9142
|
+
export const TokenMetadata = (() => {
|
|
8913
9143
|
const defaults = () => ({});
|
|
8914
9144
|
const create = (() => {
|
|
8915
|
-
return uniffiCreateRecord<
|
|
9145
|
+
return uniffiCreateRecord<TokenMetadata, ReturnType<typeof defaults>>(
|
|
8916
9146
|
defaults
|
|
8917
9147
|
);
|
|
8918
9148
|
})();
|
|
8919
9149
|
return Object.freeze({
|
|
8920
9150
|
/**
|
|
8921
|
-
* Create a frozen instance of {@link
|
|
9151
|
+
* Create a frozen instance of {@link TokenMetadata}, with defaults specified
|
|
8922
9152
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
8923
9153
|
*/
|
|
8924
9154
|
create,
|
|
8925
9155
|
|
|
8926
9156
|
/**
|
|
8927
|
-
* Create a frozen instance of {@link
|
|
9157
|
+
* Create a frozen instance of {@link TokenMetadata}, with defaults specified
|
|
8928
9158
|
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
8929
9159
|
*/
|
|
8930
9160
|
new: create,
|
|
@@ -8932,220 +9162,56 @@ export const TokenConversionInfo = (() => {
|
|
|
8932
9162
|
/**
|
|
8933
9163
|
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
8934
9164
|
*/
|
|
8935
|
-
defaults: () => Object.freeze(defaults()) as Partial<
|
|
9165
|
+
defaults: () => Object.freeze(defaults()) as Partial<TokenMetadata>,
|
|
8936
9166
|
});
|
|
8937
9167
|
})();
|
|
8938
9168
|
|
|
8939
|
-
const
|
|
8940
|
-
type TypeName =
|
|
9169
|
+
const FfiConverterTypeTokenMetadata = (() => {
|
|
9170
|
+
type TypeName = TokenMetadata;
|
|
8941
9171
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
8942
9172
|
read(from: RustBuffer): TypeName {
|
|
8943
9173
|
return {
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
9174
|
+
identifier: FfiConverterString.read(from),
|
|
9175
|
+
issuerPublicKey: FfiConverterString.read(from),
|
|
9176
|
+
name: FfiConverterString.read(from),
|
|
9177
|
+
ticker: FfiConverterString.read(from),
|
|
9178
|
+
decimals: FfiConverterUInt32.read(from),
|
|
9179
|
+
maxSupply: FfiConverterTypeu128.read(from),
|
|
9180
|
+
isFreezable: FfiConverterBool.read(from),
|
|
8948
9181
|
};
|
|
8949
9182
|
}
|
|
8950
9183
|
write(value: TypeName, into: RustBuffer): void {
|
|
8951
|
-
FfiConverterString.write(value.
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
9184
|
+
FfiConverterString.write(value.identifier, into);
|
|
9185
|
+
FfiConverterString.write(value.issuerPublicKey, into);
|
|
9186
|
+
FfiConverterString.write(value.name, into);
|
|
9187
|
+
FfiConverterString.write(value.ticker, into);
|
|
9188
|
+
FfiConverterUInt32.write(value.decimals, into);
|
|
9189
|
+
FfiConverterTypeu128.write(value.maxSupply, into);
|
|
9190
|
+
FfiConverterBool.write(value.isFreezable, into);
|
|
8955
9191
|
}
|
|
8956
9192
|
allocationSize(value: TypeName): number {
|
|
8957
9193
|
return (
|
|
8958
|
-
FfiConverterString.allocationSize(value.
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
9194
|
+
FfiConverterString.allocationSize(value.identifier) +
|
|
9195
|
+
FfiConverterString.allocationSize(value.issuerPublicKey) +
|
|
9196
|
+
FfiConverterString.allocationSize(value.name) +
|
|
9197
|
+
FfiConverterString.allocationSize(value.ticker) +
|
|
9198
|
+
FfiConverterUInt32.allocationSize(value.decimals) +
|
|
9199
|
+
FfiConverterTypeu128.allocationSize(value.maxSupply) +
|
|
9200
|
+
FfiConverterBool.allocationSize(value.isFreezable)
|
|
8962
9201
|
);
|
|
8963
9202
|
}
|
|
8964
9203
|
}
|
|
8965
9204
|
return new FFIConverter();
|
|
8966
9205
|
})();
|
|
8967
9206
|
|
|
9207
|
+
export type TxStatus = {
|
|
9208
|
+
confirmed: boolean;
|
|
9209
|
+
blockHeight: /*u32*/ number | undefined;
|
|
9210
|
+
blockTime: /*u64*/ bigint | undefined;
|
|
9211
|
+
};
|
|
9212
|
+
|
|
8968
9213
|
/**
|
|
8969
|
-
*
|
|
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
|
-
export type TokenMetadata = {
|
|
9058
|
-
identifier: string;
|
|
9059
|
-
/**
|
|
9060
|
-
* Hex representation of the issuer public key
|
|
9061
|
-
*/
|
|
9062
|
-
issuerPublicKey: string;
|
|
9063
|
-
name: string;
|
|
9064
|
-
ticker: string;
|
|
9065
|
-
/**
|
|
9066
|
-
* Number of decimals the token uses
|
|
9067
|
-
*/
|
|
9068
|
-
decimals: /*u32*/ number;
|
|
9069
|
-
maxSupply: U128;
|
|
9070
|
-
isFreezable: boolean;
|
|
9071
|
-
};
|
|
9072
|
-
|
|
9073
|
-
/**
|
|
9074
|
-
* Generated factory for {@link TokenMetadata} record objects.
|
|
9075
|
-
*/
|
|
9076
|
-
export const TokenMetadata = (() => {
|
|
9077
|
-
const defaults = () => ({});
|
|
9078
|
-
const create = (() => {
|
|
9079
|
-
return uniffiCreateRecord<TokenMetadata, ReturnType<typeof defaults>>(
|
|
9080
|
-
defaults
|
|
9081
|
-
);
|
|
9082
|
-
})();
|
|
9083
|
-
return Object.freeze({
|
|
9084
|
-
/**
|
|
9085
|
-
* Create a frozen instance of {@link TokenMetadata}, with defaults specified
|
|
9086
|
-
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
9087
|
-
*/
|
|
9088
|
-
create,
|
|
9089
|
-
|
|
9090
|
-
/**
|
|
9091
|
-
* Create a frozen instance of {@link TokenMetadata}, with defaults specified
|
|
9092
|
-
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
9093
|
-
*/
|
|
9094
|
-
new: create,
|
|
9095
|
-
|
|
9096
|
-
/**
|
|
9097
|
-
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
9098
|
-
*/
|
|
9099
|
-
defaults: () => Object.freeze(defaults()) as Partial<TokenMetadata>,
|
|
9100
|
-
});
|
|
9101
|
-
})();
|
|
9102
|
-
|
|
9103
|
-
const FfiConverterTypeTokenMetadata = (() => {
|
|
9104
|
-
type TypeName = TokenMetadata;
|
|
9105
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
9106
|
-
read(from: RustBuffer): TypeName {
|
|
9107
|
-
return {
|
|
9108
|
-
identifier: FfiConverterString.read(from),
|
|
9109
|
-
issuerPublicKey: FfiConverterString.read(from),
|
|
9110
|
-
name: FfiConverterString.read(from),
|
|
9111
|
-
ticker: FfiConverterString.read(from),
|
|
9112
|
-
decimals: FfiConverterUInt32.read(from),
|
|
9113
|
-
maxSupply: FfiConverterTypeu128.read(from),
|
|
9114
|
-
isFreezable: FfiConverterBool.read(from),
|
|
9115
|
-
};
|
|
9116
|
-
}
|
|
9117
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
9118
|
-
FfiConverterString.write(value.identifier, into);
|
|
9119
|
-
FfiConverterString.write(value.issuerPublicKey, into);
|
|
9120
|
-
FfiConverterString.write(value.name, into);
|
|
9121
|
-
FfiConverterString.write(value.ticker, into);
|
|
9122
|
-
FfiConverterUInt32.write(value.decimals, into);
|
|
9123
|
-
FfiConverterTypeu128.write(value.maxSupply, into);
|
|
9124
|
-
FfiConverterBool.write(value.isFreezable, into);
|
|
9125
|
-
}
|
|
9126
|
-
allocationSize(value: TypeName): number {
|
|
9127
|
-
return (
|
|
9128
|
-
FfiConverterString.allocationSize(value.identifier) +
|
|
9129
|
-
FfiConverterString.allocationSize(value.issuerPublicKey) +
|
|
9130
|
-
FfiConverterString.allocationSize(value.name) +
|
|
9131
|
-
FfiConverterString.allocationSize(value.ticker) +
|
|
9132
|
-
FfiConverterUInt32.allocationSize(value.decimals) +
|
|
9133
|
-
FfiConverterTypeu128.allocationSize(value.maxSupply) +
|
|
9134
|
-
FfiConverterBool.allocationSize(value.isFreezable)
|
|
9135
|
-
);
|
|
9136
|
-
}
|
|
9137
|
-
}
|
|
9138
|
-
return new FFIConverter();
|
|
9139
|
-
})();
|
|
9140
|
-
|
|
9141
|
-
export type TxStatus = {
|
|
9142
|
-
confirmed: boolean;
|
|
9143
|
-
blockHeight: /*u32*/ number | undefined;
|
|
9144
|
-
blockTime: /*u64*/ bigint | undefined;
|
|
9145
|
-
};
|
|
9146
|
-
|
|
9147
|
-
/**
|
|
9148
|
-
* Generated factory for {@link TxStatus} record objects.
|
|
9214
|
+
* Generated factory for {@link TxStatus} record objects.
|
|
9149
9215
|
*/
|
|
9150
9216
|
export const TxStatus = (() => {
|
|
9151
9217
|
const defaults = () => ({});
|
|
@@ -10254,169 +10320,503 @@ export const ChainServiceError = (() => {
|
|
|
10254
10320
|
static instanceOf(obj: any): obj is InvalidAddress_ {
|
|
10255
10321
|
return obj.tag === ChainServiceError_Tags.InvalidAddress;
|
|
10256
10322
|
}
|
|
10257
|
-
|
|
10258
|
-
static hasInner(obj: any): obj is InvalidAddress_ {
|
|
10259
|
-
return InvalidAddress_.instanceOf(obj);
|
|
10323
|
+
|
|
10324
|
+
static hasInner(obj: any): obj is InvalidAddress_ {
|
|
10325
|
+
return InvalidAddress_.instanceOf(obj);
|
|
10326
|
+
}
|
|
10327
|
+
|
|
10328
|
+
static getInner(obj: InvalidAddress_): Readonly<[string]> {
|
|
10329
|
+
return obj.inner;
|
|
10330
|
+
}
|
|
10331
|
+
}
|
|
10332
|
+
|
|
10333
|
+
type ServiceConnectivity__interface = {
|
|
10334
|
+
tag: ChainServiceError_Tags.ServiceConnectivity;
|
|
10335
|
+
inner: Readonly<[string]>;
|
|
10336
|
+
};
|
|
10337
|
+
|
|
10338
|
+
class ServiceConnectivity_
|
|
10339
|
+
extends UniffiError
|
|
10340
|
+
implements ServiceConnectivity__interface
|
|
10341
|
+
{
|
|
10342
|
+
/**
|
|
10343
|
+
* @private
|
|
10344
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10345
|
+
*/
|
|
10346
|
+
readonly [uniffiTypeNameSymbol] = 'ChainServiceError';
|
|
10347
|
+
readonly tag = ChainServiceError_Tags.ServiceConnectivity;
|
|
10348
|
+
readonly inner: Readonly<[string]>;
|
|
10349
|
+
constructor(v0: string) {
|
|
10350
|
+
super('ChainServiceError', 'ServiceConnectivity');
|
|
10351
|
+
this.inner = Object.freeze([v0]);
|
|
10352
|
+
}
|
|
10353
|
+
|
|
10354
|
+
static new(v0: string): ServiceConnectivity_ {
|
|
10355
|
+
return new ServiceConnectivity_(v0);
|
|
10356
|
+
}
|
|
10357
|
+
|
|
10358
|
+
static instanceOf(obj: any): obj is ServiceConnectivity_ {
|
|
10359
|
+
return obj.tag === ChainServiceError_Tags.ServiceConnectivity;
|
|
10360
|
+
}
|
|
10361
|
+
|
|
10362
|
+
static hasInner(obj: any): obj is ServiceConnectivity_ {
|
|
10363
|
+
return ServiceConnectivity_.instanceOf(obj);
|
|
10364
|
+
}
|
|
10365
|
+
|
|
10366
|
+
static getInner(obj: ServiceConnectivity_): Readonly<[string]> {
|
|
10367
|
+
return obj.inner;
|
|
10368
|
+
}
|
|
10369
|
+
}
|
|
10370
|
+
|
|
10371
|
+
type Generic__interface = {
|
|
10372
|
+
tag: ChainServiceError_Tags.Generic;
|
|
10373
|
+
inner: Readonly<[string]>;
|
|
10374
|
+
};
|
|
10375
|
+
|
|
10376
|
+
class Generic_ extends UniffiError implements Generic__interface {
|
|
10377
|
+
/**
|
|
10378
|
+
* @private
|
|
10379
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10380
|
+
*/
|
|
10381
|
+
readonly [uniffiTypeNameSymbol] = 'ChainServiceError';
|
|
10382
|
+
readonly tag = ChainServiceError_Tags.Generic;
|
|
10383
|
+
readonly inner: Readonly<[string]>;
|
|
10384
|
+
constructor(v0: string) {
|
|
10385
|
+
super('ChainServiceError', 'Generic');
|
|
10386
|
+
this.inner = Object.freeze([v0]);
|
|
10387
|
+
}
|
|
10388
|
+
|
|
10389
|
+
static new(v0: string): Generic_ {
|
|
10390
|
+
return new Generic_(v0);
|
|
10391
|
+
}
|
|
10392
|
+
|
|
10393
|
+
static instanceOf(obj: any): obj is Generic_ {
|
|
10394
|
+
return obj.tag === ChainServiceError_Tags.Generic;
|
|
10395
|
+
}
|
|
10396
|
+
|
|
10397
|
+
static hasInner(obj: any): obj is Generic_ {
|
|
10398
|
+
return Generic_.instanceOf(obj);
|
|
10399
|
+
}
|
|
10400
|
+
|
|
10401
|
+
static getInner(obj: Generic_): Readonly<[string]> {
|
|
10402
|
+
return obj.inner;
|
|
10403
|
+
}
|
|
10404
|
+
}
|
|
10405
|
+
|
|
10406
|
+
function instanceOf(obj: any): obj is ChainServiceError {
|
|
10407
|
+
return obj[uniffiTypeNameSymbol] === 'ChainServiceError';
|
|
10408
|
+
}
|
|
10409
|
+
|
|
10410
|
+
return Object.freeze({
|
|
10411
|
+
instanceOf,
|
|
10412
|
+
InvalidAddress: InvalidAddress_,
|
|
10413
|
+
ServiceConnectivity: ServiceConnectivity_,
|
|
10414
|
+
Generic: Generic_,
|
|
10415
|
+
});
|
|
10416
|
+
})();
|
|
10417
|
+
|
|
10418
|
+
export type ChainServiceError = InstanceType<
|
|
10419
|
+
(typeof ChainServiceError)[keyof Omit<typeof ChainServiceError, 'instanceOf'>]
|
|
10420
|
+
>;
|
|
10421
|
+
|
|
10422
|
+
// FfiConverter for enum ChainServiceError
|
|
10423
|
+
const FfiConverterTypeChainServiceError = (() => {
|
|
10424
|
+
const ordinalConverter = FfiConverterInt32;
|
|
10425
|
+
type TypeName = ChainServiceError;
|
|
10426
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
10427
|
+
read(from: RustBuffer): TypeName {
|
|
10428
|
+
switch (ordinalConverter.read(from)) {
|
|
10429
|
+
case 1:
|
|
10430
|
+
return new ChainServiceError.InvalidAddress(
|
|
10431
|
+
FfiConverterString.read(from)
|
|
10432
|
+
);
|
|
10433
|
+
case 2:
|
|
10434
|
+
return new ChainServiceError.ServiceConnectivity(
|
|
10435
|
+
FfiConverterString.read(from)
|
|
10436
|
+
);
|
|
10437
|
+
case 3:
|
|
10438
|
+
return new ChainServiceError.Generic(FfiConverterString.read(from));
|
|
10439
|
+
default:
|
|
10440
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10441
|
+
}
|
|
10442
|
+
}
|
|
10443
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
10444
|
+
switch (value.tag) {
|
|
10445
|
+
case ChainServiceError_Tags.InvalidAddress: {
|
|
10446
|
+
ordinalConverter.write(1, into);
|
|
10447
|
+
const inner = value.inner;
|
|
10448
|
+
FfiConverterString.write(inner[0], into);
|
|
10449
|
+
return;
|
|
10450
|
+
}
|
|
10451
|
+
case ChainServiceError_Tags.ServiceConnectivity: {
|
|
10452
|
+
ordinalConverter.write(2, into);
|
|
10453
|
+
const inner = value.inner;
|
|
10454
|
+
FfiConverterString.write(inner[0], into);
|
|
10455
|
+
return;
|
|
10456
|
+
}
|
|
10457
|
+
case ChainServiceError_Tags.Generic: {
|
|
10458
|
+
ordinalConverter.write(3, into);
|
|
10459
|
+
const inner = value.inner;
|
|
10460
|
+
FfiConverterString.write(inner[0], into);
|
|
10461
|
+
return;
|
|
10462
|
+
}
|
|
10463
|
+
default:
|
|
10464
|
+
// Throwing from here means that ChainServiceError_Tags hasn't matched an ordinal.
|
|
10465
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10466
|
+
}
|
|
10467
|
+
}
|
|
10468
|
+
allocationSize(value: TypeName): number {
|
|
10469
|
+
switch (value.tag) {
|
|
10470
|
+
case ChainServiceError_Tags.InvalidAddress: {
|
|
10471
|
+
const inner = value.inner;
|
|
10472
|
+
let size = ordinalConverter.allocationSize(1);
|
|
10473
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
10474
|
+
return size;
|
|
10475
|
+
}
|
|
10476
|
+
case ChainServiceError_Tags.ServiceConnectivity: {
|
|
10477
|
+
const inner = value.inner;
|
|
10478
|
+
let size = ordinalConverter.allocationSize(2);
|
|
10479
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
10480
|
+
return size;
|
|
10481
|
+
}
|
|
10482
|
+
case ChainServiceError_Tags.Generic: {
|
|
10483
|
+
const inner = value.inner;
|
|
10484
|
+
let size = ordinalConverter.allocationSize(3);
|
|
10485
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
10486
|
+
return size;
|
|
10487
|
+
}
|
|
10488
|
+
default:
|
|
10489
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10490
|
+
}
|
|
10491
|
+
}
|
|
10492
|
+
}
|
|
10493
|
+
return new FFIConverter();
|
|
10494
|
+
})();
|
|
10495
|
+
|
|
10496
|
+
// Enum: ConversionPurpose
|
|
10497
|
+
export enum ConversionPurpose_Tags {
|
|
10498
|
+
OngoingPayment = 'OngoingPayment',
|
|
10499
|
+
SelfTransfer = 'SelfTransfer',
|
|
10500
|
+
}
|
|
10501
|
+
/**
|
|
10502
|
+
* The purpose of the conversion, which is used to provide context for the conversion
|
|
10503
|
+
* if its related to an ongoing payment or a self-transfer.
|
|
10504
|
+
*/
|
|
10505
|
+
export const ConversionPurpose = (() => {
|
|
10506
|
+
type OngoingPayment__interface = {
|
|
10507
|
+
tag: ConversionPurpose_Tags.OngoingPayment;
|
|
10508
|
+
inner: Readonly<{ paymentRequest: string }>;
|
|
10509
|
+
};
|
|
10510
|
+
|
|
10511
|
+
/**
|
|
10512
|
+
* Conversion is associated with an ongoing payment
|
|
10513
|
+
*/
|
|
10514
|
+
class OngoingPayment_
|
|
10515
|
+
extends UniffiEnum
|
|
10516
|
+
implements OngoingPayment__interface
|
|
10517
|
+
{
|
|
10518
|
+
/**
|
|
10519
|
+
* @private
|
|
10520
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10521
|
+
*/
|
|
10522
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionPurpose';
|
|
10523
|
+
readonly tag = ConversionPurpose_Tags.OngoingPayment;
|
|
10524
|
+
readonly inner: Readonly<{ paymentRequest: string }>;
|
|
10525
|
+
constructor(inner: {
|
|
10526
|
+
/**
|
|
10527
|
+
* The payment request of the ongoing payment
|
|
10528
|
+
*/ paymentRequest: string;
|
|
10529
|
+
}) {
|
|
10530
|
+
super('ConversionPurpose', 'OngoingPayment');
|
|
10531
|
+
this.inner = Object.freeze(inner);
|
|
10532
|
+
}
|
|
10533
|
+
|
|
10534
|
+
static new(inner: {
|
|
10535
|
+
/**
|
|
10536
|
+
* The payment request of the ongoing payment
|
|
10537
|
+
*/ paymentRequest: string;
|
|
10538
|
+
}): OngoingPayment_ {
|
|
10539
|
+
return new OngoingPayment_(inner);
|
|
10540
|
+
}
|
|
10541
|
+
|
|
10542
|
+
static instanceOf(obj: any): obj is OngoingPayment_ {
|
|
10543
|
+
return obj.tag === ConversionPurpose_Tags.OngoingPayment;
|
|
10544
|
+
}
|
|
10545
|
+
}
|
|
10546
|
+
|
|
10547
|
+
type SelfTransfer__interface = {
|
|
10548
|
+
tag: ConversionPurpose_Tags.SelfTransfer;
|
|
10549
|
+
};
|
|
10550
|
+
|
|
10551
|
+
/**
|
|
10552
|
+
* Conversion is for self-transfer
|
|
10553
|
+
*/
|
|
10554
|
+
class SelfTransfer_ extends UniffiEnum implements SelfTransfer__interface {
|
|
10555
|
+
/**
|
|
10556
|
+
* @private
|
|
10557
|
+
* This field is private and should not be used, use `tag` instead.
|
|
10558
|
+
*/
|
|
10559
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionPurpose';
|
|
10560
|
+
readonly tag = ConversionPurpose_Tags.SelfTransfer;
|
|
10561
|
+
constructor() {
|
|
10562
|
+
super('ConversionPurpose', 'SelfTransfer');
|
|
10563
|
+
}
|
|
10564
|
+
|
|
10565
|
+
static new(): SelfTransfer_ {
|
|
10566
|
+
return new SelfTransfer_();
|
|
10567
|
+
}
|
|
10568
|
+
|
|
10569
|
+
static instanceOf(obj: any): obj is SelfTransfer_ {
|
|
10570
|
+
return obj.tag === ConversionPurpose_Tags.SelfTransfer;
|
|
10571
|
+
}
|
|
10572
|
+
}
|
|
10573
|
+
|
|
10574
|
+
function instanceOf(obj: any): obj is ConversionPurpose {
|
|
10575
|
+
return obj[uniffiTypeNameSymbol] === 'ConversionPurpose';
|
|
10576
|
+
}
|
|
10577
|
+
|
|
10578
|
+
return Object.freeze({
|
|
10579
|
+
instanceOf,
|
|
10580
|
+
OngoingPayment: OngoingPayment_,
|
|
10581
|
+
SelfTransfer: SelfTransfer_,
|
|
10582
|
+
});
|
|
10583
|
+
})();
|
|
10584
|
+
|
|
10585
|
+
/**
|
|
10586
|
+
* The purpose of the conversion, which is used to provide context for the conversion
|
|
10587
|
+
* if its related to an ongoing payment or a self-transfer.
|
|
10588
|
+
*/
|
|
10589
|
+
|
|
10590
|
+
export type ConversionPurpose = InstanceType<
|
|
10591
|
+
(typeof ConversionPurpose)[keyof Omit<typeof ConversionPurpose, 'instanceOf'>]
|
|
10592
|
+
>;
|
|
10593
|
+
|
|
10594
|
+
// FfiConverter for enum ConversionPurpose
|
|
10595
|
+
const FfiConverterTypeConversionPurpose = (() => {
|
|
10596
|
+
const ordinalConverter = FfiConverterInt32;
|
|
10597
|
+
type TypeName = ConversionPurpose;
|
|
10598
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
10599
|
+
read(from: RustBuffer): TypeName {
|
|
10600
|
+
switch (ordinalConverter.read(from)) {
|
|
10601
|
+
case 1:
|
|
10602
|
+
return new ConversionPurpose.OngoingPayment({
|
|
10603
|
+
paymentRequest: FfiConverterString.read(from),
|
|
10604
|
+
});
|
|
10605
|
+
case 2:
|
|
10606
|
+
return new ConversionPurpose.SelfTransfer();
|
|
10607
|
+
default:
|
|
10608
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
10612
|
+
switch (value.tag) {
|
|
10613
|
+
case ConversionPurpose_Tags.OngoingPayment: {
|
|
10614
|
+
ordinalConverter.write(1, into);
|
|
10615
|
+
const inner = value.inner;
|
|
10616
|
+
FfiConverterString.write(inner.paymentRequest, into);
|
|
10617
|
+
return;
|
|
10618
|
+
}
|
|
10619
|
+
case ConversionPurpose_Tags.SelfTransfer: {
|
|
10620
|
+
ordinalConverter.write(2, into);
|
|
10621
|
+
return;
|
|
10622
|
+
}
|
|
10623
|
+
default:
|
|
10624
|
+
// Throwing from here means that ConversionPurpose_Tags hasn't matched an ordinal.
|
|
10625
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10626
|
+
}
|
|
10627
|
+
}
|
|
10628
|
+
allocationSize(value: TypeName): number {
|
|
10629
|
+
switch (value.tag) {
|
|
10630
|
+
case ConversionPurpose_Tags.OngoingPayment: {
|
|
10631
|
+
const inner = value.inner;
|
|
10632
|
+
let size = ordinalConverter.allocationSize(1);
|
|
10633
|
+
size += FfiConverterString.allocationSize(inner.paymentRequest);
|
|
10634
|
+
return size;
|
|
10635
|
+
}
|
|
10636
|
+
case ConversionPurpose_Tags.SelfTransfer: {
|
|
10637
|
+
return ordinalConverter.allocationSize(2);
|
|
10638
|
+
}
|
|
10639
|
+
default:
|
|
10640
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10641
|
+
}
|
|
10642
|
+
}
|
|
10643
|
+
}
|
|
10644
|
+
return new FFIConverter();
|
|
10645
|
+
})();
|
|
10646
|
+
|
|
10647
|
+
/**
|
|
10648
|
+
* The status of the conversion
|
|
10649
|
+
*/
|
|
10650
|
+
export enum ConversionStatus {
|
|
10651
|
+
/**
|
|
10652
|
+
* The conversion was successful
|
|
10653
|
+
*/
|
|
10654
|
+
Completed,
|
|
10655
|
+
/**
|
|
10656
|
+
* The conversion failed and no refund was made yet, which requires action by the SDK to
|
|
10657
|
+
* perform the refund. This can happen if there was a failure during the conversion process.
|
|
10658
|
+
*/
|
|
10659
|
+
RefundNeeded,
|
|
10660
|
+
/**
|
|
10661
|
+
* The conversion failed and a refund was made
|
|
10662
|
+
*/
|
|
10663
|
+
Refunded,
|
|
10664
|
+
}
|
|
10665
|
+
|
|
10666
|
+
const FfiConverterTypeConversionStatus = (() => {
|
|
10667
|
+
const ordinalConverter = FfiConverterInt32;
|
|
10668
|
+
type TypeName = ConversionStatus;
|
|
10669
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
10670
|
+
read(from: RustBuffer): TypeName {
|
|
10671
|
+
switch (ordinalConverter.read(from)) {
|
|
10672
|
+
case 1:
|
|
10673
|
+
return ConversionStatus.Completed;
|
|
10674
|
+
case 2:
|
|
10675
|
+
return ConversionStatus.RefundNeeded;
|
|
10676
|
+
case 3:
|
|
10677
|
+
return ConversionStatus.Refunded;
|
|
10678
|
+
default:
|
|
10679
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10680
|
+
}
|
|
10681
|
+
}
|
|
10682
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
10683
|
+
switch (value) {
|
|
10684
|
+
case ConversionStatus.Completed:
|
|
10685
|
+
return ordinalConverter.write(1, into);
|
|
10686
|
+
case ConversionStatus.RefundNeeded:
|
|
10687
|
+
return ordinalConverter.write(2, into);
|
|
10688
|
+
case ConversionStatus.Refunded:
|
|
10689
|
+
return ordinalConverter.write(3, into);
|
|
10690
|
+
}
|
|
10260
10691
|
}
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
return obj.inner;
|
|
10692
|
+
allocationSize(value: TypeName): number {
|
|
10693
|
+
return ordinalConverter.allocationSize(0);
|
|
10264
10694
|
}
|
|
10265
10695
|
}
|
|
10696
|
+
return new FFIConverter();
|
|
10697
|
+
})();
|
|
10266
10698
|
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10699
|
+
// Enum: ConversionType
|
|
10700
|
+
export enum ConversionType_Tags {
|
|
10701
|
+
FromBitcoin = 'FromBitcoin',
|
|
10702
|
+
ToBitcoin = 'ToBitcoin',
|
|
10703
|
+
}
|
|
10704
|
+
export const ConversionType = (() => {
|
|
10705
|
+
type FromBitcoin__interface = {
|
|
10706
|
+
tag: ConversionType_Tags.FromBitcoin;
|
|
10270
10707
|
};
|
|
10271
10708
|
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
{
|
|
10709
|
+
/**
|
|
10710
|
+
* Converting from Bitcoin to a token
|
|
10711
|
+
*/
|
|
10712
|
+
class FromBitcoin_ extends UniffiEnum implements FromBitcoin__interface {
|
|
10276
10713
|
/**
|
|
10277
10714
|
* @private
|
|
10278
10715
|
* This field is private and should not be used, use `tag` instead.
|
|
10279
10716
|
*/
|
|
10280
|
-
readonly [uniffiTypeNameSymbol] = '
|
|
10281
|
-
readonly tag =
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
super('ChainServiceError', 'ServiceConnectivity');
|
|
10285
|
-
this.inner = Object.freeze([v0]);
|
|
10286
|
-
}
|
|
10287
|
-
|
|
10288
|
-
static new(v0: string): ServiceConnectivity_ {
|
|
10289
|
-
return new ServiceConnectivity_(v0);
|
|
10290
|
-
}
|
|
10291
|
-
|
|
10292
|
-
static instanceOf(obj: any): obj is ServiceConnectivity_ {
|
|
10293
|
-
return obj.tag === ChainServiceError_Tags.ServiceConnectivity;
|
|
10717
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionType';
|
|
10718
|
+
readonly tag = ConversionType_Tags.FromBitcoin;
|
|
10719
|
+
constructor() {
|
|
10720
|
+
super('ConversionType', 'FromBitcoin');
|
|
10294
10721
|
}
|
|
10295
10722
|
|
|
10296
|
-
static
|
|
10297
|
-
return
|
|
10723
|
+
static new(): FromBitcoin_ {
|
|
10724
|
+
return new FromBitcoin_();
|
|
10298
10725
|
}
|
|
10299
10726
|
|
|
10300
|
-
static
|
|
10301
|
-
return obj.
|
|
10727
|
+
static instanceOf(obj: any): obj is FromBitcoin_ {
|
|
10728
|
+
return obj.tag === ConversionType_Tags.FromBitcoin;
|
|
10302
10729
|
}
|
|
10303
10730
|
}
|
|
10304
10731
|
|
|
10305
|
-
type
|
|
10306
|
-
tag:
|
|
10307
|
-
inner: Readonly<
|
|
10732
|
+
type ToBitcoin__interface = {
|
|
10733
|
+
tag: ConversionType_Tags.ToBitcoin;
|
|
10734
|
+
inner: Readonly<{ fromTokenIdentifier: string }>;
|
|
10308
10735
|
};
|
|
10309
10736
|
|
|
10310
|
-
|
|
10737
|
+
/**
|
|
10738
|
+
* Converting from a token to Bitcoin
|
|
10739
|
+
*/
|
|
10740
|
+
class ToBitcoin_ extends UniffiEnum implements ToBitcoin__interface {
|
|
10311
10741
|
/**
|
|
10312
10742
|
* @private
|
|
10313
10743
|
* This field is private and should not be used, use `tag` instead.
|
|
10314
10744
|
*/
|
|
10315
|
-
readonly [uniffiTypeNameSymbol] = '
|
|
10316
|
-
readonly tag =
|
|
10317
|
-
readonly inner: Readonly<
|
|
10318
|
-
constructor(
|
|
10319
|
-
super('
|
|
10320
|
-
this.inner = Object.freeze(
|
|
10321
|
-
}
|
|
10322
|
-
|
|
10323
|
-
static new(v0: string): Generic_ {
|
|
10324
|
-
return new Generic_(v0);
|
|
10325
|
-
}
|
|
10326
|
-
|
|
10327
|
-
static instanceOf(obj: any): obj is Generic_ {
|
|
10328
|
-
return obj.tag === ChainServiceError_Tags.Generic;
|
|
10745
|
+
readonly [uniffiTypeNameSymbol] = 'ConversionType';
|
|
10746
|
+
readonly tag = ConversionType_Tags.ToBitcoin;
|
|
10747
|
+
readonly inner: Readonly<{ fromTokenIdentifier: string }>;
|
|
10748
|
+
constructor(inner: { fromTokenIdentifier: string }) {
|
|
10749
|
+
super('ConversionType', 'ToBitcoin');
|
|
10750
|
+
this.inner = Object.freeze(inner);
|
|
10329
10751
|
}
|
|
10330
10752
|
|
|
10331
|
-
static
|
|
10332
|
-
return
|
|
10753
|
+
static new(inner: { fromTokenIdentifier: string }): ToBitcoin_ {
|
|
10754
|
+
return new ToBitcoin_(inner);
|
|
10333
10755
|
}
|
|
10334
10756
|
|
|
10335
|
-
static
|
|
10336
|
-
return obj.
|
|
10757
|
+
static instanceOf(obj: any): obj is ToBitcoin_ {
|
|
10758
|
+
return obj.tag === ConversionType_Tags.ToBitcoin;
|
|
10337
10759
|
}
|
|
10338
10760
|
}
|
|
10339
10761
|
|
|
10340
|
-
function instanceOf(obj: any): obj is
|
|
10341
|
-
return obj[uniffiTypeNameSymbol] === '
|
|
10762
|
+
function instanceOf(obj: any): obj is ConversionType {
|
|
10763
|
+
return obj[uniffiTypeNameSymbol] === 'ConversionType';
|
|
10342
10764
|
}
|
|
10343
10765
|
|
|
10344
10766
|
return Object.freeze({
|
|
10345
10767
|
instanceOf,
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
Generic: Generic_,
|
|
10768
|
+
FromBitcoin: FromBitcoin_,
|
|
10769
|
+
ToBitcoin: ToBitcoin_,
|
|
10349
10770
|
});
|
|
10350
10771
|
})();
|
|
10351
10772
|
|
|
10352
|
-
export type
|
|
10353
|
-
(typeof
|
|
10773
|
+
export type ConversionType = InstanceType<
|
|
10774
|
+
(typeof ConversionType)[keyof Omit<typeof ConversionType, 'instanceOf'>]
|
|
10354
10775
|
>;
|
|
10355
10776
|
|
|
10356
|
-
// FfiConverter for enum
|
|
10357
|
-
const
|
|
10777
|
+
// FfiConverter for enum ConversionType
|
|
10778
|
+
const FfiConverterTypeConversionType = (() => {
|
|
10358
10779
|
const ordinalConverter = FfiConverterInt32;
|
|
10359
|
-
type TypeName =
|
|
10780
|
+
type TypeName = ConversionType;
|
|
10360
10781
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
10361
10782
|
read(from: RustBuffer): TypeName {
|
|
10362
10783
|
switch (ordinalConverter.read(from)) {
|
|
10363
10784
|
case 1:
|
|
10364
|
-
return new
|
|
10365
|
-
FfiConverterString.read(from)
|
|
10366
|
-
);
|
|
10785
|
+
return new ConversionType.FromBitcoin();
|
|
10367
10786
|
case 2:
|
|
10368
|
-
return new
|
|
10369
|
-
FfiConverterString.read(from)
|
|
10370
|
-
);
|
|
10371
|
-
case 3:
|
|
10372
|
-
return new ChainServiceError.Generic(FfiConverterString.read(from));
|
|
10787
|
+
return new ConversionType.ToBitcoin({
|
|
10788
|
+
fromTokenIdentifier: FfiConverterString.read(from),
|
|
10789
|
+
});
|
|
10373
10790
|
default:
|
|
10374
10791
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10375
10792
|
}
|
|
10376
10793
|
}
|
|
10377
10794
|
write(value: TypeName, into: RustBuffer): void {
|
|
10378
10795
|
switch (value.tag) {
|
|
10379
|
-
case
|
|
10796
|
+
case ConversionType_Tags.FromBitcoin: {
|
|
10380
10797
|
ordinalConverter.write(1, into);
|
|
10381
|
-
const inner = value.inner;
|
|
10382
|
-
FfiConverterString.write(inner[0], into);
|
|
10383
10798
|
return;
|
|
10384
10799
|
}
|
|
10385
|
-
case
|
|
10800
|
+
case ConversionType_Tags.ToBitcoin: {
|
|
10386
10801
|
ordinalConverter.write(2, into);
|
|
10387
10802
|
const inner = value.inner;
|
|
10388
|
-
FfiConverterString.write(inner
|
|
10389
|
-
return;
|
|
10390
|
-
}
|
|
10391
|
-
case ChainServiceError_Tags.Generic: {
|
|
10392
|
-
ordinalConverter.write(3, into);
|
|
10393
|
-
const inner = value.inner;
|
|
10394
|
-
FfiConverterString.write(inner[0], into);
|
|
10803
|
+
FfiConverterString.write(inner.fromTokenIdentifier, into);
|
|
10395
10804
|
return;
|
|
10396
10805
|
}
|
|
10397
10806
|
default:
|
|
10398
|
-
// Throwing from here means that
|
|
10807
|
+
// Throwing from here means that ConversionType_Tags hasn't matched an ordinal.
|
|
10399
10808
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
10400
10809
|
}
|
|
10401
10810
|
}
|
|
10402
10811
|
allocationSize(value: TypeName): number {
|
|
10403
10812
|
switch (value.tag) {
|
|
10404
|
-
case
|
|
10405
|
-
|
|
10406
|
-
let size = ordinalConverter.allocationSize(1);
|
|
10407
|
-
size += FfiConverterString.allocationSize(inner[0]);
|
|
10408
|
-
return size;
|
|
10813
|
+
case ConversionType_Tags.FromBitcoin: {
|
|
10814
|
+
return ordinalConverter.allocationSize(1);
|
|
10409
10815
|
}
|
|
10410
|
-
case
|
|
10816
|
+
case ConversionType_Tags.ToBitcoin: {
|
|
10411
10817
|
const inner = value.inner;
|
|
10412
10818
|
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]);
|
|
10819
|
+
size += FfiConverterString.allocationSize(inner.fromTokenIdentifier);
|
|
10420
10820
|
return size;
|
|
10421
10821
|
}
|
|
10422
10822
|
default:
|
|
@@ -12427,7 +12827,7 @@ export const PaymentDetails = (() => {
|
|
|
12427
12827
|
inner: Readonly<{
|
|
12428
12828
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12429
12829
|
htlcDetails: SparkHtlcDetails | undefined;
|
|
12430
|
-
|
|
12830
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12431
12831
|
}>;
|
|
12432
12832
|
};
|
|
12433
12833
|
|
|
@@ -12441,7 +12841,7 @@ export const PaymentDetails = (() => {
|
|
|
12441
12841
|
readonly inner: Readonly<{
|
|
12442
12842
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12443
12843
|
htlcDetails: SparkHtlcDetails | undefined;
|
|
12444
|
-
|
|
12844
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12445
12845
|
}>;
|
|
12446
12846
|
constructor(inner: {
|
|
12447
12847
|
/**
|
|
@@ -12451,8 +12851,8 @@ export const PaymentDetails = (() => {
|
|
|
12451
12851
|
* The HTLC transfer details if the payment fulfilled an HTLC transfer
|
|
12452
12852
|
*/ htlcDetails: SparkHtlcDetails | undefined;
|
|
12453
12853
|
/**
|
|
12454
|
-
* The information for a
|
|
12455
|
-
*/
|
|
12854
|
+
* The information for a conversion
|
|
12855
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12456
12856
|
}) {
|
|
12457
12857
|
super('PaymentDetails', 'Spark');
|
|
12458
12858
|
this.inner = Object.freeze(inner);
|
|
@@ -12466,8 +12866,8 @@ export const PaymentDetails = (() => {
|
|
|
12466
12866
|
* The HTLC transfer details if the payment fulfilled an HTLC transfer
|
|
12467
12867
|
*/ htlcDetails: SparkHtlcDetails | undefined;
|
|
12468
12868
|
/**
|
|
12469
|
-
* The information for a
|
|
12470
|
-
*/
|
|
12869
|
+
* The information for a conversion
|
|
12870
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12471
12871
|
}): Spark_ {
|
|
12472
12872
|
return new Spark_(inner);
|
|
12473
12873
|
}
|
|
@@ -12483,7 +12883,7 @@ export const PaymentDetails = (() => {
|
|
|
12483
12883
|
metadata: TokenMetadata;
|
|
12484
12884
|
txHash: string;
|
|
12485
12885
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12486
|
-
|
|
12886
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12487
12887
|
}>;
|
|
12488
12888
|
};
|
|
12489
12889
|
|
|
@@ -12498,7 +12898,7 @@ export const PaymentDetails = (() => {
|
|
|
12498
12898
|
metadata: TokenMetadata;
|
|
12499
12899
|
txHash: string;
|
|
12500
12900
|
invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12501
|
-
|
|
12901
|
+
conversionInfo: ConversionInfo | undefined;
|
|
12502
12902
|
}>;
|
|
12503
12903
|
constructor(inner: {
|
|
12504
12904
|
metadata: TokenMetadata;
|
|
@@ -12507,8 +12907,8 @@ export const PaymentDetails = (() => {
|
|
|
12507
12907
|
* The invoice details if the payment fulfilled a spark invoice
|
|
12508
12908
|
*/ invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12509
12909
|
/**
|
|
12510
|
-
* The information for a
|
|
12511
|
-
*/
|
|
12910
|
+
* The information for a conversion
|
|
12911
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12512
12912
|
}) {
|
|
12513
12913
|
super('PaymentDetails', 'Token');
|
|
12514
12914
|
this.inner = Object.freeze(inner);
|
|
@@ -12521,8 +12921,8 @@ export const PaymentDetails = (() => {
|
|
|
12521
12921
|
* The invoice details if the payment fulfilled a spark invoice
|
|
12522
12922
|
*/ invoiceDetails: SparkInvoicePaymentDetails | undefined;
|
|
12523
12923
|
/**
|
|
12524
|
-
* The information for a
|
|
12525
|
-
*/
|
|
12924
|
+
* The information for a conversion
|
|
12925
|
+
*/ conversionInfo: ConversionInfo | undefined;
|
|
12526
12926
|
}): Token_ {
|
|
12527
12927
|
return new Token_(inner);
|
|
12528
12928
|
}
|
|
@@ -12715,8 +13115,7 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12715
13115
|
invoiceDetails:
|
|
12716
13116
|
FfiConverterOptionalTypeSparkInvoicePaymentDetails.read(from),
|
|
12717
13117
|
htlcDetails: FfiConverterOptionalTypeSparkHtlcDetails.read(from),
|
|
12718
|
-
|
|
12719
|
-
FfiConverterOptionalTypeTokenConversionInfo.read(from),
|
|
13118
|
+
conversionInfo: FfiConverterOptionalTypeConversionInfo.read(from),
|
|
12720
13119
|
});
|
|
12721
13120
|
case 2:
|
|
12722
13121
|
return new PaymentDetails.Token({
|
|
@@ -12724,8 +13123,7 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12724
13123
|
txHash: FfiConverterString.read(from),
|
|
12725
13124
|
invoiceDetails:
|
|
12726
13125
|
FfiConverterOptionalTypeSparkInvoicePaymentDetails.read(from),
|
|
12727
|
-
|
|
12728
|
-
FfiConverterOptionalTypeTokenConversionInfo.read(from),
|
|
13126
|
+
conversionInfo: FfiConverterOptionalTypeConversionInfo.read(from),
|
|
12729
13127
|
});
|
|
12730
13128
|
case 3:
|
|
12731
13129
|
return new PaymentDetails.Lightning({
|
|
@@ -12765,8 +13163,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12765
13163
|
inner.htlcDetails,
|
|
12766
13164
|
into
|
|
12767
13165
|
);
|
|
12768
|
-
|
|
12769
|
-
inner.
|
|
13166
|
+
FfiConverterOptionalTypeConversionInfo.write(
|
|
13167
|
+
inner.conversionInfo,
|
|
12770
13168
|
into
|
|
12771
13169
|
);
|
|
12772
13170
|
return;
|
|
@@ -12780,8 +13178,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12780
13178
|
inner.invoiceDetails,
|
|
12781
13179
|
into
|
|
12782
13180
|
);
|
|
12783
|
-
|
|
12784
|
-
inner.
|
|
13181
|
+
FfiConverterOptionalTypeConversionInfo.write(
|
|
13182
|
+
inner.conversionInfo,
|
|
12785
13183
|
into
|
|
12786
13184
|
);
|
|
12787
13185
|
return;
|
|
@@ -12834,8 +13232,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12834
13232
|
size += FfiConverterOptionalTypeSparkHtlcDetails.allocationSize(
|
|
12835
13233
|
inner.htlcDetails
|
|
12836
13234
|
);
|
|
12837
|
-
size +=
|
|
12838
|
-
inner.
|
|
13235
|
+
size += FfiConverterOptionalTypeConversionInfo.allocationSize(
|
|
13236
|
+
inner.conversionInfo
|
|
12839
13237
|
);
|
|
12840
13238
|
return size;
|
|
12841
13239
|
}
|
|
@@ -12848,8 +13246,8 @@ const FfiConverterTypePaymentDetails = (() => {
|
|
|
12848
13246
|
FfiConverterOptionalTypeSparkInvoicePaymentDetails.allocationSize(
|
|
12849
13247
|
inner.invoiceDetails
|
|
12850
13248
|
);
|
|
12851
|
-
size +=
|
|
12852
|
-
inner.
|
|
13249
|
+
size += FfiConverterOptionalTypeConversionInfo.allocationSize(
|
|
13250
|
+
inner.conversionInfo
|
|
12853
13251
|
);
|
|
12854
13252
|
return size;
|
|
12855
13253
|
}
|
|
@@ -13727,7 +14125,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13727
14125
|
* If empty, it is a Bitcoin payment
|
|
13728
14126
|
*/ tokenIdentifier: string | undefined;
|
|
13729
14127
|
/**
|
|
13730
|
-
* The expiry time of the invoice
|
|
14128
|
+
* The expiry time of the invoice as a unix timestamp in seconds
|
|
13731
14129
|
*/ expiryTime: /*u64*/ bigint | undefined;
|
|
13732
14130
|
/**
|
|
13733
14131
|
* A description to embed in the invoice.
|
|
@@ -13749,7 +14147,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13749
14147
|
* If empty, it is a Bitcoin payment
|
|
13750
14148
|
*/ tokenIdentifier: string | undefined;
|
|
13751
14149
|
/**
|
|
13752
|
-
* The expiry time of the invoice
|
|
14150
|
+
* The expiry time of the invoice as a unix timestamp in seconds
|
|
13753
14151
|
*/ expiryTime: /*u64*/ bigint | undefined;
|
|
13754
14152
|
/**
|
|
13755
14153
|
* A description to embed in the invoice.
|
|
@@ -13818,7 +14216,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13818
14216
|
description: string;
|
|
13819
14217
|
amountSats: /*u64*/ bigint | undefined;
|
|
13820
14218
|
/**
|
|
13821
|
-
* The expiry
|
|
14219
|
+
* The expiry of the invoice as a duration in seconds
|
|
13822
14220
|
*/ expirySecs: /*u32*/ number | undefined;
|
|
13823
14221
|
}) {
|
|
13824
14222
|
super('ReceivePaymentMethod', 'Bolt11Invoice');
|
|
@@ -13829,7 +14227,7 @@ export const ReceivePaymentMethod = (() => {
|
|
|
13829
14227
|
description: string;
|
|
13830
14228
|
amountSats: /*u64*/ bigint | undefined;
|
|
13831
14229
|
/**
|
|
13832
|
-
* The expiry
|
|
14230
|
+
* The expiry of the invoice as a duration in seconds
|
|
13833
14231
|
*/ expirySecs: /*u32*/ number | undefined;
|
|
13834
14232
|
}): Bolt11Invoice_ {
|
|
13835
14233
|
return new Bolt11Invoice_(inner);
|
|
@@ -17731,140 +18129,6 @@ const FfiConverterTypeSyncStorageError = (() => {
|
|
|
17731
18129
|
return new FFIConverter();
|
|
17732
18130
|
})();
|
|
17733
18131
|
|
|
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);
|
|
17790
|
-
}
|
|
17791
|
-
|
|
17792
|
-
static instanceOf(obj: any): obj is ToBitcoin_ {
|
|
17793
|
-
return obj.tag === TokenConversionType_Tags.ToBitcoin;
|
|
17794
|
-
}
|
|
17795
|
-
}
|
|
17796
|
-
|
|
17797
|
-
function instanceOf(obj: any): obj is TokenConversionType {
|
|
17798
|
-
return obj[uniffiTypeNameSymbol] === 'TokenConversionType';
|
|
17799
|
-
}
|
|
17800
|
-
|
|
17801
|
-
return Object.freeze({
|
|
17802
|
-
instanceOf,
|
|
17803
|
-
FromBitcoin: FromBitcoin_,
|
|
17804
|
-
ToBitcoin: ToBitcoin_,
|
|
17805
|
-
});
|
|
17806
|
-
})();
|
|
17807
|
-
|
|
17808
|
-
export type TokenConversionType = InstanceType<
|
|
17809
|
-
(typeof TokenConversionType)[keyof Omit<
|
|
17810
|
-
typeof TokenConversionType,
|
|
17811
|
-
'instanceOf'
|
|
17812
|
-
>]
|
|
17813
|
-
>;
|
|
17814
|
-
|
|
17815
|
-
// FfiConverter for enum TokenConversionType
|
|
17816
|
-
const FfiConverterTypeTokenConversionType = (() => {
|
|
17817
|
-
const ordinalConverter = FfiConverterInt32;
|
|
17818
|
-
type TypeName = TokenConversionType;
|
|
17819
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
17820
|
-
read(from: RustBuffer): TypeName {
|
|
17821
|
-
switch (ordinalConverter.read(from)) {
|
|
17822
|
-
case 1:
|
|
17823
|
-
return new TokenConversionType.FromBitcoin();
|
|
17824
|
-
case 2:
|
|
17825
|
-
return new TokenConversionType.ToBitcoin({
|
|
17826
|
-
fromTokenIdentifier: FfiConverterString.read(from),
|
|
17827
|
-
});
|
|
17828
|
-
default:
|
|
17829
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17830
|
-
}
|
|
17831
|
-
}
|
|
17832
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
17833
|
-
switch (value.tag) {
|
|
17834
|
-
case TokenConversionType_Tags.FromBitcoin: {
|
|
17835
|
-
ordinalConverter.write(1, into);
|
|
17836
|
-
return;
|
|
17837
|
-
}
|
|
17838
|
-
case TokenConversionType_Tags.ToBitcoin: {
|
|
17839
|
-
ordinalConverter.write(2, into);
|
|
17840
|
-
const inner = value.inner;
|
|
17841
|
-
FfiConverterString.write(inner.fromTokenIdentifier, into);
|
|
17842
|
-
return;
|
|
17843
|
-
}
|
|
17844
|
-
default:
|
|
17845
|
-
// Throwing from here means that TokenConversionType_Tags hasn't matched an ordinal.
|
|
17846
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17847
|
-
}
|
|
17848
|
-
}
|
|
17849
|
-
allocationSize(value: TypeName): number {
|
|
17850
|
-
switch (value.tag) {
|
|
17851
|
-
case TokenConversionType_Tags.FromBitcoin: {
|
|
17852
|
-
return ordinalConverter.allocationSize(1);
|
|
17853
|
-
}
|
|
17854
|
-
case TokenConversionType_Tags.ToBitcoin: {
|
|
17855
|
-
const inner = value.inner;
|
|
17856
|
-
let size = ordinalConverter.allocationSize(2);
|
|
17857
|
-
size += FfiConverterString.allocationSize(inner.fromTokenIdentifier);
|
|
17858
|
-
return size;
|
|
17859
|
-
}
|
|
17860
|
-
default:
|
|
17861
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
17862
|
-
}
|
|
17863
|
-
}
|
|
17864
|
-
}
|
|
17865
|
-
return new FFIConverter();
|
|
17866
|
-
})();
|
|
17867
|
-
|
|
17868
18132
|
// Enum: UpdateDepositPayload
|
|
17869
18133
|
export enum UpdateDepositPayload_Tags {
|
|
17870
18134
|
ClaimError = 'ClaimError',
|
|
@@ -18643,10 +18907,10 @@ export interface BreezSdkInterface {
|
|
|
18643
18907
|
* Result containing either success or an `SdkError` if the background task couldn't be stopped
|
|
18644
18908
|
*/
|
|
18645
18909
|
disconnect(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
|
|
18646
|
-
|
|
18647
|
-
request:
|
|
18910
|
+
fetchConversionLimits(
|
|
18911
|
+
request: FetchConversionLimitsRequest,
|
|
18648
18912
|
asyncOpts_?: { signal: AbortSignal }
|
|
18649
|
-
): /*throws*/ Promise<
|
|
18913
|
+
): /*throws*/ Promise<FetchConversionLimitsResponse>;
|
|
18650
18914
|
/**
|
|
18651
18915
|
* Returns the balance of the wallet in satoshis
|
|
18652
18916
|
*/
|
|
@@ -19193,18 +19457,18 @@ export class BreezSdk
|
|
|
19193
19457
|
}
|
|
19194
19458
|
}
|
|
19195
19459
|
|
|
19196
|
-
public async
|
|
19197
|
-
request:
|
|
19460
|
+
public async fetchConversionLimits(
|
|
19461
|
+
request: FetchConversionLimitsRequest,
|
|
19198
19462
|
asyncOpts_?: { signal: AbortSignal }
|
|
19199
|
-
): Promise<
|
|
19463
|
+
): Promise<FetchConversionLimitsResponse> /*throws*/ {
|
|
19200
19464
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
19201
19465
|
try {
|
|
19202
19466
|
return await uniffiRustCallAsync(
|
|
19203
19467
|
/*rustCaller:*/ uniffiCaller,
|
|
19204
19468
|
/*rustFutureFunc:*/ () => {
|
|
19205
|
-
return nativeModule().
|
|
19469
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_fetch_conversion_limits(
|
|
19206
19470
|
uniffiTypeBreezSdkObjectFactory.clonePointer(this),
|
|
19207
|
-
|
|
19471
|
+
FfiConverterTypeFetchConversionLimitsRequest.lower(request)
|
|
19208
19472
|
);
|
|
19209
19473
|
},
|
|
19210
19474
|
/*pollFunc:*/ nativeModule()
|
|
@@ -19215,8 +19479,8 @@ export class BreezSdk
|
|
|
19215
19479
|
.ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
19216
19480
|
/*freeFunc:*/ nativeModule()
|
|
19217
19481
|
.ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
19218
|
-
/*liftFunc:*/
|
|
19219
|
-
|
|
19482
|
+
/*liftFunc:*/ FfiConverterTypeFetchConversionLimitsResponse.lift.bind(
|
|
19483
|
+
FfiConverterTypeFetchConversionLimitsResponse
|
|
19220
19484
|
),
|
|
19221
19485
|
/*liftString:*/ FfiConverterString.lift,
|
|
19222
19486
|
/*asyncOpts:*/ asyncOpts_,
|
|
@@ -27143,6 +27407,21 @@ const FfiConverterOptionalTypeLogger = new FfiConverterOptional(
|
|
|
27143
27407
|
FfiConverterTypeLogger
|
|
27144
27408
|
);
|
|
27145
27409
|
|
|
27410
|
+
// FfiConverter for ConversionEstimate | undefined
|
|
27411
|
+
const FfiConverterOptionalTypeConversionEstimate = new FfiConverterOptional(
|
|
27412
|
+
FfiConverterTypeConversionEstimate
|
|
27413
|
+
);
|
|
27414
|
+
|
|
27415
|
+
// FfiConverter for ConversionInfo | undefined
|
|
27416
|
+
const FfiConverterOptionalTypeConversionInfo = new FfiConverterOptional(
|
|
27417
|
+
FfiConverterTypeConversionInfo
|
|
27418
|
+
);
|
|
27419
|
+
|
|
27420
|
+
// FfiConverter for ConversionOptions | undefined
|
|
27421
|
+
const FfiConverterOptionalTypeConversionOptions = new FfiConverterOptional(
|
|
27422
|
+
FfiConverterTypeConversionOptions
|
|
27423
|
+
);
|
|
27424
|
+
|
|
27146
27425
|
// FfiConverter for Credentials | undefined
|
|
27147
27426
|
const FfiConverterOptionalTypeCredentials = new FfiConverterOptional(
|
|
27148
27427
|
FfiConverterTypeCredentials
|
|
@@ -27207,16 +27486,6 @@ const FfiConverterOptionalTypeSymbol = new FfiConverterOptional(
|
|
|
27207
27486
|
FfiConverterTypeSymbol
|
|
27208
27487
|
);
|
|
27209
27488
|
|
|
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
27489
|
// FfiConverter for string | undefined
|
|
27221
27490
|
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
27222
27491
|
|
|
@@ -27354,6 +27623,11 @@ const FfiConverterOptionalTypeAssetFilter = new FfiConverterOptional(
|
|
|
27354
27623
|
FfiConverterTypeAssetFilter
|
|
27355
27624
|
);
|
|
27356
27625
|
|
|
27626
|
+
// FfiConverter for ConversionPurpose | undefined
|
|
27627
|
+
const FfiConverterOptionalTypeConversionPurpose = new FfiConverterOptional(
|
|
27628
|
+
FfiConverterTypeConversionPurpose
|
|
27629
|
+
);
|
|
27630
|
+
|
|
27357
27631
|
// FfiConverter for DepositClaimError | undefined
|
|
27358
27632
|
const FfiConverterOptionalTypeDepositClaimError = new FfiConverterOptional(
|
|
27359
27633
|
FfiConverterTypeDepositClaimError
|
|
@@ -27608,11 +27882,11 @@ function uniffiEnsureInitialized() {
|
|
|
27608
27882
|
);
|
|
27609
27883
|
}
|
|
27610
27884
|
if (
|
|
27611
|
-
nativeModule().
|
|
27612
|
-
|
|
27885
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_fetch_conversion_limits() !==
|
|
27886
|
+
50958
|
|
27613
27887
|
) {
|
|
27614
27888
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
27615
|
-
'
|
|
27889
|
+
'uniffi_breez_sdk_spark_checksum_method_breezsdk_fetch_conversion_limits'
|
|
27616
27890
|
);
|
|
27617
27891
|
}
|
|
27618
27892
|
if (
|
|
@@ -28415,6 +28689,12 @@ export default Object.freeze({
|
|
|
28415
28689
|
FfiConverterTypeConfig,
|
|
28416
28690
|
FfiConverterTypeConnectRequest,
|
|
28417
28691
|
FfiConverterTypeConnectWithSignerRequest,
|
|
28692
|
+
FfiConverterTypeConversionEstimate,
|
|
28693
|
+
FfiConverterTypeConversionInfo,
|
|
28694
|
+
FfiConverterTypeConversionOptions,
|
|
28695
|
+
FfiConverterTypeConversionPurpose,
|
|
28696
|
+
FfiConverterTypeConversionStatus,
|
|
28697
|
+
FfiConverterTypeConversionType,
|
|
28418
28698
|
FfiConverterTypeCreateIssuerTokenRequest,
|
|
28419
28699
|
FfiConverterTypeCredentials,
|
|
28420
28700
|
FfiConverterTypeCurrencyInfo,
|
|
@@ -28438,8 +28718,8 @@ export default Object.freeze({
|
|
|
28438
28718
|
FfiConverterTypeExternalTreeNodeId,
|
|
28439
28719
|
FfiConverterTypeExternalVerifiableSecretShare,
|
|
28440
28720
|
FfiConverterTypeFee,
|
|
28441
|
-
|
|
28442
|
-
|
|
28721
|
+
FfiConverterTypeFetchConversionLimitsRequest,
|
|
28722
|
+
FfiConverterTypeFetchConversionLimitsResponse,
|
|
28443
28723
|
FfiConverterTypeFiatCurrency,
|
|
28444
28724
|
FfiConverterTypeFiatService,
|
|
28445
28725
|
FfiConverterTypeFreezeIssuerTokenRequest,
|
|
@@ -28546,9 +28826,6 @@ export default Object.freeze({
|
|
|
28546
28826
|
FfiConverterTypeSyncWalletRequest,
|
|
28547
28827
|
FfiConverterTypeSyncWalletResponse,
|
|
28548
28828
|
FfiConverterTypeTokenBalance,
|
|
28549
|
-
FfiConverterTypeTokenConversionInfo,
|
|
28550
|
-
FfiConverterTypeTokenConversionOptions,
|
|
28551
|
-
FfiConverterTypeTokenConversionType,
|
|
28552
28829
|
FfiConverterTypeTokenIssuer,
|
|
28553
28830
|
FfiConverterTypeTokenMetadata,
|
|
28554
28831
|
FfiConverterTypeTxStatus,
|