/** * Signer manager: the signing pipeline and signer-write builders for the * connected wallet. * * Owns nothing directly — every wallet-dependent value is a late-bound closure * ({@link SignerManagerDeps.getWallet} / `getContractId` / `getSpec`) supplied by * the kit facade, so the manager is constructed once and always sees current * state. That indirection is also what makes it `vi.fn()`-testable. * * @packageDocumentation */ import { xdr } from "@stellar/stellar-sdk"; import type { Server } from "@stellar/stellar-sdk/rpc"; import type { AssembledTransaction } from "@stellar/stellar-sdk/contract"; import type { Client as PasskeyClient, SignerVal } from "passkey-kit-sdk"; import type { Signer, SignerContext } from "../signers.js"; import { SignerKey, SignerStore, type SignerLimits } from "../types.js"; import { type SignOptions } from "../kit/tx-ops.js"; import { type WalletTx } from "../kit/wallet-ops.js"; export interface SignerManagerDeps { networkPassphrase: string; timeoutInSeconds: number; rpc: Server; getWallet: () => PasskeyClient | undefined; getContractId: () => string | undefined; getSignerContext: () => SignerContext; calculateExpiration: () => Promise; } export declare class SignerManager { private readonly deps; constructor(deps: SignerManagerDeps); private requireWallet; private writeDeps; private signAuthEntryDeps; /** Sign a single auth entry with `signer` (defaults to the connected passkey). */ signAuthEntry(entry: xdr.SorobanAuthorizationEntry, signer?: Signer, options?: SignOptions): Promise; /** Sign an assembled transaction's wallet auth entries. */ sign(txn: AssembledTransaction, signer?: Signer, options?: SignOptions): Promise>; addSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise; /** * Update a passkey signer's limits/storage/expiration. * * The signer's `publicKey` is deliberately NOT a parameter: `update_signer` * replaces the whole on-chain `SignerVal`, so the ledger is treated as the * single source of truth for key material — a limits-only update must never * change the stored public key. The authoritative key * is re-read from the ledger here, and only that value is written back. * * @throws {SignerNotFoundError} If the keyId is not a live on-chain signer. */ updateSecp256r1(keyId: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise; addEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise; updateEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise; addPolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise; updatePolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise; remove(signerKey: SignerKey): Promise; /** Build an `upgrade(new_wasm_hash)` transaction. */ upgrade(newWasmHash: Buffer | Uint8Array): Promise; /** Read a signer entry from the ledger (temporary before persistent). */ getSigner(signerKey: SignerKey): Promise; } //# sourceMappingURL=signer-manager.d.ts.map