@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,87 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deploymentAddresses,
|
|
3
|
-
publicClient,
|
|
4
|
-
} from '../../tests/addTestContracts.js'
|
|
5
|
-
import getOwner from './getOwner.js'
|
|
6
|
-
|
|
7
|
-
describe('getOwner', () => {
|
|
8
|
-
it('should return correct ownership level and values for a wrapped .eth name', async () => {
|
|
9
|
-
const result = await getOwner(publicClient, { name: 'wrapped.eth' })
|
|
10
|
-
expect(result).toMatchInlineSnapshot(`
|
|
11
|
-
{
|
|
12
|
-
"owner": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
|
13
|
-
"ownershipLevel": "nameWrapper",
|
|
14
|
-
}
|
|
15
|
-
`)
|
|
16
|
-
})
|
|
17
|
-
it('should return correct ownership level and values for an expired wrapped .eth name', async () => {
|
|
18
|
-
const result = await getOwner(publicClient, { name: 'expired-wrapped.eth' })
|
|
19
|
-
expect(result).toMatchInlineSnapshot(`
|
|
20
|
-
{
|
|
21
|
-
"owner": "${deploymentAddresses.NameWrapper}",
|
|
22
|
-
"ownershipLevel": "registrar",
|
|
23
|
-
"registrant": null,
|
|
24
|
-
}
|
|
25
|
-
`)
|
|
26
|
-
// expect(result).toEqual({
|
|
27
|
-
// ownershipLevel: 'nameWrapper',
|
|
28
|
-
// owner: '0x0000000000000000000000000000000000000000',
|
|
29
|
-
// expired: true,
|
|
30
|
-
// })
|
|
31
|
-
})
|
|
32
|
-
it('should return correct ownership level and values for an unwrapped .eth name', async () => {
|
|
33
|
-
const result = await getOwner(publicClient, { name: 'test123.eth' })
|
|
34
|
-
expect(result).toMatchInlineSnapshot(`
|
|
35
|
-
{
|
|
36
|
-
"owner": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
|
37
|
-
"ownershipLevel": "registrar",
|
|
38
|
-
"registrant": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
|
39
|
-
}
|
|
40
|
-
`)
|
|
41
|
-
})
|
|
42
|
-
it('should return correct ownership level and values for an expired unwrapped .eth name', async () => {
|
|
43
|
-
const result = await getOwner(publicClient, { name: 'expired.eth' })
|
|
44
|
-
expect(result).toMatchInlineSnapshot(`
|
|
45
|
-
{
|
|
46
|
-
"owner": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
|
47
|
-
"ownershipLevel": "registrar",
|
|
48
|
-
"registrant": null,
|
|
49
|
-
}
|
|
50
|
-
`)
|
|
51
|
-
})
|
|
52
|
-
describe('subname', () => {
|
|
53
|
-
it('should return correct ownership level and values for a unwrapped name', async () => {
|
|
54
|
-
const result = await getOwner(publicClient, {
|
|
55
|
-
name: 'test.with-subnames.eth',
|
|
56
|
-
})
|
|
57
|
-
expect(result).toMatchInlineSnapshot(`
|
|
58
|
-
{
|
|
59
|
-
"owner": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
|
|
60
|
-
"ownershipLevel": "registry",
|
|
61
|
-
}
|
|
62
|
-
`)
|
|
63
|
-
})
|
|
64
|
-
it('should return correct ownership level and values for a wrapped name', async () => {
|
|
65
|
-
const result = await getOwner(publicClient, {
|
|
66
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
67
|
-
})
|
|
68
|
-
expect(result).toMatchInlineSnapshot(`
|
|
69
|
-
{
|
|
70
|
-
"owner": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
|
|
71
|
-
"ownershipLevel": "nameWrapper",
|
|
72
|
-
}
|
|
73
|
-
`)
|
|
74
|
-
})
|
|
75
|
-
it('should return correct ownership level and values for an expired wrapped name', async () => {
|
|
76
|
-
const result = await getOwner(publicClient, {
|
|
77
|
-
name: 'test.expired-wrapped.eth',
|
|
78
|
-
})
|
|
79
|
-
expect(result).toMatchInlineSnapshot(`
|
|
80
|
-
{
|
|
81
|
-
"owner": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
|
|
82
|
-
"ownershipLevel": "nameWrapper",
|
|
83
|
-
}
|
|
84
|
-
`)
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
})
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { publicClient } from '../../tests/addTestContracts.js'
|
|
2
|
-
import getPrice from './getPrice.js'
|
|
3
|
-
|
|
4
|
-
const yearCost = BigInt('8561643835626')
|
|
5
|
-
|
|
6
|
-
describe('getPrice', () => {
|
|
7
|
-
it('should return a base and premium price for a name', async () => {
|
|
8
|
-
const result = await getPrice(publicClient, {
|
|
9
|
-
nameOrNames: 'test123.eth',
|
|
10
|
-
duration: 86400,
|
|
11
|
-
})
|
|
12
|
-
expect(result).toBeTruthy()
|
|
13
|
-
if (result) {
|
|
14
|
-
const { base, premium } = result
|
|
15
|
-
expect(base).toBe(yearCost)
|
|
16
|
-
expect(premium).toBe(0n)
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('should return a base and premium price for an array of names', async () => {
|
|
21
|
-
const result = await getPrice(publicClient, {
|
|
22
|
-
nameOrNames: ['test123.eth', 'to-be-renewed.eth'],
|
|
23
|
-
duration: 86400,
|
|
24
|
-
})
|
|
25
|
-
expect(result).toBeTruthy()
|
|
26
|
-
if (result) {
|
|
27
|
-
const { base, premium } = result
|
|
28
|
-
expect(base).toBe(yearCost * 2n)
|
|
29
|
-
expect(premium).toBe(0n)
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('should allow labels as inputs', async () => {
|
|
34
|
-
const result = await getPrice(publicClient, {
|
|
35
|
-
nameOrNames: 'test123',
|
|
36
|
-
duration: 86400,
|
|
37
|
-
})
|
|
38
|
-
expect(result).toBeTruthy()
|
|
39
|
-
if (result) {
|
|
40
|
-
const { base, premium } = result
|
|
41
|
-
expect(base).toBe(yearCost)
|
|
42
|
-
expect(premium).toBe(0n)
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
})
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deploymentAddresses,
|
|
3
|
-
publicClient,
|
|
4
|
-
} from '../../tests/addTestContracts.js'
|
|
5
|
-
import getRecords from './getRecords.js'
|
|
6
|
-
|
|
7
|
-
describe('getRecords()', () => {
|
|
8
|
-
it('works', async () => {
|
|
9
|
-
const result = await getRecords(publicClient, {
|
|
10
|
-
name: 'with-profile.eth',
|
|
11
|
-
records: {
|
|
12
|
-
texts: ['description', 'url'],
|
|
13
|
-
coins: ['60', 'ETC_LEGACY', '0'],
|
|
14
|
-
},
|
|
15
|
-
})
|
|
16
|
-
expect(result).toMatchInlineSnapshot(`
|
|
17
|
-
{
|
|
18
|
-
"coins": [
|
|
19
|
-
{
|
|
20
|
-
"id": 60,
|
|
21
|
-
"name": "ETH",
|
|
22
|
-
"value": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": 61,
|
|
26
|
-
"name": "ETC_LEGACY",
|
|
27
|
-
"value": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"id": 0,
|
|
31
|
-
"name": "BTC",
|
|
32
|
-
"value": "bc1qjqg9slurvjukfl92wp58y94480fvh4uc2pwa6n",
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
"resolverAddress": "${deploymentAddresses.LegacyPublicResolver}",
|
|
36
|
-
"texts": [
|
|
37
|
-
{
|
|
38
|
-
"key": "description",
|
|
39
|
-
"value": "Hello2",
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"key": "url",
|
|
43
|
-
"value": "twitter.com",
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
}
|
|
47
|
-
`)
|
|
48
|
-
})
|
|
49
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deploymentAddresses,
|
|
3
|
-
publicClient,
|
|
4
|
-
} from '../../tests/addTestContracts.js'
|
|
5
|
-
import getResolver from './getResolver.js'
|
|
6
|
-
|
|
7
|
-
describe('getResolver', () => {
|
|
8
|
-
it('should find the resolver for a name with a resolver', async () => {
|
|
9
|
-
const result = await getResolver(publicClient, { name: 'with-profile.eth' })
|
|
10
|
-
expect(result).toBe(deploymentAddresses.LegacyPublicResolver)
|
|
11
|
-
})
|
|
12
|
-
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { publicClient } from '../../tests/addTestContracts.js'
|
|
2
|
-
import getTextRecord from './getTextRecord.js'
|
|
3
|
-
|
|
4
|
-
describe('getTextRecord()', () => {
|
|
5
|
-
it('should return a record from a key', async () => {
|
|
6
|
-
const result = await getTextRecord(publicClient, {
|
|
7
|
-
name: 'with-profile.eth',
|
|
8
|
-
key: 'description',
|
|
9
|
-
})
|
|
10
|
-
expect(result).toBe('Hello2')
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('should return null for a non-existent key', async () => {
|
|
14
|
-
const result = await getTextRecord(publicClient, {
|
|
15
|
-
name: 'with-profile.eth',
|
|
16
|
-
key: 'thiskeydoesntexist',
|
|
17
|
-
})
|
|
18
|
-
expect(result).toBeNull()
|
|
19
|
-
})
|
|
20
|
-
})
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { publicClient } from '../../tests/addTestContracts.js'
|
|
2
|
-
import getWrapperData from './getWrapperData.js'
|
|
3
|
-
|
|
4
|
-
describe('getWrapperData', () => {
|
|
5
|
-
it('should return null for an unwrapped name', async () => {
|
|
6
|
-
const result = await getWrapperData(publicClient, {
|
|
7
|
-
name: 'with-profile.eth',
|
|
8
|
-
})
|
|
9
|
-
expect(result).toBeNull()
|
|
10
|
-
})
|
|
11
|
-
it('should return with CAN_DO_EVERYTHING set to true for a name with no fuses burned', async () => {
|
|
12
|
-
const result = await getWrapperData(publicClient, {
|
|
13
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
14
|
-
})
|
|
15
|
-
expect(result).toBeTruthy()
|
|
16
|
-
if (result) {
|
|
17
|
-
expect(result.fuses.child.CAN_DO_EVERYTHING).toBe(true)
|
|
18
|
-
expect(result.fuses.value).toBe(0)
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
// it('should return with other correct fuses', async () => {
|
|
22
|
-
// const tx = await ensInstance.setFuses('wrapped.eth', {
|
|
23
|
-
// named: [
|
|
24
|
-
// 'CANNOT_UNWRAP',
|
|
25
|
-
// 'CANNOT_CREATE_SUBDOMAIN',
|
|
26
|
-
// 'CANNOT_SET_TTL',
|
|
27
|
-
// 'CANNOT_APPROVE',
|
|
28
|
-
// ],
|
|
29
|
-
// addressOrIndex: 1,
|
|
30
|
-
// })
|
|
31
|
-
// await tx.wait()
|
|
32
|
-
|
|
33
|
-
// const result = await ensInstance.getWrapperData('wrapped.eth')
|
|
34
|
-
// expect(result).toBeTruthy()
|
|
35
|
-
// if (result) {
|
|
36
|
-
// expect(result.child.CAN_DO_EVERYTHING).toBe(false)
|
|
37
|
-
// expect(result.child.CANNOT_UNWRAP).toBe(true)
|
|
38
|
-
// expect(result.child.CANNOT_CREATE_SUBDOMAIN).toBe(true)
|
|
39
|
-
// expect(result.child.CANNOT_SET_TTL).toBe(true)
|
|
40
|
-
// expect(result.child.CANNOT_APPROVE).toBe(true)
|
|
41
|
-
// expect(result.parent.IS_DOT_ETH).toBe(true)
|
|
42
|
-
// }
|
|
43
|
-
// })
|
|
44
|
-
it('should return correct expiry', async () => {
|
|
45
|
-
const result = await getWrapperData(publicClient, {
|
|
46
|
-
name: 'wrapped.eth',
|
|
47
|
-
})
|
|
48
|
-
expect(result).toBeTruthy()
|
|
49
|
-
if (result) {
|
|
50
|
-
expect(result.expiry!.date).toBeInstanceOf(Date)
|
|
51
|
-
expect(typeof result.expiry!.value).toBe('bigint')
|
|
52
|
-
expect(Number.isNaN(result.expiry!.date.getTime())).toBe(false)
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
it('should return correct expiry for large expiry', async () => {
|
|
56
|
-
const result = await getWrapperData(publicClient, {
|
|
57
|
-
name: 'wrapped-big-duration.eth',
|
|
58
|
-
})
|
|
59
|
-
expect(result).toBeTruthy()
|
|
60
|
-
if (result) {
|
|
61
|
-
expect(result.expiry!.date).toBeInstanceOf(Date)
|
|
62
|
-
expect(typeof result.expiry!.value).toBe('bigint')
|
|
63
|
-
expect(result.expiry!.date.getFullYear()).toBe(275760)
|
|
64
|
-
expect(Number.isNaN(result.expiry!.date.getTime())).toBe(false)
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
it('should return correct max expiry for expiry larger than maximum for date', async () => {
|
|
68
|
-
const result = await getWrapperData(publicClient, {
|
|
69
|
-
name: 'wrapped-max-duration.eth',
|
|
70
|
-
})
|
|
71
|
-
expect(result).toBeTruthy()
|
|
72
|
-
if (result) {
|
|
73
|
-
expect(result.expiry!.date).toBeInstanceOf(Date)
|
|
74
|
-
expect(typeof result.expiry!.value).toBe('bigint')
|
|
75
|
-
expect(result.expiry!.date.getFullYear()).toBe(275760)
|
|
76
|
-
expect(Number.isNaN(result.expiry!.date.getTime())).toBe(false)
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
})
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { publicClient } from '../../tests/addTestContracts.js'
|
|
2
|
-
import getWrapperName from './getWrapperName.js'
|
|
3
|
-
|
|
4
|
-
describe('getWrapperName()', () => {
|
|
5
|
-
it('should return name for existing name', async () => {
|
|
6
|
-
const result = await getWrapperName(publicClient, {
|
|
7
|
-
// wrapped.eth
|
|
8
|
-
name: '[4ca938ec1b323ca71c4fb47a712abb68cce1cabf39ea4d6789e42fbc1f95459b].eth',
|
|
9
|
-
})
|
|
10
|
-
expect(result).toBe('wrapped.eth')
|
|
11
|
-
})
|
|
12
|
-
it('should return null for non-existent name', async () => {
|
|
13
|
-
const result = await getWrapperName(publicClient, {
|
|
14
|
-
// test123.eth
|
|
15
|
-
name: '[f81b517a242b218999ec8eec0ea6e2ddbef2a367a14e93f4a32a39e260f686ad].eth',
|
|
16
|
-
})
|
|
17
|
-
expect(result).toBeNull()
|
|
18
|
-
})
|
|
19
|
-
})
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { namehash } from 'viem'
|
|
2
|
-
import { requestMiddleware, responseMiddleware } from './client.js'
|
|
3
|
-
|
|
4
|
-
const queryWithoutId = `
|
|
5
|
-
query getNames($id: ID!, $expiryDate: Int) {
|
|
6
|
-
account(id: $id) {
|
|
7
|
-
registrations(first: 1000, where: { expiryDate_gt: $expiryDate }) {
|
|
8
|
-
registrationDate
|
|
9
|
-
expiryDate
|
|
10
|
-
domain {
|
|
11
|
-
labelName
|
|
12
|
-
labelhash
|
|
13
|
-
name
|
|
14
|
-
isMigrated
|
|
15
|
-
parent {
|
|
16
|
-
name
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
domains(first: 1000) {
|
|
21
|
-
labelName
|
|
22
|
-
labelhash
|
|
23
|
-
name
|
|
24
|
-
isMigrated
|
|
25
|
-
parent {
|
|
26
|
-
name
|
|
27
|
-
}
|
|
28
|
-
createdAt
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
const mockRequest = {
|
|
35
|
-
method: 'POST',
|
|
36
|
-
headers: {
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
38
|
-
'Content-Type': 'application/json',
|
|
39
|
-
},
|
|
40
|
-
body: JSON.stringify({ query: queryWithoutId }),
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const mockResponse = {
|
|
44
|
-
data: {
|
|
45
|
-
account: {
|
|
46
|
-
registrations: [
|
|
47
|
-
{
|
|
48
|
-
registrationDate: '1659245504',
|
|
49
|
-
expiryDate: '1690781504',
|
|
50
|
-
domain: {
|
|
51
|
-
id: '0xb1ccf7f6bb648f39ba48bf80f4a8a4522f474ee7d1edd6ea65f7fa51fe8b1612',
|
|
52
|
-
labelName: 'randydandy',
|
|
53
|
-
labelhash:
|
|
54
|
-
'0x63fd5bfdd0b1eb9f4c33c209b7c3e7dcb87a761d926a65e267f7cb99ee313ddd',
|
|
55
|
-
name: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd',
|
|
56
|
-
isMigrated: true,
|
|
57
|
-
parent: {
|
|
58
|
-
name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae',
|
|
59
|
-
invalidName: true,
|
|
60
|
-
},
|
|
61
|
-
invalidName: true,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
registrationDate: '1635284756',
|
|
66
|
-
expiryDate: '1666841708',
|
|
67
|
-
domain: {
|
|
68
|
-
id: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd',
|
|
69
|
-
labelName: 'randydandy',
|
|
70
|
-
labelhash:
|
|
71
|
-
'0x6a877a8d92ad83c8d044d0c5b69aa0da3050f4d653dcc149fca952d6439e4105',
|
|
72
|
-
name: 'randydandy.eth',
|
|
73
|
-
isMigrated: true,
|
|
74
|
-
parent: {
|
|
75
|
-
name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae',
|
|
76
|
-
invalidName: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
registrationDate: '1659250465',
|
|
82
|
-
expiryDate: '1690786465',
|
|
83
|
-
domain: {
|
|
84
|
-
id: '0xaf119e72f050e5acad6b2d97826a7afb45afe9407376a2ab8240b62173b2d7c2',
|
|
85
|
-
labelName: 'nullbyte',
|
|
86
|
-
labelhash:
|
|
87
|
-
'0xc8985f8323b3dc707003a6ef5b379d9e8a058b6d6bcc2cfb307c61ca36920e27',
|
|
88
|
-
name: '0xb54c7c79c89d571f1fbf4c67f524e336a04441eeee4d76f156e835da99a46ddb',
|
|
89
|
-
isMigrated: true,
|
|
90
|
-
parent: {
|
|
91
|
-
name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae',
|
|
92
|
-
invalidName: true,
|
|
93
|
-
},
|
|
94
|
-
invalidName: true,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
domains: [
|
|
99
|
-
{
|
|
100
|
-
id: '0xaf119e72f050e5acad6b2d97826a7afb45afe9407376a2ab8240b62173b2d7c2',
|
|
101
|
-
labelName: 'nullbyte',
|
|
102
|
-
labelhash:
|
|
103
|
-
'0xc8985f8323b3dc707003a6ef5b379d9e8a058b6d6bcc2cfb307c61ca36920e27',
|
|
104
|
-
name: '0xb54c7c79c89d571f1fbf4c67f524e336a04441eeee4d76f156e835da99a46ddb',
|
|
105
|
-
isMigrated: true,
|
|
106
|
-
parent: {
|
|
107
|
-
name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae',
|
|
108
|
-
invalidName: true,
|
|
109
|
-
},
|
|
110
|
-
createdAt: '1659250465',
|
|
111
|
-
invalidName: true,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
id: '0xb1ccf7f6bb648f39ba48bf80f4a8a4522f474ee7d1edd6ea65f7fa51fe8b1612',
|
|
115
|
-
labelName: 'randydandy',
|
|
116
|
-
labelhash:
|
|
117
|
-
'0x63fd5bfdd0b1eb9f4c33c209b7c3e7dcb87a761d926a65e267f7cb99ee313ddd',
|
|
118
|
-
name: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd',
|
|
119
|
-
isMigrated: true,
|
|
120
|
-
parent: {
|
|
121
|
-
name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae',
|
|
122
|
-
invalidName: true,
|
|
123
|
-
},
|
|
124
|
-
createdAt: '1659245504',
|
|
125
|
-
invalidName: true,
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
id: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd',
|
|
129
|
-
labelName: 'randydandy',
|
|
130
|
-
labelhash:
|
|
131
|
-
'0x6a877a8d92ad83c8d044d0c5b69aa0da3050f4d653dcc149fca952d6439e4105',
|
|
132
|
-
name: 'randydandy.eth',
|
|
133
|
-
isMigrated: true,
|
|
134
|
-
parent: {
|
|
135
|
-
name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae',
|
|
136
|
-
invalidName: true,
|
|
137
|
-
},
|
|
138
|
-
createdAt: '1635284756',
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
headers: {
|
|
144
|
-
map: {
|
|
145
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
146
|
-
'Content-Type': 'application/json',
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
status: 200,
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
describe('requestMiddleware', () => {
|
|
153
|
-
it('should add id to a SelectionSet if name is present and id is not', () => {
|
|
154
|
-
const result = requestMiddleware(mockRequest as any)
|
|
155
|
-
const body = (result as any).body as string
|
|
156
|
-
expect(body.match(/domain.*id.*id.*domains.*id.*id/)?.length).toBe(1)
|
|
157
|
-
})
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
describe('responseMiddleware', () => {
|
|
161
|
-
it('should replace name with the namehash when there is an invalid name and id combo', () => {
|
|
162
|
-
const response = { ...mockResponse }
|
|
163
|
-
responseMiddleware(response as any)
|
|
164
|
-
expect(response.data.account.domains[0].name).toBe(
|
|
165
|
-
namehash(
|
|
166
|
-
'0xb54c7c79c89d571f1fbf4c67f524e336a04441eeee4d76f156e835da99a46ddb',
|
|
167
|
-
),
|
|
168
|
-
)
|
|
169
|
-
})
|
|
170
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { publicClient } from '../../tests/addTestContracts.js'
|
|
2
|
-
import getDecodedName from './getDecodedName.js'
|
|
3
|
-
|
|
4
|
-
it('should decode a name via namehash lookup', async () => {
|
|
5
|
-
const result = await getDecodedName(publicClient, {
|
|
6
|
-
name: '[9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658].wrapped-with-subnames.eth',
|
|
7
|
-
})
|
|
8
|
-
expect(result).toBe('test.wrapped-with-subnames.eth')
|
|
9
|
-
})
|
|
10
|
-
it('should decode a name via labelhash lookup', async () => {
|
|
11
|
-
const result = await getDecodedName(publicClient, {
|
|
12
|
-
name: '[f81b517a242b218999ec8eec0ea6e2ddbef2a367a14e93f4a32a39e260f686ad].eth',
|
|
13
|
-
})
|
|
14
|
-
expect(result).toBe('test123.eth')
|
|
15
|
-
})
|
|
16
|
-
it('should partially decode a name when allowIncomplete is true', async () => {
|
|
17
|
-
const result = await getDecodedName(publicClient, {
|
|
18
|
-
name: '[7bffb6e3ebf801bbc438fea5c11d957ba49978bdc8d52b71cba974139d22edea].[6c14e1739568670447af1d5af8a571008f7a582068af18bcd7ac2dbc13bb37c1].eth',
|
|
19
|
-
allowIncomplete: true,
|
|
20
|
-
})
|
|
21
|
-
expect(result).toBe(
|
|
22
|
-
'[7bffb6e3ebf801bbc438fea5c11d957ba49978bdc8d52b71cba974139d22edea].with-unknown-subnames.eth',
|
|
23
|
-
)
|
|
24
|
-
})
|
|
25
|
-
it('should not partially decode a name when allowIncomplete is false', async () => {
|
|
26
|
-
const result = await getDecodedName(publicClient, {
|
|
27
|
-
name: '[7bffb6e3ebf801bbc438fea5c11d957ba49978bdc8d52b71cba974139d22edea].[6c14e1739568670447af1d5af8a571008f7a582068af18bcd7ac2dbc13bb37c1].eth',
|
|
28
|
-
allowIncomplete: false,
|
|
29
|
-
})
|
|
30
|
-
expect(result).toBeNull()
|
|
31
|
-
})
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { publicClient } from '../../tests/addTestContracts.js'
|
|
2
|
-
import getNameHistory from './getNameHistory.js'
|
|
3
|
-
|
|
4
|
-
it('returns null for a non-existent name', async () => {
|
|
5
|
-
const result = await getNameHistory(publicClient, {
|
|
6
|
-
name: 'test123123cool.eth',
|
|
7
|
-
})
|
|
8
|
-
expect(result).toBeNull()
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('returns the history of a name', async () => {
|
|
12
|
-
const result = await getNameHistory(publicClient, {
|
|
13
|
-
name: 'with-profile.eth',
|
|
14
|
-
})
|
|
15
|
-
if (!result) throw new Error('No result')
|
|
16
|
-
expect(result.domainEvents.length).toBeGreaterThan(0)
|
|
17
|
-
expect(result.registrationEvents!.length).toBeGreaterThan(0)
|
|
18
|
-
expect(result.resolverEvents!.length).toBeGreaterThan(0)
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
it('returns the history of a wrapped name', async () => {
|
|
22
|
-
const result = await getNameHistory(publicClient, {
|
|
23
|
-
name: 'wrapped.eth',
|
|
24
|
-
})
|
|
25
|
-
if (!result) throw new Error('No result')
|
|
26
|
-
expect(result.domainEvents.length).toBeGreaterThan(0)
|
|
27
|
-
expect(result.registrationEvents!.length).toBeGreaterThan(0)
|
|
28
|
-
expect(result.resolverEvents).not.toBeNull()
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('returns the history of a subname', async () => {
|
|
32
|
-
const result = await getNameHistory(publicClient, {
|
|
33
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
34
|
-
})
|
|
35
|
-
if (!result) throw new Error('No result')
|
|
36
|
-
expect(result.domainEvents.length).toBeGreaterThan(0)
|
|
37
|
-
expect(result.registrationEvents).toBeNull()
|
|
38
|
-
expect(result.resolverEvents).not.toBeNull()
|
|
39
|
-
})
|