import { Network, Account, TransactionOptions, TransactionStatusResponse, TxHistoryResult } from '@provablehq/aleo-types'; import { WalletName, WalletDecryptPermission, WalletReadyState, ConnectOptions, RecordStatusFilter, AleoDeployment, EventEmitter } from '@provablehq/aleo-wallet-standard'; import { BaseAleoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-core'; /** * Shield wallet adapter */ declare class ShieldWalletAdapter extends BaseAleoWalletAdapter { /** * The wallet name */ readonly name: WalletName<"Shield Wallet">; /** * The wallet URL */ url: string; /** * The wallet icon (base64-encoded SVG) */ readonly icon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMTI0LjU5NSAyNzguMzc2VjExMy40MDNIMjU2LjIwNlY0MjguNTYyQzI1NS4zMjQgNDI4LjI0OCAxMjQuNTk1IDM4MS41NzggMTI0LjU5NSAyNzguMzc2WiIgZmlsbD0idXJsKCNwYWludDBfbGluZWFyXzVfMTUpIi8+CjxwYXRoIGQ9Ik0zODcuODI1IDI3OC4zNzZWMTEzLjQwM0gyNTYuMjE0VjQyOC41NjJDMjU3LjA5NiA0MjguMjQ4IDM4Ny44MjUgMzgxLjU3OCAzODcuODI1IDI3OC4zNzZaIiBmaWxsPSJ1cmwoI3BhaW50MV9saW5lYXJfNV8xNSkiLz4KPHBhdGggb3BhY2l0eT0iMC4xIiBkPSJNMjU2LjIwNiA0NDAuNzcxQzI1NS4zMTkgNDQwLjQ1NiAxMTQuNDIgMzg1LjY0NiAxMTQuNDIgMjgyLjQ0NVYxMDMuMjI4SDI1Ni4yMDZWNDQwLjc3MVpNMzk4IDEwMy4yMjhWMjgyLjQ0NUMzOTggMzg1LjYzNSAyNTcuMTMgNDQwLjQ0NSAyNTYuMjE1IDQ0MC43NzFWMTAzLjIyOEgzOThaIiBmaWxsPSJibGFjayIvPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyXzVfMTUiIHgxPSIxOTAuNDAyIiB5MT0iMTEzLjQwMyIgeDI9IjE5MC40MDIiIHkyPSI0MjguNTY0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLW9wYWNpdHk9IjAiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzVfMTUiIHgxPSIzMjIuMDE4IiB5MT0iMTEzLjQwMyIgeDI9IjMyMi4wMTgiIHkyPSI0MjguNTY0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3Atb3BhY2l0eT0iMCIvPgo8c3RvcCBvZmZzZXQ9IjEiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"; /** * The window object */ private _window; /** * Current network */ network: Network; /** * The wallet's decrypt permission */ decryptPermission: WalletDecryptPermission; /** * Public key */ private _publicKey; _readyState: WalletReadyState; /** * Shield wallet instance */ private _shieldWallet; /** * Create a new Shield wallet adapter * @param config Adapter configuration */ constructor(); /** * Check if Shield wallet is available */ private _checkAvailability; /** * Connect to Shield wallet * @returns The connected account */ connect(network: Network, decryptPermission: WalletDecryptPermission, programs?: string[], options?: ConnectOptions): Promise; /** * Disconnect from Shield wallet */ disconnect(): Promise; /** * Sign a transaction with Shield wallet * @param message The message to sign * @returns The signed message */ signMessage(message: Uint8Array): Promise; decrypt(cipherText: string): Promise; /** * Execute a transaction with Shield wallet * @param options Transaction options * @returns The executed temporary transaction ID */ executeTransaction(options: TransactionOptions): Promise<{ transactionId: string; }>; /** * Get transaction status * @param transactionId The transaction ID * @returns The transaction status */ transactionStatus(transactionId: string): Promise; /** * Switch the network * @param network The network to switch to */ switchNetwork(_network: Network): Promise; /** * Request records from Shield wallet * @param program The program to request records from * @param includePlaintext Whether to include plaintext on each record * @param statusFilter Whether to filter records by status * @returns The records */ requestRecords(program: string, includePlaintext: boolean, statusFilter?: RecordStatusFilter): Promise; /** * Execute a deployment * @param deployment The deployment to execute * @returns The executed transaction ID */ executeDeployment(deployment: AleoDeployment): Promise<{ transactionId: string; }>; /** * get transition view keys(tvk) for a transaction * @param transactionId The transaction ID * @returns The tvk array */ transitionViewKeys(transactionId: string): Promise; /** * get transaction of specific program * @param program The program ID * @returns array of transactionId */ requestTransactionHistory(program: string): Promise; /** * Shield's currently-supported derived-input algorithms. Returns the SDK's * known-algorithm catalog; the wallet itself is the source of truth at * runtime and will reject any algorithm it doesn't implement. * * TODO(wallet): when the injector exposes an `algorithmsSupported` message, * replace this static list with a real round-trip so dapps see what THIS * Shield build supports, not just the SDK's static catalog. */ algorithmsSupported(): Promise; /** * EVENTS HANDLING */ _onNetworkChange: (network: Network) => void; _onAccountChange: () => void; _onDisconnect: () => void; /** * Set up event listeners with structured approach */ private _setupListeners; /** * Clean up all event listeners */ private _cleanupListeners; } interface ShieldWalletAdapterConfig { } interface ShieldTransaction extends TransactionOptions { network: Network; } interface ShieldDeployment extends AleoDeployment { network: Network; } interface ShieldWalletEvents { networkChanged(network: Network): void; disconnect(): void; accountChanged(): void; } interface ShieldWallet extends EventEmitter { publicKey?: string; connect(network: Network, decryptPermission: WalletDecryptPermission, programs?: string[], options?: ConnectOptions): Promise<{ address: string; }>; disconnect(): Promise; signMessage(message: Uint8Array): Promise; decrypt(cipherText: string): Promise; executeTransaction(transactionOptions: ShieldTransaction): Promise<{ transactionId?: string; }>; transactionStatus(transactionId: string): Promise; switchNetwork(network: Network): Promise; requestRecords(program: string, includePlaintext?: boolean): Promise; executeDeployment(deployment: ShieldDeployment): Promise<{ transactionId: string; }>; transitionViewKeys: (transactionId: string) => Promise; requestTransactionHistory: (program: string) => Promise; } interface ShieldWindow extends Window { shield?: ShieldWallet; } export { type ShieldDeployment, type ShieldTransaction, type ShieldWallet, ShieldWalletAdapter, type ShieldWalletAdapterConfig, type ShieldWalletEvents, type ShieldWindow };