UNPKG

@towns-protocol/sdk

Version:

For more details, visit the following resources:

37 lines 2.02 kB
import { Permission } from '@towns-protocol/web3'; export declare function unsafeProp<K extends keyof any | undefined>(prop: K): boolean; export declare function safeSet<O extends Record<any, any>, K extends keyof O>(obj: O, prop: K, value: O[K]): void; export declare const isEthereumAddress: (address: string | Uint8Array) => boolean; export declare const ethereumAddressToBytes: (address: string) => Uint8Array; export declare const ethereumAddressFromBytes: (bytes: Uint8Array) => string; export declare const ethereumAddressAsString: (address: string | Uint8Array) => string; export declare const ethereumAddressAsBytes: (address: string | Uint8Array) => Uint8Array; export declare function stripUndefinedMetadata(obj: Record<string, Uint8Array | undefined>): { [key: string]: Uint8Array; } | undefined; export declare function promiseTry<T>(fn: () => T | Promise<T>): Promise<T>; export declare function hashString(string: string): string; export declare function usernameChecksum(username: string, streamId: string): string; /** * IConnectError contains a subset of the properties in ConnectError */ export type IConnectError = { code: number; }; export declare function isIConnectError(obj: unknown): obj is { code: number; }; export declare class MockEntitlementsDelegate { isEntitled(_spaceId: string | undefined, _channelId: string | undefined, _user: string, _permission: Permission): Promise<boolean>; } export declare function removeCommon(x: string[], y: string[]): string[]; export declare function getEnvVar(key: string, defaultValue?: string): string; export declare function isMobileSafari(): boolean; export declare function isBaseUrlIncluded(baseUrls: string[], fullUrl: string): boolean; export declare const randomUrlSelector: (urls: string) => string; export declare function getTime<T>(fn: () => Promise<T>): Promise<{ result: Awaited<T>; time: number; }>; export declare const randomBytes: (len: number) => Uint8Array<ArrayBuffer>; //# sourceMappingURL=utils.d.ts.map