@ensdomains/ensjs 3.0.0-beta.1 → 3.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/OldestResolver.json +170 -0
- package/contracts/UniversalResolverv2.json +628 -0
- package/dist/cjs/clients/decorators/subgraph.js.map +1 -1
- package/dist/cjs/clients/decorators/wallet.js +2 -0
- package/dist/cjs/clients/decorators/wallet.js.map +1 -1
- package/dist/cjs/clients/public.js.map +1 -1
- package/dist/cjs/clients/subgraph.js.map +1 -1
- package/dist/cjs/contracts/consts.js +53 -2
- package/dist/cjs/contracts/consts.js.map +1 -1
- package/dist/cjs/contracts/universalResolver.js +46 -1
- package/dist/cjs/contracts/universalResolver.js.map +1 -1
- package/dist/cjs/dns.js +3 -3
- package/dist/cjs/dns.js.map +1 -1
- package/dist/cjs/errors/subgraph.js.map +1 -1
- package/dist/cjs/errors/utils.js +27 -18
- package/dist/cjs/errors/utils.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/errors/version.js.map +1 -1
- package/dist/cjs/functions/dns/{prepareDnsImport.js → getDnsImportData.js} +3 -3
- package/dist/cjs/functions/dns/{prepareDnsImport.js.map → getDnsImportData.js.map} +1 -1
- package/dist/cjs/functions/dns/importDnsName.js +7 -7
- package/dist/cjs/functions/dns/importDnsName.js.map +1 -1
- package/dist/cjs/functions/public/_getAbi.js +2 -2
- package/dist/cjs/functions/public/_getAbi.js.map +1 -1
- package/dist/cjs/functions/public/_getAddr.js +9 -19
- package/dist/cjs/functions/public/_getAddr.js.map +1 -1
- package/dist/cjs/functions/public/_getContentHash.js +1 -1
- package/dist/cjs/functions/public/batch.js.map +1 -1
- package/dist/cjs/functions/public/getAbiRecord.js.map +1 -1
- package/dist/cjs/functions/public/getAddressRecord.js.map +1 -1
- package/dist/cjs/functions/public/getAvailable.js.map +1 -1
- package/dist/cjs/functions/public/getContentHashRecord.js.map +1 -1
- package/dist/cjs/functions/public/getExpiry.js.map +1 -1
- package/dist/cjs/functions/public/getName.js.map +1 -1
- package/dist/cjs/functions/public/getOwner.js.map +1 -1
- package/dist/cjs/functions/public/getPrice.js.map +1 -1
- package/dist/cjs/functions/public/getRecords.js +56 -42
- package/dist/cjs/functions/public/getRecords.js.map +1 -1
- package/dist/cjs/functions/public/getResolver.js.map +1 -1
- package/dist/cjs/functions/public/getSupportedInterfaces.js +1 -1
- package/dist/cjs/functions/public/getSupportedInterfaces.js.map +1 -1
- package/dist/cjs/functions/public/getTextRecord.js.map +1 -1
- package/dist/cjs/functions/public/getWrapperData.js.map +1 -1
- package/dist/cjs/functions/public/getWrapperName.js.map +1 -1
- package/dist/cjs/functions/public/multicallWrapper.js.map +1 -1
- package/dist/cjs/functions/public/universalWrapper.js.map +1 -1
- package/dist/cjs/functions/subgraph/client.js.map +1 -1
- package/dist/cjs/functions/subgraph/filters.js +3 -0
- package/dist/cjs/functions/subgraph/filters.js.map +1 -0
- package/dist/cjs/functions/subgraph/getDecodedName.js.map +1 -1
- package/dist/cjs/functions/subgraph/getNameHistory.js +4 -3
- package/dist/cjs/functions/subgraph/getNameHistory.js.map +1 -1
- package/dist/cjs/functions/subgraph/getNamesForAddress.js +155 -190
- package/dist/cjs/functions/subgraph/getNamesForAddress.js.map +1 -1
- package/dist/cjs/functions/subgraph/getSubgraphRecords.js +34 -26
- package/dist/cjs/functions/subgraph/getSubgraphRecords.js.map +1 -1
- package/dist/cjs/functions/subgraph/getSubgraphRegistrant.js.map +1 -1
- package/dist/cjs/functions/subgraph/getSubnames.js +95 -108
- package/dist/cjs/functions/subgraph/getSubnames.js.map +1 -1
- package/dist/cjs/functions/subgraph/types.js +3 -0
- package/dist/cjs/functions/subgraph/types.js.map +1 -0
- package/dist/cjs/functions/subgraph/utils.js.map +1 -1
- package/dist/cjs/functions/wallet/clearRecords.js +26 -0
- package/dist/cjs/functions/wallet/clearRecords.js.map +1 -0
- package/dist/cjs/functions/wallet/commitName.js.map +1 -1
- package/dist/cjs/functions/wallet/createSubname.js +1 -1
- package/dist/cjs/functions/wallet/createSubname.js.map +1 -1
- package/dist/cjs/functions/wallet/deleteSubname.js.map +1 -1
- package/dist/cjs/functions/wallet/registerName.js.map +1 -1
- package/dist/cjs/functions/wallet/renewNames.js.map +1 -1
- package/dist/cjs/functions/wallet/setAbiRecord.js.map +1 -1
- package/dist/cjs/functions/wallet/setAddressRecord.js.map +1 -1
- package/dist/cjs/functions/wallet/setChildFuses.js +1 -1
- package/dist/cjs/functions/wallet/setChildFuses.js.map +1 -1
- package/dist/cjs/functions/wallet/setContentHashRecord.js.map +1 -1
- package/dist/cjs/functions/wallet/setFuses.js +1 -1
- package/dist/cjs/functions/wallet/setFuses.js.map +1 -1
- package/dist/cjs/functions/wallet/setPrimaryName.js.map +1 -1
- package/dist/cjs/functions/wallet/setRecords.js.map +1 -1
- package/dist/cjs/functions/wallet/setResolver.js.map +1 -1
- package/dist/cjs/functions/wallet/setTextRecord.js.map +1 -1
- package/dist/cjs/functions/wallet/transferName.js.map +1 -1
- package/dist/cjs/functions/wallet/unwrapName.js.map +1 -1
- package/dist/cjs/functions/wallet/wrapName.js +3 -1
- package/dist/cjs/functions/wallet/wrapName.js.map +1 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/subgraph.js +4 -1
- package/dist/cjs/subgraph.js.map +1 -1
- package/dist/cjs/utils/contentHash.js +60 -131
- package/dist/cjs/utils/contentHash.js.map +1 -1
- package/dist/cjs/utils/encoders/encodeAbi.js +33 -3
- package/dist/cjs/utils/encoders/encodeAbi.js.map +1 -1
- package/dist/cjs/utils/encoders/encodeClearRecords.js +12 -0
- package/dist/cjs/utils/encoders/encodeClearRecords.js.map +1 -0
- package/dist/cjs/utils/encoders/encodeSetAddr.js +5 -16
- package/dist/cjs/utils/encoders/encodeSetAddr.js.map +1 -1
- package/dist/cjs/utils/encoders/encodeSetContentHash.js +1 -4
- package/dist/cjs/utils/encoders/encodeSetContentHash.js.map +1 -1
- package/dist/cjs/utils/format.js +1 -5
- package/dist/cjs/utils/format.js.map +1 -1
- package/dist/cjs/utils/fuses.js +184 -200
- package/dist/cjs/utils/fuses.js.map +1 -1
- package/dist/cjs/utils/generateRecordCallArray.js +6 -10
- package/dist/cjs/utils/generateRecordCallArray.js.map +1 -1
- package/dist/cjs/utils/getRevertErrorData.js +4 -1
- package/dist/cjs/utils/getRevertErrorData.js.map +1 -1
- package/dist/cjs/utils/index.js +31 -7
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/normaliseCoinId.js +35 -0
- package/dist/cjs/utils/normaliseCoinId.js.map +1 -0
- package/dist/cjs/utils/registerHelpers.js +3 -1
- package/dist/cjs/utils/registerHelpers.js.map +1 -1
- package/dist/cjs/wallet.js +3 -1
- package/dist/cjs/wallet.js.map +1 -1
- package/dist/esm/clients/decorators/subgraph.js.map +1 -1
- package/dist/esm/clients/decorators/wallet.js +2 -0
- package/dist/esm/clients/decorators/wallet.js.map +1 -1
- package/dist/esm/clients/public.js.map +1 -1
- package/dist/esm/clients/subgraph.js.map +1 -1
- package/dist/esm/contracts/consts.js +53 -2
- package/dist/esm/contracts/consts.js.map +1 -1
- package/dist/esm/contracts/universalResolver.js +46 -1
- package/dist/esm/contracts/universalResolver.js.map +1 -1
- package/dist/esm/dns.js +1 -1
- package/dist/esm/dns.js.map +1 -1
- package/dist/esm/errors/subgraph.js.map +1 -1
- package/dist/esm/errors/utils.js +24 -16
- package/dist/esm/errors/utils.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/errors/version.js.map +1 -1
- package/dist/esm/functions/dns/{prepareDnsImport.js → getDnsImportData.js} +10 -10
- package/dist/esm/functions/dns/{prepareDnsImport.js.map → getDnsImportData.js.map} +1 -1
- package/dist/esm/functions/dns/getDnsOwner.js +1 -1
- package/dist/esm/functions/dns/importDnsName.js +13 -12
- package/dist/esm/functions/dns/importDnsName.js.map +1 -1
- package/dist/esm/functions/public/_getAbi.js +2 -2
- package/dist/esm/functions/public/_getAbi.js.map +1 -1
- package/dist/esm/functions/public/_getAddr.js +10 -20
- package/dist/esm/functions/public/_getAddr.js.map +1 -1
- package/dist/esm/functions/public/_getContentHash.js +2 -2
- package/dist/esm/functions/public/batch.js +2 -1
- package/dist/esm/functions/public/batch.js.map +1 -1
- package/dist/esm/functions/public/getAbiRecord.js +2 -1
- package/dist/esm/functions/public/getAbiRecord.js.map +1 -1
- package/dist/esm/functions/public/getAddressRecord.js +2 -1
- package/dist/esm/functions/public/getAddressRecord.js.map +1 -1
- package/dist/esm/functions/public/getAvailable.js +2 -1
- package/dist/esm/functions/public/getAvailable.js.map +1 -1
- package/dist/esm/functions/public/getContentHashRecord.js +2 -1
- package/dist/esm/functions/public/getContentHashRecord.js.map +1 -1
- package/dist/esm/functions/public/getExpiry.js +2 -1
- package/dist/esm/functions/public/getExpiry.js.map +1 -1
- package/dist/esm/functions/public/getName.js +2 -1
- package/dist/esm/functions/public/getName.js.map +1 -1
- package/dist/esm/functions/public/getOwner.js +3 -2
- package/dist/esm/functions/public/getOwner.js.map +1 -1
- package/dist/esm/functions/public/getPrice.js +3 -2
- package/dist/esm/functions/public/getPrice.js.map +1 -1
- package/dist/esm/functions/public/getRecords.js +59 -48
- package/dist/esm/functions/public/getRecords.js.map +1 -1
- package/dist/esm/functions/public/getResolver.js +2 -1
- package/dist/esm/functions/public/getResolver.js.map +1 -1
- package/dist/esm/functions/public/getSupportedInterfaces.js +24 -2
- package/dist/esm/functions/public/getSupportedInterfaces.js.map +1 -1
- package/dist/esm/functions/public/getTextRecord.js +2 -1
- package/dist/esm/functions/public/getTextRecord.js.map +1 -1
- package/dist/esm/functions/public/getWrapperData.js +2 -1
- package/dist/esm/functions/public/getWrapperData.js.map +1 -1
- package/dist/esm/functions/public/getWrapperName.js +2 -1
- package/dist/esm/functions/public/getWrapperName.js.map +1 -1
- package/dist/esm/functions/public/multicallWrapper.js.map +1 -1
- package/dist/esm/functions/public/universalWrapper.js.map +1 -1
- package/dist/esm/functions/subgraph/client.js.map +1 -1
- package/dist/esm/functions/subgraph/filters.js +2 -0
- package/dist/esm/functions/subgraph/filters.js.map +1 -0
- package/dist/esm/functions/subgraph/getDecodedName.js +2 -1
- package/dist/esm/functions/subgraph/getDecodedName.js.map +1 -1
- package/dist/esm/functions/subgraph/getNameHistory.js +8 -6
- package/dist/esm/functions/subgraph/getNameHistory.js.map +1 -1
- package/dist/esm/functions/subgraph/getNamesForAddress.js +163 -192
- package/dist/esm/functions/subgraph/getNamesForAddress.js.map +1 -1
- package/dist/esm/functions/subgraph/getSubgraphRecords.js +36 -27
- package/dist/esm/functions/subgraph/getSubgraphRecords.js.map +1 -1
- package/dist/esm/functions/subgraph/getSubgraphRegistrant.js +2 -1
- package/dist/esm/functions/subgraph/getSubgraphRegistrant.js.map +1 -1
- package/dist/esm/functions/subgraph/getSubnames.js +103 -112
- package/dist/esm/functions/subgraph/getSubnames.js.map +1 -1
- package/dist/esm/functions/subgraph/types.js +2 -0
- package/dist/esm/functions/subgraph/types.js.map +1 -0
- package/dist/esm/functions/subgraph/utils.js.map +1 -1
- package/dist/esm/functions/wallet/clearRecords.js +44 -0
- package/dist/esm/functions/wallet/clearRecords.js.map +1 -0
- package/dist/esm/functions/wallet/commitName.js +3 -1
- package/dist/esm/functions/wallet/commitName.js.map +1 -1
- package/dist/esm/functions/wallet/createSubname.js +3 -2
- package/dist/esm/functions/wallet/createSubname.js.map +1 -1
- package/dist/esm/functions/wallet/deleteSubname.js +2 -1
- package/dist/esm/functions/wallet/deleteSubname.js.map +1 -1
- package/dist/esm/functions/wallet/registerName.js +4 -1
- package/dist/esm/functions/wallet/registerName.js.map +1 -1
- package/dist/esm/functions/wallet/renewNames.js +3 -1
- package/dist/esm/functions/wallet/renewNames.js.map +1 -1
- package/dist/esm/functions/wallet/setAbiRecord.js +3 -1
- package/dist/esm/functions/wallet/setAbiRecord.js.map +1 -1
- package/dist/esm/functions/wallet/setAddressRecord.js +2 -1
- package/dist/esm/functions/wallet/setAddressRecord.js.map +1 -1
- package/dist/esm/functions/wallet/setChildFuses.js +3 -2
- package/dist/esm/functions/wallet/setChildFuses.js.map +1 -1
- package/dist/esm/functions/wallet/setContentHashRecord.js +2 -1
- package/dist/esm/functions/wallet/setContentHashRecord.js.map +1 -1
- package/dist/esm/functions/wallet/setFuses.js +4 -3
- package/dist/esm/functions/wallet/setFuses.js.map +1 -1
- package/dist/esm/functions/wallet/setPrimaryName.js +2 -1
- package/dist/esm/functions/wallet/setPrimaryName.js.map +1 -1
- package/dist/esm/functions/wallet/setRecords.js +2 -1
- package/dist/esm/functions/wallet/setRecords.js.map +1 -1
- package/dist/esm/functions/wallet/setResolver.js +2 -1
- package/dist/esm/functions/wallet/setResolver.js.map +1 -1
- package/dist/esm/functions/wallet/setTextRecord.js +2 -1
- package/dist/esm/functions/wallet/setTextRecord.js.map +1 -1
- package/dist/esm/functions/wallet/transferName.js +2 -1
- package/dist/esm/functions/wallet/transferName.js.map +1 -1
- package/dist/esm/functions/wallet/unwrapName.js +2 -1
- package/dist/esm/functions/wallet/unwrapName.js.map +1 -1
- package/dist/esm/functions/wallet/wrapName.js +6 -3
- package/dist/esm/functions/wallet/wrapName.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/subgraph.js +1 -0
- package/dist/esm/subgraph.js.map +1 -1
- package/dist/esm/utils/contentHash.js +56 -128
- package/dist/esm/utils/contentHash.js.map +1 -1
- package/dist/esm/utils/encoders/encodeAbi.js +30 -2
- package/dist/esm/utils/encoders/encodeAbi.js.map +1 -1
- package/dist/esm/utils/encoders/encodeClearRecords.js +8 -0
- package/dist/esm/utils/encoders/encodeClearRecords.js.map +1 -0
- package/dist/esm/utils/encoders/encodeSetAddr.js +5 -16
- package/dist/esm/utils/encoders/encodeSetAddr.js.map +1 -1
- package/dist/esm/utils/encoders/encodeSetContentHash.js +2 -5
- package/dist/esm/utils/encoders/encodeSetContentHash.js.map +1 -1
- package/dist/esm/utils/format.js +0 -2
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/fuses.js +183 -201
- package/dist/esm/utils/fuses.js.map +1 -1
- package/dist/esm/utils/generateRecordCallArray.js +7 -10
- package/dist/esm/utils/generateRecordCallArray.js.map +1 -1
- package/dist/esm/utils/getRevertErrorData.js +4 -1
- package/dist/esm/utils/getRevertErrorData.js.map +1 -1
- package/dist/esm/utils/index.js +5 -3
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/normaliseCoinId.js +30 -0
- package/dist/esm/utils/normaliseCoinId.js.map +1 -0
- package/dist/esm/utils/registerHelpers.js +4 -2
- package/dist/esm/utils/registerHelpers.js.map +1 -1
- package/dist/esm/wallet.js +1 -0
- package/dist/esm/wallet.js.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +1 -519
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/clients/decorators/subgraph.d.ts +2 -520
- package/dist/types/clients/decorators/subgraph.d.ts.map +1 -1
- package/dist/types/clients/decorators/wallet.d.ts +66 -47
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/types/clients/public.d.ts +24 -265
- package/dist/types/clients/public.d.ts.map +1 -1
- package/dist/types/clients/subgraph.d.ts +19 -260
- package/dist/types/clients/subgraph.d.ts.map +1 -1
- package/dist/types/clients/wallet.d.ts +60 -92
- package/dist/types/clients/wallet.d.ts.map +1 -1
- package/dist/types/contracts/consts.d.ts +52 -3
- package/dist/types/contracts/consts.d.ts.map +1 -1
- package/dist/types/contracts/universalResolver.d.ts +133 -1
- package/dist/types/contracts/universalResolver.d.ts.map +1 -1
- package/dist/types/dns.d.ts +2 -2
- package/dist/types/dns.d.ts.map +1 -1
- package/dist/types/errors/subgraph.d.ts +4 -4
- package/dist/types/errors/subgraph.d.ts.map +1 -1
- package/dist/types/errors/utils.d.ts +16 -13
- package/dist/types/errors/utils.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/errors/version.d.ts.map +1 -1
- package/dist/types/functions/dns/getDnsImportData.d.ts +39 -0
- package/dist/types/functions/dns/{prepareDnsImport.d.ts.map → getDnsImportData.d.ts.map} +1 -1
- package/dist/types/functions/dns/getDnsOwner.d.ts +1 -1
- package/dist/types/functions/dns/importDnsName.d.ts +88 -102
- package/dist/types/functions/dns/importDnsName.d.ts.map +1 -1
- package/dist/types/functions/public/_getAddr.d.ts.map +1 -1
- package/dist/types/functions/public/batch.d.ts +2 -1
- package/dist/types/functions/public/batch.d.ts.map +1 -1
- package/dist/types/functions/public/getAbiRecord.d.ts +2 -1
- package/dist/types/functions/public/getAbiRecord.d.ts.map +1 -1
- package/dist/types/functions/public/getAddressRecord.d.ts +2 -1
- package/dist/types/functions/public/getAddressRecord.d.ts.map +1 -1
- package/dist/types/functions/public/getAvailable.d.ts +2 -1
- package/dist/types/functions/public/getAvailable.d.ts.map +1 -1
- package/dist/types/functions/public/getContentHashRecord.d.ts +2 -1
- package/dist/types/functions/public/getContentHashRecord.d.ts.map +1 -1
- package/dist/types/functions/public/getExpiry.d.ts +2 -1
- package/dist/types/functions/public/getExpiry.d.ts.map +1 -1
- package/dist/types/functions/public/getName.d.ts +2 -1
- package/dist/types/functions/public/getName.d.ts.map +1 -1
- package/dist/types/functions/public/getOwner.d.ts +19 -9
- package/dist/types/functions/public/getOwner.d.ts.map +1 -1
- package/dist/types/functions/public/getPrice.d.ts +3 -2
- package/dist/types/functions/public/getPrice.d.ts.map +1 -1
- package/dist/types/functions/public/getRecords.d.ts +3 -2
- package/dist/types/functions/public/getRecords.d.ts.map +1 -1
- package/dist/types/functions/public/getResolver.d.ts +2 -1
- package/dist/types/functions/public/getResolver.d.ts.map +1 -1
- package/dist/types/functions/public/getSupportedInterfaces.d.ts +41 -4
- package/dist/types/functions/public/getSupportedInterfaces.d.ts.map +1 -1
- package/dist/types/functions/public/getTextRecord.d.ts +2 -1
- package/dist/types/functions/public/getTextRecord.d.ts.map +1 -1
- package/dist/types/functions/public/getWrapperData.d.ts +4 -3
- package/dist/types/functions/public/getWrapperData.d.ts.map +1 -1
- package/dist/types/functions/public/getWrapperName.d.ts +2 -1
- package/dist/types/functions/public/getWrapperName.d.ts.map +1 -1
- package/dist/types/functions/subgraph/client.d.ts +2 -2
- package/dist/types/functions/subgraph/client.d.ts.map +1 -1
- package/dist/types/functions/subgraph/filters.d.ts +693 -0
- package/dist/types/functions/subgraph/filters.d.ts.map +1 -0
- package/dist/types/functions/subgraph/getDecodedName.d.ts +2 -1
- package/dist/types/functions/subgraph/getDecodedName.d.ts.map +1 -1
- package/dist/types/functions/subgraph/getNameHistory.d.ts +2 -1
- package/dist/types/functions/subgraph/getNameHistory.d.ts.map +1 -1
- package/dist/types/functions/subgraph/getNamesForAddress.d.ts +7 -2
- package/dist/types/functions/subgraph/getNamesForAddress.d.ts.map +1 -1
- package/dist/types/functions/subgraph/getSubgraphRecords.d.ts +2 -1
- package/dist/types/functions/subgraph/getSubgraphRecords.d.ts.map +1 -1
- package/dist/types/functions/subgraph/getSubgraphRegistrant.d.ts +2 -1
- package/dist/types/functions/subgraph/getSubgraphRegistrant.d.ts.map +1 -1
- package/dist/types/functions/subgraph/getSubnames.d.ts +5 -2
- package/dist/types/functions/subgraph/getSubnames.d.ts.map +1 -1
- package/dist/types/functions/subgraph/types.d.ts +13 -0
- package/dist/types/functions/subgraph/types.d.ts.map +1 -0
- package/dist/types/functions/subgraph/utils.d.ts +2 -2
- package/dist/types/functions/subgraph/utils.d.ts.map +1 -1
- package/dist/types/functions/wallet/clearRecords.d.ts +555 -0
- package/dist/types/functions/wallet/clearRecords.d.ts.map +1 -0
- package/dist/types/functions/wallet/commitName.d.ts +80 -93
- package/dist/types/functions/wallet/commitName.d.ts.map +1 -1
- package/dist/types/functions/wallet/createSubname.d.ts +82 -96
- package/dist/types/functions/wallet/createSubname.d.ts.map +1 -1
- package/dist/types/functions/wallet/deleteSubname.d.ts +79 -93
- package/dist/types/functions/wallet/deleteSubname.d.ts.map +1 -1
- package/dist/types/functions/wallet/registerName.d.ts +80 -89
- package/dist/types/functions/wallet/registerName.d.ts.map +1 -1
- package/dist/types/functions/wallet/renewNames.d.ts +79 -89
- package/dist/types/functions/wallet/renewNames.d.ts.map +1 -1
- package/dist/types/functions/wallet/setAbiRecord.d.ts +80 -93
- package/dist/types/functions/wallet/setAbiRecord.d.ts.map +1 -1
- package/dist/types/functions/wallet/setAddressRecord.d.ts +79 -93
- package/dist/types/functions/wallet/setAddressRecord.d.ts.map +1 -1
- package/dist/types/functions/wallet/setChildFuses.d.ts +81 -95
- package/dist/types/functions/wallet/setChildFuses.d.ts.map +1 -1
- package/dist/types/functions/wallet/setContentHashRecord.d.ts +79 -93
- package/dist/types/functions/wallet/setContentHashRecord.d.ts.map +1 -1
- package/dist/types/functions/wallet/setFuses.d.ts +81 -95
- package/dist/types/functions/wallet/setFuses.d.ts.map +1 -1
- package/dist/types/functions/wallet/setPrimaryName.d.ts +79 -93
- package/dist/types/functions/wallet/setPrimaryName.d.ts.map +1 -1
- package/dist/types/functions/wallet/setRecords.d.ts +79 -93
- package/dist/types/functions/wallet/setRecords.d.ts.map +1 -1
- package/dist/types/functions/wallet/setResolver.d.ts +79 -93
- package/dist/types/functions/wallet/setResolver.d.ts.map +1 -1
- package/dist/types/functions/wallet/setTextRecord.d.ts +79 -93
- package/dist/types/functions/wallet/setTextRecord.d.ts.map +1 -1
- package/dist/types/functions/wallet/transferName.d.ts +80 -94
- package/dist/types/functions/wallet/transferName.d.ts.map +1 -1
- package/dist/types/functions/wallet/unwrapName.d.ts +79 -93
- package/dist/types/functions/wallet/unwrapName.d.ts.map +1 -1
- package/dist/types/functions/wallet/wrapName.d.ts +81 -95
- package/dist/types/functions/wallet/wrapName.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/subgraph.d.ts +1 -0
- package/dist/types/subgraph.d.ts.map +1 -1
- package/dist/types/types.d.ts +3 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/contentHash.d.ts +10 -11
- package/dist/types/utils/contentHash.d.ts.map +1 -1
- package/dist/types/utils/encoders/encodeAbi.d.ts +8 -5
- package/dist/types/utils/encoders/encodeAbi.d.ts.map +1 -1
- package/dist/types/utils/encoders/encodeClearRecords.d.ts +3 -0
- package/dist/types/utils/encoders/encodeClearRecords.d.ts.map +1 -0
- package/dist/types/utils/encoders/encodeSetAddr.d.ts.map +1 -1
- package/dist/types/utils/encoders/encodeSetContentHash.d.ts.map +1 -1
- package/dist/types/utils/format.d.ts +0 -2
- package/dist/types/utils/format.d.ts.map +1 -1
- package/dist/types/utils/fuses.d.ts +164 -125
- package/dist/types/utils/fuses.d.ts.map +1 -1
- package/dist/types/utils/generateRecordCallArray.d.ts +5 -5
- package/dist/types/utils/generateRecordCallArray.d.ts.map +1 -1
- package/dist/types/utils/getRevertErrorData.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +5 -3
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/normaliseCoinId.d.ts +10 -0
- package/dist/types/utils/normaliseCoinId.d.ts.map +1 -0
- package/dist/types/utils/registerHelpers.d.ts +2 -2
- package/dist/types/utils/registerHelpers.d.ts.map +1 -1
- package/dist/types/wallet.d.ts +18 -17
- package/dist/types/wallet.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/clients/decorators/subgraph.ts +1 -0
- package/src/clients/decorators/wallet.ts +41 -3
- package/src/clients/public.ts +3 -2
- package/src/clients/subgraph.ts +3 -2
- package/src/clients/wallet.ts +1 -1
- package/src/contracts/consts.ts +58 -13
- package/src/contracts/universalResolver.ts +46 -1
- package/src/dns.ts +7 -5
- package/src/errors/subgraph.ts +4 -4
- package/src/errors/utils.ts +29 -18
- package/src/errors/version.ts +1 -1
- package/src/functions/dns/{prepareDnsImport.ts → getDnsImportData.ts} +13 -13
- package/src/functions/dns/getDnsOwner.ts +1 -1
- package/src/functions/dns/importDnsName.ts +21 -15
- package/src/functions/public/_getAbi.ts +2 -2
- package/src/functions/public/_getAddr.ts +16 -23
- package/src/functions/public/_getContentHash.ts +2 -2
- package/src/functions/public/batch.ts +2 -1
- package/src/functions/public/getAbiRecord.ts +2 -1
- package/src/functions/public/getAddressRecord.ts +2 -1
- package/src/functions/public/getAvailable.ts +2 -1
- package/src/functions/public/getContentHashRecord.ts +2 -1
- package/src/functions/public/getExpiry.ts +2 -1
- package/src/functions/public/getName.ts +3 -2
- package/src/functions/public/getOwner.ts +54 -33
- package/src/functions/public/getPrice.ts +3 -2
- package/src/functions/public/getRecords.ts +130 -114
- package/src/functions/public/getResolver.ts +3 -2
- package/src/functions/public/getSupportedInterfaces.ts +70 -10
- package/src/functions/public/getTextRecord.ts +2 -1
- package/src/functions/public/getWrapperData.ts +5 -4
- package/src/functions/public/getWrapperName.ts +3 -2
- package/src/functions/public/multicallWrapper.ts +1 -1
- package/src/functions/public/universalWrapper.ts +1 -1
- package/src/functions/subgraph/client.ts +2 -2
- package/src/functions/subgraph/filters.ts +702 -0
- package/src/functions/subgraph/getDecodedName.ts +2 -1
- package/src/functions/subgraph/getNameHistory.ts +8 -6
- package/src/functions/subgraph/getNamesForAddress.ts +199 -195
- package/src/functions/subgraph/getSubgraphRecords.ts +65 -33
- package/src/functions/subgraph/getSubgraphRegistrant.ts +2 -1
- package/src/functions/subgraph/getSubnames.ts +123 -114
- package/src/functions/subgraph/types.ts +13 -0
- package/src/functions/subgraph/utils.ts +2 -2
- package/src/functions/wallet/clearRecords.ts +97 -0
- package/src/functions/wallet/commitName.ts +3 -1
- package/src/functions/wallet/createSubname.ts +6 -5
- package/src/functions/wallet/deleteSubname.ts +2 -1
- package/src/functions/wallet/registerName.ts +4 -1
- package/src/functions/wallet/renewNames.ts +3 -1
- package/src/functions/wallet/setAbiRecord.ts +3 -1
- package/src/functions/wallet/setAddressRecord.ts +2 -1
- package/src/functions/wallet/setChildFuses.ts +5 -4
- package/src/functions/wallet/setContentHashRecord.ts +2 -1
- package/src/functions/wallet/setFuses.ts +8 -4
- package/src/functions/wallet/setPrimaryName.ts +2 -1
- package/src/functions/wallet/setRecords.ts +2 -1
- package/src/functions/wallet/setResolver.ts +2 -1
- package/src/functions/wallet/setTextRecord.ts +2 -1
- package/src/functions/wallet/transferName.ts +3 -2
- package/src/functions/wallet/unwrapName.ts +2 -1
- package/src/functions/wallet/wrapName.ts +10 -4
- package/src/index.ts +0 -1
- package/src/subgraph.ts +5 -0
- package/src/types.ts +6 -3
- package/src/utils/contentHash.ts +65 -113
- package/src/utils/encoders/encodeAbi.ts +37 -8
- package/src/utils/encoders/encodeClearRecords.ts +9 -0
- package/src/utils/encoders/encodeSetAddr.ts +5 -16
- package/src/utils/encoders/encodeSetContentHash.ts +2 -4
- package/src/utils/format.ts +0 -6
- package/src/utils/fuses.ts +312 -308
- package/src/utils/generateRecordCallArray.ts +10 -14
- package/src/utils/getRevertErrorData.ts +3 -1
- package/src/utils/index.ts +37 -5
- package/src/utils/normaliseCoinId.ts +36 -0
- package/src/utils/registerHelpers.ts +5 -3
- package/src/wallet.ts +41 -0
- package/dist/types/functions/dns/prepareDnsImport.d.ts +0 -39
- package/src/@types/@ensdomains/content-hash.d.ts +0 -1
- package/src/functions/dns/getDnsOwner.test.ts +0 -195
- package/src/functions/dns/importDnsName.test.ts +0 -117
- package/src/functions/dns/prepareDnsImport.test.ts +0 -115
- package/src/functions/public/batch.test.ts +0 -67
- package/src/functions/public/ccip.test.ts +0 -78
- package/src/functions/public/getAbiRecord.test.ts +0 -174
- package/src/functions/public/getAddressRecord.test.ts +0 -83
- package/src/functions/public/getAvailable.test.ts +0 -17
- package/src/functions/public/getContentHashRecord.test.ts +0 -28
- package/src/functions/public/getExpiry.test.ts +0 -48
- package/src/functions/public/getName.test.ts +0 -66
- package/src/functions/public/getOwner.test.ts +0 -87
- package/src/functions/public/getPrice.test.ts +0 -45
- package/src/functions/public/getRecords.test.ts +0 -49
- package/src/functions/public/getResolver.test.ts +0 -12
- package/src/functions/public/getTextRecord.test.ts +0 -20
- package/src/functions/public/getWrapperData.test.ts +0 -79
- package/src/functions/public/getWrapperName.test.ts +0 -19
- package/src/functions/subgraph/client.test.ts +0 -170
- package/src/functions/subgraph/getDecodedName.test.ts +0 -31
- package/src/functions/subgraph/getNameHistory.test.ts +0 -39
- package/src/functions/subgraph/getNamesForAddress.test.ts +0 -244
- package/src/functions/subgraph/getSubgraphRecords.test.ts +0 -74
- package/src/functions/subgraph/getSubgraphRegistrant.test.ts +0 -34
- package/src/functions/subgraph/getSubnames.test.ts +0 -202
- package/src/functions/wallet/commitName.test.ts +0 -58
- package/src/functions/wallet/createSubname.test.ts +0 -73
- package/src/functions/wallet/deleteSubname.test.ts +0 -150
- package/src/functions/wallet/registerName.test.ts +0 -81
- package/src/functions/wallet/renewNames.test.ts +0 -92
- package/src/functions/wallet/setAbiRecord.test.ts +0 -156
- package/src/functions/wallet/setAddressRecord.test.ts +0 -121
- package/src/functions/wallet/setChildFuses.test.ts +0 -97
- package/src/functions/wallet/setContentHashRecord.test.ts +0 -69
- package/src/functions/wallet/setFuses.test.ts +0 -287
- package/src/functions/wallet/setPrimaryName.test.ts +0 -71
- package/src/functions/wallet/setRecords.test.ts +0 -127
- package/src/functions/wallet/setResolver.test.ts +0 -114
- package/src/functions/wallet/setTextRecord.test.ts +0 -67
- package/src/functions/wallet/transferName.test.ts +0 -201
- package/src/functions/wallet/unwrapName.test.ts +0 -93
- package/src/functions/wallet/wrapName.test.ts +0 -195
- package/src/utils/generateRecordCallArray.test.ts +0 -84
- package/src/utils/labels.test.ts +0 -163
- package/src/utils/makeLabelNodeAndParent.test.ts +0 -11
- package/src/utils/makeSafeSecondsDate.test.ts +0 -14
- package/src/utils/normalise.test.ts +0 -35
- package/src/utils/ownerFromContract.test.ts +0 -52
- package/src/utils/registerHelpers.test.ts +0 -159
- package/src/utils/validation.test.ts +0 -170
- package/src/utils/wrapper.test.ts +0 -46
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-await-in-loop */
|
|
2
|
-
|
|
3
|
-
import type { Address } from 'viem'
|
|
4
|
-
import { publicClient, walletClient } from '../../tests/addTestContracts.js'
|
|
5
|
-
import getNamesForAddress, {
|
|
6
|
-
type NameWithRelation,
|
|
7
|
-
} from './getNamesForAddress.js'
|
|
8
|
-
|
|
9
|
-
let accounts: Address[]
|
|
10
|
-
|
|
11
|
-
beforeAll(async () => {
|
|
12
|
-
accounts = await walletClient.getAddresses()
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('returns with default values', async () => {
|
|
16
|
-
const result = await getNamesForAddress(publicClient, {
|
|
17
|
-
address: accounts[1],
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
expect(result).toBeTruthy()
|
|
21
|
-
// arbitrary number, just to make sure we get some results
|
|
22
|
-
expect(result.length).toBeGreaterThan(10)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('has registration date on .eth names', async () => {
|
|
26
|
-
const result = await getNamesForAddress(publicClient, {
|
|
27
|
-
address: accounts[1],
|
|
28
|
-
})
|
|
29
|
-
if (!result.length) throw new Error('No names found')
|
|
30
|
-
for (const name of result) {
|
|
31
|
-
if (name.parentName === 'eth') {
|
|
32
|
-
expect(name.registrationDate).toBeTruthy()
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
describe('filter', () => {
|
|
37
|
-
it('filters by owner', async () => {
|
|
38
|
-
const result = await getNamesForAddress(publicClient, {
|
|
39
|
-
address: accounts[1],
|
|
40
|
-
filter: {
|
|
41
|
-
owner: true,
|
|
42
|
-
registrant: false,
|
|
43
|
-
resolvedAddress: false,
|
|
44
|
-
wrappedOwner: false,
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
if (!result.length) throw new Error('No names found')
|
|
48
|
-
for (const name of result) {
|
|
49
|
-
expect(name.owner).toBe(accounts[1])
|
|
50
|
-
expect(name.relation.owner).toBe(true)
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
it('filters by registrant', async () => {
|
|
54
|
-
const result = await getNamesForAddress(publicClient, {
|
|
55
|
-
address: accounts[1],
|
|
56
|
-
filter: {
|
|
57
|
-
owner: false,
|
|
58
|
-
registrant: true,
|
|
59
|
-
resolvedAddress: false,
|
|
60
|
-
wrappedOwner: false,
|
|
61
|
-
},
|
|
62
|
-
})
|
|
63
|
-
if (!result.length) throw new Error('No names found')
|
|
64
|
-
for (const name of result) {
|
|
65
|
-
expect(name.registrant).toBe(accounts[1])
|
|
66
|
-
expect(name.relation.registrant).toBe(true)
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
it('filters by resolved address', async () => {
|
|
70
|
-
const result = await getNamesForAddress(publicClient, {
|
|
71
|
-
address: accounts[1],
|
|
72
|
-
filter: {
|
|
73
|
-
owner: false,
|
|
74
|
-
registrant: false,
|
|
75
|
-
resolvedAddress: true,
|
|
76
|
-
wrappedOwner: false,
|
|
77
|
-
},
|
|
78
|
-
})
|
|
79
|
-
if (!result.length) throw new Error('No names found')
|
|
80
|
-
for (const name of result) {
|
|
81
|
-
expect(name.resolvedAddress).toBe(accounts[1])
|
|
82
|
-
expect(name.relation.resolvedAddress).toBe(true)
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
it('filters by wrapped owner', async () => {
|
|
86
|
-
const result = await getNamesForAddress(publicClient, {
|
|
87
|
-
address: accounts[1],
|
|
88
|
-
filter: {
|
|
89
|
-
owner: false,
|
|
90
|
-
registrant: false,
|
|
91
|
-
resolvedAddress: false,
|
|
92
|
-
wrappedOwner: true,
|
|
93
|
-
},
|
|
94
|
-
})
|
|
95
|
-
if (!result.length) throw new Error('No names found')
|
|
96
|
-
for (const name of result) {
|
|
97
|
-
expect(name.wrappedOwner).toBe(accounts[1])
|
|
98
|
-
expect(name.relation.wrappedOwner).toBe(true)
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
it('allows including expired names', async () => {
|
|
102
|
-
const result = await getNamesForAddress(publicClient, {
|
|
103
|
-
address: accounts[1],
|
|
104
|
-
filter: {
|
|
105
|
-
owner: true,
|
|
106
|
-
registrant: true,
|
|
107
|
-
resolvedAddress: true,
|
|
108
|
-
wrappedOwner: true,
|
|
109
|
-
allowExpired: true,
|
|
110
|
-
},
|
|
111
|
-
})
|
|
112
|
-
if (!result.length) throw new Error('No names found')
|
|
113
|
-
const expiredNames = result.filter(
|
|
114
|
-
(x) => x.expiryDate?.date && x.expiryDate.date < new Date(),
|
|
115
|
-
)
|
|
116
|
-
expect(expiredNames.length).toBeGreaterThan(0)
|
|
117
|
-
})
|
|
118
|
-
it('allows including reverse record', async () => {
|
|
119
|
-
const result = await getNamesForAddress(publicClient, {
|
|
120
|
-
address: accounts[2],
|
|
121
|
-
filter: {
|
|
122
|
-
owner: true,
|
|
123
|
-
registrant: true,
|
|
124
|
-
resolvedAddress: true,
|
|
125
|
-
wrappedOwner: true,
|
|
126
|
-
allowReverseRecord: true,
|
|
127
|
-
},
|
|
128
|
-
})
|
|
129
|
-
if (!result.length) throw new Error('No names found')
|
|
130
|
-
const reverseRecordNames = result.filter(
|
|
131
|
-
(x) => x.parentName === 'addr.reverse',
|
|
132
|
-
)
|
|
133
|
-
expect(reverseRecordNames.length).toBeGreaterThan(0)
|
|
134
|
-
})
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
describe.each([
|
|
138
|
-
{
|
|
139
|
-
orderBy: 'name',
|
|
140
|
-
orderDirection: 'asc',
|
|
141
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) =>
|
|
142
|
-
(a.name || '').localeCompare(b.name || ''),
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
orderBy: 'name',
|
|
146
|
-
orderDirection: 'desc',
|
|
147
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) =>
|
|
148
|
-
(b.name || '').localeCompare(a.name || ''),
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
orderBy: 'labelName',
|
|
152
|
-
orderDirection: 'asc',
|
|
153
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) => {
|
|
154
|
-
const aLabelName = a.labelName || ''
|
|
155
|
-
const bLabelName = b.labelName || ''
|
|
156
|
-
return aLabelName.localeCompare(bLabelName)
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
orderBy: 'labelName',
|
|
161
|
-
orderDirection: 'desc',
|
|
162
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) => {
|
|
163
|
-
const aLabelName = a.labelName || ''
|
|
164
|
-
const bLabelName = b.labelName || ''
|
|
165
|
-
return bLabelName.localeCompare(aLabelName)
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
orderBy: 'expiryDate',
|
|
170
|
-
orderDirection: 'asc',
|
|
171
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) => {
|
|
172
|
-
const aExpiryDate = a.expiryDate?.value || Infinity
|
|
173
|
-
const bExpiryDate = b.expiryDate?.value || Infinity
|
|
174
|
-
return aExpiryDate - bExpiryDate
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
orderBy: 'expiryDate',
|
|
179
|
-
orderDirection: 'desc',
|
|
180
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) => {
|
|
181
|
-
const aExpiryDate = a.expiryDate?.value || Infinity
|
|
182
|
-
const bExpiryDate = b.expiryDate?.value || Infinity
|
|
183
|
-
return bExpiryDate - aExpiryDate
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
orderBy: 'createdAt',
|
|
188
|
-
orderDirection: 'asc',
|
|
189
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) => {
|
|
190
|
-
const aCreatedAt = a.createdAt.value
|
|
191
|
-
const bCreatedAt = b.createdAt.value
|
|
192
|
-
return aCreatedAt - bCreatedAt
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
orderBy: 'createdAt',
|
|
197
|
-
orderDirection: 'desc',
|
|
198
|
-
compareFn: (a: NameWithRelation, b: NameWithRelation) => {
|
|
199
|
-
const aCreatedAt = a.createdAt.value
|
|
200
|
-
const bCreatedAt = b.createdAt.value
|
|
201
|
-
return bCreatedAt - aCreatedAt
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
])(
|
|
205
|
-
'filters by $orderBy $orderDirection',
|
|
206
|
-
({ orderBy, orderDirection, compareFn }) => {
|
|
207
|
-
it('is consistent between full result and paginated results', async () => {
|
|
208
|
-
const fullResult = await getNamesForAddress(publicClient, {
|
|
209
|
-
address: accounts[1],
|
|
210
|
-
orderBy: orderBy as any,
|
|
211
|
-
orderDirection: orderDirection as any,
|
|
212
|
-
pageSize: 1000,
|
|
213
|
-
})
|
|
214
|
-
if (!fullResult.length) throw new Error('No names found')
|
|
215
|
-
const paginatedResults = []
|
|
216
|
-
let lastResult: NameWithRelation[] = []
|
|
217
|
-
do {
|
|
218
|
-
const result = await getNamesForAddress(publicClient, {
|
|
219
|
-
address: accounts[1],
|
|
220
|
-
orderBy: orderBy as any,
|
|
221
|
-
orderDirection: orderDirection as any,
|
|
222
|
-
previousPage: lastResult,
|
|
223
|
-
pageSize: 5,
|
|
224
|
-
})
|
|
225
|
-
paginatedResults.push(...result)
|
|
226
|
-
lastResult = result
|
|
227
|
-
} while (lastResult.length)
|
|
228
|
-
|
|
229
|
-
expect(paginatedResults.length).toBe(fullResult.length)
|
|
230
|
-
expect(paginatedResults).toStrictEqual(fullResult)
|
|
231
|
-
})
|
|
232
|
-
it('is sorted correctly', async () => {
|
|
233
|
-
const fullResult = await getNamesForAddress(publicClient, {
|
|
234
|
-
address: accounts[1],
|
|
235
|
-
orderBy: orderBy as any,
|
|
236
|
-
orderDirection: orderDirection as any,
|
|
237
|
-
pageSize: 1000,
|
|
238
|
-
})
|
|
239
|
-
if (!fullResult.length) throw new Error('No names found')
|
|
240
|
-
const sortedResult = [...fullResult].sort(compareFn)
|
|
241
|
-
expect(fullResult).toEqual(sortedResult)
|
|
242
|
-
})
|
|
243
|
-
},
|
|
244
|
-
)
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deploymentAddresses,
|
|
3
|
-
publicClient,
|
|
4
|
-
} from '../../tests/addTestContracts.js'
|
|
5
|
-
import getSubgraphRecords from './getSubgraphRecords.js'
|
|
6
|
-
|
|
7
|
-
it('gets basic records', async () => {
|
|
8
|
-
const result = await getSubgraphRecords(publicClient, {
|
|
9
|
-
name: 'with-profile.eth',
|
|
10
|
-
})
|
|
11
|
-
expect(result).toBeTruthy()
|
|
12
|
-
const { createdAt, ...snapshot } = result!
|
|
13
|
-
expect(createdAt.date).toBeInstanceOf(Date)
|
|
14
|
-
expect(createdAt.value).toBe(createdAt.date.getTime())
|
|
15
|
-
expect(snapshot).toMatchInlineSnapshot(`
|
|
16
|
-
{
|
|
17
|
-
"coins": [
|
|
18
|
-
"60",
|
|
19
|
-
"61",
|
|
20
|
-
"0",
|
|
21
|
-
"2",
|
|
22
|
-
],
|
|
23
|
-
"isMigrated": true,
|
|
24
|
-
"texts": [
|
|
25
|
-
"description",
|
|
26
|
-
"url",
|
|
27
|
-
"blankrecord",
|
|
28
|
-
"email",
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
`)
|
|
32
|
-
})
|
|
33
|
-
it('gets records for custom resolver address', async () => {
|
|
34
|
-
const result = await getSubgraphRecords(publicClient, {
|
|
35
|
-
name: 'with-legacy-resolver.eth',
|
|
36
|
-
resolverAddress: deploymentAddresses.LegacyPublicResolver,
|
|
37
|
-
})
|
|
38
|
-
expect(result).toBeTruthy()
|
|
39
|
-
const { createdAt, ...snapshot } = result!
|
|
40
|
-
expect(createdAt.date).toBeInstanceOf(Date)
|
|
41
|
-
expect(createdAt.value).toBe(createdAt.date.getTime())
|
|
42
|
-
expect(snapshot).toMatchInlineSnapshot(`
|
|
43
|
-
{
|
|
44
|
-
"coins": [
|
|
45
|
-
"60",
|
|
46
|
-
],
|
|
47
|
-
"isMigrated": true,
|
|
48
|
-
"texts": [],
|
|
49
|
-
}
|
|
50
|
-
`)
|
|
51
|
-
})
|
|
52
|
-
it('returns null for nonexistent name', async () => {
|
|
53
|
-
const result = await getSubgraphRecords(publicClient, {
|
|
54
|
-
name: 'nonexistent.eth',
|
|
55
|
-
})
|
|
56
|
-
expect(result).toBeNull()
|
|
57
|
-
})
|
|
58
|
-
it('returns empty texts/coins for nonexistent resolver', async () => {
|
|
59
|
-
const result = await getSubgraphRecords(publicClient, {
|
|
60
|
-
name: 'with-profile.eth',
|
|
61
|
-
resolverAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
|
|
62
|
-
})
|
|
63
|
-
expect(result).toBeTruthy()
|
|
64
|
-
const { createdAt, ...snapshot } = result!
|
|
65
|
-
expect(createdAt.date).toBeInstanceOf(Date)
|
|
66
|
-
expect(createdAt.value).toBe(createdAt.date.getTime())
|
|
67
|
-
expect(snapshot).toMatchInlineSnapshot(`
|
|
68
|
-
{
|
|
69
|
-
"coins": [],
|
|
70
|
-
"isMigrated": true,
|
|
71
|
-
"texts": [],
|
|
72
|
-
}
|
|
73
|
-
`)
|
|
74
|
-
})
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getVersion } from '../../errors/error-utils.js'
|
|
2
|
-
import {
|
|
3
|
-
deploymentAddresses,
|
|
4
|
-
publicClient,
|
|
5
|
-
} from '../../tests/addTestContracts.js'
|
|
6
|
-
import getSubgraphRegistrant from './getSubgraphRegistrant.js'
|
|
7
|
-
|
|
8
|
-
it('gets the registrant for a 2ld .eth name', async () => {
|
|
9
|
-
const result = await getSubgraphRegistrant(publicClient, {
|
|
10
|
-
name: 'wrapped.eth',
|
|
11
|
-
})
|
|
12
|
-
expect(result).toBe(deploymentAddresses.NameWrapper)
|
|
13
|
-
})
|
|
14
|
-
it('returns null for nonexistent name', async () => {
|
|
15
|
-
const result = await getSubgraphRegistrant(publicClient, {
|
|
16
|
-
name: 'unregistered.eth',
|
|
17
|
-
})
|
|
18
|
-
expect(result).toBeNull()
|
|
19
|
-
})
|
|
20
|
-
it('throws an error for other name', async () => {
|
|
21
|
-
await expect(
|
|
22
|
-
getSubgraphRegistrant(publicClient, {
|
|
23
|
-
name: 'test123.com',
|
|
24
|
-
}),
|
|
25
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
26
|
-
"Unsupported name type: other-2ld
|
|
27
|
-
|
|
28
|
-
- Supported name types: eth-2ld
|
|
29
|
-
|
|
30
|
-
Details: Registrant can only be fetched for eth-2ld names
|
|
31
|
-
|
|
32
|
-
Version: ${getVersion()}"
|
|
33
|
-
`)
|
|
34
|
-
})
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-await-in-loop */
|
|
2
|
-
|
|
3
|
-
import { publicClient } from '../../tests/addTestContracts.js'
|
|
4
|
-
import getSubnames from './getSubnames.js'
|
|
5
|
-
import type { Name } from './utils.js'
|
|
6
|
-
|
|
7
|
-
it('returns with default values', async () => {
|
|
8
|
-
const result = await getSubnames(publicClient, {
|
|
9
|
-
name: 'with-subnames.eth',
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
expect(result).toBeTruthy()
|
|
13
|
-
// arbitrary number, just to make sure we get some results
|
|
14
|
-
expect(result.length).toBeGreaterThan(2)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('has registration date on .eth names', async () => {
|
|
18
|
-
const result = await getSubnames(publicClient, {
|
|
19
|
-
name: 'eth',
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
if (!result.length) throw new Error('No names found')
|
|
23
|
-
for (const name of result) {
|
|
24
|
-
expect(name.registrationDate).toBeTruthy()
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('filters by search string', async () => {
|
|
29
|
-
const result = await getSubnames(publicClient, {
|
|
30
|
-
name: 'eth',
|
|
31
|
-
searchString: 'test',
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
if (!result.length) throw new Error('No names found')
|
|
35
|
-
for (const name of result) {
|
|
36
|
-
expect(name.labelName).toContain('test')
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
it('does not include expired names by default - .eth 2ld', async () => {
|
|
40
|
-
const result = await getSubnames(publicClient, {
|
|
41
|
-
name: 'eth',
|
|
42
|
-
pageSize: 1000,
|
|
43
|
-
})
|
|
44
|
-
if (!result.length) throw new Error('No names found')
|
|
45
|
-
for (const name of result) {
|
|
46
|
-
expect(name.expiryDate!.value).toBeGreaterThan(Date.now())
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
it('allows including expired names - .eth 2ld', async () => {
|
|
50
|
-
const result = await getSubnames(publicClient, {
|
|
51
|
-
name: 'eth',
|
|
52
|
-
allowExpired: true,
|
|
53
|
-
pageSize: 1000,
|
|
54
|
-
})
|
|
55
|
-
if (!result.length) throw new Error('No names found')
|
|
56
|
-
const expiredNames = result.filter(
|
|
57
|
-
(name) => name.expiryDate!.value < Date.now(),
|
|
58
|
-
)
|
|
59
|
-
expect(expiredNames.length).toBeGreaterThan(0)
|
|
60
|
-
})
|
|
61
|
-
it('includes names with no expiry', async () => {
|
|
62
|
-
const result = await getSubnames(publicClient, {
|
|
63
|
-
name: 'wrapped-with-expiring-subnames.eth',
|
|
64
|
-
pageSize: 1000,
|
|
65
|
-
})
|
|
66
|
-
if (!result.length) throw new Error('No names found')
|
|
67
|
-
const noExpiryNames = result.filter((name) => !name.expiryDate)
|
|
68
|
-
expect(noExpiryNames.length).toBeGreaterThan(0)
|
|
69
|
-
})
|
|
70
|
-
it('does not include expired names by default - other', async () => {
|
|
71
|
-
const result = await getSubnames(publicClient, {
|
|
72
|
-
name: 'wrapped-with-expiring-subnames.eth',
|
|
73
|
-
pageSize: 1000,
|
|
74
|
-
})
|
|
75
|
-
if (!result.length) throw new Error('No names found')
|
|
76
|
-
const namesWithExpiry = result.filter((name) => name.expiryDate)
|
|
77
|
-
expect(namesWithExpiry.length).toBeGreaterThan(0)
|
|
78
|
-
for (const name of namesWithExpiry) {
|
|
79
|
-
expect(name.expiryDate!.value).toBeGreaterThan(Date.now())
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
it('allows including expired names - other', async () => {
|
|
83
|
-
const result = await getSubnames(publicClient, {
|
|
84
|
-
name: 'wrapped-with-expiring-subnames.eth',
|
|
85
|
-
allowExpired: true,
|
|
86
|
-
pageSize: 1000,
|
|
87
|
-
})
|
|
88
|
-
if (!result.length) throw new Error('No names found')
|
|
89
|
-
const expiredNames = result.filter(
|
|
90
|
-
(name) => name.expiryDate && name.expiryDate.value < Date.now(),
|
|
91
|
-
)
|
|
92
|
-
expect(expiredNames.length).toBeGreaterThan(0)
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
describe.each([
|
|
96
|
-
{
|
|
97
|
-
orderBy: 'name',
|
|
98
|
-
orderDirection: 'asc',
|
|
99
|
-
compareFn: (a: Name, b: Name) => (a.name || '').localeCompare(b.name || ''),
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
orderBy: 'name',
|
|
103
|
-
orderDirection: 'desc',
|
|
104
|
-
compareFn: (a: Name, b: Name) => (b.name || '').localeCompare(a.name || ''),
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
orderBy: 'labelName',
|
|
108
|
-
orderDirection: 'asc',
|
|
109
|
-
compareFn: (a: Name, b: Name) => {
|
|
110
|
-
const aLabelName = a.labelName || ''
|
|
111
|
-
const bLabelName = b.labelName || ''
|
|
112
|
-
return aLabelName.localeCompare(bLabelName)
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
orderBy: 'labelName',
|
|
117
|
-
orderDirection: 'desc',
|
|
118
|
-
compareFn: (a: Name, b: Name) => {
|
|
119
|
-
const aLabelName = a.labelName || ''
|
|
120
|
-
const bLabelName = b.labelName || ''
|
|
121
|
-
return bLabelName.localeCompare(aLabelName)
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
orderBy: 'expiryDate',
|
|
126
|
-
orderDirection: 'asc',
|
|
127
|
-
compareFn: (a: Name, b: Name) => {
|
|
128
|
-
const aExpiryDate = a.expiryDate?.value || Infinity
|
|
129
|
-
const bExpiryDate = b.expiryDate?.value || Infinity
|
|
130
|
-
return aExpiryDate - bExpiryDate
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
orderBy: 'expiryDate',
|
|
135
|
-
orderDirection: 'desc',
|
|
136
|
-
compareFn: (a: Name, b: Name) => {
|
|
137
|
-
const aExpiryDate = a.expiryDate?.value || Infinity
|
|
138
|
-
const bExpiryDate = b.expiryDate?.value || Infinity
|
|
139
|
-
return bExpiryDate - aExpiryDate
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
orderBy: 'createdAt',
|
|
144
|
-
orderDirection: 'asc',
|
|
145
|
-
compareFn: (a: Name, b: Name) => {
|
|
146
|
-
const aCreatedAt = a.createdAt.value
|
|
147
|
-
const bCreatedAt = b.createdAt.value
|
|
148
|
-
return aCreatedAt - bCreatedAt
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
orderBy: 'createdAt',
|
|
153
|
-
orderDirection: 'desc',
|
|
154
|
-
compareFn: (a: Name, b: Name) => {
|
|
155
|
-
const aCreatedAt = a.createdAt.value
|
|
156
|
-
const bCreatedAt = b.createdAt.value
|
|
157
|
-
return bCreatedAt - aCreatedAt
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
])(
|
|
161
|
-
'filters by $orderBy $orderDirection',
|
|
162
|
-
({ orderBy, orderDirection, compareFn }) => {
|
|
163
|
-
it('is consistent between full result and paginated results', async () => {
|
|
164
|
-
const fullResult = await getSubnames(publicClient, {
|
|
165
|
-
name: 'eth',
|
|
166
|
-
orderBy: orderBy as any,
|
|
167
|
-
orderDirection: orderDirection as any,
|
|
168
|
-
pageSize: 1000,
|
|
169
|
-
})
|
|
170
|
-
if (!fullResult.length) throw new Error('No names found')
|
|
171
|
-
const paginatedResults = []
|
|
172
|
-
let lastResult: Name[] = []
|
|
173
|
-
do {
|
|
174
|
-
const result = await getSubnames(publicClient, {
|
|
175
|
-
name: 'eth',
|
|
176
|
-
orderBy: orderBy as any,
|
|
177
|
-
orderDirection: orderDirection as any,
|
|
178
|
-
previousPage: lastResult,
|
|
179
|
-
pageSize: 5,
|
|
180
|
-
})
|
|
181
|
-
paginatedResults.push(...result)
|
|
182
|
-
lastResult = result
|
|
183
|
-
} while (lastResult.length)
|
|
184
|
-
|
|
185
|
-
expect(paginatedResults.length).toBe(fullResult.length)
|
|
186
|
-
expect(JSON.stringify(paginatedResults)).toEqual(
|
|
187
|
-
JSON.stringify(fullResult),
|
|
188
|
-
)
|
|
189
|
-
})
|
|
190
|
-
it('is sorted correctly', async () => {
|
|
191
|
-
const fullResult = await getSubnames(publicClient, {
|
|
192
|
-
name: 'eth',
|
|
193
|
-
orderBy: orderBy as any,
|
|
194
|
-
orderDirection: orderDirection as any,
|
|
195
|
-
pageSize: 1000,
|
|
196
|
-
})
|
|
197
|
-
if (!fullResult.length) throw new Error('No names found')
|
|
198
|
-
const sortedResult = [...fullResult].sort(compareFn)
|
|
199
|
-
expect(fullResult).toStrictEqual(sortedResult)
|
|
200
|
-
})
|
|
201
|
-
},
|
|
202
|
-
)
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import { ethRegistrarControllerCommitmentsSnippet } from '../../contracts/ethRegistrarController.js'
|
|
3
|
-
import { getChainContractAddress } from '../../contracts/getChainContractAddress.js'
|
|
4
|
-
import {
|
|
5
|
-
publicClient,
|
|
6
|
-
testClient,
|
|
7
|
-
waitForTransaction,
|
|
8
|
-
walletClient,
|
|
9
|
-
} from '../../tests/addTestContracts.js'
|
|
10
|
-
import {
|
|
11
|
-
makeCommitment,
|
|
12
|
-
type RegistrationParameters,
|
|
13
|
-
} from '../../utils/registerHelpers.js'
|
|
14
|
-
import commitName from './commitName.js'
|
|
15
|
-
|
|
16
|
-
let snapshot: Hex
|
|
17
|
-
let accounts: Address[]
|
|
18
|
-
|
|
19
|
-
beforeAll(async () => {
|
|
20
|
-
accounts = await walletClient.getAddresses()
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
beforeEach(async () => {
|
|
24
|
-
snapshot = await testClient.snapshot()
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
afterEach(async () => {
|
|
28
|
-
await testClient.revert({ id: snapshot })
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const secret = `0x${'a'.repeat(64)}` as Hex
|
|
32
|
-
|
|
33
|
-
it('should return a commit transaction and succeed', async () => {
|
|
34
|
-
const params: RegistrationParameters = {
|
|
35
|
-
name: 'wrapped-with-subnames.eth',
|
|
36
|
-
duration: 31536000,
|
|
37
|
-
owner: accounts[1],
|
|
38
|
-
secret,
|
|
39
|
-
}
|
|
40
|
-
const tx = await commitName(walletClient, {
|
|
41
|
-
...params,
|
|
42
|
-
account: accounts[1],
|
|
43
|
-
})
|
|
44
|
-
expect(tx).toBeTruthy()
|
|
45
|
-
const receipt = await waitForTransaction(tx)
|
|
46
|
-
expect(receipt.status).toBe('success')
|
|
47
|
-
|
|
48
|
-
const commitment = await publicClient.readContract({
|
|
49
|
-
abi: ethRegistrarControllerCommitmentsSnippet,
|
|
50
|
-
functionName: 'commitments',
|
|
51
|
-
address: getChainContractAddress({
|
|
52
|
-
client: publicClient,
|
|
53
|
-
contract: 'ensEthRegistrarController',
|
|
54
|
-
}),
|
|
55
|
-
args: [makeCommitment(params)],
|
|
56
|
-
})
|
|
57
|
-
expect(commitment).toBeTruthy()
|
|
58
|
-
})
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import { getChainContractAddress } from '../../contracts/getChainContractAddress.js'
|
|
3
|
-
import { nameWrapperOwnerOfSnippet } from '../../contracts/nameWrapper.js'
|
|
4
|
-
import { registryOwnerSnippet } from '../../contracts/registry.js'
|
|
5
|
-
import {
|
|
6
|
-
publicClient,
|
|
7
|
-
testClient,
|
|
8
|
-
waitForTransaction,
|
|
9
|
-
walletClient,
|
|
10
|
-
} from '../../tests/addTestContracts.js'
|
|
11
|
-
import { namehash } from '../../utils/normalise.js'
|
|
12
|
-
import createSubname from './createSubname.js'
|
|
13
|
-
|
|
14
|
-
let snapshot: Hex
|
|
15
|
-
let accounts: Address[]
|
|
16
|
-
|
|
17
|
-
beforeAll(async () => {
|
|
18
|
-
accounts = await walletClient.getAddresses()
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
beforeEach(async () => {
|
|
22
|
-
snapshot = await testClient.snapshot()
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
afterEach(async () => {
|
|
26
|
-
await testClient.revert({ id: snapshot })
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
it('should allow creating a subname on the registry', async () => {
|
|
30
|
-
const tx = await createSubname(walletClient, {
|
|
31
|
-
name: 'test.test123.eth',
|
|
32
|
-
contract: 'registry',
|
|
33
|
-
owner: accounts[0],
|
|
34
|
-
account: accounts[1],
|
|
35
|
-
})
|
|
36
|
-
expect(tx).toBeTruthy()
|
|
37
|
-
const receipt = await waitForTransaction(tx)
|
|
38
|
-
expect(receipt.status).toBe('success')
|
|
39
|
-
|
|
40
|
-
const owner = await publicClient.readContract({
|
|
41
|
-
abi: registryOwnerSnippet,
|
|
42
|
-
functionName: 'owner',
|
|
43
|
-
address: getChainContractAddress({
|
|
44
|
-
client: publicClient,
|
|
45
|
-
contract: 'ensRegistry',
|
|
46
|
-
}),
|
|
47
|
-
args: [namehash('test.test123.eth')],
|
|
48
|
-
})
|
|
49
|
-
expect(owner).toBe(accounts[0])
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
it('should allow creating a subname on the namewrapper', async () => {
|
|
53
|
-
const tx = await createSubname(walletClient, {
|
|
54
|
-
name: 'test.wrapped.eth',
|
|
55
|
-
contract: 'nameWrapper',
|
|
56
|
-
owner: accounts[0],
|
|
57
|
-
account: accounts[1],
|
|
58
|
-
})
|
|
59
|
-
expect(tx).toBeTruthy()
|
|
60
|
-
const receipt = await waitForTransaction(tx)
|
|
61
|
-
expect(receipt.status).toBe('success')
|
|
62
|
-
|
|
63
|
-
const owner = await publicClient.readContract({
|
|
64
|
-
abi: nameWrapperOwnerOfSnippet,
|
|
65
|
-
functionName: 'ownerOf',
|
|
66
|
-
address: getChainContractAddress({
|
|
67
|
-
client: publicClient,
|
|
68
|
-
contract: 'ensNameWrapper',
|
|
69
|
-
}),
|
|
70
|
-
args: [BigInt(namehash('test.wrapped.eth'))],
|
|
71
|
-
})
|
|
72
|
-
expect(owner).toBe(accounts[0])
|
|
73
|
-
})
|