passkey-kit 0.14.0 → 0.15.0
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/README.md +11 -11
- package/dist/constants.d.ts +16 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +16 -5
- package/dist/constants.js.map +1 -1
- package/dist/kit/deploy-ops.d.ts +9 -7
- package/dist/kit/deploy-ops.d.ts.map +1 -1
- package/dist/kit/deploy-ops.js +11 -8
- package/dist/kit/deploy-ops.js.map +1 -1
- package/dist/kit/tx-ops.d.ts +4 -4
- package/dist/kit/tx-ops.d.ts.map +1 -1
- package/dist/kit/tx-ops.js +14 -5
- package/dist/kit/tx-ops.js.map +1 -1
- package/dist/kit.d.ts +11 -7
- package/dist/kit.d.ts.map +1 -1
- package/dist/kit.js +68 -19
- package/dist/kit.js.map +1 -1
- package/dist/managers/submission-manager.d.ts +12 -17
- package/dist/managers/submission-manager.d.ts.map +1 -1
- package/dist/managers/submission-manager.js +77 -19
- package/dist/managers/submission-manager.js.map +1 -1
- package/dist/relayer.d.ts +2 -2
- package/dist/relayer.js +2 -2
- package/dist/server.d.ts +4 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +12 -5
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +14 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +18 -2
- package/dist/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A TypeScript SDK for creating and using **smart-wallet accounts on Stellar with
|
|
|
9
9
|
> **Security.** Review the contract and SDK yourself before holding meaningful value, and read [Caveats](#caveats).
|
|
10
10
|
|
|
11
11
|
> [!NOTE]
|
|
12
|
-
> **Looking for context rules, thresholds, and spending-limit policies?** [smart-account-kit](https://github.com/
|
|
12
|
+
> **Looking for context rules, thresholds, and spending-limit policies?** [smart-account-kit](https://github.com/stellar/smart-account-kit) is a sibling SDK built on the audited [OpenZeppelin stellar-contracts](https://github.com/OpenZeppelin/stellar-contracts) account. It uses a different on-chain authorization model (context rules + an auth digest) than passkey-kit's flat `Signatures` map, so the two are not drop-in compatible — pick the model that fits your app.
|
|
13
13
|
|
|
14
14
|
## Contents
|
|
15
15
|
|
|
@@ -148,7 +148,7 @@ Browser-side facade for wallet lifecycle and signing. Holds no secrets.
|
|
|
148
148
|
| `networkPassphrase` | `string` | Yes | Network passphrase. |
|
|
149
149
|
| `walletWasmHash` | `string` (hex) | Yes | Smart-wallet WASM hash used to deploy new wallets. |
|
|
150
150
|
| `rpId` | `string` | No | WebAuthn Relying Party id (domain). Defaults to the current origin. |
|
|
151
|
-
| `deploySource` | `string` (`S…`) | No | Secret key for
|
|
151
|
+
| `deploySource` | `string` (`S…`) | No | Secret key for a deployer you control, which then sources and pays for its own deployments. Defaults to the canonical deterministic deployer, which is sign-only and never pays. **Overriding it changes derived wallet addresses** (see [Deterministic derivation](#deterministic-derivation)). |
|
|
152
152
|
| `timeoutInSeconds` | `number` | No | Transaction time bound (default `30`; the relayer requires `<= 30`). |
|
|
153
153
|
| `storage` | `StorageAdapter` | No | Passkey-record persistence (see [Storage adapters](#storage-adapters)). |
|
|
154
154
|
| `WebAuthn` | `WebAuthnClient` | No | Custom `startRegistration`/`startAuthentication` (for testing). |
|
|
@@ -160,7 +160,7 @@ Browser-side facade for wallet lifecycle and signing. Holds no secrets.
|
|
|
160
160
|
| `keyId` | `string \| undefined` | Connected passkey's base64url credential id. |
|
|
161
161
|
| `wallet` | `PasskeyClient \| undefined` | Connected wallet's generated contract client. |
|
|
162
162
|
| `contractId` | `string \| undefined` | Connected wallet address (getter). |
|
|
163
|
-
| `deployerPublicKey` | `string` | The
|
|
163
|
+
| `deployerPublicKey` | `string` | The deployer's `G…` address (getter). Pays only when it is a custom `deploySource`. |
|
|
164
164
|
| `networkPassphrase` / `rpcUrl` / `walletWasmHash` / `rpId` | `string` | The resolved config. |
|
|
165
165
|
| `events` | `PasskeyEventEmitter` | Lifecycle events: `walletCreated`, `walletConnected`, `walletDisconnected`. |
|
|
166
166
|
|
|
@@ -169,8 +169,8 @@ Browser-side facade for wallet lifecycle and signing. Holds no secrets.
|
|
|
169
169
|
| Method | Returns | Description |
|
|
170
170
|
|---|---|---|
|
|
171
171
|
| `createKey(appName, userName, options?)` | `CreatedPasskey` | Run a passkey registration ceremony **without** deploying a wallet. |
|
|
172
|
-
| `createWallet(appName, userName, options?)` | `CreateWalletResult` | Register a passkey and build a
|
|
173
|
-
| `connectWallet(options?)` | `ConnectWalletResult` | Resolve a wallet from a passkey (
|
|
172
|
+
| `createWallet(appName, userName, options?)` | `CreateWalletResult` | Register a passkey and build a deploy carrier (initializes the wallet via `__constructor` with the passkey as the first signer). For the shared deployer the carrier holds a signed authorization entry and no envelope signature. Submit the returned `signedTx` via `PasskeyServer`. |
|
|
173
|
+
| `connectWallet(options?)` | `ConnectWalletResult` | Resolve a wallet from a passkey (local storage → injected indexer lookup → deterministic derivation) and **verify** the passkey is a live signer on it. |
|
|
174
174
|
| `disconnect()` | `void` | Clear the connected wallet/keyId. |
|
|
175
175
|
| `requireWallet()` | `PasskeyClient` | Return the connected wallet or throw `WalletNotConnectedError`. |
|
|
176
176
|
|
|
@@ -181,7 +181,7 @@ Browser-side facade for wallet lifecycle and signing. Holds no secrets.
|
|
|
181
181
|
| Option | Type | Description |
|
|
182
182
|
|---|---|---|
|
|
183
183
|
| `keyId` | `string \| Uint8Array` | Connect a specific credential, skipping the discovery ceremony. |
|
|
184
|
-
| `getContractId` | `(keyId: string) => Promise<string \| undefined>` | Indexer-backed keyId → wallet lookup,
|
|
184
|
+
| `getContractId` | `(keyId: string) => Promise<string \| undefined>` | Indexer-backed keyId → wallet lookup, tried after local storage and before deterministic derivation. |
|
|
185
185
|
| `verifyWasmHash` | `boolean` | Also assert the wallet's on-chain WASM hash equals `walletWasmHash`. Off by default (an upgraded wallet legitimately runs a different hash). |
|
|
186
186
|
|
|
187
187
|
### Signing methods
|
|
@@ -305,7 +305,7 @@ All wallet writes are fee-sponsored by the [OpenZeppelin Relayer Channels](https
|
|
|
305
305
|
Two submission modes are chosen automatically:
|
|
306
306
|
|
|
307
307
|
- **`{ func, auth }`** (`submitSorobanTransaction`) — for wallet invocations (transfers, signer management) whose auth is carried by Address credentials. The relayer builds the envelope.
|
|
308
|
-
- **`{ xdr }`** (`submitTransaction`) — for an already-signed envelope that needs a fee bump (deploys / source-account auth).
|
|
308
|
+
- **`{ xdr }`** (`submitTransaction`) — for an already-signed envelope that needs a fee bump (custom-`deploySource` deploys / source-account auth). Shared-deployer deploys never take this path.
|
|
309
309
|
|
|
310
310
|
### Browsers: the relayer-proxy worker
|
|
311
311
|
|
|
@@ -313,7 +313,7 @@ The relayer API key is a secret, so a browser must never hold it. The [`relayer-
|
|
|
313
313
|
|
|
314
314
|
## Discovery (indexer)
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
The "reconnect" path needs no indexer: `connectWallet` resolves from a stored passkey → wallet association or, failing that, deterministic derivation (see [Deterministic derivation](#deterministic-derivation)), then confirms ownership on-chain. Derivation is a last resort because it is only correct for a wallet's first credential and is the one resolution path a squatted contract can hijack — trusted storage wins. An indexer is for **richer discovery**: enumerating a wallet's full signer set, and reverse-looking-up which wallets a given signer belongs to.
|
|
317
317
|
|
|
318
318
|
The SDK abstracts discovery behind a `SignerIndexer` interface (`getSigners` / `findWallets` / `health`), implemented by the **keyless** `MercuryIndexer` — exported from the main `passkey-kit` entry (no secret, so it runs in the browser):
|
|
319
319
|
|
|
@@ -452,8 +452,8 @@ Signer and signature expiration are **UNIX timestamps in seconds** (inclusive: v
|
|
|
452
452
|
> These are inherent to the wallet model. The SDK does not guard against them — handle them in your app.
|
|
453
453
|
|
|
454
454
|
- **Keep at least one durable admin signer.** The contract rejects any change that would remove or demote its last durable (`Persistent`, non-expiring) admin signer (`LastAdminSigner = 103`) or leave it without any durable signer (`LastSigner = 104`), so a wallet always retains one signer that cannot evict or expire. Signers outside that guard — `Temporary` storage or with an expiration — lapse on their own: add a replacement *before* removing or demoting an existing signer.
|
|
455
|
-
- **The default deployer is a shared, public keypair.** It only
|
|
456
|
-
- **Deploy front-running
|
|
455
|
+
- **The default deployer is a shared, public keypair — its secret is publicly derivable.** It salts deployment and signs only the CreateContractV2 authorization entry; the relayer supplies the envelope source, sequence, and fees. It never controls the wallet. Its determinism is load-bearing for discovery: overriding `deploySource` changes every derived address and breaks keyId → wallet lookup. Use a separate funded `restoreSource` for `restoreFootprint`; never fund the shared deployer. A third-party `bumpSequence` to `INT64_MAX` no longer blocks the current SDK because it never uses the shared deployer as an envelope source. Full analysis: [`docs/security-deterministic-deployer.md`](docs/security-deterministic-deployer.md).
|
|
456
|
+
- **Deploy front-running remains an accepted residual.** Anyone who learns a `keyId` before deployment could place arbitrary code at the derived address. A signer getter check alone is not proof of ownership because arbitrary squatted code can lie; bind the accepted WASM/code identity before trusting signer or policy state. See the [security analysis](docs/security-deterministic-deployer.md#accepted-residual-address-squatting).
|
|
457
457
|
- **WebAuthn requires User Presence (UP), not User Verification (UV).** The contract requires the UP flag but not UV (biometric/PIN), so it stays compatible with non-UV authenticators. Enforce UV at the client/relayer layer if you need it.
|
|
458
458
|
- **Value-moving policies need a cumulative cap or a co-signer.** A `Signature::Policy` carries no secret, so a per-transfer cap alone is trivially drained by repeated capped transfers. See the [contract interface](#contract-interface) and `sample-policy`.
|
|
459
459
|
|
|
@@ -487,7 +487,7 @@ contractId = sha256(XDR(HashIdPreimage::EnvelopeTypeContractId {
|
|
|
487
487
|
}))
|
|
488
488
|
```
|
|
489
489
|
|
|
490
|
-
- The canonical deployer keypair is `Keypair.fromRawEd25519Seed(sha256("kalepail"))`. It
|
|
490
|
+
- The canonical deployer keypair is `Keypair.fromRawEd25519Seed(sha256("kalepail"))`. It salts the deploy and signs the deploy authorization — it never pays fees and never controls the wallet — but its determinism is **load-bearing**: overriding `deploySource` changes every derived address and breaks keyId → wallet discovery.
|
|
491
491
|
- The WASM hash is deliberately **not** in the preimage, so an `upgrade` never moves a wallet's address.
|
|
492
492
|
|
|
493
493
|
This tuple is normative and must never change. See [`docs/deployments-testnet-2026-07-11.md`](./docs/deployments-testnet-2026-07-11.md) for the canonical WASM hashes, the deployer `G…` address, and the full derivation spec (including the deploy-front-running consequence in [Caveats](#caveats)).
|
package/dist/constants.d.ts
CHANGED
|
@@ -37,12 +37,23 @@ export declare const WEBAUTHN_CHALLENGE_SIZE = 32;
|
|
|
37
37
|
* `deployer = this keypair`), which is exactly what the indexer reverse-lookup
|
|
38
38
|
* (keyId → contract) depends on.
|
|
39
39
|
*
|
|
40
|
-
* This value MUST remain `"kalepail"`:
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
40
|
+
* This value MUST remain `"kalepail"`: it is the current deterministic deployer,
|
|
41
|
+
* and the derivation is load-bearing for keyId → contract discovery. (Wallets
|
|
42
|
+
* deployed BEFORE commit 23597d8 used an earlier scheme — the deployer was
|
|
43
|
+
* derived from `sha256(networkPassphrase)` — so those wallets live under
|
|
44
|
+
* different, legacy deployer addresses; see the deployer inventory in
|
|
45
|
+
* docs/security-deterministic-deployer.md. It is NOT true that every wallet ever
|
|
46
|
+
* used this seed.) The deployer salts and signs deploy authorization entries — it
|
|
47
|
+
* never controls the wallet and is never the default transaction source. Provide
|
|
48
|
+
* your own `deploySource` only to change the derivation identity (note: doing so
|
|
45
49
|
* changes the derived contract addresses and breaks keyId → contract discovery).
|
|
50
|
+
*
|
|
51
|
+
* ⚠️ SECURITY: the seed is a published constant, so the SECRET key is publicly
|
|
52
|
+
* derivable and the account is SHARED across default-configured integrators.
|
|
53
|
+
* The relayer/channel supplies deploy sequence and fees; footprint restores use
|
|
54
|
+
* the separate `restoreSource`. The shared account's balance and sequence are
|
|
55
|
+
* therefore irrelevant to SDK deploys.
|
|
56
|
+
* See docs/security-deterministic-deployer.md.
|
|
46
57
|
*/
|
|
47
58
|
export declare const DEFAULT_DEPLOYER_SEED = "kalepail";
|
|
48
59
|
/**
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +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;AAEF,sDAAsD;AACtD,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,WAAW,QAEvB,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,oEAAoE;AACpE,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAM1C
|
|
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;AAEF,sDAAsD;AACtD,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,WAAW,QAEvB,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,oEAAoE;AACpE,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAM1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;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"}
|
package/dist/constants.js
CHANGED
|
@@ -46,12 +46,23 @@ export const WEBAUTHN_CHALLENGE_SIZE = 32;
|
|
|
46
46
|
* `deployer = this keypair`), which is exactly what the indexer reverse-lookup
|
|
47
47
|
* (keyId → contract) depends on.
|
|
48
48
|
*
|
|
49
|
-
* This value MUST remain `"kalepail"`:
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
49
|
+
* This value MUST remain `"kalepail"`: it is the current deterministic deployer,
|
|
50
|
+
* and the derivation is load-bearing for keyId → contract discovery. (Wallets
|
|
51
|
+
* deployed BEFORE commit 23597d8 used an earlier scheme — the deployer was
|
|
52
|
+
* derived from `sha256(networkPassphrase)` — so those wallets live under
|
|
53
|
+
* different, legacy deployer addresses; see the deployer inventory in
|
|
54
|
+
* docs/security-deterministic-deployer.md. It is NOT true that every wallet ever
|
|
55
|
+
* used this seed.) The deployer salts and signs deploy authorization entries — it
|
|
56
|
+
* never controls the wallet and is never the default transaction source. Provide
|
|
57
|
+
* your own `deploySource` only to change the derivation identity (note: doing so
|
|
54
58
|
* changes the derived contract addresses and breaks keyId → contract discovery).
|
|
59
|
+
*
|
|
60
|
+
* ⚠️ SECURITY: the seed is a published constant, so the SECRET key is publicly
|
|
61
|
+
* derivable and the account is SHARED across default-configured integrators.
|
|
62
|
+
* The relayer/channel supplies deploy sequence and fees; footprint restores use
|
|
63
|
+
* the separate `restoreSource`. The shared account's balance and sequence are
|
|
64
|
+
* therefore irrelevant to SDK deploys.
|
|
65
|
+
* See docs/security-deterministic-deployer.md.
|
|
55
66
|
*/
|
|
56
67
|
export const DEFAULT_DEPLOYER_SEED = "kalepail";
|
|
57
68
|
// ============================================================================
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,+EAA+E;AAC/E,6DAA6D;AAC7D,+EAA+E;AAE/E,sEAAsE;AACtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,iEAAiE;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAE/C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,8CAA8C;AAC9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CACzC,oEAAoE,CACrE,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CACzC,oEAAoE,CACrE,CAAC;AAE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} from "@stellar/stellar-sdk/contract";
|
|
13
13
|
import { Client as PasskeyClient } from "passkey-kit-sdk";
|
|
14
14
|
/**
|
|
15
|
-
* Resolve the
|
|
15
|
+
* Resolve the address-derivation deployer keypair from an optional secret.
|
|
16
16
|
*
|
|
17
17
|
* With no secret, derives the canonical deterministic deployer from
|
|
18
|
-
* {@link DEFAULT_DEPLOYER_SEED}. The deployer only
|
|
19
|
-
*
|
|
20
|
-
* changes the derived contract addresses (and breaks
|
|
21
|
-
* discovery), so this is documented as an advanced option.
|
|
18
|
+
* {@link DEFAULT_DEPLOYER_SEED}. The default deployer only salts and authorizes
|
|
19
|
+
* deploys; it never controls the wallet or sources the transaction. Supplying a
|
|
20
|
+
* different `deploySource` changes the derived contract addresses (and breaks
|
|
21
|
+
* keyId → contract discovery), so this is documented as an advanced option.
|
|
22
22
|
*
|
|
23
23
|
* @throws {ConfigurationError} If `deploySource` is not a valid secret key.
|
|
24
24
|
*/
|
|
@@ -32,14 +32,16 @@ export declare function deriveWalletAddress(deps: {
|
|
|
32
32
|
* Build the smart-wallet deploy transaction, initializing it with the passkey as
|
|
33
33
|
* the first (unlimited, persistent) Secp256r1 signer via `__constructor`.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* Shared-default deploys use the SDK's address-only build path, so simulation
|
|
36
|
+
* uses the null carrier account instead of reading the deployer's sequence.
|
|
37
|
+
* Custom deployers keep the normal account-source path.
|
|
37
38
|
*/
|
|
38
39
|
export declare function buildDeployTransaction(deps: {
|
|
39
40
|
rpcUrl: string;
|
|
40
41
|
networkPassphrase: string;
|
|
41
42
|
walletWasmHash: string;
|
|
42
43
|
deployerPublicKey: string;
|
|
44
|
+
usingSharedDeployer: boolean;
|
|
43
45
|
timeoutInSeconds: number;
|
|
44
46
|
}, keyId: Buffer, publicKey: Uint8Array): Promise<AssembledTransaction<PasskeyClient>>;
|
|
45
47
|
//# sourceMappingURL=deploy-ops.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-ops.d.ts","sourceRoot":"","sources":["../../src/kit/deploy-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAQ,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,MAAM,IAAI,aAAa,EAExB,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAY9D;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,EAC9D,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED
|
|
1
|
+
{"version":3,"file":"deploy-ops.d.ts","sourceRoot":"","sources":["../../src/kit/deploy-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAQ,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,MAAM,IAAI,aAAa,EAExB,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAY9D;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,EAC9D,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE;IACJ,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;CAC1B,EACD,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,GACpB,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAyB9C"}
|
package/dist/kit/deploy-ops.js
CHANGED
|
@@ -14,13 +14,13 @@ import { DEFAULT_DEPLOYER_SEED } from "../constants.js";
|
|
|
14
14
|
import { deriveContractAddress } from "../utils.js";
|
|
15
15
|
import { ConfigurationError, PasskeyKitErrorCode } from "../errors.js";
|
|
16
16
|
/**
|
|
17
|
-
* Resolve the
|
|
17
|
+
* Resolve the address-derivation deployer keypair from an optional secret.
|
|
18
18
|
*
|
|
19
19
|
* With no secret, derives the canonical deterministic deployer from
|
|
20
|
-
* {@link DEFAULT_DEPLOYER_SEED}. The deployer only
|
|
21
|
-
*
|
|
22
|
-
* changes the derived contract addresses (and breaks
|
|
23
|
-
* discovery), so this is documented as an advanced option.
|
|
20
|
+
* {@link DEFAULT_DEPLOYER_SEED}. The default deployer only salts and authorizes
|
|
21
|
+
* deploys; it never controls the wallet or sources the transaction. Supplying a
|
|
22
|
+
* different `deploySource` changes the derived contract addresses (and breaks
|
|
23
|
+
* keyId → contract discovery), so this is documented as an advanced option.
|
|
24
24
|
*
|
|
25
25
|
* @throws {ConfigurationError} If `deploySource` is not a valid secret key.
|
|
26
26
|
*/
|
|
@@ -43,8 +43,9 @@ export function deriveWalletAddress(deps, keyId) {
|
|
|
43
43
|
* Build the smart-wallet deploy transaction, initializing it with the passkey as
|
|
44
44
|
* the first (unlimited, persistent) Secp256r1 signer via `__constructor`.
|
|
45
45
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* Shared-default deploys use the SDK's address-only build path, so simulation
|
|
47
|
+
* uses the null carrier account instead of reading the deployer's sequence.
|
|
48
|
+
* Custom deployers keep the normal account-source path.
|
|
48
49
|
*/
|
|
49
50
|
export async function buildDeployTransaction(deps, keyId, publicKey) {
|
|
50
51
|
const signer = {
|
|
@@ -61,7 +62,9 @@ export async function buildDeployTransaction(deps, keyId, publicKey) {
|
|
|
61
62
|
rpcUrl: deps.rpcUrl,
|
|
62
63
|
wasmHash: deps.walletWasmHash,
|
|
63
64
|
networkPassphrase: deps.networkPassphrase,
|
|
64
|
-
|
|
65
|
+
...(deps.usingSharedDeployer
|
|
66
|
+
? { address: deps.deployerPublicKey }
|
|
67
|
+
: { publicKey: deps.deployerPublicKey }),
|
|
65
68
|
salt: hash(keyId),
|
|
66
69
|
timeoutInSeconds: deps.timeoutInSeconds,
|
|
67
70
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-ops.js","sourceRoot":"","sources":["../../src/kit/deploy-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACL,MAAM,IAAI,aAAa,GAExB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,YAAqB;IACnD,IAAI,YAAY,EAAE,CAAC;QACjB,IAAI,CAAC;YACH,OAAO,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,kBAAkB,CAC1B,sDAAsD,EACtD,mBAAmB,CAAC,cAAc,CACnC,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB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AM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAOC,EACD,KAAa,EACb,SAAqB;IAErB,MAAM,MAAM,GAAc;QACxB,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE;YACN,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;YACtB,CAAC,SAAS,CAAC,EAAE,yBAAyB;YACtC,CAAC,SAAS,CAAC,EAAE,0BAA0B;YACvC,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE;SACzC;KACF,CAAC;IAEF,OAAO,aAAa,CAAC,MAAM,CACzB,EAAE,MAAM,EAAE,EACV;QACE,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,cAAc;QAC7B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,GAAG,CAAC,IAAI,CAAC,mBAAmB;YAC1B,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE;YACrC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC1C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;QACjB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;KACxC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/kit/tx-ops.d.ts
CHANGED
|
@@ -74,12 +74,12 @@ export interface RestorePreamble {
|
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Restore an archived contract-data footprint reported by simulation, paying
|
|
77
|
-
* with the
|
|
77
|
+
* with the independently configured restore source.
|
|
78
78
|
*
|
|
79
79
|
* Soroban simulation returns a `restorePreamble` when the transaction touches
|
|
80
80
|
* archived entries; the footprint must be restored (a separate, fee-bearing
|
|
81
|
-
* transaction) before the real transaction can succeed.
|
|
82
|
-
*
|
|
81
|
+
* transaction) before the real transaction can succeed. This source is
|
|
82
|
+
* deliberately separate from the address-derivation deployer identity.
|
|
83
83
|
*
|
|
84
84
|
* Returns the restore transaction hash. This path is exercised live in F2 (it
|
|
85
85
|
* requires archived on-chain state to trigger).
|
|
@@ -89,7 +89,7 @@ export interface RestorePreamble {
|
|
|
89
89
|
export declare function restoreFootprint(deps: {
|
|
90
90
|
rpc: Server;
|
|
91
91
|
networkPassphrase: string;
|
|
92
|
-
|
|
92
|
+
sourceKeypair?: Keypair;
|
|
93
93
|
timeoutInSeconds: number;
|
|
94
94
|
}, restorePreamble: RestorePreamble): Promise<string>;
|
|
95
95
|
//# sourceMappingURL=tx-ops.d.ts.map
|
package/dist/kit/tx-ops.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx-ops.d.ts","sourceRoot":"","sources":["../../src/kit/tx-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAiC,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EACV,oBAAoB,EACpB,IAAI,IAAI,YAAY,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tx-ops.d.ts","sourceRoot":"","sources":["../../src/kit/tx-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAiC,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EACV,oBAAoB,EACpB,IAAI,IAAI,YAAY,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO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KAAE,CAAC;CAC1D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE;IACJ,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,EACD,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,MAAM,CAAC,CAiDjB"}
|
package/dist/kit/tx-ops.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { Operation, TransactionBuilder, xdr } from "@stellar/stellar-sdk";
|
|
19
19
|
import { buildSignaturePayload, getAddressCredentials, signatureToScVal, signerKeyToScVal, toAddressBoundCredentials, upsertSignatureEntry, usesAddressBoundPayload, } from "./auth-payload.js";
|
|
20
20
|
import { SigningError, PasskeyKitError, PasskeyKitErrorCode } from "../errors.js";
|
|
21
|
+
import { isDefaultDeployer } from "../utils.js";
|
|
21
22
|
/**
|
|
22
23
|
* Compute a default signature-expiration ledger: the latest ledger plus the
|
|
23
24
|
* timeout window (assuming ~5s ledgers), rounded up.
|
|
@@ -88,12 +89,12 @@ export async function sign(deps, txn, signer, options) {
|
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
90
91
|
* Restore an archived contract-data footprint reported by simulation, paying
|
|
91
|
-
* with the
|
|
92
|
+
* with the independently configured restore source.
|
|
92
93
|
*
|
|
93
94
|
* Soroban simulation returns a `restorePreamble` when the transaction touches
|
|
94
95
|
* archived entries; the footprint must be restored (a separate, fee-bearing
|
|
95
|
-
* transaction) before the real transaction can succeed.
|
|
96
|
-
*
|
|
96
|
+
* transaction) before the real transaction can succeed. This source is
|
|
97
|
+
* deliberately separate from the address-derivation deployer identity.
|
|
97
98
|
*
|
|
98
99
|
* Returns the restore transaction hash. This path is exercised live in F2 (it
|
|
99
100
|
* requires archived on-chain state to trigger).
|
|
@@ -101,7 +102,15 @@ export async function sign(deps, txn, signer, options) {
|
|
|
101
102
|
* @throws {SigningError} On submission/confirmation failure.
|
|
102
103
|
*/
|
|
103
104
|
export async function restoreFootprint(deps, restorePreamble) {
|
|
104
|
-
|
|
105
|
+
if (!deps.sourceKeypair) {
|
|
106
|
+
throw new PasskeyKitError(`Footprint restoration requires a funded \`restoreSource\` secret. ` +
|
|
107
|
+
`It is intentionally separate from \`deploySource\`, because changing ` +
|
|
108
|
+
`the deployer changes every derived wallet address.`, PasskeyKitErrorCode.INVALID_CONFIG);
|
|
109
|
+
}
|
|
110
|
+
if (isDefaultDeployer(deps.sourceKeypair.publicKey())) {
|
|
111
|
+
throw new PasskeyKitError("restoreSource must be a separate funded account, not the shared default deployer", PasskeyKitErrorCode.INVALID_CONFIG);
|
|
112
|
+
}
|
|
113
|
+
const account = await deps.rpc.getAccount(deps.sourceKeypair.publicKey());
|
|
105
114
|
const fee = (Number(restorePreamble.minResourceFee) + 100_000).toString();
|
|
106
115
|
const restoreTx = new TransactionBuilder(account, {
|
|
107
116
|
fee,
|
|
@@ -111,7 +120,7 @@ export async function restoreFootprint(deps, restorePreamble) {
|
|
|
111
120
|
.setSorobanData(restorePreamble.transactionData.build())
|
|
112
121
|
.setTimeout(deps.timeoutInSeconds)
|
|
113
122
|
.build();
|
|
114
|
-
restoreTx.sign(deps.
|
|
123
|
+
restoreTx.sign(deps.sourceKeypair);
|
|
115
124
|
const sendResult = await deps.rpc.sendTransaction(restoreTx);
|
|
116
125
|
if (sendResult.status === "ERROR") {
|
|
117
126
|
throw new PasskeyKitError(`Footprint restore submission failed: ${sendResult.errorResult?.toXDR("base64") ?? "unknown"}`, PasskeyKitErrorCode.RESTORE_REQUIRED, { context: { hash: sendResult.hash } });
|
package/dist/kit/tx-ops.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx-ops.js","sourceRoot":"","sources":["../../src/kit/tx-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,SA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AAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC;AACzB,CAAC"}
|
package/dist/kit.d.ts
CHANGED
|
@@ -34,11 +34,13 @@ export interface PasskeyKitConfig {
|
|
|
34
34
|
/** WebAuthn Relying Party id (domain); defaults to the current origin. */
|
|
35
35
|
rpId?: string;
|
|
36
36
|
/**
|
|
37
|
-
* Secret key (`S…`) for the
|
|
38
|
-
*
|
|
39
|
-
* derived wallet addresses.
|
|
37
|
+
* Secret key (`S…`) for the address-derivation deployer. Defaults to the
|
|
38
|
+
* canonical shared sign-only deployer (see {@link resolveDeployer});
|
|
39
|
+
* overriding it changes derived wallet addresses.
|
|
40
40
|
*/
|
|
41
41
|
deploySource?: string;
|
|
42
|
+
/** Funded secret key used only to source footprint-restoration transactions. */
|
|
43
|
+
restoreSource?: string;
|
|
42
44
|
/** Transaction timeout, in seconds (default 30). */
|
|
43
45
|
timeoutInSeconds?: number;
|
|
44
46
|
/** Optional passkey-record storage adapter (see `passkey-kit/storage`). */
|
|
@@ -82,24 +84,26 @@ export declare class PasskeyKit {
|
|
|
82
84
|
constructor(config: PasskeyKitConfig);
|
|
83
85
|
/** The connected wallet's contract id, if any. */
|
|
84
86
|
get contractId(): string | undefined;
|
|
85
|
-
/** The
|
|
87
|
+
/** The address-derivation deployer's `G…` public key. */
|
|
86
88
|
get deployerPublicKey(): string;
|
|
87
89
|
private signerContext;
|
|
88
90
|
/** Run a passkey registration ceremony without deploying a wallet. */
|
|
89
91
|
createKey(appName: string, userName: string, options?: CreateOptions): Promise<CreatedPasskey>;
|
|
90
92
|
/**
|
|
91
93
|
* Register a passkey and deploy a smart wallet initialized with it as the
|
|
92
|
-
* first signer. Returns the
|
|
94
|
+
* first signer. Returns the authorized deploy carrier (submit it via
|
|
93
95
|
* `PasskeyServer`).
|
|
94
96
|
*/
|
|
95
97
|
createWallet(appName: string, userName: string, options?: CreateOptions): Promise<CreateWalletResult>;
|
|
96
98
|
/**
|
|
97
99
|
* Connect an existing wallet from a passkey.
|
|
98
100
|
*
|
|
99
|
-
* Resolves the wallet address by (1)
|
|
100
|
-
*
|
|
101
|
+
* Resolves the wallet address by (1) local storage, (2) an injected indexer
|
|
102
|
+
* lookup, then (3) deterministic derivation from the keyId — and then VERIFIES
|
|
101
103
|
* ownership: the keyId must resolve to a live signer on the wallet (#601 F7).
|
|
102
104
|
* This closes the unverified reverse-lookup hole (#598 F3) at the SDK layer.
|
|
105
|
+
* Derivation is deliberately last: it is only correct for a wallet's first
|
|
106
|
+
* credential and is the one path a squatted contract can hijack.
|
|
103
107
|
*
|
|
104
108
|
* @throws {WalletOwnershipError} If the keyId is not a signer on the wallet.
|
|
105
109
|
*/
|
package/dist/kit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../src/kit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../src/kit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAW,GAAG,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAIL,KAAK,8BAA8B,EACpC,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,EAAiB,KAAK,MAAM,EAAsB,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK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AC;IAI/C,8EAA8E;IAC9E,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI5D,yEAAyE;IACzE,SAAS,CAAC,SAAS,EAAE,SAAS;IAI9B,4CAA4C;IAC5C,aAAa,IAAI,aAAa;CAM/B"}
|
package/dist/kit.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
|
-
import { xdr } from "@stellar/stellar-sdk";
|
|
14
|
+
import { Keypair, xdr } from "@stellar/stellar-sdk";
|
|
15
15
|
import { Server } from "@stellar/stellar-sdk/rpc";
|
|
16
16
|
import { startAuthentication, startRegistration, } from "@simplewebauthn/browser";
|
|
17
17
|
import { Client as PasskeyClient } from "passkey-kit-sdk";
|
|
@@ -19,6 +19,7 @@ import base64url from "./base64url.js";
|
|
|
19
19
|
import { SignerKey, } from "./types.js";
|
|
20
20
|
import { ConfigurationError, PasskeyKitError, PasskeyKitErrorCode, WalletNotConnectedError, WalletOwnershipError, } from "./errors.js";
|
|
21
21
|
import { PasskeyEventEmitter } from "./events.js";
|
|
22
|
+
import { isDefaultDeployer } from "./utils.js";
|
|
22
23
|
import { DEFAULT_TIMEOUT_SECONDS } from "./constants.js";
|
|
23
24
|
import { calculateExpiration } from "./kit/tx-ops.js";
|
|
24
25
|
import { CredentialManager, SignerManager, SubmissionManager, } from "./managers/index.js";
|
|
@@ -60,6 +61,23 @@ export class PasskeyKit {
|
|
|
60
61
|
this.webAuthn =
|
|
61
62
|
config.WebAuthn ?? { startRegistration, startAuthentication };
|
|
62
63
|
const deployerKeypair = resolveDeployer(config.deploySource);
|
|
64
|
+
let restoreKeypair;
|
|
65
|
+
if (config.restoreSource) {
|
|
66
|
+
try {
|
|
67
|
+
restoreKeypair = Keypair.fromSecret(config.restoreSource);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
throw new ConfigurationError("restoreSource must be a valid Stellar secret key (S…)", PasskeyKitErrorCode.INVALID_CONFIG);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (!isDefaultDeployer(deployerKeypair.publicKey())) {
|
|
74
|
+
// No dedicated restoreSource, but the integrator supplied their OWN funded
|
|
75
|
+
// deploySource: keep the pre-existing behaviour and let it source restores.
|
|
76
|
+
// Address derivation is unaffected (their deployer identity is unchanged),
|
|
77
|
+
// so this stays address-preserving. Only the SHARED default deployer is
|
|
78
|
+
// refused — it must never source or fund a transaction.
|
|
79
|
+
restoreKeypair = deployerKeypair;
|
|
80
|
+
}
|
|
63
81
|
this.credentialManager = new CredentialManager({
|
|
64
82
|
rpId: this.rpId,
|
|
65
83
|
webAuthn: this.webAuthn,
|
|
@@ -80,6 +98,7 @@ export class PasskeyKit {
|
|
|
80
98
|
networkPassphrase: this.networkPassphrase,
|
|
81
99
|
walletWasmHash: this.walletWasmHash,
|
|
82
100
|
deployerKeypair,
|
|
101
|
+
restoreKeypair,
|
|
83
102
|
timeoutInSeconds: this.timeoutInSeconds,
|
|
84
103
|
});
|
|
85
104
|
}
|
|
@@ -87,7 +106,7 @@ export class PasskeyKit {
|
|
|
87
106
|
get contractId() {
|
|
88
107
|
return this.wallet?.options.contractId;
|
|
89
108
|
}
|
|
90
|
-
/** The
|
|
109
|
+
/** The address-derivation deployer's `G…` public key. */
|
|
91
110
|
get deployerPublicKey() {
|
|
92
111
|
return this.submissionManager.deployerPublicKey;
|
|
93
112
|
}
|
|
@@ -101,7 +120,7 @@ export class PasskeyKit {
|
|
|
101
120
|
}
|
|
102
121
|
/**
|
|
103
122
|
* Register a passkey and deploy a smart wallet initialized with it as the
|
|
104
|
-
* first signer. Returns the
|
|
123
|
+
* first signer. Returns the authorized deploy carrier (submit it via
|
|
105
124
|
* `PasskeyServer`).
|
|
106
125
|
*/
|
|
107
126
|
async createWallet(appName, userName, options) {
|
|
@@ -133,10 +152,12 @@ export class PasskeyKit {
|
|
|
133
152
|
/**
|
|
134
153
|
* Connect an existing wallet from a passkey.
|
|
135
154
|
*
|
|
136
|
-
* Resolves the wallet address by (1)
|
|
137
|
-
*
|
|
155
|
+
* Resolves the wallet address by (1) local storage, (2) an injected indexer
|
|
156
|
+
* lookup, then (3) deterministic derivation from the keyId — and then VERIFIES
|
|
138
157
|
* ownership: the keyId must resolve to a live signer on the wallet (#601 F7).
|
|
139
158
|
* This closes the unverified reverse-lookup hole (#598 F3) at the SDK layer.
|
|
159
|
+
* Derivation is deliberately last: it is only correct for a wallet's first
|
|
160
|
+
* credential and is the one path a squatted contract can hijack.
|
|
140
161
|
*
|
|
141
162
|
* @throws {WalletOwnershipError} If the keyId is not a signer on the wallet.
|
|
142
163
|
*/
|
|
@@ -150,18 +171,26 @@ export class PasskeyKit {
|
|
|
150
171
|
}
|
|
151
172
|
const keyIdBase64 = keyId instanceof Uint8Array ? base64url(Buffer.from(keyId)) : keyId;
|
|
152
173
|
const keyIdBuffer = keyId instanceof Uint8Array ? Buffer.from(keyId) : base64url.toBuffer(keyId);
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
// Resolve the wallet address. Deterministic derivation is authoritative
|
|
175
|
+
// ONLY for a wallet's first credential (the one whose keyId salted the
|
|
176
|
+
// deploy); for every later signer `derive(keyId)` points at an address that
|
|
177
|
+
// is never legitimately deployed, and is the one resolution path an attacker
|
|
178
|
+
// can poison by squatting code at that derived address. So trusted state
|
|
179
|
+
// wins and derivation is a last-resort hint, confirmed by an on-chain read:
|
|
180
|
+
// 1) local storage, 2) injected indexer lookup, 3) derivation.
|
|
181
|
+
// The keyId is still verified as a live signer below (F7), so a stale hint
|
|
182
|
+
// can never connect to a wallet the passkey does not actually control.
|
|
183
|
+
let contractId = (await this.credentialManager.lookupContractId(keyIdBase64)) ??
|
|
184
|
+
(options?.getContractId
|
|
185
|
+
? await options.getContractId(keyIdBase64)
|
|
186
|
+
: undefined);
|
|
187
|
+
if (!contractId) {
|
|
188
|
+
// Transport errors (429/5xx/timeout) propagate — only an authoritative
|
|
189
|
+
// not-found leaves the derived address unresolved.
|
|
190
|
+
const derived = this.submissionManager.deriveWalletAddress(keyIdBuffer);
|
|
191
|
+
if (await contractInstanceExists(this.rpc, derived)) {
|
|
192
|
+
contractId = derived;
|
|
193
|
+
}
|
|
165
194
|
}
|
|
166
195
|
if (!contractId) {
|
|
167
196
|
throw new PasskeyKitError("Could not resolve a wallet for the given passkey", PasskeyKitErrorCode.WALLET_NOT_FOUND, { context: { keyId: keyIdBase64 } });
|
|
@@ -246,8 +275,28 @@ export class PasskeyKit {
|
|
|
246
275
|
return this.signerManager.sign(txn, signer, options);
|
|
247
276
|
}
|
|
248
277
|
// -- Signer management -------------------------------------------------------
|
|
249
|
-
addSecp256r1(keyId, publicKey, limits, store, expiration) {
|
|
250
|
-
|
|
278
|
+
async addSecp256r1(keyId, publicKey, limits, store, expiration) {
|
|
279
|
+
const tx = await this.signerManager.addSecp256r1(keyId, publicKey, limits, store, expiration);
|
|
280
|
+
// Persist the keyId → wallet mapping so a later connectWallet(keyId) resolves
|
|
281
|
+
// this wallet from trusted storage instead of derivation (derive(keyId) of a
|
|
282
|
+
// secondary passkey is a squattable address). Without this record a pure-SDK
|
|
283
|
+
// consumer has nothing but derivation to fall back on for a second signer.
|
|
284
|
+
// ponytail: optimistic — written at build time, before the caller submits.
|
|
285
|
+
// If the add tx never lands the keyId is not a signer anywhere, so the F7
|
|
286
|
+
// ownership check in connectWallet rejects the stale hint rather than
|
|
287
|
+
// mis-binding. Requires a connected wallet (add_signer is wallet-authorized).
|
|
288
|
+
const contractId = this.contractId;
|
|
289
|
+
if (contractId) {
|
|
290
|
+
await this.credentialManager.rememberPasskey({
|
|
291
|
+
keyId: keyId instanceof Uint8Array ? base64url(Buffer.from(keyId)) : keyId,
|
|
292
|
+
publicKey: publicKey instanceof Uint8Array
|
|
293
|
+
? publicKey
|
|
294
|
+
: base64url.toBuffer(publicKey),
|
|
295
|
+
contractId,
|
|
296
|
+
createdAt: Date.now(),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return tx;
|
|
251
300
|
}
|
|
252
301
|
/**
|
|
253
302
|
* Update a passkey signer's limits/storage/expiration. The public key is
|
package/dist/kit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kit.js","sourceRoot":"","sources":["../src/kit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAGlB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,SAAS,GAMV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAKzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AA6CvD,MAAM,OAAO,UAAU;IACZ,GAAG,CAAS;IACZ,MAAM,CAAS;IACf,iBAAiB,CAAS;IAC1B,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CAAC,CAAC;IACzE,CAAC;IACD,YAAY,CACV,MAAc,EACd,MAAoB,EACpB,KAAkB,EAClB,UAAmB;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,CAAC,SAAoB;QACzB,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED,8EAA8E;IAC9E,OAAO,CAAC,WAAgC;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAED,yEAAyE;IACzE,SAAS,CAAC,SAAoB;QAC5B,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAED,4CAA4C;IAC5C,aAAa;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,uBAAuB,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Submission manager: builds and
|
|
3
|
-
*
|
|
4
|
-
* the footprint-restore flow.
|
|
2
|
+
* Submission manager: builds and authorizes deploys, derives deterministic
|
|
3
|
+
* wallet addresses, and drives the footprint-restore flow.
|
|
5
4
|
*
|
|
6
5
|
* Network submission itself is the server's job (`PasskeyServer` / relayer); this
|
|
7
|
-
* manager owns the deployer
|
|
8
|
-
* deploy transaction submittable.
|
|
6
|
+
* manager owns the deployer identity and its deploy authorization signature.
|
|
9
7
|
*
|
|
10
8
|
* @packageDocumentation
|
|
11
9
|
*/
|
|
@@ -20,30 +18,27 @@ export interface SubmissionManagerDeps {
|
|
|
20
18
|
networkPassphrase: string;
|
|
21
19
|
walletWasmHash: string;
|
|
22
20
|
deployerKeypair: Keypair;
|
|
21
|
+
restoreKeypair?: Keypair;
|
|
23
22
|
timeoutInSeconds: number;
|
|
24
23
|
}
|
|
25
24
|
export declare class SubmissionManager {
|
|
26
25
|
private readonly deps;
|
|
27
26
|
constructor(deps: SubmissionManagerDeps);
|
|
28
|
-
/** The deployer's `G…` public key (
|
|
27
|
+
/** The deployer's `G…` public key (address-derivation identity). */
|
|
29
28
|
get deployerPublicKey(): string;
|
|
30
29
|
/** Deterministically derive the wallet address for a passkey credential. */
|
|
31
30
|
deriveWalletAddress(keyId: Buffer): string;
|
|
32
31
|
/** Build the wallet deploy transaction (initial Secp256r1 signer). */
|
|
33
32
|
buildDeployTransaction(keyId: Buffer, publicKey: Uint8Array): Promise<AssembledTransaction<PasskeyClient>>;
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
36
|
-
* return the signed transaction XDR.
|
|
34
|
+
* Authorize a deploy and return its carrier transaction XDR.
|
|
37
35
|
*
|
|
38
|
-
* The
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* commits to the fee). `TransactionBuilder.cloneFrom` drops
|
|
45
|
-
* `SorobanTransactionData` (→ txMalformed), so set the fee field surgically on
|
|
46
|
-
* the envelope and rebuild.
|
|
36
|
+
* The shared deployer signs one address auth entry; the carrier has no usable
|
|
37
|
+
* source or envelope signature and `PasskeyServer` submits its `{func,auth}`.
|
|
38
|
+
* A custom deployer keeps the legacy self-source envelope path. Its inner fee
|
|
39
|
+
* must equal the resource fee before signing because the fee bump supplies the
|
|
40
|
+
* inclusion fee. `TransactionBuilder.cloneFrom` drops Soroban data, so that
|
|
41
|
+
* fee field is changed directly on the envelope.
|
|
47
42
|
*/
|
|
48
43
|
signDeploy(tx: AssembledTransaction<PasskeyClient>): Promise<string>;
|
|
49
44
|
/** Restore an archived footprint reported by simulation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submission-manager.d.ts","sourceRoot":"","sources":["../../src/managers/submission-manager.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"submission-manager.d.ts","sourceRoot":"","sources":["../../src/managers/submission-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAK/D,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAM1B,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,qBAAqB;IAExD,oEAAoE;IACpE,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED,4EAA4E;IAC5E,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAU1C,sEAAsE;IACtE,sBAAsB,CACpB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,GACpB,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAe/C;;;;;;;;;OASG;IACG,UAAU,CAAC,EAAE,EAAE,oBAAoB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAoG1E,4DAA4D;IAC5D,gBAAgB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAWpE"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Submission manager: builds and
|
|
3
|
-
*
|
|
4
|
-
* the footprint-restore flow.
|
|
2
|
+
* Submission manager: builds and authorizes deploys, derives deterministic
|
|
3
|
+
* wallet addresses, and drives the footprint-restore flow.
|
|
5
4
|
*
|
|
6
5
|
* Network submission itself is the server's job (`PasskeyServer` / relayer); this
|
|
7
|
-
* manager owns the deployer
|
|
8
|
-
* deploy transaction submittable.
|
|
6
|
+
* manager owns the deployer identity and its deploy authorization signature.
|
|
9
7
|
*
|
|
10
8
|
* @packageDocumentation
|
|
11
9
|
*/
|
|
12
|
-
import { TransactionBuilder } from "@stellar/stellar-sdk";
|
|
10
|
+
import { Address, TransactionBuilder, xdr } from "@stellar/stellar-sdk";
|
|
13
11
|
import { buildDeployTransaction as buildDeployTransactionOp, deriveWalletAddress as deriveWalletAddressOp, } from "../kit/deploy-ops.js";
|
|
14
12
|
import { restoreFootprint as restoreFootprintOp, } from "../kit/tx-ops.js";
|
|
13
|
+
import { buildSignaturePayload } from "../kit/auth-payload.js";
|
|
14
|
+
import { isDefaultDeployer } from "../utils.js";
|
|
15
|
+
const DEPLOY_AUTH_LIFETIME_LEDGERS = 720;
|
|
15
16
|
export class SubmissionManager {
|
|
16
17
|
deps;
|
|
17
18
|
constructor(deps) {
|
|
18
19
|
this.deps = deps;
|
|
19
20
|
}
|
|
20
|
-
/** The deployer's `G…` public key (
|
|
21
|
+
/** The deployer's `G…` public key (address-derivation identity). */
|
|
21
22
|
get deployerPublicKey() {
|
|
22
23
|
return this.deps.deployerKeypair.publicKey();
|
|
23
24
|
}
|
|
@@ -35,27 +36,84 @@ export class SubmissionManager {
|
|
|
35
36
|
networkPassphrase: this.deps.networkPassphrase,
|
|
36
37
|
walletWasmHash: this.deps.walletWasmHash,
|
|
37
38
|
deployerPublicKey: this.deployerPublicKey,
|
|
39
|
+
usingSharedDeployer: isDefaultDeployer(this.deployerPublicKey),
|
|
38
40
|
timeoutInSeconds: this.deps.timeoutInSeconds,
|
|
39
41
|
}, keyId, publicKey);
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
|
-
*
|
|
43
|
-
* return the signed transaction XDR.
|
|
44
|
+
* Authorize a deploy and return its carrier transaction XDR.
|
|
44
45
|
*
|
|
45
|
-
* The
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* commits to the fee). `TransactionBuilder.cloneFrom` drops
|
|
52
|
-
* `SorobanTransactionData` (→ txMalformed), so set the fee field surgically on
|
|
53
|
-
* the envelope and rebuild.
|
|
46
|
+
* The shared deployer signs one address auth entry; the carrier has no usable
|
|
47
|
+
* source or envelope signature and `PasskeyServer` submits its `{func,auth}`.
|
|
48
|
+
* A custom deployer keeps the legacy self-source envelope path. Its inner fee
|
|
49
|
+
* must equal the resource fee before signing because the fee bump supplies the
|
|
50
|
+
* inclusion fee. `TransactionBuilder.cloneFrom` drops Soroban data, so that
|
|
51
|
+
* fee field is changed directly on the envelope.
|
|
54
52
|
*/
|
|
55
53
|
async signDeploy(tx) {
|
|
56
54
|
if (!tx.built) {
|
|
57
55
|
throw new Error("deploy transaction has not been built/simulated");
|
|
58
56
|
}
|
|
57
|
+
if (isDefaultDeployer(this.deployerPublicKey)) {
|
|
58
|
+
const operation = tx.built.operations[0];
|
|
59
|
+
const auth = operation?.type === "invokeHostFunction" ? operation.auth ?? [] : [];
|
|
60
|
+
const latestLedger = tx.simulation?.latestLedger;
|
|
61
|
+
const authorizedFunction = auth[0]?.rootInvocation().function();
|
|
62
|
+
const authorizedCreate = authorizedFunction?.switch().name ===
|
|
63
|
+
"sorobanAuthorizedFunctionTypeCreateContractV2HostFn"
|
|
64
|
+
? authorizedFunction.createContractV2HostFn()
|
|
65
|
+
: undefined;
|
|
66
|
+
const operationCreate = operation?.type === "invokeHostFunction" &&
|
|
67
|
+
operation.func.switch().name === "hostFunctionTypeCreateContractV2"
|
|
68
|
+
? operation.func.createContractV2()
|
|
69
|
+
: undefined;
|
|
70
|
+
const fromAddress = authorizedCreate?.contractIdPreimage().fromAddress();
|
|
71
|
+
if (tx.built.operations.length !== 1 ||
|
|
72
|
+
tx.built.source === this.deployerPublicKey ||
|
|
73
|
+
tx.built.signatures.length !== 0 ||
|
|
74
|
+
auth.length !== 1 ||
|
|
75
|
+
latestLedger === undefined ||
|
|
76
|
+
!authorizedCreate ||
|
|
77
|
+
!operationCreate ||
|
|
78
|
+
!Buffer.from(authorizedCreate.toXDR()).equals(operationCreate.toXDR()) ||
|
|
79
|
+
!fromAddress ||
|
|
80
|
+
Address.fromScAddress(fromAddress.address()).toString() !==
|
|
81
|
+
this.deployerPublicKey ||
|
|
82
|
+
// The deployer signs the whole tree, so anything hanging off the root
|
|
83
|
+
// would be authorized too. A deployment needs no sub-invocations.
|
|
84
|
+
auth[0].rootInvocation().subInvocations().length !== 0) {
|
|
85
|
+
throw new Error("shared deploy simulation did not return one matching address authorization");
|
|
86
|
+
}
|
|
87
|
+
const nonceBytes = crypto.getRandomValues(new Uint8Array(8));
|
|
88
|
+
const expirationLedger = latestLedger + DEPLOY_AUTH_LIFETIME_LEDGERS;
|
|
89
|
+
const credentials = new xdr.SorobanAddressCredentials({
|
|
90
|
+
address: Address.fromString(this.deployerPublicKey).toScAddress(),
|
|
91
|
+
nonce: xdr.Int64.fromString(Buffer.from(nonceBytes).readBigInt64BE().toString()),
|
|
92
|
+
signatureExpirationLedger: expirationLedger,
|
|
93
|
+
signature: xdr.ScVal.scvVoid(),
|
|
94
|
+
});
|
|
95
|
+
const signedEntry = new xdr.SorobanAuthorizationEntry({
|
|
96
|
+
credentials: xdr.SorobanCredentials.sorobanCredentialsAddress(credentials),
|
|
97
|
+
rootInvocation: auth[0].rootInvocation(),
|
|
98
|
+
});
|
|
99
|
+
credentials.signature(xdr.ScVal.scvVec([
|
|
100
|
+
xdr.ScVal.scvMap([
|
|
101
|
+
new xdr.ScMapEntry({
|
|
102
|
+
key: xdr.ScVal.scvSymbol("public_key"),
|
|
103
|
+
val: xdr.ScVal.scvBytes(this.deps.deployerKeypair.rawPublicKey()),
|
|
104
|
+
}),
|
|
105
|
+
new xdr.ScMapEntry({
|
|
106
|
+
key: xdr.ScVal.scvSymbol("signature"),
|
|
107
|
+
val: xdr.ScVal.scvBytes(this.deps.deployerKeypair.sign(buildSignaturePayload(this.deps.networkPassphrase, signedEntry, expirationLedger))),
|
|
108
|
+
}),
|
|
109
|
+
]),
|
|
110
|
+
]));
|
|
111
|
+
const envelope = tx.built.toEnvelope();
|
|
112
|
+
envelope.v1().tx().operations()[0].body().invokeHostFunctionOp().auth([
|
|
113
|
+
signedEntry,
|
|
114
|
+
]);
|
|
115
|
+
return envelope.toXDR("base64");
|
|
116
|
+
}
|
|
59
117
|
const envelope = tx.built.toEnvelope();
|
|
60
118
|
const inner = envelope.v1().tx();
|
|
61
119
|
const resourceFee = inner.ext().sorobanData().resourceFee().toString();
|
|
@@ -69,7 +127,7 @@ export class SubmissionManager {
|
|
|
69
127
|
return restoreFootprintOp({
|
|
70
128
|
rpc: this.deps.rpc,
|
|
71
129
|
networkPassphrase: this.deps.networkPassphrase,
|
|
72
|
-
|
|
130
|
+
sourceKeypair: this.deps.restoreKeypair,
|
|
73
131
|
timeoutInSeconds: this.deps.timeoutInSeconds,
|
|
74
132
|
}, restorePreamble);
|
|
75
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submission-manager.js","sourceRoot":"","sources":["../../src/managers/submission-manager.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"submission-manager.js","sourceRoot":"","sources":["../../src/managers/submission-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAKxE,OAAO,EACL,sBAAsB,IAAI,wBAAwB,EAClD,mBAAmB,IAAI,qBA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AC;QAE/B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAC5C,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,EACxB,IAAI,CAAC,IAAI,CAAC,iBAAiB,CACb,CAAC;QACjB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5C,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED,4DAA4D;IAC5D,gBAAgB,CAAC,eAAgC;QAC/C,OAAO,kBAAkB,CACvB;YACE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG;YAClB,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB;YAC9C,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc;YACvC,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB;SAC7C,EACD,eAAe,CAChB,CAAC;IACJ,CAAC;CACF"}
|
package/dist/relayer.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - {@link RelayerClient.send} — `{ func, auth }` for invokeHostFunction flows
|
|
11
11
|
* (the preferred Soroban path; the relayer builds the envelope + pays fees).
|
|
12
12
|
* - {@link RelayerClient.sendTransaction} — `{ xdr }` for a signed envelope
|
|
13
|
-
* (e.g. a
|
|
13
|
+
* (e.g. a custom-deployer transaction that needs a fee bump).
|
|
14
14
|
*
|
|
15
15
|
* Every method returns a discriminated {@link TransactionResult} and NEVER
|
|
16
16
|
* throws for expected relayer/on-chain failures — a `PluginClientError` is
|
|
@@ -49,7 +49,7 @@ export declare class RelayerClient {
|
|
|
49
49
|
send(func: string, auth: string[], options?: RelayerSubmitOptions): Promise<TransactionResult>;
|
|
50
50
|
/**
|
|
51
51
|
* Submit a signed transaction envelope via `{ xdr }` for a fee bump (preserves
|
|
52
|
-
* the inner signature; use for
|
|
52
|
+
* the inner signature; use for custom-source / source-account-auth flows).
|
|
53
53
|
*/
|
|
54
54
|
sendTransaction(xdr: string, options?: RelayerSubmitOptions): Promise<TransactionResult>;
|
|
55
55
|
/** Poll a previously-submitted (`skipWait`) transaction by its relayer id. */
|
package/dist/relayer.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - {@link RelayerClient.send} — `{ func, auth }` for invokeHostFunction flows
|
|
11
11
|
* (the preferred Soroban path; the relayer builds the envelope + pays fees).
|
|
12
12
|
* - {@link RelayerClient.sendTransaction} — `{ xdr }` for a signed envelope
|
|
13
|
-
* (e.g. a
|
|
13
|
+
* (e.g. a custom-deployer transaction that needs a fee bump).
|
|
14
14
|
*
|
|
15
15
|
* Every method returns a discriminated {@link TransactionResult} and NEVER
|
|
16
16
|
* throws for expected relayer/on-chain failures — a `PluginClientError` is
|
|
@@ -63,7 +63,7 @@ export class RelayerClient {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Submit a signed transaction envelope via `{ xdr }` for a fee bump (preserves
|
|
66
|
-
* the inner signature; use for
|
|
66
|
+
* the inner signature; use for custom-source / source-account-auth flows).
|
|
67
67
|
*/
|
|
68
68
|
async sendTransaction(xdr, options) {
|
|
69
69
|
return this.run(() => this.channels.submitTransaction({
|
package/dist/server.d.ts
CHANGED
|
@@ -50,10 +50,10 @@ export declare class PasskeyServer {
|
|
|
50
50
|
/**
|
|
51
51
|
* Submit a transaction via the relayer for fee sponsorship.
|
|
52
52
|
*
|
|
53
|
-
* invokeHostFunction transactions without source-account auth use
|
|
54
|
-
* `{ func, auth }` Soroban path
|
|
55
|
-
* is fee-bumped via
|
|
56
|
-
* {@link TransactionResult}.
|
|
53
|
+
* Single-op invokeHostFunction transactions without source-account auth use
|
|
54
|
+
* the preferred `{ func, auth }` Soroban path (including shared-deployer
|
|
55
|
+
* deploys); everything else is fee-bumped via `{ xdr }`. Never throws —
|
|
56
|
+
* returns a typed {@link TransactionResult}.
|
|
57
57
|
*/
|
|
58
58
|
send(input: AssembledTransaction<unknown> | Transaction | string, options?: RelayerSubmitOptions): Promise<TransactionResult>;
|
|
59
59
|
/** Poll a `skipWait` submission by its relayer transaction id. */
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAiB,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASlG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIpD,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AAEtB,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,qCAAqC;IACrC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAmCD,qBAAa,aAAa;IACxB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAiB;gBAE9B,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O,CAAC,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAiB;gBAE9B,MAAM,EAAE,mBAAmB;IAgCvC;;;;;;;OAOG;IACG,IAAI,CACR,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,WAAW,GAAG,MAAM,EAC3D,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,iBAAiB,CAAC;IA4C7B,kEAAkE;IAClE,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgBjE,OAAO,CAAC,cAAc;IAUtB;;;;OAIG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIvD;;;;OAIG;IACG,aAAa,CACjB,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAChE,KAAK,SAAI,GACR,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAmB/B"}
|
package/dist/server.js
CHANGED
|
@@ -79,10 +79,10 @@ export class PasskeyServer {
|
|
|
79
79
|
/**
|
|
80
80
|
* Submit a transaction via the relayer for fee sponsorship.
|
|
81
81
|
*
|
|
82
|
-
* invokeHostFunction transactions without source-account auth use
|
|
83
|
-
* `{ func, auth }` Soroban path
|
|
84
|
-
* is fee-bumped via
|
|
85
|
-
* {@link TransactionResult}.
|
|
82
|
+
* Single-op invokeHostFunction transactions without source-account auth use
|
|
83
|
+
* the preferred `{ func, auth }` Soroban path (including shared-deployer
|
|
84
|
+
* deploys); everything else is fee-bumped via `{ xdr }`. Never throws —
|
|
85
|
+
* returns a typed {@link TransactionResult}.
|
|
86
86
|
*/
|
|
87
87
|
async send(input, options) {
|
|
88
88
|
if (!this.relayer) {
|
|
@@ -97,8 +97,15 @@ export class PasskeyServer {
|
|
|
97
97
|
? err
|
|
98
98
|
: new RelayerError(err instanceof Error ? err.message : String(err), PasskeyKitErrorCode.RELAYER_REQUEST_FAILED));
|
|
99
99
|
}
|
|
100
|
+
// The {func,auth} path submits exactly ONE host function — the relayer
|
|
101
|
+
// rebuilds the envelope around it. Only take it when the transaction is a
|
|
102
|
+
// single invokeHostFunction op; a multi-op envelope must go through the
|
|
103
|
+
// full-envelope fee-bump path or its extra operations would be silently
|
|
104
|
+
// dropped (and could report success after executing only the first).
|
|
100
105
|
const op = built.operations[0];
|
|
101
|
-
if (
|
|
106
|
+
if (built.operations.length === 1 &&
|
|
107
|
+
op?.type === "invokeHostFunction" &&
|
|
108
|
+
!hasSourceAccountAuth(built)) {
|
|
102
109
|
const invokeOp = op;
|
|
103
110
|
const func = invokeOp.func.toXDR("base64");
|
|
104
111
|
const auth = (invokeOp.auth ?? []).map((entry) => entry.toXDR("base64"));
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAEL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAuD,MAAM,cAAc,CAAC;AAClG,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,sEAAsE;AACtE,mEAAmE;AACnE,OAAO,EACL,aAAa,GAGd,MAAM,cAAc,CAAC;AAwBtB,sEAAsE;AACtE,S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,OAAO,CACR,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,YAAY,CACpB,oDAAoD,EACpD,mBAAmB,CAAC,sBAAsB,CAC3C,CAAC;QACJ,CAAC;QAED,IAAI,GAAc,CAAC;QACnB,IAAI,OAAO,CAAC,KAAK;YAAE,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aACvD,IAAI,OAAO,CAAC,SAAS;YAAE,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;;YAClE,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,MAAO,CAAC,CAAC;QAE7C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export interface CreateWalletResult {
|
|
|
91
91
|
keyIdBase64: string;
|
|
92
92
|
/** Deployed smart-wallet contract address. */
|
|
93
93
|
contractId: string;
|
|
94
|
-
/**
|
|
94
|
+
/** Authorized deployment carrier, ready to submit (base64 XDR). */
|
|
95
95
|
signedTx: string;
|
|
96
96
|
}
|
|
97
97
|
/** Result of connecting to an existing smart wallet. */
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
import type { RegistrationResponseJSON } from "@simplewebauthn/browser";
|
|
7
|
+
/**
|
|
8
|
+
* Public key of the shared, deterministic default deployer, derived once from
|
|
9
|
+
* {@link DEFAULT_DEPLOYER_SEED}.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_DEPLOYER_PUBLIC_KEY: string;
|
|
12
|
+
/**
|
|
13
|
+
* True when `publicKey` is the shared, publicly-derivable default deployer.
|
|
14
|
+
*
|
|
15
|
+
* That account is a **sign-only / address-derivation** identity: the SDK must
|
|
16
|
+
* never use it as a transaction source (its sequence can be bricked by anyone
|
|
17
|
+
* via `bumpSequence`) or fee payer (its balance is sweepable by anyone). It may
|
|
18
|
+
* only sign Soroban auth entries and salt the deploy.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isDefaultDeployer(publicKey: string): boolean;
|
|
7
21
|
/**
|
|
8
22
|
* Derive a smart-wallet contract address from a passkey credential id.
|
|
9
23
|
*
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAYxE;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAE3B,CAAC;AAEd;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE5D;AAWD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,GACxB,MAAM,CAcR;AAcD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAe5D;AAgDD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,wBAAwB,CAAC,UAAU,CAAC,GAC7C,OAAO,CAAC,UAAU,CAAC,CAoDrB;AAaD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAmDjE;AAMD;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAI1C"}
|
package/dist/utils.js
CHANGED
|
@@ -3,9 +3,25 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
import { StrKey, hash, xdr, Address } from "@stellar/stellar-sdk";
|
|
6
|
+
import { StrKey, hash, xdr, Address, Keypair } from "@stellar/stellar-sdk";
|
|
7
7
|
import base64url from "./base64url.js";
|
|
8
|
-
import { SECP256R1_PUBLIC_KEY_SIZE, SECP256R1_CURVE_ORDER, SECP256R1_FIELD_PRIME, SECP256R1_B, UNCOMPRESSED_PUBKEY_PREFIX, WEBAUTHN_CHALLENGE_SIZE, } from "./constants.js";
|
|
8
|
+
import { SECP256R1_PUBLIC_KEY_SIZE, SECP256R1_CURVE_ORDER, SECP256R1_FIELD_PRIME, SECP256R1_B, UNCOMPRESSED_PUBKEY_PREFIX, WEBAUTHN_CHALLENGE_SIZE, DEFAULT_DEPLOYER_SEED, } from "./constants.js";
|
|
9
|
+
/**
|
|
10
|
+
* Public key of the shared, deterministic default deployer, derived once from
|
|
11
|
+
* {@link DEFAULT_DEPLOYER_SEED}.
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_DEPLOYER_PUBLIC_KEY = Keypair.fromRawEd25519Seed(hash(Buffer.from(DEFAULT_DEPLOYER_SEED))).publicKey();
|
|
14
|
+
/**
|
|
15
|
+
* True when `publicKey` is the shared, publicly-derivable default deployer.
|
|
16
|
+
*
|
|
17
|
+
* That account is a **sign-only / address-derivation** identity: the SDK must
|
|
18
|
+
* never use it as a transaction source (its sequence can be bricked by anyone
|
|
19
|
+
* via `bumpSequence`) or fee payer (its balance is sweepable by anyone). It may
|
|
20
|
+
* only sign Soroban auth entries and salt the deploy.
|
|
21
|
+
*/
|
|
22
|
+
export function isDefaultDeployer(publicKey) {
|
|
23
|
+
return publicKey === DEFAULT_DEPLOYER_PUBLIC_KEY;
|
|
24
|
+
}
|
|
9
25
|
import { ValidationError, WebAuthnError, PasskeyKitErrorCode, } from "./errors.js";
|
|
10
26
|
// ============================================================================
|
|
11
27
|
// Deterministic contract-address derivation
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC,kBAAkB,CACnE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CACzC,CAAC,SAAS,EAAE,CAAC;AAEd;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,SAAS,KAAK,2BAA2B,CAAC;AACnD,CAAC;AACD,OAAO,EACL,eAAe,EACf,aAAa,EACb,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,+EAA+E;AAC/E,4CAA4C;AAC5C,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAa,EACb,iBAAyB,EACzB,iBAAyB;IAEz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GAAG,KAAK,EAAE,CAAC;QACpB,OAAO,GAAG,qBAAqB,GAAG,OAAO,CAAC;IAC5C,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAEzE,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACtD,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passkey-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "A helper library for creating and using smart wallet accounts on the Stellar blockchain.",
|
|
5
5
|
"author": "Tyler van der Hoeven <tyler@stellar.org>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@openzeppelin/relayer-plugin-channels": "^0.20.0",
|
|
33
33
|
"@simplewebauthn/browser": "^13.3.0",
|
|
34
|
-
"@stellar/stellar-sdk": "16.0.
|
|
34
|
+
"@stellar/stellar-sdk": ">=16.0.0",
|
|
35
35
|
"base64url": "^3.0.1",
|
|
36
36
|
"buffer": "^6.0.3",
|
|
37
37
|
"sac-sdk": "0.4.3",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"repository": {
|
|
53
53
|
"type": "git",
|
|
54
|
-
"url": "git+https://github.com/
|
|
54
|
+
"url": "git+https://github.com/stellar/passkey-kit.git"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"smart wallet",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"crypto"
|
|
68
68
|
],
|
|
69
69
|
"bugs": {
|
|
70
|
-
"url": "https://github.com/
|
|
70
|
+
"url": "https://github.com/stellar/passkey-kit/issues"
|
|
71
71
|
},
|
|
72
|
-
"homepage": "https://github.com/
|
|
72
|
+
"homepage": "https://github.com/stellar/passkey-kit/blob/main/README.md",
|
|
73
73
|
"scripts": {
|
|
74
74
|
"sync-version": "node scripts/sync-version.js",
|
|
75
75
|
"prebuild": "node scripts/sync-version.js",
|