@breeztech/breez-sdk-spark-react-native 0.7.3 → 0.7.5

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.
@@ -1766,6 +1766,28 @@ export declare const GetTokensMetadataResponse: Readonly<{
1766
1766
  */
1767
1767
  defaults: () => Partial<GetTokensMetadataResponse>;
1768
1768
  }>;
1769
+ export type HashedMessageBytes = {
1770
+ bytes: ArrayBuffer;
1771
+ };
1772
+ /**
1773
+ * Generated factory for {@link HashedMessageBytes} record objects.
1774
+ */
1775
+ export declare const HashedMessageBytes: Readonly<{
1776
+ /**
1777
+ * Create a frozen instance of {@link HashedMessageBytes}, with defaults specified
1778
+ * in Rust, in the {@link breez_sdk_spark} crate.
1779
+ */
1780
+ create: (partial: Partial<HashedMessageBytes> & Required<Omit<HashedMessageBytes, never>>) => HashedMessageBytes;
1781
+ /**
1782
+ * Create a frozen instance of {@link HashedMessageBytes}, with defaults specified
1783
+ * in Rust, in the {@link breez_sdk_spark} crate.
1784
+ */
1785
+ new: (partial: Partial<HashedMessageBytes> & Required<Omit<HashedMessageBytes, never>>) => HashedMessageBytes;
1786
+ /**
1787
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1788
+ */
1789
+ defaults: () => Partial<HashedMessageBytes>;
1790
+ }>;
1769
1791
  /**
1770
1792
  * FFI-safe wrapper for (Identifier, `SigningCommitments`) pair
1771
1793
  */
@@ -2173,6 +2195,31 @@ export declare const LnurlAuthRequestDetails: Readonly<{
2173
2195
  */
2174
2196
  defaults: () => Partial<LnurlAuthRequestDetails>;
2175
2197
  }>;
2198
+ /**
2199
+ * LNURL error details
2200
+ */
2201
+ export type LnurlErrorDetails = {
2202
+ reason: string;
2203
+ };
2204
+ /**
2205
+ * Generated factory for {@link LnurlErrorDetails} record objects.
2206
+ */
2207
+ export declare const LnurlErrorDetails: Readonly<{
2208
+ /**
2209
+ * Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
2210
+ * in Rust, in the {@link breez_sdk_spark} crate.
2211
+ */
2212
+ create: (partial: Partial<LnurlErrorDetails> & Required<Omit<LnurlErrorDetails, never>>) => LnurlErrorDetails;
2213
+ /**
2214
+ * Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
2215
+ * in Rust, in the {@link breez_sdk_spark} crate.
2216
+ */
2217
+ new: (partial: Partial<LnurlErrorDetails> & Required<Omit<LnurlErrorDetails, never>>) => LnurlErrorDetails;
2218
+ /**
2219
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2220
+ */
2221
+ defaults: () => Partial<LnurlErrorDetails>;
2222
+ }>;
2176
2223
  /**
2177
2224
  * Represents the payment LNURL info
2178
2225
  */
@@ -2537,6 +2584,31 @@ export declare const LogEntry: Readonly<{
2537
2584
  */
2538
2585
  defaults: () => Partial<LogEntry>;
2539
2586
  }>;
2587
+ /**
2588
+ * FFI-safe representation of a 32-byte message digest for ECDSA signing
2589
+ */
2590
+ export type MessageBytes = {
2591
+ bytes: ArrayBuffer;
2592
+ };
2593
+ /**
2594
+ * Generated factory for {@link MessageBytes} record objects.
2595
+ */
2596
+ export declare const MessageBytes: Readonly<{
2597
+ /**
2598
+ * Create a frozen instance of {@link MessageBytes}, with defaults specified
2599
+ * in Rust, in the {@link breez_sdk_spark} crate.
2600
+ */
2601
+ create: (partial: Partial<MessageBytes> & Required<Omit<MessageBytes, never>>) => MessageBytes;
2602
+ /**
2603
+ * Create a frozen instance of {@link MessageBytes}, with defaults specified
2604
+ * in Rust, in the {@link breez_sdk_spark} crate.
2605
+ */
2606
+ new: (partial: Partial<MessageBytes> & Required<Omit<MessageBytes, never>>) => MessageBytes;
2607
+ /**
2608
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2609
+ */
2610
+ defaults: () => Partial<MessageBytes>;
2611
+ }>;
2540
2612
  export type MessageSuccessActionData = {
2541
2613
  message: string;
2542
2614
  };
