import * as Data from 'effect/Data'; import * as Schema from 'effect/Schema'; export type Storage = { getItem: (key: string) => string | null; setItem: (key: string, value: string) => void; removeItem: (key: string) => void; }; export type SignMessage = (message: string) => Promise | string; export type GetAddress = () => Promise | string; export type Signer = { getAddress: GetAddress; signMessage: SignMessage; }; export type IdentityKeys = { encryptionPublicKey: string; encryptionPrivateKey: string; signaturePublicKey: string; signaturePrivateKey: string; }; export const KeysSchema = Schema.Struct({ encryptionPublicKey: Schema.String, encryptionPrivateKey: Schema.String, signaturePublicKey: Schema.String, signaturePrivateKey: Schema.String, }); export type KeysSchema = Schema.Schema.Type; export type Identity = IdentityKeys & { accountAddress: string; }; export type PublicIdentity = { accountAddress: string; encryptionPublicKey: string; signaturePublicKey: string; }; export class InvalidIdentityError extends Data.TaggedError('InvalidIdentityError') {}