passkey-kit 0.18.3 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/SECURITY.md +19 -0
- package/dist/constants.d.ts +22 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +34 -0
- package/dist/constants.js.map +1 -1
- package/dist/errors.d.ts +30 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +44 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/kit/legacy-ops.d.ts +130 -0
- package/dist/kit/legacy-ops.d.ts.map +1 -0
- package/dist/kit/legacy-ops.js +263 -0
- package/dist/kit/legacy-ops.js.map +1 -0
- package/dist/kit.d.ts +53 -0
- package/dist/kit.d.ts.map +1 -1
- package/dist/kit.js +148 -3
- package/dist/kit.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -252,6 +252,10 @@ Each method builds an `AssembledTransaction` (`WalletTx`) that wraps one contrac
|
|
|
252
252
|
| `remove(signerKey)` | `remove_signer` | Remove a signer. A policy entry must pass its own `policy__` check. |
|
|
253
253
|
| `upgrade(newWasmHash)` | `upgrade` | Replace the wallet's WASM (`Buffer`/`Uint8Array`, 32 bytes). |
|
|
254
254
|
| `getSigner(signerKey)` | `get_signer` | Read a signer entry from the ledger (temporary before persistent). Returns `SignerVal \| null`. |
|
|
255
|
+
| `inspectLegacyWallet(contractId)` | (reads) | Status, storage cohort, archived entries, and a recommendation for a pre-1.0 wallet this kit cannot connect to. |
|
|
256
|
+
| `buildLegacyUpgradeTx(contractId)` | `update_contract_code` | The in-place upgrade to the legacy-line target; restores archived entries first via `restoreSource`. |
|
|
257
|
+
| `signLegacyUpgradeTx(tx, contractId, signer?)` | — | Sign that upgrade with an existing passkey or Ed25519 signer without connecting. |
|
|
258
|
+
| `buildLegacyMigrateTx(contractId, signerKeys)` | `migrate_signers` | Re-encode pre-`6a27d48` signer entries after the upgrade. |
|
|
255
259
|
|
|
256
260
|
Parameters:
|
|
257
261
|
|
|
@@ -517,7 +521,7 @@ It uses the latest Stellar RPC ledger close timestamp.
|
|
|
517
521
|
- **Current code identity is not signer provenance.** The SDK also verifies immutable birth code and address-bound proofs. See the [signer-provenance design](docs/security-signer-provenance-v2.md).
|
|
518
522
|
- **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.
|
|
519
523
|
- **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`.
|
|
520
|
-
- **Pre-1.1 wallets cannot
|
|
524
|
+
- **Pre-1.1 wallets cannot connect through this release.** `connectWallet` throws `LegacyWalletError` for them. The kit does inspect them and build, sign, and migrate their in-place upgrade (`inspectLegacyWallet`, `buildLegacyUpgradeTx`, `signLegacyUpgradeTx`, `buildLegacyMigrateTx`); see [docs/legacy-wallet-upgrade.md](./docs/legacy-wallet-upgrade.md).
|
|
521
525
|
|
|
522
526
|
## Contract interface
|
|
523
527
|
|
|
@@ -567,6 +571,7 @@ This tuple remains stable for address compatibility. Signer proofs provide owner
|
|
|
567
571
|
| `packages/passkey-kit-sdk` | Generated smart-wallet contract bindings (do not hand-edit — see [releasing](./docs/releasing.md)). |
|
|
568
572
|
| `packages/sac-sdk` | Generated SEP-41 SAC bindings. |
|
|
569
573
|
| `contracts/` | Rust Soroban contracts: `smart-wallet`, `smart-wallet-interface`, `sample-policy`, `example-contract`. |
|
|
574
|
+
| `contracts-legacy/` | The pre-1.0 wallet line with dual-layout signer reads: the in-place upgrade target for pre-fix wallets. The canonical artifact is committed at `out/smart_wallet.wasm`. |
|
|
570
575
|
| `relayer-proxy/` | Cloudflare Worker for keyless, fee-sponsored submission. |
|
|
571
576
|
| `demo/` | Svelte 5 demo exercising the full client API. |
|
|
572
577
|
|
|
@@ -580,6 +585,7 @@ pnpm verify:bindings # assert the committed bindings match the canonical WASM
|
|
|
580
585
|
- **[CHANGELOG.md](./CHANGELOG.md)** — the v1 overhaul, by component.
|
|
581
586
|
- **[SECURITY.md](./SECURITY.md)** — supported versions and private vulnerability reporting.
|
|
582
587
|
- **[docs/migration-v1.md](./docs/migration-v1.md)** — upgrading from 0.12.x, with Before/After and a gap analysis.
|
|
588
|
+
- **[docs/legacy-wallet-upgrade.md](./docs/legacy-wallet-upgrade.md)** — in-place upgrade for pre-fix legacy wallets (known-vulnerable WASM hashes in [SECURITY.md](./SECURITY.md)).
|
|
583
589
|
- **[docs/releasing.md](./docs/releasing.md)** — the dependency-ordered publish flow.
|
|
584
590
|
|
|
585
591
|
## Resources
|
package/SECURITY.md
CHANGED
|
@@ -14,6 +14,25 @@ Only the latest npm releases and the canonical smart-wallet WASM receive securit
|
|
|
14
14
|
|
|
15
15
|
The current [`deployment manifest`](./docs/deployments-2026-09-01.md) identifies the canonical WASM. Existing wallet instances do not upgrade automatically.
|
|
16
16
|
|
|
17
|
+
## Known-vulnerable wallet WASM hashes
|
|
18
|
+
|
|
19
|
+
Wallets deployed from the following mainnet WASM hashes run code in which `update_signer` has no authorization check. Anyone who knows a signer key can overwrite that signer. The defect was fixed in source in commit [`dcc6e3dc9c`](https://github.com/kalepail/passkey-kit/commit/dcc6e3dc9cfd32e64b98f23541cd2d96812b64c4) on 2025-03-27. Deployed wallets keep the old code until their owner upgrades them.
|
|
20
|
+
|
|
21
|
+
| WASM hash | Storage layout |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `0c0a264d4cc0b3e79b8533e2a2e1f0ed21501a5a3f9f2455d2f18c232940b865` | bare (pre-`6a27d48`) |
|
|
24
|
+
| `19868df3653d427cafa1c30bdb6cec1ca5c8c815eeabab8a8bae6d83efb1fedd` | bare (pre-`6a27d48`) |
|
|
25
|
+
| `b62f62217ff256d557513793e9e44317b25b14401a8a6b6149a04d38d72d6c7c` | wrapped |
|
|
26
|
+
| `c5509dfa5f022deb8ae621f073adac5fd788feca0b24d15b5f392ab22c2ff222` | wrapped (not built from this repo) |
|
|
27
|
+
|
|
28
|
+
Do not deploy new wallets from these hashes, or from any Makefile or `.env` pin older than commit `da472f9`.
|
|
29
|
+
|
|
30
|
+
Upgrade affected wallets in place to the legacy-line build `c079d3a4136eb6ca68eb724acd3d8af11b0be4a0ed82605925a6dfd4dd83a97c`, built from [`contracts-legacy/`](./contracts-legacy) and live on mainnet (upload tx `501bd5d5…`, 2026-09-17). It reads both storage layouts. The earlier post-fix builds `ecd990f0…` and `e45c42b9…` and the v1 build read only the wrapped layout and brick a bare-layout wallet. See [`docs/legacy-wallet-upgrade.md`](./docs/legacy-wallet-upgrade.md) for the procedure.
|
|
31
|
+
|
|
32
|
+
Move funds out of any affected wallet you do not intend to upgrade.
|
|
33
|
+
|
|
34
|
+
The current SDK refuses to deploy from these hashes, throws `LegacyWalletError` with the upgrade guidance when `connectWallet` meets a wallet running one of them, and builds the upgrade itself through `inspectLegacyWallet` / `buildLegacyUpgradeTx` / `signLegacyUpgradeTx`.
|
|
35
|
+
|
|
17
36
|
## Cargo advisory status
|
|
18
37
|
|
|
19
38
|
The lockfile retains `serde_with@3.14.0` and its inactive `time@0.3.41` optional dependency.
|
package/dist/constants.d.ts
CHANGED
|
@@ -99,4 +99,26 @@ export declare const MERCURY_PASSKEY_INDEXER_URLS: {
|
|
|
99
99
|
};
|
|
100
100
|
/** Stellar Friendbot URL for testnet funding. */
|
|
101
101
|
export declare const FRIENDBOT_URL = "https://friendbot.stellar.org";
|
|
102
|
+
/**
|
|
103
|
+
* Mainnet smart-wallet WASM hashes whose `update_signer` has no authorization
|
|
104
|
+
* check (fixed in source by commit dcc6e3dc9c, 2025-03-27). Any signer on a
|
|
105
|
+
* wallet running one of these can be overwritten by anyone. The kit refuses to
|
|
106
|
+
* deploy from them and names them in {@link LegacyWalletError} on connect.
|
|
107
|
+
* See SECURITY.md and docs/legacy-wallet-upgrade.md.
|
|
108
|
+
*/
|
|
109
|
+
export declare const KNOWN_VULNERABLE_WALLET_WASM_HASHES: readonly string[];
|
|
110
|
+
/**
|
|
111
|
+
* Patched pre-1.0 smart-wallet WASM hashes. Wallets on these are not
|
|
112
|
+
* vulnerable but predate the v1 contract, so this kit cannot connect to them;
|
|
113
|
+
* the 0.10.20–0.12.x kit line can.
|
|
114
|
+
*/
|
|
115
|
+
export declare const LEGACY_WALLET_WASM_HASHES: readonly string[];
|
|
116
|
+
/**
|
|
117
|
+
* The in-place upgrade target for every vulnerable legacy wallet. Built from
|
|
118
|
+
* `contracts-legacy/`; it reads both pre-1.0 storage layouts, which the other
|
|
119
|
+
* patched builds do not (they brick `0c0a264d…`/`19868df3…` wallets).
|
|
120
|
+
*/
|
|
121
|
+
export declare const LEGACY_UPGRADE_TARGET_WASM_HASH = "c079d3a4136eb6ca68eb724acd3d8af11b0be4a0ed82605925a6dfd4dd83a97c";
|
|
122
|
+
/** Operator guide for upgrading legacy wallets in place. */
|
|
123
|
+
export declare const LEGACY_WALLET_UPGRADE_GUIDE_URL = "https://github.com/stellar/passkey-kit/blob/main/docs/legacy-wallet-upgrade.md";
|
|
102
124
|
//# sourceMappingURL=constants.d.ts.map
|
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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CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,qEACwB,CAAC;AAErE,4DAA4D;AAC5D,eAAO,MAAM,+BAA+B,mFACsC,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -123,4 +123,38 @@ export const MERCURY_PASSKEY_INDEXER_URLS = {
|
|
|
123
123
|
// ============================================================================
|
|
124
124
|
/** Stellar Friendbot URL for testnet funding. */
|
|
125
125
|
export const FRIENDBOT_URL = "https://friendbot.stellar.org";
|
|
126
|
+
// ============================================================================
|
|
127
|
+
// Legacy (pre-1.0) wallet code identities
|
|
128
|
+
// ============================================================================
|
|
129
|
+
/**
|
|
130
|
+
* Mainnet smart-wallet WASM hashes whose `update_signer` has no authorization
|
|
131
|
+
* check (fixed in source by commit dcc6e3dc9c, 2025-03-27). Any signer on a
|
|
132
|
+
* wallet running one of these can be overwritten by anyone. The kit refuses to
|
|
133
|
+
* deploy from them and names them in {@link LegacyWalletError} on connect.
|
|
134
|
+
* See SECURITY.md and docs/legacy-wallet-upgrade.md.
|
|
135
|
+
*/
|
|
136
|
+
export const KNOWN_VULNERABLE_WALLET_WASM_HASHES = [
|
|
137
|
+
"0c0a264d4cc0b3e79b8533e2a2e1f0ed21501a5a3f9f2455d2f18c232940b865",
|
|
138
|
+
"19868df3653d427cafa1c30bdb6cec1ca5c8c815eeabab8a8bae6d83efb1fedd",
|
|
139
|
+
"b62f62217ff256d557513793e9e44317b25b14401a8a6b6149a04d38d72d6c7c",
|
|
140
|
+
"c5509dfa5f022deb8ae621f073adac5fd788feca0b24d15b5f392ab22c2ff222",
|
|
141
|
+
];
|
|
142
|
+
/**
|
|
143
|
+
* Patched pre-1.0 smart-wallet WASM hashes. Wallets on these are not
|
|
144
|
+
* vulnerable but predate the v1 contract, so this kit cannot connect to them;
|
|
145
|
+
* the 0.10.20–0.12.x kit line can.
|
|
146
|
+
*/
|
|
147
|
+
export const LEGACY_WALLET_WASM_HASHES = [
|
|
148
|
+
"ecd990f0b45ca6817149b6175f79b32efb442f35731985a084131e8265c4cd90",
|
|
149
|
+
"e45c42b944a767bd5f37f8c4a469b48917d28e23481dbfd550419c84cdacde92",
|
|
150
|
+
"c079d3a4136eb6ca68eb724acd3d8af11b0be4a0ed82605925a6dfd4dd83a97c",
|
|
151
|
+
];
|
|
152
|
+
/**
|
|
153
|
+
* The in-place upgrade target for every vulnerable legacy wallet. Built from
|
|
154
|
+
* `contracts-legacy/`; it reads both pre-1.0 storage layouts, which the other
|
|
155
|
+
* patched builds do not (they brick `0c0a264d…`/`19868df3…` wallets).
|
|
156
|
+
*/
|
|
157
|
+
export const LEGACY_UPGRADE_TARGET_WASM_HASH = "c079d3a4136eb6ca68eb724acd3d8af11b0be4a0ed82605925a6dfd4dd83a97c";
|
|
158
|
+
/** Operator guide for upgrading legacy wallets in place. */
|
|
159
|
+
export const LEGACY_WALLET_UPGRADE_GUIDE_URL = "https://github.com/stellar/passkey-kit/blob/main/docs/legacy-wallet-upgrade.md";
|
|
126
160
|
//# sourceMappingURL=constants.js.map
|
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,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;CACnE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;CACnE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,kEAAkE,CAAC;AAErE,4DAA4D;AAC5D,MAAM,CAAC,MAAM,+BAA+B,GAC1C,gFAAgF,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export declare enum PasskeyKitErrorCode {
|
|
|
36
36
|
WALLET_NOT_FOUND = 2003,
|
|
37
37
|
WALLET_OWNERSHIP_MISMATCH = 2004,
|
|
38
38
|
WALLET_AMBIGUOUS = 2005,
|
|
39
|
+
/** The wallet runs pre-1.0 contract code; see {@link LegacyWalletError}. */
|
|
40
|
+
WALLET_LEGACY_CODE = 2006,
|
|
39
41
|
WEBAUTHN_REGISTRATION_FAILED = 3001,
|
|
40
42
|
WEBAUTHN_AUTHENTICATION_FAILED = 3002,
|
|
41
43
|
WEBAUTHN_NOT_SUPPORTED = 3003,
|
|
@@ -96,6 +98,34 @@ export declare class WalletNotConnectedError extends PasskeyKitError {
|
|
|
96
98
|
export declare class WalletOwnershipError extends PasskeyKitError {
|
|
97
99
|
constructor(message: string, context?: Record<string, unknown>);
|
|
98
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Thrown when a wallet runs pre-1.0 (legacy) contract code, which this kit
|
|
103
|
+
* cannot operate. Two cases, distinguished by {@link LegacyWalletError.vulnerable}:
|
|
104
|
+
*
|
|
105
|
+
* - `vulnerable: true` — the code is one of the known-vulnerable builds whose
|
|
106
|
+
* `update_signer` has no authorization check. Anyone can take the wallet
|
|
107
|
+
* over. It must be upgraded in place to {@link upgradeTarget} (or drained)
|
|
108
|
+
* using the 0.10.20–0.12.x kit line; see {@link guideUrl}.
|
|
109
|
+
* - `vulnerable: false` — the code is a patched legacy build. The wallet is
|
|
110
|
+
* safe but only the 0.10.20–0.12.x kit line can connect to it.
|
|
111
|
+
*/
|
|
112
|
+
export declare class LegacyWalletError extends PasskeyKitError {
|
|
113
|
+
/** The wallet's current code hash (hex). */
|
|
114
|
+
readonly wasmHash: string;
|
|
115
|
+
/** Whether the code has the unauthenticated `update_signer` defect. */
|
|
116
|
+
readonly vulnerable: boolean;
|
|
117
|
+
/** WASM hash to upgrade to in place (safe for every legacy layout). */
|
|
118
|
+
readonly upgradeTarget: string;
|
|
119
|
+
/** Operator guide for the upgrade. */
|
|
120
|
+
readonly guideUrl: string;
|
|
121
|
+
constructor(options: {
|
|
122
|
+
contractId: string;
|
|
123
|
+
wasmHash: string;
|
|
124
|
+
vulnerable: boolean;
|
|
125
|
+
upgradeTarget: string;
|
|
126
|
+
guideUrl: string;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
99
129
|
/** Thrown when more than one verified wallet contains the connecting passkey. */
|
|
100
130
|
export declare class WalletAmbiguousError extends PasskeyKitError {
|
|
101
131
|
/** Every candidate that passed the configured wallet checks. */
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,mBAAmB;IAE7B,cAAc,OAAO;IACrB,cAAc,OAAO;IAGrB,oBAAoB,OAAO;IAC3B,qBAAqB,OAAO;IAC5B,gBAAgB,OAAO;IACvB,yBAAyB,OAAO;IAChC,gBAAgB,OAAO;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,mBAAmB;IAE7B,cAAc,OAAO;IACrB,cAAc,OAAO;IAGrB,oBAAoB,OAAO;IAC3B,qBAAqB,OAAO;IAC5B,gBAAgB,OAAO;IACvB,yBA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AE7C,OAAO,EAAE,MAAM,EACf,IAAI,GACA,mBAAmB,CAAC,sBAAsB,GAC1C,mBAAmB,CAAC,sBAAsB,GAC1C,mBAAmB,CAAC,eAA4D,EACpF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,KAAK,CAAC,EAAE,KAAK;CAKhB;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAc,SAAQ,eAAe;IAChD,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,kEAAkE;IAClE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAEnC,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAGtB,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,KAAK,CAAC,EAAE,KAAK,CAAC;KACf;CAWJ;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,OAAO,EACZ,WAAW,GAAE,mBAAuD,GACnE,eAAe,CASjB"}
|
package/dist/errors.js
CHANGED
|
@@ -39,6 +39,8 @@ export var PasskeyKitErrorCode;
|
|
|
39
39
|
PasskeyKitErrorCode[PasskeyKitErrorCode["WALLET_NOT_FOUND"] = 2003] = "WALLET_NOT_FOUND";
|
|
40
40
|
PasskeyKitErrorCode[PasskeyKitErrorCode["WALLET_OWNERSHIP_MISMATCH"] = 2004] = "WALLET_OWNERSHIP_MISMATCH";
|
|
41
41
|
PasskeyKitErrorCode[PasskeyKitErrorCode["WALLET_AMBIGUOUS"] = 2005] = "WALLET_AMBIGUOUS";
|
|
42
|
+
/** The wallet runs pre-1.0 contract code; see {@link LegacyWalletError}. */
|
|
43
|
+
PasskeyKitErrorCode[PasskeyKitErrorCode["WALLET_LEGACY_CODE"] = 2006] = "WALLET_LEGACY_CODE";
|
|
42
44
|
// WebAuthn (3xxx)
|
|
43
45
|
PasskeyKitErrorCode[PasskeyKitErrorCode["WEBAUTHN_REGISTRATION_FAILED"] = 3001] = "WEBAUTHN_REGISTRATION_FAILED";
|
|
44
46
|
PasskeyKitErrorCode[PasskeyKitErrorCode["WEBAUTHN_AUTHENTICATION_FAILED"] = 3002] = "WEBAUTHN_AUTHENTICATION_FAILED";
|
|
@@ -136,6 +138,48 @@ export class WalletOwnershipError extends PasskeyKitError {
|
|
|
136
138
|
this.name = "WalletOwnershipError";
|
|
137
139
|
}
|
|
138
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Thrown when a wallet runs pre-1.0 (legacy) contract code, which this kit
|
|
143
|
+
* cannot operate. Two cases, distinguished by {@link LegacyWalletError.vulnerable}:
|
|
144
|
+
*
|
|
145
|
+
* - `vulnerable: true` — the code is one of the known-vulnerable builds whose
|
|
146
|
+
* `update_signer` has no authorization check. Anyone can take the wallet
|
|
147
|
+
* over. It must be upgraded in place to {@link upgradeTarget} (or drained)
|
|
148
|
+
* using the 0.10.20–0.12.x kit line; see {@link guideUrl}.
|
|
149
|
+
* - `vulnerable: false` — the code is a patched legacy build. The wallet is
|
|
150
|
+
* safe but only the 0.10.20–0.12.x kit line can connect to it.
|
|
151
|
+
*/
|
|
152
|
+
export class LegacyWalletError extends PasskeyKitError {
|
|
153
|
+
/** The wallet's current code hash (hex). */
|
|
154
|
+
wasmHash;
|
|
155
|
+
/** Whether the code has the unauthenticated `update_signer` defect. */
|
|
156
|
+
vulnerable;
|
|
157
|
+
/** WASM hash to upgrade to in place (safe for every legacy layout). */
|
|
158
|
+
upgradeTarget;
|
|
159
|
+
/** Operator guide for the upgrade. */
|
|
160
|
+
guideUrl;
|
|
161
|
+
constructor(options) {
|
|
162
|
+
const { contractId, wasmHash, vulnerable, upgradeTarget, guideUrl } = options;
|
|
163
|
+
const message = vulnerable
|
|
164
|
+
? `Wallet ${contractId} runs known-vulnerable legacy code ${wasmHash.slice(0, 8)}…: ` +
|
|
165
|
+
`its update_signer has no authorization check, so anyone can take the wallet over. ` +
|
|
166
|
+
`Upgrade it in place to ${upgradeTarget}: this kit builds and signs that call ` +
|
|
167
|
+
`(kit.buildLegacyUpgradeTx, kit.signLegacyUpgradeTx, then kit.buildLegacyMigrateTx ` +
|
|
168
|
+
`for the oldest layout), or use the passkey-kit 0.10.20–0.12.x line; or move its ` +
|
|
169
|
+
`funds out. This kit version cannot connect to it. Guide: ${guideUrl}`
|
|
170
|
+
: `Wallet ${contractId} runs patched legacy code ${wasmHash.slice(0, 8)}…, ` +
|
|
171
|
+
`which this kit version cannot connect to. Operate it with the passkey-kit ` +
|
|
172
|
+
`0.10.20–0.12.x line (kit.inspectLegacyWallet describes its state). Guide: ${guideUrl}`;
|
|
173
|
+
super(message, PasskeyKitErrorCode.WALLET_LEGACY_CODE, {
|
|
174
|
+
context: { contractId, wasmHash, vulnerable, upgradeTarget, guideUrl },
|
|
175
|
+
});
|
|
176
|
+
this.name = "LegacyWalletError";
|
|
177
|
+
this.wasmHash = wasmHash;
|
|
178
|
+
this.vulnerable = vulnerable;
|
|
179
|
+
this.upgradeTarget = upgradeTarget;
|
|
180
|
+
this.guideUrl = guideUrl;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
139
183
|
/** Thrown when more than one verified wallet contains the connecting passkey. */
|
|
140
184
|
export class WalletAmbiguousError extends PasskeyKitError {
|
|
141
185
|
/** Every candidate that passed the configured wallet checks. */
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;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AG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAErD,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,9 @@ export { Client as PasskeyClient } from "passkey-kit-sdk";
|
|
|
13
13
|
export { PasskeySigner, Ed25519Signer, PolicySigner, type Signer, type SignerContext, type PreparedSignature, type WebAuthnAuthenticator, } from "./signers.js";
|
|
14
14
|
export { SignerKey, SignerStore, type SignerKeyTag, type SignerLimits, type StoredPasskey, type StorageAdapter, type CreateWalletResult, type ConnectWalletResult, type TransactionResult, type TransactionSuccess, type TransactionFailure, type SubmissionMethod, } from "./types.js";
|
|
15
15
|
export type { PolicySignerTxOptions } from "./kit/wallet-ops.js";
|
|
16
|
-
export { PasskeyKitError, PasskeyKitErrorCode, ConfigurationError, WalletNotConnectedError, WalletOwnershipError, WalletAmbiguousError, WebAuthnError, SigningError, SignerNotFoundError, SimulationError, SubmissionError, ValidationError, IndexerError, RelayerError, ContractError, wrapError, } from "./errors.js";
|
|
16
|
+
export { PasskeyKitError, PasskeyKitErrorCode, ConfigurationError, WalletNotConnectedError, WalletOwnershipError, WalletAmbiguousError, LegacyWalletError, WebAuthnError, SigningError, SignerNotFoundError, SimulationError, SubmissionError, ValidationError, IndexerError, RelayerError, ContractError, wrapError, } from "./errors.js";
|
|
17
|
+
export { classifyWasmHash, BARE_LAYOUT_WALLET_WASM_HASHES, type LegacyCodeStatus, type LegacyWalletInspection, } from "./kit/legacy-ops.js";
|
|
18
|
+
export { KNOWN_VULNERABLE_WALLET_WASM_HASHES, LEGACY_WALLET_WASM_HASHES, LEGACY_UPGRADE_TARGET_WASM_HASH, LEGACY_WALLET_UPGRADE_GUIDE_URL, } from "./constants.js";
|
|
17
19
|
export { CONTRACT_ERROR_REGISTRY, contractErrorFromCode, decodeContractError, type ContractErrorFamily, type ContractErrorInfo, } from "./contract-errors.js";
|
|
18
20
|
export { MercuryIndexer, mercuryPasskeyIndexerUrl, MERCURY_PASSKEY_INDEXER_URLS, lookupWithRetry, type MercuryIndexerConfig, type SignerIndexer, type WalletSigner, type WalletCandidate, type WalletCandidateIncompleteReason, type IncompleteWalletCandidate, type WalletCandidateLookup, type WalletLookupIncompleteReason, type IndexerHealth, type SignerStatus, type SignerStorageClass, } from "./indexer/index.js";
|
|
19
21
|
export { PasskeyEventEmitter, type PasskeyEvent, type PasskeyEventMap, type EventListener, } from "./events.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAGrE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EACL,aAAa,EACb,aAAa,EACb,YAAY,EACZ,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,4BAA4B,EAC5B,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,cAAc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4B,EAC5B,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,11 @@ export { PasskeySigner, Ed25519Signer, PolicySigner, } from "./signers.js";
|
|
|
19
19
|
// Signer-key helpers, storage + result types
|
|
20
20
|
export { SignerKey, SignerStore, } from "./types.js";
|
|
21
21
|
// Typed errors
|
|
22
|
-
export { PasskeyKitError, PasskeyKitErrorCode, ConfigurationError, WalletNotConnectedError, WalletOwnershipError, WalletAmbiguousError, WebAuthnError, SigningError, SignerNotFoundError, SimulationError, SubmissionError, ValidationError, IndexerError, RelayerError, ContractError, wrapError, } from "./errors.js";
|
|
22
|
+
export { PasskeyKitError, PasskeyKitErrorCode, ConfigurationError, WalletNotConnectedError, WalletOwnershipError, WalletAmbiguousError, LegacyWalletError, WebAuthnError, SigningError, SignerNotFoundError, SimulationError, SubmissionError, ValidationError, IndexerError, RelayerError, ContractError, wrapError, } from "./errors.js";
|
|
23
|
+
// Legacy (pre-1.0) wallet upgrade helpers
|
|
24
|
+
export { classifyWasmHash, BARE_LAYOUT_WALLET_WASM_HASHES, } from "./kit/legacy-ops.js";
|
|
25
|
+
// Legacy (pre-1.0) wallet code identities
|
|
26
|
+
export { KNOWN_VULNERABLE_WALLET_WASM_HASHES, LEGACY_WALLET_WASM_HASHES, LEGACY_UPGRADE_TARGET_WASM_HASH, LEGACY_WALLET_UPGRADE_GUIDE_URL, } from "./constants.js";
|
|
23
27
|
// Contract-error decoding
|
|
24
28
|
export { CONTRACT_ERROR_REGISTRY, contractErrorFromCode, decodeContractError, } from "./contract-errors.js";
|
|
25
29
|
// Indexer abstraction. Mercury's hosted passkey-indexer is keyless, so the
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,8EAA8E;AAC9E,SAAS;AACT,OAAO,EACL,UAAU,GAIX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAErE,4BAA4B;AAC5B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE1D,qBAAqB;AACrB,OAAO,EACL,aAAa,EACb,aAAa,EACb,YAAY,GAKb,MAAM,cAAc,CAAC;AAEtB,6CAA6C;AAC7C,OAAO,EACL,SAAS,EACT,WAAW,GAWZ,MAAM,YAAY,CAAC;AAGpB,eAAe;AACf,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,0BAA0B;AAC1B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,GAGpB,MA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,aAAa,CAAC;AAErB,0CAA0C;AAC1C,OAAO,EACL,gBAAgB,EAChB,8BAA8B,GAG/B,MAAM,qBAAqB,CAAC;AAE7B,0CAA0C;AAC1C,OAAO,EACL,mCAAmC,EACnC,yBAAyB,EACzB,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,gBAAgB,CAAC;AAExB,0BAA0B;AAC1B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAE9B,2EAA2E;AAC3E,kFAAkF;AAClF,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,4BAA4B,EAC5B,eAAe,GAYhB,MAAM,oBAAoB,CAAC;AAE5B,SAAS;AACT,OAAO,EACL,mBAAmB,GAIpB,MAAM,aAAa,CAAC;AAErB,8BAA8B;AAC9B,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,yBAAyB;AACzB,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AAEzB,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy (pre-1.0) wallet upgrade helpers.
|
|
3
|
+
*
|
|
4
|
+
* The kit cannot connect to a pre-1.0 wallet (`connectWallet` throws
|
|
5
|
+
* {@link LegacyWalletError}), but it can still craft the one transaction such
|
|
6
|
+
* a wallet needs: an in-place `update_contract_code` to the legacy-line build
|
|
7
|
+
* that reads both pre-1.0 storage layouts, followed for the bare-layout cohort
|
|
8
|
+
* by a `migrate_signers` call. This module builds those transactions from the
|
|
9
|
+
* wallet's actual on-chain state, so an application only has to sign and
|
|
10
|
+
* submit. See docs/legacy-wallet-upgrade.md for the full procedure.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
import { AssembledTransaction, type Spec as ContractSpec } from "@stellar/stellar-sdk/contract";
|
|
15
|
+
import type { Server } from "@stellar/stellar-sdk/rpc";
|
|
16
|
+
import type { SignerKey } from "../types.js";
|
|
17
|
+
import type { Signer } from "../signers.js";
|
|
18
|
+
import { type SignAuthEntryDeps, type SignOptions } from "./tx-ops.js";
|
|
19
|
+
/**
|
|
20
|
+
* Pre-1.0 wallets that store signers in the pre-`6a27d48` (2024-12-13)
|
|
21
|
+
* layout. Every later build fails to decode them, which is why only the
|
|
22
|
+
* legacy-line target is a safe upgrade for them and why `migrate_signers`
|
|
23
|
+
* exists.
|
|
24
|
+
*/
|
|
25
|
+
export declare const BARE_LAYOUT_WALLET_WASM_HASHES: readonly string[];
|
|
26
|
+
/** How a wallet's current code relates to this kit. */
|
|
27
|
+
export type LegacyCodeStatus =
|
|
28
|
+
/** One of the known-vulnerable pre-fix builds: upgrade or drain now. */
|
|
29
|
+
"vulnerable"
|
|
30
|
+
/** A patched pre-1.0 build: safe, but only legacy tooling operates it. */
|
|
31
|
+
| "legacy"
|
|
32
|
+
/** One of this kit's accepted hashes: nothing to do. */
|
|
33
|
+
| "current"
|
|
34
|
+
/** Not a hash this kit knows. */
|
|
35
|
+
| "unknown";
|
|
36
|
+
/** What {@link inspectLegacyWallet} learned about a wallet. */
|
|
37
|
+
export interface LegacyWalletInspection {
|
|
38
|
+
contractId: string;
|
|
39
|
+
/** Current code hash (hex). */
|
|
40
|
+
wasmHash: string;
|
|
41
|
+
status: LegacyCodeStatus;
|
|
42
|
+
/** Storage layout cohort, when the code is a known pre-1.0 build. */
|
|
43
|
+
cohort: "bare" | "wrapped" | null;
|
|
44
|
+
/** The in-place upgrade target for every pre-1.0 wallet. */
|
|
45
|
+
upgradeTarget: string;
|
|
46
|
+
/** True when the wallet should call `update_contract_code(upgradeTarget)`. */
|
|
47
|
+
upgradeRequired: boolean;
|
|
48
|
+
/** True when `migrate_signers` should follow the upgrade (bare cohort). */
|
|
49
|
+
migrateRequired: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Ledger entries that are archived and must be restored before anything on
|
|
52
|
+
* the wallet can run. `instance` is the wallet instance, `code` its current
|
|
53
|
+
* code, `target` the upgrade target's code.
|
|
54
|
+
*/
|
|
55
|
+
archived: {
|
|
56
|
+
instance: boolean;
|
|
57
|
+
code: boolean;
|
|
58
|
+
target: boolean;
|
|
59
|
+
};
|
|
60
|
+
/** Operator guide. */
|
|
61
|
+
guideUrl: string;
|
|
62
|
+
/** One-paragraph instruction for this wallet. */
|
|
63
|
+
recommendation: string;
|
|
64
|
+
}
|
|
65
|
+
/** Classify a code hash without touching the network. */
|
|
66
|
+
export declare function classifyWasmHash(wasmHash: string, acceptedWasmHashes: readonly string[]): {
|
|
67
|
+
status: LegacyCodeStatus;
|
|
68
|
+
cohort: "bare" | "wrapped" | null;
|
|
69
|
+
};
|
|
70
|
+
/** Deps for {@link inspectLegacyWallet}. */
|
|
71
|
+
export interface InspectDeps {
|
|
72
|
+
rpc: Server;
|
|
73
|
+
acceptedWasmHashes: readonly string[];
|
|
74
|
+
/** Read the wallet's current code hash (hex). */
|
|
75
|
+
contractWasmHash: (contractId: string) => Promise<string>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Read a wallet's code hash and the liveness of the entries an upgrade
|
|
79
|
+
* touches, and say what to do.
|
|
80
|
+
*/
|
|
81
|
+
export declare function inspectLegacyWallet(deps: InspectDeps, contractId: string): Promise<LegacyWalletInspection>;
|
|
82
|
+
/** Deps for the transaction builders. */
|
|
83
|
+
export interface LegacyTxDeps {
|
|
84
|
+
rpcUrl: string;
|
|
85
|
+
networkPassphrase: string;
|
|
86
|
+
timeoutInSeconds: number;
|
|
87
|
+
/** The wallet contract spec, used to encode `SignerKey` arguments. */
|
|
88
|
+
spec: ContractSpec;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Build `wallet.update_contract_code(target)` for a legacy wallet.
|
|
92
|
+
*
|
|
93
|
+
* The transaction's single auth entry is the wallet's own, to be signed by an
|
|
94
|
+
* existing signer through {@link signLegacyUpgradeTx}. The envelope source is
|
|
95
|
+
* the SDK's placeholder account, so submit through `PasskeyServer.send` (a
|
|
96
|
+
* relayer supplies the source and fees) or rebuild with your own funded source.
|
|
97
|
+
*/
|
|
98
|
+
export declare function buildLegacyUpgradeTx(deps: LegacyTxDeps, contractId: string, target?: string): Promise<AssembledTransaction<null>>;
|
|
99
|
+
/**
|
|
100
|
+
* Build `wallet.migrate_signers(keys)` for a wallet already on the legacy-line
|
|
101
|
+
* target. The call needs no wallet authorization (it is a value-preserving
|
|
102
|
+
* re-encoding), so any funded source can submit it. Returns the number of
|
|
103
|
+
* entries rewritten when simulated or executed.
|
|
104
|
+
*
|
|
105
|
+
* Soroban has no storage iteration, so the caller supplies the keys: the
|
|
106
|
+
* hosted passkey indexer (`MercuryIndexer.getSigners` /
|
|
107
|
+
* `PasskeyServer.getSigners`) lists every signer a wallet has ever held.
|
|
108
|
+
*/
|
|
109
|
+
export declare function buildLegacyMigrateTx(deps: LegacyTxDeps, contractId: string, signerKeys: readonly SignerKey[]): Promise<AssembledTransaction<number>>;
|
|
110
|
+
/**
|
|
111
|
+
* Sign a legacy wallet's `update_contract_code` auth entry with one of its
|
|
112
|
+
* existing signers, without a connected wallet.
|
|
113
|
+
*
|
|
114
|
+
* Passkey and Ed25519 signature entries encode identically on every pre-1.0
|
|
115
|
+
* build, and the signature covers the V2 address-bound payload the host
|
|
116
|
+
* presents to any custom account, so the kit's normal signers work here. The
|
|
117
|
+
* entry root is pinned to the transaction's own host function, as for every
|
|
118
|
+
* wallet-admin write.
|
|
119
|
+
*/
|
|
120
|
+
export declare function signLegacyUpgradeTx<T>(deps: SignAuthEntryDeps & {
|
|
121
|
+
contractId: string;
|
|
122
|
+
}, tx: AssembledTransaction<T>, signer: Signer, options?: Omit<SignOptions, "allowWalletReentry"> & {
|
|
123
|
+
/**
|
|
124
|
+
* The only WASM hash an `update_contract_code` call may carry. Defaults to
|
|
125
|
+
* the canonical legacy-line target, so a transaction that would move the
|
|
126
|
+
* wallet to any other code is refused before anything is signed.
|
|
127
|
+
*/
|
|
128
|
+
expectedTarget?: string;
|
|
129
|
+
}): Promise<AssembledTransaction<T>>;
|
|
130
|
+
//# sourceMappingURL=legacy-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-ops.d.ts","sourceRoot":"","sources":["../../src/kit/legacy-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,oBAAoB,EAAE,KAAK,IAAI,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAChG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAUvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AAGrB;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,EAAE,SAAS,MAAM,EAG3D,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,gBAAgB;AAC1B,wEAAwE;AACtE,YAAY;AACd,0EAA0E;GACxE,QAAQ;AACV,wDAAwD;GACtD,SAAS;AACX,iCAAiC;GAC/B,SAAS,CAAC;AAEd,+DAA+D;AAC/D,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;IACzB,qEAAqE;IACrE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAClC,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,eAAe,EAAE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