import { BaseError, type Hex } from 'viem'; import type { ClientWithPns } from '../../contracts/consts.js'; import type { DateWithValue, Prettify, SimpleTransactionRequest } from '../../types.js'; import { type GeneratedFunction } from '../../utils/generateFunction.js'; type ContractOption = 'registrar' | 'nameWrapper'; type ExpiryStatus = 'active' | 'expired' | 'gracePeriod'; export type GetExpiryParameters = Prettify<{ /** Name to get expiry for */ name: string; /** Optional specific contract to use to get expiry */ contract?: ContractOption; }>; export type GetExpiryReturnType = Prettify<{ /** Expiry value */ expiry: DateWithValue; /** Grace period value (in seconds) */ gracePeriod: number; /** Status of name */ status: ExpiryStatus; } | null>; declare const encode: (client: ClientWithPns, { name, contract }: GetExpiryParameters) => SimpleTransactionRequest; declare const decode: (client: ClientWithPns, data: Hex | BaseError, { name, contract }: GetExpiryParameters) => Promise; type BatchableFunctionObject = GeneratedFunction; /** * Gets the expiry for a name * @param client - {@link ClientWithPns} * @param parameters - {@link GetExpiryParameters} * @returns Expiry object, or `null` if no expiry. {@link GetExpiryReturnType} * * @example * import { createPublicClient, http } from 'viem' * import { mainnet } from 'viem/chains' * import { addPnsContracts } from '@pnsdomains/pnsjs' * import { getExpiry } from '@pnsdomains/pnsjs/public' * * const client = createPublicClient({ * chain: addPnsContracts(mainnet), * transport: http(), * }) * const result = await getExpiry(client, { name: 'pns.pls' }) * // { expiry: { date: Date, value: 1913933217n }, gracePeriod: 7776000, status: 'active' } */ declare const getExpiry: ((client: ClientWithPns, { name, contract }: GetExpiryParameters) => Promise) & BatchableFunctionObject; export default getExpiry; //# sourceMappingURL=getExpiry.d.ts.map