{"version":3,"sources":["../../src/types/ans.ts"],"sourcesContent":["import { type GetANSNameResponse } from \"./indexer\";\n\nexport type RawANSName = GetANSNameResponse[0];\n\n/**\n * The token standard for the ANS name. v1 is the original token standard, v2 is\n * the new token standard. v1 has been deprecated.\n */\nexport type AnsTokenStandard = \"v1\" | \"v2\";\n\n/**\n * Policy for determining how subdomains expire in relation to their parent domain.\n */\nexport enum SubdomainExpirationPolicy {\n  /**\n   * The subdomain will expire independently of the domain. The owner of the\n   * domain can manually set when the subdomain expires.\n   */\n  Independent = 0,\n  /**\n   * The subdomain will expire at the same time as the domain.\n   */\n  FollowsDomain = 1,\n}\n\n/**\n * The status of the name.\n */\nexport enum ExpirationStatus {\n  /**\n   * The name no longer functions as a primary or target name. It is open to\n   * being claimed by the public.\n   */\n  Expired = \"expired\",\n  /**\n   * The name is past it's expiration date, but only claimable by the current\n   * owner of the name. It does not function as a primary or target name.\n   */\n  InGracePeriod = \"in_grace_period\",\n  /**\n   * The name is in good standing.\n   */\n  Active = \"active\",\n}\n\nexport interface AnsName extends RawANSName {\n  /**\n   * The domain name. ie \"aptos.apt\" would have a domain of \"aptos\"\n   */\n  domain: string;\n  /**\n   * The subdomain name, if the name is a subdomain. ie \"name.aptos.apt\" would have a subdomain of \"name\"\n   */\n  subdomain?: string;\n  /**\n   * The expiration timestamp of the name in milliseconds since epoch. Note, if\n   * the name is not a subdomain, this will be the same as the domain expiration\n   * timestamp.\n   */\n  expiration_timestamp: string;\n  /**\n   * The expiration timestamp of the domain in milliseconds since epoch.\n   */\n  domain_expiration_timestamp: string;\n  /**\n   * This is a derived date value. It takes into consideration if the name is a\n   * subdomain and its expiration policy.\n   */\n  expiration: Date;\n\n  /**\n   * The status of the name's expiration.\n   *\n   * 1. Expired: The name has expired and is no longer resolvable.\n   * 2. InGracePeriod: The name is within the grace period and is still\n   *    resolvable if it is renewed.\n   * 3. Active: The name is active and is resolvable.\n   *\n   * @see {@link ExpirationStatus}\n   */\n  expiration_status: ExpirationStatus;\n  /**\n   * The address that the name points to. For example, if you send a transaction\n   * to \"aptos.apt\" with a target address of \"0x1\", the registered_address will\n   * be \"0x1\".\n   */\n  registered_address?: string;\n  /**\n   * The token standard for the name. See {@link AnsTokenStandard} for more details.\n   */\n  token_standard: AnsTokenStandard;\n  /**\n   * If the name is registered as a primary name for _any_ account. It is\n   * possible to have multiple primary names returned in a single query.\n   */\n  is_primary: boolean;\n  /**\n   * The address of the wallet that owns the name.\n   */\n  owner_address?: string;\n  /**\n   * The expiration policy for the subdomain. See {@link SubdomainExpirationPolicy} for more details.\n   */\n  subdomain_expiration_policy: SubdomainExpirationPolicy;\n  /**\n   * Whether the name is in the renewable period. This incorporates leading time\n   * before the name expires and the grace period after the name expires.\n   */\n  isInRenewablePeriod: boolean;\n}\n"],"mappings":"AAaO,IAAKA,OAKVA,IAAA,YAAc,GAAd,cAIAA,IAAA,cAAgB,GAAhB,gBATUA,OAAA,IAeAC,OAKVA,EAAA,QAAU,UAKVA,EAAA,cAAgB,kBAIhBA,EAAA,OAAS,SAdCA,OAAA","names":["SubdomainExpirationPolicy","ExpirationStatus"]}