import type { AssetTransferInstructions, RecipientResolved, KeetaNetAccount, Rail } from '../../asset-movement/common.js';
import type { AssetLocationLike, PickChainLocation } from '../../asset-movement/lib/location.js';
import type { StorageSubClientConfig } from '../client.js';
import type { StorageObjectMetadata } from '../common.js';
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
/**
 * The structural shape of a transfer instruction, excluding transaction-specific fields.
 */
export type TransferInstructionShape = DistributiveOmit<AssetTransferInstructions, 'value' | 'assetFee' | 'totalReceiveAmount' | 'persistentAddressId'>;
/**
 * The type of provider information allowed for a contact address.
 */
export type ProviderInformationType = 'username' | 'template';
/**
 * The type of recipient for a persistent address template.
 */
export type PersistentAddressTemplateRecipient = Extract<RecipientResolved, {
    type: 'persistent-address';
}>;
/**
 * Base interface for contact addresses with narrowed generic parameters.
 */
export interface ContactAddressBase<RecipientType extends RecipientResolved, Location extends AssetLocationLike, ProviderInformationAllowedTypes extends ProviderInformationType> {
    recipient: RecipientType;
    location?: Location;
    providerInformation?: {
        [providerId: string]: ProviderInformationAllowedTypes[];
    };
    pastInstructions?: TransferInstructionShape[];
}
export type KeetaAssetLocation = PickChainLocation<'keeta'> | `chain:keeta:${bigint}`;
/**
 * A contact address for a Keeta account.
 */
export type KeetaContactAddress = ContactAddressBase<string, KeetaAssetLocation, 'username'>;
/**
 * A contact address for a persistent address template.
 */
export type TemplateContactAddress = ContactAddressBase<PersistentAddressTemplateRecipient, AssetLocationLike, 'template'>;
/**
 * A contact address for a non-Keeta, non-persistent-address recipient.
 */
export type OtherContactAddress = ContactAddressBase<Exclude<RecipientResolved, KeetaNetAccount | PersistentAddressTemplateRecipient>, Exclude<AssetLocationLike, KeetaAssetLocation>, 'template'>;
export type ContactAddress = KeetaContactAddress | TemplateContactAddress | OtherContactAddress;
/**
 * A stored contact with metadata and an address.
 */
export interface Contact {
    id: string;
    label: string;
    address: ContactAddress;
    rail?: Rail | undefined;
}
interface SharedStorageObjectMetadata extends Pick<StorageObjectMetadata, 'createdAt' | 'updatedAt'> {
}
export interface ContactWithMetadata extends Contact, SharedStorageObjectMetadata {
}
interface ContactOptions extends Omit<Contact, 'id'>, Partial<Pick<Contact, 'id'>> {
}
/**
 * Generic contacts client interface
 */
export interface ContactsClient {
    deriveId(address: ContactAddress): string;
    create(options: ContactOptions): Promise<Contact>;
    get(id: string): Promise<Contact | null>;
    update(id: string, options: {
        label?: string;
        address?: ContactAddress;
    }): Promise<Contact>;
    delete(id: string): Promise<boolean>;
    list(options?: {
        location?: AssetLocationLike;
    }): Promise<Contact[]>;
}
/**
 * Storage Anchor-backed implementation of `ContactsClient`.
 * Stores contacts as encrypted JSON objects via a `KeetaStorageAnchorSession`.
 */
export declare class StorageContactsClient implements ContactsClient {
    #private;
    constructor(config: StorageSubClientConfig);
    deriveId(address: ContactAddress): string;
    create(options: ContactOptions): Promise<Contact>;
    get(id: string, includeMetadata: true): Promise<ContactWithMetadata | null>;
    get(id: string, includeMetadata?: false): Promise<Contact | null>;
    update(id: string, options: {
        label?: string;
        address?: ContactAddress;
    }): Promise<Contact>;
    delete(id: string): Promise<boolean>;
    list(options?: {
        location?: AssetLocationLike;
    }): Promise<ContactWithMetadata[]>;
}
export {};
//# sourceMappingURL=contacts.d.ts.map