/** * Transaction-signing operations: the auth-entry signing pipeline and the * `AssembledTransaction` signing entrypoint. * * Two deliberate changes from the old kit: * - `sign` takes a single explicit `AssembledTransaction` instead of the * lossy `AssembledTransaction | Tx | string` tri-input that silently dropped * memo/fee/operations on its fallback path (#599 ยง6). Callers holding XDR use * `AssembledTransaction.fromXDR` first. * - The `Signatures` map is sorted with the host-order `compareScVal`, not the * old `localeCompare` string approximation. * - Signing is address-bound only: V1 address credentials are upgraded to * CAP-0071-02 V2 before the payload is hashed (`toAddressBoundCredentials`), * and there is no V1 signing path. * * @packageDocumentation */ import { xdr } from "@stellar/stellar-sdk"; import type { Keypair } from "@stellar/stellar-sdk"; import type { Server } from "@stellar/stellar-sdk/rpc"; import type { AssembledTransaction, Spec as ContractSpec } from "@stellar/stellar-sdk/contract"; import type { Signer, SignerContext } from "../signers.js"; /** Deps for computing a default signature-expiration ledger. */ export interface ExpirationDeps { rpc: Server; timeoutInSeconds: number; } /** * Compute a default signature-expiration ledger: the latest ledger plus the * timeout window (assuming ~5s ledgers), rounded up. */ export declare function calculateExpiration(deps: ExpirationDeps): Promise; /** Deps for signing a single auth entry. */ export interface SignAuthEntryDeps { networkPassphrase: string; spec: ContractSpec; signerContext: SignerContext; calculateExpiration: () => Promise; } /** Per-call signing options. */ export interface SignOptions { /** Signature expiration ledger (defaults to the configured window). */ expiration?: number; } /** * Sign a single Soroban authorization entry with a {@link Signer}, merging the * resulting `(SignerKey, Signature)` pair into the entry's flat `Signatures` * map (host-ordered). * * Mutates and returns the passed entry. */ export declare function signAuthEntry(deps: SignAuthEntryDeps, entry: xdr.SorobanAuthorizationEntry, signer: Signer, options?: SignOptions): Promise; /** Deps for signing an assembled transaction's auth entries. */ export interface SignTxDeps extends SignAuthEntryDeps { getContractId: () => string | undefined; } /** * Sign every auth entry of an {@link AssembledTransaction} that is authorized by * the connected wallet, using `signer`. Returns the same transaction with its * auth entries signed. * * @throws {SigningError} If no wallet is connected. */ export declare function sign(deps: SignTxDeps, txn: AssembledTransaction, signer: Signer, options?: SignOptions): Promise>; /** * The `restorePreamble` shape Soroban simulation returns when a transaction * touches archived entries (a subset of the SDK's `SimulateTransactionResponse`). */ export interface RestorePreamble { minResourceFee: string; transactionData: { build(): xdr.SorobanTransactionData; }; } /** * Restore an archived contract-data footprint reported by simulation, paying * with the deployer keypair. * * Soroban simulation returns a `restorePreamble` when the transaction touches * archived entries; the footprint must be restored (a separate, fee-bearing * transaction) before the real transaction can succeed. The deployer keypair * pays because it is the on-chain fee source the kit already controls. * * Returns the restore transaction hash. This path is exercised live in F2 (it * requires archived on-chain state to trigger). * * @throws {SigningError} On submission/confirmation failure. */ export declare function restoreFootprint(deps: { rpc: Server; networkPassphrase: string; deployerKeypair: Keypair; timeoutInSeconds: number; }, restorePreamble: RestorePreamble): Promise; //# sourceMappingURL=tx-ops.d.ts.map