passkey-kit 0.12.0 → 0.13.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.
Files changed (172) hide show
  1. package/README.md +399 -227
  2. package/{types → dist}/base.d.ts +2 -1
  3. package/dist/base.d.ts.map +1 -0
  4. package/{src/base.ts → dist/base.js} +8 -10
  5. package/dist/base.js.map +1 -0
  6. package/dist/base64url.d.ts +18 -0
  7. package/dist/base64url.d.ts.map +1 -0
  8. package/dist/base64url.js +18 -0
  9. package/dist/base64url.js.map +1 -0
  10. package/dist/constants.d.ts +87 -0
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/constants.js +111 -0
  13. package/dist/constants.js.map +1 -0
  14. package/dist/contract-errors.d.ts +69 -0
  15. package/dist/contract-errors.d.ts.map +1 -0
  16. package/dist/contract-errors.js +129 -0
  17. package/dist/contract-errors.js.map +1 -0
  18. package/dist/errors.d.ts +163 -0
  19. package/dist/errors.d.ts.map +1 -0
  20. package/dist/errors.js +244 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/events.d.ts +94 -0
  23. package/dist/events.d.ts.map +1 -0
  24. package/dist/events.js +92 -0
  25. package/dist/events.js.map +1 -0
  26. package/dist/index.d.ts +22 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +36 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/indexer/codec.d.ts +18 -0
  31. package/dist/indexer/codec.d.ts.map +1 -0
  32. package/dist/indexer/codec.js +32 -0
  33. package/dist/indexer/codec.js.map +1 -0
  34. package/dist/indexer/index.d.ts +25 -0
  35. package/dist/indexer/index.d.ts.map +1 -0
  36. package/dist/indexer/index.js +34 -0
  37. package/dist/indexer/index.js.map +1 -0
  38. package/dist/indexer/mercury.d.ts +88 -0
  39. package/dist/indexer/mercury.d.ts.map +1 -0
  40. package/dist/indexer/mercury.js +237 -0
  41. package/dist/indexer/mercury.js.map +1 -0
  42. package/dist/indexer/stellar-indexer.d.ts +115 -0
  43. package/dist/indexer/stellar-indexer.d.ts.map +1 -0
  44. package/dist/indexer/stellar-indexer.js +279 -0
  45. package/dist/indexer/stellar-indexer.js.map +1 -0
  46. package/dist/indexer/types.d.ts +73 -0
  47. package/dist/indexer/types.d.ts.map +1 -0
  48. package/dist/indexer/types.js +9 -0
  49. package/dist/indexer/types.js.map +1 -0
  50. package/dist/kit/auth-payload.d.ts +89 -0
  51. package/dist/kit/auth-payload.d.ts.map +1 -0
  52. package/dist/kit/auth-payload.js +203 -0
  53. package/dist/kit/auth-payload.js.map +1 -0
  54. package/dist/kit/deploy-ops.d.ts +45 -0
  55. package/dist/kit/deploy-ops.d.ts.map +1 -0
  56. package/dist/kit/deploy-ops.js +69 -0
  57. package/dist/kit/deploy-ops.js.map +1 -0
  58. package/dist/kit/tx-ops.d.ts +92 -0
  59. package/dist/kit/tx-ops.d.ts.map +1 -0
  60. package/dist/kit/tx-ops.js +113 -0
  61. package/dist/kit/tx-ops.js.map +1 -0
  62. package/dist/kit/wallet-ops.d.ts +59 -0
  63. package/dist/kit/wallet-ops.d.ts.map +1 -0
  64. package/dist/kit/wallet-ops.js +122 -0
  65. package/dist/kit/wallet-ops.js.map +1 -0
  66. package/dist/kit/webauthn-ops.d.ts +55 -0
  67. package/dist/kit/webauthn-ops.d.ts.map +1 -0
  68. package/dist/kit/webauthn-ops.js +79 -0
  69. package/dist/kit/webauthn-ops.js.map +1 -0
  70. package/dist/kit.d.ts +128 -0
  71. package/dist/kit.d.ts.map +1 -0
  72. package/dist/kit.js +276 -0
  73. package/dist/kit.js.map +1 -0
  74. package/dist/managers/credential-manager.d.ts +39 -0
  75. package/dist/managers/credential-manager.d.ts.map +1 -0
  76. package/dist/managers/credential-manager.js +47 -0
  77. package/dist/managers/credential-manager.js.map +1 -0
  78. package/dist/managers/index.d.ts +7 -0
  79. package/dist/managers/index.d.ts.map +1 -0
  80. package/dist/managers/index.js +7 -0
  81. package/dist/managers/index.js.map +1 -0
  82. package/dist/managers/signer-manager.d.ts +51 -0
  83. package/dist/managers/signer-manager.d.ts.map +1 -0
  84. package/dist/managers/signer-manager.js +92 -0
  85. package/dist/managers/signer-manager.js.map +1 -0
  86. package/dist/managers/submission-manager.d.ts +52 -0
  87. package/dist/managers/submission-manager.d.ts.map +1 -0
  88. package/dist/managers/submission-manager.js +77 -0
  89. package/dist/managers/submission-manager.js.map +1 -0
  90. package/dist/relayer.d.ts +61 -0
  91. package/dist/relayer.d.ts.map +1 -0
  92. package/dist/relayer.js +119 -0
  93. package/dist/relayer.js.map +1 -0
  94. package/dist/rpc-data.d.ts +35 -0
  95. package/dist/rpc-data.d.ts.map +1 -0
  96. package/dist/rpc-data.js +49 -0
  97. package/dist/rpc-data.js.map +1 -0
  98. package/dist/sac.d.ts +31 -0
  99. package/dist/sac.d.ts.map +1 -0
  100. package/dist/sac.js +47 -0
  101. package/dist/sac.js.map +1 -0
  102. package/dist/server.d.ts +79 -0
  103. package/dist/server.d.ts.map +1 -0
  104. package/dist/server.js +152 -0
  105. package/dist/server.js.map +1 -0
  106. package/dist/signers.d.ts +83 -0
  107. package/dist/signers.d.ts.map +1 -0
  108. package/dist/signers.js +124 -0
  109. package/dist/signers.js.map +1 -0
  110. package/dist/storage/index.d.ts +13 -0
  111. package/dist/storage/index.d.ts.map +1 -0
  112. package/dist/storage/index.js +12 -0
  113. package/dist/storage/index.js.map +1 -0
  114. package/dist/storage/indexeddb.d.ts +26 -0
  115. package/dist/storage/indexeddb.d.ts.map +1 -0
  116. package/dist/storage/indexeddb.js +100 -0
  117. package/dist/storage/indexeddb.js.map +1 -0
  118. package/dist/storage/localStorage.d.ts +22 -0
  119. package/dist/storage/localStorage.d.ts.map +1 -0
  120. package/dist/storage/localStorage.js +86 -0
  121. package/dist/storage/localStorage.js.map +1 -0
  122. package/dist/storage/memory.d.ts +18 -0
  123. package/dist/storage/memory.d.ts.map +1 -0
  124. package/dist/storage/memory.js +41 -0
  125. package/dist/storage/memory.js.map +1 -0
  126. package/dist/types.d.ts +136 -0
  127. package/dist/types.d.ts.map +1 -0
  128. package/dist/types.js +39 -0
  129. package/dist/types.js.map +1 -0
  130. package/dist/utils.d.ts +52 -0
  131. package/dist/utils.d.ts.map +1 -0
  132. package/dist/utils.js +153 -0
  133. package/dist/utils.js.map +1 -0
  134. package/dist/validation.d.ts +40 -0
  135. package/dist/validation.d.ts.map +1 -0
  136. package/dist/validation.js +73 -0
  137. package/dist/validation.js.map +1 -0
  138. package/dist/version.d.ts +7 -0
  139. package/dist/version.d.ts.map +1 -0
  140. package/dist/version.js +9 -0
  141. package/dist/version.js.map +1 -0
  142. package/package.json +48 -20
  143. package/.claude/settings.local.json +0 -20
  144. package/.cursorrules +0 -170
  145. package/.gitattributes +0 -2
  146. package/.github/workflows/release.yml +0 -21
  147. package/.vscode/settings.json +0 -6
  148. package/PROPOSAL.md +0 -397
  149. package/cheatsheet.txt +0 -18
  150. package/clone-js-sdk.sh +0 -21
  151. package/packages/passkey-kit-sdk/README.md +0 -54
  152. package/packages/passkey-kit-sdk/package.json +0 -18
  153. package/packages/passkey-kit-sdk/src/index.ts +0 -171
  154. package/packages/passkey-kit-sdk/tsconfig.json +0 -98
  155. package/packages/passkey-kit-sdk/types/index.d.ts +0 -190
  156. package/packages/sac-sdk/README.md +0 -54
  157. package/packages/sac-sdk/package.json +0 -18
  158. package/packages/sac-sdk/src/index.ts +0 -586
  159. package/packages/sac-sdk/tsconfig.json +0 -98
  160. package/packages/sac-sdk/types/index.d.ts +0 -532
  161. package/pnpm-workspace.yaml +0 -2
  162. package/src/index.ts +0 -5
  163. package/src/kit.ts +0 -698
  164. package/src/sac.ts +0 -29
  165. package/src/server.ts +0 -179
  166. package/src/types.ts +0 -32
  167. package/tsconfig.json +0 -28
  168. package/types/index.d.ts +0 -5
  169. package/types/kit.d.ts +0 -89
  170. package/types/sac.d.ts +0 -13
  171. package/types/server.d.ts +0 -29
  172. package/types/types.d.ts +0 -22
