@@ -37,13 +37,7 @@ import {
37
37
AgentMessageCodec ,
38
38
ContentTypeAgentMessage ,
39
39
} from "../content-types/agent-message.js" ;
40
- import type {
41
- Agent ,
42
- clientMessage ,
43
- Message ,
44
- User ,
45
- UserReturnType ,
46
- } from "./types.js" ;
40
+ import type { Agent , clientMessage , Message , UserReturnType } from "./types.js" ;
47
41
48
42
dotenv . config ( ) ;
49
43
@@ -92,7 +86,7 @@ export class XMTP {
92
86
93
87
const volumePath =
94
88
process . env . RAILWAY_VOLUME_MOUNT_PATH ??
95
- this . agent ?. config ?. path ??
89
+ this . agent ?. config ?. dbPath ??
96
90
".data/xmtp" ;
97
91
98
92
if ( ! fs . existsSync ( volumePath ) ) {
@@ -484,6 +478,7 @@ async function streamMessages(
484
478
) {
485
479
continue ;
486
480
}
481
+
487
482
const parsedMessage = await parseMessage (
488
483
message ,
489
484
conversation ,
@@ -587,7 +582,16 @@ export async function parseMessage(
587
582
} ;
588
583
}
589
584
const date = message . sentAt ;
590
- let sender : User | undefined = undefined ;
585
+ let sender :
586
+ | {
587
+ inboxId : string ;
588
+ address : string ;
589
+ accountAddresses : string [ ] ;
590
+ installationIds : string [ ] ;
591
+ username ?: string ;
592
+ ensDomain ?: string ;
593
+ }
594
+ | undefined = undefined ;
591
595
592
596
await conversation ?. sync ( ) ;
593
597
const members = await conversation ?. members ( ) ;
@@ -596,14 +600,26 @@ export async function parseMessage(
596
600
address : member . accountAddresses [ 0 ] ,
597
601
accountAddresses : member . accountAddresses ,
598
602
installationIds : member . installationIds ,
599
- } ) ) as User [ ] ;
603
+ } ) ) as {
604
+ inboxId : string ;
605
+ address : string ;
606
+ accountAddresses : string [ ] ;
607
+ installationIds : string [ ] ;
608
+ } [ ] ;
600
609
601
610
sender = membersArray . find (
602
- ( member : User ) => member . inboxId === message . senderInboxId ,
611
+ ( member : { inboxId : string } ) => member . inboxId === message . senderInboxId ,
603
612
) ;
604
613
return {
605
614
id : message . id ,
606
- sender,
615
+ sender : {
616
+ inboxId : sender ?. inboxId || "" ,
617
+ address : sender ?. address || "" ,
618
+ accountAddresses : sender ?. accountAddresses || [ ] ,
619
+ installationIds : sender ?. installationIds || [ ] ,
620
+ username : sender ?. username || "" ,
621
+ ensDomain : sender ?. ensDomain || "" ,
622
+ } ,
607
623
group : {
608
624
id : conversation ?. id ,
609
625
createdAt : conversation ?. createdAt ,
0 commit comments