@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,67 +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 getResolver from '../public/getResolver.js'
|
|
9
|
-
import getText from '../public/getTextRecord.js'
|
|
10
|
-
import setTextRecord from './setTextRecord.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 a text record to be set', async () => {
|
|
28
|
-
const tx = await setTextRecord(walletClient, {
|
|
29
|
-
name: 'test123.eth',
|
|
30
|
-
key: 'foo',
|
|
31
|
-
value: 'bar',
|
|
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 getText(publicClient, {
|
|
42
|
-
name: 'test123.eth',
|
|
43
|
-
key: 'foo',
|
|
44
|
-
})
|
|
45
|
-
expect(response).toBe('bar')
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('should allow a text record to be set to blank', async () => {
|
|
49
|
-
const tx = await setTextRecord(walletClient, {
|
|
50
|
-
name: 'test123.eth',
|
|
51
|
-
key: 'url',
|
|
52
|
-
value: null,
|
|
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 getText(publicClient, {
|
|
63
|
-
name: 'test123.eth',
|
|
64
|
-
key: 'url',
|
|
65
|
-
})
|
|
66
|
-
expect(response).toBeNull()
|
|
67
|
-
})
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import { getVersion } from '../../errors/error-utils.js'
|
|
3
|
-
import {
|
|
4
|
-
publicClient,
|
|
5
|
-
testClient,
|
|
6
|
-
waitForTransaction,
|
|
7
|
-
walletClient,
|
|
8
|
-
} from '../../tests/addTestContracts.js'
|
|
9
|
-
import getOwner from '../public/getOwner.js'
|
|
10
|
-
import transferName from './transferName.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 a transfer on the registry', async () => {
|
|
28
|
-
const tx = await transferName(walletClient, {
|
|
29
|
-
name: 'test.with-subnames.eth',
|
|
30
|
-
newOwnerAddress: accounts[1],
|
|
31
|
-
contract: 'registry',
|
|
32
|
-
account: accounts[2],
|
|
33
|
-
})
|
|
34
|
-
expect(tx).toBeTruthy()
|
|
35
|
-
const receipt = await waitForTransaction(tx)
|
|
36
|
-
expect(receipt.status).toBe('success')
|
|
37
|
-
|
|
38
|
-
const owner = await getOwner(publicClient, {
|
|
39
|
-
name: 'test.with-subnames.eth',
|
|
40
|
-
contract: 'registry',
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
expect(owner!.owner).toBe(accounts[1])
|
|
44
|
-
})
|
|
45
|
-
it('should allow a regular transfer on the registrar', async () => {
|
|
46
|
-
const tx = await transferName(walletClient, {
|
|
47
|
-
name: 'test123.eth',
|
|
48
|
-
newOwnerAddress: accounts[2],
|
|
49
|
-
contract: 'registrar',
|
|
50
|
-
account: accounts[1],
|
|
51
|
-
})
|
|
52
|
-
expect(tx).toBeTruthy()
|
|
53
|
-
const receipt = await waitForTransaction(tx)
|
|
54
|
-
expect(receipt.status).toBe('success')
|
|
55
|
-
|
|
56
|
-
const owner = await getOwner(publicClient, {
|
|
57
|
-
name: 'test123.eth',
|
|
58
|
-
contract: 'registrar',
|
|
59
|
-
})
|
|
60
|
-
expect(owner!.registrant).toBe(accounts[2])
|
|
61
|
-
})
|
|
62
|
-
it('should allow a reclaim on the registrar', async () => {
|
|
63
|
-
const changeRegistryOwnerTx = await transferName(walletClient, {
|
|
64
|
-
name: 'test123.eth',
|
|
65
|
-
newOwnerAddress: accounts[2],
|
|
66
|
-
contract: 'registry',
|
|
67
|
-
account: accounts[1],
|
|
68
|
-
})
|
|
69
|
-
expect(changeRegistryOwnerTx).toBeTruthy()
|
|
70
|
-
const changeRegistryOwnerReceipt = await waitForTransaction(
|
|
71
|
-
changeRegistryOwnerTx,
|
|
72
|
-
)
|
|
73
|
-
expect(changeRegistryOwnerReceipt.status).toBe('success')
|
|
74
|
-
|
|
75
|
-
const tx = await transferName(walletClient, {
|
|
76
|
-
name: 'test123.eth',
|
|
77
|
-
newOwnerAddress: accounts[1],
|
|
78
|
-
contract: 'registrar',
|
|
79
|
-
reclaim: true,
|
|
80
|
-
account: accounts[1],
|
|
81
|
-
})
|
|
82
|
-
expect(tx).toBeTruthy()
|
|
83
|
-
const receipt = await waitForTransaction(tx)
|
|
84
|
-
expect(receipt.status).toBe('success')
|
|
85
|
-
|
|
86
|
-
const owner = await getOwner(publicClient, {
|
|
87
|
-
name: 'test123.eth',
|
|
88
|
-
contract: 'registry',
|
|
89
|
-
})
|
|
90
|
-
expect(owner!.owner).toBe(accounts[1])
|
|
91
|
-
})
|
|
92
|
-
it('should allow a transfer on the namewrapper', async () => {
|
|
93
|
-
const tx = await transferName(walletClient, {
|
|
94
|
-
name: 'wrapped.eth',
|
|
95
|
-
newOwnerAddress: accounts[2],
|
|
96
|
-
contract: 'nameWrapper',
|
|
97
|
-
account: accounts[1],
|
|
98
|
-
})
|
|
99
|
-
expect(tx).toBeTruthy()
|
|
100
|
-
const receipt = await waitForTransaction(tx)
|
|
101
|
-
expect(receipt.status).toBe('success')
|
|
102
|
-
|
|
103
|
-
const owner = await getOwner(publicClient, {
|
|
104
|
-
name: 'wrapped.eth',
|
|
105
|
-
contract: 'nameWrapper',
|
|
106
|
-
})
|
|
107
|
-
expect(owner!.owner).toBe(accounts[2])
|
|
108
|
-
})
|
|
109
|
-
it('errors if unknown contract', async () => {
|
|
110
|
-
await expect(
|
|
111
|
-
transferName(walletClient, {
|
|
112
|
-
name: 'test123.eth',
|
|
113
|
-
newOwnerAddress: accounts[2],
|
|
114
|
-
contract: 'random' as any,
|
|
115
|
-
account: accounts[1],
|
|
116
|
-
}),
|
|
117
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
118
|
-
"Invalid contract type: random
|
|
119
|
-
|
|
120
|
-
- Supported contract types: registry, registrar, nameWrapper
|
|
121
|
-
|
|
122
|
-
Version: ${getVersion()}"
|
|
123
|
-
`)
|
|
124
|
-
})
|
|
125
|
-
it('errors when reclaim is specified and contract is not registrar', async () => {
|
|
126
|
-
await expect(
|
|
127
|
-
transferName(walletClient, {
|
|
128
|
-
name: 'test123.eth',
|
|
129
|
-
newOwnerAddress: accounts[2],
|
|
130
|
-
contract: 'registry',
|
|
131
|
-
reclaim: true,
|
|
132
|
-
account: accounts[1],
|
|
133
|
-
} as any),
|
|
134
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
135
|
-
"Additional parameter specified: reclaim
|
|
136
|
-
|
|
137
|
-
- Allowed parameters: name, newOwnerAddress, contract
|
|
138
|
-
|
|
139
|
-
Details: Can't reclaim a name from any contract other than the registrar
|
|
140
|
-
|
|
141
|
-
Version: ${getVersion()}"
|
|
142
|
-
`)
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
describe('subnames/asParent', () => {
|
|
146
|
-
it('allows transferring a subname on the registry', async () => {
|
|
147
|
-
const tx = await transferName(walletClient, {
|
|
148
|
-
name: 'test.with-subnames.eth',
|
|
149
|
-
contract: 'registry',
|
|
150
|
-
newOwnerAddress: accounts[1],
|
|
151
|
-
asParent: true,
|
|
152
|
-
account: accounts[1],
|
|
153
|
-
})
|
|
154
|
-
expect(tx).toBeTruthy()
|
|
155
|
-
const receipt = await waitForTransaction(tx)
|
|
156
|
-
expect(receipt.status).toBe('success')
|
|
157
|
-
|
|
158
|
-
const owner = await getOwner(publicClient, {
|
|
159
|
-
name: 'test.with-subnames.eth',
|
|
160
|
-
contract: 'registry',
|
|
161
|
-
})
|
|
162
|
-
expect(owner!.owner).toBe(accounts[1])
|
|
163
|
-
})
|
|
164
|
-
it('allows transferring a subname on the namewrapper', async () => {
|
|
165
|
-
const tx = await transferName(walletClient, {
|
|
166
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
167
|
-
contract: 'nameWrapper',
|
|
168
|
-
newOwnerAddress: accounts[1],
|
|
169
|
-
asParent: true,
|
|
170
|
-
account: accounts[1],
|
|
171
|
-
})
|
|
172
|
-
expect(tx).toBeTruthy()
|
|
173
|
-
const receipt = await waitForTransaction(tx)
|
|
174
|
-
expect(receipt.status).toBe('success')
|
|
175
|
-
|
|
176
|
-
const owner = await getOwner(publicClient, {
|
|
177
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
178
|
-
contract: 'nameWrapper',
|
|
179
|
-
})
|
|
180
|
-
expect(owner!.owner).toBe(accounts[1])
|
|
181
|
-
})
|
|
182
|
-
it('erorrs when asParent is specified and contract is registrar', async () => {
|
|
183
|
-
await expect(
|
|
184
|
-
transferName(walletClient, {
|
|
185
|
-
name: 'test123.eth',
|
|
186
|
-
newOwnerAddress: accounts[2],
|
|
187
|
-
contract: 'registrar',
|
|
188
|
-
asParent: true,
|
|
189
|
-
account: accounts[1],
|
|
190
|
-
} as any),
|
|
191
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
192
|
-
"Additional parameter specified: asParent
|
|
193
|
-
|
|
194
|
-
- Allowed parameters: name, newOwnerAddress, contract, reclaim
|
|
195
|
-
|
|
196
|
-
Details: Can't transfer a name as the parent owner on the registrar
|
|
197
|
-
|
|
198
|
-
Version: ${getVersion()}"
|
|
199
|
-
`)
|
|
200
|
-
})
|
|
201
|
-
})
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import { getVersion } from '../../errors/error-utils.js'
|
|
3
|
-
import {
|
|
4
|
-
publicClient,
|
|
5
|
-
testClient,
|
|
6
|
-
waitForTransaction,
|
|
7
|
-
walletClient,
|
|
8
|
-
} from '../../tests/addTestContracts.js'
|
|
9
|
-
import getOwner from '../public/getOwner.js'
|
|
10
|
-
import unwrapName from './unwrapName.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 return a .eth unwrap name transaction and succeed', async () => {
|
|
28
|
-
const tx = await unwrapName(walletClient, {
|
|
29
|
-
name: 'wrapped.eth',
|
|
30
|
-
newOwnerAddress: accounts[1],
|
|
31
|
-
newRegistrantAddress: accounts[1],
|
|
32
|
-
account: accounts[1],
|
|
33
|
-
})
|
|
34
|
-
expect(tx).toBeTruthy()
|
|
35
|
-
const receipt = await waitForTransaction(tx)
|
|
36
|
-
expect(receipt.status).toBe('success')
|
|
37
|
-
|
|
38
|
-
const owner = await getOwner(publicClient, {
|
|
39
|
-
name: 'wrapped.eth',
|
|
40
|
-
})
|
|
41
|
-
expect(owner!.owner).toBe(accounts[1])
|
|
42
|
-
expect(owner!.registrant).toBe(accounts[1])
|
|
43
|
-
expect(owner!.ownershipLevel).toBe('registrar')
|
|
44
|
-
})
|
|
45
|
-
it('should return a regular unwrap name transaction and succeed', async () => {
|
|
46
|
-
const tx = await unwrapName(walletClient, {
|
|
47
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
48
|
-
newOwnerAddress: accounts[1],
|
|
49
|
-
account: accounts[2],
|
|
50
|
-
})
|
|
51
|
-
expect(tx).toBeTruthy()
|
|
52
|
-
const receipt = await waitForTransaction(tx)
|
|
53
|
-
expect(receipt.status).toBe('success')
|
|
54
|
-
|
|
55
|
-
const owner = await getOwner(publicClient, {
|
|
56
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
57
|
-
})
|
|
58
|
-
expect(owner!.owner).toBe(accounts[1])
|
|
59
|
-
expect(owner!.ownershipLevel).toBe('registry')
|
|
60
|
-
})
|
|
61
|
-
it('should error if newRegistrantAddress is not specified for .eth', async () => {
|
|
62
|
-
await expect(
|
|
63
|
-
unwrapName(walletClient, {
|
|
64
|
-
name: 'wrapped.eth',
|
|
65
|
-
newOwnerAddress: accounts[1],
|
|
66
|
-
account: accounts[1],
|
|
67
|
-
} as any),
|
|
68
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
69
|
-
"Required parameter not specified: newRegistrantAddress
|
|
70
|
-
|
|
71
|
-
Details: Must provide newRegistrantAddress for eth-2ld names
|
|
72
|
-
|
|
73
|
-
Version: ${getVersion()}"
|
|
74
|
-
`)
|
|
75
|
-
})
|
|
76
|
-
it('should error if newRegistrantAddress is specified for non .eth', async () => {
|
|
77
|
-
await expect(
|
|
78
|
-
unwrapName(walletClient, {
|
|
79
|
-
name: 'test.wrapped-with-subnames.eth',
|
|
80
|
-
newOwnerAddress: accounts[1],
|
|
81
|
-
newRegistrantAddress: accounts[1],
|
|
82
|
-
account: accounts[2],
|
|
83
|
-
} as any),
|
|
84
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
85
|
-
"Additional parameter specified: newRegistrantAddress
|
|
86
|
-
|
|
87
|
-
- Allowed parameters: name, newOwnerAddress
|
|
88
|
-
|
|
89
|
-
Details: newRegistrantAddress can only be specified for eth-2ld names
|
|
90
|
-
|
|
91
|
-
Version: ${getVersion()}"
|
|
92
|
-
`)
|
|
93
|
-
})
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem'
|
|
2
|
-
import { getChainContractAddress } from '../../contracts/getChainContractAddress.js'
|
|
3
|
-
import { registrySetApprovalForAllSnippet } from '../../contracts/registry.js'
|
|
4
|
-
import { getVersion } from '../../errors/error-utils.js'
|
|
5
|
-
import {
|
|
6
|
-
publicClient,
|
|
7
|
-
testClient,
|
|
8
|
-
waitForTransaction,
|
|
9
|
-
walletClient,
|
|
10
|
-
} from '../../tests/addTestContracts.js'
|
|
11
|
-
import getOwner from '../public/getOwner.js'
|
|
12
|
-
import getResolver from '../public/getResolver.js'
|
|
13
|
-
import getWrapperData from '../public/getWrapperData.js'
|
|
14
|
-
import wrapName from './wrapName.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 approve = async () => {
|
|
32
|
-
return walletClient.writeContract({
|
|
33
|
-
abi: registrySetApprovalForAllSnippet,
|
|
34
|
-
address: getChainContractAddress({
|
|
35
|
-
client: walletClient,
|
|
36
|
-
contract: 'ensRegistry',
|
|
37
|
-
}),
|
|
38
|
-
functionName: 'setApprovalForAll',
|
|
39
|
-
args: [
|
|
40
|
-
getChainContractAddress({
|
|
41
|
-
client: walletClient,
|
|
42
|
-
contract: 'ensNameWrapper',
|
|
43
|
-
}),
|
|
44
|
-
true,
|
|
45
|
-
],
|
|
46
|
-
account: accounts[2],
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
describe('eth 2ld', () => {
|
|
51
|
-
it('should return a wrap name transaction and succeed', async () => {
|
|
52
|
-
const tx = await wrapName(walletClient, {
|
|
53
|
-
name: 'test123.eth',
|
|
54
|
-
newOwnerAddress: accounts[2],
|
|
55
|
-
account: accounts[1],
|
|
56
|
-
})
|
|
57
|
-
expect(tx).toBeTruthy()
|
|
58
|
-
const receipt = await waitForTransaction(tx)
|
|
59
|
-
expect(receipt.status).toBe('success')
|
|
60
|
-
|
|
61
|
-
const owner = await getOwner(publicClient, {
|
|
62
|
-
name: 'test123.eth',
|
|
63
|
-
})
|
|
64
|
-
expect(owner!.owner).toBe(accounts[2])
|
|
65
|
-
expect(owner!.ownershipLevel).toBe('nameWrapper')
|
|
66
|
-
})
|
|
67
|
-
it('should allow initial fuses', async () => {
|
|
68
|
-
const tx = await wrapName(walletClient, {
|
|
69
|
-
name: 'test123.eth',
|
|
70
|
-
newOwnerAddress: accounts[2],
|
|
71
|
-
fuses: {
|
|
72
|
-
named: ['CANNOT_UNWRAP', 'CANNOT_SET_TTL'],
|
|
73
|
-
},
|
|
74
|
-
account: accounts[1],
|
|
75
|
-
})
|
|
76
|
-
expect(tx).toBeTruthy()
|
|
77
|
-
const receipt = await waitForTransaction(tx)
|
|
78
|
-
expect(receipt.status).toBe('success')
|
|
79
|
-
|
|
80
|
-
const wrapperData = await getWrapperData(publicClient, {
|
|
81
|
-
name: 'test123.eth',
|
|
82
|
-
})
|
|
83
|
-
expect(wrapperData!.fuses.value).toBe(196625)
|
|
84
|
-
})
|
|
85
|
-
it('should allow a non-default resolver address', async () => {
|
|
86
|
-
const tx = await wrapName(walletClient, {
|
|
87
|
-
name: 'test123.eth',
|
|
88
|
-
newOwnerAddress: accounts[2],
|
|
89
|
-
resolverAddress: '0x42D63ae25990889E35F215bC95884039Ba354115',
|
|
90
|
-
account: accounts[1],
|
|
91
|
-
})
|
|
92
|
-
expect(tx).toBeTruthy()
|
|
93
|
-
const receipt = await waitForTransaction(tx)
|
|
94
|
-
expect(receipt.status).toBe('success')
|
|
95
|
-
|
|
96
|
-
const resolver = await getResolver(publicClient, {
|
|
97
|
-
name: 'test123.eth',
|
|
98
|
-
})
|
|
99
|
-
expect(resolver).toBe('0x42D63ae25990889E35F215bC95884039Ba354115')
|
|
100
|
-
})
|
|
101
|
-
it('should error for labels longer than 255 bytes', async () => {
|
|
102
|
-
const label = 'a'.repeat(256)
|
|
103
|
-
await expect(
|
|
104
|
-
wrapName(walletClient, {
|
|
105
|
-
name: `${label}.eth`,
|
|
106
|
-
newOwnerAddress: accounts[2],
|
|
107
|
-
account: accounts[1],
|
|
108
|
-
}),
|
|
109
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
110
|
-
"Supplied label was too long
|
|
111
|
-
|
|
112
|
-
- Supplied label: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
113
|
-
- Max byte length: 255
|
|
114
|
-
- Actual byte length: 256
|
|
115
|
-
|
|
116
|
-
Version: ${getVersion()}"
|
|
117
|
-
`)
|
|
118
|
-
})
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
describe('other', () => {
|
|
122
|
-
beforeEach(async () => {
|
|
123
|
-
await approve()
|
|
124
|
-
})
|
|
125
|
-
it('should return a wrap name transaction and succeed', async () => {
|
|
126
|
-
const tx = await wrapName(walletClient, {
|
|
127
|
-
name: 'test.with-subnames.eth',
|
|
128
|
-
newOwnerAddress: accounts[2],
|
|
129
|
-
account: accounts[2],
|
|
130
|
-
})
|
|
131
|
-
expect(tx).toBeTruthy()
|
|
132
|
-
const receipt = await waitForTransaction(tx)
|
|
133
|
-
expect(receipt.status).toBe('success')
|
|
134
|
-
|
|
135
|
-
const owner = await getOwner(publicClient, {
|
|
136
|
-
name: 'test.with-subnames.eth',
|
|
137
|
-
})
|
|
138
|
-
expect(owner!.owner).toBe(accounts[2])
|
|
139
|
-
expect(owner!.ownershipLevel).toBe('nameWrapper')
|
|
140
|
-
})
|
|
141
|
-
it('should allow a non-default resolver address', async () => {
|
|
142
|
-
const tx = await wrapName(walletClient, {
|
|
143
|
-
name: 'test.with-subnames.eth',
|
|
144
|
-
newOwnerAddress: accounts[2],
|
|
145
|
-
resolverAddress: '0x42D63ae25990889E35F215bC95884039Ba354115',
|
|
146
|
-
account: accounts[2],
|
|
147
|
-
})
|
|
148
|
-
expect(tx).toBeTruthy()
|
|
149
|
-
const receipt = await waitForTransaction(tx)
|
|
150
|
-
expect(receipt.status).toBe('success')
|
|
151
|
-
|
|
152
|
-
const resolver = await getResolver(publicClient, {
|
|
153
|
-
name: 'test.with-subnames.eth',
|
|
154
|
-
})
|
|
155
|
-
expect(resolver).toBe('0x42D63ae25990889E35F215bC95884039Ba354115')
|
|
156
|
-
})
|
|
157
|
-
it('should error if initial fuses are provided', async () => {
|
|
158
|
-
await expect(
|
|
159
|
-
wrapName(walletClient, {
|
|
160
|
-
name: 'test.with-subnames.eth',
|
|
161
|
-
newOwnerAddress: accounts[2],
|
|
162
|
-
fuses: {
|
|
163
|
-
named: ['CANNOT_UNWRAP', 'CANNOT_SET_TTL'],
|
|
164
|
-
} as any,
|
|
165
|
-
account: accounts[2],
|
|
166
|
-
}),
|
|
167
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
168
|
-
"Additional parameter specified: fuses
|
|
169
|
-
|
|
170
|
-
- Allowed parameters: name, wrappedOwner, resolverAddress
|
|
171
|
-
|
|
172
|
-
Details: Fuses cannot be initially set when wrapping non eth-2ld names
|
|
173
|
-
|
|
174
|
-
Version: ${getVersion()}"
|
|
175
|
-
`)
|
|
176
|
-
})
|
|
177
|
-
it('should error for a label longer than 255 bytes', async () => {
|
|
178
|
-
const label = 'a'.repeat(256)
|
|
179
|
-
await expect(
|
|
180
|
-
wrapName(walletClient, {
|
|
181
|
-
name: `${label}.with-subnames.eth`,
|
|
182
|
-
newOwnerAddress: accounts[2],
|
|
183
|
-
account: accounts[2],
|
|
184
|
-
}),
|
|
185
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
186
|
-
"Supplied label was too long
|
|
187
|
-
|
|
188
|
-
- Supplied label: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
189
|
-
- Max byte length: 255
|
|
190
|
-
- Actual byte length: 256
|
|
191
|
-
|
|
192
|
-
Version: ${getVersion()}"
|
|
193
|
-
`)
|
|
194
|
-
})
|
|
195
|
-
})
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { generateRecordCallArray } from './generateRecordCallArray.js'
|
|
2
|
-
import { namehash } from './normalise.js'
|
|
3
|
-
|
|
4
|
-
it('generates a record call array', () => {
|
|
5
|
-
expect(
|
|
6
|
-
generateRecordCallArray({
|
|
7
|
-
namehash: namehash('test.eth'),
|
|
8
|
-
clearRecords: true,
|
|
9
|
-
coins: [
|
|
10
|
-
{ coin: 'ETH', value: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' },
|
|
11
|
-
],
|
|
12
|
-
|
|
13
|
-
texts: [{ key: 'email', value: 'test@example.com' }],
|
|
14
|
-
}),
|
|
15
|
-
).toMatchInlineSnapshot(`
|
|
16
|
-
[
|
|
17
|
-
"0x3603d758eb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f1",
|
|
18
|
-
"0x10f13a8ceb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000005656d61696c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001074657374406578616d706c652e636f6d00000000000000000000000000000000",
|
|
19
|
-
"0x8b95dd71eb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f1000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000014f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000",
|
|
20
|
-
]
|
|
21
|
-
`)
|
|
22
|
-
})
|
|
23
|
-
it('adds clearRecords call when clearRecords is true', () => {
|
|
24
|
-
expect(
|
|
25
|
-
generateRecordCallArray({
|
|
26
|
-
namehash: namehash('test.eth'),
|
|
27
|
-
clearRecords: true,
|
|
28
|
-
}),
|
|
29
|
-
).toMatchInlineSnapshot(`
|
|
30
|
-
[
|
|
31
|
-
"0x3603d758eb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f1",
|
|
32
|
-
]
|
|
33
|
-
`)
|
|
34
|
-
})
|
|
35
|
-
it('adds contentHash call when contentHash is defined', () => {
|
|
36
|
-
expect(
|
|
37
|
-
generateRecordCallArray({
|
|
38
|
-
namehash: namehash('test.eth'),
|
|
39
|
-
contentHash: 'ipfs://Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio',
|
|
40
|
-
}),
|
|
41
|
-
).toMatchInlineSnapshot(`
|
|
42
|
-
[
|
|
43
|
-
"0x304e6adeeb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000026e30101701220af4147b366bee9eb9a21a9c2d5ccdde35fa4b8d2e0d44854fc81aeb894e8ce280000000000000000000000000000000000000000000000000000",
|
|
44
|
-
]
|
|
45
|
-
`)
|
|
46
|
-
})
|
|
47
|
-
it('adds abi call when abi is defined', () => {
|
|
48
|
-
expect(
|
|
49
|
-
generateRecordCallArray({
|
|
50
|
-
namehash: namehash('test.eth'),
|
|
51
|
-
abi: { contentType: 0, encodedData: '0x' },
|
|
52
|
-
}),
|
|
53
|
-
).toMatchInlineSnapshot(`
|
|
54
|
-
[
|
|
55
|
-
"0x623195b0eb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
|
|
56
|
-
]
|
|
57
|
-
`)
|
|
58
|
-
})
|
|
59
|
-
it('adds text calls when texts array is defined and not empty', () => {
|
|
60
|
-
expect(
|
|
61
|
-
generateRecordCallArray({
|
|
62
|
-
namehash: namehash('test.eth'),
|
|
63
|
-
texts: [{ key: 'email', value: 'cool' }],
|
|
64
|
-
}),
|
|
65
|
-
).toMatchInlineSnapshot(`
|
|
66
|
-
[
|
|
67
|
-
"0x10f13a8ceb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000005656d61696c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004636f6f6c00000000000000000000000000000000000000000000000000000000",
|
|
68
|
-
]
|
|
69
|
-
`)
|
|
70
|
-
})
|
|
71
|
-
it('adds coin calls when coins array is defined and not empty', () => {
|
|
72
|
-
expect(
|
|
73
|
-
generateRecordCallArray({
|
|
74
|
-
namehash: namehash('test.eth'),
|
|
75
|
-
coins: [
|
|
76
|
-
{ coin: 'ETH', value: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' },
|
|
77
|
-
],
|
|
78
|
-
}),
|
|
79
|
-
).toMatchInlineSnapshot(`
|
|
80
|
-
[
|
|
81
|
-
"0x8b95dd71eb4f647bea6caa36333c816d7b46fdcb05f9466ecacc140ea8c66faf15b3d9f1000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000014f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000",
|
|
82
|
-
]
|
|
83
|
-
`)
|
|
84
|
-
})
|