passkey-kit 0.3.0 → 0.4.1
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/PROPOSAL.md +397 -0
- package/README.md +4 -2
- package/cheatsheet +5 -4
- package/package.json +4 -4
- package/packages/passkey-factory-sdk/package.json +3 -3
- package/packages/passkey-factory-sdk/src/index.ts +5 -5
- package/packages/passkey-factory-sdk/types/index.d.ts +3 -2
- package/packages/passkey-kit-sdk/package.json +3 -3
- package/packages/passkey-kit-sdk/src/index.ts +21 -68
- package/packages/passkey-kit-sdk/types/index.d.ts +12 -61
- package/src/kit.ts +81 -177
- package/tsconfig.json +1 -2
- package/types/kit.d.ts +5 -7
- package/types/src/base.d.ts +9 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/kit.d.ts +53 -0
- package/types/tests/index.d.ts +1 -0
- package/TODO.md +0 -1
package/types/kit.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { PasskeyBase } from './base';
|
|
|
6
6
|
type GetContractIdFunction = (keyId: string) => Promise<string>;
|
|
7
7
|
export declare class PasskeyKit extends PasskeyBase {
|
|
8
8
|
keyId: string | undefined;
|
|
9
|
-
keyExpired: boolean | undefined;
|
|
10
9
|
wallet: PasskeyClient | undefined;
|
|
11
10
|
factory: FactoryClient;
|
|
12
11
|
networkPassphrase: Networks;
|
|
@@ -19,12 +18,12 @@ export declare class PasskeyKit extends PasskeyBase {
|
|
|
19
18
|
networkPassphrase: string;
|
|
20
19
|
factoryContractId: string;
|
|
21
20
|
});
|
|
22
|
-
createWallet(
|
|
21
|
+
createWallet(app: string, user: string): Promise<{
|
|
23
22
|
keyId: Buffer;
|
|
24
23
|
contractId: string;
|
|
25
24
|
xdr: string;
|
|
26
25
|
}>;
|
|
27
|
-
createKey(
|
|
26
|
+
createKey(app: string, user: string): Promise<{
|
|
28
27
|
keyId: Buffer;
|
|
29
28
|
publicKey: Buffer;
|
|
30
29
|
}>;
|
|
@@ -32,7 +31,7 @@ export declare class PasskeyKit extends PasskeyBase {
|
|
|
32
31
|
keyId?: string | Uint8Array;
|
|
33
32
|
getContractId?: GetContractIdFunction;
|
|
34
33
|
}): Promise<{
|
|
35
|
-
keyId:
|
|
34
|
+
keyId: Buffer;
|
|
36
35
|
contractId: string;
|
|
37
36
|
}>;
|
|
38
37
|
signAuthEntry(entry: xdr.SorobanAuthorizationEntry, options?: {
|
|
@@ -47,8 +46,7 @@ export declare class PasskeyKit extends PasskeyBase {
|
|
|
47
46
|
keyId?: 'any' | string | Uint8Array;
|
|
48
47
|
ledgersToLive?: number;
|
|
49
48
|
}): Promise<string>;
|
|
50
|
-
|
|
51
|
-
private
|
|
52
|
-
private convertEcdsaSignatureAsnToCompact;
|
|
49
|
+
private getPublicKey;
|
|
50
|
+
private compactSignature;
|
|
53
51
|
}
|
|
54
52
|
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Client as PasskeyClient } from 'passkey-kit-sdk';
|
|
2
|
+
import { Client as FactoryClient } from 'passkey-factory-sdk';
|
|
3
|
+
import { Networks, xdr, Transaction, SorobanRpc } from '@stellar/stellar-sdk';
|
|
4
|
+
import { Buffer } from 'buffer';
|
|
5
|
+
import { PasskeyBase } from './base';
|
|
6
|
+
type GetContractIdFunction = (keyId: string) => Promise<string>;
|
|
7
|
+
export declare class PasskeyKit extends PasskeyBase {
|
|
8
|
+
keyId: string | undefined;
|
|
9
|
+
keyExpired: boolean | undefined;
|
|
10
|
+
wallet: PasskeyClient | undefined;
|
|
11
|
+
factory: FactoryClient;
|
|
12
|
+
networkPassphrase: Networks;
|
|
13
|
+
rpcUrl: string;
|
|
14
|
+
rpc: SorobanRpc.Server;
|
|
15
|
+
constructor(options: {
|
|
16
|
+
rpcUrl: string;
|
|
17
|
+
launchtubeUrl?: string;
|
|
18
|
+
launchtubeJwt?: string;
|
|
19
|
+
networkPassphrase: string;
|
|
20
|
+
factoryContractId: string;
|
|
21
|
+
});
|
|
22
|
+
createWallet(name: string, user: string): Promise<{
|
|
23
|
+
keyId: Buffer;
|
|
24
|
+
contractId: string;
|
|
25
|
+
xdr: string;
|
|
26
|
+
}>;
|
|
27
|
+
createKey(name: string, user: string): Promise<{
|
|
28
|
+
keyId: Buffer;
|
|
29
|
+
publicKey: Buffer;
|
|
30
|
+
}>;
|
|
31
|
+
connectWallet(opts: {
|
|
32
|
+
keyId?: string | Uint8Array;
|
|
33
|
+
getContractId?: GetContractIdFunction;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
keyId: Buffer;
|
|
36
|
+
contractId: string;
|
|
37
|
+
}>;
|
|
38
|
+
signAuthEntry(entry: xdr.SorobanAuthorizationEntry, options?: {
|
|
39
|
+
keyId?: 'any' | string | Uint8Array;
|
|
40
|
+
ledgersToLive?: number;
|
|
41
|
+
}): Promise<xdr.SorobanAuthorizationEntry>;
|
|
42
|
+
signAuthEntries(entries: xdr.SorobanAuthorizationEntry[], options?: {
|
|
43
|
+
keyId?: 'any' | string | Uint8Array;
|
|
44
|
+
ledgersToLive?: number;
|
|
45
|
+
}): Promise<xdr.SorobanAuthorizationEntry[]>;
|
|
46
|
+
sign(txn: Transaction | string, options?: {
|
|
47
|
+
keyId?: 'any' | string | Uint8Array;
|
|
48
|
+
ledgersToLive?: number;
|
|
49
|
+
}): Promise<string>;
|
|
50
|
+
private getPublicKeyObject;
|
|
51
|
+
private convertEcdsaSignatureAsnToCompact;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/TODO.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
- [ ] Add timestamps to zephyr event data
|