@breeztech/breez-sdk-spark-react-native 0.7.7 → 0.7.9

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.
@@ -2854,9 +2854,9 @@ const FfiConverterTypeExternalAggregateFrostRequest = (() => {
2854
2854
  })();
2855
2855
 
2856
2856
  /**
2857
- * FFI-safe representation of `spark_wallet::EncryptedPrivateKey`
2857
+ * FFI-safe representation of `spark_wallet::EncryptedSecret`
2858
2858
  */
2859
- export type ExternalEncryptedPrivateKey = {
2859
+ export type ExternalEncryptedSecret = {
2860
2860
  /**
2861
2861
  * The encrypted ciphertext
2862
2862
  */
@@ -2864,25 +2864,25 @@ export type ExternalEncryptedPrivateKey = {
2864
2864
  };
2865
2865
 
2866
2866
  /**
2867
- * Generated factory for {@link ExternalEncryptedPrivateKey} record objects.
2867
+ * Generated factory for {@link ExternalEncryptedSecret} record objects.
2868
2868
  */
2869
- export const ExternalEncryptedPrivateKey = (() => {
2869
+ export const ExternalEncryptedSecret = (() => {
2870
2870
  const defaults = () => ({});
2871
2871
  const create = (() => {
2872
2872
  return uniffiCreateRecord<
2873
- ExternalEncryptedPrivateKey,
2873
+ ExternalEncryptedSecret,
2874
2874
  ReturnType<typeof defaults>
2875
2875
  >(defaults);
2876
2876
  })();
2877
2877
  return Object.freeze({
2878
2878
  /**
2879
- * Create a frozen instance of {@link ExternalEncryptedPrivateKey}, with defaults specified
2879
+ * Create a frozen instance of {@link ExternalEncryptedSecret}, with defaults specified
2880
2880
  * in Rust, in the {@link breez_sdk_spark} crate.
2881
2881
  */
2882
2882
  create,
2883
2883
 
2884
2884
  /**
2885
- * Create a frozen instance of {@link ExternalEncryptedPrivateKey}, with defaults specified
2885
+ * Create a frozen instance of {@link ExternalEncryptedSecret}, with defaults specified
2886
2886
  * in Rust, in the {@link breez_sdk_spark} crate.
2887
2887
  */
2888
2888
  new: create,
@@ -2891,12 +2891,12 @@ export const ExternalEncryptedPrivateKey = (() => {
2891
2891
  * Defaults specified in the {@link breez_sdk_spark} crate.
2892
2892
  */
2893
2893
  defaults: () =>
2894
- Object.freeze(defaults()) as Partial<ExternalEncryptedPrivateKey>,
2894
+ Object.freeze(defaults()) as Partial<ExternalEncryptedSecret>,
2895
2895
  });
2896
2896
  })();
2897
2897
 
2898
- const FfiConverterTypeExternalEncryptedPrivateKey = (() => {
2899
- type TypeName = ExternalEncryptedPrivateKey;
2898
+ const FfiConverterTypeExternalEncryptedSecret = (() => {
2899
+ type TypeName = ExternalEncryptedSecret;
2900
2900
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
2901
2901
  read(from: RustBuffer): TypeName {
2902
2902
  return {
@@ -3389,7 +3389,7 @@ export type ExternalSignFrostRequest = {
3389
3389
  /**
3390
3390
  * The private key source
3391
3391
  */
3392
- privateKey: ExternalSecretKeySource;
3392
+ secret: ExternalSecretSource;
3393
3393
  /**
3394
3394
  * The verifying key (33 bytes compressed)
3395
3395
  */
@@ -3447,7 +3447,7 @@ const FfiConverterTypeExternalSignFrostRequest = (() => {
3447
3447
  return {
3448
3448
  message: FfiConverterArrayBuffer.read(from),
3449
3449
  publicKey: FfiConverterArrayBuffer.read(from),
3450
- privateKey: FfiConverterTypeExternalSecretKeySource.read(from),
3450
+ secret: FfiConverterTypeExternalSecretSource.read(from),
3451
3451
  verifyingKey: FfiConverterArrayBuffer.read(from),
3452
3452
  selfNonceCommitment:
3453
3453
  FfiConverterTypeExternalFrostCommitments.read(from),
@@ -3459,7 +3459,7 @@ const FfiConverterTypeExternalSignFrostRequest = (() => {
3459
3459
  write(value: TypeName, into: RustBuffer): void {
3460
3460
  FfiConverterArrayBuffer.write(value.message, into);
3461
3461
  FfiConverterArrayBuffer.write(value.publicKey, into);
3462
- FfiConverterTypeExternalSecretKeySource.write(value.privateKey, into);
3462
+ FfiConverterTypeExternalSecretSource.write(value.secret, into);
3463
3463
  FfiConverterArrayBuffer.write(value.verifyingKey, into);
3464
3464
  FfiConverterTypeExternalFrostCommitments.write(
3465
3465
  value.selfNonceCommitment,
@@ -3475,9 +3475,7 @@ const FfiConverterTypeExternalSignFrostRequest = (() => {
3475
3475
  return (
3476
3476
  FfiConverterArrayBuffer.allocationSize(value.message) +
3477
3477
  FfiConverterArrayBuffer.allocationSize(value.publicKey) +
3478
- FfiConverterTypeExternalSecretKeySource.allocationSize(
3479
- value.privateKey
3480
- ) +
3478
+ FfiConverterTypeExternalSecretSource.allocationSize(value.secret) +
3481
3479
  FfiConverterArrayBuffer.allocationSize(value.verifyingKey) +
3482
3480
  FfiConverterTypeExternalFrostCommitments.allocationSize(
3483
3481
  value.selfNonceCommitment
@@ -7189,61 +7187,6 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
7189
7187
  return new FFIConverter();
7190
7188
  })();
7191
7189
 
7192
- /**
7193
- * FFI-safe representation of a private key (32 bytes)
7194
- */
7195
- export type PrivateKeyBytes = {
7196
- bytes: ArrayBuffer;
7197
- };
7198
-
7199
- /**
7200
- * Generated factory for {@link PrivateKeyBytes} record objects.
7201
- */
7202
- export const PrivateKeyBytes = (() => {
7203
- const defaults = () => ({});
7204
- const create = (() => {
7205
- return uniffiCreateRecord<PrivateKeyBytes, ReturnType<typeof defaults>>(
7206
- defaults
7207
- );
7208
- })();
7209
- return Object.freeze({
7210
- /**
7211
- * Create a frozen instance of {@link PrivateKeyBytes}, with defaults specified
7212
- * in Rust, in the {@link breez_sdk_spark} crate.
7213
- */
7214
- create,
7215
-
7216
- /**
7217
- * Create a frozen instance of {@link PrivateKeyBytes}, with defaults specified
7218
- * in Rust, in the {@link breez_sdk_spark} crate.
7219
- */
7220
- new: create,
7221
-
7222
- /**
7223
- * Defaults specified in the {@link breez_sdk_spark} crate.
7224
- */
7225
- defaults: () => Object.freeze(defaults()) as Partial<PrivateKeyBytes>,
7226
- });
7227
- })();
7228
-
7229
- const FfiConverterTypePrivateKeyBytes = (() => {
7230
- type TypeName = PrivateKeyBytes;
7231
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
7232
- read(from: RustBuffer): TypeName {
7233
- return {
7234
- bytes: FfiConverterArrayBuffer.read(from),
7235
- };
7236
- }
7237
- write(value: TypeName, into: RustBuffer): void {
7238
- FfiConverterArrayBuffer.write(value.bytes, into);
7239
- }
7240
- allocationSize(value: TypeName): number {
7241
- return FfiConverterArrayBuffer.allocationSize(value.bytes);
7242
- }
7243
- }
7244
- return new FFIConverter();
7245
- })();
7246
-
7247
7190
  export type ProvisionalPayment = {
7248
7191
  /**
7249
7192
  * Unique identifier for the payment
@@ -8161,6 +8104,61 @@ const FfiConverterTypeSchnorrSignatureBytes = (() => {
8161
8104
  return new FFIConverter();
8162
8105
  })();
8163
8106
 
8107
+ /**
8108
+ * FFI-safe representation of a private key (32 bytes)
8109
+ */
8110
+ export type SecretBytes = {
8111
+ bytes: ArrayBuffer;
8112
+ };
8113
+
8114
+ /**
8115
+ * Generated factory for {@link SecretBytes} record objects.
8116
+ */
8117
+ export const SecretBytes = (() => {
8118
+ const defaults = () => ({});
8119
+ const create = (() => {
8120
+ return uniffiCreateRecord<SecretBytes, ReturnType<typeof defaults>>(
8121
+ defaults
8122
+ );
8123
+ })();
8124
+ return Object.freeze({
8125
+ /**
8126
+ * Create a frozen instance of {@link SecretBytes}, with defaults specified
8127
+ * in Rust, in the {@link breez_sdk_spark} crate.
8128
+ */
8129
+ create,
8130
+
8131
+ /**
8132
+ * Create a frozen instance of {@link SecretBytes}, with defaults specified
8133
+ * in Rust, in the {@link breez_sdk_spark} crate.
8134
+ */
8135
+ new: create,
8136
+
8137
+ /**
8138
+ * Defaults specified in the {@link breez_sdk_spark} crate.
8139
+ */
8140
+ defaults: () => Object.freeze(defaults()) as Partial<SecretBytes>,
8141
+ });
8142
+ })();
8143
+
8144
+ const FfiConverterTypeSecretBytes = (() => {
8145
+ type TypeName = SecretBytes;
8146
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
8147
+ read(from: RustBuffer): TypeName {
8148
+ return {
8149
+ bytes: FfiConverterArrayBuffer.read(from),
8150
+ };
8151
+ }
8152
+ write(value: TypeName, into: RustBuffer): void {
8153
+ FfiConverterArrayBuffer.write(value.bytes, into);
8154
+ }
8155
+ allocationSize(value: TypeName): number {
8156
+ return FfiConverterArrayBuffer.allocationSize(value.bytes);
8157
+ }
8158
+ }
8159
+ return new FFIConverter();
8160
+ })();
8161
+
8164
8162
  export type SendOnchainFeeQuote = {
8165
8163
  id: string;
8166
8164
  expiresAt: /*u64*/ bigint;
@@ -11213,17 +11211,17 @@ const FfiConverterTypeDepositClaimError = (() => {
11213
11211
  return new FFIConverter();
11214
11212
  })();
11215
11213
 
11216
- // Enum: ExternalSecretKeySource
11217
- export enum ExternalSecretKeySource_Tags {
11214
+ // Enum: ExternalSecretSource
11215
+ export enum ExternalSecretSource_Tags {
11218
11216
  Derived = 'Derived',
11219
11217
  Encrypted = 'Encrypted',
11220
11218
  }
11221
11219
  /**
11222
- * FFI-safe representation of `spark_wallet::SecretKeySource`
11220
+ * FFI-safe representation of `spark_wallet::SecretSource`
11223
11221
  */
11224
- export const ExternalSecretKeySource = (() => {
11222
+ export const ExternalSecretSource = (() => {
11225
11223
  type Derived__interface = {
11226
- tag: ExternalSecretKeySource_Tags.Derived;
11224
+ tag: ExternalSecretSource_Tags.Derived;
11227
11225
  inner: Readonly<{ nodeId: ExternalTreeNodeId }>;
11228
11226
  };
11229
11227
 
@@ -11235,11 +11233,11 @@ export const ExternalSecretKeySource = (() => {
11235
11233
  * @private
11236
11234
  * This field is private and should not be used, use `tag` instead.
11237
11235
  */
11238
- readonly [uniffiTypeNameSymbol] = 'ExternalSecretKeySource';
11239
- readonly tag = ExternalSecretKeySource_Tags.Derived;
11236
+ readonly [uniffiTypeNameSymbol] = 'ExternalSecretSource';
11237
+ readonly tag = ExternalSecretSource_Tags.Derived;
11240
11238
  readonly inner: Readonly<{ nodeId: ExternalTreeNodeId }>;
11241
11239
  constructor(inner: { nodeId: ExternalTreeNodeId }) {
11242
- super('ExternalSecretKeySource', 'Derived');
11240
+ super('ExternalSecretSource', 'Derived');
11243
11241
  this.inner = Object.freeze(inner);
11244
11242
  }
11245
11243
 
@@ -11248,13 +11246,13 @@ export const ExternalSecretKeySource = (() => {
11248
11246
  }
11249
11247
 
11250
11248
  static instanceOf(obj: any): obj is Derived_ {
11251
- return obj.tag === ExternalSecretKeySource_Tags.Derived;
11249
+ return obj.tag === ExternalSecretSource_Tags.Derived;
11252
11250
  }
11253
11251
  }
11254
11252
 
11255
11253
  type Encrypted__interface = {
11256
- tag: ExternalSecretKeySource_Tags.Encrypted;
11257
- inner: Readonly<{ key: ExternalEncryptedPrivateKey }>;
11254
+ tag: ExternalSecretSource_Tags.Encrypted;
11255
+ inner: Readonly<{ key: ExternalEncryptedSecret }>;
11258
11256
  };
11259
11257
 
11260
11258
  /**
@@ -11265,25 +11263,25 @@ export const ExternalSecretKeySource = (() => {
11265
11263
  * @private
11266
11264
  * This field is private and should not be used, use `tag` instead.
11267
11265
  */
11268
- readonly [uniffiTypeNameSymbol] = 'ExternalSecretKeySource';
11269
- readonly tag = ExternalSecretKeySource_Tags.Encrypted;
11270
- readonly inner: Readonly<{ key: ExternalEncryptedPrivateKey }>;
11271
- constructor(inner: { key: ExternalEncryptedPrivateKey }) {
11272
- super('ExternalSecretKeySource', 'Encrypted');
11266
+ readonly [uniffiTypeNameSymbol] = 'ExternalSecretSource';
11267
+ readonly tag = ExternalSecretSource_Tags.Encrypted;
11268
+ readonly inner: Readonly<{ key: ExternalEncryptedSecret }>;
11269
+ constructor(inner: { key: ExternalEncryptedSecret }) {
11270
+ super('ExternalSecretSource', 'Encrypted');
11273
11271
  this.inner = Object.freeze(inner);
11274
11272
  }
11275
11273
 
11276
- static new(inner: { key: ExternalEncryptedPrivateKey }): Encrypted_ {
11274
+ static new(inner: { key: ExternalEncryptedSecret }): Encrypted_ {
11277
11275
  return new Encrypted_(inner);
11278
11276
  }
11279
11277
 
11280
11278
  static instanceOf(obj: any): obj is Encrypted_ {
11281
- return obj.tag === ExternalSecretKeySource_Tags.Encrypted;
11279
+ return obj.tag === ExternalSecretSource_Tags.Encrypted;
11282
11280
  }
11283
11281
  }
11284
11282
 
11285
- function instanceOf(obj: any): obj is ExternalSecretKeySource {
11286
- return obj[uniffiTypeNameSymbol] === 'ExternalSecretKeySource';
11283
+ function instanceOf(obj: any): obj is ExternalSecretSource {
11284
+ return obj[uniffiTypeNameSymbol] === 'ExternalSecretSource';
11287
11285
  }
11288
11286
 
11289
11287
  return Object.freeze({
@@ -11294,30 +11292,30 @@ export const ExternalSecretKeySource = (() => {
11294
11292
  })();
11295
11293
 
11296
11294
  /**
11297
- * FFI-safe representation of `spark_wallet::SecretKeySource`
11295
+ * FFI-safe representation of `spark_wallet::SecretSource`
11298
11296
  */
11299
11297
 
11300
- export type ExternalSecretKeySource = InstanceType<
11301
- (typeof ExternalSecretKeySource)[keyof Omit<
11302
- typeof ExternalSecretKeySource,
11298
+ export type ExternalSecretSource = InstanceType<
11299
+ (typeof ExternalSecretSource)[keyof Omit<
11300
+ typeof ExternalSecretSource,
11303
11301
  'instanceOf'
11304
11302
  >]
11305
11303
  >;
11306
11304
 
11307
- // FfiConverter for enum ExternalSecretKeySource
11308
- const FfiConverterTypeExternalSecretKeySource = (() => {
11305
+ // FfiConverter for enum ExternalSecretSource
11306
+ const FfiConverterTypeExternalSecretSource = (() => {
11309
11307
  const ordinalConverter = FfiConverterInt32;
11310
- type TypeName = ExternalSecretKeySource;
11308
+ type TypeName = ExternalSecretSource;
11311
11309
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11312
11310
  read(from: RustBuffer): TypeName {
11313
11311
  switch (ordinalConverter.read(from)) {
11314
11312
  case 1:
11315
- return new ExternalSecretKeySource.Derived({
11313
+ return new ExternalSecretSource.Derived({
11316
11314
  nodeId: FfiConverterTypeExternalTreeNodeId.read(from),
11317
11315
  });
11318
11316
  case 2:
11319
- return new ExternalSecretKeySource.Encrypted({
11320
- key: FfiConverterTypeExternalEncryptedPrivateKey.read(from),
11317
+ return new ExternalSecretSource.Encrypted({
11318
+ key: FfiConverterTypeExternalEncryptedSecret.read(from),
11321
11319
  });
11322
11320
  default:
11323
11321
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -11325,26 +11323,26 @@ const FfiConverterTypeExternalSecretKeySource = (() => {
11325
11323
  }
11326
11324
  write(value: TypeName, into: RustBuffer): void {
11327
11325
  switch (value.tag) {
11328
- case ExternalSecretKeySource_Tags.Derived: {
11326
+ case ExternalSecretSource_Tags.Derived: {
11329
11327
  ordinalConverter.write(1, into);
11330
11328
  const inner = value.inner;
11331
11329
  FfiConverterTypeExternalTreeNodeId.write(inner.nodeId, into);
11332
11330
  return;
11333
11331
  }
11334
- case ExternalSecretKeySource_Tags.Encrypted: {
11332
+ case ExternalSecretSource_Tags.Encrypted: {
11335
11333
  ordinalConverter.write(2, into);
11336
11334
  const inner = value.inner;
11337
- FfiConverterTypeExternalEncryptedPrivateKey.write(inner.key, into);
11335
+ FfiConverterTypeExternalEncryptedSecret.write(inner.key, into);
11338
11336
  return;
11339
11337
  }
11340
11338
  default:
11341
- // Throwing from here means that ExternalSecretKeySource_Tags hasn't matched an ordinal.
11339
+ // Throwing from here means that ExternalSecretSource_Tags hasn't matched an ordinal.
11342
11340
  throw new UniffiInternalError.UnexpectedEnumCase();
11343
11341
  }
11344
11342
  }
11345
11343
  allocationSize(value: TypeName): number {
11346
11344
  switch (value.tag) {
11347
- case ExternalSecretKeySource_Tags.Derived: {
11345
+ case ExternalSecretSource_Tags.Derived: {
11348
11346
  const inner = value.inner;
11349
11347
  let size = ordinalConverter.allocationSize(1);
11350
11348
  size += FfiConverterTypeExternalTreeNodeId.allocationSize(
@@ -11352,10 +11350,10 @@ const FfiConverterTypeExternalSecretKeySource = (() => {
11352
11350
  );
11353
11351
  return size;
11354
11352
  }
11355
- case ExternalSecretKeySource_Tags.Encrypted: {
11353
+ case ExternalSecretSource_Tags.Encrypted: {
11356
11354
  const inner = value.inner;
11357
11355
  let size = ordinalConverter.allocationSize(2);
11358
- size += FfiConverterTypeExternalEncryptedPrivateKey.allocationSize(
11356
+ size += FfiConverterTypeExternalEncryptedSecret.allocationSize(
11359
11357
  inner.key
11360
11358
  );
11361
11359
  return size;
@@ -11370,40 +11368,40 @@ const FfiConverterTypeExternalSecretKeySource = (() => {
11370
11368
 
11371
11369
  // Enum: ExternalSecretToSplit
11372
11370
  export enum ExternalSecretToSplit_Tags {
11373
- PrivateKey = 'PrivateKey',
11371
+ SecretSource = 'SecretSource',
11374
11372
  Preimage = 'Preimage',
11375
11373
  }
11376
11374
  /**
11377
11375
  * FFI-safe representation of `spark_wallet::SecretToSplit`
11378
11376
  */
11379
11377
  export const ExternalSecretToSplit = (() => {
11380
- type PrivateKey__interface = {
11381
- tag: ExternalSecretToSplit_Tags.PrivateKey;
11382
- inner: Readonly<{ source: ExternalSecretKeySource }>;
11378
+ type SecretSource__interface = {
11379
+ tag: ExternalSecretToSplit_Tags.SecretSource;
11380
+ inner: Readonly<{ source: ExternalSecretSource }>;
11383
11381
  };
11384
11382
 
11385
11383
  /**
11386
- * A private key to split
11384
+ * A secret source to split
11387
11385
  */
11388
- class PrivateKey_ extends UniffiEnum implements PrivateKey__interface {
11386
+ class SecretSource_ extends UniffiEnum implements SecretSource__interface {
11389
11387
  /**
11390
11388
  * @private
11391
11389
  * This field is private and should not be used, use `tag` instead.
11392
11390
  */
11393
11391
  readonly [uniffiTypeNameSymbol] = 'ExternalSecretToSplit';
11394
- readonly tag = ExternalSecretToSplit_Tags.PrivateKey;
11395
- readonly inner: Readonly<{ source: ExternalSecretKeySource }>;
11396
- constructor(inner: { source: ExternalSecretKeySource }) {
11397
- super('ExternalSecretToSplit', 'PrivateKey');
11392
+ readonly tag = ExternalSecretToSplit_Tags.SecretSource;
11393
+ readonly inner: Readonly<{ source: ExternalSecretSource }>;
11394
+ constructor(inner: { source: ExternalSecretSource }) {
11395
+ super('ExternalSecretToSplit', 'SecretSource');
11398
11396
  this.inner = Object.freeze(inner);
11399
11397
  }
11400
11398
 
11401
- static new(inner: { source: ExternalSecretKeySource }): PrivateKey_ {
11402
- return new PrivateKey_(inner);
11399
+ static new(inner: { source: ExternalSecretSource }): SecretSource_ {
11400
+ return new SecretSource_(inner);
11403
11401
  }
11404
11402
 
11405
- static instanceOf(obj: any): obj is PrivateKey_ {
11406
- return obj.tag === ExternalSecretToSplit_Tags.PrivateKey;
11403
+ static instanceOf(obj: any): obj is SecretSource_ {
11404
+ return obj.tag === ExternalSecretToSplit_Tags.SecretSource;
11407
11405
  }
11408
11406
  }
11409
11407
 
@@ -11443,7 +11441,7 @@ export const ExternalSecretToSplit = (() => {
11443
11441
 
11444
11442
  return Object.freeze({
11445
11443
  instanceOf,
11446
- PrivateKey: PrivateKey_,
11444
+ SecretSource: SecretSource_,
11447
11445
  Preimage: Preimage_,
11448
11446
  });
11449
11447
  })();
@@ -11467,8 +11465,8 @@ const FfiConverterTypeExternalSecretToSplit = (() => {
11467
11465
  read(from: RustBuffer): TypeName {
11468
11466
  switch (ordinalConverter.read(from)) {
11469
11467
  case 1:
11470
- return new ExternalSecretToSplit.PrivateKey({
11471
- source: FfiConverterTypeExternalSecretKeySource.read(from),
11468
+ return new ExternalSecretToSplit.SecretSource({
11469
+ source: FfiConverterTypeExternalSecretSource.read(from),
11472
11470
  });
11473
11471
  case 2:
11474
11472
  return new ExternalSecretToSplit.Preimage({
@@ -11480,10 +11478,10 @@ const FfiConverterTypeExternalSecretToSplit = (() => {
11480
11478
  }
11481
11479
  write(value: TypeName, into: RustBuffer): void {
11482
11480
  switch (value.tag) {
11483
- case ExternalSecretToSplit_Tags.PrivateKey: {
11481
+ case ExternalSecretToSplit_Tags.SecretSource: {
11484
11482
  ordinalConverter.write(1, into);
11485
11483
  const inner = value.inner;
11486
- FfiConverterTypeExternalSecretKeySource.write(inner.source, into);
11484
+ FfiConverterTypeExternalSecretSource.write(inner.source, into);
11487
11485
  return;
11488
11486
  }
11489
11487
  case ExternalSecretToSplit_Tags.Preimage: {
@@ -11499,10 +11497,10 @@ const FfiConverterTypeExternalSecretToSplit = (() => {
11499
11497
  }
11500
11498
  allocationSize(value: TypeName): number {
11501
11499
  switch (value.tag) {
11502
- case ExternalSecretToSplit_Tags.PrivateKey: {
11500
+ case ExternalSecretToSplit_Tags.SecretSource: {
11503
11501
  const inner = value.inner;
11504
11502
  let size = ordinalConverter.allocationSize(1);
11505
- size += FfiConverterTypeExternalSecretKeySource.allocationSize(
11503
+ size += FfiConverterTypeExternalSecretSource.allocationSize(
11506
11504
  inner.source
11507
11505
  );
11508
11506
  return size;
@@ -21203,57 +21201,72 @@ export interface ExternalSigner {
21203
21201
  * * `id` - The tree node identifier
21204
21202
  *
21205
21203
  * # Returns
21206
- * The public key for the node, or an error string
21204
+ * The public key for the node, or a `SignerError`
21207
21205
  */
21208
21206
  getPublicKeyForNode(
21209
21207
  id: ExternalTreeNodeId,
21210
21208
  asyncOpts_?: { signal: AbortSignal }
21211
21209
  ): /*throws*/ Promise<PublicKeyBytes>;
21212
21210
  /**
21213
- * Generates a random secret key.
21211
+ * Generates a random secret that is encrypted and known only to the signer.
21212
+ *
21213
+ * This method creates a new random secret and returns it in encrypted form.
21214
+ * The plaintext secret never leaves the signer boundary, providing a secure way
21215
+ * to create secrets that can be referenced in subsequent operations without
21216
+ * exposing them.
21217
+ *
21218
+ * This is conceptually similar to Spark's key derivation system where secrets
21219
+ * are represented by opaque references (like tree node IDs or Random) rather than raw values.
21220
+ * The encrypted secret can be passed to other signer methods that need to operate
21221
+ * on it, while keeping the actual secret material protected within the signer.
21214
21222
  *
21215
21223
  * # Returns
21216
- * A randomly generated secret key source, or an error string
21224
+ * An encrypted secret that can be used in subsequent signer operations,
21225
+ * or a `SignerError` if generation fails.
21226
+ *
21227
+ * See also: [Key Derivation System](https://docs.spark.money/wallets/spark-signer#the-keyderivation-system)
21217
21228
  */
21218
- generateRandomKey(asyncOpts_?: {
21229
+ generateRandomSecret(asyncOpts_?: {
21219
21230
  signal: AbortSignal;
21220
- }): /*throws*/ Promise<ExternalSecretKeySource>;
21231
+ }): /*throws*/ Promise<ExternalEncryptedSecret>;
21221
21232
  /**
21222
- * Gets an encrypted static deposit secret key by index.
21233
+ * Gets an encrypted static deposit secret by index.
21223
21234
  *
21224
21235
  * # Arguments
21225
- * * `index` - The index of the static deposit key
21236
+ * * `index` - The index of the static deposit secret
21226
21237
  *
21227
21238
  * # Returns
21228
- * The encrypted secret key, or an error string
21239
+ * The encrypted secret, or a `SignerError`
21240
+ *
21241
+ * This is the encrypted version of: [JavaScript `getStaticDepositSecretKey`](https://docs.spark.money/wallets/spark-signer#get-static-deposit-secret-key)
21229
21242
  */
21230
- staticDepositSecretKeyEncrypted(
21243
+ staticDepositSecretEncrypted(
21231
21244
  index: /*u32*/ number,
21232
21245
  asyncOpts_?: { signal: AbortSignal }
21233
- ): /*throws*/ Promise<ExternalSecretKeySource>;
21246
+ ): /*throws*/ Promise<ExternalSecretSource>;
21234
21247
  /**
21235
- * Gets a static deposit secret key by index.
21248
+ * Gets a static deposit secret by index.
21236
21249
  *
21237
21250
  * # Arguments
21238
- * * `index` - The index of the static deposit key
21251
+ * * `index` - The index of the static deposit secret
21239
21252
  *
21240
21253
  * # Returns
21241
- * The 32-byte secret key, or an error string
21254
+ * The 32-byte secret, or a `SignerError`
21242
21255
  *
21243
21256
  * See also: [JavaScript `getStaticDepositSecretKey`](https://docs.spark.money/wallets/spark-signer#get-static-deposit-secret-key)
21244
21257
  */
21245
- staticDepositSecretKey(
21258
+ staticDepositSecret(
21246
21259
  index: /*u32*/ number,
21247
21260
  asyncOpts_?: { signal: AbortSignal }
21248
- ): /*throws*/ Promise<PrivateKeyBytes>;
21261
+ ): /*throws*/ Promise<SecretBytes>;
21249
21262
  /**
21250
- * Gets a static deposit public key by index.
21263
+ * Gets a static deposit signing public key by index.
21251
21264
  *
21252
21265
  * # Arguments
21253
- * * `index` - The index of the static deposit key
21266
+ * * `index` - The index of the static deposit public signing key
21254
21267
  *
21255
21268
  * # Returns
21256
- * The 33-byte public key, or an error string
21269
+ * The 33-byte public key, or a `SignerError`
21257
21270
  *
21258
21271
  * See also: [JavaScript `getStaticDepositSigningKey`](https://docs.spark.money/wallets/spark-signer#get-static-deposit-signing-key)
21259
21272
  */
@@ -21262,23 +21275,23 @@ export interface ExternalSigner {
21262
21275
  asyncOpts_?: { signal: AbortSignal }
21263
21276
  ): /*throws*/ Promise<PublicKeyBytes>;
21264
21277
  /**
21265
- * Subtracts one secret key from another.
21278
+ * Subtracts one secret from another.
21266
21279
  *
21267
21280
  * # Arguments
21268
- * * `signing_key` - The first secret key source
21269
- * * `new_signing_key` - The second secret key source to subtract
21281
+ * * `signing_key` - The first secret
21282
+ * * `new_signing_key` - The second secret to subtract
21270
21283
  *
21271
21284
  * # Returns
21272
- * The resulting secret key source, or an error string
21285
+ * The resulting secret, or a `SignerError`
21273
21286
  *
21274
21287
  * See also: [JavaScript `subtractSplitAndEncrypt`](https://docs.spark.money/wallets/spark-signer#subtract,-split,-and-encrypt)
21275
21288
  * (this method provides the subtraction step of that higher-level operation)
21276
21289
  */
21277
- subtractSecretKeys(
21278
- signingKey: ExternalSecretKeySource,
21279
- newSigningKey: ExternalSecretKeySource,
21290
+ subtractSecrets(
21291
+ signingKey: ExternalSecretSource,
21292
+ newSigningKey: ExternalSecretSource,
21280
21293
  asyncOpts_?: { signal: AbortSignal }
21281
- ): /*throws*/ Promise<ExternalSecretKeySource>;
21294
+ ): /*throws*/ Promise<ExternalSecretSource>;
21282
21295
  /**
21283
21296
  * Splits a secret with proofs using Shamir's Secret Sharing.
21284
21297
  *
@@ -21288,7 +21301,7 @@ export interface ExternalSigner {
21288
21301
  * * `num_shares` - Total number of shares to create
21289
21302
  *
21290
21303
  * # Returns
21291
- * Vector of verifiable secret shares, or an error string
21304
+ * Vector of verifiable secret shares, or a `SignerError`
21292
21305
  *
21293
21306
  * See also: [JavaScript `splitSecretWithProofs`](https://docs.spark.money/wallets/spark-signer#split-secret-with-proofs)
21294
21307
  */
@@ -21299,31 +21312,33 @@ export interface ExternalSigner {
21299
21312
  asyncOpts_?: { signal: AbortSignal }
21300
21313
  ): /*throws*/ Promise<Array<ExternalVerifiableSecretShare>>;
21301
21314
  /**
21302
- * Encrypts a secret key for a specific receiver's public key.
21315
+ * Encrypts a secret for a specific receiver's public key.
21303
21316
  *
21304
21317
  * # Arguments
21305
- * * `secret_key` - The encrypted secret key to re-encrypt
21318
+ * * `encrypted_secret` - The encrypted secret to re-encrypt
21306
21319
  * * `receiver_public_key` - The receiver's 33-byte public key
21307
21320
  *
21308
21321
  * # Returns
21309
- * Encrypted data for the receiver, or an error string
21322
+ * Encrypted data for the receiver, or a `SignerError`
21310
21323
  */
21311
- encryptSecretKeyForReceiver(
21312
- secretKey: ExternalEncryptedPrivateKey,
21324
+ encryptSecretForReceiver(
21325
+ encryptedSecret: ExternalEncryptedSecret,
21313
21326
  receiverPublicKey: PublicKeyBytes,
21314
21327
  asyncOpts_?: { signal: AbortSignal }
21315
21328
  ): /*throws*/ Promise<ArrayBuffer>;
21316
21329
  /**
21317
- * Gets the public key from a secret key source.
21330
+ * Gets the public key from a secret.
21318
21331
  *
21319
21332
  * # Arguments
21320
- * * `secret_key` - The secret key source
21333
+ * * `secret` - The secret
21321
21334
  *
21322
21335
  * # Returns
21323
- * The corresponding 33-byte public key, or an error string
21336
+ * The corresponding 33-byte public key, or a `SignerError`
21337
+ *
21338
+ * See also: [JavaScript `getPublicKeyFromDerivation`](https://docs.spark.money/wallets/spark-signer#get-public-key-from-derivation)
21324
21339
  */
21325
- publicKeyFromSecretKeySource(
21326
- secretKey: ExternalSecretKeySource,
21340
+ publicKeyFromSecret(
21341
+ secret: ExternalSecretSource,
21327
21342
  asyncOpts_?: { signal: AbortSignal }
21328
21343
  ): /*throws*/ Promise<PublicKeyBytes>;
21329
21344
  /**
@@ -21333,7 +21348,7 @@ export interface ExternalSigner {
21333
21348
  * * `request` - The Frost signing request
21334
21349
  *
21335
21350
  * # Returns
21336
- * A signature share, or an error string
21351
+ * A signature share, or a `SignerError`
21337
21352
  *
21338
21353
  * See also: [JavaScript `signFrost`](https://docs.spark.money/wallets/spark-signer#frost-signing)
21339
21354
  */
@@ -21348,7 +21363,7 @@ export interface ExternalSigner {
21348
21363
  * * `request` - The Frost aggregation request
21349
21364
  *
21350
21365
  * # Returns
21351
- * The aggregated Frost signature, or an error string
21366
+ * The aggregated Frost signature, or a `SignerError`
21352
21367
  *
21353
21368
  * See also: [JavaScript `aggregateFrost`](https://docs.spark.money/wallets/spark-signer#aggregate-frost-signatures)
21354
21369
  */
@@ -21824,7 +21839,7 @@ export class ExternalSignerImpl
21824
21839
  * * `id` - The tree node identifier
21825
21840
  *
21826
21841
  * # Returns
21827
- * The public key for the node, or an error string
21842
+ * The public key for the node, or a `SignerError`
21828
21843
  */
21829
21844
  public async getPublicKeyForNode(
21830
21845
  id: ExternalTreeNodeId,
@@ -21866,20 +21881,33 @@ export class ExternalSignerImpl
21866
21881
  }
21867
21882
 
21868
21883
  /**
21869
- * Generates a random secret key.
21884
+ * Generates a random secret that is encrypted and known only to the signer.
21885
+ *
21886
+ * This method creates a new random secret and returns it in encrypted form.
21887
+ * The plaintext secret never leaves the signer boundary, providing a secure way
21888
+ * to create secrets that can be referenced in subsequent operations without
21889
+ * exposing them.
21890
+ *
21891
+ * This is conceptually similar to Spark's key derivation system where secrets
21892
+ * are represented by opaque references (like tree node IDs or Random) rather than raw values.
21893
+ * The encrypted secret can be passed to other signer methods that need to operate
21894
+ * on it, while keeping the actual secret material protected within the signer.
21870
21895
  *
21871
21896
  * # Returns
21872
- * A randomly generated secret key source, or an error string
21897
+ * An encrypted secret that can be used in subsequent signer operations,
21898
+ * or a `SignerError` if generation fails.
21899
+ *
21900
+ * See also: [Key Derivation System](https://docs.spark.money/wallets/spark-signer#the-keyderivation-system)
21873
21901
  */
21874
- public async generateRandomKey(asyncOpts_?: {
21902
+ public async generateRandomSecret(asyncOpts_?: {
21875
21903
  signal: AbortSignal;
21876
- }): Promise<ExternalSecretKeySource> /*throws*/ {
21904
+ }): Promise<ExternalEncryptedSecret> /*throws*/ {
21877
21905
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
21878
21906
  try {
21879
21907
  return await uniffiRustCallAsync(
21880
21908
  /*rustCaller:*/ uniffiCaller,
21881
21909
  /*rustFutureFunc:*/ () => {
21882
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_generate_random_key(
21910
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_generate_random_secret(
21883
21911
  uniffiTypeExternalSignerImplObjectFactory.clonePointer(this)
21884
21912
  );
21885
21913
  },
@@ -21891,8 +21919,8 @@ export class ExternalSignerImpl
21891
21919
  .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
21892
21920
  /*freeFunc:*/ nativeModule()
21893
21921
  .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
21894
- /*liftFunc:*/ FfiConverterTypeExternalSecretKeySource.lift.bind(
21895
- FfiConverterTypeExternalSecretKeySource
21922
+ /*liftFunc:*/ FfiConverterTypeExternalEncryptedSecret.lift.bind(
21923
+ FfiConverterTypeExternalEncryptedSecret
21896
21924
  ),
21897
21925
  /*liftString:*/ FfiConverterString.lift,
21898
21926
  /*asyncOpts:*/ asyncOpts_,
@@ -21909,24 +21937,26 @@ export class ExternalSignerImpl
21909
21937
  }
21910
21938
 
21911
21939
  /**
21912
- * Gets an encrypted static deposit secret key by index.
21940
+ * Gets an encrypted static deposit secret by index.
21913
21941
  *
21914
21942
  * # Arguments
21915
- * * `index` - The index of the static deposit key
21943
+ * * `index` - The index of the static deposit secret
21916
21944
  *
21917
21945
  * # Returns
21918
- * The encrypted secret key, or an error string
21946
+ * The encrypted secret, or a `SignerError`
21947
+ *
21948
+ * This is the encrypted version of: [JavaScript `getStaticDepositSecretKey`](https://docs.spark.money/wallets/spark-signer#get-static-deposit-secret-key)
21919
21949
  */
21920
- public async staticDepositSecretKeyEncrypted(
21950
+ public async staticDepositSecretEncrypted(
21921
21951
  index: /*u32*/ number,
21922
21952
  asyncOpts_?: { signal: AbortSignal }
21923
- ): Promise<ExternalSecretKeySource> /*throws*/ {
21953
+ ): Promise<ExternalSecretSource> /*throws*/ {
21924
21954
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
21925
21955
  try {
21926
21956
  return await uniffiRustCallAsync(
21927
21957
  /*rustCaller:*/ uniffiCaller,
21928
21958
  /*rustFutureFunc:*/ () => {
21929
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_static_deposit_secret_key_encrypted(
21959
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_static_deposit_secret_encrypted(
21930
21960
  uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
21931
21961
  FfiConverterUInt32.lower(index)
21932
21962
  );
@@ -21939,8 +21969,8 @@ export class ExternalSignerImpl
21939
21969
  .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
21940
21970
  /*freeFunc:*/ nativeModule()
21941
21971
  .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
21942
- /*liftFunc:*/ FfiConverterTypeExternalSecretKeySource.lift.bind(
21943
- FfiConverterTypeExternalSecretKeySource
21972
+ /*liftFunc:*/ FfiConverterTypeExternalSecretSource.lift.bind(
21973
+ FfiConverterTypeExternalSecretSource
21944
21974
  ),
21945
21975
  /*liftString:*/ FfiConverterString.lift,
21946
21976
  /*asyncOpts:*/ asyncOpts_,
@@ -21957,26 +21987,26 @@ export class ExternalSignerImpl
21957
21987
  }
21958
21988
 
21959
21989
  /**
21960
- * Gets a static deposit secret key by index.
21990
+ * Gets a static deposit secret by index.
21961
21991
  *
21962
21992
  * # Arguments
21963
- * * `index` - The index of the static deposit key
21993
+ * * `index` - The index of the static deposit secret
21964
21994
  *
21965
21995
  * # Returns
21966
- * The 32-byte secret key, or an error string
21996
+ * The 32-byte secret, or a `SignerError`
21967
21997
  *
21968
21998
  * See also: [JavaScript `getStaticDepositSecretKey`](https://docs.spark.money/wallets/spark-signer#get-static-deposit-secret-key)
21969
21999
  */
21970
- public async staticDepositSecretKey(
22000
+ public async staticDepositSecret(
21971
22001
  index: /*u32*/ number,
21972
22002
  asyncOpts_?: { signal: AbortSignal }
21973
- ): Promise<PrivateKeyBytes> /*throws*/ {
22003
+ ): Promise<SecretBytes> /*throws*/ {
21974
22004
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
21975
22005
  try {
21976
22006
  return await uniffiRustCallAsync(
21977
22007
  /*rustCaller:*/ uniffiCaller,
21978
22008
  /*rustFutureFunc:*/ () => {
21979
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_static_deposit_secret_key(
22009
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_static_deposit_secret(
21980
22010
  uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
21981
22011
  FfiConverterUInt32.lower(index)
21982
22012
  );
@@ -21989,8 +22019,8 @@ export class ExternalSignerImpl
21989
22019
  .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
21990
22020
  /*freeFunc:*/ nativeModule()
21991
22021
  .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
21992
- /*liftFunc:*/ FfiConverterTypePrivateKeyBytes.lift.bind(
21993
- FfiConverterTypePrivateKeyBytes
22022
+ /*liftFunc:*/ FfiConverterTypeSecretBytes.lift.bind(
22023
+ FfiConverterTypeSecretBytes
21994
22024
  ),
21995
22025
  /*liftString:*/ FfiConverterString.lift,
21996
22026
  /*asyncOpts:*/ asyncOpts_,
@@ -22007,13 +22037,13 @@ export class ExternalSignerImpl
22007
22037
  }
22008
22038
 
22009
22039
  /**
22010
- * Gets a static deposit public key by index.
22040
+ * Gets a static deposit signing public key by index.
22011
22041
  *
22012
22042
  * # Arguments
22013
- * * `index` - The index of the static deposit key
22043
+ * * `index` - The index of the static deposit public signing key
22014
22044
  *
22015
22045
  * # Returns
22016
- * The 33-byte public key, or an error string
22046
+ * The 33-byte public key, or a `SignerError`
22017
22047
  *
22018
22048
  * See also: [JavaScript `getStaticDepositSigningKey`](https://docs.spark.money/wallets/spark-signer#get-static-deposit-signing-key)
22019
22049
  */
@@ -22057,32 +22087,32 @@ export class ExternalSignerImpl
22057
22087
  }
22058
22088
 
22059
22089
  /**
22060
- * Subtracts one secret key from another.
22090
+ * Subtracts one secret from another.
22061
22091
  *
22062
22092
  * # Arguments
22063
- * * `signing_key` - The first secret key source
22064
- * * `new_signing_key` - The second secret key source to subtract
22093
+ * * `signing_key` - The first secret
22094
+ * * `new_signing_key` - The second secret to subtract
22065
22095
  *
22066
22096
  * # Returns
22067
- * The resulting secret key source, or an error string
22097
+ * The resulting secret, or a `SignerError`
22068
22098
  *
22069
22099
  * See also: [JavaScript `subtractSplitAndEncrypt`](https://docs.spark.money/wallets/spark-signer#subtract,-split,-and-encrypt)
22070
22100
  * (this method provides the subtraction step of that higher-level operation)
22071
22101
  */
22072
- public async subtractSecretKeys(
22073
- signingKey: ExternalSecretKeySource,
22074
- newSigningKey: ExternalSecretKeySource,
22102
+ public async subtractSecrets(
22103
+ signingKey: ExternalSecretSource,
22104
+ newSigningKey: ExternalSecretSource,
22075
22105
  asyncOpts_?: { signal: AbortSignal }
22076
- ): Promise<ExternalSecretKeySource> /*throws*/ {
22106
+ ): Promise<ExternalSecretSource> /*throws*/ {
22077
22107
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
22078
22108
  try {
22079
22109
  return await uniffiRustCallAsync(
22080
22110
  /*rustCaller:*/ uniffiCaller,
22081
22111
  /*rustFutureFunc:*/ () => {
22082
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_subtract_secret_keys(
22112
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_subtract_secrets(
22083
22113
  uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
22084
- FfiConverterTypeExternalSecretKeySource.lower(signingKey),
22085
- FfiConverterTypeExternalSecretKeySource.lower(newSigningKey)
22114
+ FfiConverterTypeExternalSecretSource.lower(signingKey),
22115
+ FfiConverterTypeExternalSecretSource.lower(newSigningKey)
22086
22116
  );
22087
22117
  },
22088
22118
  /*pollFunc:*/ nativeModule()
@@ -22093,8 +22123,8 @@ export class ExternalSignerImpl
22093
22123
  .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
22094
22124
  /*freeFunc:*/ nativeModule()
22095
22125
  .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
22096
- /*liftFunc:*/ FfiConverterTypeExternalSecretKeySource.lift.bind(
22097
- FfiConverterTypeExternalSecretKeySource
22126
+ /*liftFunc:*/ FfiConverterTypeExternalSecretSource.lift.bind(
22127
+ FfiConverterTypeExternalSecretSource
22098
22128
  ),
22099
22129
  /*liftString:*/ FfiConverterString.lift,
22100
22130
  /*asyncOpts:*/ asyncOpts_,
@@ -22119,7 +22149,7 @@ export class ExternalSignerImpl
22119
22149
  * * `num_shares` - Total number of shares to create
22120
22150
  *
22121
22151
  * # Returns
22122
- * Vector of verifiable secret shares, or an error string
22152
+ * Vector of verifiable secret shares, or a `SignerError`
22123
22153
  *
22124
22154
  * See also: [JavaScript `splitSecretWithProofs`](https://docs.spark.money/wallets/spark-signer#split-secret-with-proofs)
22125
22155
  */
@@ -22167,17 +22197,17 @@ export class ExternalSignerImpl
22167
22197
  }
22168
22198
 
22169
22199
  /**
22170
- * Encrypts a secret key for a specific receiver's public key.
22200
+ * Encrypts a secret for a specific receiver's public key.
22171
22201
  *
22172
22202
  * # Arguments
22173
- * * `secret_key` - The encrypted secret key to re-encrypt
22203
+ * * `encrypted_secret` - The encrypted secret to re-encrypt
22174
22204
  * * `receiver_public_key` - The receiver's 33-byte public key
22175
22205
  *
22176
22206
  * # Returns
22177
- * Encrypted data for the receiver, or an error string
22207
+ * Encrypted data for the receiver, or a `SignerError`
22178
22208
  */
22179
- public async encryptSecretKeyForReceiver(
22180
- secretKey: ExternalEncryptedPrivateKey,
22209
+ public async encryptSecretForReceiver(
22210
+ encryptedSecret: ExternalEncryptedSecret,
22181
22211
  receiverPublicKey: PublicKeyBytes,
22182
22212
  asyncOpts_?: { signal: AbortSignal }
22183
22213
  ): Promise<ArrayBuffer> /*throws*/ {
@@ -22186,9 +22216,9 @@ export class ExternalSignerImpl
22186
22216
  return await uniffiRustCallAsync(
22187
22217
  /*rustCaller:*/ uniffiCaller,
22188
22218
  /*rustFutureFunc:*/ () => {
22189
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_encrypt_secret_key_for_receiver(
22219
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_encrypt_secret_for_receiver(
22190
22220
  uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
22191
- FfiConverterTypeExternalEncryptedPrivateKey.lower(secretKey),
22221
+ FfiConverterTypeExternalEncryptedSecret.lower(encryptedSecret),
22192
22222
  FfiConverterTypePublicKeyBytes.lower(receiverPublicKey)
22193
22223
  );
22194
22224
  },
@@ -22218,16 +22248,18 @@ export class ExternalSignerImpl
22218
22248
  }
22219
22249
 
22220
22250
  /**
22221
- * Gets the public key from a secret key source.
22251
+ * Gets the public key from a secret.
22222
22252
  *
22223
22253
  * # Arguments
22224
- * * `secret_key` - The secret key source
22254
+ * * `secret` - The secret
22225
22255
  *
22226
22256
  * # Returns
22227
- * The corresponding 33-byte public key, or an error string
22257
+ * The corresponding 33-byte public key, or a `SignerError`
22258
+ *
22259
+ * See also: [JavaScript `getPublicKeyFromDerivation`](https://docs.spark.money/wallets/spark-signer#get-public-key-from-derivation)
22228
22260
  */
22229
- public async publicKeyFromSecretKeySource(
22230
- secretKey: ExternalSecretKeySource,
22261
+ public async publicKeyFromSecret(
22262
+ secret: ExternalSecretSource,
22231
22263
  asyncOpts_?: { signal: AbortSignal }
22232
22264
  ): Promise<PublicKeyBytes> /*throws*/ {
22233
22265
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -22235,9 +22267,9 @@ export class ExternalSignerImpl
22235
22267
  return await uniffiRustCallAsync(
22236
22268
  /*rustCaller:*/ uniffiCaller,
22237
22269
  /*rustFutureFunc:*/ () => {
22238
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_public_key_from_secret_key_source(
22270
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsigner_public_key_from_secret(
22239
22271
  uniffiTypeExternalSignerImplObjectFactory.clonePointer(this),
22240
- FfiConverterTypeExternalSecretKeySource.lower(secretKey)
22272
+ FfiConverterTypeExternalSecretSource.lower(secret)
22241
22273
  );
22242
22274
  },
22243
22275
  /*pollFunc:*/ nativeModule()
@@ -22272,7 +22304,7 @@ export class ExternalSignerImpl
22272
22304
  * * `request` - The Frost signing request
22273
22305
  *
22274
22306
  * # Returns
22275
- * A signature share, or an error string
22307
+ * A signature share, or a `SignerError`
22276
22308
  *
22277
22309
  * See also: [JavaScript `signFrost`](https://docs.spark.money/wallets/spark-signer#frost-signing)
22278
22310
  */
@@ -22322,7 +22354,7 @@ export class ExternalSignerImpl
22322
22354
  * * `request` - The Frost aggregation request
22323
22355
  *
22324
22356
  * # Returns
22325
- * The aggregated Frost signature, or an error string
22357
+ * The aggregated Frost signature, or a `SignerError`
22326
22358
  *
22327
22359
  * See also: [JavaScript `aggregateFrost`](https://docs.spark.money/wallets/spark-signer#aggregate-frost-signatures)
22328
22360
  */
@@ -22913,23 +22945,23 @@ const uniffiCallbackInterfaceExternalSigner: {
22913
22945
  );
22914
22946
  return UniffiResult.success(uniffiForeignFuture);
22915
22947
  },
22916
- generateRandomKey: (
22948
+ generateRandomSecret: (
22917
22949
  uniffiHandle: bigint,
22918
22950
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
22919
22951
  uniffiCallbackData: bigint
22920
22952
  ) => {
22921
22953
  const uniffiMakeCall = async (
22922
22954
  signal: AbortSignal
22923
- ): Promise<ExternalSecretKeySource> => {
22955
+ ): Promise<ExternalEncryptedSecret> => {
22924
22956
  const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
22925
- return await jsCallback.generateRandomKey({ signal });
22957
+ return await jsCallback.generateRandomSecret({ signal });
22926
22958
  };
22927
- const uniffiHandleSuccess = (returnValue: ExternalSecretKeySource) => {
22959
+ const uniffiHandleSuccess = (returnValue: ExternalEncryptedSecret) => {
22928
22960
  uniffiFutureCallback(
22929
22961
  uniffiCallbackData,
22930
22962
  /* UniffiForeignFutureStructRustBuffer */ {
22931
22963
  returnValue:
22932
- FfiConverterTypeExternalSecretKeySource.lower(returnValue),
22964
+ FfiConverterTypeExternalEncryptedSecret.lower(returnValue),
22933
22965
  callStatus: uniffiCaller.createCallStatus(),
22934
22966
  }
22935
22967
  );
@@ -22956,7 +22988,7 @@ const uniffiCallbackInterfaceExternalSigner: {
22956
22988
  );
22957
22989
  return UniffiResult.success(uniffiForeignFuture);
22958
22990
  },
22959
- staticDepositSecretKeyEncrypted: (
22991
+ staticDepositSecretEncrypted: (
22960
22992
  uniffiHandle: bigint,
22961
22993
  index: number,
22962
22994
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
@@ -22964,19 +22996,19 @@ const uniffiCallbackInterfaceExternalSigner: {
22964
22996
  ) => {
22965
22997
  const uniffiMakeCall = async (
22966
22998
  signal: AbortSignal
22967
- ): Promise<ExternalSecretKeySource> => {
22999
+ ): Promise<ExternalSecretSource> => {
22968
23000
  const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
22969
- return await jsCallback.staticDepositSecretKeyEncrypted(
23001
+ return await jsCallback.staticDepositSecretEncrypted(
22970
23002
  FfiConverterUInt32.lift(index),
22971
23003
  { signal }
22972
23004
  );
22973
23005
  };
22974
- const uniffiHandleSuccess = (returnValue: ExternalSecretKeySource) => {
23006
+ const uniffiHandleSuccess = (returnValue: ExternalSecretSource) => {
22975
23007
  uniffiFutureCallback(
22976
23008
  uniffiCallbackData,
22977
23009
  /* UniffiForeignFutureStructRustBuffer */ {
22978
23010
  returnValue:
22979
- FfiConverterTypeExternalSecretKeySource.lower(returnValue),
23011
+ FfiConverterTypeExternalSecretSource.lower(returnValue),
22980
23012
  callStatus: uniffiCaller.createCallStatus(),
22981
23013
  }
22982
23014
  );
@@ -23003,7 +23035,7 @@ const uniffiCallbackInterfaceExternalSigner: {
23003
23035
  );
23004
23036
  return UniffiResult.success(uniffiForeignFuture);
23005
23037
  },
23006
- staticDepositSecretKey: (
23038
+ staticDepositSecret: (
23007
23039
  uniffiHandle: bigint,
23008
23040
  index: number,
23009
23041
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
@@ -23011,18 +23043,18 @@ const uniffiCallbackInterfaceExternalSigner: {
23011
23043
  ) => {
23012
23044
  const uniffiMakeCall = async (
23013
23045
  signal: AbortSignal
23014
- ): Promise<PrivateKeyBytes> => {
23046
+ ): Promise<SecretBytes> => {
23015
23047
  const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
23016
- return await jsCallback.staticDepositSecretKey(
23048
+ return await jsCallback.staticDepositSecret(
23017
23049
  FfiConverterUInt32.lift(index),
23018
23050
  { signal }
23019
23051
  );
23020
23052
  };
23021
- const uniffiHandleSuccess = (returnValue: PrivateKeyBytes) => {
23053
+ const uniffiHandleSuccess = (returnValue: SecretBytes) => {
23022
23054
  uniffiFutureCallback(
23023
23055
  uniffiCallbackData,
23024
23056
  /* UniffiForeignFutureStructRustBuffer */ {
23025
- returnValue: FfiConverterTypePrivateKeyBytes.lower(returnValue),
23057
+ returnValue: FfiConverterTypeSecretBytes.lower(returnValue),
23026
23058
  callStatus: uniffiCaller.createCallStatus(),
23027
23059
  }
23028
23060
  );
@@ -23095,7 +23127,7 @@ const uniffiCallbackInterfaceExternalSigner: {
23095
23127
  );
23096
23128
  return UniffiResult.success(uniffiForeignFuture);
23097
23129
  },
23098
- subtractSecretKeys: (
23130
+ subtractSecrets: (
23099
23131
  uniffiHandle: bigint,
23100
23132
  signingKey: Uint8Array,
23101
23133
  newSigningKey: Uint8Array,
@@ -23104,20 +23136,20 @@ const uniffiCallbackInterfaceExternalSigner: {
23104
23136
  ) => {
23105
23137
  const uniffiMakeCall = async (
23106
23138
  signal: AbortSignal
23107
- ): Promise<ExternalSecretKeySource> => {
23139
+ ): Promise<ExternalSecretSource> => {
23108
23140
  const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
23109
- return await jsCallback.subtractSecretKeys(
23110
- FfiConverterTypeExternalSecretKeySource.lift(signingKey),
23111
- FfiConverterTypeExternalSecretKeySource.lift(newSigningKey),
23141
+ return await jsCallback.subtractSecrets(
23142
+ FfiConverterTypeExternalSecretSource.lift(signingKey),
23143
+ FfiConverterTypeExternalSecretSource.lift(newSigningKey),
23112
23144
  { signal }
23113
23145
  );
23114
23146
  };
23115
- const uniffiHandleSuccess = (returnValue: ExternalSecretKeySource) => {
23147
+ const uniffiHandleSuccess = (returnValue: ExternalSecretSource) => {
23116
23148
  uniffiFutureCallback(
23117
23149
  uniffiCallbackData,
23118
23150
  /* UniffiForeignFutureStructRustBuffer */ {
23119
23151
  returnValue:
23120
- FfiConverterTypeExternalSecretKeySource.lower(returnValue),
23152
+ FfiConverterTypeExternalSecretSource.lower(returnValue),
23121
23153
  callStatus: uniffiCaller.createCallStatus(),
23122
23154
  }
23123
23155
  );
@@ -23199,9 +23231,9 @@ const uniffiCallbackInterfaceExternalSigner: {
23199
23231
  );
23200
23232
  return UniffiResult.success(uniffiForeignFuture);
23201
23233
  },
23202
- encryptSecretKeyForReceiver: (
23234
+ encryptSecretForReceiver: (
23203
23235
  uniffiHandle: bigint,
23204
- secretKey: Uint8Array,
23236
+ encryptedSecret: Uint8Array,
23205
23237
  receiverPublicKey: Uint8Array,
23206
23238
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
23207
23239
  uniffiCallbackData: bigint
@@ -23210,8 +23242,8 @@ const uniffiCallbackInterfaceExternalSigner: {
23210
23242
  signal: AbortSignal
23211
23243
  ): Promise<ArrayBuffer> => {
23212
23244
  const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
23213
- return await jsCallback.encryptSecretKeyForReceiver(
23214
- FfiConverterTypeExternalEncryptedPrivateKey.lift(secretKey),
23245
+ return await jsCallback.encryptSecretForReceiver(
23246
+ FfiConverterTypeExternalEncryptedSecret.lift(encryptedSecret),
23215
23247
  FfiConverterTypePublicKeyBytes.lift(receiverPublicKey),
23216
23248
  { signal }
23217
23249
  );
@@ -23247,9 +23279,9 @@ const uniffiCallbackInterfaceExternalSigner: {
23247
23279
  );
23248
23280
  return UniffiResult.success(uniffiForeignFuture);
23249
23281
  },
23250
- publicKeyFromSecretKeySource: (
23282
+ publicKeyFromSecret: (
23251
23283
  uniffiHandle: bigint,
23252
- secretKey: Uint8Array,
23284
+ secret: Uint8Array,
23253
23285
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
23254
23286
  uniffiCallbackData: bigint
23255
23287
  ) => {
@@ -23257,8 +23289,8 @@ const uniffiCallbackInterfaceExternalSigner: {
23257
23289
  signal: AbortSignal
23258
23290
  ): Promise<PublicKeyBytes> => {
23259
23291
  const jsCallback = FfiConverterTypeExternalSigner.lift(uniffiHandle);
23260
- return await jsCallback.publicKeyFromSecretKeySource(
23261
- FfiConverterTypeExternalSecretKeySource.lift(secretKey),
23292
+ return await jsCallback.publicKeyFromSecret(
23293
+ FfiConverterTypeExternalSecretSource.lift(secret),
23262
23294
  { signal }
23263
23295
  );
23264
23296
  };
@@ -28793,79 +28825,79 @@ function uniffiEnsureInitialized() {
28793
28825
  }
28794
28826
  if (
28795
28827
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_get_public_key_for_node() !==
28796
- 62425
28828
+ 37434
28797
28829
  ) {
28798
28830
  throw new UniffiInternalError.ApiChecksumMismatch(
28799
28831
  'uniffi_breez_sdk_spark_checksum_method_externalsigner_get_public_key_for_node'
28800
28832
  );
28801
28833
  }
28802
28834
  if (
28803
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_random_key() !==
28804
- 24906
28835
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_random_secret() !==
28836
+ 26114
28805
28837
  ) {
28806
28838
  throw new UniffiInternalError.ApiChecksumMismatch(
28807
- 'uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_random_key'
28839
+ 'uniffi_breez_sdk_spark_checksum_method_externalsigner_generate_random_secret'
28808
28840
  );
28809
28841
  }
28810
28842
  if (
28811
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret_key_encrypted() !==
28812
- 50023
28843
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret_encrypted() !==
28844
+ 38925
28813
28845
  ) {
28814
28846
  throw new UniffiInternalError.ApiChecksumMismatch(
28815
- 'uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret_key_encrypted'
28847
+ 'uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret_encrypted'
28816
28848
  );
28817
28849
  }
28818
28850
  if (
28819
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret_key() !==
28820
- 61854
28851
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret() !==
28852
+ 45280
28821
28853
  ) {
28822
28854
  throw new UniffiInternalError.ApiChecksumMismatch(
28823
- 'uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret_key'
28855
+ 'uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_secret'
28824
28856
  );
28825
28857
  }
28826
28858
  if (
28827
28859
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_signing_key() !==
28828
- 15562
28860
+ 62519
28829
28861
  ) {
28830
28862
  throw new UniffiInternalError.ApiChecksumMismatch(
28831
28863
  'uniffi_breez_sdk_spark_checksum_method_externalsigner_static_deposit_signing_key'
28832
28864
  );
28833
28865
  }
28834
28866
  if (
28835
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_secret_keys() !==
28836
- 4979
28867
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_secrets() !==
28868
+ 51106
28837
28869
  ) {
28838
28870
  throw new UniffiInternalError.ApiChecksumMismatch(
28839
- 'uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_secret_keys'
28871
+ 'uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_secrets'
28840
28872
  );
28841
28873
  }
28842
28874
  if (
28843
28875
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_split_secret_with_proofs() !==
28844
- 6228
28876
+ 19489
28845
28877
  ) {
28846
28878
  throw new UniffiInternalError.ApiChecksumMismatch(
28847
28879
  'uniffi_breez_sdk_spark_checksum_method_externalsigner_split_secret_with_proofs'
28848
28880
  );
28849
28881
  }
28850
28882
  if (
28851
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_encrypt_secret_key_for_receiver() !==
28852
- 43011
28883
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_encrypt_secret_for_receiver() !==
28884
+ 51627
28853
28885
  ) {
28854
28886
  throw new UniffiInternalError.ApiChecksumMismatch(
28855
- 'uniffi_breez_sdk_spark_checksum_method_externalsigner_encrypt_secret_key_for_receiver'
28887
+ 'uniffi_breez_sdk_spark_checksum_method_externalsigner_encrypt_secret_for_receiver'
28856
28888
  );
28857
28889
  }
28858
28890
  if (
28859
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_public_key_from_secret_key_source() !==
28860
- 35440
28891
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_public_key_from_secret() !==
28892
+ 53055
28861
28893
  ) {
28862
28894
  throw new UniffiInternalError.ApiChecksumMismatch(
28863
- 'uniffi_breez_sdk_spark_checksum_method_externalsigner_public_key_from_secret_key_source'
28895
+ 'uniffi_breez_sdk_spark_checksum_method_externalsigner_public_key_from_secret'
28864
28896
  );
28865
28897
  }
28866
28898
  if (
28867
28899
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_frost() !==
28868
- 2993
28900
+ 20635
28869
28901
  ) {
28870
28902
  throw new UniffiInternalError.ApiChecksumMismatch(
28871
28903
  'uniffi_breez_sdk_spark_checksum_method_externalsigner_sign_frost'
@@ -28873,7 +28905,7 @@ function uniffiEnsureInitialized() {
28873
28905
  }
28874
28906
  if (
28875
28907
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_aggregate_frost() !==
28876
- 27769
28908
+ 53544
28877
28909
  ) {
28878
28910
  throw new UniffiInternalError.ApiChecksumMismatch(
28879
28911
  'uniffi_breez_sdk_spark_checksum_method_externalsigner_aggregate_frost'
@@ -29332,15 +29364,15 @@ export default Object.freeze({
29332
29364
  FfiConverterTypeDepositInfo,
29333
29365
  FfiConverterTypeEcdsaSignatureBytes,
29334
29366
  FfiConverterTypeExternalAggregateFrostRequest,
29335
- FfiConverterTypeExternalEncryptedPrivateKey,
29367
+ FfiConverterTypeExternalEncryptedSecret,
29336
29368
  FfiConverterTypeExternalFrostCommitments,
29337
29369
  FfiConverterTypeExternalFrostSignature,
29338
29370
  FfiConverterTypeExternalFrostSignatureShare,
29339
29371
  FfiConverterTypeExternalIdentifier,
29340
29372
  FfiConverterTypeExternalInputParser,
29341
29373
  FfiConverterTypeExternalScalar,
29342
- FfiConverterTypeExternalSecretKeySource,
29343
29374
  FfiConverterTypeExternalSecretShare,
29375
+ FfiConverterTypeExternalSecretSource,
29344
29376
  FfiConverterTypeExternalSecretToSplit,
29345
29377
  FfiConverterTypeExternalSignFrostRequest,
29346
29378
  FfiConverterTypeExternalSigner,
@@ -29414,7 +29446,6 @@ export default Object.freeze({
29414
29446
  FfiConverterTypePrepareLnurlPayResponse,
29415
29447
  FfiConverterTypePrepareSendPaymentRequest,
29416
29448
  FfiConverterTypePrepareSendPaymentResponse,
29417
- FfiConverterTypePrivateKeyBytes,
29418
29449
  FfiConverterTypeProvisionalPayment,
29419
29450
  FfiConverterTypeProvisionalPaymentDetails,
29420
29451
  FfiConverterTypePublicKeyBytes,
@@ -29435,6 +29466,7 @@ export default Object.freeze({
29435
29466
  FfiConverterTypeSchnorrSignatureBytes,
29436
29467
  FfiConverterTypeSdkBuilder,
29437
29468
  FfiConverterTypeSdkEvent,
29469
+ FfiConverterTypeSecretBytes,
29438
29470
  FfiConverterTypeSeed,
29439
29471
  FfiConverterTypeSendOnchainFeeQuote,
29440
29472
  FfiConverterTypeSendOnchainSpeedFeeQuote,