@@ -417,6 +417,11 @@ const {
417417- ` sendTransaction(txParams) ` : Send a privacy-preserving transaction through the session key
418418 - ` txParams ` : ` { to: string, value: string, data: string } `
419419 - Returns: ` Promise<string> ` (transaction hash)
420+ - ` waitForReceipt(txHash, timeout?) ` : Wait for transaction receipt and confirmation
421+ - ` txHash ` : Transaction hash from ` sendTransaction `
422+ - ` timeout ` : Optional timeout in milliseconds (default: 30000)
423+ - Returns: ` Promise<TransactionReceipt> ` (full receipt with logs and status)
424+ - Throws: Error if transaction reverts or timeout is exceeded
420425- ` createSessionKey() ` : Create a new session key
421426- ` fundSessionKey(address, amount, userAddress) ` : Fund a session key with ETH
422427- ` deleteSessionKey() ` : Delete the current session key
@@ -426,10 +431,10 @@ const {
426431** Example:**
427432``` tsx
428433import { useSessionKeyStore } from ' @tenprotocol/ten-kit' ;
429- import { encodeFunctionData , parseEther } from ' viem' ;
434+ import { encodeFunctionData , parseEther , parseEventLogs } from ' viem' ;
430435
431436function MyComponent() {
432- const { sessionKey, sendTransaction } = useSessionKeyStore ();
437+ const { sessionKey, sendTransaction, waitForReceipt } = useSessionKeyStore ();
433438
434439 const handleTransaction = async () => {
435440 const data = encodeFunctionData ({
@@ -442,6 +447,17 @@ function MyComponent() {
442447 value: ` 0x${parseEther (' 0.01' ).toString (16 )} ` ,
443448 data ,
444449 });
450+
451+ // Wait for confirmation and get receipt
452+ const receipt = await waitForReceipt (txHash );
453+ console .log (' Status:' , receipt .status );
454+
455+ // Parse event logs
456+ const events = parseEventLogs ({
457+ abi: MyContractABI ,
458+ logs: receipt .logs ,
459+ });
460+ console .log (' Events:' , events );
445461 };
446462
447463 return <button onClick = { handleTransaction } >Send TX</button >;
@@ -624,6 +640,7 @@ import type {
624640 // Session Key Types
625641 SessionKeyStore ,
626642 TransactionParams ,
643+ TransactionReceipt ,
627644
628645 // Public Clients
629646 TENPublicClients ,
@@ -640,6 +657,12 @@ const txParams: TransactionParams = {
640657 data: ' 0x...' ,
641658};
642659
660+ // Example: Working with receipts
661+ const receipt: TransactionReceipt = await waitForReceipt (txHash );
662+ console .log (' Status:' , receipt .status );
663+ console .log (' Gas used:' , receipt .gasUsed );
664+ console .log (' Logs:' , receipt .logs );
665+
643666// Example: Custom Config
644667const config: TenConfig = {
645668 id: 8443 ,
0 commit comments