{"version":3,"file":"getRecordV2Address.cjs","sources":["../../../src/record/getRecordV2Address.ts"],"sourcesContent":["import { Address } from \"@solana/kit\";\r\n\r\nimport { CENTRAL_STATE_DOMAIN_RECORDS } from \"../constants/addresses\";\r\nimport { getDomainAddress } from \"../domain/getDomainAddress\";\r\nimport { Record } from \"../types/record\";\r\nimport { deriveAddress } from \"../utils/deriveAddress\";\r\n\r\ninterface GetRecordV2AddressParams {\r\n  domain: string;\r\n  record: Record;\r\n}\r\n\r\n/**\r\n * Derives the address of a version 2 record.\r\n *\r\n * @param params - An object containing the following properties:\r\n *   - `domain`: The domain under which the record resides.\r\n *   - `record`: The type of record to derive the address for.\r\n * @returns A promise that resolves to the derived record address.\r\n */\r\nexport const getRecordV2Address = async ({\r\n  domain,\r\n  record,\r\n}: GetRecordV2AddressParams): Promise<Address> => {\r\n  const { domainAddress } = await getDomainAddress({ domain });\r\n\r\n  return await deriveAddress(\r\n    `\\x02${record}`,\r\n    domainAddress,\r\n    CENTRAL_STATE_DOMAIN_RECORDS\r\n  );\r\n};\r\n"],"names":["async","domain","record","domainAddress","getDomainAddress","deriveAddress","CENTRAL_STATE_DOMAIN_RECORDS"],"mappings":"wKAoBkCA,OAChCC,SACAC,aAEA,MAAMC,cAAEA,SAAwBC,EAAAA,iBAAiB,CAAEH,WAEnD,aAAaI,EAAaA,cACxB,IAAOH,IACPC,EACAG,+BACD"}