UNPKG

discreetly-interfaces

Version:

Common interfaces and utilities for discreetly

56 lines (55 loc) 1.71 kB
import type { RLNFullProof } from 'rlnjs'; import { MessageType, MessageInterfaces } from './messageTypes'; export * from './utils'; export * from './messageTypes'; export type IdentityCommitmentT = bigint | string; export type RoomType = 'PUBLIC' | 'PRIVATE'; export type MembershipType = 'IDENTITY_LIST' | 'BANDADA_GROUP'; export type EmepheralType = 'EPHEMERAL' | 'PERSISTENT'; export type EncryptedType = 'AES' | 'PLAINTEXT'; export interface MessageI { id?: string; messageId?: string; roomId?: RLNFullProof['rlnIdentifier'] | string; messageType?: MessageType; message: MessageInterfaces | string; proof?: RLNFullProof | string; epoch?: number | bigint; timeStamp?: string | Date | number; encrypted?: EncryptedType; responseTo?: string; sessionId?: string; } export interface SystemMessageI { timeStamp: string; message: string; room?: RLNFullProof['rlnIdentifier'] | string; } export interface RoomI { id: string; roomId: RLNFullProof['rlnIdentifier'] | string; name: string; rateLimit?: number; banRateLimit?: number; userMessageLimit?: number; membershipType?: MembershipType | string; identities?: IdentityCommitmentT[]; semaphoreIdentities?: IdentityCommitmentT[]; adminIdentities?: IdentityCommitmentT[]; contractAddress?: string; bandadaAddress?: string; bandadaGroupId?: string; epochs?: any[]; messages?: MessageI[]; claimCodes?: string[]; type?: RoomType | string; ephemeral?: EmepheralType; encrypted?: EncryptedType; } export interface ServerI { id?: bigint | string; name?: string; version?: string; url?: string; rooms?: string[]; }