@breeztech/breez-sdk-spark 0.15.1 → 0.16.1-dev1
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 +511 -215
- package/bundler/breez_sdk_spark_wasm.js +1 -1
- package/bundler/breez_sdk_spark_wasm_bg.js +567 -414
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +55 -46
- package/bundler/storage/index.js +205 -15
- package/deno/breez_sdk_spark_wasm.d.ts +511 -215
- package/deno/breez_sdk_spark_wasm.js +567 -414
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +55 -46
- package/nodejs/breez_sdk_spark_wasm.d.ts +511 -215
- package/nodejs/breez_sdk_spark_wasm.js +578 -421
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +55 -46
- package/nodejs/index.js +10 -10
- package/nodejs/index.mjs +12 -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 +229 -111
- package/nodejs/mysql-storage/migrations.cjs +37 -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 +174 -107
- package/nodejs/postgres-storage/migrations.cjs +24 -0
- package/nodejs/postgres-token-store/index.cjs +89 -64
- package/nodejs/postgres-token-store/migrations.cjs +44 -0
- package/nodejs/storage/index.cjs +167 -113
- package/nodejs/storage/migrations.cjs +23 -0
- package/package.json +6 -1
- package/ssr/index.js +52 -28
- package/web/breez_sdk_spark_wasm.d.ts +566 -261
- package/web/breez_sdk_spark_wasm.js +567 -414
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +55 -46
- package/web/passkey-prf-provider/index.d.ts +203 -0
- package/web/passkey-prf-provider/index.js +733 -0
- package/web/storage/index.js +205 -15
- 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
|
Binary file
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_bitcoinchainservicehandle_free: (a: number, b: number) => void;
|
|
5
5
|
export const __wbg_breezsdk_free: (a: number, b: number) => void;
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const __wbg_postgresconnectionpool_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_externalsigners_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_passkeyclient_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_passkeylabels_free: (a: number, b: number) => void;
|
|
10
9
|
export const __wbg_sdkbuilder_free: (a: number, b: number) => void;
|
|
11
10
|
export const __wbg_tokenissuer_free: (a: number, b: number) => void;
|
|
12
11
|
export const __wbg_wasmsdkcontext_free: (a: number, b: number) => void;
|
|
12
|
+
export const __wbg_wasmstorageconfig_free: (a: number, b: number) => void;
|
|
13
13
|
export const bitcoinchainservicehandle_broadcastTransaction: (a: number, b: number, c: number) => any;
|
|
14
14
|
export const bitcoinchainservicehandle_getAddressUtxos: (a: number, b: number, c: number) => any;
|
|
15
15
|
export const bitcoinchainservicehandle_getTransactionHex: (a: number, b: number, c: number) => any;
|
|
@@ -17,18 +17,18 @@ export const bitcoinchainservicehandle_getTransactionStatus: (a: number, b: numb
|
|
|
17
17
|
export const bitcoinchainservicehandle_recommendedFees: (a: number) => any;
|
|
18
18
|
export const breezsdk_addContact: (a: number, b: any) => any;
|
|
19
19
|
export const breezsdk_addEventListener: (a: number, b: any) => any;
|
|
20
|
+
export const breezsdk_authorizeLightningAddressTransfer: (a: number, b: any) => any;
|
|
20
21
|
export const breezsdk_buyBitcoin: (a: number, b: any) => any;
|
|
21
|
-
export const breezsdk_cancelLeafOptimization: (a: number) => any;
|
|
22
22
|
export const breezsdk_checkLightningAddressAvailable: (a: number, b: any) => any;
|
|
23
23
|
export const breezsdk_checkMessage: (a: number, b: any) => any;
|
|
24
24
|
export const breezsdk_claimDeposit: (a: number, b: any) => any;
|
|
25
25
|
export const breezsdk_claimHtlcPayment: (a: number, b: any) => any;
|
|
26
|
+
export const breezsdk_claimLightningAddressTransfer: (a: number, b: any) => any;
|
|
26
27
|
export const breezsdk_deleteContact: (a: number, b: number, c: number) => any;
|
|
27
28
|
export const breezsdk_deleteLightningAddress: (a: number) => any;
|
|
28
29
|
export const breezsdk_disconnect: (a: number) => any;
|
|
29
30
|
export const breezsdk_fetchConversionLimits: (a: number, b: any) => any;
|
|
30
31
|
export const breezsdk_getInfo: (a: number, b: any) => any;
|
|
31
|
-
export const breezsdk_getLeafOptimizationProgress: (a: number) => any;
|
|
32
32
|
export const breezsdk_getLightningAddress: (a: number) => any;
|
|
33
33
|
export const breezsdk_getPayment: (a: number, b: any) => any;
|
|
34
34
|
export const breezsdk_getTokenIssuer: (a: number) => number;
|
|
@@ -43,6 +43,7 @@ export const breezsdk_listWebhooks: (a: number) => any;
|
|
|
43
43
|
export const breezsdk_lnurlAuth: (a: number, b: any) => any;
|
|
44
44
|
export const breezsdk_lnurlPay: (a: number, b: any) => any;
|
|
45
45
|
export const breezsdk_lnurlWithdraw: (a: number, b: any) => any;
|
|
46
|
+
export const breezsdk_optimizeLeaves: (a: number, b: any) => any;
|
|
46
47
|
export const breezsdk_parse: (a: number, b: number, c: number) => any;
|
|
47
48
|
export const breezsdk_prepareLnurlPay: (a: number, b: any) => any;
|
|
48
49
|
export const breezsdk_prepareSendPayment: (a: number, b: any) => any;
|
|
@@ -55,65 +56,71 @@ export const breezsdk_registerWebhook: (a: number, b: any) => any;
|
|
|
55
56
|
export const breezsdk_removeEventListener: (a: number, b: number, c: number) => any;
|
|
56
57
|
export const breezsdk_sendPayment: (a: number, b: any) => any;
|
|
57
58
|
export const breezsdk_signMessage: (a: number, b: any) => any;
|
|
58
|
-
export const breezsdk_startLeafOptimization: (a: number) => any;
|
|
59
59
|
export const breezsdk_syncWallet: (a: number, b: any) => any;
|
|
60
60
|
export const breezsdk_unregisterWebhook: (a: number, b: any) => any;
|
|
61
61
|
export const breezsdk_updateContact: (a: number, b: any) => any;
|
|
62
62
|
export const breezsdk_updateUserSettings: (a: number, b: any) => any;
|
|
63
63
|
export const connect: (a: any) => any;
|
|
64
|
-
export const connectWithSigner: (a: any, b: any, c:
|
|
65
|
-
export const
|
|
66
|
-
export const createPostgresConnectionPool: (a: any) => [number, number, number];
|
|
64
|
+
export const connectWithSigner: (a: any, b: any, c: any, d: number, e: number) => any;
|
|
65
|
+
export const createTurnkeySigner: (a: any) => any;
|
|
67
66
|
export const defaultConfig: (a: any) => any;
|
|
68
|
-
export const
|
|
67
|
+
export const defaultExternalSigners: (a: number, b: number, c: number, d: number, e: any, f: number) => [number, number, number];
|
|
69
68
|
export const defaultMysqlStorageConfig: (a: number, b: number) => any;
|
|
70
69
|
export const defaultPostgresStorageConfig: (a: number, b: number) => any;
|
|
71
70
|
export const defaultServerConfig: (a: any) => any;
|
|
72
|
-
export const
|
|
73
|
-
export const
|
|
74
|
-
export const
|
|
75
|
-
export const
|
|
76
|
-
export const
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
79
|
-
export const
|
|
80
|
-
export const
|
|
81
|
-
export const
|
|
82
|
-
export const
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
85
|
-
export const
|
|
86
|
-
export const
|
|
87
|
-
export const
|
|
88
|
-
export const
|
|
89
|
-
export const
|
|
90
|
-
export const
|
|
91
|
-
export const
|
|
71
|
+
export const defaultStorage: (a: number, b: number) => number;
|
|
72
|
+
export const externalbreezsignerhandle_decryptEcies: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
73
|
+
export const externalbreezsignerhandle_derivePublicKey: (a: number, b: number, c: number) => any;
|
|
74
|
+
export const externalbreezsignerhandle_encryptEcies: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
75
|
+
export const externalbreezsignerhandle_hmacSha256: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
76
|
+
export const externalbreezsignerhandle_signEcdsa: (a: number, b: any, c: number, d: number) => any;
|
|
77
|
+
export const externalbreezsignerhandle_signEcdsaRecoverable: (a: number, b: any, c: number, d: number) => any;
|
|
78
|
+
export const externalbreezsignerhandle_signHashSchnorr: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
79
|
+
export const externalsigners_breezSigner: (a: number) => number;
|
|
80
|
+
export const externalsigners_sparkSigner: (a: number) => number;
|
|
81
|
+
export const externalsparksignerhandle_getIdentityPublicKey: (a: number) => any;
|
|
82
|
+
export const externalsparksignerhandle_getPublicKeyForLeaf: (a: number, b: any) => any;
|
|
83
|
+
export const externalsparksignerhandle_getStaticDepositPublicKey: (a: number, b: number) => any;
|
|
84
|
+
export const externalsparksignerhandle_prepareClaim: (a: number, b: any) => any;
|
|
85
|
+
export const externalsparksignerhandle_prepareLightningReceive: (a: number, b: any) => any;
|
|
86
|
+
export const externalsparksignerhandle_prepareStaticDeposit: (a: number, b: any) => any;
|
|
87
|
+
export const externalsparksignerhandle_prepareStaticDepositClaim: (a: number, b: any) => any;
|
|
88
|
+
export const externalsparksignerhandle_prepareTokenTransaction: (a: number, b: any) => any;
|
|
89
|
+
export const externalsparksignerhandle_prepareTransfer: (a: number, b: any) => any;
|
|
90
|
+
export const externalsparksignerhandle_signAuthenticationChallenge: (a: number, b: number, c: number) => any;
|
|
91
|
+
export const externalsparksignerhandle_signFrost: (a: number, b: number, c: number) => any;
|
|
92
|
+
export const externalsparksignerhandle_signMessage: (a: number, b: number, c: number) => any;
|
|
93
|
+
export const externalsparksignerhandle_signSparkInvoice: (a: number, b: any) => any;
|
|
94
|
+
export const externalsparksignerhandle_signStaticDepositRefund: (a: number, b: any) => any;
|
|
95
|
+
export const externalsparksignerhandle_startStaticDepositRefund: (a: number, b: any) => any;
|
|
92
96
|
export const getSparkStatus: () => any;
|
|
93
97
|
export const initLogging: (a: any, b: number, c: number) => any;
|
|
98
|
+
export const mysqlStorage: (a: any) => number;
|
|
94
99
|
export const newRestChainService: (a: number, b: number, c: any, d: any, e: number) => any;
|
|
95
100
|
export const newSharedSdkContext: (a: any) => any;
|
|
96
|
-
export const
|
|
97
|
-
export const
|
|
98
|
-
export const
|
|
99
|
-
export const
|
|
100
|
-
export const
|
|
101
|
+
export const passkeyclient_checkAvailability: (a: number) => any;
|
|
102
|
+
export const passkeyclient_labels: (a: number) => number;
|
|
103
|
+
export const passkeyclient_new: (a: any, b: number, c: number, d: number) => number;
|
|
104
|
+
export const passkeyclient_register: (a: number, b: any) => any;
|
|
105
|
+
export const passkeyclient_signIn: (a: number, b: any) => any;
|
|
106
|
+
export const passkeylabels_list: (a: number) => any;
|
|
107
|
+
export const passkeylabels_store: (a: number, b: number, c: number) => any;
|
|
108
|
+
export const postgresStorage: (a: any) => number;
|
|
101
109
|
export const sdkbuilder_build: (a: number) => any;
|
|
102
110
|
export const sdkbuilder_new: (a: any, b: any) => number;
|
|
103
|
-
export const sdkbuilder_newWithSigner: (a: any, b: any) => number;
|
|
111
|
+
export const sdkbuilder_newWithSigner: (a: any, b: any, c: any) => number;
|
|
112
|
+
export const sdkbuilder_withAccountNumber: (a: number, b: number) => number;
|
|
104
113
|
export const sdkbuilder_withChainService: (a: number, b: any) => number;
|
|
105
114
|
export const sdkbuilder_withDefaultStorage: (a: number, b: number, c: number) => any;
|
|
106
115
|
export const sdkbuilder_withFiatService: (a: number, b: any) => number;
|
|
107
|
-
export const sdkbuilder_withKeySet: (a: number, b: any) => number;
|
|
108
116
|
export const sdkbuilder_withLnurlClient: (a: number, b: any) => number;
|
|
109
117
|
export const sdkbuilder_withMysqlBackend: (a: number, b: any) => [number, number, number];
|
|
110
|
-
export const sdkbuilder_withMysqlConnectionPool: (a: number, b: number) => number;
|
|
111
118
|
export const sdkbuilder_withPaymentObserver: (a: number, b: any) => number;
|
|
112
119
|
export const sdkbuilder_withPostgresBackend: (a: number, b: any) => [number, number, number];
|
|
113
|
-
export const sdkbuilder_withPostgresConnectionPool: (a: number, b: number) => number;
|
|
114
120
|
export const sdkbuilder_withRestChainService: (a: number, b: number, c: number, d: any, e: number) => number;
|
|
115
121
|
export const sdkbuilder_withSharedContext: (a: number, b: number) => number;
|
|
116
122
|
export const sdkbuilder_withStorage: (a: number, b: any) => number;
|
|
123
|
+
export const sdkbuilder_withStorageBackend: (a: number, b: number) => number;
|
|
117
124
|
export const tokenissuer_burnIssuerToken: (a: number, b: any) => any;
|
|
118
125
|
export const tokenissuer_createIssuerToken: (a: number, b: any) => any;
|
|
119
126
|
export const tokenissuer_freezeIssuerToken: (a: number, b: any) => any;
|
|
@@ -139,16 +146,18 @@ export const intounderlyingsink_close: (a: number) => any;
|
|
|
139
146
|
export const intounderlyingsink_write: (a: number, b: any) => any;
|
|
140
147
|
export const intounderlyingsource_cancel: (a: number) => void;
|
|
141
148
|
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
|
142
|
-
export const
|
|
143
|
-
export const
|
|
144
|
-
export const
|
|
145
|
-
export const
|
|
146
|
-
export const
|
|
149
|
+
export const __wbg_externalbreezsignerhandle_free: (a: number, b: number) => void;
|
|
150
|
+
export const __wbg_externalsparksignerhandle_free: (a: number, b: number) => void;
|
|
151
|
+
export const wasm_bindgen__convert__closures_____invoke__h4bd7a023e323559c: (a: number, b: number, c: any) => [number, number];
|
|
152
|
+
export const wasm_bindgen__convert__closures_____invoke__h4bd7a023e323559c_4: (a: number, b: number, c: any) => [number, number];
|
|
153
|
+
export const wasm_bindgen__convert__closures_____invoke__h4bd7a023e323559c_5: (a: number, b: number, c: any) => [number, number];
|
|
154
|
+
export const wasm_bindgen__convert__closures_____invoke__h4bd7a023e323559c_6: (a: number, b: number, c: any) => [number, number];
|
|
155
|
+
export const wasm_bindgen__convert__closures_____invoke__h4bd7a023e323559c_7: (a: number, b: number, c: any) => [number, number];
|
|
147
156
|
export const wasm_bindgen__convert__closures_____invoke__h41057d61edf43a32: (a: number, b: number, c: any, d: any) => void;
|
|
148
157
|
export const wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57: (a: number, b: number, c: any) => void;
|
|
149
158
|
export const wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57_2: (a: number, b: number, c: any) => void;
|
|
150
159
|
export const wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57_3: (a: number, b: number, c: any) => void;
|
|
151
|
-
export const
|
|
160
|
+
export const wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7: (a: number, b: number) => void;
|
|
152
161
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
153
162
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
154
163
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { PasskeyClient as SdkPasskeyClient } from '../breez_sdk_spark_wasm.js';
|
|
2
|
+
import type {
|
|
3
|
+
PasskeyConfig,
|
|
4
|
+
PasskeyProviderOptions,
|
|
5
|
+
PrfProvider,
|
|
6
|
+
PasskeyCredential,
|
|
7
|
+
DeriveSeedsResult,
|
|
8
|
+
DeriveSeedOptions
|
|
9
|
+
} from '../breez_sdk_spark_wasm.js';
|
|
10
|
+
|
|
11
|
+
export type { PasskeyCredential, DeriveSeedsResult, DeriveSeedOptions, PasskeyProviderOptions };
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Outcome of a domain-association check: whether `rpId` is a valid
|
|
15
|
+
* WebAuthn scope for the current origin.
|
|
16
|
+
*/
|
|
17
|
+
export type DomainAssociation =
|
|
18
|
+
| { kind: 'Associated' }
|
|
19
|
+
| { kind: 'NotAssociated'; source: string; reason: string }
|
|
20
|
+
| { kind: 'Skipped'; reason: string };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Thrown by `createPasskey` when an entry in `excludeCredentials`
|
|
24
|
+
* matches a credential already on the device. Route the user to
|
|
25
|
+
* sign-in rather than treating it as a generic registration failure.
|
|
26
|
+
*/
|
|
27
|
+
export declare class PasskeyAlreadyExistsError extends Error {
|
|
28
|
+
constructor(message?: string);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Thrown when the OS biometric prompt times out (around 55s) before
|
|
33
|
+
* any user interaction. Distinct from a cancel: hosts may auto-retry
|
|
34
|
+
* since the user did not deliberately abandon the flow.
|
|
35
|
+
*/
|
|
36
|
+
export declare class PasskeyTimedOutError extends Error {
|
|
37
|
+
constructor(message?: string);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Thrown when `deriveSeeds` cannot match a credential for this RP on
|
|
42
|
+
* the device. `message` carries diagnostic detail.
|
|
43
|
+
*/
|
|
44
|
+
export declare class PasskeyCredentialNotFoundError extends Error {
|
|
45
|
+
constructor(message?: string);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Thrown when the user actively dismisses the OS passkey prompt.
|
|
50
|
+
* Distinct from `PasskeyTimedOutError`: hosts should not auto-retry a
|
|
51
|
+
* deliberate cancel.
|
|
52
|
+
*/
|
|
53
|
+
export declare class PasskeyUserCancelledError extends Error {
|
|
54
|
+
constructor(message?: string);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Web-only options for the built-in {@link PasskeyProvider}, passed as the
|
|
59
|
+
* second constructor argument. The cross-platform Relying Party / user
|
|
60
|
+
* fields live on {@link PasskeyProviderOptions} (the first argument), and
|
|
61
|
+
* are also settable on `PasskeyConfig` for the zero-config client.
|
|
62
|
+
*/
|
|
63
|
+
export interface PasskeyProviderWebOptions {
|
|
64
|
+
/**
|
|
65
|
+
* Narrows the create-time chooser to one authenticator class.
|
|
66
|
+
* `'platform'` allows only the local authenticator (Touch ID, Face
|
|
67
|
+
* ID, Windows Hello, iCloud Keychain); `'cross-platform'` only
|
|
68
|
+
* roaming keys (USB, NFC, BLE, hybrid). Unset shows all.
|
|
69
|
+
*/
|
|
70
|
+
authenticatorAttachment?: 'platform' | 'cross-platform';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* WebAuthn L3 priority hints applied to both create and get,
|
|
74
|
+
* ordering the authenticator classes a supporting browser offers
|
|
75
|
+
* first (ignored otherwise). Pass `['client-device']` to favor the
|
|
76
|
+
* platform authenticator. This is the only standards-track lever for
|
|
77
|
+
* the sign-in picker, where `authenticatorAttachment` is not allowed.
|
|
78
|
+
*/
|
|
79
|
+
hints?: ('client-device' | 'security-key' | 'hybrid')[];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Default WebAuthn `timeout` (ms) for every create and get. A hint
|
|
83
|
+
* only: platforms cap around 60s. Set it 5 to 10s under the cap so a
|
|
84
|
+
* host-side "looks like a timeout" heuristic can fire before the OS
|
|
85
|
+
* tears the prompt down. Unset uses the platform default.
|
|
86
|
+
*/
|
|
87
|
+
defaultTimeoutMs?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Built-in browser PRF provider: implements `PrfProvider` over the
|
|
92
|
+
* WebAuthn PRF extension, using discoverable credentials so no
|
|
93
|
+
* credential storage is needed.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* import { PasskeyClient } from '@breeztech/breez-sdk-spark'
|
|
98
|
+
* import { PasskeyProvider } from '@breeztech/breez-sdk-spark/passkey-prf-provider'
|
|
99
|
+
*
|
|
100
|
+
* const provider = new PasskeyProvider()
|
|
101
|
+
* const client = new PasskeyClient(provider)
|
|
102
|
+
* const { wallet } = await client.signIn({ label: 'personal' })
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare class PasskeyProvider {
|
|
106
|
+
/**
|
|
107
|
+
* Breez's shared `keys.breez.technology` RP. Pass as `rpId` to opt
|
|
108
|
+
* in (Breez-registered apps only); other apps pass their own domain.
|
|
109
|
+
*/
|
|
110
|
+
static readonly BREEZ_RP_ID: string;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Default `rpName` for the zero-config {@link PasskeyClient} /
|
|
114
|
+
* {@link PasskeyClientBuilder} path.
|
|
115
|
+
*/
|
|
116
|
+
static readonly DEFAULT_RP_NAME: string;
|
|
117
|
+
|
|
118
|
+
constructor(options?: PasskeyProviderOptions, webOptions?: PasskeyProviderWebOptions);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Derive one 32-byte PRF output per salt (in input order), pairing
|
|
122
|
+
* salts into a single ceremony where the authenticator supports it.
|
|
123
|
+
* Worst case is one prompt per salt.
|
|
124
|
+
*
|
|
125
|
+
* @throws If authentication fails, PRF is not supported, or the user cancels.
|
|
126
|
+
*/
|
|
127
|
+
deriveSeeds(salts: string[], options?: DeriveSeedOptions): Promise<DeriveSeedsResult>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Create a new PRF-capable passkey. Pass `excludeCredentials`
|
|
131
|
+
* (already-registered IDs) to prevent re-registering the same
|
|
132
|
+
* device. The `user.id` is provider-minted and returned as `userId`.
|
|
133
|
+
*
|
|
134
|
+
* @throws {PasskeyAlreadyExistsError} If an entry in
|
|
135
|
+
* `excludeCredentials` already exists on the device.
|
|
136
|
+
* @throws If the user cancels or PRF is not supported.
|
|
137
|
+
*/
|
|
138
|
+
createPasskey(excludeCredentials?: Uint8Array[]): Promise<PasskeyCredential>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Check if a PRF-capable passkey is available on this device.
|
|
142
|
+
*
|
|
143
|
+
* @returns true if WebAuthn with PRF extension is likely supported.
|
|
144
|
+
*/
|
|
145
|
+
isSupported(): Promise<boolean>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Check whether the configured `rpId` is a valid WebAuthn scope for
|
|
149
|
+
* the current origin (must be a registrable suffix of
|
|
150
|
+
* `window.location.hostname`, or equal to it). Mirrors the browser's
|
|
151
|
+
* own rule so a misconfigured `rpId` is diagnosed with a concrete
|
|
152
|
+
* reason instead of an opaque `SecurityError` at ceremony time.
|
|
153
|
+
*
|
|
154
|
+
* @returns `Associated` when in scope, `NotAssociated` with a reason
|
|
155
|
+
* when not, or `Skipped` when no `window.location` is available.
|
|
156
|
+
*/
|
|
157
|
+
checkDomainAssociation(): Promise<DomainAssociation>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Builder for a {@link PasskeyClient} with a caller-supplied
|
|
162
|
+
* `PrfProvider`. Use it when you need a configured {@link PasskeyProvider}
|
|
163
|
+
* (custom `rpId`/`rpName`, timeout overrides) or a custom PRF backend.
|
|
164
|
+
* For the zero-config Breez-RP case, use the {@link PasskeyClient}
|
|
165
|
+
* constructor directly.
|
|
166
|
+
*/
|
|
167
|
+
export declare class PasskeyClientBuilder {
|
|
168
|
+
/**
|
|
169
|
+
* @param breezApiKey - Breez relay key for authenticated (NIP-42)
|
|
170
|
+
* label storage. Omit for public relays only.
|
|
171
|
+
* @param config - `rpId` / `rpName` configure the built-in provider
|
|
172
|
+
* (ignored when one is injected via {@link withPrfProvider});
|
|
173
|
+
* `defaultLabel` is the label-store default.
|
|
174
|
+
*/
|
|
175
|
+
constructor(breezApiKey?: string, config?: PasskeyConfig);
|
|
176
|
+
|
|
177
|
+
/** Inject the `PrfProvider` the client derives seeds through. */
|
|
178
|
+
withPrfProvider(provider: PrfProvider): PasskeyClientBuilder;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Build the client, defaulting to a browser {@link PasskeyProvider}
|
|
182
|
+
* on the Breez RP when no provider was injected.
|
|
183
|
+
*/
|
|
184
|
+
build(): SdkPasskeyClient;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* High-level passkey client. The zero-config constructor wires the
|
|
189
|
+
* built-in browser {@link PasskeyProvider} on the Breez shared RP, so a
|
|
190
|
+
* Breez-registered app needs only its relay key. Apps with their own RP
|
|
191
|
+
* or a custom PRF backend inject their own provider through
|
|
192
|
+
* {@link PasskeyClientBuilder}. The instance is the underlying SDK client
|
|
193
|
+
* (`checkAvailability`, `register`, `signIn`, `labels()`).
|
|
194
|
+
*/
|
|
195
|
+
export declare class PasskeyClient extends SdkPasskeyClient {
|
|
196
|
+
/**
|
|
197
|
+
* @param breezApiKey - Breez relay key for authenticated (NIP-42)
|
|
198
|
+
* label storage. Omit for public relays only.
|
|
199
|
+
* @param config - Optional `rpId` / `rpName` for the built-in
|
|
200
|
+
* provider (default: the Breez shared RP) plus `defaultLabel`.
|
|
201
|
+
*/
|
|
202
|
+
constructor(breezApiKey?: string, config?: PasskeyConfig);
|
|
203
|
+
}
|