UNPKG

@river-build/sdk

Version:

For more details, visit the following resources:

54 lines 3.38 kB
export declare const STREAM_ID_BYTES_LENGTH = 32; export declare const STREAM_ID_STRING_LENGTH: number; export declare const userIdFromAddress: (address: Uint8Array) => string; export declare const addressFromUserId: (userId: string) => Uint8Array; export declare const streamIdToBytes: (streamId: string) => Uint8Array; export declare const streamIdFromBytes: (bytes: Uint8Array) => string; export declare const streamIdAsString: (streamId: string | Uint8Array) => string; export declare const streamIdAsBytes: (streamId: string | Uint8Array) => Uint8Array; export declare const isUserId: (userId: string | Uint8Array) => boolean; export declare const contractAddressFromSpaceId: (spaceId: string) => string; export declare enum StreamPrefix { Channel = "20", DM = "88", GDM = "77", Media = "ff", Space = "10", User = "a8", UserMetadata = "ad", UserInbox = "a1", UserSettings = "a5" } export declare const allowedStreamPrefixes: () => string[]; export declare const makeStreamId: (prefix: StreamPrefix, identity: string) => string; export declare const makeUserStreamId: (userId: string | Uint8Array) => string; export declare const makeUserSettingsStreamId: (userId: string | Uint8Array) => string; export declare const makeUserMetadataStreamId: (userId: string | Uint8Array) => string; export declare const makeUserInboxStreamId: (userId: string | Uint8Array) => string; export declare const makeSpaceStreamId: (spaceContractAddress: string) => string; export declare const makeUniqueChannelStreamId: (spaceId: string) => string; export declare const makeDefaultChannelStreamId: (spaceContractAddressOrId: string) => string; export declare const spaceIdFromChannelId: (channelId: string) => string; export declare const isDefaultChannelId: (streamId: string) => boolean; export declare const makeUniqueGDMChannelStreamId: () => string; export declare const makeUniqueMediaStreamId: () => string; export declare const makeDMStreamId: (userIdA: string, userIdB: string) => string; export declare const isUserStreamId: (streamId: string | Uint8Array) => boolean; export declare const isSpaceStreamId: (streamId: string | Uint8Array) => boolean; export declare const isChannelStreamId: (streamId: string | Uint8Array) => boolean; export declare const isDMChannelStreamId: (streamId: string | Uint8Array) => boolean; export declare const isUserDeviceStreamId: (streamId: string | Uint8Array) => boolean; export declare const isUserSettingsStreamId: (streamId: string | Uint8Array) => boolean; export declare const isMediaStreamId: (streamId: string | Uint8Array) => boolean; export declare const isGDMChannelStreamId: (streamId: string | Uint8Array) => boolean; export declare const isUserInboxStreamId: (streamId: string | Uint8Array) => boolean; export declare const getUserAddressFromStreamId: (streamId: string) => Uint8Array; export declare const getUserIdFromStreamId: (streamId: string) => string; export declare const isValidStreamId: (streamId: string) => boolean; export declare const checkStreamId: (streamId: string) => void; export declare const genId: (size?: number | undefined) => string; export declare const genShortId: () => string; export declare const genLocalId: () => string; export declare const genIdBlob: () => Uint8Array; export declare const isLowercaseHex: (input: string) => boolean; //# sourceMappingURL=id.d.ts.map