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 +13 -3
- package/dist/chat-widget.es.js +4041 -3006
- package/dist/chat-widget.umd.js +92 -77
- package/dist/lib.d.ts +21 -3
- package/package.json +4 -1
- package/dist/ccip-IYnyK3PA.js +0 -147
- package/dist/chat-widget-wc.es.js +0 -35157
- package/dist/chat-widget-wc.umd.js +0 -498
- package/dist/lib-D9s5_kE6.js +0 -14878
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
|
|
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<
|
|
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
|