@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,150 +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 {
|
|
5
|
-
registryOwnerSnippet,
|
|
6
|
-
registryResolverSnippet,
|
|
7
|
-
} from '../../contracts/registry.js'
|
|
8
|
-
import {
|
|
9
|
-
publicClient,
|
|
10
|
-
testClient,
|
|
11
|
-
waitForTransaction,
|
|
12
|
-
walletClient,
|
|
13
|
-
} from '../../tests/addTestContracts.js'
|
|
14
|
-
import { EMPTY_ADDRESS } from '../../utils/consts.js'
|
|
15
|
-
import { namehash } from '../../utils/normalise.js'
|
|
16
|
-
import deleteSubname from './deleteSubname.js'
|
|
17
|
-
|
|
18
|
-
let snapshot: Hex
|
|
19
|
-
let accounts: Address[]
|
|
20
|
-
|
|
21
|
-
beforeAll(async () => {
|
|
22
|
-
accounts = await walletClient.getAddresses()
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
beforeEach(async () => {
|
|
26
|
-
snapshot = await testClient.snapshot()
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
afterEach(async () => {
|
|
30
|
-
await testClient.revert({ id: snapshot })
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const getOwner = async (name: string) => {
|
|
34
|
-
return publicClient.readContract({
|
|
35
|
-
abi: registryOwnerSnippet,
|
|
36
|
-
functionName: 'owner',
|
|
37
|
-
address: getChainContractAddress({
|
|
38
|
-
client: publicClient,
|
|
39
|
-
contract: 'ensRegistry',
|
|
40
|
-
}),
|
|
41
|
-
args: [namehash(name)],
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const getNameWrapperOwner = async (name: string) => {
|
|
46
|
-
return publicClient.readContract({
|
|
47
|
-
abi: nameWrapperOwnerOfSnippet,
|
|
48
|
-
functionName: 'ownerOf',
|
|
49
|
-
address: getChainContractAddress({
|
|
50
|
-
client: publicClient,
|
|
51
|
-
contract: 'ensNameWrapper',
|
|
52
|
-
}),
|
|
53
|
-
args: [BigInt(namehash(name))],
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const getResolver = async (name: string) => {
|
|
58
|
-
return publicClient.readContract({
|
|
59
|
-
abi: registryResolverSnippet,
|
|
60
|
-
functionName: 'resolver',
|
|
61
|
-
address: getChainContractAddress({
|
|
62
|
-
client: publicClient,
|
|
63
|
-
contract: 'ensRegistry',
|
|
64
|
-
}),
|
|
65
|
-
args: [namehash(name)],
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
it('should allow deleting a subname on the registry by parent owner', async () => {
|
|
70
|
-
const tx = await deleteSubname(walletClient, {
|
|
71
|
-
name: 'test.with-subnames.eth',
|
|
72
|
-
contract: 'registry',
|
|
73
|
-
account: accounts[1],
|
|
74
|
-
})
|
|
75
|
-
expect(tx).toBeTruthy()
|
|
76
|
-
const receipt = await waitForTransaction(tx)
|
|
77
|
-
expect(receipt.status).toBe('success')
|
|
78
|
-
|
|
79
|
-
const owner = await getOwner('test.with-subnames.eth')
|
|
80
|
-
expect(owner).toBe(EMPTY_ADDRESS)
|
|
81
|
-
|
|
82
|
-
const resolver = await getResolver('test.with-subnames.eth')
|
|
83
|
-
expect(resolver).toBe(EMPTY_ADDRESS)
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
it('should allow deleting a subname on the namewrapper by parent owner', async () => {
|
|
87
|
-
const tx = await deleteSubname(walletClient, {
|
|
88
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
89
|
-
contract: 'nameWrapper',
|
|
90
|
-
account: accounts[1],
|
|
91
|
-
})
|
|
92
|
-
expect(tx).toBeTruthy()
|
|
93
|
-
const receipt = await waitForTransaction(tx)
|
|
94
|
-
expect(receipt.status).toBe('success')
|
|
95
|
-
|
|
96
|
-
const owner = await getOwner('test.wrapped-with-subnames.eth')
|
|
97
|
-
expect(owner).toBe(EMPTY_ADDRESS)
|
|
98
|
-
|
|
99
|
-
const resolver = await getResolver('test.wrapped-with-subnames.eth')
|
|
100
|
-
expect(resolver).toBe(EMPTY_ADDRESS)
|
|
101
|
-
|
|
102
|
-
const nameWrapperOwner = await getNameWrapperOwner(
|
|
103
|
-
'test.wrapped-with-subnames.eth',
|
|
104
|
-
)
|
|
105
|
-
expect(nameWrapperOwner).toBe(EMPTY_ADDRESS)
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
it('should allow deleting a subname on the namewrapper by name owner', async () => {
|
|
109
|
-
const tx = await deleteSubname(walletClient, {
|
|
110
|
-
name: 'addr.wrapped-with-subnames.eth',
|
|
111
|
-
contract: 'nameWrapper',
|
|
112
|
-
asOwner: true,
|
|
113
|
-
account: accounts[2],
|
|
114
|
-
})
|
|
115
|
-
expect(tx).toBeTruthy()
|
|
116
|
-
const receipt = await waitForTransaction(tx)
|
|
117
|
-
expect(receipt.status).toBe('success')
|
|
118
|
-
|
|
119
|
-
const owner = await getOwner('addr.wrapped-with-subnames.eth')
|
|
120
|
-
expect(owner).toBe(EMPTY_ADDRESS)
|
|
121
|
-
|
|
122
|
-
const resolver = await getResolver('addr.wrapped-with-subnames.eth')
|
|
123
|
-
expect(resolver).toBe(EMPTY_ADDRESS)
|
|
124
|
-
|
|
125
|
-
const nameWrapperOwner = await getNameWrapperOwner(
|
|
126
|
-
'addr.wrapped-with-subnames.eth',
|
|
127
|
-
)
|
|
128
|
-
expect(nameWrapperOwner).toBe(EMPTY_ADDRESS)
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
it('should not allow deleting top level domain', async () => {
|
|
132
|
-
await expect(
|
|
133
|
-
deleteSubname(walletClient, {
|
|
134
|
-
name: 'eth',
|
|
135
|
-
contract: 'nameWrapper',
|
|
136
|
-
asOwner: true,
|
|
137
|
-
account: accounts[1],
|
|
138
|
-
}),
|
|
139
|
-
).rejects.toThrow()
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
it('should not allow deleting second level domain', async () => {
|
|
143
|
-
await expect(
|
|
144
|
-
deleteSubname(walletClient, {
|
|
145
|
-
name: 'test123.eth',
|
|
146
|
-
contract: 'registry',
|
|
147
|
-
account: accounts[1],
|
|
148
|
-
}),
|
|
149
|
-
).rejects.toThrow()
|
|
150
|
-
})
|
|
@@ -1,81 +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 {
|
|
5
|
-
publicClient,
|
|
6
|
-
testClient,
|
|
7
|
-
waitForTransaction,
|
|
8
|
-
walletClient,
|
|
9
|
-
} from '../../tests/addTestContracts.js'
|
|
10
|
-
import { namehash } from '../../utils/normalise.js'
|
|
11
|
-
import type { RegistrationParameters } from '../../utils/registerHelpers.js'
|
|
12
|
-
import getPrice from '../public/getPrice.js'
|
|
13
|
-
import commitName from './commitName.js'
|
|
14
|
-
import registerName from './registerName.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
|
-
const getNameWrapperOwner = async (name: string) => {
|
|
34
|
-
return publicClient.readContract({
|
|
35
|
-
abi: nameWrapperOwnerOfSnippet,
|
|
36
|
-
functionName: 'ownerOf',
|
|
37
|
-
address: getChainContractAddress({
|
|
38
|
-
client: publicClient,
|
|
39
|
-
contract: 'ensNameWrapper',
|
|
40
|
-
}),
|
|
41
|
-
args: [BigInt(namehash(name))],
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
it('should return a registration transaction and succeed', async () => {
|
|
46
|
-
const params: RegistrationParameters = {
|
|
47
|
-
name: 'cool-swag.eth',
|
|
48
|
-
duration: 31536000,
|
|
49
|
-
owner: accounts[1],
|
|
50
|
-
secret,
|
|
51
|
-
}
|
|
52
|
-
const commitTx = await commitName(walletClient, {
|
|
53
|
-
...params,
|
|
54
|
-
account: accounts[1],
|
|
55
|
-
})
|
|
56
|
-
expect(commitTx).toBeTruthy()
|
|
57
|
-
const commitReceipt = await waitForTransaction(commitTx)
|
|
58
|
-
|
|
59
|
-
expect(commitReceipt.status).toBe('success')
|
|
60
|
-
|
|
61
|
-
await testClient.increaseTime({ seconds: 61 })
|
|
62
|
-
await testClient.mine({ blocks: 1 })
|
|
63
|
-
|
|
64
|
-
const price = await getPrice(publicClient, {
|
|
65
|
-
nameOrNames: params.name,
|
|
66
|
-
duration: params.duration,
|
|
67
|
-
})
|
|
68
|
-
const total = price!.base + price!.premium
|
|
69
|
-
|
|
70
|
-
const tx = await registerName(walletClient, {
|
|
71
|
-
...params,
|
|
72
|
-
account: accounts[1],
|
|
73
|
-
value: total,
|
|
74
|
-
})
|
|
75
|
-
expect(tx).toBeTruthy()
|
|
76
|
-
const receipt = await waitForTransaction(tx)
|
|
77
|
-
expect(receipt.status).toBe('success')
|
|
78
|
-
|
|
79
|
-
const owner = await getNameWrapperOwner(params.name)
|
|
80
|
-
expect(owner).toBe(accounts[1])
|
|
81
|
-
})
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { labelhash, type Address, type Hex } from 'viem'
|
|
2
|
-
import { baseRegistrarNameExpiresSnippet } from '../../contracts/baseRegistrar.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 getPrice from '../public/getPrice.js'
|
|
11
|
-
import renewNames from './renewNames.js'
|
|
12
|
-
|
|
13
|
-
let snapshot: Hex
|
|
14
|
-
let accounts: Address[]
|
|
15
|
-
|
|
16
|
-
beforeAll(async () => {
|
|
17
|
-
accounts = await walletClient.getAddresses()
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
beforeEach(async () => {
|
|
21
|
-
snapshot = await testClient.snapshot()
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
afterEach(async () => {
|
|
25
|
-
await testClient.revert({ id: snapshot })
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
const getExpiry = async (name: string) => {
|
|
29
|
-
return publicClient.readContract({
|
|
30
|
-
abi: baseRegistrarNameExpiresSnippet,
|
|
31
|
-
functionName: 'nameExpires',
|
|
32
|
-
address: getChainContractAddress({
|
|
33
|
-
client: publicClient,
|
|
34
|
-
contract: 'ensBaseRegistrarImplementation',
|
|
35
|
-
}),
|
|
36
|
-
args: [BigInt(labelhash(name.split('.')[0]))],
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
it('should return a renew transaction for a single name and succeed', async () => {
|
|
41
|
-
const name = 'to-be-renewed.eth'
|
|
42
|
-
const duration = 31536000n
|
|
43
|
-
|
|
44
|
-
const oldExpiry = await getExpiry(name)
|
|
45
|
-
|
|
46
|
-
const price = await getPrice(publicClient, {
|
|
47
|
-
nameOrNames: name,
|
|
48
|
-
duration,
|
|
49
|
-
})
|
|
50
|
-
const total = price!.base + price!.premium
|
|
51
|
-
|
|
52
|
-
const tx = await renewNames(walletClient, {
|
|
53
|
-
nameOrNames: name,
|
|
54
|
-
duration,
|
|
55
|
-
value: total,
|
|
56
|
-
account: accounts[0],
|
|
57
|
-
})
|
|
58
|
-
expect(tx).toBeTruthy()
|
|
59
|
-
const receipt = await waitForTransaction(tx)
|
|
60
|
-
expect(receipt.status).toBe('success')
|
|
61
|
-
|
|
62
|
-
const newExpiry = await getExpiry(name)
|
|
63
|
-
expect(newExpiry).toBe(oldExpiry + duration)
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
it('should return a renewAll transaction for multiple names and succeed', async () => {
|
|
67
|
-
const names = ['to-be-renewed.eth', 'test123.eth']
|
|
68
|
-
const duration = 31536000n
|
|
69
|
-
|
|
70
|
-
const oldExpiries = await Promise.all(names.map(getExpiry))
|
|
71
|
-
|
|
72
|
-
const price = await getPrice(publicClient, {
|
|
73
|
-
nameOrNames: names,
|
|
74
|
-
duration,
|
|
75
|
-
})
|
|
76
|
-
const total = price!.base + price!.premium
|
|
77
|
-
|
|
78
|
-
const tx = await renewNames(walletClient, {
|
|
79
|
-
nameOrNames: names,
|
|
80
|
-
duration,
|
|
81
|
-
value: total,
|
|
82
|
-
account: accounts[1],
|
|
83
|
-
})
|
|
84
|
-
expect(tx).toBeTruthy()
|
|
85
|
-
const receipt = await waitForTransaction(tx)
|
|
86
|
-
expect(receipt.status).toBe('success')
|
|
87
|
-
|
|
88
|
-
const newExpiries = await Promise.all(names.map(getExpiry))
|
|
89
|
-
for (let i = 0; i < names.length; i += 1) {
|
|
90
|
-
expect(newExpiries[i]).toBe(oldExpiries[i] + duration)
|
|
91
|
-
}
|
|
92
|
-
})
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import {
|
|
3
|
-
publicClient,
|
|
4
|
-
testClient,
|
|
5
|
-
waitForTransaction,
|
|
6
|
-
walletClient,
|
|
7
|
-
} from '../../tests/addTestContracts.js'
|
|
8
|
-
import { encodeAbi } from '../../utils/encoders/encodeAbi.js'
|
|
9
|
-
import getAbiRecord from '../public/getAbiRecord.js'
|
|
10
|
-
import getResolver from '../public/getResolver.js'
|
|
11
|
-
import setAbiRecord from './setAbiRecord.js'
|
|
12
|
-
|
|
13
|
-
let snapshot: Hex
|
|
14
|
-
let accounts: Address[]
|
|
15
|
-
|
|
16
|
-
beforeAll(async () => {
|
|
17
|
-
accounts = await walletClient.getAddresses()
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
beforeEach(async () => {
|
|
21
|
-
snapshot = await testClient.snapshot()
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
afterEach(async () => {
|
|
25
|
-
await testClient.revert({ id: snapshot })
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
const dummyABI = [
|
|
29
|
-
{
|
|
30
|
-
type: 'function',
|
|
31
|
-
name: 'supportsInterface',
|
|
32
|
-
constant: true,
|
|
33
|
-
stateMutability: 'view',
|
|
34
|
-
payable: false,
|
|
35
|
-
inputs: [
|
|
36
|
-
{
|
|
37
|
-
type: 'bytes4',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
outputs: [
|
|
41
|
-
{
|
|
42
|
-
type: 'bool',
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
it('should allow an abi record to be set with json content type', async () => {
|
|
49
|
-
const encodedAbi = await encodeAbi({ encodeAs: 'json', data: dummyABI })
|
|
50
|
-
const tx = await setAbiRecord(walletClient, {
|
|
51
|
-
name: 'test123.eth',
|
|
52
|
-
encodedAbi,
|
|
53
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
54
|
-
name: 'test123.eth',
|
|
55
|
-
}))!,
|
|
56
|
-
account: accounts[1],
|
|
57
|
-
})
|
|
58
|
-
expect(tx).toBeTruthy()
|
|
59
|
-
const receipt = await waitForTransaction(tx)
|
|
60
|
-
expect(receipt.status).toBe('success')
|
|
61
|
-
|
|
62
|
-
const response = await getAbiRecord(publicClient, {
|
|
63
|
-
name: 'test123.eth',
|
|
64
|
-
})
|
|
65
|
-
expect(response!.abi).toEqual(dummyABI)
|
|
66
|
-
expect(response!.contentType).toEqual(1)
|
|
67
|
-
expect(response!.decoded).toBe(true)
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
it('should allow an abi record to be set with zlib content type', async () => {
|
|
71
|
-
const encodedAbi = await encodeAbi({ encodeAs: 'zlib', data: dummyABI })
|
|
72
|
-
const tx = await setAbiRecord(walletClient, {
|
|
73
|
-
name: 'test123.eth',
|
|
74
|
-
encodedAbi,
|
|
75
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
76
|
-
name: 'test123.eth',
|
|
77
|
-
}))!,
|
|
78
|
-
account: accounts[1],
|
|
79
|
-
})
|
|
80
|
-
expect(tx).toBeTruthy()
|
|
81
|
-
const receipt = await waitForTransaction(tx)
|
|
82
|
-
expect(receipt.status).toBe('success')
|
|
83
|
-
|
|
84
|
-
const response = await getAbiRecord(publicClient, {
|
|
85
|
-
name: 'test123.eth',
|
|
86
|
-
})
|
|
87
|
-
expect(response!.abi).toEqual(dummyABI)
|
|
88
|
-
expect(response!.contentType).toEqual(2)
|
|
89
|
-
expect(response!.decoded).toBe(true)
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
it('should allow an abi record to be set with cbor content type', async () => {
|
|
93
|
-
const encodedAbi = await encodeAbi({ encodeAs: 'cbor', data: dummyABI })
|
|
94
|
-
const tx = await setAbiRecord(walletClient, {
|
|
95
|
-
name: 'test123.eth',
|
|
96
|
-
encodedAbi,
|
|
97
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
98
|
-
name: 'test123.eth',
|
|
99
|
-
}))!,
|
|
100
|
-
account: accounts[1],
|
|
101
|
-
})
|
|
102
|
-
expect(tx).toBeTruthy()
|
|
103
|
-
const receipt = await waitForTransaction(tx)
|
|
104
|
-
expect(receipt.status).toBe('success')
|
|
105
|
-
|
|
106
|
-
const response = await getAbiRecord(publicClient, {
|
|
107
|
-
name: 'test123.eth',
|
|
108
|
-
})
|
|
109
|
-
expect(response!.abi).toEqual(dummyABI)
|
|
110
|
-
expect(response!.contentType).toEqual(4)
|
|
111
|
-
expect(response!.decoded).toBe(true)
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
it('should allow an abi record to be set with uri content type', async () => {
|
|
115
|
-
const encodedAbi = await encodeAbi({
|
|
116
|
-
encodeAs: 'uri',
|
|
117
|
-
data: 'https://example.com',
|
|
118
|
-
})
|
|
119
|
-
const tx = await setAbiRecord(walletClient, {
|
|
120
|
-
name: 'test123.eth',
|
|
121
|
-
encodedAbi,
|
|
122
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
123
|
-
name: 'test123.eth',
|
|
124
|
-
}))!,
|
|
125
|
-
account: accounts[1],
|
|
126
|
-
})
|
|
127
|
-
expect(tx).toBeTruthy()
|
|
128
|
-
const receipt = await waitForTransaction(tx)
|
|
129
|
-
expect(receipt.status).toBe('success')
|
|
130
|
-
|
|
131
|
-
const response = await getAbiRecord(publicClient, {
|
|
132
|
-
name: 'test123.eth',
|
|
133
|
-
})
|
|
134
|
-
expect(response!.abi).toEqual('https://example.com')
|
|
135
|
-
expect(response!.contentType).toEqual(8)
|
|
136
|
-
expect(response!.decoded).toBe(true)
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
it('should allow an abi record to be set to blank', async () => {
|
|
140
|
-
const tx = await setAbiRecord(walletClient, {
|
|
141
|
-
name: 'with-type-1-abi.eth',
|
|
142
|
-
encodedAbi: null,
|
|
143
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
144
|
-
name: 'test123.eth',
|
|
145
|
-
}))!,
|
|
146
|
-
account: accounts[1],
|
|
147
|
-
})
|
|
148
|
-
expect(tx).toBeTruthy()
|
|
149
|
-
const receipt = await waitForTransaction(tx)
|
|
150
|
-
expect(receipt.status).toBe('success')
|
|
151
|
-
|
|
152
|
-
const response = await getAbiRecord(publicClient, {
|
|
153
|
-
name: 'test123.eth',
|
|
154
|
-
})
|
|
155
|
-
expect(response).toBeNull()
|
|
156
|
-
})
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import {
|
|
3
|
-
publicClient,
|
|
4
|
-
testClient,
|
|
5
|
-
waitForTransaction,
|
|
6
|
-
walletClient,
|
|
7
|
-
} from '../../tests/addTestContracts.js'
|
|
8
|
-
import getAddressRecord from '../public/getAddressRecord.js'
|
|
9
|
-
import getResolver from '../public/getResolver.js'
|
|
10
|
-
import setAddressRecord from './setAddressRecord.js'
|
|
11
|
-
|
|
12
|
-
let snapshot: Hex
|
|
13
|
-
let accounts: Address[]
|
|
14
|
-
|
|
15
|
-
beforeAll(async () => {
|
|
16
|
-
accounts = await walletClient.getAddresses()
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
beforeEach(async () => {
|
|
20
|
-
snapshot = await testClient.snapshot()
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
afterEach(async () => {
|
|
24
|
-
await testClient.revert({ id: snapshot })
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('should allow an eth address record to be set', async () => {
|
|
28
|
-
const tx = await setAddressRecord(walletClient, {
|
|
29
|
-
name: 'test123.eth',
|
|
30
|
-
coin: 'ETH',
|
|
31
|
-
value: '0x42D63ae25990889E35F215bC95884039Ba354115',
|
|
32
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
33
|
-
name: 'test123.eth',
|
|
34
|
-
}))!,
|
|
35
|
-
account: accounts[1],
|
|
36
|
-
})
|
|
37
|
-
expect(tx).toBeTruthy()
|
|
38
|
-
const receipt = await waitForTransaction(tx)
|
|
39
|
-
expect(receipt.status).toBe('success')
|
|
40
|
-
|
|
41
|
-
const response = await getAddressRecord(publicClient, {
|
|
42
|
-
name: 'test123.eth',
|
|
43
|
-
coin: 'ETH',
|
|
44
|
-
})
|
|
45
|
-
expect(response).toMatchInlineSnapshot(`
|
|
46
|
-
{
|
|
47
|
-
"id": 60,
|
|
48
|
-
"name": "ETH",
|
|
49
|
-
"value": "0x42D63ae25990889E35F215bC95884039Ba354115",
|
|
50
|
-
}
|
|
51
|
-
`)
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
it('should allow a multicoin address record to be set', async () => {
|
|
55
|
-
const tx = await setAddressRecord(walletClient, {
|
|
56
|
-
name: 'test123.eth',
|
|
57
|
-
coin: 'ETC_LEGACY',
|
|
58
|
-
value: '0x42D63ae25990889E35F215bC95884039Ba354115',
|
|
59
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
60
|
-
name: 'test123.eth',
|
|
61
|
-
}))!,
|
|
62
|
-
account: accounts[1],
|
|
63
|
-
})
|
|
64
|
-
expect(tx).toBeTruthy()
|
|
65
|
-
const receipt = await waitForTransaction(tx)
|
|
66
|
-
expect(receipt.status).toBe('success')
|
|
67
|
-
|
|
68
|
-
const response = await getAddressRecord(publicClient, {
|
|
69
|
-
name: 'test123.eth',
|
|
70
|
-
coin: 'ETC_LEGACY',
|
|
71
|
-
})
|
|
72
|
-
expect(response).toMatchInlineSnapshot(`
|
|
73
|
-
{
|
|
74
|
-
"id": 61,
|
|
75
|
-
"name": "ETC_LEGACY",
|
|
76
|
-
"value": "0x42D63ae25990889E35F215bC95884039Ba354115",
|
|
77
|
-
}
|
|
78
|
-
`)
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
it('should allow an eth record to be set to blank', async () => {
|
|
82
|
-
const tx = await setAddressRecord(walletClient, {
|
|
83
|
-
name: 'test123.eth',
|
|
84
|
-
coin: 'ETH',
|
|
85
|
-
value: null,
|
|
86
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
87
|
-
name: 'test123.eth',
|
|
88
|
-
}))!,
|
|
89
|
-
account: accounts[1],
|
|
90
|
-
})
|
|
91
|
-
expect(tx).toBeTruthy()
|
|
92
|
-
const receipt = await waitForTransaction(tx)
|
|
93
|
-
expect(receipt.status).toBe('success')
|
|
94
|
-
|
|
95
|
-
const response = await getAddressRecord(publicClient, {
|
|
96
|
-
name: 'test123.eth',
|
|
97
|
-
coin: 'ETH',
|
|
98
|
-
})
|
|
99
|
-
expect(response).toBeNull()
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
it('should allow a multicoin record to be set to blank', async () => {
|
|
103
|
-
const tx = await setAddressRecord(walletClient, {
|
|
104
|
-
name: 'with-profile.eth',
|
|
105
|
-
coin: 'BTC',
|
|
106
|
-
value: null,
|
|
107
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
108
|
-
name: 'with-profile.eth',
|
|
109
|
-
}))!,
|
|
110
|
-
account: accounts[2],
|
|
111
|
-
})
|
|
112
|
-
expect(tx).toBeTruthy()
|
|
113
|
-
const receipt = await waitForTransaction(tx)
|
|
114
|
-
expect(receipt.status).toBe('success')
|
|
115
|
-
|
|
116
|
-
const response = await getAddressRecord(publicClient, {
|
|
117
|
-
name: 'with-profile.eth',
|
|
118
|
-
coin: 'BTC',
|
|
119
|
-
})
|
|
120
|
-
expect(response).toBeNull()
|
|
121
|
-
})
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import { getChainContractAddress } from '../../contracts/getChainContractAddress.js'
|
|
3
|
-
import { nameWrapperGetDataSnippet } from '../../contracts/nameWrapper.js'
|
|
4
|
-
import {
|
|
5
|
-
publicClient,
|
|
6
|
-
testClient,
|
|
7
|
-
waitForTransaction,
|
|
8
|
-
walletClient,
|
|
9
|
-
} from '../../tests/addTestContracts.js'
|
|
10
|
-
import { userSettableFuseEnum } from '../../utils/fuses.js'
|
|
11
|
-
import { namehash } from '../../utils/normalise.js'
|
|
12
|
-
import setChildFuses from './setChildFuses.js'
|
|
13
|
-
import setFuses from './setFuses.js'
|
|
14
|
-
|
|
15
|
-
let snapshot: Hex
|
|
16
|
-
let accounts: Address[]
|
|
17
|
-
|
|
18
|
-
beforeAll(async () => {
|
|
19
|
-
accounts = await walletClient.getAddresses()
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
beforeEach(async () => {
|
|
23
|
-
snapshot = await testClient.snapshot()
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
afterEach(async () => {
|
|
27
|
-
await testClient.revert({ id: snapshot })
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const checkFuses = (
|
|
31
|
-
fuses: number,
|
|
32
|
-
expected: (keyof typeof userSettableFuseEnum)[],
|
|
33
|
-
) => {
|
|
34
|
-
// eslint-disable-next-line guard-for-in
|
|
35
|
-
for (const fuse in userSettableFuseEnum) {
|
|
36
|
-
const active =
|
|
37
|
-
(fuses &
|
|
38
|
-
userSettableFuseEnum[fuse as keyof typeof userSettableFuseEnum]) >
|
|
39
|
-
0
|
|
40
|
-
if (expected.includes(fuse as keyof typeof userSettableFuseEnum)) {
|
|
41
|
-
try {
|
|
42
|
-
expect(active).toBeTruthy()
|
|
43
|
-
} catch {
|
|
44
|
-
throw new Error(`${fuse} should be true but is false`)
|
|
45
|
-
}
|
|
46
|
-
} else if (active) {
|
|
47
|
-
try {
|
|
48
|
-
expect(active).toBeFalsy()
|
|
49
|
-
} catch {
|
|
50
|
-
throw new Error(`${fuse} should be false but is true`)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const getFuses = async (name: string) => {
|
|
57
|
-
const [, fuses] = await publicClient.readContract({
|
|
58
|
-
abi: nameWrapperGetDataSnippet,
|
|
59
|
-
address: getChainContractAddress({
|
|
60
|
-
client: publicClient,
|
|
61
|
-
contract: 'ensNameWrapper',
|
|
62
|
-
}),
|
|
63
|
-
functionName: 'getData',
|
|
64
|
-
args: [BigInt(namehash(name))],
|
|
65
|
-
})
|
|
66
|
-
return fuses
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
it('should return a setChildFuses transaction and succeed', async () => {
|
|
70
|
-
const setParentTx = await setFuses(walletClient, {
|
|
71
|
-
name: 'wrapped-with-subnames.eth',
|
|
72
|
-
fuses: {
|
|
73
|
-
named: ['CANNOT_UNWRAP'],
|
|
74
|
-
},
|
|
75
|
-
account: accounts[1],
|
|
76
|
-
})
|
|
77
|
-
expect(setParentTx).toBeTruthy()
|
|
78
|
-
const setParentTxReceipt = await waitForTransaction(setParentTx)
|
|
79
|
-
expect(setParentTxReceipt.status).toBe('success')
|
|
80
|
-
|
|
81
|
-
const tx = await setChildFuses(walletClient, {
|
|
82
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
83
|
-
fuses: 65537 + 64,
|
|
84
|
-
account: accounts[1],
|
|
85
|
-
})
|
|
86
|
-
expect(tx).toBeTruthy()
|
|
87
|
-
const receipt = await waitForTransaction(tx)
|
|
88
|
-
expect(receipt.status).toBe('success')
|
|
89
|
-
|
|
90
|
-
const fuses = await getFuses('test.wrapped-with-subnames.eth')
|
|
91
|
-
|
|
92
|
-
checkFuses(fuses, [
|
|
93
|
-
'CANNOT_UNWRAP',
|
|
94
|
-
'PARENT_CANNOT_CONTROL',
|
|
95
|
-
'CANNOT_APPROVE',
|
|
96
|
-
])
|
|
97
|
-
})
|