passkey-kit 0.10.7 → 0.10.10

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/cheatsheet.txt CHANGED
@@ -13,6 +13,6 @@ stellar contract deploy --wasm target/wasm32-unknown-unknown/release/sample_poli
13
13
 
14
14
  export JWT=???
15
15
  mercury-cli --jwt $JWT --local false --mainnet false deploy
16
- mercury-cli --jwt $JWT --local false --mainnet false catchup --project-name "smart-wallets-next-dima" --contracts CBVTK6PLO2P7N47ABXP52SJSHSW3RJRS3SGZHQMLZCQ3SLP36IN3FS7X
16
+ mercury-cli --jwt $JWT --local false --mainnet false catchup --project-name "smart-wallets-next-dima" --contracts CDJWTBQTTGWZVJNS4UC47DIBKEYGDV2YHRAYBD3A2ZLWVXFI6LHYZQPA
17
17
  curl -X GET https://api.mercurydata.app/catchups/4
18
18
  curl -X POST https://api.mercurydata.app/v2/key -H "Authorization: Bearer $JWT"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passkey-kit",
3
- "version": "0.10.7",
3
+ "version": "0.10.10",
4
4
  "description": "A helper library for creating and using smart wallet accounts on the Stellar blockchain.",
5
5
  "author": "Tyler van der Hoeven",
6
6
  "license": "MIT",
@@ -9,11 +9,11 @@
9
9
  "types": "types/index.d.ts",
