import type { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';
import { getDefaultResolver } from '../../config.js';
import type { UserClient as KeetaNetUserClient } from '@keetanetwork/keetanet-client';
import type { KeetaAssetMovementAnchorGetTransferStatusResponse, KeetaAssetMovementAnchorCreatePersistentForwardingResponse, SupportedAssetsMetadata, ProviderSearchInput, KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse, KeetaAssetMovementAnchorCreatePersistentForwardingClientRequest, KeetaAssetMovementAnchorInitiateTransferClientRequest, KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateClientRequest, KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateResponse, KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateClientRequest, KeetaAssetMovementAnchorlistTransactionsClientRequest, KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest, PersistentAddressTemplateData, KeetaAssetMovementAnchorGetTransferStatusClientRequest, KeetaAssetMovementAnchorShareKYCClientRequest, KeetaAssetMovementAnchorListPersistentForwardingClientRequest, KeetaPersistentForwardingAddressDetails, KeetaAssetMovementAnchorInitiateTransferResponse, KeetaAssetMovementAnchorExecuteTransferClientRequest, AnchorTokenLocationMetadata, AnchorCustomLocationMetadata, AssetLocationLike, KeetaAssetMovementAnchorSimulateTransferResponse, KeetaAssetMovementAnchorSimulateTransferClientRequest } from './common.js';
import type { Logger } from '../../lib/log/index.ts';
import Resolver from "../../lib/resolver.js";
import type { ServiceMetadata, ServiceMetadataAuthenticationType, SharedLookupCriteria } from '../../lib/resolver.ts';
import type { BrandedString } from '../../lib/utils/brand.js';
import type { ExtractOk } from '../../lib/http-server/common.js';
import { type SharedAnchorMetadataLegalExtension, type AnchorMetadataLegalField } from '../../lib/metadata.types.js';
import type { ExternalChainAsset } from '../../lib/asset.js';
/**
 * The configuration options for the Asset Movement (Inbound/Outbound) Anchor client.
 */
export type KeetaAssetMovementClientConfig = {
    /**
     * The ID of the client. This is used to identify the client in logs.
     * If not provided, a random ID will be generated.
     */
    id?: string;
    /**
     * The logger to use for logging messages. If not provided, no logging
     * will be done.
     */
    logger?: Logger;
    /**
     * The resolver to use for resolving Asset Movement Anchor services. If not
     * provided, a default resolver will be created using the provided
     * client and network (if the network is also not provided and the
     * client is not a UserClient, an error occurs).
     */
    resolver?: Resolver;
    /**
     * The account to use for signing requests. If not provided, the
     * account associated with the provided client will be used. If there
     * is no account associated with the client, an error occurs.
     */
    signer?: InstanceType<typeof KeetaNetLib.Account>;
    /**
     * Account to perform changes on. If not provided, the account
     * associated with the provided client will be used. If there is no
     * account associated with the client, an error occurs.
     */
    account?: InstanceType<typeof KeetaNetLib.Account>;
} & Omit<NonNullable<Parameters<typeof getDefaultResolver>[1]>, 'client'>;
/**
 * An opaque type that represents a provider ID.
 */
type ProviderID = BrandedString<'AssetMovementProviderID'>;
/**
 * A list of operations that can be performed by the Asset Movement Anchor service.
 */
type KeetaAssetMovementAnchorOperations = {
    [operation in keyof NonNullable<ServiceMetadata['services']['assetMovement']>[string]['operations']]?: {
        url: (params?: {
            [key: string]: string;
        }) => URL;
        options: {
            authentication: ServiceMetadataAuthenticationType;
        };
    };
};
/**
 * The service information for a KYC Anchor service.
 */
interface KeetaAssetMovementServiceInfo extends SharedAnchorMetadataLegalExtension {
    operations: {
        [operation in keyof KeetaAssetMovementAnchorOperations]: Promise<KeetaAssetMovementAnchorOperations[operation]>;
    };
    supportedAssets: SupportedAssetsMetadata[];
    locationMetadata?: AnchorCustomLocationMetadata;
}
interface KeetaAssetMovementAnchorBaseConfig {
    client: KeetaNetUserClient;
    logger?: Logger | undefined;
}
declare class KeetaAssetMovementAnchorBase {
    protected readonly logger?: Logger | undefined;
    protected readonly client: KeetaNetUserClient;
    constructor(config: KeetaAssetMovementAnchorBaseConfig);
}
type SimulationOrTransferResponse = ExtractOk<KeetaAssetMovementAnchorInitiateTransferResponse> | ExtractOk<KeetaAssetMovementAnchorSimulateTransferResponse>;
interface BaseKeetaAssetMovementTransferConstructorArguments<Request extends KeetaAssetMovementAnchorInitiateTransferClientRequest | KeetaAssetMovementAnchorSimulateTransferClientRequest, Transfer extends SimulationOrTransferResponse> {
    provider: KeetaAssetMovementAnchorProvider;
    request: Request;
    transfer: Transfer;
}
declare abstract class BaseKeetaAssetMovementTransfer<Request extends KeetaAssetMovementAnchorInitiateTransferClientRequest | KeetaAssetMovementAnchorSimulateTransferClientRequest, Transfer extends SimulationOrTransferResponse> {
    readonly provider: KeetaAssetMovementAnchorProvider;
    readonly request: Request;
    readonly transfer: Transfer;
    readonly abstract isSimulation: Request extends KeetaAssetMovementAnchorInitiateTransferClientRequest ? false : true;
    constructor({ request, transfer, provider }: BaseKeetaAssetMovementTransferConstructorArguments<Request, Transfer>);
    get instructions(): Transfer['instructionChoices'];
}
/**
 * Represents an in-progress Asset Movement request.
 */
declare class KeetaAssetMovementTransfer extends BaseKeetaAssetMovementTransfer<KeetaAssetMovementAnchorInitiateTransferClientRequest, ExtractOk<KeetaAssetMovementAnchorInitiateTransferResponse>> {
    readonly isSimulation: false;
    get transferId(): string;
    getTransferStatus(): Promise<ExtractOk<KeetaAssetMovementAnchorGetTransferStatusResponse>>;
    executeTransfer(input: Omit<KeetaAssetMovementAnchorExecuteTransferClientRequest, 'id'>): Promise<ExtractOk<KeetaAssetMovementAnchorGetTransferStatusResponse>>;
}
declare class KeetaAssetMovementSimulatedTransfer extends BaseKeetaAssetMovementTransfer<KeetaAssetMovementAnchorSimulateTransferClientRequest, ExtractOk<KeetaAssetMovementAnchorSimulateTransferResponse>> {
    readonly isSimulation: true;
    createTransfer(overrides?: {
        to: Partial<Pick<KeetaAssetMovementAnchorInitiateTransferClientRequest['to'], 'depositMessage' | 'recipient'>>;
    }): Promise<KeetaAssetMovementTransfer>;
}
interface AwaitPromiseURLOptions {
    defaultPollIntervalMs?: number;
    timeoutMs?: number;
    abortSignal?: AbortSignal;
}
export declare class KeetaAssetMovementAnchorProvider extends KeetaAssetMovementAnchorBase {
    #private;
    readonly serviceInfo: KeetaAssetMovementServiceInfo;
    readonly providerID: ProviderID;
    private readonly parent;
    constructor(serviceInfo: KeetaAssetMovementServiceInfo, providerID: ProviderID, parent: KeetaAssetMovementAnchorClient);
    isOperationSupported(operationName: keyof KeetaAssetMovementAnchorOperations): Promise<boolean>;
    initiateTransfer(request: KeetaAssetMovementAnchorInitiateTransferClientRequest): Promise<KeetaAssetMovementTransfer>;
    simulateTransfer(request: KeetaAssetMovementAnchorSimulateTransferClientRequest): Promise<KeetaAssetMovementSimulatedTransfer>;
    executeTransfer(request: KeetaAssetMovementAnchorExecuteTransferClientRequest): Promise<ExtractOk<KeetaAssetMovementAnchorGetTransferStatusResponse>>;
    getTransferStatus(request: KeetaAssetMovementAnchorGetTransferStatusClientRequest): Promise<ExtractOk<KeetaAssetMovementAnchorGetTransferStatusResponse>>;
    initiatePersistentForwardingTemplate(request: KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateClientRequest): Promise<ExtractOk<KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateResponse>>;
    createPersistentForwardingTemplate(request: KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateClientRequest): Promise<ExtractOk<KeetaAssetMovementAnchorCreatePersistentForwardingResponse>>;
    createPersistentForwardingAddress(request: KeetaAssetMovementAnchorCreatePersistentForwardingClientRequest): Promise<ExtractOk<KeetaAssetMovementAnchorCreatePersistentForwardingResponse>>;
    listForwardingAddressTemplates(request: KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest): Promise<{
        templates: PersistentAddressTemplateData[];
        total: number;
    }>;
    listForwardingAddresses(request: KeetaAssetMovementAnchorListPersistentForwardingClientRequest): Promise<{
        addresses: KeetaPersistentForwardingAddressDetails[];
        total: number;
    }>;
    listTransactions(request: KeetaAssetMovementAnchorlistTransactionsClientRequest): Promise<ExtractOk<KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse>>;
    shareKYCAttributes(request: KeetaAssetMovementAnchorShareKYCClientRequest, awaitOptions?: AwaitPromiseURLOptions): Promise<void>;
    getAssetMetadataForLocation(location: AssetLocationLike, asset: ExternalChainAsset): AnchorTokenLocationMetadata | null;
    getLegalDisclaimers(): NonNullable<AnchorMetadataLegalField['disclaimers']> | null;
}
declare class KeetaAssetMovementAnchorClient extends KeetaAssetMovementAnchorBase {
    #private;
    readonly resolver: Resolver;
    readonly id: string;
    constructor(client: KeetaNetUserClient, config?: KeetaAssetMovementClientConfig);
    getProvidersForTransfer(request: ProviderSearchInput, shared?: SharedLookupCriteria): Promise<KeetaAssetMovementAnchorProvider[] | null>;
    getProviderByID(providerID: string): Promise<KeetaAssetMovementAnchorProvider | null>;
    getProviderLegalDisclaimersByID(providerID: string): Promise<Exclude<AnchorMetadataLegalField['disclaimers'], undefined> | null>;
    getProviderByAccount(account: NonNullable<SharedLookupCriteria['accounts']>[number]): Promise<KeetaAssetMovementAnchorProvider | null>;
}
export default KeetaAssetMovementAnchorClient;
//# sourceMappingURL=client.d.ts.map