MCPcopy Create free account
hub / github.com/block/buzz / toRawChannel

Function toRawChannel

desktop/src/testing/e2eBridge.ts:837–863  ·  view source on GitHub ↗
(
  channel: MockChannel,
  config?: E2eConfig,
)

Source from the content-addressed store, hash-verified

835}
836
837function toRawChannel(
838 channel: MockChannel,
839 config?: E2eConfig,
840): RawChannelWithMembership {
841 const currentPubkey = getMockMemberPubkey(config).toLowerCase();
842
843 return {
844 id: channel.id,
845 name: channel.name,
846 channel_type: channel.channel_type,
847 visibility: channel.visibility,
848 description: channel.description,
849 topic: channel.topic,
850 purpose: channel.purpose,
851 member_count: channel.member_count,
852 member_pubkeys: channel.members.map((member) => member.pubkey),
853 last_message_at: channel.last_message_at,
854 archived_at: channel.archived_at,
855 participants: [...channel.participants],
856 participant_pubkeys: [...channel.participant_pubkeys],
857 ttl_seconds: channel.ttl_seconds ?? null,
858 ttl_deadline: channel.ttl_deadline ?? null,
859 is_member: channel.members.some(
860 (member) => member.pubkey.toLowerCase() === currentPubkey,
861 ),
862 };
863}
864
865function toRawChannelDetail(
866 channel: MockChannel,

Callers 4

toRawChannelDetailFunction · 0.85
listMockChannelsFunction · 0.85
handleCreateChannelFunction · 0.85
handleOpenDmFunction · 0.85

Calls 1

getMockMemberPubkeyFunction · 0.85

Tested by

no test coverage detected