@@ -5554,6 +5626,85 @@ export declare enum KeySetType {
5554
5626
  WrappedSegwit = 3,
5555
5627
  Legacy = 4
5556
5628
  }
5629
+ export declare enum LnurlCallbackStatus_Tags {
5630
+ Ok = "Ok",
5631
+ ErrorStatus = "ErrorStatus"
5632
+ }
5633
+ /**
5634
+ * The response from a LNURL-auth callback, indicating success or failure.
5635
+ */
5636
+ export declare const LnurlCallbackStatus: Readonly<{
5637
+ instanceOf: (obj: any) => obj is LnurlCallbackStatus;
5638
+ Ok: {
5639
+ new (): {
5640
+ readonly tag: LnurlCallbackStatus_Tags.Ok;
5641
+ /**
5642
+ * @private
5643
+ * This field is private and should not be used, use `tag` instead.
5644
+ */
5645
+ readonly [uniffiTypeNameSymbol]: "LnurlCallbackStatus";
5646
+ };
5647
+ "new"(): {
5648
+ readonly tag: LnurlCallbackStatus_Tags.Ok;
5649
+ /**
5650
+ * @private
5651
+ * This field is private and should not be used, use `tag` instead.
5652
+ */
5653
+ readonly [uniffiTypeNameSymbol]: "LnurlCallbackStatus";
5654
+ };
5655
+ instanceOf(obj: any): obj is {
5656
+ readonly tag: LnurlCallbackStatus_Tags.Ok;
5657
+ /**
5658
+ * @private
5659
+ * This field is private and should not be used, use `tag` instead.
5660
+ */
5661
+ readonly [uniffiTypeNameSymbol]: "LnurlCallbackStatus";
5662
+ };
5663
+ };
5664
+ ErrorStatus: {
5665
+ new (inner: {
5666
+ errorDetails: LnurlErrorDetails;
5667
+ }): {
5668
+ readonly tag: LnurlCallbackStatus_Tags.ErrorStatus;
5669
+ readonly inner: Readonly<{
5670
+ errorDetails: LnurlErrorDetails;
5671
+ }>;
5672
+ /**
5673
+ * @private
5674
+ * This field is private and should not be used, use `tag` instead.
5675
+ */
5676
+ readonly [uniffiTypeNameSymbol]: "LnurlCallbackStatus";
5677
+ };
5678
+ "new"(inner: {
5679
+ errorDetails: LnurlErrorDetails;
5680
+ }): {
5681
+ readonly tag: LnurlCallbackStatus_Tags.ErrorStatus;
5682
+ readonly inner: Readonly<{
5683
+ errorDetails: LnurlErrorDetails;
5684
+ }>;
5685
+ /**
5686
+ * @private
5687
+ * This field is private and should not be used, use `tag` instead.
5688
+ */
5689
+ readonly [uniffiTypeNameSymbol]: "LnurlCallbackStatus";
5690
+ };
5691
+ instanceOf(obj: any): obj is {
5692
+ readonly tag: LnurlCallbackStatus_Tags.ErrorStatus;
5693
+ readonly inner: Readonly<{
5694
+ errorDetails: LnurlErrorDetails;
5695
+ }>;
5696
+ /**
5697
+ * @private
5698
+ * This field is private and should not be used, use `tag` instead.
5699
+ */
5700
+ readonly [uniffiTypeNameSymbol]: "LnurlCallbackStatus";
5701
+ };
5702
+ };
5703
+ }>;
5704
+ /**
5705
+ * The response from a LNURL-auth callback, indicating success or failure.
5706
+ */
5707
+ export type LnurlCallbackStatus = InstanceType<(typeof LnurlCallbackStatus)[keyof Omit<typeof LnurlCallbackStatus, 'instanceOf'>]>;
5557
5708
  export declare enum MaxFee_Tags {
5558
5709
  Fixed = "Fixed",
5559
5710
  Rate = "Rate",
@@ -10871,6 +11022,58 @@ export interface BreezSdkInterface {
10871
11022
  listUnclaimedDeposits(request: ListUnclaimedDepositsRequest, asyncOpts_?: {
10872
11023
  signal: AbortSignal;
10873
11024
  }): Promise<ListUnclaimedDepositsResponse>;
11025
+ /**
11026
+ * Performs LNURL-auth with the service.
11027
+ *
11028
+ * This method implements the LNURL-auth protocol as specified in LUD-04 and LUD-05.
11029
+ * It derives a domain-specific linking key, signs the challenge, and sends the
11030
+ * authentication request to the service.
11031
+ *
11032
+ * # Arguments
11033
+ *
11034
+ * * `request_data` - The parsed LNURL-auth request details obtained from [`parse`]
11035
+ *
11036
+ * # Returns
11037
+ *
11038
+ * * `Ok(LnurlCallbackStatus::Ok)` - Authentication was successful
11039
+ * * `Ok(LnurlCallbackStatus::ErrorStatus{reason})` - Service returned an error
11040
+ * * `Err(SdkError)` - An error occurred during the authentication process
11041
+ *
11042
+ * # Example
11043
+ *
11044
+ * ```rust,no_run
11045
+ * # use breez_sdk_spark::{BreezSdk, InputType};
11046
+ * # async fn example(sdk: BreezSdk) -> Result<(), Box<dyn std::error::Error>> {
11047
+ * // 1. Parse the LNURL-auth string
11048
+ * let input = sdk.parse("lnurl1...").await?;
11049
+ * let auth_request = match input {
11050
+ * InputType::LnurlAuth(data) => data,
11051
+ * _ => return Err("Not an auth request".into()),
11052
+ * };
11053
+ *
11054
+ * // 2. Show user the domain and get confirmation
11055
+ * println!("Authenticate with {}?", auth_request.domain);
11056
+ *
11057
+ * // 3. Perform authentication
11058
+ * let status = sdk.lnurl_auth(auth_request).await?;
11059
+ * match status {
11060
+ * breez_sdk_spark::LnurlCallbackStatus::Ok => println!("Success!"),
11061
+ * breez_sdk_spark::LnurlCallbackStatus::ErrorStatus { error_details } => {
11062
+ * println!("Error: {}", error_details.reason)
11063
+ * }
11064
+ * }
11065
+ * # Ok(())
11066
+ * # }
11067
+ * ```
11068
+ *
11069
+ * # See Also
11070
+ *
11071
+ * * LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
11072
+ * * LUD-05: <https://github.com/lnurl/luds/blob/luds/05.md>
11073
+ */
11074
+ lnurlAuth(requestData: LnurlAuthRequestDetails, asyncOpts_?: {
11075
+ signal: AbortSignal;
11076
+ }): Promise<LnurlCallbackStatus>;
10874
11077
  lnurlPay(request: LnurlPayRequest, asyncOpts_?: {
10875
11078
  signal: AbortSignal;
10876
11079
  }): Promise<LnurlPayResponse>;
@@ -11122,6 +11325,58 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
11122
11325
  listUnclaimedDeposits(request: ListUnclaimedDepositsRequest, asyncOpts_?: {
11123
11326
  signal: AbortSignal;
11124
11327
  }): Promise<ListUnclaimedDepositsResponse>;
11328
+ /**
11329
+ * Performs LNURL-auth with the service.
11330
+ *
11331
+ * This method implements the LNURL-auth protocol as specified in LUD-04 and LUD-05.
11332
+ * It derives a domain-specific linking key, signs the challenge, and sends the
11333
+ * authentication request to the service.
11334
+ *
11335
+ * # Arguments
11336
+ *
11337
+ * * `request_data` - The parsed LNURL-auth request details obtained from [`parse`]
11338
+ *
11339
+ * # Returns
11340
+ *
11341
+ * * `Ok(LnurlCallbackStatus::Ok)` - Authentication was successful
11342
+ * * `Ok(LnurlCallbackStatus::ErrorStatus{reason})` - Service returned an error
11343
+ * * `Err(SdkError)` - An error occurred during the authentication process
11344
+ *
11345
+ * # Example
11346
+ *
11347
+ * ```rust,no_run
11348
+ * # use breez_sdk_spark::{BreezSdk, InputType};
11349
+ * # async fn example(sdk: BreezSdk) -> Result<(), Box<dyn std::error::Error>> {
11350
+ * // 1. Parse the LNURL-auth string
11351
+ * let input = sdk.parse("lnurl1...").await?;
11352
+ * let auth_request = match input {
11353
+ * InputType::LnurlAuth(data) => data,
11354
+ * _ => return Err("Not an auth request".into()),
11355
+ * };
11356
+ *
11357
+ * // 2. Show user the domain and get confirmation
11358
+ * println!("Authenticate with {}?", auth_request.domain);
11359
+ *
11360
+ * // 3. Perform authentication
11361
+ * let status = sdk.lnurl_auth(auth_request).await?;
11362
+ * match status {
11363
+ * breez_sdk_spark::LnurlCallbackStatus::Ok => println!("Success!"),
11364
+ * breez_sdk_spark::LnurlCallbackStatus::ErrorStatus { error_details } => {
11365
+ * println!("Error: {}", error_details.reason)
11366
+ * }
11367
+ * }
11368
+ * # Ok(())
11369
+ * # }
11370
+ * ```
11371
+ *
11372
+ * # See Also
11373
+ *
11374
+ * * LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
11375
+ * * LUD-05: <https://github.com/lnurl/luds/blob/luds/05.md>
11376
+ */
11377
+ lnurlAuth(requestData: LnurlAuthRequestDetails, asyncOpts_?: {
11378
+ signal: AbortSignal;
11379
+ }): Promise<LnurlCallbackStatus>;
11125
11380
  lnurlPay(request: LnurlPayRequest, asyncOpts_?: {
11126
11381
  signal: AbortSignal;
11127
11382
  }): Promise<LnurlPayResponse>;
@@ -11265,27 +11520,31 @@ export interface ExternalSigner {
11265
11520
  /**
11266
11521
  * Signs a message using ECDSA at the given derivation path.
11267
11522
  *
11523
+ * The message should be a 32-byte digest (typically a hash of the original data).
11524
+ *
11268
11525
  * # Arguments
11269
- * * `message` - The message to sign
11526
+ * * `message` - The 32-byte message digest to sign
11270
11527
  * * `path` - BIP32 derivation path as a string
11271
11528
  *
11272
11529
  * # Returns
11273
11530
  * 64-byte compact ECDSA signature, or a `SignerError`
11274
11531
  */
11275
- signEcdsa(message: ArrayBuffer, path: string, asyncOpts_?: {
11532
+ signEcdsa(message: MessageBytes, path: string, asyncOpts_?: {
11276
11533
  signal: AbortSignal;
11277
11534
  }): Promise<EcdsaSignatureBytes>;
11278
11535
  /**
11279
11536
  * Signs a message using recoverable ECDSA at the given derivation path.
11280
11537
  *
11538
+ * The message should be a 32-byte digest (typically a hash of the original data).
11539
+ *
11281
11540
  * # Arguments
11282
- * * `message` - The message to sign (will be double-SHA256 hashed)
11541
+ * * `message` - The 32-byte message digest to sign
11283
11542
  * * `path` - BIP32 derivation path as a string
11284
11543
  *
11285
11544
  * # Returns
11286
11545
  * 65 bytes: recovery ID (31 + `recovery_id`) + 64-byte signature, or a `SignerError`
11287
11546
  */
11288
- signEcdsaRecoverable(message: ArrayBuffer, path: string, asyncOpts_?: {
11547
+ signEcdsaRecoverable(message: MessageBytes, path: string, asyncOpts_?: {
11289
11548
  signal: AbortSignal;
11290
11549
  }): Promise<RecoverableEcdsaSignatureBytes>;
11291
11550
  /**
@@ -11327,6 +11586,19 @@ export interface ExternalSigner {
11327
11586
  signHashSchnorr(hash: ArrayBuffer, path: string, asyncOpts_?: {
11328
11587
  signal: AbortSignal;
11329
11588
  }): Promise<SchnorrSignatureBytes>;
11589
+ /**
11590
+ * HMAC-SHA256 of a message at the given derivation path.
11591
+ *
11592
+ * # Arguments
11593
+ * * `message` - The message to hash
11594
+ * * `path` - BIP32 derivation path as a string
11595
+ *
11596
+ * # Returns
11597
+ * 32-byte HMAC-SHA256, or a `SignerError`
11598
+ */
11599
+ hmacSha256(message: ArrayBuffer, path: string, asyncOpts_?: {
11600
+ signal: AbortSignal;
11601
+ }): Promise<HashedMessageBytes>;
11330
11602
  /**
11331
11603
  * Generates Frost signing commitments for multi-party signing.
11332
11604
  *
@@ -11507,27 +11779,31 @@ export declare class ExternalSignerImpl extends UniffiAbstractObject implements
11507
11779
  /**
11508
11780
  * Signs a message using ECDSA at the given derivation path.
11509
11781
  *
11782
+ * The message should be a 32-byte digest (typically a hash of the original data).
11783
+ *
11510
11784
  * # Arguments
11511
- * * `message` - The message to sign
11785
+ * * `message` - The 32-byte message digest to sign
11512
11786
  * * `path` - BIP32 derivation path as a string
11513
11787
  *
11514
11788
  * # Returns
11515
11789
  * 64-byte compact ECDSA signature, or a `SignerError`
11516
11790
  */
11517
- signEcdsa(message: ArrayBuffer, path: string, asyncOpts_?: {
11791
+ signEcdsa(message: MessageBytes, path: string, asyncOpts_?: {
11518
11792
  signal: AbortSignal;
11519
11793
  }): Promise<EcdsaSignatureBytes>;
11520
11794
  /**
11521
11795
  * Signs a message using recoverable ECDSA at the given derivation path.
11522
11796
  *
11797
+ * The message should be a 32-byte digest (typically a hash of the original data).
11798
+ *
11523
11799
  * # Arguments
11524
- * * `message` - The message to sign (will be double-SHA256 hashed)
11800
+ * * `message` - The 32-byte message digest to sign
11525
11801
  * * `path` - BIP32 derivation path as a string
11526
11802
  *
11527
11803
  * # Returns
11528
11804
  * 65 bytes: recovery ID (31 + `recovery_id`) + 64-byte signature, or a `SignerError`
11529
11805
  */
11530
- signEcdsaRecoverable(message: ArrayBuffer, path: string, asyncOpts_?: {
11806
+ signEcdsaRecoverable(message: MessageBytes, path: string, asyncOpts_?: {
11531
11807
  signal: AbortSignal;
11532
11808
  }): Promise<RecoverableEcdsaSignatureBytes>;
11533
11809
  /**
@@ -11569,6 +11845,19 @@ export declare class ExternalSignerImpl extends UniffiAbstractObject implements
11569
11845
  signHashSchnorr(hash: ArrayBuffer, path: string, asyncOpts_?: {
11570
11846
  signal: AbortSignal;
11571
11847
  }): Promise<SchnorrSignatureBytes>;
11848
+ /**
11849
+ * HMAC-SHA256 of a message at the given derivation path.
11850
+ *
11851
+ * # Arguments
11852
+ * * `message` - The message to hash
11853
+ * * `path` - BIP32 derivation path as a string
11854
+ *
11855
+ * # Returns
11856
+ * 32-byte HMAC-SHA256, or a `SignerError`
11857
+ */
11858
+ hmacSha256(message: ArrayBuffer, path: string, asyncOpts_?: {
11859
+ signal: AbortSignal;
11860
+ }): Promise<HashedMessageBytes>;
11572
11861
  /**
11573
11862
  * Generates Frost signing commitments for multi-party signing.
11574
11863
  *
@@ -13172,6 +13461,13 @@ declare const _default: Readonly<{
13172
13461
  lift(value: UniffiByteArray): GetTokensMetadataResponse;
13173
13462
  lower(value: GetTokensMetadataResponse): UniffiByteArray;
13174
13463
  };
13464
+ FfiConverterTypeHashedMessageBytes: {
13465
+ read(from: RustBuffer): HashedMessageBytes;
13466
+ write(value: HashedMessageBytes, into: RustBuffer): void;
13467
+ allocationSize(value: HashedMessageBytes): number;
13468
+ lift(value: UniffiByteArray): HashedMessageBytes;
13469
+ lower(value: HashedMessageBytes): UniffiByteArray;
13470
+ };
13175
13471
  FfiConverterTypeIdentifierCommitmentPair: {
13176
13472
  read(from: RustBuffer): IdentifierCommitmentPair;
13177
13473
  write(value: IdentifierCommitmentPair, into: RustBuffer): void;
@@ -13284,6 +13580,20 @@ declare const _default: Readonly<{
13284
13580
  lift(value: UniffiByteArray): LnurlAuthRequestDetails;
13285
13581
  lower(value: LnurlAuthRequestDetails): UniffiByteArray;
13286
13582
  };
13583
+ FfiConverterTypeLnurlCallbackStatus: {
13584
+ read(from: RustBuffer): LnurlCallbackStatus;
13585
+ write(value: LnurlCallbackStatus, into: RustBuffer): void;
13586
+ allocationSize(value: LnurlCallbackStatus): number;
13587
+ lift(value: UniffiByteArray): LnurlCallbackStatus;
13588
+ lower(value: LnurlCallbackStatus): UniffiByteArray;
13589
+ };
13590
+ FfiConverterTypeLnurlErrorDetails: {
13591
+ read(from: RustBuffer): LnurlErrorDetails;
13592
+ write(value: LnurlErrorDetails, into: RustBuffer): void;
13593
+ allocationSize(value: LnurlErrorDetails): number;
13594
+ lift(value: UniffiByteArray): LnurlErrorDetails;
13595
+ lower(value: LnurlErrorDetails): UniffiByteArray;
13596
+ };
13287
13597
  FfiConverterTypeLnurlPayInfo: {
13288
13598
  read(from: RustBuffer): LnurlPayInfo;
13289
13599
  write(value: LnurlPayInfo, into: RustBuffer): void;
@@ -13375,6 +13685,13 @@ declare const _default: Readonly<{
13375
13685
  lift(value: UniffiByteArray): MaxFee;
13376
13686
  lower(value: MaxFee): UniffiByteArray;
13377
13687
  };
13688
+ FfiConverterTypeMessageBytes: {
13689
+ read(from: RustBuffer): MessageBytes;
13690
+ write(value: MessageBytes, into: RustBuffer): void;
13691
+ allocationSize(value: MessageBytes): number;
13692
+ lift(value: UniffiByteArray): MessageBytes;
13693
+ lower(value: MessageBytes): UniffiByteArray;
13694
+ };
13378
13695
  FfiConverterTypeMessageSuccessActionData: {
13379
13696
  read(from: RustBuffer): MessageSuccessActionData;
13380
13697
  write(value: MessageSuccessActionData, into: RustBuffer): void;