passkey-kit 0.11.2 → 0.11.3
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/.claude/settings.local.json +9 -0
- package/package.json +1 -1
- package/src/kit.ts +12 -2
- package/types/kit.d.ts +4 -1
package/package.json
CHANGED
package/src/kit.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { PasskeyBase } from './base'
|
|
|
8
8
|
import { AssembledTransaction, basicNodeSigner, type AssembledTransactionOptions, type Tx } from '@stellar/stellar-sdk/minimal/contract'
|
|
9
9
|
import type { Server } from '@stellar/stellar-sdk/minimal/rpc'
|
|
10
10
|
|
|
11
|
+
// TODO we should allow setting the rpId in the constructor so we don't have to keep setting it for every call
|
|
12
|
+
// e.g. if you want to sign with a smol.xyz key on next.smol.xyz key you have to set rpId over and over again
|
|
13
|
+
|
|
11
14
|
export class PasskeyKit extends PasskeyBase {
|
|
12
15
|
declare rpc: Server
|
|
13
16
|
declare rpcUrl: string
|
|
@@ -52,8 +55,15 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
52
55
|
this.WebAuthn = WebAuthn || { startRegistration, startAuthentication }
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
public async createWallet(
|
|
56
|
-
|
|
58
|
+
public async createWallet(
|
|
59
|
+
app: string,
|
|
60
|
+
user: string,
|
|
61
|
+
settings?: {
|
|
62
|
+
rpId?: string
|
|
63
|
+
authenticatorSelection?: AuthenticatorSelectionCriteria
|
|
64
|
+
}
|
|
65
|
+
) {
|
|
66
|
+
const { rawResponse, keyId, keyIdBase64, publicKey } = await this.createKey(app, user, settings)
|
|
57
67
|
|
|
58
68
|
const at = await PasskeyClient.deploy(
|
|
59
69
|
{
|
package/types/kit.d.ts
CHANGED
|
@@ -27,7 +27,10 @@ export declare class PasskeyKit extends PasskeyBase {
|
|
|
27
27
|
startAuthentication: typeof startAuthentication;
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
|
-
createWallet(app: string, user: string
|
|
30
|
+
createWallet(app: string, user: string, settings?: {
|
|
31
|
+
rpId?: string;
|
|
32
|
+
authenticatorSelection?: AuthenticatorSelectionCriteria;
|
|
33
|
+
}): Promise<{
|
|
31
34
|
rawResponse: import("@simplewebauthn/browser").RegistrationResponseJSON;
|
|
32
35
|
keyId: Buffer<ArrayBufferLike>;
|
|
33
36
|
keyIdBase64: string;
|