10
10
  "dependencies": {
11
11
  "@simplewebauthn/browser": "^13.0.0",
12
- "@stellar/stellar-sdk": "^13.0.0",
12
+ "@stellar/stellar-sdk": "^13.1.0",
13
13
  "base64url": "^3.0.1",
14
14
  "buffer": "^6.0.3",
15
- "passkey-kit-sdk": "0.6.3",
16
- "sac-sdk": "0.3.3"
15
+ "passkey-kit-sdk": "0.6.5",
16
+ "sac-sdk": "0.3.5"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@simplewebauthn/types": "^12.0.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.3",
2
+ "version": "0.6.5",
3
3
  "name": "passkey-kit-sdk",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "buffer": "6.0.3",
13
- "@stellar/stellar-sdk": "13.0.0"
13
+ "@stellar/stellar-sdk": "13.1.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "5.7.2"
@@ -3,6 +3,7 @@ import {
3
3
  AssembledTransaction,
4
4
  Client as ContractClient,
5
5
  ClientOptions as ContractClientOptions,
6
+ MethodOptions,
6
7
  Spec as ContractSpec,
7
8
  } from '@stellar/stellar-sdk/minimal/contract';
8
9
  import type {
@@ -26,21 +27,20 @@ export const Errors = {
26
27
  8: { message: "ClientDataJsonChallengeIncorrect" },
27
28
  9: { message: "JsonParseError" }
28
29
  }
29
-
30
- export type SignerLimits = readonly [Map<string, Option<Array<SignerKey>>>];
31
- export type SignerKey = { tag: "Policy", values: readonly [string] } | { tag: "Ed25519", values: readonly [Buffer] } | { tag: "Secp256r1", values: readonly [Buffer] };
32
- export type SignerVal = { tag: "Policy", values: readonly [Option<u32>, SignerLimits] } | { tag: "Ed25519", values: readonly [Option<u32>, SignerLimits] } | { tag: "Secp256r1", values: readonly [Buffer, Option<u32>, SignerLimits] };
30
+ export type SignerExpiration = readonly [Option<u32>];
31
+ export type SignerLimits = readonly [Option<Map<string, Option<Array<SignerKey>>>>];
33
32
  export type SignerStorage = { tag: "Persistent", values: void } | { tag: "Temporary", values: void };
34
- export type Signer = { tag: "Policy", values: readonly [string, Option<u32>, SignerLimits, SignerStorage] } | { tag: "Ed25519", values: readonly [Buffer, Option<u32>, SignerLimits, SignerStorage] } | { tag: "Secp256r1", values: readonly [Buffer, Buffer, Option<u32>, SignerLimits, SignerStorage] };
33
+ export type Signer = { tag: "Policy", values: readonly [string, SignerExpiration, SignerLimits, SignerStorage] } | { tag: "Ed25519", values: readonly [Buffer, SignerExpiration, SignerLimits, SignerStorage] } | { tag: "Secp256r1", values: readonly [Buffer, Buffer, SignerExpiration, SignerLimits, SignerStorage] };
34
+ export type SignerKey = { tag: "Policy", values: readonly [string] } | { tag: "Ed25519", values: readonly [Buffer] } | { tag: "Secp256r1", values: readonly [Buffer] };
35
+ export type SignerVal = { tag: "Policy", values: readonly [SignerExpiration, SignerLimits] } | { tag: "Ed25519", values: readonly [SignerExpiration, SignerLimits] } | { tag: "Secp256r1", values: readonly [Buffer, SignerExpiration, SignerLimits] };
35
36
 
36
37
  export interface Secp256r1Signature {
37
38
  authenticator_data: Buffer;
38
39
  client_data_json: Buffer;
39
40
  signature: Buffer;
40
41
  }
41
-
42
- export type Signature = { tag: "Ed25519", values: readonly [Buffer] } | { tag: "Secp256r1", values: readonly [Secp256r1Signature] };
43
- export type Signatures = readonly [Map<SignerKey, Option<Signature>>];
42
+ export type Signature = { tag: "Policy", values: void } | { tag: "Ed25519", values: readonly [Buffer] } | { tag: "Secp256r1", values: readonly [Secp256r1Signature] };
43
+ export type Signatures = readonly [Map<SignerKey, Signature>];
44
44
 
45
45
  export interface Client {
46
46
  /**
@@ -124,18 +124,35 @@ export interface Client {
124
124
  }) => Promise<AssembledTransaction<null>>
125
125
  }
126
126
  export class Client extends ContractClient {
127
+ static async deploy<T = Client>(
128
+ /** Constructor/Initialization Args for the contract's `__constructor` method */
129
+ { signer }: { signer: Signer },
130
+ /** Options for initalizing a Client as well as for calling a method, with extras specific to deploying. */
131
+ options: MethodOptions &
132
+ Omit<ContractClientOptions, "contractId"> & {
133
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
134
+ wasmHash: Buffer | string;
135
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
136
+ salt?: Buffer | Uint8Array;
137
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
138
+ format?: "hex" | "base64";
139
+ }
140
+ ): Promise<AssembledTransaction<T>> {
141
+ return ContractClient.deploy({ signer }, options)
142
+ }
127
143
  constructor(public readonly options: ContractClientOptions) {
128
144
  super(
129
145
  new ContractSpec(["AAAABAAAAAAAAAAAA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yAAAAAAAA",
153
+ "AAAAAgAAAAAAAAAAAAAACVNpZ25hdHVyZQAAAAAAAAMAAAAAAAAAAAAAAAZQb2xpY3kAAAAAAAEAAAAAAAAAB0VkMjU1MTkAAAAAAQAAA+4AAABAAAAAAQAAAAAAAAAJU2VjcDI1NnIxAAAAAAAAAQAAB9AAAAASU2VjcDI1NnIxU2lnbmF0dXJlAAA=",
154
+ "AAAAAQAAAAAAAAAAAAAAClNpZ25hdHVyZXMAAAAAAAEAAAAAAAAAATAAAAAAAAPsAAAH0AAAAAlTaWduZXJLZXkAAAAAAAfQAAAACVNpZ25hdHVyZQAAAA==",
155
+ "AAAAAAAAAAAAAAANX19jb25zdHJ1Y3RvcgAAAAAAAAEAAAAAAAAABnNpZ25lcgAAAAAH0AAAAAZTaWduZXIAAAAAAAA=",
139
156
  "AAAAAAAAAAAAAAAKYWRkX3NpZ25lcgAAAAAAAQAAAAAAAAAGc2lnbmVyAAAAAAfQAAAABlNpZ25lcgAAAAAAAA==",
140
157
  "AAAAAAAAAAAAAAANdXBkYXRlX3NpZ25lcgAAAAAAAAEAAAAAAAAABnNpZ25lcgAAAAAH0AAAAAZTaWduZXIAAAAAAAA=",
141
158
  "AAAAAAAAAAAAAAANcmVtb3ZlX3NpZ25lcgAAAAAAAAEAAAAAAAAACnNpZ25lcl9rZXkAAAAAB9AAAAAJU2lnbmVyS2V5AAAAAAAAAA==",
@@ -1,5 +1,5 @@
1
1
  import { Buffer } from "buffer";
2
- import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from '@stellar/stellar-sdk/minimal/contract';
2
+ import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/minimal/contract';
3
3
  import type { u32, Option } from '@stellar/stellar-sdk/minimal/contract';
4
4
  export declare const Errors: {
5
5
  1: {
@@ -30,43 +30,44 @@ export declare const Errors: {
30
30
  message: string;
31
31
  };
32
32
  };
33
- export type SignerLimits = readonly [Map<string, Option<Array<SignerKey>>>];
34
- export type SignerKey = {
33
+ export type SignerExpiration = readonly [Option<u32>];
34
+ export type SignerLimits = readonly [Option<Map<string, Option<Array<SignerKey>>>>];
35
+ export type SignerStorage = {
36
+ tag: "Persistent";
37
+ values: void;
38
+ } | {
39
+ tag: "Temporary";
40
+ values: void;
41
+ };
42
+ export type Signer = {
35
43
  tag: "Policy";
36
- values: readonly [string];
44
+ values: readonly [string, SignerExpiration, SignerLimits, SignerStorage];
37
45
  } | {
38
46
  tag: "Ed25519";
39
- values: readonly [Buffer];
47
+ values: readonly [Buffer, SignerExpiration, SignerLimits, SignerStorage];
40
48
  } | {
41
49
  tag: "Secp256r1";
42
- values: readonly [Buffer];
50
+ values: readonly [Buffer, Buffer, SignerExpiration, SignerLimits, SignerStorage];
43
51
  };
44
- export type SignerVal = {
52
+ export type SignerKey = {
45
53
  tag: "Policy";
46
- values: readonly [Option<u32>, SignerLimits];
54
+ values: readonly [string];
47
55
  } | {
48
56
  tag: "Ed25519";
49
- values: readonly [Option<u32>, SignerLimits];
57
+ values: readonly [Buffer];
50
58
  } | {
51
59
  tag: "Secp256r1";
52
- values: readonly [Buffer, Option<u32>, SignerLimits];
53
- };
54
- export type SignerStorage = {
55
- tag: "Persistent";
56
- values: void;
57
- } | {
58
- tag: "Temporary";
59
- values: void;
60
+ values: readonly [Buffer];
60
61
  };
61
- export type Signer = {
62
+ export type SignerVal = {
62
63
  tag: "Policy";
63
- values: readonly [string, Option<u32>, SignerLimits, SignerStorage];
64
+ values: readonly [SignerExpiration, SignerLimits];
64
65
  } | {
65
66
  tag: "Ed25519";
66
- values: readonly [Buffer, Option<u32>, SignerLimits, SignerStorage];
67
+ values: readonly [SignerExpiration, SignerLimits];
67
68
  } | {
68
69
  tag: "Secp256r1";
69
- values: readonly [Buffer, Buffer, Option<u32>, SignerLimits, SignerStorage];
70
+ values: readonly [Buffer, SignerExpiration, SignerLimits];
70
71
  };
71
72
  export interface Secp256r1Signature {
72
73
  authenticator_data: Buffer;
@@ -74,13 +75,16 @@ export interface Secp256r1Signature {
74
75
  signature: Buffer;
75
76
  }
76
77
  export type Signature = {
78
+ tag: "Policy";
79
+ values: void;
80
+ } | {
77
81
  tag: "Ed25519";
78
82
  values: readonly [Buffer];
79
83
  } | {
80
84
  tag: "Secp256r1";
81
85
  values: readonly [Secp256r1Signature];
82
86
  };
83
- export type Signatures = readonly [Map<SignerKey, Option<Signature>>];
87
+ export type Signatures = readonly [Map<SignerKey, Signature>];
84
88
  export interface Client {
85
89
  /**
86
90
  * Construct and simulate a add_signer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
@@ -161,6 +165,20 @@ export interface Client {
161
165
  }
162
166
  export declare class Client extends ContractClient {
163
167
  readonly options: ContractClientOptions;
168
+ static deploy<T = Client>(
169
+ /** Constructor/Initialization Args for the contract's `__constructor` method */
170
+ { signer }: {
171
+ signer: Signer;
172
+ },
173
+ /** Options for initalizing a Client as well as for calling a method, with extras specific to deploying. */
174
+ options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
175
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
176
+ wasmHash: Buffer | string;
177
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
178
+ salt?: Buffer | Uint8Array;
179
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
180
+ format?: "hex" | "base64";
181
+ }): Promise<AssembledTransaction<T>>;
164
182
  constructor(options: ContractClientOptions);
165
183
  readonly fromJSON: {
166
184
  add_signer: (json: string) => AssembledTransaction<null>;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.3",
2
+ "version": "0.3.5",
3
3
  "name": "sac-sdk",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "buffer": "6.0.3",
13
- "@stellar/stellar-sdk": "13.0.0"
13
+ "@stellar/stellar-sdk": "13.1.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "5.7.2"
@@ -3,6 +3,7 @@ import {
3
3
  AssembledTransaction,
4
4
  Client as ContractClient,
5
5
  ClientOptions as ContractClientOptions,
6
+ MethodOptions,
6
7
  Spec as ContractSpec,
7
8
  } from '@stellar/stellar-sdk/minimal/contract';
8
9
  import type {
@@ -15,10 +16,6 @@ if (typeof window !== 'undefined') {
15
16
  window.Buffer = window.Buffer || Buffer;
16
17
  }
17
18
 
18
- export const Errors = {
19
-
20
- }
21
-
22
19
  export interface Client {
23
20
  /**
24
21
  * Construct and simulate a allowance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
@@ -524,6 +521,20 @@ export interface Client {
524
521
  }) => Promise<AssembledTransaction<null>>
525
522
  }
526
523
  export class Client extends ContractClient {
524
+ static async deploy<T = Client>(
525
+ /** Options for initalizing a Client as well as for calling a method, with extras specific to deploying. */
526
+ options: MethodOptions &
527
+ Omit<ContractClientOptions, "contractId"> & {
528
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
529
+ wasmHash: Buffer | string;
530
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
531
+ salt?: Buffer | Uint8Array;
532
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
533
+ format?: "hex" | "base64";
534
+ }
535
+ ): Promise<AssembledTransaction<T>> {
536
+ return ContractClient.deploy(null, options)
537
+ }
527
538
  constructor(public readonly options: ContractClientOptions) {
528
539
  super(
529
540
  new ContractSpec(["AAAAAAAAAYpSZXR1cm5zIHRoZSBhbGxvd2FuY2UgZm9yIGBzcGVuZGVyYCB0byB0cmFuc2ZlciBmcm9tIGBmcm9tYC4KClRoZSBhbW91bnQgcmV0dXJuZWQgaXMgdGhlIGFtb3VudCB0aGF0IHNwZW5kZXIgaXMgYWxsb3dlZCB0byB0cmFuc2ZlcgpvdXQgb2YgZnJvbSdzIGJhbGFuY2UuIFdoZW4gdGhlIHNwZW5kZXIgdHJhbnNmZXJzIGFtb3VudHMsIHRoZSBhbGxvd2FuY2UKd2lsbCBiZSByZWR1Y2VkIGJ5IHRoZSBhbW91bnQgdHJhbnNmZXJyZWQuCgojIEFyZ3VtZW50cwoKKiBgZnJvbWAgLSBUaGUgYWRkcmVzcyBob2xkaW5nIHRoZSBiYWxhbmNlIG9mIHRva2VucyB0byBiZSBkcmF3biBmcm9tLgoqIGBzcGVuZGVyYCAtIFRoZSBhZGRyZXNzIHNwZW5kaW5nIHRoZSB0b2tlbnMgaGVsZCBieSBgZnJvbWAuAAAAAAAJYWxsb3dhbmNlAAAAAAAAAgAAAAAAAAAEZnJvbQAAABMAAAAAAAAAB3NwZW5kZXIAAAAAEwAAAAEAAAAL",
@@ -1,6 +1,6 @@
1
- import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from '@stellar/stellar-sdk/minimal/contract';
1
+ import { Buffer } from "buffer";
2
+ import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/minimal/contract';
2
3
  import type { u32, i128 } from '@stellar/stellar-sdk/minimal/contract';
3
- export declare const Errors: {};
4
4
  export interface Client {
5
5
  /**
6
6
  * Construct and simulate a allowance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
@@ -499,6 +499,16 @@ export interface Client {
499
499
  }
500
500
  export declare class Client extends ContractClient {
501
501
  readonly options: ContractClientOptions;
502
+ static deploy<T = Client>(
503
+ /** Options for initalizing a Client as well as for calling a method, with extras specific to deploying. */
504
+ options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
505
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
506
+ wasmHash: Buffer | string;
507
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
508
+ salt?: Buffer | Uint8Array;
509
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
510
+ format?: "hex" | "base64";
511
+ }): Promise<AssembledTransaction<T>>;
502
512
  constructor(options: ContractClientOptions);
503
513
  readonly fromJSON: {
504
514
  allowance: (json: string) => AssembledTransaction<bigint>;
package/src/kit.ts CHANGED
@@ -55,8 +55,8 @@ export class PasskeyKit extends PasskeyBase {
55
55
  values: [
56
56
  keyId,
57
57
  publicKey,
58
- undefined,
59
- [new Map()],
58
+ [undefined],
59
+ [undefined],
60
60
  { tag: 'Persistent', values: undefined },
61
61
  ]
62
62
  }
@@ -258,6 +258,10 @@ export class PasskeyKit extends PasskeyBase {
258
258
  tag: "Policy",
259
259
  values: [policy]
260
260
  }
261
+ val = {
262
+ tag: "Policy",
263
+ values: undefined,
264
+ }
261
265
  }
262
266
 
263
267
  // Sign with the keypair as an ed25519 signer
@@ -445,7 +449,7 @@ export class PasskeyKit extends PasskeyBase {
445
449
  values: [
446
450
  Buffer.from(keyId),
447
451
  Buffer.from(publicKey),
448
- expiration,
452
+ [expiration],
449
453
  this.getSignerLimits(limits),
450
454
  { tag: store, values: undefined },
451
455
  ],
@@ -458,7 +462,7 @@ export class PasskeyKit extends PasskeyBase {
458
462
  tag: "Ed25519",
459
463
  values: [
460
464
  Keypair.fromPublicKey(publicKey).rawPublicKey(),
461
- expiration,
465
+ [expiration],
462
466
  this.getSignerLimits(limits),
463
467
  { tag: store, values: undefined },
464
468
  ],
@@ -471,7 +475,7 @@ export class PasskeyKit extends PasskeyBase {
471
475
  tag: "Policy",
472
476
  values: [
473
477
  policy,
474
- expiration,
478
+ [expiration],
475
479
  this.getSignerLimits(limits),
476
480
  { tag: store, values: undefined },
477
481
  ],
@@ -485,6 +489,9 @@ export class PasskeyKit extends PasskeyBase {
485
489
  */
486
490
 
487
491
  private getSignerLimits(limits: SignerLimits) {
492
+ if (!limits)
493
+ return [undefined] as SDKSignerLimits
494
+
488
495
  const sdk_limits: SDKSignerLimits = [new Map()]
489
496
 
490
497
  for (const [contract, signer_keys] of limits.entries()) {
@@ -500,7 +507,7 @@ export class PasskeyKit extends PasskeyBase {
500
507
  }
501
508
  }
502
509
 
503
- sdk_limits[0].set(contract, sdk_signer_keys)
510
+ sdk_limits[0]?.set(contract, sdk_signer_keys)
504
511
  }
505
512
 
506
513
  return sdk_limits
package/src/types.ts CHANGED
@@ -24,7 +24,7 @@ export class SignerKey {
24
24
  }
25
25
  }
26
26
 
27
- export type SignerLimits = Map<string, SignerKey[] | undefined>
27
+ export type SignerLimits = Map<string, SignerKey[] | undefined> | undefined
28
28
 
29
29
  export enum SignerStore {
30
30
  Persistent = 'Persistent',
package/types/types.d.ts CHANGED
@@ -15,7 +15,7 @@ export declare class SignerKey {
15
15
  static Ed25519(publicKey: string): SignerKey;
16
16
  static Secp256r1(id: string): SignerKey;
17
17
  }
18
- export type SignerLimits = Map<string, SignerKey[] | undefined>;
18
+ export type SignerLimits = Map<string, SignerKey[] | undefined> | undefined;
19
19
  export declare enum SignerStore {
20
20
  Persistent = "Persistent",
21
21
  Temporary = "Temporary"