@breeztech/breez-sdk-spark-react-native 0.1.9-dev2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cpp/generated/breez_sdk_common.cpp +675 -25
- package/cpp/generated/breez_sdk_common.hpp +27 -0
- package/cpp/generated/breez_sdk_spark.cpp +142 -1
- package/cpp/generated/breez_sdk_spark.hpp +21 -0
- package/lib/commonjs/generated/breez_sdk_common-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_common.js +185 -1
- package/lib/commonjs/generated/breez_sdk_common.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +310 -11
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/generated/breez_sdk_common-ffi.js.map +1 -1
- package/lib/module/generated/breez_sdk_common.js +183 -0
- package/lib/module/generated/breez_sdk_common.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +310 -11
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_common-ffi.d.ts +15 -0
- package/lib/typescript/commonjs/src/generated/breez_sdk_common-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +44 -0
- package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +7 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +225 -9
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_common-ffi.d.ts +15 -0
- package/lib/typescript/module/src/generated/breez_sdk_common-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_common.d.ts +44 -0
- package/lib/typescript/module/src/generated/breez_sdk_common.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +7 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +225 -9
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/breez_sdk_common-ffi.ts +38 -0
- package/src/generated/breez_sdk_common.ts +334 -0
- package/src/generated/breez_sdk_spark-ffi.ts +14 -1
- package/src/generated/breez_sdk_spark.ts +486 -15
|
@@ -37,7 +37,10 @@ import nativeModule, {
|
|
|
37
37
|
import {
|
|
38
38
|
type BitcoinAddressDetails,
|
|
39
39
|
type Bolt11InvoiceDetails,
|
|
40
|
+
type FiatCurrency,
|
|
41
|
+
type FiatService,
|
|
40
42
|
type LnurlPayRequestDetails,
|
|
43
|
+
type Rate,
|
|
41
44
|
type RestClient,
|
|
42
45
|
InputType,
|
|
43
46
|
SuccessAction,
|
|
@@ -54,6 +57,7 @@ import {
|
|
|
54
57
|
type UnsafeMutableRawPointer,
|
|
55
58
|
AbstractFfiConverterByteArray,
|
|
56
59
|
FfiConverterArray,
|
|
60
|
+
FfiConverterArrayBuffer,
|
|
57
61
|
FfiConverterBool,
|
|
58
62
|
FfiConverterCallback,
|
|
59
63
|
FfiConverterInt32,
|
|
@@ -85,8 +89,11 @@ import uniffiBreezSdkCommonModule from './breez_sdk_common';
|
|
|
85
89
|
const {
|
|
86
90
|
FfiConverterTypeBitcoinAddressDetails,
|
|
87
91
|
FfiConverterTypeBolt11InvoiceDetails,
|
|
92
|
+
FfiConverterTypeFiatCurrency,
|
|
93
|
+
FfiConverterTypeFiatService,
|
|
88
94
|
FfiConverterTypeInputType,
|
|
89
95
|
FfiConverterTypeLnurlPayRequestDetails,
|
|
96
|
+
FfiConverterTypeRate,
|
|
90
97
|
FfiConverterTypeRestClient,
|
|
91
98
|
FfiConverterTypeSuccessAction,
|
|
92
99
|
FfiConverterTypeSuccessActionProcessed,
|
|
@@ -581,7 +588,7 @@ const FfiConverterTypeConfig = (() => {
|
|
|
581
588
|
|
|
582
589
|
export type ConnectRequest = {
|
|
583
590
|
config: Config;
|
|
584
|
-
|
|
591
|
+
seed: Seed;
|
|
585
592
|
storageDir: string;
|
|
586
593
|
};
|
|
587
594
|
|
|
@@ -621,19 +628,19 @@ const FfiConverterTypeConnectRequest = (() => {
|
|
|
621
628
|
read(from: RustBuffer): TypeName {
|
|
622
629
|
return {
|
|
623
630
|
config: FfiConverterTypeConfig.read(from),
|
|
624
|
-
|
|
631
|
+
seed: FfiConverterTypeSeed.read(from),
|
|
625
632
|
storageDir: FfiConverterString.read(from),
|
|
626
633
|
};
|
|
627
634
|
}
|
|
628
635
|
write(value: TypeName, into: RustBuffer): void {
|
|
629
636
|
FfiConverterTypeConfig.write(value.config, into);
|
|
630
|
-
|
|
637
|
+
FfiConverterTypeSeed.write(value.seed, into);
|
|
631
638
|
FfiConverterString.write(value.storageDir, into);
|
|
632
639
|
}
|
|
633
640
|
allocationSize(value: TypeName): number {
|
|
634
641
|
return (
|
|
635
642
|
FfiConverterTypeConfig.allocationSize(value.config) +
|
|
636
|
-
|
|
643
|
+
FfiConverterTypeSeed.allocationSize(value.seed) +
|
|
637
644
|
FfiConverterString.allocationSize(value.storageDir)
|
|
638
645
|
);
|
|
639
646
|
}
|
|
@@ -1053,6 +1060,125 @@ const FfiConverterTypeLightningAddressInfo = (() => {
|
|
|
1053
1060
|
return new FFIConverter();
|
|
1054
1061
|
})();
|
|
1055
1062
|
|
|
1063
|
+
/**
|
|
1064
|
+
* Response from listing fiat currencies
|
|
1065
|
+
*/
|
|
1066
|
+
export type ListFiatCurrenciesResponse = {
|
|
1067
|
+
/**
|
|
1068
|
+
* The list of fiat currencies
|
|
1069
|
+
*/
|
|
1070
|
+
currencies: Array<FiatCurrency>;
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Generated factory for {@link ListFiatCurrenciesResponse} record objects.
|
|
1075
|
+
*/
|
|
1076
|
+
export const ListFiatCurrenciesResponse = (() => {
|
|
1077
|
+
const defaults = () => ({});
|
|
1078
|
+
const create = (() => {
|
|
1079
|
+
return uniffiCreateRecord<
|
|
1080
|
+
ListFiatCurrenciesResponse,
|
|
1081
|
+
ReturnType<typeof defaults>
|
|
1082
|
+
>(defaults);
|
|
1083
|
+
})();
|
|
1084
|
+
return Object.freeze({
|
|
1085
|
+
/**
|
|
1086
|
+
* Create a frozen instance of {@link ListFiatCurrenciesResponse}, with defaults specified
|
|
1087
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
1088
|
+
*/
|
|
1089
|
+
create,
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* Create a frozen instance of {@link ListFiatCurrenciesResponse}, with defaults specified
|
|
1093
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
1094
|
+
*/
|
|
1095
|
+
new: create,
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
1099
|
+
*/
|
|
1100
|
+
defaults: () =>
|
|
1101
|
+
Object.freeze(defaults()) as Partial<ListFiatCurrenciesResponse>,
|
|
1102
|
+
});
|
|
1103
|
+
})();
|
|
1104
|
+
|
|
1105
|
+
const FfiConverterTypeListFiatCurrenciesResponse = (() => {
|
|
1106
|
+
type TypeName = ListFiatCurrenciesResponse;
|
|
1107
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1108
|
+
read(from: RustBuffer): TypeName {
|
|
1109
|
+
return {
|
|
1110
|
+
currencies: FfiConverterArrayTypeFiatCurrency.read(from),
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1114
|
+
FfiConverterArrayTypeFiatCurrency.write(value.currencies, into);
|
|
1115
|
+
}
|
|
1116
|
+
allocationSize(value: TypeName): number {
|
|
1117
|
+
return FfiConverterArrayTypeFiatCurrency.allocationSize(value.currencies);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
return new FFIConverter();
|
|
1121
|
+
})();
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* Response from listing fiat rates
|
|
1125
|
+
*/
|
|
1126
|
+
export type ListFiatRatesResponse = {
|
|
1127
|
+
/**
|
|
1128
|
+
* The list of fiat rates
|
|
1129
|
+
*/
|
|
1130
|
+
rates: Array<Rate>;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Generated factory for {@link ListFiatRatesResponse} record objects.
|
|
1135
|
+
*/
|
|
1136
|
+
export const ListFiatRatesResponse = (() => {
|
|
1137
|
+
const defaults = () => ({});
|
|
1138
|
+
const create = (() => {
|
|
1139
|
+
return uniffiCreateRecord<
|
|
1140
|
+
ListFiatRatesResponse,
|
|
1141
|
+
ReturnType<typeof defaults>
|
|
1142
|
+
>(defaults);
|
|
1143
|
+
})();
|
|
1144
|
+
return Object.freeze({
|
|
1145
|
+
/**
|
|
1146
|
+
* Create a frozen instance of {@link ListFiatRatesResponse}, with defaults specified
|
|
1147
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
1148
|
+
*/
|
|
1149
|
+
create,
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* Create a frozen instance of {@link ListFiatRatesResponse}, with defaults specified
|
|
1153
|
+
* in Rust, in the {@link breez_sdk_spark} crate.
|
|
1154
|
+
*/
|
|
1155
|
+
new: create,
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* Defaults specified in the {@link breez_sdk_spark} crate.
|
|
1159
|
+
*/
|
|
1160
|
+
defaults: () => Object.freeze(defaults()) as Partial<ListFiatRatesResponse>,
|
|
1161
|
+
});
|
|
1162
|
+
})();
|
|
1163
|
+
|
|
1164
|
+
const FfiConverterTypeListFiatRatesResponse = (() => {
|
|
1165
|
+
type TypeName = ListFiatRatesResponse;
|
|
1166
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1167
|
+
read(from: RustBuffer): TypeName {
|
|
1168
|
+
return {
|
|
1169
|
+
rates: FfiConverterArrayTypeRate.read(from),
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1173
|
+
FfiConverterArrayTypeRate.write(value.rates, into);
|
|
1174
|
+
}
|
|
1175
|
+
allocationSize(value: TypeName): number {
|
|
1176
|
+
return FfiConverterArrayTypeRate.allocationSize(value.rates);
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
return new FFIConverter();
|
|
1180
|
+
})();
|
|
1181
|
+
|
|
1056
1182
|
/**
|
|
1057
1183
|
* Request to list payments with pagination
|
|
1058
1184
|
*/
|
|
@@ -4984,6 +5110,174 @@ const FfiConverterTypeSdkEvent = (() => {
|
|
|
4984
5110
|
return new FFIConverter();
|
|
4985
5111
|
})();
|
|
4986
5112
|
|
|
5113
|
+
// Enum: Seed
|
|
5114
|
+
export enum Seed_Tags {
|
|
5115
|
+
Mnemonic = 'Mnemonic',
|
|
5116
|
+
Entropy = 'Entropy',
|
|
5117
|
+
}
|
|
5118
|
+
/**
|
|
5119
|
+
* Represents the seed for wallet generation, either as a mnemonic phrase with an optional
|
|
5120
|
+
* passphrase or as raw entropy bytes.
|
|
5121
|
+
*/
|
|
5122
|
+
export const Seed = (() => {
|
|
5123
|
+
type Mnemonic__interface = {
|
|
5124
|
+
tag: Seed_Tags.Mnemonic;
|
|
5125
|
+
inner: Readonly<{ mnemonic: string; passphrase: string | undefined }>;
|
|
5126
|
+
};
|
|
5127
|
+
|
|
5128
|
+
/**
|
|
5129
|
+
* A BIP-39 mnemonic phrase with an optional passphrase.
|
|
5130
|
+
*/
|
|
5131
|
+
class Mnemonic_ extends UniffiEnum implements Mnemonic__interface {
|
|
5132
|
+
/**
|
|
5133
|
+
* @private
|
|
5134
|
+
* This field is private and should not be used, use `tag` instead.
|
|
5135
|
+
*/
|
|
5136
|
+
readonly [uniffiTypeNameSymbol] = 'Seed';
|
|
5137
|
+
readonly tag = Seed_Tags.Mnemonic;
|
|
5138
|
+
readonly inner: Readonly<{
|
|
5139
|
+
mnemonic: string;
|
|
5140
|
+
passphrase: string | undefined;
|
|
5141
|
+
}>;
|
|
5142
|
+
constructor(inner: {
|
|
5143
|
+
/**
|
|
5144
|
+
* The mnemonic phrase. 12 or 24 words.
|
|
5145
|
+
*/ mnemonic: string;
|
|
5146
|
+
/**
|
|
5147
|
+
* An optional passphrase for the mnemonic.
|
|
5148
|
+
*/ passphrase: string | undefined;
|
|
5149
|
+
}) {
|
|
5150
|
+
super('Seed', 'Mnemonic');
|
|
5151
|
+
this.inner = Object.freeze(inner);
|
|
5152
|
+
}
|
|
5153
|
+
|
|
5154
|
+
static new(inner: {
|
|
5155
|
+
/**
|
|
5156
|
+
* The mnemonic phrase. 12 or 24 words.
|
|
5157
|
+
*/ mnemonic: string;
|
|
5158
|
+
/**
|
|
5159
|
+
* An optional passphrase for the mnemonic.
|
|
5160
|
+
*/ passphrase: string | undefined;
|
|
5161
|
+
}): Mnemonic_ {
|
|
5162
|
+
return new Mnemonic_(inner);
|
|
5163
|
+
}
|
|
5164
|
+
|
|
5165
|
+
static instanceOf(obj: any): obj is Mnemonic_ {
|
|
5166
|
+
return obj.tag === Seed_Tags.Mnemonic;
|
|
5167
|
+
}
|
|
5168
|
+
}
|
|
5169
|
+
|
|
5170
|
+
type Entropy__interface = {
|
|
5171
|
+
tag: Seed_Tags.Entropy;
|
|
5172
|
+
inner: Readonly<[ArrayBuffer]>;
|
|
5173
|
+
};
|
|
5174
|
+
|
|
5175
|
+
/**
|
|
5176
|
+
* Raw entropy bytes.
|
|
5177
|
+
*/
|
|
5178
|
+
class Entropy_ extends UniffiEnum implements Entropy__interface {
|
|
5179
|
+
/**
|
|
5180
|
+
* @private
|
|
5181
|
+
* This field is private and should not be used, use `tag` instead.
|
|
5182
|
+
*/
|
|
5183
|
+
readonly [uniffiTypeNameSymbol] = 'Seed';
|
|
5184
|
+
readonly tag = Seed_Tags.Entropy;
|
|
5185
|
+
readonly inner: Readonly<[ArrayBuffer]>;
|
|
5186
|
+
constructor(v0: ArrayBuffer) {
|
|
5187
|
+
super('Seed', 'Entropy');
|
|
5188
|
+
this.inner = Object.freeze([v0]);
|
|
5189
|
+
}
|
|
5190
|
+
|
|
5191
|
+
static new(v0: ArrayBuffer): Entropy_ {
|
|
5192
|
+
return new Entropy_(v0);
|
|
5193
|
+
}
|
|
5194
|
+
|
|
5195
|
+
static instanceOf(obj: any): obj is Entropy_ {
|
|
5196
|
+
return obj.tag === Seed_Tags.Entropy;
|
|
5197
|
+
}
|
|
5198
|
+
}
|
|
5199
|
+
|
|
5200
|
+
function instanceOf(obj: any): obj is Seed {
|
|
5201
|
+
return obj[uniffiTypeNameSymbol] === 'Seed';
|
|
5202
|
+
}
|
|
5203
|
+
|
|
5204
|
+
return Object.freeze({
|
|
5205
|
+
instanceOf,
|
|
5206
|
+
Mnemonic: Mnemonic_,
|
|
5207
|
+
Entropy: Entropy_,
|
|
5208
|
+
});
|
|
5209
|
+
})();
|
|
5210
|
+
|
|
5211
|
+
/**
|
|
5212
|
+
* Represents the seed for wallet generation, either as a mnemonic phrase with an optional
|
|
5213
|
+
* passphrase or as raw entropy bytes.
|
|
5214
|
+
*/
|
|
5215
|
+
|
|
5216
|
+
export type Seed = InstanceType<
|
|
5217
|
+
(typeof Seed)[keyof Omit<typeof Seed, 'instanceOf'>]
|
|
5218
|
+
>;
|
|
5219
|
+
|
|
5220
|
+
// FfiConverter for enum Seed
|
|
5221
|
+
const FfiConverterTypeSeed = (() => {
|
|
5222
|
+
const ordinalConverter = FfiConverterInt32;
|
|
5223
|
+
type TypeName = Seed;
|
|
5224
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
5225
|
+
read(from: RustBuffer): TypeName {
|
|
5226
|
+
switch (ordinalConverter.read(from)) {
|
|
5227
|
+
case 1:
|
|
5228
|
+
return new Seed.Mnemonic({
|
|
5229
|
+
mnemonic: FfiConverterString.read(from),
|
|
5230
|
+
passphrase: FfiConverterOptionalString.read(from),
|
|
5231
|
+
});
|
|
5232
|
+
case 2:
|
|
5233
|
+
return new Seed.Entropy(FfiConverterArrayBuffer.read(from));
|
|
5234
|
+
default:
|
|
5235
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
5236
|
+
}
|
|
5237
|
+
}
|
|
5238
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
5239
|
+
switch (value.tag) {
|
|
5240
|
+
case Seed_Tags.Mnemonic: {
|
|
5241
|
+
ordinalConverter.write(1, into);
|
|
5242
|
+
const inner = value.inner;
|
|
5243
|
+
FfiConverterString.write(inner.mnemonic, into);
|
|
5244
|
+
FfiConverterOptionalString.write(inner.passphrase, into);
|
|
5245
|
+
return;
|
|
5246
|
+
}
|
|
5247
|
+
case Seed_Tags.Entropy: {
|
|
5248
|
+
ordinalConverter.write(2, into);
|
|
5249
|
+
const inner = value.inner;
|
|
5250
|
+
FfiConverterArrayBuffer.write(inner[0], into);
|
|
5251
|
+
return;
|
|
5252
|
+
}
|
|
5253
|
+
default:
|
|
5254
|
+
// Throwing from here means that Seed_Tags hasn't matched an ordinal.
|
|
5255
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
5256
|
+
}
|
|
5257
|
+
}
|
|
5258
|
+
allocationSize(value: TypeName): number {
|
|
5259
|
+
switch (value.tag) {
|
|
5260
|
+
case Seed_Tags.Mnemonic: {
|
|
5261
|
+
const inner = value.inner;
|
|
5262
|
+
let size = ordinalConverter.allocationSize(1);
|
|
5263
|
+
size += FfiConverterString.allocationSize(inner.mnemonic);
|
|
5264
|
+
size += FfiConverterOptionalString.allocationSize(inner.passphrase);
|
|
5265
|
+
return size;
|
|
5266
|
+
}
|
|
5267
|
+
case Seed_Tags.Entropy: {
|
|
5268
|
+
const inner = value.inner;
|
|
5269
|
+
let size = ordinalConverter.allocationSize(2);
|
|
5270
|
+
size += FfiConverterArrayBuffer.allocationSize(inner[0]);
|
|
5271
|
+
return size;
|
|
5272
|
+
}
|
|
5273
|
+
default:
|
|
5274
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
5275
|
+
}
|
|
5276
|
+
}
|
|
5277
|
+
}
|
|
5278
|
+
return new FFIConverter();
|
|
5279
|
+
})();
|
|
5280
|
+
|
|
4987
5281
|
// Enum: SendPaymentMethod
|
|
4988
5282
|
export enum SendPaymentMethod_Tags {
|
|
4989
5283
|
BitcoinAddress = 'BitcoinAddress',
|
|
@@ -5261,7 +5555,7 @@ export const SendPaymentOptions = (() => {
|
|
|
5261
5555
|
|
|
5262
5556
|
type Bolt11Invoice__interface = {
|
|
5263
5557
|
tag: SendPaymentOptions_Tags.Bolt11Invoice;
|
|
5264
|
-
inner: Readonly<{
|
|
5558
|
+
inner: Readonly<{ preferSpark: boolean }>;
|
|
5265
5559
|
};
|
|
5266
5560
|
|
|
5267
5561
|
class Bolt11Invoice_ extends UniffiEnum implements Bolt11Invoice__interface {
|
|
@@ -5271,13 +5565,13 @@ export const SendPaymentOptions = (() => {
|
|
|
5271
5565
|
*/
|
|
5272
5566
|
readonly [uniffiTypeNameSymbol] = 'SendPaymentOptions';
|
|
5273
5567
|
readonly tag = SendPaymentOptions_Tags.Bolt11Invoice;
|
|
5274
|
-
readonly inner: Readonly<{
|
|
5275
|
-
constructor(inner: {
|
|
5568
|
+
readonly inner: Readonly<{ preferSpark: boolean }>;
|
|
5569
|
+
constructor(inner: { preferSpark: boolean }) {
|
|
5276
5570
|
super('SendPaymentOptions', 'Bolt11Invoice');
|
|
5277
5571
|
this.inner = Object.freeze(inner);
|
|
5278
5572
|
}
|
|
5279
5573
|
|
|
5280
|
-
static new(inner: {
|
|
5574
|
+
static new(inner: { preferSpark: boolean }): Bolt11Invoice_ {
|
|
5281
5575
|
return new Bolt11Invoice_(inner);
|
|
5282
5576
|
}
|
|
5283
5577
|
|
|
@@ -5318,7 +5612,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
|
|
|
5318
5612
|
});
|
|
5319
5613
|
case 2:
|
|
5320
5614
|
return new SendPaymentOptions.Bolt11Invoice({
|
|
5321
|
-
|
|
5615
|
+
preferSpark: FfiConverterBool.read(from),
|
|
5322
5616
|
});
|
|
5323
5617
|
default:
|
|
5324
5618
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
@@ -5338,7 +5632,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
|
|
|
5338
5632
|
case SendPaymentOptions_Tags.Bolt11Invoice: {
|
|
5339
5633
|
ordinalConverter.write(2, into);
|
|
5340
5634
|
const inner = value.inner;
|
|
5341
|
-
FfiConverterBool.write(inner.
|
|
5635
|
+
FfiConverterBool.write(inner.preferSpark, into);
|
|
5342
5636
|
return;
|
|
5343
5637
|
}
|
|
5344
5638
|
default:
|
|
@@ -5359,7 +5653,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
|
|
|
5359
5653
|
case SendPaymentOptions_Tags.Bolt11Invoice: {
|
|
5360
5654
|
const inner = value.inner;
|
|
5361
5655
|
let size = ordinalConverter.allocationSize(2);
|
|
5362
|
-
size += FfiConverterBool.allocationSize(inner.
|
|
5656
|
+
size += FfiConverterBool.allocationSize(inner.preferSpark);
|
|
5363
5657
|
return size;
|
|
5364
5658
|
}
|
|
5365
5659
|
default:
|
|
@@ -6168,6 +6462,19 @@ export interface BreezSdkInterface {
|
|
|
6168
6462
|
request: GetPaymentRequest,
|
|
6169
6463
|
asyncOpts_?: { signal: AbortSignal }
|
|
6170
6464
|
) /*throws*/ : Promise<GetPaymentResponse>;
|
|
6465
|
+
/**
|
|
6466
|
+
* List fiat currencies for which there is a known exchange rate,
|
|
6467
|
+
* sorted by the canonical name of the currency.
|
|
6468
|
+
*/
|
|
6469
|
+
listFiatCurrencies(asyncOpts_?: {
|
|
6470
|
+
signal: AbortSignal;
|
|
6471
|
+
}) /*throws*/ : Promise<ListFiatCurrenciesResponse>;
|
|
6472
|
+
/**
|
|
6473
|
+
* List the latest rates of fiat currencies, sorted by name.
|
|
6474
|
+
*/
|
|
6475
|
+
listFiatRates(asyncOpts_?: {
|
|
6476
|
+
signal: AbortSignal;
|
|
6477
|
+
}) /*throws*/ : Promise<ListFiatRatesResponse>;
|
|
6171
6478
|
/**
|
|
6172
6479
|
* Lists payments from the storage with pagination
|
|
6173
6480
|
*
|
|
@@ -6549,6 +6856,87 @@ export class BreezSdk
|
|
|
6549
6856
|
}
|
|
6550
6857
|
}
|
|
6551
6858
|
|
|
6859
|
+
/**
|
|
6860
|
+
* List fiat currencies for which there is a known exchange rate,
|
|
6861
|
+
* sorted by the canonical name of the currency.
|
|
6862
|
+
*/
|
|
6863
|
+
public async listFiatCurrencies(asyncOpts_?: {
|
|
6864
|
+
signal: AbortSignal;
|
|
6865
|
+
}): Promise<ListFiatCurrenciesResponse> /*throws*/ {
|
|
6866
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6867
|
+
try {
|
|
6868
|
+
return await uniffiRustCallAsync(
|
|
6869
|
+
/*rustCaller:*/ uniffiCaller,
|
|
6870
|
+
/*rustFutureFunc:*/ () => {
|
|
6871
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_currencies(
|
|
6872
|
+
uniffiTypeBreezSdkObjectFactory.clonePointer(this)
|
|
6873
|
+
);
|
|
6874
|
+
},
|
|
6875
|
+
/*pollFunc:*/ nativeModule()
|
|
6876
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
6877
|
+
/*cancelFunc:*/ nativeModule()
|
|
6878
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
|
|
6879
|
+
/*completeFunc:*/ nativeModule()
|
|
6880
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
6881
|
+
/*freeFunc:*/ nativeModule()
|
|
6882
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
6883
|
+
/*liftFunc:*/ FfiConverterTypeListFiatCurrenciesResponse.lift.bind(
|
|
6884
|
+
FfiConverterTypeListFiatCurrenciesResponse
|
|
6885
|
+
),
|
|
6886
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
6887
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
6888
|
+
/*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
|
|
6889
|
+
FfiConverterTypeSdkError
|
|
6890
|
+
)
|
|
6891
|
+
);
|
|
6892
|
+
} catch (__error: any) {
|
|
6893
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6894
|
+
__error.stack = __stack;
|
|
6895
|
+
}
|
|
6896
|
+
throw __error;
|
|
6897
|
+
}
|
|
6898
|
+
}
|
|
6899
|
+
|
|
6900
|
+
/**
|
|
6901
|
+
* List the latest rates of fiat currencies, sorted by name.
|
|
6902
|
+
*/
|
|
6903
|
+
public async listFiatRates(asyncOpts_?: {
|
|
6904
|
+
signal: AbortSignal;
|
|
6905
|
+
}): Promise<ListFiatRatesResponse> /*throws*/ {
|
|
6906
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6907
|
+
try {
|
|
6908
|
+
return await uniffiRustCallAsync(
|
|
6909
|
+
/*rustCaller:*/ uniffiCaller,
|
|
6910
|
+
/*rustFutureFunc:*/ () => {
|
|
6911
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_rates(
|
|
6912
|
+
uniffiTypeBreezSdkObjectFactory.clonePointer(this)
|
|
6913
|
+
);
|
|
6914
|
+
},
|
|
6915
|
+
/*pollFunc:*/ nativeModule()
|
|
6916
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
6917
|
+
/*cancelFunc:*/ nativeModule()
|
|
6918
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
|
|
6919
|
+
/*completeFunc:*/ nativeModule()
|
|
6920
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
6921
|
+
/*freeFunc:*/ nativeModule()
|
|
6922
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
6923
|
+
/*liftFunc:*/ FfiConverterTypeListFiatRatesResponse.lift.bind(
|
|
6924
|
+
FfiConverterTypeListFiatRatesResponse
|
|
6925
|
+
),
|
|
6926
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
6927
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
6928
|
+
/*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
|
|
6929
|
+
FfiConverterTypeSdkError
|
|
6930
|
+
)
|
|
6931
|
+
);
|
|
6932
|
+
} catch (__error: any) {
|
|
6933
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6934
|
+
__error.stack = __stack;
|
|
6935
|
+
}
|
|
6936
|
+
throw __error;
|
|
6937
|
+
}
|
|
6938
|
+
}
|
|
6939
|
+
|
|
6552
6940
|
/**
|
|
6553
6941
|
* Lists payments from the storage with pagination
|
|
6554
6942
|
*
|
|
@@ -7161,6 +7549,15 @@ export interface SdkBuilderInterface {
|
|
|
7161
7549
|
chainService: BitcoinChainService,
|
|
7162
7550
|
asyncOpts_?: { signal: AbortSignal }
|
|
7163
7551
|
): Promise<void>;
|
|
7552
|
+
/**
|
|
7553
|
+
* Sets the fiat service to be used by the SDK.
|
|
7554
|
+
* Arguments:
|
|
7555
|
+
* - `fiat_service`: The fiat service to be used.
|
|
7556
|
+
*/
|
|
7557
|
+
withFiatService(
|
|
7558
|
+
fiatService: FiatService,
|
|
7559
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
7560
|
+
): Promise<void>;
|
|
7164
7561
|
/**
|
|
7165
7562
|
* Sets the key set type to be used by the SDK.
|
|
7166
7563
|
* Arguments:
|
|
@@ -7203,16 +7600,16 @@ export class SdkBuilder
|
|
|
7203
7600
|
* Creates a new `SdkBuilder` with the provided configuration.
|
|
7204
7601
|
* Arguments:
|
|
7205
7602
|
* - `config`: The configuration to be used.
|
|
7206
|
-
* - `
|
|
7603
|
+
* - `seed`: The seed for wallet generation.
|
|
7207
7604
|
* - `storage`: The storage backend to be used.
|
|
7208
7605
|
*/
|
|
7209
|
-
constructor(config: Config,
|
|
7606
|
+
constructor(config: Config, seed: Seed, storage: Storage) {
|
|
7210
7607
|
super();
|
|
7211
7608
|
const pointer = uniffiCaller.rustCall(
|
|
7212
7609
|
/*caller:*/ (callStatus) => {
|
|
7213
7610
|
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new(
|
|
7214
7611
|
FfiConverterTypeConfig.lower(config),
|
|
7215
|
-
|
|
7612
|
+
FfiConverterTypeSeed.lower(seed),
|
|
7216
7613
|
FfiConverterTypeStorage.lower(storage),
|
|
7217
7614
|
callStatus
|
|
7218
7615
|
);
|
|
@@ -7303,6 +7700,45 @@ export class SdkBuilder
|
|
|
7303
7700
|
}
|
|
7304
7701
|
}
|
|
7305
7702
|
|
|
7703
|
+
/**
|
|
7704
|
+
* Sets the fiat service to be used by the SDK.
|
|
7705
|
+
* Arguments:
|
|
7706
|
+
* - `fiat_service`: The fiat service to be used.
|
|
7707
|
+
*/
|
|
7708
|
+
public async withFiatService(
|
|
7709
|
+
fiatService: FiatService,
|
|
7710
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
7711
|
+
): Promise<void> {
|
|
7712
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
7713
|
+
try {
|
|
7714
|
+
return await uniffiRustCallAsync(
|
|
7715
|
+
/*rustCaller:*/ uniffiCaller,
|
|
7716
|
+
/*rustFutureFunc:*/ () => {
|
|
7717
|
+
return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service(
|
|
7718
|
+
uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
|
|
7719
|
+
FfiConverterTypeFiatService.lower(fiatService)
|
|
7720
|
+
);
|
|
7721
|
+
},
|
|
7722
|
+
/*pollFunc:*/ nativeModule()
|
|
7723
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
|
|
7724
|
+
/*cancelFunc:*/ nativeModule()
|
|
7725
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
|
|
7726
|
+
/*completeFunc:*/ nativeModule()
|
|
7727
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
|
|
7728
|
+
/*freeFunc:*/ nativeModule()
|
|
7729
|
+
.ubrn_ffi_breez_sdk_spark_rust_future_free_void,
|
|
7730
|
+
/*liftFunc:*/ (_v) => {},
|
|
7731
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
7732
|
+
/*asyncOpts:*/ asyncOpts_
|
|
7733
|
+
);
|
|
7734
|
+
} catch (__error: any) {
|
|
7735
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
7736
|
+
__error.stack = __stack;
|
|
7737
|
+
}
|
|
7738
|
+
throw __error;
|
|
7739
|
+
}
|
|
7740
|
+
}
|
|
7741
|
+
|
|
7306
7742
|
/**
|
|
7307
7743
|
* Sets the key set type to be used by the SDK.
|
|
7308
7744
|
* Arguments:
|
|
@@ -8810,6 +9246,14 @@ const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
|
|
|
8810
9246
|
// FfiConverter for /*u64*/bigint | undefined
|
|
8811
9247
|
const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
8812
9248
|
|
|
9249
|
+
// FfiConverter for Array<FiatCurrency>
|
|
9250
|
+
const FfiConverterArrayTypeFiatCurrency = new FfiConverterArray(
|
|
9251
|
+
FfiConverterTypeFiatCurrency
|
|
9252
|
+
);
|
|
9253
|
+
|
|
9254
|
+
// FfiConverter for Array<Rate>
|
|
9255
|
+
const FfiConverterArrayTypeRate = new FfiConverterArray(FfiConverterTypeRate);
|
|
9256
|
+
|
|
8813
9257
|
// FfiConverter for Array<DepositInfo>
|
|
8814
9258
|
const FfiConverterArrayTypeDepositInfo = new FfiConverterArray(
|
|
8815
9259
|
FfiConverterTypeDepositInfo
|
|
@@ -8991,6 +9435,22 @@ function uniffiEnsureInitialized() {
|
|
|
8991
9435
|
'uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment'
|
|
8992
9436
|
);
|
|
8993
9437
|
}
|
|
9438
|
+
if (
|
|
9439
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() !==
|
|
9440
|
+
63366
|
|
9441
|
+
) {
|
|
9442
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
9443
|
+
'uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies'
|
|
9444
|
+
);
|
|
9445
|
+
}
|
|
9446
|
+
if (
|
|
9447
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates() !==
|
|
9448
|
+
5904
|
|
9449
|
+
) {
|
|
9450
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
9451
|
+
'uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates'
|
|
9452
|
+
);
|
|
9453
|
+
}
|
|
8994
9454
|
if (
|
|
8995
9455
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments() !==
|
|
8996
9456
|
16156
|
|
@@ -9119,6 +9579,14 @@ function uniffiEnsureInitialized() {
|
|
|
9119
9579
|
'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service'
|
|
9120
9580
|
);
|
|
9121
9581
|
}
|
|
9582
|
+
if (
|
|
9583
|
+
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service() !==
|
|
9584
|
+
41113
|
|
9585
|
+
) {
|
|
9586
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
9587
|
+
'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service'
|
|
9588
|
+
);
|
|
9589
|
+
}
|
|
9122
9590
|
if (
|
|
9123
9591
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() !==
|
|
9124
9592
|
55523
|
|
@@ -9233,7 +9701,7 @@ function uniffiEnsureInitialized() {
|
|
|
9233
9701
|
}
|
|
9234
9702
|
if (
|
|
9235
9703
|
nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() !==
|
|
9236
|
-
|
|
9704
|
+
53882
|
|
9237
9705
|
) {
|
|
9238
9706
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
9239
9707
|
'uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new'
|
|
@@ -9282,6 +9750,8 @@ export default Object.freeze({
|
|
|
9282
9750
|
FfiConverterTypeGetPaymentResponse,
|
|
9283
9751
|
FfiConverterTypeKeySetType,
|
|
9284
9752
|
FfiConverterTypeLightningAddressInfo,
|
|
9753
|
+
FfiConverterTypeListFiatCurrenciesResponse,
|
|
9754
|
+
FfiConverterTypeListFiatRatesResponse,
|
|
9285
9755
|
FfiConverterTypeListPaymentsRequest,
|
|
9286
9756
|
FfiConverterTypeListPaymentsResponse,
|
|
9287
9757
|
FfiConverterTypeListUnclaimedDepositsRequest,
|
|
@@ -9310,6 +9780,7 @@ export default Object.freeze({
|
|
|
9310
9780
|
FfiConverterTypeRegisterLightningAddressRequest,
|
|
9311
9781
|
FfiConverterTypeSdkBuilder,
|
|
9312
9782
|
FfiConverterTypeSdkEvent,
|
|
9783
|
+
FfiConverterTypeSeed,
|
|
9313
9784
|
FfiConverterTypeSendOnchainFeeQuote,
|
|
9314
9785
|
FfiConverterTypeSendOnchainSpeedFeeQuote,
|
|
9315
9786
|
FfiConverterTypeSendPaymentMethod,
|