passkey-kit 0.14.0 → 0.16.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/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";
@@ -29,6 +30,8 @@ export class PasskeyKit {
29
30
  rpcUrl;
30
31
  networkPassphrase;
31
32
  walletWasmHash;
33
+ /** Accepted code identities, lowercase hex. Never empty. */
34
+ acceptedWasmHashes;
32
35
  rpId;
33
36
  /** Lifecycle event emitter (walletCreated, walletConnected, …). */
34
37
  events = new PasskeyEventEmitter();
@@ -55,11 +58,33 @@ export class PasskeyKit {
55
58
  this.rpcUrl = config.rpcUrl;
56
59
  this.networkPassphrase = config.networkPassphrase;
57
60
  this.walletWasmHash = config.walletWasmHash;
61
+ // Seeded from the deploy hash so the common case is zero-config; an empty
62
+ // array would silently accept nothing, so treat it as "not supplied".
63
+ this.acceptedWasmHashes = (config.acceptedWasmHashes?.length
64
+ ? config.acceptedWasmHashes
65
+ : [config.walletWasmHash]).map((h) => h.toLowerCase());
58
66
  this.rpId = config.rpId;
59
67
  this.timeoutInSeconds = config.timeoutInSeconds ?? DEFAULT_TIMEOUT_SECONDS;
60
68
  this.webAuthn =
61
69
  config.WebAuthn ?? { startRegistration, startAuthentication };
62
70
  const deployerKeypair = resolveDeployer(config.deploySource);
71
+ let restoreKeypair;
72
+ if (config.restoreSource) {
73
+ try {
74
+ restoreKeypair = Keypair.fromSecret(config.restoreSource);
75
+ }
76
+ catch {
77
+ throw new ConfigurationError("restoreSource must be a valid Stellar secret key (S…)", PasskeyKitErrorCode.INVALID_CONFIG);
78
+ }
79
+ }
80
+ else if (!isDefaultDeployer(deployerKeypair.publicKey())) {
81
+ // No dedicated restoreSource, but the integrator supplied their OWN funded
82
+ // deploySource: keep the pre-existing behaviour and let it source restores.
83
+ // Address derivation is unaffected (their deployer identity is unchanged),
84
+ // so this stays address-preserving. Only the SHARED default deployer is
85
+ // refused — it must never source or fund a transaction.
86
+ restoreKeypair = deployerKeypair;
87
+ }
63
88
  this.credentialManager = new CredentialManager({
64
89
  rpId: this.rpId,
65
90
  webAuthn: this.webAuthn,
@@ -80,6 +105,7 @@ export class PasskeyKit {
80
105
  networkPassphrase: this.networkPassphrase,
81
106
  walletWasmHash: this.walletWasmHash,
82
107
  deployerKeypair,
108
+ restoreKeypair,
83
109
  timeoutInSeconds: this.timeoutInSeconds,
84
110
  });
85
111
  }
@@ -87,7 +113,7 @@ export class PasskeyKit {
87
113
  get contractId() {
88
114
  return this.wallet?.options.contractId;
89
115
  }
90
- /** The fee-paying deployer's `G…` public key. */
116
+ /** The address-derivation deployer's `G…` public key. */
91
117
  get deployerPublicKey() {
92
118
  return this.submissionManager.deployerPublicKey;
93
119
  }
@@ -101,7 +127,7 @@ export class PasskeyKit {
101
127
  }
102
128
  /**
103
129
  * Register a passkey and deploy a smart wallet initialized with it as the
104
- * first signer. Returns the signed deploy transaction (submit it via
130
+ * first signer. Returns the authorized deploy carrier (submit it via
105
131
  * `PasskeyServer`).
106
132
  */
107
133
  async createWallet(appName, userName, options) {
@@ -133,10 +159,12 @@ export class PasskeyKit {
133
159
  /**
134
160
  * Connect an existing wallet from a passkey.
135
161
  *
136
- * Resolves the wallet address by (1) deterministic derivation from the keyId,
137
- * (2) local storage, then (3) an injected indexer lookup — and then VERIFIES
162
+ * Resolves the wallet address by (1) local storage, (2) an injected indexer
163
+ * lookup, then (3) deterministic derivation from the keyId — and then VERIFIES
138
164
  * ownership: the keyId must resolve to a live signer on the wallet (#601 F7).
139
165
  * This closes the unverified reverse-lookup hole (#598 F3) at the SDK layer.
166
+ * Derivation is deliberately last: it is only correct for a wallet's first
167
+ * credential and is the one path a squatted contract can hijack.
140
168
  *
141
169
  * @throws {WalletOwnershipError} If the keyId is not a signer on the wallet.
142
170
  */
@@ -150,18 +178,32 @@ export class PasskeyKit {
150
178
  }
151
179
  const keyIdBase64 = keyId instanceof Uint8Array ? base64url(Buffer.from(keyId)) : keyId;
152
180
  const keyIdBuffer = keyId instanceof Uint8Array ? Buffer.from(keyId) : base64url.toBuffer(keyId);
153
- // 1) Deterministic derivation, confirmed by an on-chain instance read.
154
- // Transport errors (429/5xx/timeout) propagate only an authoritative
155
- // not-found may abandon the canonical derivation for the less-trusted
156
- // storage/indexer fallbacks.
157
- let contractId = this.submissionManager.deriveWalletAddress(keyIdBuffer);
158
- if (!(await contractInstanceExists(this.rpc, contractId))) {
159
- // 2) local storage, then 3) injected indexer lookup.
160
- contractId =
161
- (await this.credentialManager.lookupContractId(keyIdBase64)) ??
162
- (options?.getContractId
163
- ? await options.getContractId(keyIdBase64)
164
- : undefined);
181
+ // Resolve the wallet address. Deterministic derivation is authoritative
182
+ // ONLY for a wallet's first credential (the one whose keyId salted the
183
+ // deploy); for every later signer `derive(keyId)` points at an address that
184
+ // is never legitimately deployed, and is the one resolution path an attacker
185
+ // can poison by squatting code at that derived address. So trusted state
186
+ // wins and derivation is a last-resort hint, confirmed by an on-chain read:
187
+ // 1) local storage, 2) injected indexer lookup, 3) derivation.
188
+ // The keyId is still verified as a live signer below (F7), so a stale hint
189
+ // can never connect to a wallet the passkey does not actually control.
190
+ let contractId = await this.credentialManager.lookupContractId(keyIdBase64);
191
+ // Whether the address came from trusted local state. An indexer row or a
192
+ // derived address is a CLAIM by an untrusted party: any contract can emit
193
+ // the signer events an indexer keys on, and any contract can write the
194
+ // signer ledger entry we read back. Both are checked against accepted code
195
+ // identity below; trusted state is not, so an upgraded wallet still opens.
196
+ const fromTrustedState = contractId !== undefined;
197
+ if (!contractId && options?.getContractId) {
198
+ contractId = await options.getContractId(keyIdBase64);
199
+ }
200
+ if (!contractId) {
201
+ // Transport errors (429/5xx/timeout) propagate — only an authoritative
202
+ // not-found leaves the derived address unresolved.
203
+ const derived = this.submissionManager.deriveWalletAddress(keyIdBuffer);
204
+ if (await contractInstanceExists(this.rpc, derived)) {
205
+ contractId = derived;
206
+ }
165
207
  }
166
208
  if (!contractId) {
167
209
  throw new PasskeyKitError("Could not resolve a wallet for the given passkey", PasskeyKitErrorCode.WALLET_NOT_FOUND, { context: { keyId: keyIdBase64 } });
@@ -172,7 +214,21 @@ export class PasskeyKit {
172
214
  networkPassphrase: this.networkPassphrase,
173
215
  });
174
216
  this.keyId = keyIdBase64;
175
- // 3) Ownership verification (F7): the keyId must be a live signer.
217
+ // 3) Code identity FIRST, then signer state the ordering matters. A signer
218
+ // entry only means "this passkey was authorized onto this wallet" if the code
219
+ // that wrote it enforced authorization; under arbitrary code it means nothing.
220
+ // So bind accepted code before reading any signer state from the contract.
221
+ if (options?.verifyWasmHash ?? !fromTrustedState) {
222
+ try {
223
+ await this.assertWalletWasmHash(contractId);
224
+ }
225
+ catch (err) {
226
+ this.wallet = undefined;
227
+ this.keyId = undefined;
228
+ throw err;
229
+ }
230
+ }
231
+ // 4) Ownership verification (F7): the keyId must be a live signer.
176
232
  // A thrown error here is a transport failure, not proof of non-ownership —
177
233
  // surface it as-is (a valid passkey must not read as an ownership mismatch
178
234
  // because the RPC hiccuped); only a definitive not-found (`null`) does.
@@ -190,19 +246,6 @@ export class PasskeyKit {
190
246
  this.keyId = undefined;
191
247
  throw new WalletOwnershipError("The passkey is not a signer on the resolved wallet", { contractId, keyId: keyIdBase64 });
192
248
  }
193
- // 4) Optional wasm-hash check (opt-in; upgraded wallets differ by design).
194
- // A failed check must leave the kit disconnected — otherwise a subsequent
195
- // sign() would operate on the contract the caller just rejected.
196
- if (options?.verifyWasmHash) {
197
- try {
198
- await this.assertWalletWasmHash(contractId);
199
- }
200
- catch (err) {
201
- this.wallet = undefined;
202
- this.keyId = undefined;
203
- throw err;
204
- }
205
- }
206
249
  this.events.emit("walletConnected", { contractId, keyId: keyIdBase64 });
207
250
  return { rawResponse, keyId: keyIdBuffer, keyIdBase64, contractId };
208
251
  }
@@ -219,10 +262,10 @@ export class PasskeyKit {
219
262
  });
220
263
  }
221
264
  const wasmHash = executable.wasmHash().toString("hex");
222
- if (wasmHash !== this.walletWasmHash.toLowerCase()) {
223
- throw new WalletOwnershipError("Wallet WASM hash does not match", {
265
+ if (!this.acceptedWasmHashes.includes(wasmHash)) {
266
+ throw new WalletOwnershipError("Wallet code identity is not accepted", {
224
267
  contractId,
225
- expected: this.walletWasmHash,
268
+ accepted: this.acceptedWasmHashes,
226
269
  actual: wasmHash,
227
270
  });
228
271
  }
@@ -246,8 +289,28 @@ export class PasskeyKit {
246
289
  return this.signerManager.sign(txn, signer, options);
247
290
  }
248
291
  // -- Signer management -------------------------------------------------------
249
- addSecp256r1(keyId, publicKey, limits, store, expiration) {
250
- return this.signerManager.addSecp256r1(keyId, publicKey, limits, store, expiration);
292
+ async addSecp256r1(keyId, publicKey, limits, store, expiration) {
293
+ const tx = await this.signerManager.addSecp256r1(keyId, publicKey, limits, store, expiration);
294
+ // Persist the keyId → wallet mapping so a later connectWallet(keyId) resolves
295
+ // this wallet from trusted storage instead of derivation (derive(keyId) of a
296
+ // secondary passkey is a squattable address). Without this record a pure-SDK
297
+ // consumer has nothing but derivation to fall back on for a second signer.
298
+ // ponytail: optimistic — written at build time, before the caller submits.
299
+ // If the add tx never lands the keyId is not a signer anywhere, so the F7
300
+ // ownership check in connectWallet rejects the stale hint rather than
301
+ // mis-binding. Requires a connected wallet (add_signer is wallet-authorized).
302
+ const contractId = this.contractId;
303
+ if (contractId) {
304
+ await this.credentialManager.rememberPasskey({
305
+ keyId: keyId instanceof Uint8Array ? base64url(Buffer.from(keyId)) : keyId,
306
+ publicKey: publicKey instanceof Uint8Array
307
+ ? publicKey
308
+ : base64url.toBuffer(publicKey),
309
+ contractId,
310
+ createdAt: Date.now(),
311
+ });
312
+ }
313
+ return tx;
251
314
  }
252
315
  /**
253
316
  * 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;AACt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AAC;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 signs the deploy transaction with the fee-
3
- * paying deployer keypair, derives deterministic wallet addresses, and drives
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 keypair and the fee-payer signature that make a
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 (fee source + derivation deployer). */
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
- * Sign a deploy transaction with the deployer keypair (the fee source) and
36
- * return the signed transaction XDR.
34
+ * Authorize a deploy and return its carrier transaction XDR.
37
35
  *
38
- * The deploy carries source-account auth, so it is submitted through the
39
- * relayer's fee-bump (`{ xdr }`) path. A fee-bumped Soroban inner transaction
40
- * must have `fee == resourceFee` the fee-bump supplies the inclusion fee
41
- * or the relayer rejects it with a fee mismatch ("Transaction fee must be
42
- * equal to the resource fee"). The assembled fee is `inclusion + resource`,
43
- * so pin it to the resource fee BEFORE the deployer signs (the signature
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;;;;;;;;;;GAUG;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;AAE1B,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,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,qBAAqB;IAExD,yEAAyE;IACzE,IAAI,iBAAiB,IAAI,MA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AAmB,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 signs the deploy transaction with the fee-
3
- * paying deployer keypair, derives deterministic wallet addresses, and drives
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 keypair and the fee-payer signature that make a
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 (fee source + derivation deployer). */
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
- * Sign a deploy transaction with the deployer keypair (the fee source) and
43
- * return the signed transaction XDR.
44
+ * Authorize a deploy and return its carrier transaction XDR.
44
45
  *
45
- * The deploy carries source-account auth, so it is submitted through the
46
- * relayer's fee-bump (`{ xdr }`) path. A fee-bumped Soroban inner transaction
47
- * must have `fee == resourceFee` the fee-bump supplies the inclusion fee
48
- * or the relayer rejects it with a fee mismatch ("Transaction fee must be
49
- * equal to the resource fee"). The assembled fee is `inclusion + resource`,
50
- * so pin it to the resource fee BEFORE the deployer signs (the signature
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
- deployerKeypair: this.deps.deployerKeypair,
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;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,EACL,sBAAsB,IAAI,wBAAwB,EAClD,mBAAmB,IAAI,qBAAqB,GAC7C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,IAAI,kBAAkB,GAEvC,MAAM,kBAAkB,CAAC;AAW1B,MAAM,OAAO,iBAAiB;IACC;IAA7B,YAA6B,IAA2B;QAA3B,SAAI,GAAJ,IAAI,CAAuB;IAAG,CAAC;IAE5D,yEAAyE;IACzE,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;IAC/C,CAAC;IAED,4EAA4E;IAC5E,mBAAmB,CAAC,KAAa;QAC/B,OAAO,qBAAqB,CAC1B;YACE,iBA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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 deploy transaction that needs source-account auth + a fee bump).
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 deploys / source-account-auth transactions).
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 deploy transaction that needs source-account auth + a fee bump).
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 deploys / source-account-auth transactions).
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 the preferred
54
- * `{ func, auth }` Soroban path; everything else (deploys, source-account auth)
55
- * is fee-bumped via the `{ xdr }` envelope path. Never throws — returns a typed
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. */
@@ -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,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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 the preferred
83
- * `{ func, auth }` Soroban path; everything else (deploys, source-account auth)
84
- * is fee-bumped via the `{ xdr }` envelope path. Never throws — returns a typed
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 (op?.type === "invokeHostFunction" && !hasSourceAccountAuth(built)) {
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"));
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],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