export interface ApiResponse<T = unknown> {
    success: boolean;
    data?: T;
    error?: string;
    code?: string;
    details?: Record<string, unknown>;
}
export interface AuthHeaders {
    "Content-Type": "application/json";
    "X-Auth-Token": string;
    "X-Decrypted-Backup"?: string;
}
export interface PaginationParams {
    page?: number;
    limit?: number;
    offset?: number;
}
export interface TimestampRange {
    from?: number;
    to?: number;
}
export interface SignInRequest {
    address: string;
    idKey: string;
}
export interface SignInResponse {
    user: AuthUser;
    sessionToken?: string;
}
export interface AuthUser {
    id: string;
    address: string;
    idKey: string;
    profiles: ProfileInfo[];
    activeProfileId?: string;
}
export interface ProfileInfo {
    id: string;
    address: string;
    name?: string;
    image?: string;
    description?: string;
    isPublished: boolean;
}
export interface OAuthCallbackRequest {
    code: string;
    state: string;
    error?: string;
}
export interface OAuthCallbackResponse {
    encryptedBackup?: string;
    bapId: string;
    provider: string;
    userId: string;
}
export interface OAuthLinkRequest {
    provider: string;
    encryptedBackup: string;
}
export interface OAuthLinkResponse {
    linkedProviders: string[];
}
export interface BackupStoreRequest {
    encryptedBackup: string;
    provider?: string;
    metadata?: {
        createdAt: string;
        backupType: "master" | "member";
        version: string;
        [key: string]: string | number | boolean;
    };
}
export interface BackupStoreResponse {
    backupId: string;
    storedAt: string;
}
export interface BackupRetrieveResponse {
    encryptedBackup: string;
    metadata: {
        createdAt: string;
        backupType: "master" | "member";
        version: string;
        provider?: string;
    };
}
export interface DeviceLinkGenerateRequest {
    bapId: string;
}
export interface DeviceLinkGenerateResponse {
    token: string;
    expiresAt: string;
}
export interface DeviceLinkValidateRequest {
    token: string;
}
export interface DeviceLinkValidateResponse {
    encryptedBackup: string;
    bapId: string;
}
export interface SocialFeedParams extends PaginationParams, TimestampRange {
    fromTimestamp?: number;
}
export interface SocialFeedResponse {
    page: number | null;
    limit: number;
    count: number;
    results: BmapTx[];
    signers: IdentityData[];
    meta?: Meta[];
}
export interface BmapTx {
    tx: {
        h: string;
    };
    blk?: {
        i: number;
        t: number;
    };
    MAP?: Array<{
        app?: string;
        type?: string;
        [key: string]: string | number | boolean | undefined;
    }>;
    B?: Array<{
        content?: string;
        "content-type"?: string;
        encoding?: string;
    }>;
    AIP?: {
        algorithm?: string;
        address?: string;
        signature?: string;
    };
}
export interface IdentityData {
    "@context": "https://schema.org";
    "@type": "Person" | "Organization";
    alternateName: string;
    description?: string;
    image?: string;
    bapId: string;
    idKey: string;
    addresses: {
        signing: string[];
        encryption: string[];
    };
}
export interface Friend {
    bapId: string;
    name?: string;
    avatar?: string;
    timestamp: number;
}
export interface FriendRequest extends Friend {
    status: "pending" | "accepted" | "rejected";
}
export interface Meta {
    tx: string;
    replies: number;
    likes: number;
    reactions: ReactionMeta[];
}
export interface ReactionMeta {
    emoji: string;
    count: number;
    users: string[];
}
export interface MarketListing {
    txid: string;
    vout: number;
    priceSats: number;
    payAddress: string;
    ordAddress: string;
    assetType: "ordinals" | "bsv20" | "bsv21" | "lrc20";
    tokenId?: string;
    tokenAmount?: string;
    symbol?: string;
    decimals?: number;
    origin?: string;
    contentType?: string;
    collectionId?: string;
    createdAt?: number;
    height?: number;
    seller?: string;
}
export interface BroadcastRequest {
    txhex: string;
    description?: string;
}
export interface BroadcastResponse {
    success: true;
    txid: string;
    timestamp: number;
}
export interface UTXO {
    txid: string;
    vout: number;
    satoshis: number;
    script: string;
    confirmations: number;
}
export interface UTXOResponse {
    utxos: UTXO[];
    balance: number;
    unconfirmedBalance: number;
}
export interface BalanceResponse {
    confirmed: number;
    unconfirmed: number;
    total: number;
    usd?: number;
    txCount: number;
}
export interface TransactionHistoryParams extends PaginationParams {
    from?: number;
    to?: number;
}
export interface Transaction {
    txid: string;
    height: number;
    timestamp: number;
    amount: number;
    fee?: number;
    inputs: Array<{
        address: string;
        satoshis: number;
    }>;
    outputs: Array<{
        address: string;
        satoshis: number;
    }>;
    confirmations: number;
}
export interface TransactionHistoryResponse {
    transactions: Transaction[];
    total: number;
    page: number;
    limit: number;
}
export interface IdentityStoreRequest {
    bapId: string;
    encryptedData: string;
    attestations?: Array<{
        type: string;
        data: Record<string, unknown>;
        signature: string;
    }>;
    metadata?: {
        version: string;
        createdAt: number;
        lastRotation?: number;
    };
}
export interface IdentityResponse {
    bapId: string;
    publicKeys: {
        signing: string[];
        encryption: string[];
        previous?: string[];
    };
    attestations: Array<{
        type: string;
        issuer: string;
        data: Record<string, unknown>;
        signature: string;
        timestamp: number;
    }>;
    metadata: {
        version: string;
        createdAt: number;
        lastRotation?: number;
        rotationCount: number;
    };
}
export interface KeyRotationRequest {
    bapId: string;
    oldSigningKey: string;
    newSigningKey: string;
    newEncryptionKey?: string;
    rotationProof: {
        oldKeySignature: string;
        newKeySignature: string;
        timestamp: number;
        rotationIndex: number;
    };
    attestations?: Array<{
        type: string;
        data: Record<string, unknown>;
        signature: string;
    }>;
}
export interface DroplitClaimRequest {
    address: string;
    amount?: number;
    captcha?: string;
    referrer?: string;
    metadata?: {
        userAgent: string;
        ip?: string;
        timestamp: number;
    };
}
export interface DroplitClaimResponse {
    claim: {
        txid: string;
        amount: number;
        address: string;
        timestamp: number;
        estimatedConfirmTime: number;
    };
    faucet: {
        remainingBalance: number;
        dailyLimit: number;
        userDailyUsed: number;
        nextClaimAvailable: number;
    };
}
export interface DroplitStatusResponse {
    eligible: boolean;
    faucet: {
        enabled: boolean;
        balance: number;
        minAmount: number;
        maxAmount: number;
        defaultAmount: number;
        cooldownPeriod: number;
        dailyLimit: number;
        requiresCaptcha: boolean;
    };
    user: {
        lastClaim?: number;
        dailyUsed: number;
        totalClaimed: number;
        claimCount: number;
        nextClaimAvailable: number;
    };
}
export type ErrorCode = "AUTH_REQUIRED" | "INVALID_TOKEN" | "INVALID_SIGNATURE" | "BACKUP_NOT_FOUND" | "PROFILE_NOT_FOUND" | "INVALID_REQUEST" | "RATE_LIMITED" | "SERVER_ERROR" | "OAUTH_ERROR" | "ENCRYPTION_ERROR" | "INSUFFICIENT_FUNDS" | "INVALID_ADDRESS" | "TRANSACTION_FAILED" | "NETWORK_ERROR" | "BROADCAST_FAILED";
export interface ApiError {
    success: false;
    error: string;
    code: ErrorCode;
    details?: Record<string, unknown>;
}
export interface WSMessage<T = unknown> {
    type: string;
    data: T;
}
export interface WSTransactionEvent {
    type: "transaction";
    data: {
        txid: string;
        amount: number;
        confirmations: number;
    };
}
export interface WSBalanceEvent {
    type: "balance";
    data: {
        confirmed: number;
        unconfirmed: number;
    };
}
export interface WSMessageEvent {
    type: "message";
    data: {
        txid: string;
        from: string;
        to: string;
        content: string;
        timestamp: number;
        read: boolean;
    };
}
export type Timestamp = number;
export type ISOString = string;
export type BitcoinAddress = string;
export type TransactionId = string;
export type BAPId = string;
export type Satoshis = number;
//# sourceMappingURL=backend.d.ts.map