keyring-chatbot-agent-sdk-test 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,8 +43,8 @@ function App() {
43
43
  const handleTransaction = async (tx: Transaction) => {
44
44
  // Handle transaction signing and submission
45
45
  console.log('Transaction:', tx);
46
- // Return 'success' or 'fail' after processing
47
- return 'success';
46
+ // Return TransactionResult object after processing
47
+ return { status: 'success' as const, transactionHash: '0x...' };
48
48
  };
49
49
 
50
50
  return (
@@ -246,7 +246,7 @@ widget.addEventListener('close', () => console.log('Closed'));
246
246
  | `onOpen` | `() => void` | - | Callback when chat opens |
247
247
  | `onClose` | `() => void` | - | Callback when chat closes |
248
248
  | `account` | `Account` | - | Wallet account info (can be provided via ConnectProvider) |
249
- | `onTransaction` | `(tx: Transaction) => Promise<'success' \| 'fail'>` | **Required** | Transaction handler |
249
+ | `onTransaction` | `(tx: Transaction) => Promise<TransactionResult>` | **Required** | Transaction handler |
250
250
 
251
251
  #### Account Type
252
252
 
@@ -269,6 +269,16 @@ interface Transaction {
269
269
  }
270
270
  ```
271
271
 
272
+ #### TransactionResult Type
273
+
274
+ ```typescript
275
+ interface TransactionResult {
276
+ status: 'success' | 'fail';
277
+ transactionHash?: string; // Optional transaction hash on success
278
+ error?: string; // Optional error message on failure
279
+ }
280
+ ```
281
+
272
282
  #### Theme Configuration
273
283
 
274
284
  ```typescript