@@ -1,6 +1,7 @@
1
- import { Server } from "@stellar/stellar-sdk/minimal/rpc";
1
+ import { Server } from "@stellar/stellar-sdk/rpc";
2
2
  export declare class PasskeyBase {
3
3
  rpcUrl: string | undefined;
4
4
  rpc: Server | undefined;
5
5
  constructor(rpcUrl?: string);
6
6
  }
7
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAOjD,qBAAa,WAAW;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;gBAElB,MAAM,CAAC,EAAE,MAAM;CAM9B"}
@@ -1,18 +1,16 @@
1
- import { Server } from "@stellar/stellar-sdk/minimal/rpc"
2
-
1
+ import { Server } from "@stellar/stellar-sdk/rpc";
3
2
  // TODO consider adding support for a signAuthEntry method that conforms to the ed25519 signature scheme of this passkey interface
4
3
  // once we do that we can clean the code a little with the `xdr.HashIdPreimage.envelopeTypeSorobanAuthorization` stuff
5
4
  // ... note I've re-read the above and I've currently got no clue what this is asking for. Maybe check git-blame for when it was added to try and find some context
6
5
  // actually this is just talking about adding support for signing transactions with an ed25519 key as well as a passkey. Simple enough
7
-
8
6
  export class PasskeyBase {
9
- public rpcUrl: string | undefined
10
- public rpc: Server | undefined
11
-
12
- constructor(rpcUrl?: string) {
7
+ rpcUrl;
8
+ rpc;
9
+ constructor(rpcUrl) {
13
10
  if (rpcUrl) {
14
- this.rpcUrl = rpcUrl
15
- this.rpc = new Server(rpcUrl)
11
+ this.rpcUrl = rpcUrl;
12
+ this.rpc = new Server(rpcUrl);
16
13
  }
17
14
  }
18
- }
15
+ }
16
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEjD,kIAAkI;AAClI,sHAAsH;AACtH,mKAAmK;AACnK,sIAAsI;AAEtI,MAAM,OAAO,WAAW;IACb,MAAM,CAAoB;IAC1B,GAAG,CAAoB;IAE9B,YAAY,MAAe;QACvB,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;YACpB,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;QACjC,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `base64url` interop shim.
3
+ *
4
+ * The `base64url` package ships ESM-style type declarations
5
+ * (`export default base64url`) over a CommonJS runtime. Under NodeNext module
6
+ * resolution the default import is typed as the module namespace object rather
7
+ * than the callable `Base64Url`, so both calling it (`base64url(...)`) and
8
+ * member access (`base64url.toBuffer(...)`) fail to type-check. At runtime
9
+ * `esModuleInterop` already yields the callable, so this is a type-only
10
+ * correction, centralized here rather than repeated at every call site.
11
+ *
12
+ * Every module in the kit imports base64url from here, never directly from the
13
+ * package, so the interop fix lives in exactly one place.
14
+ */
15
+ import { type Base64Url } from "base64url";
16
+ declare const base64url: Base64Url;
17
+ export default base64url;
18
+ //# sourceMappingURL=base64url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64url.d.ts","sourceRoot":"","sources":["../src/base64url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAyB,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE7D,QAAA,MAAM,SAAS,EAAkC,SAAS,CAAC;AAE3D,eAAe,SAAS,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `base64url` interop shim.
3
+ *
4
+ * The `base64url` package ships ESM-style type declarations
5
+ * (`export default base64url`) over a CommonJS runtime. Under NodeNext module
6
+ * resolution the default import is typed as the module namespace object rather
7
+ * than the callable `Base64Url`, so both calling it (`base64url(...)`) and
8
+ * member access (`base64url.toBuffer(...)`) fail to type-check. At runtime
9
+ * `esModuleInterop` already yields the callable, so this is a type-only
10
+ * correction, centralized here rather than repeated at every call site.
11
+ *
12
+ * Every module in the kit imports base64url from here, never directly from the
13
+ * package, so the interop fix lives in exactly one place.
14
+ */
15
+ import base64urlDefault from "base64url";
16
+ const base64url = base64urlDefault;
17
+ export default base64url;
18
+ //# sourceMappingURL=base64url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64url.js","sourceRoot":"","sources":["../src/base64url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,gBAAoC,MAAM,WAAW,CAAC;AAE7D,MAAM,SAAS,GAAG,gBAAwC,CAAC;AAE3D,eAAe,SAAS,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Constants used throughout the Passkey Kit SDK.
3
+ *
4
+ * Cryptographic sizes mirror the smart-wallet contract; the deployer seed is
5
+ * load-bearing for deterministic contract-id derivation (see below).
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ /** Size of an uncompressed secp256r1 (P-256) public key, in bytes. */
10
+ export declare const SECP256R1_PUBLIC_KEY_SIZE = 65;
11
+ /** First byte of an uncompressed secp256r1 public key (0x04). */
12
+ export declare const UNCOMPRESSED_PUBKEY_PREFIX = 4;
13
+ /** Size of an Ed25519 public key, in bytes. */
14
+ export declare const ED25519_PUBLIC_KEY_SIZE = 32;
15
+ /** Size of an Ed25519 signature, in bytes. */
16
+ export declare const ED25519_SIGNATURE_SIZE = 64;
17
+ /**
18
+ * Order (n) of the secp256r1 (P-256) curve, used to enforce low-S signatures.
19
+ * @see https://github.com/stellar/stellar-protocol/discussions/1435
20
+ */
21
+ export declare const SECP256R1_CURVE_ORDER: bigint;
22
+ /** Default timeout for WebAuthn ceremonies, in milliseconds. */
23
+ export declare const WEBAUTHN_TIMEOUT_MS = 60000;
24
+ /** Length, in bytes, of a randomly generated WebAuthn challenge. */
25
+ export declare const WEBAUTHN_CHALLENGE_SIZE = 32;
26
+ /**
27
+ * Seed for the default (deterministic) deployer keypair.
28
+ *
29
+ * The deployer keypair is derived as
30
+ * `Keypair.fromRawEd25519Seed(sha256(utf8(DEFAULT_DEPLOYER_SEED)))`. Deriving it
31
+ * from a fixed, well-known string makes smart-wallet contract IDs reproducible
32
+ * across clients from a passkey credential ID alone (`salt = sha256(keyId)`,
33
+ * `deployer = this keypair`), which is exactly what the indexer reverse-lookup
34
+ * (keyId → contract) depends on.
35
+ *
36
+ * This value MUST remain `"kalepail"`: every wallet ever deployed by passkey-kit
37
+ * used this deployer, and the derivation is load-bearing for discovery. The
38
+ * deployer only pays fees and salts the deploy — it never controls the wallet —
39
+ * but it IS a shared, publicly-derivable keypair. Provide your own
40
+ * `deploySource` secret for a dedicated fee payer (note: a different deployer
41
+ * changes the derived contract addresses and breaks keyId → contract discovery).
42
+ */
43
+ export declare const DEFAULT_DEPLOYER_SEED = "kalepail";
44
+ /**
45
+ * Default transaction timeout, in seconds.
46
+ *
47
+ * The OpenZeppelin Relayer requires a time-bound of <= 30s on submitted
48
+ * transactions, so the kit defaults to that.
49
+ */
50
+ export declare const DEFAULT_TIMEOUT_SECONDS = 30;
51
+ /** Default IndexedDB database name for passkey credential storage. */
52
+ export declare const DB_NAME = "passkey-kit";
53
+ /** Current IndexedDB schema version. */
54
+ export declare const DB_VERSION = 1;
55
+ /** IndexedDB object-store name for passkey credentials. */
56
+ export declare const IDB_STORE_CREDENTIALS = "credentials";
57
+ /** IndexedDB index name for contract-id lookups. */
58
+ export declare const IDB_INDEX_CONTRACT_ID = "contractId";
59
+ /** localStorage key under which passkey credentials are persisted. */
60
+ export declare const LOCALSTORAGE_CREDENTIALS_KEY = "passkey-kit:credentials";
61
+ /**
62
+ * Default relayer request timeout, in milliseconds (6 minutes).
63
+ *
64
+ * Long enough to absorb testnet channel-account funding retries after a network
65
+ * reset. Mainnet requests return quickly; this only bounds the maximum wait.
66
+ */
67
+ export declare const DEFAULT_RELAYER_TIMEOUT_MS = 360000;
68
+ /** OpenZeppelin managed Channels relayer endpoint (mainnet). */
69
+ export declare const CHANNELS_MAINNET_URL = "https://channels.openzeppelin.com";
70
+ /** OpenZeppelin managed Channels relayer endpoint (testnet). */
71
+ export declare const CHANNELS_TESTNET_URL = "https://channels.openzeppelin.com/testnet";
72
+ /** Default indexer request timeout, in milliseconds. */
73
+ export declare const DEFAULT_INDEXER_TIMEOUT_MS = 10000;
74
+ /**
75
+ * Mercury's hosted, keyless passkey-indexer base URLs, per network. Public REST
76
+ * (no API key / JWT); covers both the legacy `("sw_v1", …)` and v1
77
+ * `#[contractevent]` signer generations with full history.
78
+ *
79
+ * @see https://docs.mercurydata.app/smart-wallet-indexers/introduction-1
80
+ */
81
+ export declare const MERCURY_PASSKEY_INDEXER_URLS: {
82
+ readonly testnet: "https://testnet.mercurydata.app/rest/passkey-indexer";
83
+ readonly mainnet: "https://mainnet.mercurydata.app/rest/passkey-indexer";
84
+ };
85
+ /** Stellar Friendbot URL for testnet funding. */
86
+ export declare const FRIENDBOT_URL = "https://friendbot.stellar.org";
87
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,sEAAsE;AACtE,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,IAAO,CAAC;AAE/C,+CAA+C;AAC/C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,oEAAoE;AACpE,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAM1C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAMhD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAM1C,sEAAsE;AACtE,eAAO,MAAM,OAAO,gBAAgB,CAAC;AAErC,wCAAwC;AACxC,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,oDAAoD;AACpD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,sEAAsE;AACtE,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAMtE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,SAAU,CAAC;AAElD,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,sCAAsC,CAAC;AAExE,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,8CAA8C,CAAC;AAMhF,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;;CAG/B,CAAC;AAMX,iDAAiD;AACjD,eAAO,MAAM,aAAa,kCAAkC,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Constants used throughout the Passkey Kit SDK.
3
+ *
4
+ * Cryptographic sizes mirror the smart-wallet contract; the deployer seed is
5
+ * load-bearing for deterministic contract-id derivation (see below).
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ // ============================================================================
10
+ // Cryptographic constants (mirror the smart-wallet contract)
11
+ // ============================================================================
12
+ /** Size of an uncompressed secp256r1 (P-256) public key, in bytes. */
13
+ export const SECP256R1_PUBLIC_KEY_SIZE = 65;
14
+ /** First byte of an uncompressed secp256r1 public key (0x04). */
15
+ export const UNCOMPRESSED_PUBKEY_PREFIX = 0x04;
16
+ /** Size of an Ed25519 public key, in bytes. */
17
+ export const ED25519_PUBLIC_KEY_SIZE = 32;
18
+ /** Size of an Ed25519 signature, in bytes. */
19
+ export const ED25519_SIGNATURE_SIZE = 64;
20
+ /**
21
+ * Order (n) of the secp256r1 (P-256) curve, used to enforce low-S signatures.
22
+ * @see https://github.com/stellar/stellar-protocol/discussions/1435
23
+ */
24
+ export const SECP256R1_CURVE_ORDER = BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551");
25
+ // ============================================================================
26
+ // WebAuthn configuration
27
+ // ============================================================================
28
+ /** Default timeout for WebAuthn ceremonies, in milliseconds. */
29
+ export const WEBAUTHN_TIMEOUT_MS = 60_000;
30
+ /** Length, in bytes, of a randomly generated WebAuthn challenge. */
31
+ export const WEBAUTHN_CHALLENGE_SIZE = 32;
32
+ // ============================================================================
33
+ // Deployer
34
+ // ============================================================================
35
+ /**
36
+ * Seed for the default (deterministic) deployer keypair.
37
+ *
38
+ * The deployer keypair is derived as
39
+ * `Keypair.fromRawEd25519Seed(sha256(utf8(DEFAULT_DEPLOYER_SEED)))`. Deriving it
40
+ * from a fixed, well-known string makes smart-wallet contract IDs reproducible
41
+ * across clients from a passkey credential ID alone (`salt = sha256(keyId)`,
42
+ * `deployer = this keypair`), which is exactly what the indexer reverse-lookup
43
+ * (keyId → contract) depends on.
44
+ *
45
+ * This value MUST remain `"kalepail"`: every wallet ever deployed by passkey-kit
46
+ * used this deployer, and the derivation is load-bearing for discovery. The
47
+ * deployer only pays fees and salts the deploy — it never controls the wallet —
48
+ * but it IS a shared, publicly-derivable keypair. Provide your own
49
+ * `deploySource` secret for a dedicated fee payer (note: a different deployer
50
+ * changes the derived contract addresses and breaks keyId → contract discovery).
51
+ */
52
+ export const DEFAULT_DEPLOYER_SEED = "kalepail";
53
+ // ============================================================================
54
+ // Transaction timeouts
55
+ // ============================================================================
56
+ /**
57
+ * Default transaction timeout, in seconds.
58
+ *
59
+ * The OpenZeppelin Relayer requires a time-bound of <= 30s on submitted
60
+ * transactions, so the kit defaults to that.
61
+ */
62
+ export const DEFAULT_TIMEOUT_SECONDS = 30;
63
+ // ============================================================================
64
+ // Storage configuration
65
+ // ============================================================================
66
+ /** Default IndexedDB database name for passkey credential storage. */
67
+ export const DB_NAME = "passkey-kit";
68
+ /** Current IndexedDB schema version. */
69
+ export const DB_VERSION = 1;
70
+ /** IndexedDB object-store name for passkey credentials. */
71
+ export const IDB_STORE_CREDENTIALS = "credentials";
72
+ /** IndexedDB index name for contract-id lookups. */
73
+ export const IDB_INDEX_CONTRACT_ID = "contractId";
74
+ /** localStorage key under which passkey credentials are persisted. */
75
+ export const LOCALSTORAGE_CREDENTIALS_KEY = "passkey-kit:credentials";
76
+ // ============================================================================
77
+ // Relayer
78
+ // ============================================================================
79
+ /**
80
+ * Default relayer request timeout, in milliseconds (6 minutes).
81
+ *
82
+ * Long enough to absorb testnet channel-account funding retries after a network
83
+ * reset. Mainnet requests return quickly; this only bounds the maximum wait.
84
+ */
85
+ export const DEFAULT_RELAYER_TIMEOUT_MS = 360_000;
86
+ /** OpenZeppelin managed Channels relayer endpoint (mainnet). */
87
+ export const CHANNELS_MAINNET_URL = "https://channels.openzeppelin.com";
88
+ /** OpenZeppelin managed Channels relayer endpoint (testnet). */
89
+ export const CHANNELS_TESTNET_URL = "https://channels.openzeppelin.com/testnet";
90
+ // ============================================================================
91
+ // Indexer
92
+ // ============================================================================
93
+ /** Default indexer request timeout, in milliseconds. */
94
+ export const DEFAULT_INDEXER_TIMEOUT_MS = 10_000;
95
+ /**
96
+ * Mercury's hosted, keyless passkey-indexer base URLs, per network. Public REST
97
+ * (no API key / JWT); covers both the legacy `("sw_v1", …)` and v1
98
+ * `#[contractevent]` signer generations with full history.
99
+ *
100
+ * @see https://docs.mercurydata.app/smart-wallet-indexers/introduction-1
101
+ */
102
+ export const MERCURY_PASSKEY_INDEXER_URLS = {
103
+ testnet: "https://testnet.mercurydata.app/rest/passkey-indexer",
104
+ mainnet: "https://mainnet.mercurydata.app/rest/passkey-indexer",
105
+ };
106
+ // ============================================================================
107
+ // Networks
108
+ // ============================================================================
109
+ /** Stellar Friendbot URL for testnet funding. */
110
+ export const FRIENDBOT_URL = "https://friendbot.stellar.org";
111
+ //# sourceMappingURL=constants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AAsE;AACtE,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAyB,CAAC;AAEtE,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAElD,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAExE,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,2CAA2C,CAAC;AAEhF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,wDAAwD;AACxD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,OAAO,EAAE,sDAAsD;IAC/D,OAAO,EAAE,sDAAsD;CACvD,CAAC;AAEX,+EAA+E;AAC/E,WAAW;AACX,+EAA+E;AAE/E,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,+BAA+B,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Contract error decoding.
3
+ *
4
+ * Maps on-chain smart-wallet failure codes (surfaced in simulation/submission
5
+ * diagnostics as `Error(Contract, #N)`) to typed {@link ContractError}s with the
6
+ * enum variant name and a human-readable message.
7
+ *
8
+ * The `SmartWallet` family is the source of truth in the generated bindings'
9
+ * `Errors` map; `contract-errors.test.ts` asserts this registry stays in sync
10
+ * with it, so a bindings regen surfaces any drift.
11
+ *
12
+ * The v1 contract deliberately renumbered its error space to 100-129 so it is
13
+ * disjoint from the legacy (pre-1.0) 1-9 range: a decoded code < 100 means the
14
+ * client is talking to a legacy wallet. Both ranges are kept here so errors
15
+ * from legacy deployed wallets still decode (family `SmartWalletLegacy`).
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ import { ContractError, PasskeyKitError } from "./errors.js";
20
+ import type { TransactionFailure } from "./types.js";
21
+ /**
22
+ * Contract families that expose custom error codes.
23
+ */
24
+ export type ContractErrorFamily = "SmartWallet" | "SmartWalletLegacy";
25
+ /**
26
+ * A single contract error entry: code, enum variant name, family, and a
27
+ * human-readable message.
28
+ */
29
+ export interface ContractErrorInfo {
30
+ code: number;
31
+ name: string;
32
+ family: ContractErrorFamily;
33
+ message: string;
34
+ }
35
+ /**
36
+ * Registry of every known contract error code, keyed by numeric code.
37
+ */
38
+ export declare const CONTRACT_ERROR_REGISTRY: Readonly<Record<number, ContractErrorInfo>>;
39
+ /**
40
+ * Build a {@link ContractError} for a known contract code, or `null` if the code
41
+ * is not in the registry.
42
+ */
43
+ export declare function contractErrorFromCode(code: number, context?: Record<string, unknown>): ContractError | null;
44
+ /**
45
+ * Decode a simulation/submission diagnostic into a typed {@link ContractError}.
46
+ *
47
+ * Scans the (stringified) diagnostic for an `Error(Contract, #N)` marker and
48
+ * looks the code up in {@link CONTRACT_ERROR_REGISTRY}. Returns `null` when no
49
+ * contract code is present or the code is unknown, letting callers fall back to
50
+ * a generic {@link SimulationError}/{@link SubmissionError}.
51
+ */
52
+ export declare function decodeContractError(diagnostic: unknown): ContractError | null;
53
+ /**
54
+ * Build a {@link TransactionFailure} from an already-typed error.
55
+ */
56
+ export declare function failedTransaction(error: PasskeyKitError, hash?: string): TransactionFailure;
57
+ /**
58
+ * Build a {@link TransactionFailure} from a simulation diagnostic, decoding a
59
+ * contract error when present and otherwise wrapping it in a
60
+ * {@link SimulationError}.
61
+ */
62
+ export declare function simulationFailure(diagnostic: unknown, hash?: string): TransactionFailure;
63
+ /**
64
+ * Build a {@link TransactionFailure} from a submission diagnostic, decoding a
65
+ * contract error when present and otherwise wrapping it in a
66
+ * {@link SubmissionError}.
67
+ */
68
+ export declare function submissionFailure(diagnostic: unknown, hash?: string): TransactionFailure;
69
+ //# sourceMappingURL=contract-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-errors.d.ts","sourceRoot":"","sources":["../src/contract-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,aAAa,EAGb,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,mBAAmB,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB;AAWD;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CA8BlC,CAAC;AAkBF;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,aAAa,GAAG,IAAI,CAMtB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAM7E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,IAAI,CAAC,EAAE,MAAM,GACZ,kBAAkB,CAMpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,OAAO,EACnB,IAAI,CAAC,EAAE,MAAM,GACZ,kBAAkB,CAKpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,OAAO,EACnB,IAAI,CAAC,EAAE,MAAM,GACZ,kBAAkB,CAQpB"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Contract error decoding.
3
+ *
4
+ * Maps on-chain smart-wallet failure codes (surfaced in simulation/submission
5
+ * diagnostics as `Error(Contract, #N)`) to typed {@link ContractError}s with the
6
+ * enum variant name and a human-readable message.
7
+ *
8
+ * The `SmartWallet` family is the source of truth in the generated bindings'
9
+ * `Errors` map; `contract-errors.test.ts` asserts this registry stays in sync
10
+ * with it, so a bindings regen surfaces any drift.
11
+ *
12
+ * The v1 contract deliberately renumbered its error space to 100-129 so it is
13
+ * disjoint from the legacy (pre-1.0) 1-9 range: a decoded code < 100 means the
14
+ * client is talking to a legacy wallet. Both ranges are kept here so errors
15
+ * from legacy deployed wallets still decode (family `SmartWalletLegacy`).
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ import { ContractError, SimulationError, SubmissionError, } from "./errors.js";
20
+ function entry(code, name, family, message) {
21
+ return [code, { code, name, family, message }];
22
+ }
23
+ /**
24
+ * Registry of every known contract error code, keyed by numeric code.
25
+ */
26
+ export const CONTRACT_ERROR_REGISTRY = Object.freeze(Object.fromEntries([
27
+ // --- v1 SmartWallet (100-129) — source of truth in the bindings Errors map ---
28
+ // 100-109: signer storage / management
29
+ entry(100, "SignerNotFound", "SmartWallet", "The requested signer does not exist on this smart wallet."),
30
+ entry(101, "SignerAlreadyExists", "SmartWallet", "add_signer was called with a signer key that already exists."),
31
+ entry(102, "SignerExpired", "SmartWallet", "The signer's expiration timestamp is in the past."),
32
+ // 110-119: auth (__check_auth)
33
+ entry(110, "MissingContext", "SmartWallet", "No signer in the signatures map is permitted to authorize one of the requested auth contexts."),
34
+ entry(111, "SignatureKeyValueMismatch", "SmartWallet", "A signature's variant does not match the stored signer it claims to be for."),
35
+ // 120-129: WebAuthn (secp256r1) verification
36
+ entry(120, "ClientDataJsonTooLarge", "SmartWallet", "clientDataJSON exceeds the 1024-byte parse buffer."),
37
+ entry(121, "ClientDataJsonParseError", "SmartWallet", "clientDataJSON is not parseable JSON (or is missing required fields)."),
38
+ entry(122, "ClientDataJsonChallengeIncorrect", "SmartWallet", "The clientDataJSON challenge does not match the signature payload; this binding MUST NOT be weakened."),
39
+ entry(123, "InvalidWebAuthnType", "SmartWallet", 'clientDataJSON `type` is not "webauthn.get".'),
40
+ entry(124, "InvalidAuthenticatorData", "SmartWallet", "authenticatorData is shorter than the WebAuthn minimum of 37 bytes."),
41
+ entry(125, "UserPresenceRequired", "SmartWallet", "The authenticator did not set the User Present (UP) flag."),
42
+ // --- Legacy (pre-1.0) 1-9 — kept so errors from legacy deployed wallets decode ---
43
+ entry(1, "NotFound", "SmartWalletLegacy", "[legacy] The specified signer was not found."),
44
+ entry(2, "AlreadyExists", "SmartWalletLegacy", "[legacy] The signer already exists on this wallet."),
45
+ entry(3, "MissingContext", "SmartWalletLegacy", "[legacy] The signature did not cover a required authorization context."),
46
+ entry(4, "SignerExpired", "SmartWalletLegacy", "[legacy] The signer has expired."),
47
+ entry(5, "FailedSignerLimits", "SmartWalletLegacy", "[legacy] The signer is not permitted to authorize this context by its limits."),
48
+ entry(6, "FailedPolicySignerLimits", "SmartWalletLegacy", "[legacy] A policy signer's limits rejected this context."),
49
+ entry(7, "SignatureKeyValueMismatch", "SmartWalletLegacy", "[legacy] A signature entry's key and value did not match."),
50
+ entry(8, "ClientDataJsonChallengeIncorrect", "SmartWalletLegacy", "[legacy] The WebAuthn clientDataJSON challenge did not match the signature payload."),
51
+ entry(9, "JsonParseError", "SmartWalletLegacy", "[legacy] The WebAuthn clientDataJSON could not be parsed."),
52
+ ]));
53
+ /**
54
+ * Matches the host's rendering of a contract error, e.g. `Error(Contract, #4)`.
55
+ */
56
+ const CONTRACT_ERROR_PATTERN = /Error\(Contract,\s*#(\d+)\)/;
57
+ function diagnosticToString(diagnostic) {
58
+ if (diagnostic == null)
59
+ return "";
60
+ if (typeof diagnostic === "string")
61
+ return diagnostic;
62
+ if (diagnostic instanceof Error)
63
+ return diagnostic.message;
64
+ try {
65
+ return JSON.stringify(diagnostic);
66
+ }
67
+ catch {
68
+ return String(diagnostic);
69
+ }
70
+ }
71
+ /**
72
+ * Build a {@link ContractError} for a known contract code, or `null` if the code
73
+ * is not in the registry.
74
+ */
75
+ export function contractErrorFromCode(code, context) {
76
+ const info = CONTRACT_ERROR_REGISTRY[code];
77
+ if (!info)
78
+ return null;
79
+ return new ContractError(info.code, info.name, info.family, info.message, {
80
+ context,
81
+ });
82
+ }
83
+ /**
84
+ * Decode a simulation/submission diagnostic into a typed {@link ContractError}.
85
+ *
86
+ * Scans the (stringified) diagnostic for an `Error(Contract, #N)` marker and
87
+ * looks the code up in {@link CONTRACT_ERROR_REGISTRY}. Returns `null` when no
88
+ * contract code is present or the code is unknown, letting callers fall back to
89
+ * a generic {@link SimulationError}/{@link SubmissionError}.
90
+ */
91
+ export function decodeContractError(diagnostic) {
92
+ const text = diagnosticToString(diagnostic);
93
+ const match = text.match(CONTRACT_ERROR_PATTERN);
94
+ if (!match)
95
+ return null;
96
+ const code = Number.parseInt(match[1], 10);
97
+ return contractErrorFromCode(code, { diagnostic: text });
98
+ }
99
+ /**
100
+ * Build a {@link TransactionFailure} from an already-typed error.
101
+ */
102
+ export function failedTransaction(error, hash) {
103
+ return {
104
+ success: false,
105
+ error,
106
+ ...(hash ? { hash } : {}),
107
+ };
108
+ }
109
+ /**
110
+ * Build a {@link TransactionFailure} from a simulation diagnostic, decoding a
111
+ * contract error when present and otherwise wrapping it in a
112
+ * {@link SimulationError}.
113
+ */
114
+ export function simulationFailure(diagnostic, hash) {
115
+ const error = decodeContractError(diagnostic) ??
116
+ new SimulationError(diagnosticToString(diagnostic) || "Simulation failed");
117
+ return failedTransaction(error, hash);
118
+ }
119
+ /**
120
+ * Build a {@link TransactionFailure} from a submission diagnostic, decoding a
121
+ * contract error when present and otherwise wrapping it in a
122
+ * {@link SubmissionError}.
123
+ */
124
+ export function submissionFailure(diagnostic, hash) {
125
+ const error = decodeContractError(diagnostic) ??
126
+ new SubmissionError(diagnosticToString(diagnostic) || "Submission failed", hash);
127
+ return failedTransaction(error, hash);
128
+ }
129
+ //# sourceMappingURL=contract-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-errors.js","sourceRoot":"","sources":["../src/contract-errors.ts"],"names":[],"mappings":"AAAA;;;;;;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