@breeztech/breez-sdk-spark 0.15.1 → 0.17.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/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +604 -237
- package/bundler/breez_sdk_spark_wasm.js +1 -1
- package/bundler/breez_sdk_spark_wasm_bg.js +729 -434
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +63 -49
- package/bundler/storage/index.js +356 -34
- package/deno/breez_sdk_spark_wasm.d.ts +604 -237
- package/deno/breez_sdk_spark_wasm.js +729 -434
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +63 -49
- package/nodejs/breez_sdk_spark_wasm.d.ts +604 -237
- package/nodejs/breez_sdk_spark_wasm.js +741 -441
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +63 -49
- package/nodejs/index.js +10 -10
- package/nodejs/index.mjs +13 -8
- package/nodejs/mysql-session-store/errors.cjs +13 -0
- package/nodejs/{mysql-session-manager → mysql-session-store}/index.cjs +24 -21
- package/nodejs/{mysql-session-manager → mysql-session-store}/migrations.cjs +17 -11
- package/nodejs/mysql-session-store/package.json +9 -0
- package/nodejs/mysql-storage/index.cjs +358 -125
- package/nodejs/mysql-storage/migrations.cjs +67 -2
- package/nodejs/mysql-token-store/index.cjs +99 -79
- package/nodejs/mysql-token-store/migrations.cjs +59 -2
- package/nodejs/mysql-tree-store/index.cjs +15 -9
- package/nodejs/mysql-tree-store/migrations.cjs +16 -2
- package/nodejs/package.json +2 -2
- package/nodejs/postgres-session-store/errors.cjs +13 -0
- package/nodejs/{postgres-session-manager → postgres-session-store}/index.cjs +23 -23
- package/nodejs/{postgres-session-manager → postgres-session-store}/migrations.cjs +14 -14
- package/nodejs/postgres-session-store/package.json +9 -0
- package/nodejs/postgres-storage/index.cjs +296 -119
- package/nodejs/postgres-storage/migrations.cjs +51 -0
- package/nodejs/postgres-token-store/index.cjs +89 -64
- package/nodejs/postgres-token-store/migrations.cjs +44 -0
- package/nodejs/storage/index.cjs +285 -125
- package/nodejs/storage/migrations.cjs +47 -0
- package/package.json +6 -1
- package/ssr/index.js +57 -28
- package/web/breez_sdk_spark_wasm.d.ts +667 -286
- package/web/breez_sdk_spark_wasm.js +729 -434
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +63 -49
- package/web/passkey-prf-provider/index.d.ts +203 -0
- package/web/passkey-prf-provider/index.js +733 -0
- package/web/storage/index.js +356 -34
- package/nodejs/mysql-session-manager/errors.cjs +0 -13
- package/nodejs/mysql-session-manager/package.json +0 -9
- package/nodejs/postgres-session-manager/errors.cjs +0 -13
- package/nodejs/postgres-session-manager/package.json +0 -9
|
@@ -128,6 +128,20 @@ export interface TokenStore {
|
|
|
128
128
|
now: () => Promise<number>;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/**
|
|
132
|
+
* A passkey credential from `register` or `signIn`. `credentialId` is
|
|
133
|
+
* always set. The attestation fields (`userId`, `aaguid`,
|
|
134
|
+
* `backupEligible`) are populated on registration and null on sign-in
|
|
135
|
+
* (an assertion carries no attestation). AAGUID is unverified: a
|
|
136
|
+
* display hint only, never a trust signal.
|
|
137
|
+
*/
|
|
138
|
+
export interface PasskeyCredential {
|
|
139
|
+
credentialId: Uint8Array;
|
|
140
|
+
userId?: Uint8Array;
|
|
141
|
+
aaguid?: Uint8Array;
|
|
142
|
+
backupEligible?: boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
131
145
|
/**
|
|
132
146
|
* A wallet derived from a passkey.
|
|
133
147
|
*/
|
|
@@ -206,78 +220,171 @@ export interface PostgresStorageConfig {
|
|
|
206
220
|
runMigration?: boolean;
|
|
207
221
|
}
|
|
208
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Configuration for `PasskeyClient`.
|
|
225
|
+
*/
|
|
226
|
+
export interface PasskeyConfig {
|
|
227
|
+
/**
|
|
228
|
+
* Wallet label for `register` / `signIn` when no label is given.
|
|
229
|
+
* Unset falls back to the internal default `\"Default\"`.
|
|
230
|
+
*/
|
|
231
|
+
defaultLabel?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Relying Party and user identity for the built-in provider on the
|
|
234
|
+
* zero-config path.
|
|
235
|
+
*/
|
|
236
|
+
providerOptions?: PasskeyProviderOptions;
|
|
237
|
+
}
|
|
238
|
+
|
|
209
239
|
/**
|
|
210
240
|
* Controls whether MySQL migrations create database-enforced foreign keys.
|
|
211
241
|
*/
|
|
212
242
|
export type MysqlForeignKeyMode = "Enforced" | "Disabled";
|
|
213
243
|
|
|
214
244
|
/**
|
|
215
|
-
* Interface for
|
|
216
|
-
*
|
|
217
|
-
* Implement this interface to provide passkey PRF functionality for seedless wallet restore.
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* ```typescript
|
|
221
|
-
* class BrowserPasskeyPrfProvider implements PasskeyPrfProvider {
|
|
222
|
-
* async derivePrfSeed(salt: string): Promise<Uint8Array> {
|
|
223
|
-
* const credential = await navigator.credentials.get({
|
|
224
|
-
* publicKey: {
|
|
225
|
-
* challenge: new Uint8Array(32),
|
|
226
|
-
* rpId: window.location.hostname,
|
|
227
|
-
* allowCredentials: [], // or specific credential IDs
|
|
228
|
-
* extensions: {
|
|
229
|
-
* prf: { eval: { first: new TextEncoder().encode(salt) } }
|
|
230
|
-
* }
|
|
231
|
-
* }
|
|
232
|
-
* });
|
|
233
|
-
* const results = credential.getClientExtensionResults();
|
|
234
|
-
* return new Uint8Array(results.prf.results.first);
|
|
235
|
-
* }
|
|
245
|
+
* Interface for PRF (Pseudo-Random Function) operations backing seedless
|
|
246
|
+
* wallet restore.
|
|
236
247
|
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
* ```
|
|
248
|
+
* Implemented by the built-in `PasskeyProvider` (browser passkey via the
|
|
249
|
+
* WebAuthn PRF extension); also implementable directly for custom
|
|
250
|
+
* deterministic sources (YubiKey HMAC challenge, FIDO2 hmac-secret, on-disk
|
|
251
|
+
* key material, hardware HSMs).
|
|
242
252
|
*/
|
|
243
|
-
export interface
|
|
253
|
+
export interface PrfProvider {
|
|
244
254
|
/**
|
|
245
|
-
* Derive
|
|
255
|
+
* Derive 32-byte PRF outputs for one or more salts, in input order.
|
|
256
|
+
* Implementations with bulk capability (WebAuthn dual-salt via
|
|
257
|
+
* `prf.eval.first` + `prf.eval.second`) pack two salts per ceremony
|
|
258
|
+
* where supported; others loop the single-salt path. `options` carries
|
|
259
|
+
* per-call ceremony shapers that built-in providers forward to the OS
|
|
260
|
+
* call and custom providers may ignore.
|
|
246
261
|
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* @throws If authentication fails or PRF is not supported
|
|
262
|
+
* @param salts - Salt strings in caller order
|
|
263
|
+
* @param options - Optional per-call overrides
|
|
264
|
+
* @returns Promise of the 32-byte outputs in input order plus the
|
|
265
|
+
* credential ID observed in the same assertion (`null` when the
|
|
266
|
+
* provider surfaces none, e.g. sources without an OS picker)
|
|
253
267
|
*/
|
|
254
|
-
|
|
268
|
+
deriveSeeds(salts: string[], options?: DeriveSeedOptions): Promise<DeriveSeedsResult>;
|
|
255
269
|
|
|
256
270
|
/**
|
|
257
|
-
*
|
|
271
|
+
* Optional explicit registration. Platform passkey providers (browser
|
|
272
|
+
* WebAuthn, iOS / Android) implement this to drive the OS create
|
|
273
|
+
* ceremony and return credential metadata (`credentialId`, `userId`,
|
|
274
|
+
* optional `aaguid` / `backupEligible`) callers need for
|
|
275
|
+
* `excludeCredentials` bookkeeping and server-side correlation. Custom
|
|
276
|
+
* providers without a creation step can omit it.
|
|
258
277
|
*
|
|
259
|
-
*
|
|
278
|
+
* `excludeCredentials` lists already-registered IDs; a match raises
|
|
279
|
+
* `PasskeyAlreadyExistsError`.
|
|
260
280
|
*
|
|
261
|
-
* @
|
|
281
|
+
* @throws `PasskeyAlreadyExistsError` when an entry in
|
|
282
|
+
* `excludeCredentials` matches a credential already on the device.
|
|
283
|
+
*/
|
|
284
|
+
createPasskey?(excludeCredentials: Uint8Array[]): Promise<PasskeyCredential>;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Whether this provider can produce PRF outputs on the current
|
|
288
|
+
* device. Hosts gate UX on the result.
|
|
262
289
|
*/
|
|
263
|
-
|
|
290
|
+
isSupported(): Promise<boolean>;
|
|
264
291
|
}
|
|
265
292
|
|
|
266
293
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* Used by `Passkey.listLabels` and `Passkey.storeLabel`.
|
|
294
|
+
* Per-call options passed as the second argument of
|
|
295
|
+
* {@link PrfProvider.deriveSeeds}.
|
|
270
296
|
*/
|
|
271
|
-
export interface
|
|
297
|
+
export interface DeriveSeedOptions {
|
|
272
298
|
/**
|
|
273
|
-
*
|
|
274
|
-
*
|
|
299
|
+
* Credential IDs the assertion is restricted to, for reauthenticating
|
|
300
|
+
* a known user without an account picker. Empty or unset lets the
|
|
301
|
+
* provider's default apply.
|
|
275
302
|
*/
|
|
276
|
-
|
|
303
|
+
allowCredentials?: Uint8Array[];
|
|
277
304
|
/**
|
|
278
|
-
*
|
|
305
|
+
* Fast-fail when no local credential is available. On the web this maps
|
|
306
|
+
* to WebAuthn `mediation: 'immediate'`: `true` opts in where the browser
|
|
307
|
+
* advertises support, `false` uses the standard picker. Unset uses the
|
|
308
|
+
* provider default.
|
|
279
309
|
*/
|
|
280
|
-
|
|
310
|
+
preferImmediatelyAvailableCredentials?: boolean;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Returned by {@link PrfProvider.deriveSeeds}: the derived 32-byte outputs
|
|
315
|
+
* in input order plus the credential ID observed in the same assertion.
|
|
316
|
+
* `credentialId` is `null` when the provider does not surface one (custom
|
|
317
|
+
* deterministic sources without an OS picker).
|
|
318
|
+
*/
|
|
319
|
+
export interface DeriveSeedsResult {
|
|
320
|
+
seeds: Uint8Array[];
|
|
321
|
+
credentialId?: Uint8Array | null;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* One-shot capability + configuration probe returned by
|
|
326
|
+
* `PasskeyClient.checkAvailability`. Collapses `isSupported` +
|
|
327
|
+
* `checkDomainAssociation` into one tagged value hosts branch on.
|
|
328
|
+
*/
|
|
329
|
+
export type PasskeyAvailability = { type: "available" } | { type: "prfUnsupported" } | { type: "notAssociated"; source: string; reason: string } | { type: "skipped"; reason: string };
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Relying Party and user identity for the built-in provider on the
|
|
333
|
+
* zero-config path (ignored when you inject your own provider).
|
|
334
|
+
*/
|
|
335
|
+
export interface PasskeyProviderOptions {
|
|
336
|
+
/**
|
|
337
|
+
* Relying Party ID. Unset uses the Breez shared RP.
|
|
338
|
+
*/
|
|
339
|
+
rpId?: string;
|
|
340
|
+
/**
|
|
341
|
+
* Relying Party name. Unset uses the SDK default (`\"Breez\"`).
|
|
342
|
+
*/
|
|
343
|
+
rpName?: string;
|
|
344
|
+
/**
|
|
345
|
+
* `user.name`: the account identifier the picker shows beneath the
|
|
346
|
+
* display name (e.g. `john@doe.com`). Unset uses `rpName`.
|
|
347
|
+
*/
|
|
348
|
+
userName?: string;
|
|
349
|
+
/**
|
|
350
|
+
* `user.displayName`: the human-friendly name shown most
|
|
351
|
+
* prominently (e.g. `John Doe`). Unset uses `userName`.
|
|
352
|
+
*/
|
|
353
|
+
userDisplayName?: string;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Request shape for `PasskeyClient.register`.
|
|
358
|
+
*/
|
|
359
|
+
export interface RegisterRequest {
|
|
360
|
+
label?: string;
|
|
361
|
+
excludeCredentials?: Uint8Array[];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Request shape for `PasskeyClient.signIn`.
|
|
366
|
+
*/
|
|
367
|
+
export interface SignInRequest {
|
|
368
|
+
label?: string;
|
|
369
|
+
allowCredentials?: Uint8Array[];
|
|
370
|
+
preferImmediatelyAvailableCredentials?: boolean;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Response shape for `PasskeyClient.register`.
|
|
375
|
+
*/
|
|
376
|
+
export interface RegisterResponse {
|
|
377
|
+
wallet: Wallet;
|
|
378
|
+
credential?: PasskeyCredential;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Response shape for `PasskeyClient.signIn`.
|
|
383
|
+
*/
|
|
384
|
+
export interface SignInResponse {
|
|
385
|
+
wallet: Wallet;
|
|
386
|
+
labels: string[];
|
|
387
|
+
credential?: PasskeyCredential;
|
|
281
388
|
}
|
|
282
389
|
|
|
283
390
|
/**
|
|
@@ -330,6 +437,10 @@ export interface AesSuccessActionDataDecrypted {
|
|
|
330
437
|
plaintext: string;
|
|
331
438
|
}
|
|
332
439
|
|
|
440
|
+
export interface AuthorizeTransferRequest {
|
|
441
|
+
transfereePubkey: string;
|
|
442
|
+
}
|
|
443
|
+
|
|
333
444
|
export interface Bip21Details {
|
|
334
445
|
amountSat?: number;
|
|
335
446
|
assetId?: string;
|
|
@@ -465,6 +576,11 @@ export interface ClaimHtlcPaymentResponse {
|
|
|
465
576
|
payment: Payment;
|
|
466
577
|
}
|
|
467
578
|
|
|
579
|
+
export interface ClaimTransferRequest {
|
|
580
|
+
authorization: TransferAuthorization;
|
|
581
|
+
description?: string;
|
|
582
|
+
}
|
|
583
|
+
|
|
468
584
|
export interface Config {
|
|
469
585
|
apiKey?: string;
|
|
470
586
|
network: Network;
|
|
@@ -489,6 +605,7 @@ export interface Config {
|
|
|
489
605
|
maxConcurrentClaims: number;
|
|
490
606
|
sparkConfig?: SparkConfig;
|
|
491
607
|
backgroundTasksEnabled: boolean;
|
|
608
|
+
crossChainConfig?: CrossChainConfig;
|
|
492
609
|
}
|
|
493
610
|
|
|
494
611
|
export interface ConnectRequest {
|
|
@@ -505,10 +622,23 @@ export interface Contact {
|
|
|
505
622
|
updatedAt: number;
|
|
506
623
|
}
|
|
507
624
|
|
|
625
|
+
export interface Conversion {
|
|
626
|
+
provider: ConversionProvider;
|
|
627
|
+
status: ConversionStatus;
|
|
628
|
+
from: ConversionSide;
|
|
629
|
+
to: ConversionSide;
|
|
630
|
+
amountAdjustment?: AmountAdjustmentReason;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export interface ConversionAsset {
|
|
634
|
+
ticker: string;
|
|
635
|
+
identifier?: string;
|
|
636
|
+
decimals: number;
|
|
637
|
+
}
|
|
638
|
+
|
|
508
639
|
export interface ConversionDetails {
|
|
509
640
|
status: ConversionStatus;
|
|
510
|
-
|
|
511
|
-
to?: ConversionStep;
|
|
641
|
+
conversions?: Conversion[];
|
|
512
642
|
}
|
|
513
643
|
|
|
514
644
|
export interface ConversionEstimate {
|
|
@@ -519,28 +649,17 @@ export interface ConversionEstimate {
|
|
|
519
649
|
amountAdjustment?: AmountAdjustmentReason;
|
|
520
650
|
}
|
|
521
651
|
|
|
522
|
-
export interface ConversionInfo {
|
|
523
|
-
poolId: string;
|
|
524
|
-
conversionId: string;
|
|
525
|
-
status: ConversionStatus;
|
|
526
|
-
fee?: string;
|
|
527
|
-
purpose?: ConversionPurpose;
|
|
528
|
-
amountAdjustment?: AmountAdjustmentReason;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
652
|
export interface ConversionOptions {
|
|
532
653
|
conversionType: ConversionType;
|
|
533
654
|
maxSlippageBps?: number;
|
|
534
655
|
completionTimeoutSecs?: number;
|
|
535
656
|
}
|
|
536
657
|
|
|
537
|
-
export interface
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
tokenMetadata?: TokenMetadata;
|
|
543
|
-
amountAdjustment?: AmountAdjustmentReason;
|
|
658
|
+
export interface ConversionSide {
|
|
659
|
+
chain: ConversionChain;
|
|
660
|
+
asset: ConversionAsset;
|
|
661
|
+
amount: string;
|
|
662
|
+
fee: string;
|
|
544
663
|
}
|
|
545
664
|
|
|
546
665
|
export interface CreateIssuerTokenRequest {
|
|
@@ -556,6 +675,30 @@ export interface Credentials {
|
|
|
556
675
|
password: string;
|
|
557
676
|
}
|
|
558
677
|
|
|
678
|
+
export interface CrossChainAddressDetails {
|
|
679
|
+
address: string;
|
|
680
|
+
addressFamily: CrossChainAddressFamily;
|
|
681
|
+
contractAddress?: string;
|
|
682
|
+
chainId?: number;
|
|
683
|
+
amount?: bigint;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
export interface CrossChainConfig {
|
|
687
|
+
defaultSlippageBps?: number;
|
|
688
|
+
defaultTargetOverpayBps?: number;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
export interface CrossChainRoutePair {
|
|
692
|
+
provider: CrossChainProvider;
|
|
693
|
+
chain: string;
|
|
694
|
+
chainId?: string;
|
|
695
|
+
asset: string;
|
|
696
|
+
contractAddress?: string;
|
|
697
|
+
decimals: number;
|
|
698
|
+
exactOutEligible: boolean;
|
|
699
|
+
supportedSources: SourceAsset[];
|
|
700
|
+
}
|
|
701
|
+
|
|
559
702
|
export interface CurrencyInfo {
|
|
560
703
|
name: string;
|
|
561
704
|
fractionSize: number;
|
|
@@ -584,20 +727,20 @@ export interface EventListener {
|
|
|
584
727
|
onEvent: (e: SdkEvent) => void;
|
|
585
728
|
}
|
|
586
729
|
|
|
587
|
-
export interface
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
selfSignature: ExternalFrostSignatureShare;
|
|
596
|
-
adaptorPublicKey?: number[];
|
|
730
|
+
export interface ExternalBreezSigner {
|
|
731
|
+
derivePublicKey(path: string): Promise<PublicKeyBytes>;
|
|
732
|
+
signEcdsa(message: MessageBytes, path: string): Promise<EcdsaSignatureBytes>;
|
|
733
|
+
signEcdsaRecoverable(message: MessageBytes, path: string): Promise<RecoverableEcdsaSignatureBytes>;
|
|
734
|
+
encryptEcies(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
735
|
+
decryptEcies(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
736
|
+
signHashSchnorr(hash: Uint8Array, path: string): Promise<SchnorrSignatureBytes>;
|
|
737
|
+
hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
|
|
597
738
|
}
|
|
598
739
|
|
|
599
|
-
export interface
|
|
600
|
-
|
|
740
|
+
export interface ExternalClaimLeafInput {
|
|
741
|
+
nodeId: ExternalTreeNodeId;
|
|
742
|
+
senderSignature: number[];
|
|
743
|
+
leafKeyCiphertext: number[];
|
|
601
744
|
}
|
|
602
745
|
|
|
603
746
|
export interface ExternalFrostCommitments {
|
|
@@ -606,6 +749,19 @@ export interface ExternalFrostCommitments {
|
|
|
606
749
|
noncesCiphertext: number[];
|
|
607
750
|
}
|
|
608
751
|
|
|
752
|
+
export interface ExternalFrostJob {
|
|
753
|
+
derivation: ExternalFrostDerivation;
|
|
754
|
+
sighash: number[];
|
|
755
|
+
verifyingKey: number[];
|
|
756
|
+
operatorCommitments: IdentifierCommitmentPair[];
|
|
757
|
+
adaptorPublicKey?: number[];
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
export interface ExternalFrostShareResult {
|
|
761
|
+
commitment: ExternalFrostCommitments;
|
|
762
|
+
signatureShare: ExternalFrostSignatureShare;
|
|
763
|
+
}
|
|
764
|
+
|
|
609
765
|
export interface ExternalFrostSignature {
|
|
610
766
|
bytes: number[];
|
|
611
767
|
}
|
|
@@ -624,47 +780,105 @@ export interface ExternalInputParser {
|
|
|
624
780
|
parserUrl: string;
|
|
625
781
|
}
|
|
626
782
|
|
|
627
|
-
export interface
|
|
628
|
-
|
|
783
|
+
export interface ExternalNewLeafKey {
|
|
784
|
+
nodeId: ExternalTreeNodeId;
|
|
785
|
+
newSigningPublicKey: number[];
|
|
629
786
|
}
|
|
630
787
|
|
|
631
|
-
export interface
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
share: ExternalScalar;
|
|
788
|
+
export interface ExternalOperatorPackage {
|
|
789
|
+
operatorIdentifier: ExternalIdentifier;
|
|
790
|
+
encryptedPackage: number[];
|
|
635
791
|
}
|
|
636
792
|
|
|
637
|
-
export interface
|
|
638
|
-
|
|
793
|
+
export interface ExternalOperatorRecipient {
|
|
794
|
+
id: number;
|
|
795
|
+
identifier: ExternalIdentifier;
|
|
639
796
|
publicKey: number[];
|
|
640
|
-
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export interface ExternalPrepareClaimRequest {
|
|
800
|
+
transferId: string;
|
|
801
|
+
senderIdentityPublicKey: number[];
|
|
802
|
+
leaves: ExternalClaimLeafInput[];
|
|
803
|
+
operatorRecipients: ExternalOperatorRecipient[];
|
|
804
|
+
threshold: number;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
export interface ExternalPrepareLightningReceiveRequest {
|
|
808
|
+
operatorRecipients: ExternalOperatorRecipient[];
|
|
809
|
+
threshold: number;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
export interface ExternalPrepareStaticDepositClaimRequest {
|
|
813
|
+
index: number;
|
|
814
|
+
userStatement: number[];
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
export interface ExternalPrepareStaticDepositRequest {
|
|
818
|
+
index: number;
|
|
819
|
+
sspPublicKey: number[];
|
|
820
|
+
frostJobs: ExternalFrostJob[];
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
export interface ExternalPrepareTokenTransactionRequest {
|
|
824
|
+
kind: ExternalTokenTransactionKind;
|
|
825
|
+
digest: number[];
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
export interface ExternalPrepareTransferRequest {
|
|
829
|
+
transferId: string;
|
|
830
|
+
receiverPublicKey: number[];
|
|
831
|
+
leaves: ExternalTransferLeafInput[];
|
|
832
|
+
operatorRecipients: ExternalOperatorRecipient[];
|
|
833
|
+
threshold: number;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
export interface ExternalPreparedClaim {
|
|
837
|
+
operatorPackages: ExternalOperatorPackage[];
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
export interface ExternalPreparedLightningReceive {
|
|
841
|
+
paymentHash: number[];
|
|
842
|
+
operatorPreimagePackages: ExternalOperatorPackage[];
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
export interface ExternalPreparedStaticDeposit {
|
|
846
|
+
exportedSecret: number[];
|
|
847
|
+
frostShares: ExternalFrostShareResult[];
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
export interface ExternalPreparedStaticDepositClaim {
|
|
851
|
+
depositSecretKey: SecretBytes;
|
|
852
|
+
userSignature: EcdsaSignatureBytes;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
export interface ExternalPreparedTokenTransaction {
|
|
856
|
+
signature: SchnorrSignatureBytes;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export interface ExternalPreparedTransfer {
|
|
860
|
+
operatorPackages: ExternalOperatorPackage[];
|
|
861
|
+
newLeafKeys: ExternalNewLeafKey[];
|
|
862
|
+
transferUserSignature: EcdsaSignatureBytes;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export interface ExternalSignSparkInvoiceRequest {
|
|
866
|
+
kind: ExternalSparkInvoiceKind;
|
|
867
|
+
invoiceHash: number[];
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
export interface ExternalSignStaticDepositRefundRequest {
|
|
871
|
+
index: number;
|
|
872
|
+
sighash: number[];
|
|
641
873
|
verifyingKey: number[];
|
|
642
|
-
|
|
874
|
+
nonceCommitment: ExternalFrostCommitments;
|
|
643
875
|
statechainCommitments: IdentifierCommitmentPair[];
|
|
644
|
-
|
|
876
|
+
statechainSignatures: IdentifierSignaturePair[];
|
|
877
|
+
statechainPublicKeys: IdentifierPublicKeyPair[];
|
|
645
878
|
}
|
|
646
879
|
|
|
647
|
-
export interface
|
|
648
|
-
|
|
649
|
-
derivePublicKey(path: string): Promise<PublicKeyBytes>;
|
|
650
|
-
signEcdsa(message: MessageBytes, path: string): Promise<EcdsaSignatureBytes>;
|
|
651
|
-
signEcdsaRecoverable(message: MessageBytes, path: string): Promise<RecoverableEcdsaSignatureBytes>;
|
|
652
|
-
encryptEcies(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
653
|
-
decryptEcies(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
654
|
-
signHashSchnorr(hash: Uint8Array, path: string): Promise<SchnorrSignatureBytes>;
|
|
655
|
-
generateRandomSigningCommitment(): Promise<ExternalFrostCommitments>;
|
|
656
|
-
getPublicKeyForNode(id: ExternalTreeNodeId): Promise<PublicKeyBytes>;
|
|
657
|
-
generateRandomSecret(): Promise<ExternalEncryptedSecret>;
|
|
658
|
-
staticDepositSecretEncrypted(index: number): Promise<ExternalSecretSource>;
|
|
659
|
-
staticDepositSecret(index: number): Promise<SecretBytes>;
|
|
660
|
-
staticDepositSigningKey(index: number): Promise<PublicKeyBytes>;
|
|
661
|
-
subtractSecrets(signingKey: ExternalSecretSource, newSigningKey: ExternalSecretSource): Promise<ExternalSecretSource>;
|
|
662
|
-
splitSecretWithProofs(secret: ExternalSecretToSplit, threshold: number, numShares: number): Promise<ExternalVerifiableSecretShare[]>;
|
|
663
|
-
encryptPrivateKeyForReceiver(privateKey: ExternalEncryptedSecret, receiverPublicKey: PublicKeyBytes): Promise<Uint8Array>;
|
|
664
|
-
publicKeyFromSecret(privateKey: ExternalSecretSource): Promise<PublicKeyBytes>;
|
|
665
|
-
signFrost(request: ExternalSignFrostRequest): Promise<ExternalFrostSignatureShare>;
|
|
666
|
-
aggregateFrost(request: ExternalAggregateFrostRequest): Promise<ExternalFrostSignature>;
|
|
667
|
-
hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
|
|
880
|
+
export interface ExternalSignedSparkInvoice {
|
|
881
|
+
signature: SchnorrSignatureBytes;
|
|
668
882
|
}
|
|
669
883
|
|
|
670
884
|
export interface ExternalSigningCommitments {
|
|
@@ -672,13 +886,42 @@ export interface ExternalSigningCommitments {
|
|
|
672
886
|
binding: number[];
|
|
673
887
|
}
|
|
674
888
|
|
|
675
|
-
export interface
|
|
676
|
-
|
|
889
|
+
export interface ExternalSparkSigner {
|
|
890
|
+
getIdentityPublicKey(): Promise<PublicKeyBytes>;
|
|
891
|
+
getPublicKeyForLeaf(leafId: ExternalTreeNodeId): Promise<PublicKeyBytes>;
|
|
892
|
+
getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
|
|
893
|
+
signAuthenticationChallenge(challenge: Uint8Array): Promise<EcdsaSignatureBytes>;
|
|
894
|
+
signMessage(message: Uint8Array): Promise<EcdsaSignatureBytes>;
|
|
895
|
+
signFrost(jobs: ExternalFrostJob[]): Promise<ExternalFrostShareResult[]>;
|
|
896
|
+
prepareTransfer(request: ExternalPrepareTransferRequest): Promise<ExternalPreparedTransfer>;
|
|
897
|
+
prepareClaim(request: ExternalPrepareClaimRequest): Promise<ExternalPreparedClaim>;
|
|
898
|
+
prepareLightningReceive(request: ExternalPrepareLightningReceiveRequest): Promise<ExternalPreparedLightningReceive>;
|
|
899
|
+
prepareStaticDeposit(request: ExternalPrepareStaticDepositRequest): Promise<ExternalPreparedStaticDeposit>;
|
|
900
|
+
startStaticDepositRefund(request: ExternalStartStaticDepositRefundRequest): Promise<ExternalStartedStaticDepositRefund>;
|
|
901
|
+
signStaticDepositRefund(request: ExternalSignStaticDepositRefundRequest): Promise<ExternalFrostSignature>;
|
|
902
|
+
signSparkInvoice(request: ExternalSignSparkInvoiceRequest): Promise<ExternalSignedSparkInvoice>;
|
|
903
|
+
prepareTokenTransaction(request: ExternalPrepareTokenTransactionRequest): Promise<ExternalPreparedTokenTransaction>;
|
|
904
|
+
prepareStaticDepositClaim(request: ExternalPrepareStaticDepositClaimRequest): Promise<ExternalPreparedStaticDepositClaim>;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export interface ExternalStartStaticDepositRefundRequest {
|
|
908
|
+
index: number;
|
|
909
|
+
userStatement: number[];
|
|
677
910
|
}
|
|
678
911
|
|
|
679
|
-
export interface
|
|
680
|
-
|
|
681
|
-
|
|
912
|
+
export interface ExternalStartedStaticDepositRefund {
|
|
913
|
+
signingPublicKey: number[];
|
|
914
|
+
nonceCommitment: ExternalFrostCommitments;
|
|
915
|
+
userSignature: EcdsaSignatureBytes;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
export interface ExternalTransferLeafInput {
|
|
919
|
+
nodeId: ExternalTreeNodeId;
|
|
920
|
+
newLeafId: ExternalTreeNodeId;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
export interface ExternalTreeNodeId {
|
|
924
|
+
id: string;
|
|
682
925
|
}
|
|
683
926
|
|
|
684
927
|
export interface FetchConversionLimitsRequest {
|
|
@@ -760,12 +1003,6 @@ export interface IncomingChange {
|
|
|
760
1003
|
oldState?: Record;
|
|
761
1004
|
}
|
|
762
1005
|
|
|
763
|
-
export interface KeySetConfig {
|
|
764
|
-
keySetType: KeySetType;
|
|
765
|
-
useAddressIndex: boolean;
|
|
766
|
-
accountNumber?: number;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
1006
|
export interface LeafOptimizationConfig {
|
|
770
1007
|
autoEnabled: boolean;
|
|
771
1008
|
multiplicity: number;
|
|
@@ -927,10 +1164,12 @@ export interface MintIssuerTokenRequest {
|
|
|
927
1164
|
amount: bigint;
|
|
928
1165
|
}
|
|
929
1166
|
|
|
930
|
-
export interface
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1167
|
+
export interface OptimizeLeavesRequest {
|
|
1168
|
+
mode: OptimizationMode;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
export interface OptimizeLeavesResponse {
|
|
1172
|
+
outcome: OptimizationOutcome;
|
|
934
1173
|
}
|
|
935
1174
|
|
|
936
1175
|
export interface OutgoingChange {
|
|
@@ -950,6 +1189,11 @@ export interface Payment {
|
|
|
950
1189
|
conversionDetails?: ConversionDetails;
|
|
951
1190
|
}
|
|
952
1191
|
|
|
1192
|
+
export interface PaymentIdUpdate {
|
|
1193
|
+
provisionalPaymentId: string;
|
|
1194
|
+
finalPaymentId: string;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
953
1197
|
export interface PaymentMetadata {
|
|
954
1198
|
parentPaymentId?: string;
|
|
955
1199
|
lnurlPayInfo?: LnurlPayInfo;
|
|
@@ -961,6 +1205,7 @@ export interface PaymentMetadata {
|
|
|
961
1205
|
|
|
962
1206
|
export interface PaymentObserver {
|
|
963
1207
|
beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
|
|
1208
|
+
afterSend: (updates: PaymentIdUpdate[]) => Promise<void>;
|
|
964
1209
|
}
|
|
965
1210
|
|
|
966
1211
|
export interface PaymentRequestSource {
|
|
@@ -990,7 +1235,7 @@ export interface PrepareLnurlPayResponse {
|
|
|
990
1235
|
}
|
|
991
1236
|
|
|
992
1237
|
export interface PrepareSendPaymentRequest {
|
|
993
|
-
paymentRequest:
|
|
1238
|
+
paymentRequest: PaymentRequest;
|
|
994
1239
|
amount?: bigint;
|
|
995
1240
|
tokenIdentifier?: string;
|
|
996
1241
|
conversionOptions?: ConversionOptions;
|
|
@@ -1134,7 +1379,7 @@ export interface Session {
|
|
|
1134
1379
|
expiration: number;
|
|
1135
1380
|
}
|
|
1136
1381
|
|
|
1137
|
-
export interface
|
|
1382
|
+
export interface SessionStore {
|
|
1138
1383
|
getSession: (serviceIdentityKey: string) => Promise<Session>;
|
|
1139
1384
|
setSession: (serviceIdentityKey: string, session: Session) => Promise<void>;
|
|
1140
1385
|
}
|
|
@@ -1211,6 +1456,7 @@ export interface SparkSigningOperator {
|
|
|
1211
1456
|
identifier: string;
|
|
1212
1457
|
address: string;
|
|
1213
1458
|
identityPublicKey: string;
|
|
1459
|
+
caCertPem?: string;
|
|
1214
1460
|
}
|
|
1215
1461
|
|
|
1216
1462
|
export interface SparkSspConfig {
|
|
@@ -1241,7 +1487,15 @@ export interface Storage {
|
|
|
1241
1487
|
setCachedItem: (key: string, value: string) => Promise<void>;
|
|
1242
1488
|
deleteCachedItem: (key: string) => Promise<void>;
|
|
1243
1489
|
listPayments: (request: StorageListPaymentsRequest) => Promise<Payment[]>;
|
|
1244
|
-
|
|
1490
|
+
/**
|
|
1491
|
+
* Insert or update a payment, applying a terminal-status guard.
|
|
1492
|
+
*
|
|
1493
|
+
* Returns `true` when the caller should emit a payment event (the row was
|
|
1494
|
+
* newly inserted, or its status transitioned). Returns `false` for
|
|
1495
|
+
* redundant same-status updates and for rejected updates that would
|
|
1496
|
+
* replace an already-terminal status.
|
|
1497
|
+
*/
|
|
1498
|
+
applyPaymentUpdate: (payment: Payment) => Promise<boolean>;
|
|
1245
1499
|
insertPaymentMetadata: (paymentId: string, metadata: PaymentMetadata) => Promise<void>;
|
|
1246
1500
|
getPaymentById: (id: string) => Promise<Payment>;
|
|
1247
1501
|
getPaymentByInvoice: (invoice: string) => Promise<Payment>;
|
|
@@ -1255,6 +1509,9 @@ export interface Storage {
|
|
|
1255
1509
|
getContact: (id: string) => Promise<Contact>;
|
|
1256
1510
|
insertContact: (contact: Contact) => Promise<void>;
|
|
1257
1511
|
deleteContact: (id: string) => Promise<void>;
|
|
1512
|
+
setCrossChainSwap: (swap: StoredCrossChainSwap) => Promise<void>;
|
|
1513
|
+
getCrossChainSwap: (provider: string, id: string) => Promise<StoredCrossChainSwap | null>;
|
|
1514
|
+
listActiveCrossChainSwaps: (provider: string) => Promise<StoredCrossChainSwap[]>;
|
|
1258
1515
|
syncAddOutgoingChange: (record: UnversionedRecordChange) => Promise<number>;
|
|
1259
1516
|
syncCompleteOutgoingSync: (record: Record) => Promise<void>;
|
|
1260
1517
|
syncGetPendingOutgoingChanges: (limit: number) => Promise<OutgoingChange[]>;
|
|
@@ -1278,6 +1535,15 @@ export interface StorageListPaymentsRequest {
|
|
|
1278
1535
|
sortAscending?: boolean;
|
|
1279
1536
|
}
|
|
1280
1537
|
|
|
1538
|
+
export interface StoredCrossChainSwap {
|
|
1539
|
+
provider: string;
|
|
1540
|
+
id: string;
|
|
1541
|
+
isTerminal: boolean;
|
|
1542
|
+
updatedAt: number;
|
|
1543
|
+
data: string;
|
|
1544
|
+
secrets: string;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1281
1547
|
export interface Symbol {
|
|
1282
1548
|
grapheme?: string;
|
|
1283
1549
|
template?: string;
|
|
@@ -1310,6 +1576,31 @@ export interface TokenOptimizationConfig {
|
|
|
1310
1576
|
minOutputsThreshold: number;
|
|
1311
1577
|
}
|
|
1312
1578
|
|
|
1579
|
+
export interface TransferAuthorization {
|
|
1580
|
+
username: string;
|
|
1581
|
+
pubkey: string;
|
|
1582
|
+
signature: string;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
export interface TurnkeyConfig {
|
|
1586
|
+
baseUrl?: string;
|
|
1587
|
+
organizationId: string;
|
|
1588
|
+
apiPublicKey: string;
|
|
1589
|
+
apiPrivateKey: string;
|
|
1590
|
+
walletId: string;
|
|
1591
|
+
network: Network;
|
|
1592
|
+
accountNumber?: number;
|
|
1593
|
+
retry?: TurnkeyRetryConfig;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
export interface TurnkeyRetryConfig {
|
|
1597
|
+
initialDelayMs: number;
|
|
1598
|
+
multiplier: number;
|
|
1599
|
+
maxDelayMs: number;
|
|
1600
|
+
maxRetries: number;
|
|
1601
|
+
requestTimeoutMs: number;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1313
1604
|
export interface TxStatus {
|
|
1314
1605
|
confirmed: boolean;
|
|
1315
1606
|
blockHeight?: number;
|
|
@@ -1378,31 +1669,51 @@ export type AmountAdjustmentReason = "flooredToMinLimit" | "increasedToAvoidDust
|
|
|
1378
1669
|
|
|
1379
1670
|
export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
|
|
1380
1671
|
|
|
1672
|
+
export type AutoOptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
|
|
1673
|
+
|
|
1381
1674
|
export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
|
|
1382
1675
|
|
|
1383
1676
|
export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; redirectUrl?: string } | { type: "cashApp"; amountSats: number };
|
|
1384
1677
|
|
|
1385
1678
|
export type ChainApiType = "esplora" | "mempoolSpace";
|
|
1386
1679
|
|
|
1680
|
+
export type ConversionChain = { type: "spark" } | { type: "lightning" } | { type: "external"; name: string; chainId?: string };
|
|
1681
|
+
|
|
1682
|
+
export type ConversionFilter = "ammRefundNeeded" | "orchestraPending" | "boltzPending";
|
|
1683
|
+
|
|
1684
|
+
export type ConversionInfo = { type: "amm"; poolId: string; conversionId: string; status: ConversionStatus; fee?: string; purpose?: ConversionPurpose; amountAdjustment?: AmountAdjustmentReason } | { type: "orchestra"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; orderId: string; quoteId: string; readToken?: string } | { type: "boltz"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; swapId: string; invoice: string; invoiceAmountSats: number; bridgeRef?: string; maxSlippageBps: number; quoteDegraded?: boolean };
|
|
1685
|
+
|
|
1686
|
+
export type ConversionProvider = "amm" | "orchestra" | "boltz";
|
|
1687
|
+
|
|
1387
1688
|
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
|
|
1388
1689
|
|
|
1389
1690
|
export type ConversionStatus = "pending" | "completed" | "failed" | "refundNeeded" | "refunded";
|
|
1390
1691
|
|
|
1391
1692
|
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
1392
1693
|
|
|
1694
|
+
export type CrossChainAddressFamily = "evm" | "solana" | "tron";
|
|
1695
|
+
|
|
1696
|
+
export type CrossChainFeeMode = "feesExcluded" | "feesIncluded";
|
|
1697
|
+
|
|
1698
|
+
export type CrossChainProvider = "orchestra" | "boltz";
|
|
1699
|
+
|
|
1700
|
+
export type CrossChainProviderContext = { type: "orchestra"; quoteId: string; depositAddress: string; depositAmount?: string } | { type: "boltz"; swapId: string; invoice: string; invoiceAmountSats?: number; maxSlippageBps: number };
|
|
1701
|
+
|
|
1702
|
+
export type CrossChainRouteFilter = { type: "send"; addressDetails: CrossChainAddressDetails } | { type: "receive"; contractAddress?: string };
|
|
1703
|
+
|
|
1393
1704
|
export type DepositClaimError = { type: "maxDepositClaimFeeExceeded"; tx: string; vout: number; maxFee?: Fee; requiredFeeSats: number; requiredFeeRateSatPerVbyte: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "generic"; message: string };
|
|
1394
1705
|
|
|
1395
|
-
export type
|
|
1706
|
+
export type ExternalFrostDerivation = { type: "signingLeaf"; leafId: ExternalTreeNodeId } | { type: "staticDeposit"; index: number } | { type: "htlcPreimage" } | { type: "identity" };
|
|
1396
1707
|
|
|
1397
|
-
export type
|
|
1708
|
+
export type ExternalSparkInvoiceKind = "sats" | "tokens";
|
|
1709
|
+
|
|
1710
|
+
export type ExternalTokenTransactionKind = "freeze" | "partial" | "final";
|
|
1398
1711
|
|
|
1399
1712
|
export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
|
|
1400
1713
|
|
|
1401
1714
|
export type FeePolicy = "feesExcluded" | "feesIncluded";
|
|
1402
1715
|
|
|
1403
|
-
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails);
|
|
1404
|
-
|
|
1405
|
-
export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
|
|
1716
|
+
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails) | ({ type: "crossChainAddress" } & CrossChainAddressDetails);
|
|
1406
1717
|
|
|
1407
1718
|
export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
|
|
1408
1719
|
|
|
@@ -1412,14 +1723,18 @@ export type Network = "mainnet" | "regtest";
|
|
|
1412
1723
|
|
|
1413
1724
|
export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
|
|
1414
1725
|
|
|
1415
|
-
export type
|
|
1726
|
+
export type OptimizationMode = "full" | "singleRound";
|
|
1416
1727
|
|
|
1417
|
-
export type
|
|
1728
|
+
export type OptimizationOutcome = { type: "completed"; roundsExecuted: number } | { type: "inProgress" };
|
|
1729
|
+
|
|
1730
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; txType: TokenTransactionType; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; invoice: string; destinationPubkey: string; htlcDetails: SparkHtlcDetails; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata; conversionInfo?: ConversionInfo } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string; vout: number };
|
|
1418
1731
|
|
|
1419
1732
|
export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
|
|
1420
1733
|
|
|
1421
1734
|
export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
|
|
1422
1735
|
|
|
1736
|
+
export type PaymentRequest = { type: "input"; input: string } | { type: "crossChain"; address: string; route: CrossChainRoutePair; maxSlippageBps?: number; targetOverpayBps?: number };
|
|
1737
|
+
|
|
1423
1738
|
export type PaymentStatus = "completed" | "pending" | "failed";
|
|
1424
1739
|
|
|
1425
1740
|
export type PaymentType = "send" | "receive";
|
|
@@ -1428,23 +1743,25 @@ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: st
|
|
|
1428
1743
|
|
|
1429
1744
|
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress"; newAddress?: boolean } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number; paymentHash?: string };
|
|
1430
1745
|
|
|
1431
|
-
export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "
|
|
1746
|
+
export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "autoOptimization"; optimizationEvent: AutoOptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] };
|
|
1432
1747
|
|
|
1433
1748
|
export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
|
|
1434
1749
|
|
|
1435
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string };
|
|
1750
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: string; assetAmountIn: string; estimatedOut: string; feeAmount: string; serviceFeeAmount: string; serviceFeeAsset?: string; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
|
|
1436
1751
|
|
|
1437
1752
|
export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
|
|
1438
1753
|
|
|
1439
1754
|
export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
|
|
1440
1755
|
|
|
1441
|
-
export type
|
|
1756
|
+
export type SessionStoreError = { type: "notFound" } | ({ type: "generic" } & string);
|
|
1757
|
+
|
|
1758
|
+
export type SourceAsset = { type: "bitcoin" } | { type: "token"; tokenIdentifier: string };
|
|
1442
1759
|
|
|
1443
1760
|
export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
|
|
1444
1761
|
|
|
1445
1762
|
export type StableBalanceActiveLabel = { type: "set"; label: string } | { type: "unset" };
|
|
1446
1763
|
|
|
1447
|
-
export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[];
|
|
1764
|
+
export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionFilter?: ConversionFilter } | { type: "token"; conversionFilter?: ConversionFilter; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[]; conversionFilter?: ConversionFilter };
|
|
1448
1765
|
|
|
1449
1766
|
export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
|
|
1450
1767
|
|
|
@@ -1482,18 +1799,19 @@ export class BreezSdk {
|
|
|
1482
1799
|
[Symbol.dispose](): void;
|
|
1483
1800
|
addContact(request: AddContactRequest): Promise<Contact>;
|
|
1484
1801
|
addEventListener(listener: EventListener): Promise<string>;
|
|
1802
|
+
authorizeLightningAddressTransfer(request: AuthorizeTransferRequest): Promise<TransferAuthorization>;
|
|
1485
1803
|
buyBitcoin(request: BuyBitcoinRequest): Promise<BuyBitcoinResponse>;
|
|
1486
|
-
cancelLeafOptimization(): Promise<void>;
|
|
1487
1804
|
checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
|
|
1488
1805
|
checkMessage(request: CheckMessageRequest): Promise<CheckMessageResponse>;
|
|
1489
1806
|
claimDeposit(request: ClaimDepositRequest): Promise<ClaimDepositResponse>;
|
|
1490
1807
|
claimHtlcPayment(request: ClaimHtlcPaymentRequest): Promise<ClaimHtlcPaymentResponse>;
|
|
1808
|
+
claimLightningAddressTransfer(request: ClaimTransferRequest): Promise<LightningAddressInfo>;
|
|
1491
1809
|
deleteContact(id: string): Promise<void>;
|
|
1492
1810
|
deleteLightningAddress(): Promise<void>;
|
|
1493
1811
|
disconnect(): Promise<void>;
|
|
1494
1812
|
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
1813
|
+
getCrossChainRoutes(filter: CrossChainRouteFilter): Promise<CrossChainRoutePair[]>;
|
|
1495
1814
|
getInfo(request: GetInfoRequest): Promise<GetInfoResponse>;
|
|
1496
|
-
getLeafOptimizationProgress(): OptimizationProgress;
|
|
1497
1815
|
getLightningAddress(): Promise<LightningAddressInfo | undefined>;
|
|
1498
1816
|
getPayment(request: GetPaymentRequest): Promise<GetPaymentResponse>;
|
|
1499
1817
|
getTokenIssuer(): TokenIssuer;
|
|
@@ -1508,6 +1826,7 @@ export class BreezSdk {
|
|
|
1508
1826
|
lnurlAuth(request_data: LnurlAuthRequestDetails): Promise<LnurlCallbackStatus>;
|
|
1509
1827
|
lnurlPay(request: LnurlPayRequest): Promise<LnurlPayResponse>;
|
|
1510
1828
|
lnurlWithdraw(request: LnurlWithdrawRequest): Promise<LnurlWithdrawResponse>;
|
|
1829
|
+
optimizeLeaves(request: OptimizeLeavesRequest): Promise<OptimizeLeavesResponse>;
|
|
1511
1830
|
parse(input: string): Promise<InputType>;
|
|
1512
1831
|
prepareLnurlPay(request: PrepareLnurlPayRequest): Promise<PrepareLnurlPayResponse>;
|
|
1513
1832
|
prepareSendPayment(request: PrepareSendPaymentRequest): Promise<PrepareSendPaymentResponse>;
|
|
@@ -1520,7 +1839,6 @@ export class BreezSdk {
|
|
|
1520
1839
|
removeEventListener(id: string): Promise<boolean>;
|
|
1521
1840
|
sendPayment(request: SendPaymentRequest): Promise<SendPaymentResponse>;
|
|
1522
1841
|
signMessage(request: SignMessageRequest): Promise<SignMessageResponse>;
|
|
1523
|
-
startLeafOptimization(): Promise<void>;
|
|
1524
1842
|
syncWallet(request: SyncWalletRequest): Promise<SyncWalletResponse>;
|
|
1525
1843
|
unregisterWebhook(request: UnregisterWebhookRequest): Promise<void>;
|
|
1526
1844
|
updateContact(request: UpdateContactRequest): Promise<Contact>;
|
|
@@ -1528,33 +1846,71 @@ export class BreezSdk {
|
|
|
1528
1846
|
}
|
|
1529
1847
|
|
|
1530
1848
|
/**
|
|
1531
|
-
* A
|
|
1532
|
-
*
|
|
1849
|
+
* A Rust-backed [`ExternalBreezSigner`] surfaced to JS as a signer object that
|
|
1850
|
+
* can be passed to `connectWithSigner` or `SdkBuilder.newWithSigner`. Produced
|
|
1851
|
+
* by `defaultExternalSigners` (seed) and `createTurnkeySigner` (Turnkey).
|
|
1852
|
+
*
|
|
1853
|
+
* [`ExternalBreezSigner`]: breez_sdk_spark::signer::ExternalBreezSigner
|
|
1533
1854
|
*/
|
|
1534
|
-
export class
|
|
1855
|
+
export class ExternalBreezSignerHandle {
|
|
1535
1856
|
private constructor();
|
|
1536
1857
|
free(): void;
|
|
1537
1858
|
[Symbol.dispose](): void;
|
|
1538
|
-
aggregateFrost(request: ExternalAggregateFrostRequest): Promise<ExternalFrostSignature>;
|
|
1539
1859
|
decryptEcies(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
1540
1860
|
derivePublicKey(path: string): Promise<PublicKeyBytes>;
|
|
1541
1861
|
encryptEcies(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
1542
|
-
encryptPrivateKeyForReceiver(private_key: ExternalEncryptedSecret, receiver_public_key: PublicKeyBytes): Promise<Uint8Array>;
|
|
1543
|
-
generateRandomSecret(): Promise<ExternalEncryptedSecret>;
|
|
1544
|
-
generateRandomSigningCommitment(): Promise<ExternalFrostCommitments>;
|
|
1545
|
-
getPublicKeyForNode(id: ExternalTreeNodeId): Promise<PublicKeyBytes>;
|
|
1546
1862
|
hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
|
|
1547
|
-
identityPublicKey(): PublicKeyBytes;
|
|
1548
|
-
publicKeyFromSecret(private_key: ExternalSecretSource): Promise<PublicKeyBytes>;
|
|
1549
1863
|
signEcdsa(message: MessageBytes, path: string): Promise<EcdsaSignatureBytes>;
|
|
1550
1864
|
signEcdsaRecoverable(message: MessageBytes, path: string): Promise<RecoverableEcdsaSignatureBytes>;
|
|
1551
|
-
signFrost(request: ExternalSignFrostRequest): Promise<ExternalFrostSignatureShare>;
|
|
1552
1865
|
signHashSchnorr(hash: Uint8Array, path: string): Promise<SchnorrSignatureBytes>;
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* The two external signers for the SDK's signer-based connect. Returned by
|
|
1870
|
+
* `defaultExternalSigners` (seed) and `createTurnkeySigner` (Turnkey); pass
|
|
1871
|
+
* both halves to `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
1872
|
+
*/
|
|
1873
|
+
export class ExternalSigners {
|
|
1874
|
+
private constructor();
|
|
1875
|
+
free(): void;
|
|
1876
|
+
[Symbol.dispose](): void;
|
|
1877
|
+
/**
|
|
1878
|
+
* External signer for non-Spark SDK signing (LNURL-auth, sync, message
|
|
1879
|
+
* signing, ECIES).
|
|
1880
|
+
*/
|
|
1881
|
+
readonly breezSigner: ExternalBreezSignerHandle;
|
|
1882
|
+
/**
|
|
1883
|
+
* External high-level Spark signer for the Spark wallet flows.
|
|
1884
|
+
*/
|
|
1885
|
+
readonly sparkSigner: ExternalSparkSignerHandle;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
/**
|
|
1889
|
+
* A Rust-backed [`ExternalSparkSigner`] surfaced to JS as a signer object that
|
|
1890
|
+
* can be passed to `connectWithSigner` or `SdkBuilder.newWithSigner`. Produced
|
|
1891
|
+
* by `defaultExternalSigners` (seed) and `createTurnkeySigner` (Turnkey).
|
|
1892
|
+
*
|
|
1893
|
+
* [`ExternalSparkSigner`]: breez_sdk_spark::signer::ExternalSparkSigner
|
|
1894
|
+
*/
|
|
1895
|
+
export class ExternalSparkSignerHandle {
|
|
1896
|
+
private constructor();
|
|
1897
|
+
free(): void;
|
|
1898
|
+
[Symbol.dispose](): void;
|
|
1899
|
+
getIdentityPublicKey(): Promise<PublicKeyBytes>;
|
|
1900
|
+
getPublicKeyForLeaf(leaf_id: ExternalTreeNodeId): Promise<PublicKeyBytes>;
|
|
1901
|
+
getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
|
|
1902
|
+
prepareClaim(request: ExternalPrepareClaimRequest): Promise<ExternalPreparedClaim>;
|
|
1903
|
+
prepareLightningReceive(request: ExternalPrepareLightningReceiveRequest): Promise<ExternalPreparedLightningReceive>;
|
|
1904
|
+
prepareStaticDeposit(request: ExternalPrepareStaticDepositRequest): Promise<ExternalPreparedStaticDeposit>;
|
|
1905
|
+
prepareStaticDepositClaim(request: ExternalPrepareStaticDepositClaimRequest): Promise<ExternalPreparedStaticDepositClaim>;
|
|
1906
|
+
prepareTokenTransaction(request: ExternalPrepareTokenTransactionRequest): Promise<ExternalPreparedTokenTransaction>;
|
|
1907
|
+
prepareTransfer(request: ExternalPrepareTransferRequest): Promise<ExternalPreparedTransfer>;
|
|
1908
|
+
signAuthenticationChallenge(challenge: Uint8Array): Promise<EcdsaSignatureBytes>;
|
|
1909
|
+
signFrost(jobs: ExternalFrostJob[]): Promise<ExternalFrostShareResult[]>;
|
|
1910
|
+
signMessage(message: Uint8Array): Promise<EcdsaSignatureBytes>;
|
|
1911
|
+
signSparkInvoice(request: ExternalSignSparkInvoiceRequest): Promise<ExternalSignedSparkInvoice>;
|
|
1912
|
+
signStaticDepositRefund(request: ExternalSignStaticDepositRefundRequest): Promise<ExternalFrostSignature>;
|
|
1913
|
+
startStaticDepositRefund(request: ExternalStartStaticDepositRefundRequest): Promise<ExternalStartedStaticDepositRefund>;
|
|
1558
1914
|
}
|
|
1559
1915
|
|
|
1560
1916
|
export class IntoUnderlyingByteSource {
|
|
@@ -1586,73 +1942,59 @@ export class IntoUnderlyingSource {
|
|
|
1586
1942
|
}
|
|
1587
1943
|
|
|
1588
1944
|
/**
|
|
1589
|
-
*
|
|
1590
|
-
*
|
|
1591
|
-
*
|
|
1592
|
-
*/
|
|
1593
|
-
export class MysqlConnectionPool {
|
|
1594
|
-
private constructor();
|
|
1595
|
-
free(): void;
|
|
1596
|
-
[Symbol.dispose](): void;
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
/**
|
|
1600
|
-
* Passkey-based wallet operations using WebAuthn PRF extension.
|
|
1601
|
-
*
|
|
1602
|
-
* Wraps a `PasskeyPrfProvider` and optional relay configuration to provide
|
|
1603
|
-
* wallet derivation and label management via Nostr relays.
|
|
1945
|
+
* High-level orchestrator that collapses register / sign-in flows
|
|
1946
|
+
* into single calls. See the matching Rust types for full semantics;
|
|
1947
|
+
* the JS surface is a thin wasm-bindgen wrapper.
|
|
1604
1948
|
*/
|
|
1605
|
-
export class
|
|
1949
|
+
export class PasskeyClient {
|
|
1606
1950
|
free(): void;
|
|
1607
1951
|
[Symbol.dispose](): void;
|
|
1608
1952
|
/**
|
|
1609
|
-
*
|
|
1610
|
-
*
|
|
1611
|
-
* Uses the passkey PRF to derive a `Wallet` containing the seed and resolved label.
|
|
1612
|
-
*
|
|
1613
|
-
* @param label - Optional label string (defaults to "Default")
|
|
1953
|
+
* One-shot capability probe (PRF support + domain association)
|
|
1954
|
+
* hosts can gate UX on.
|
|
1614
1955
|
*/
|
|
1615
|
-
|
|
1956
|
+
checkAvailability(): Promise<PasskeyAvailability>;
|
|
1616
1957
|
/**
|
|
1617
|
-
*
|
|
1958
|
+
* Label sub-object. List / publish labels for this passkey's identity.
|
|
1618
1959
|
*/
|
|
1619
|
-
|
|
1960
|
+
labels(): PasskeyLabels;
|
|
1620
1961
|
/**
|
|
1621
|
-
*
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1962
|
+
* Create a `PasskeyClient` backed by the supplied `PrfProvider` and
|
|
1963
|
+
* the default Nostr-backed label store. `breezApiKey` enables
|
|
1964
|
+
* authenticated (NIP-42) relay access for label storage; omit for
|
|
1965
|
+
* public relays only.
|
|
1624
1966
|
*/
|
|
1625
|
-
|
|
1967
|
+
constructor(prf_provider: PrfProvider, breez_api_key?: string | null, config?: PasskeyConfig | null);
|
|
1626
1968
|
/**
|
|
1627
|
-
*
|
|
1628
|
-
*
|
|
1629
|
-
*
|
|
1630
|
-
* @param relayConfig - Optional configuration for Nostr relay connections
|
|
1969
|
+
* First-time setup. Drives the platform's create-passkey ceremony
|
|
1970
|
+
* then derives the wallet seed in the same PRF assertion ceremony
|
|
1971
|
+
* where the platform supports it.
|
|
1631
1972
|
*/
|
|
1632
|
-
|
|
1973
|
+
register(request: RegisterRequest): Promise<RegisterResponse>;
|
|
1633
1974
|
/**
|
|
1634
|
-
*
|
|
1635
|
-
*
|
|
1636
|
-
*
|
|
1637
|
-
*
|
|
1975
|
+
* Returning-user sign-in. With `label` set, uses the fast path
|
|
1976
|
+
* (one ceremony, no Nostr round-trip). With `label` omitted,
|
|
1977
|
+
* derives the default-label wallet and discovers the user's
|
|
1978
|
+
* label set in the same ceremony.
|
|
1638
1979
|
*/
|
|
1639
|
-
|
|
1980
|
+
signIn(request: SignInRequest): Promise<SignInResponse>;
|
|
1640
1981
|
}
|
|
1641
1982
|
|
|
1642
1983
|
/**
|
|
1643
|
-
*
|
|
1644
|
-
*
|
|
1645
|
-
* Construct via [`create_postgres_connection_pool`] and pass the same handle to multiple
|
|
1646
|
-
* `SdkBuilder`s via `withPostgresConnectionPool` to share connections across SDKs.
|
|
1647
|
-
* Per-tenant scoping is derived from each SDK's seed.
|
|
1648
|
-
*
|
|
1649
|
-
* The pool's lifecycle is controlled by the integrator: it stays alive as
|
|
1650
|
-
* long as any reference is held. `disconnect()` does **not** close the pool.
|
|
1984
|
+
* Label sub-object surfaced from `PasskeyClient.labels()`.
|
|
1651
1985
|
*/
|
|
1652
|
-
export class
|
|
1986
|
+
export class PasskeyLabels {
|
|
1653
1987
|
private constructor();
|
|
1654
1988
|
free(): void;
|
|
1655
1989
|
[Symbol.dispose](): void;
|
|
1990
|
+
/**
|
|
1991
|
+
* List labels published for this passkey's identity.
|
|
1992
|
+
*/
|
|
1993
|
+
list(): Promise<string[]>;
|
|
1994
|
+
/**
|
|
1995
|
+
* Idempotently publish `label` for this passkey's identity.
|
|
1996
|
+
*/
|
|
1997
|
+
store(label: string): Promise<void>;
|
|
1656
1998
|
}
|
|
1657
1999
|
|
|
1658
2000
|
export class SdkBuilder {
|
|
@@ -1661,37 +2003,21 @@ export class SdkBuilder {
|
|
|
1661
2003
|
[Symbol.dispose](): void;
|
|
1662
2004
|
build(): Promise<BreezSdk>;
|
|
1663
2005
|
static new(config: Config, seed: Seed): SdkBuilder;
|
|
1664
|
-
static newWithSigner(config: Config,
|
|
2006
|
+
static newWithSigner(config: Config, breez_signer: ExternalBreezSigner, spark_signer: ExternalSparkSigner): SdkBuilder;
|
|
2007
|
+
withAccountNumber(account_number: number): SdkBuilder;
|
|
1665
2008
|
withChainService(chain_service: BitcoinChainService): SdkBuilder;
|
|
1666
2009
|
withDefaultStorage(storage_dir: string): Promise<SdkBuilder>;
|
|
1667
2010
|
withFiatService(fiat_service: FiatService): SdkBuilder;
|
|
1668
|
-
withKeySet(config: KeySetConfig): SdkBuilder;
|
|
1669
2011
|
withLnurlClient(lnurl_client: RestClient): SdkBuilder;
|
|
1670
2012
|
/**
|
|
1671
|
-
* **Deprecated.**
|
|
1672
|
-
* `withMysqlConnectionPool(pool)` instead.
|
|
2013
|
+
* **Deprecated.** Use `withStorageBackend(mysqlStorage(config))`.
|
|
1673
2014
|
*/
|
|
1674
2015
|
withMysqlBackend(config: MysqlStorageConfig): SdkBuilder;
|
|
1675
|
-
/**
|
|
1676
|
-
* Sets a shared `MySQL` connection pool as the backend for all stores.
|
|
1677
|
-
*
|
|
1678
|
-
* If the same builder also receives a `WasmSdkContext` carrying a MySQL
|
|
1679
|
-
* pool, `build()` returns an error — pick one source.
|
|
1680
|
-
*/
|
|
1681
|
-
withMysqlConnectionPool(pool: MysqlConnectionPool): SdkBuilder;
|
|
1682
2016
|
withPaymentObserver(payment_observer: PaymentObserver): SdkBuilder;
|
|
1683
2017
|
/**
|
|
1684
|
-
* **Deprecated.**
|
|
1685
|
-
* `withPostgresConnectionPool(pool)` instead.
|
|
2018
|
+
* **Deprecated.** Use `withStorageBackend(postgresStorage(config))`.
|
|
1686
2019
|
*/
|
|
1687
2020
|
withPostgresBackend(config: PostgresStorageConfig): SdkBuilder;
|
|
1688
|
-
/**
|
|
1689
|
-
* Sets a shared Postgres connection pool as the backend for all stores.
|
|
1690
|
-
*
|
|
1691
|
-
* If the same builder also receives a `WasmSdkContext` carrying a
|
|
1692
|
-
* Postgres pool, `build()` returns an error — pick one source.
|
|
1693
|
-
*/
|
|
1694
|
-
withPostgresConnectionPool(pool: PostgresConnectionPool): SdkBuilder;
|
|
1695
2021
|
withRestChainService(url: string, api_type: ChainApiType, credentials?: Credentials | null): SdkBuilder;
|
|
1696
2022
|
/**
|
|
1697
2023
|
* Threads a shared [`WasmSdkContext`] into the builder.
|
|
@@ -1702,6 +2028,13 @@ export class SdkBuilder {
|
|
|
1702
2028
|
*/
|
|
1703
2029
|
withSharedContext(context: WasmSdkContext): SdkBuilder;
|
|
1704
2030
|
withStorage(storage: Storage): SdkBuilder;
|
|
2031
|
+
/**
|
|
2032
|
+
* Sets one of the SDK's built-in storage backends.
|
|
2033
|
+
*
|
|
2034
|
+
* Construct the [`WasmStorageConfig`] via `defaultStorage`,
|
|
2035
|
+
* `postgresStorage` or `mysqlStorage`.
|
|
2036
|
+
*/
|
|
2037
|
+
withStorageBackend(config: WasmStorageConfig): SdkBuilder;
|
|
1705
2038
|
}
|
|
1706
2039
|
|
|
1707
2040
|
export class TokenIssuer {
|
|
@@ -1730,23 +2063,38 @@ export class WasmSdkContext {
|
|
|
1730
2063
|
[Symbol.dispose](): void;
|
|
1731
2064
|
}
|
|
1732
2065
|
|
|
1733
|
-
export function connect(request: ConnectRequest): Promise<BreezSdk>;
|
|
1734
|
-
|
|
1735
|
-
export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
|
|
1736
|
-
|
|
1737
2066
|
/**
|
|
1738
|
-
*
|
|
2067
|
+
* Selects one of the SDK's built-in storage backends.
|
|
2068
|
+
*
|
|
2069
|
+
* Construct it via `defaultStorage`, `postgresStorage` or `mysqlStorage` and
|
|
2070
|
+
* pass it to `SdkBuilder.withStorageBackend`.
|
|
1739
2071
|
*/
|
|
1740
|
-
export
|
|
2072
|
+
export class WasmStorageConfig {
|
|
2073
|
+
private constructor();
|
|
2074
|
+
free(): void;
|
|
2075
|
+
[Symbol.dispose](): void;
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
export function connect(request: ConnectRequest): Promise<BreezSdk>;
|
|
2079
|
+
|
|
2080
|
+
export function connectWithSigner(config: Config, breez_signer: ExternalBreezSigner, spark_signer: ExternalSparkSigner, storage_dir: string): Promise<BreezSdk>;
|
|
1741
2081
|
|
|
1742
2082
|
/**
|
|
1743
|
-
*
|
|
2083
|
+
* Builds the Turnkey-backed signers from `config`, then pass
|
|
2084
|
+
* `signers.breezSigner` and `signers.sparkSigner` to `connectWithSigner`,
|
|
2085
|
+
* exactly as with any other external signer.
|
|
1744
2086
|
*/
|
|
1745
|
-
export function
|
|
2087
|
+
export function createTurnkeySigner(config: TurnkeyConfig): Promise<ExternalSigners>;
|
|
1746
2088
|
|
|
1747
2089
|
export function defaultConfig(network: Network): Config;
|
|
1748
2090
|
|
|
1749
|
-
|
|
2091
|
+
/**
|
|
2092
|
+
* Creates the default external signers from a mnemonic phrase.
|
|
2093
|
+
*
|
|
2094
|
+
* Key derivation matches the seed-based connect path: an SDK built either
|
|
2095
|
+
* way from the same mnemonic is the same wallet.
|
|
2096
|
+
*/
|
|
2097
|
+
export function defaultExternalSigners(mnemonic: string, passphrase: string | null | undefined, network: Network, account_number?: number | null): ExternalSigners;
|
|
1750
2098
|
|
|
1751
2099
|
/**
|
|
1752
2100
|
* Creates a default MySQL storage configuration with sensible defaults.
|
|
@@ -1772,14 +2120,20 @@ export function defaultPostgresStorageConfig(connection_string: string): Postgre
|
|
|
1772
2120
|
export function defaultServerConfig(network: Network): Config;
|
|
1773
2121
|
|
|
1774
2122
|
/**
|
|
1775
|
-
*
|
|
1776
|
-
*
|
|
1777
|
-
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
2123
|
+
* File-based storage rooted at `storageDir` — IndexedDB in the browser,
|
|
2124
|
+
* SQLite under Node.js.
|
|
1778
2125
|
*/
|
|
2126
|
+
export function defaultStorage(storage_dir: string): WasmStorageConfig;
|
|
2127
|
+
|
|
1779
2128
|
export function getSparkStatus(): Promise<SparkStatus>;
|
|
1780
2129
|
|
|
1781
2130
|
export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
|
|
1782
2131
|
|
|
2132
|
+
/**
|
|
2133
|
+
* `MySQL`-backed storage built from `config`.
|
|
2134
|
+
*/
|
|
2135
|
+
export function mysqlStorage(config: MysqlStorageConfig): WasmStorageConfig;
|
|
2136
|
+
|
|
1783
2137
|
/**
|
|
1784
2138
|
* Constructs a shareable REST-based Bitcoin chain service.
|
|
1785
2139
|
*
|
|
@@ -1796,6 +2150,19 @@ export function newRestChainService(url: string, network: Network, api_type: Cha
|
|
|
1796
2150
|
*/
|
|
1797
2151
|
export function newSharedSdkContext(config: WasmSdkContextConfig): Promise<WasmSdkContext>;
|
|
1798
2152
|
|
|
2153
|
+
/**
|
|
2154
|
+
* `PostgreSQL`-backed storage built from `config`.
|
|
2155
|
+
*/
|
|
2156
|
+
export function postgresStorage(config: PostgresStorageConfig): WasmStorageConfig;
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* Runs automatically when the wasm module is instantiated. Installs the
|
|
2160
|
+
* panic hook so Rust panics surface as readable `console.error` output
|
|
2161
|
+
* (with the panic message + `file.rs:line`) instead of a bare
|
|
2162
|
+
* `RuntimeError: unreachable`.
|
|
2163
|
+
*/
|
|
2164
|
+
export function start(): void;
|
|
2165
|
+
|
|
1799
2166
|
/**
|
|
1800
2167
|
* Entry point invoked by JavaScript in a worker.
|
|
1801
2168
|
*/
|