/** * SIGNET: Programmable Signing Client * * Deploy, attach, and manage WASM signing policy programs. * Programs run in a sandboxed WASM environment at the agent layer * and enforce custom signing policies (spending limits, time locks, * multi-party approval workflows). * * Programs are deployed to the ProgramRegistry contract on-chain, * then attached to individual wallets. When a sign request arrives, * agents execute all attached programs -- the request is approved * only if every program returns "allow". * * @example * ```typescript * import { SignetClient } from '@sequence0/sdk'; * * const signet = new SignetClient({ baseUrl: 'http://agent:8080' }); * * // Deploy a spending-limit WASM program * const { programId } = await signet.deployProgram({ * bytecode: '0x00616...', * name: 'spending-limit', * description: 'Enforces a 1 ETH per-tx limit', * }); * * // Attach it to a wallet * await signet.attachProgram('my-wallet', programId); * * // Query attached programs * const programs = await signet.getWalletPrograms('my-wallet'); * ``` */ /** * Options for deploying a new WASM signing policy program. */ export interface DeployProgramOptions { /** WASM bytecode as hex string */ bytecode: string; /** Human-readable program name */ name: string; /** Optional description of what the program enforces */ description?: string; } /** * Response from deploying a program. */ export interface DeployProgramResponse { /** Unique program identifier (bytes32 hex) */ programId: string; } /** * Full information about a deployed program. */ export interface SignetProgramInfo { /** Unique program identifier (bytes32 hex) */ programId: string; /** Human-readable program name */ name: string; /** SHA-256 hash of the WASM bytecode */ bytecodeHash: string; /** Unix timestamp when the program was deployed */ deployedAt: number; } /** * A program attached to a wallet, including its active state. */ export interface WalletProgramEntry { /** Unique program identifier */ programId: string; /** Human-readable program name */ name: string; /** Whether this program is currently active on the wallet */ active: boolean; } /** * Client for the SIGNET Programmable Signing protocol. * * Communicates with program management endpoints on the agent node * to deploy WASM programs, attach/detach them to wallets, and query * program information. */ export declare class SignetClient { private baseUrl; /** * Create a new SignetClient. * * @param options - Client configuration * @param options.baseUrl - Agent node HTTP endpoint URL */ constructor(options: { baseUrl: string; }); /** * Deploy a new WASM signing policy program to the ProgramRegistry. * * The bytecode is uploaded to the agent network, validated, and * registered on-chain. Once deployed, the program can be attached * to any wallet owned by the deployer. * * @param options - Program deployment details * @returns The deployed program's unique identifier * * @throws {Sequence0Error} If the deployment parameters are invalid * @throws {NetworkError} If the agent is unreachable */ deployProgram(options: DeployProgramOptions): Promise; /** * Attach a deployed program to a wallet. * * Once attached, the program's policy is enforced on every sign * request for that wallet. Multiple programs can be attached to * the same wallet -- all must return "allow" for signing to proceed. * * @param walletId - The wallet to attach the program to * @param programId - The program to attach * * @throws {Sequence0Error} If the parameters are invalid * @throws {NetworkError} If the agent is unreachable */ attachProgram(walletId: string, programId: string): Promise; /** * Detach a program from a wallet. * * The program's policy will no longer be enforced on sign requests * for this wallet. The program itself remains deployed and can be * re-attached later. * * @param walletId - The wallet to detach the program from * @param programId - The program to detach * * @throws {Sequence0Error} If the parameters are invalid * @throws {NetworkError} If the agent is unreachable */ detachProgram(walletId: string, programId: string): Promise; /** * Get all programs attached to a wallet. * * @param walletId - The wallet ID to query * @returns Array of programs with their active state * * @throws {Sequence0Error} If the wallet ID is invalid * @throws {NetworkError} If the agent is unreachable */ getWalletPrograms(walletId: string): Promise; /** * Get detailed information about a deployed program. * * @param programId - The program ID to query * @returns Program info, or null if the program does not exist * * @throws {NetworkError} If the agent is unreachable */ getProgramInfo(programId: string): Promise; private get; private post; } //# sourceMappingURL=signet.d.ts.map