@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,69 +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 getContentHashRecord from '../public/getContentHashRecord.js'
|
|
9
|
-
import getResolver from '../public/getResolver.js'
|
|
10
|
-
import setContentHashRecord from './setContentHashRecord.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 contenthash record to be set', async () => {
|
|
28
|
-
const tx = await setContentHashRecord(walletClient, {
|
|
29
|
-
name: 'test123.eth',
|
|
30
|
-
contentHash:
|
|
31
|
-
'ipns://k51qzi5uqu5dgox2z23r6e99oqency055a6xt92xzmyvpz8mwz5ycjavm0u150',
|
|
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 getContentHashRecord(publicClient, {
|
|
42
|
-
name: 'test123.eth',
|
|
43
|
-
})
|
|
44
|
-
expect(response).toMatchInlineSnapshot(`
|
|
45
|
-
{
|
|
46
|
-
"decoded": "k51qzi5uqu5dgox2z23r6e99oqency055a6xt92xzmyvpz8mwz5ycjavm0u150",
|
|
47
|
-
"protocolType": "ipns",
|
|
48
|
-
}
|
|
49
|
-
`)
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
it('should allow a contenthash record to be set to blank', async () => {
|
|
53
|
-
const tx = await setContentHashRecord(walletClient, {
|
|
54
|
-
name: 'with-contenthash.eth',
|
|
55
|
-
contentHash: null,
|
|
56
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
57
|
-
name: 'test123.eth',
|
|
58
|
-
}))!,
|
|
59
|
-
account: accounts[1],
|
|
60
|
-
})
|
|
61
|
-
expect(tx).toBeTruthy()
|
|
62
|
-
const receipt = await waitForTransaction(tx)
|
|
63
|
-
expect(receipt.status).toBe('success')
|
|
64
|
-
|
|
65
|
-
const response = await getContentHashRecord(publicClient, {
|
|
66
|
-
name: 'test123.eth',
|
|
67
|
-
})
|
|
68
|
-
expect(response).toBeNull()
|
|
69
|
-
})
|
|
@@ -1,287 +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 { getVersion } from '../../errors/error-utils.js'
|
|
5
|
-
import {
|
|
6
|
-
publicClient,
|
|
7
|
-
testClient,
|
|
8
|
-
waitForTransaction,
|
|
9
|
-
walletClient,
|
|
10
|
-
} from '../../tests/addTestContracts.js'
|
|
11
|
-
import {
|
|
12
|
-
unnamedUserSettableFuses,
|
|
13
|
-
userSettableFuseEnum,
|
|
14
|
-
} from '../../utils/fuses.js'
|
|
15
|
-
import { namehash } from '../../utils/normalise.js'
|
|
16
|
-
import setFuses from './setFuses.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 checkFuses = (
|
|
34
|
-
fuses: number,
|
|
35
|
-
expected: (keyof typeof userSettableFuseEnum)[],
|
|
36
|
-
) => {
|
|
37
|
-
// eslint-disable-next-line guard-for-in
|
|
38
|
-
for (const fuse in userSettableFuseEnum) {
|
|
39
|
-
const active =
|
|
40
|
-
(fuses &
|
|
41
|
-
userSettableFuseEnum[fuse as keyof typeof userSettableFuseEnum]) >
|
|
42
|
-
0
|
|
43
|
-
if (expected.includes(fuse as keyof typeof userSettableFuseEnum)) {
|
|
44
|
-
try {
|
|
45
|
-
expect(active).toBeTruthy()
|
|
46
|
-
} catch {
|
|
47
|
-
throw new Error(`${fuse} should be true but is false`)
|
|
48
|
-
}
|
|
49
|
-
} else if (active) {
|
|
50
|
-
try {
|
|
51
|
-
expect(active).toBeFalsy()
|
|
52
|
-
} catch {
|
|
53
|
-
throw new Error(`${fuse} should be false but is true`)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const checkUnnamedFuses = (
|
|
60
|
-
fuses: number,
|
|
61
|
-
expected: (keyof typeof unnamedUserSettableFuses)[],
|
|
62
|
-
) => {
|
|
63
|
-
// eslint-disable-next-line guard-for-in
|
|
64
|
-
for (const fuse of unnamedUserSettableFuses) {
|
|
65
|
-
const active = (fuses & fuse) > 0
|
|
66
|
-
if (expected.includes(fuse as keyof typeof unnamedUserSettableFuses)) {
|
|
67
|
-
try {
|
|
68
|
-
expect(active).toBeTruthy()
|
|
69
|
-
} catch {
|
|
70
|
-
throw new Error(`${fuse} should be true but is false`)
|
|
71
|
-
}
|
|
72
|
-
} else if (active) {
|
|
73
|
-
try {
|
|
74
|
-
expect(active).toBeFalsy()
|
|
75
|
-
} catch {
|
|
76
|
-
throw new Error(`${fuse} should be false but is true`)
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const getFuses = async (name: string) => {
|
|
83
|
-
const [, fuses] = await publicClient.readContract({
|
|
84
|
-
abi: nameWrapperGetDataSnippet,
|
|
85
|
-
address: getChainContractAddress({
|
|
86
|
-
client: publicClient,
|
|
87
|
-
contract: 'ensNameWrapper',
|
|
88
|
-
}),
|
|
89
|
-
functionName: 'getData',
|
|
90
|
-
args: [BigInt(namehash(name))],
|
|
91
|
-
})
|
|
92
|
-
return fuses
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
describe('Array', () => {
|
|
96
|
-
it('should return a setFuses transaction from a named fuse array and succeed', async () => {
|
|
97
|
-
const tx = await setFuses(walletClient, {
|
|
98
|
-
name: 'wrapped.eth',
|
|
99
|
-
fuses: {
|
|
100
|
-
named: [
|
|
101
|
-
'CANNOT_UNWRAP',
|
|
102
|
-
'CANNOT_CREATE_SUBDOMAIN',
|
|
103
|
-
'CANNOT_SET_TTL',
|
|
104
|
-
'CANNOT_APPROVE',
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
account: accounts[1],
|
|
108
|
-
})
|
|
109
|
-
const receipt = await waitForTransaction(tx)
|
|
110
|
-
expect(receipt.status).toBe('success')
|
|
111
|
-
|
|
112
|
-
const fuses = await getFuses('wrapped.eth')
|
|
113
|
-
checkFuses(fuses, [
|
|
114
|
-
'CANNOT_UNWRAP',
|
|
115
|
-
'CANNOT_CREATE_SUBDOMAIN',
|
|
116
|
-
'CANNOT_SET_TTL',
|
|
117
|
-
'PARENT_CANNOT_CONTROL',
|
|
118
|
-
'CANNOT_APPROVE',
|
|
119
|
-
])
|
|
120
|
-
})
|
|
121
|
-
it('should return a setFuses transaction from an unnamed fuse array and succeed', async () => {
|
|
122
|
-
const tx0 = await setFuses(walletClient, {
|
|
123
|
-
name: 'wrapped.eth',
|
|
124
|
-
fuses: {
|
|
125
|
-
named: ['CANNOT_UNWRAP'],
|
|
126
|
-
},
|
|
127
|
-
account: accounts[1],
|
|
128
|
-
})
|
|
129
|
-
const tx0Receipt = await waitForTransaction(tx0)
|
|
130
|
-
expect(tx0Receipt.status).toBe('success')
|
|
131
|
-
|
|
132
|
-
const tx = await setFuses(walletClient, {
|
|
133
|
-
name: 'wrapped.eth',
|
|
134
|
-
fuses: {
|
|
135
|
-
unnamed: [128, 256, 512],
|
|
136
|
-
},
|
|
137
|
-
account: accounts[1],
|
|
138
|
-
})
|
|
139
|
-
const receipt = await waitForTransaction(tx)
|
|
140
|
-
expect(receipt.status).toBe('success')
|
|
141
|
-
|
|
142
|
-
const fuses = await getFuses('wrapped.eth')
|
|
143
|
-
checkUnnamedFuses(fuses, [128, 256, 512])
|
|
144
|
-
})
|
|
145
|
-
it('should return a setFuses transaction from both an unnamed and named fuse array and succeed', async () => {
|
|
146
|
-
const tx = await setFuses(walletClient, {
|
|
147
|
-
name: 'wrapped.eth',
|
|
148
|
-
fuses: {
|
|
149
|
-
named: [
|
|
150
|
-
'CANNOT_UNWRAP',
|
|
151
|
-
'CANNOT_CREATE_SUBDOMAIN',
|
|
152
|
-
'CANNOT_SET_TTL',
|
|
153
|
-
'CANNOT_APPROVE',
|
|
154
|
-
],
|
|
155
|
-
unnamed: [128, 256, 512],
|
|
156
|
-
},
|
|
157
|
-
account: accounts[1],
|
|
158
|
-
})
|
|
159
|
-
const receipt = await waitForTransaction(tx)
|
|
160
|
-
expect(receipt.status).toBe('success')
|
|
161
|
-
|
|
162
|
-
const fuses = await getFuses('wrapped.eth')
|
|
163
|
-
checkFuses(fuses, [
|
|
164
|
-
'CANNOT_UNWRAP',
|
|
165
|
-
'CANNOT_CREATE_SUBDOMAIN',
|
|
166
|
-
'CANNOT_SET_TTL',
|
|
167
|
-
'PARENT_CANNOT_CONTROL',
|
|
168
|
-
'CANNOT_APPROVE',
|
|
169
|
-
])
|
|
170
|
-
checkUnnamedFuses(fuses, [128, 256, 512])
|
|
171
|
-
})
|
|
172
|
-
it('should throw an error when trying to burn a named fuse in an unnamed fuse array', async () => {
|
|
173
|
-
await expect(
|
|
174
|
-
setFuses(walletClient, {
|
|
175
|
-
name: 'wrapped.eth',
|
|
176
|
-
fuses: {
|
|
177
|
-
unnamed: [32] as any,
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
account: accounts[1],
|
|
181
|
-
}),
|
|
182
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
183
|
-
"32 is not a valid unnamed fuse
|
|
184
|
-
|
|
185
|
-
- If you are trying to set a named fuse, use the named property
|
|
186
|
-
|
|
187
|
-
Version: ${getVersion()}"
|
|
188
|
-
`)
|
|
189
|
-
})
|
|
190
|
-
it('should throw an error when trying to burn an unnamed fuse in a named fuse array', async () => {
|
|
191
|
-
await expect(
|
|
192
|
-
setFuses(walletClient, {
|
|
193
|
-
name: 'wrapped.eth',
|
|
194
|
-
fuses: {
|
|
195
|
-
named: ['COOL_SWAG_FUSE'] as any,
|
|
196
|
-
},
|
|
197
|
-
}),
|
|
198
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
199
|
-
"COOL_SWAG_FUSE is not a valid named fuse
|
|
200
|
-
|
|
201
|
-
Version: ${getVersion()}"
|
|
202
|
-
`)
|
|
203
|
-
})
|
|
204
|
-
})
|
|
205
|
-
describe('Number', () => {
|
|
206
|
-
it('should return a setFuses transaction from a number and succeed', async () => {
|
|
207
|
-
const tx = await setFuses(walletClient, {
|
|
208
|
-
name: 'wrapped.eth',
|
|
209
|
-
fuses: {
|
|
210
|
-
number: 113,
|
|
211
|
-
},
|
|
212
|
-
account: accounts[1],
|
|
213
|
-
})
|
|
214
|
-
expect(tx).toBeTruthy()
|
|
215
|
-
const receipt = await waitForTransaction(tx)
|
|
216
|
-
expect(receipt.status).toBe('success')
|
|
217
|
-
|
|
218
|
-
const fuses = await getFuses('wrapped.eth')
|
|
219
|
-
checkFuses(fuses, [
|
|
220
|
-
'CANNOT_UNWRAP',
|
|
221
|
-
'CANNOT_CREATE_SUBDOMAIN',
|
|
222
|
-
'CANNOT_SET_TTL',
|
|
223
|
-
'CANNOT_APPROVE',
|
|
224
|
-
'PARENT_CANNOT_CONTROL',
|
|
225
|
-
])
|
|
226
|
-
})
|
|
227
|
-
it('should throw an error if the number is too high', async () => {
|
|
228
|
-
await expect(
|
|
229
|
-
setFuses(walletClient, {
|
|
230
|
-
name: 'wrapped.eth',
|
|
231
|
-
fuses: {
|
|
232
|
-
number: 4294967297,
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
account: accounts[1],
|
|
236
|
-
}),
|
|
237
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
238
|
-
"Fuse value out of range
|
|
239
|
-
|
|
240
|
-
- Fuse value: 4294967297
|
|
241
|
-
- Allowed range: 1-4294967296
|
|
242
|
-
|
|
243
|
-
Details: Fuse number must be limited to uint32, the supplied value was too high
|
|
244
|
-
|
|
245
|
-
Version: ${getVersion()}"
|
|
246
|
-
`)
|
|
247
|
-
})
|
|
248
|
-
it('should throw an error if the number is too low', async () => {
|
|
249
|
-
await expect(
|
|
250
|
-
setFuses(walletClient, {
|
|
251
|
-
name: 'wrapped.eth',
|
|
252
|
-
fuses: {
|
|
253
|
-
number: -1,
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
account: accounts[1],
|
|
257
|
-
}),
|
|
258
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
259
|
-
"Fuse value out of range
|
|
260
|
-
|
|
261
|
-
- Fuse value: -1
|
|
262
|
-
- Allowed range: 1-4294967296
|
|
263
|
-
|
|
264
|
-
Details: Fuse number must be limited to uint32, the supplied value was too low
|
|
265
|
-
|
|
266
|
-
Version: ${getVersion()}"
|
|
267
|
-
`)
|
|
268
|
-
})
|
|
269
|
-
it('should throw an error if the number is not an integer', async () => {
|
|
270
|
-
await expect(
|
|
271
|
-
setFuses(walletClient, {
|
|
272
|
-
name: 'wrapped.eth',
|
|
273
|
-
fuses: {
|
|
274
|
-
number: 7.5,
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
account: accounts[1],
|
|
278
|
-
}),
|
|
279
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
280
|
-
"Fuse was not an integer, which is required
|
|
281
|
-
|
|
282
|
-
- Fuse value: 7.5
|
|
283
|
-
|
|
284
|
-
Version: ${getVersion()}"
|
|
285
|
-
`)
|
|
286
|
-
})
|
|
287
|
-
})
|
|
@@ -1,71 +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 {
|
|
5
|
-
publicClient,
|
|
6
|
-
testClient,
|
|
7
|
-
waitForTransaction,
|
|
8
|
-
walletClient,
|
|
9
|
-
} from '../../tests/addTestContracts.js'
|
|
10
|
-
import getName from '../public/getName.js'
|
|
11
|
-
import setPrimaryName from './setPrimaryName.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
|
-
it('should return a transaction for a name and set successfully', async () => {
|
|
29
|
-
const tx = await setPrimaryName(walletClient, {
|
|
30
|
-
name: 'test123.eth',
|
|
31
|
-
account: accounts[1],
|
|
32
|
-
})
|
|
33
|
-
expect(tx).toBeTruthy()
|
|
34
|
-
const receipt = await waitForTransaction(tx)
|
|
35
|
-
expect(receipt.status).toBe('success')
|
|
36
|
-
|
|
37
|
-
const resolvedName = await getName(publicClient, {
|
|
38
|
-
address: accounts[1],
|
|
39
|
-
})
|
|
40
|
-
expect(resolvedName!.name).toBe('test123.eth')
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it("should return a transaction for setting another address' name and succeed", async () => {
|
|
44
|
-
const setApprovedForAllTx = await walletClient.writeContract({
|
|
45
|
-
abi: registrySetApprovalForAllSnippet,
|
|
46
|
-
functionName: 'setApprovalForAll',
|
|
47
|
-
address: getChainContractAddress({
|
|
48
|
-
client: walletClient,
|
|
49
|
-
contract: 'ensRegistry',
|
|
50
|
-
}),
|
|
51
|
-
args: [accounts[2], true],
|
|
52
|
-
account: accounts[1],
|
|
53
|
-
})
|
|
54
|
-
expect(setApprovedForAllTx).toBeTruthy()
|
|
55
|
-
const setApprovedForAllReceipt = await waitForTransaction(setApprovedForAllTx)
|
|
56
|
-
expect(setApprovedForAllReceipt.status).toBe('success')
|
|
57
|
-
|
|
58
|
-
const tx = await setPrimaryName(walletClient, {
|
|
59
|
-
name: 'test123.eth',
|
|
60
|
-
address: accounts[1],
|
|
61
|
-
account: accounts[2],
|
|
62
|
-
})
|
|
63
|
-
expect(tx).toBeTruthy()
|
|
64
|
-
const receipt = await waitForTransaction(tx)
|
|
65
|
-
expect(receipt.status).toBe('success')
|
|
66
|
-
|
|
67
|
-
const resolvedName = await getName(publicClient, {
|
|
68
|
-
address: accounts[1],
|
|
69
|
-
})
|
|
70
|
-
expect(resolvedName!.name).toBe('test123.eth')
|
|
71
|
-
})
|
|
@@ -1,127 +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 { encodeAbi } from '../../utils/encoders/encodeAbi.js'
|
|
10
|
-
import getRecords from '../public/getRecords.js'
|
|
11
|
-
import getResolver from '../public/getResolver.js'
|
|
12
|
-
import setRecords from './setRecords.js'
|
|
13
|
-
|
|
14
|
-
let snapshot: Hex
|
|
15
|
-
let accounts: Address[]
|
|
16
|
-
|
|
17
|
-
beforeAll(async () => {
|
|
18
|
-
accounts = await walletClient.getAddresses()
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
beforeEach(async () => {
|
|
22
|
-
snapshot = await testClient.snapshot()
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
afterEach(async () => {
|
|
26
|
-
await testClient.revert({ id: snapshot })
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const dummyABI = [
|
|
30
|
-
{
|
|
31
|
-
type: 'function',
|
|
32
|
-
name: 'supportsInterface',
|
|
33
|
-
constant: true,
|
|
34
|
-
stateMutability: 'view',
|
|
35
|
-
payable: false,
|
|
36
|
-
inputs: [
|
|
37
|
-
{
|
|
38
|
-
type: 'bytes4',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
outputs: [
|
|
42
|
-
{
|
|
43
|
-
type: 'bool',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
]
|
|
48
|
-
|
|
49
|
-
it('should return a transaction to the resolver and set successfully', async () => {
|
|
50
|
-
const tx = await setRecords(walletClient, {
|
|
51
|
-
name: 'test123.eth',
|
|
52
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
53
|
-
name: 'test123.eth',
|
|
54
|
-
}))!,
|
|
55
|
-
coins: [
|
|
56
|
-
{
|
|
57
|
-
coin: 'ETC_LEGACY',
|
|
58
|
-
value: '0x42D63ae25990889E35F215bC95884039Ba354115',
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
texts: [{ key: 'foo', value: 'bar' }],
|
|
62
|
-
abi: await encodeAbi({ encodeAs: 'json', data: dummyABI }),
|
|
63
|
-
account: accounts[1],
|
|
64
|
-
})
|
|
65
|
-
expect(tx).toBeTruthy()
|
|
66
|
-
const receipt = await waitForTransaction(tx)
|
|
67
|
-
expect(receipt.status).toBe('success')
|
|
68
|
-
|
|
69
|
-
const records = await getRecords(publicClient, {
|
|
70
|
-
name: 'test123.eth',
|
|
71
|
-
records: {
|
|
72
|
-
coins: ['ETC_LEGACY'],
|
|
73
|
-
texts: ['foo'],
|
|
74
|
-
abi: true,
|
|
75
|
-
},
|
|
76
|
-
})
|
|
77
|
-
expect(records.abi!.abi).toStrictEqual(dummyABI)
|
|
78
|
-
expect(records.coins).toMatchInlineSnapshot(`
|
|
79
|
-
[
|
|
80
|
-
{
|
|
81
|
-
"id": 61,
|
|
82
|
-
"name": "ETC_LEGACY",
|
|
83
|
-
"value": "0x42D63ae25990889E35F215bC95884039Ba354115",
|
|
84
|
-
},
|
|
85
|
-
]
|
|
86
|
-
`)
|
|
87
|
-
expect(records.texts).toMatchInlineSnapshot(`
|
|
88
|
-
[
|
|
89
|
-
{
|
|
90
|
-
"key": "foo",
|
|
91
|
-
"value": "bar",
|
|
92
|
-
},
|
|
93
|
-
]
|
|
94
|
-
`)
|
|
95
|
-
})
|
|
96
|
-
it('should error if there are no records to set', async () => {
|
|
97
|
-
await expect(
|
|
98
|
-
setRecords(walletClient, {
|
|
99
|
-
name: 'test123.eth',
|
|
100
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
101
|
-
name: 'test123.eth',
|
|
102
|
-
}))!,
|
|
103
|
-
|
|
104
|
-
account: accounts[1],
|
|
105
|
-
}),
|
|
106
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
|
107
|
-
"No records specified
|
|
108
|
-
|
|
109
|
-
Version: ${getVersion()}"
|
|
110
|
-
`)
|
|
111
|
-
})
|
|
112
|
-
it('should not wrap with multicall if only setting a single record', async () => {
|
|
113
|
-
const encodedData = setRecords.makeFunctionData(walletClient, {
|
|
114
|
-
name: 'test123.eth',
|
|
115
|
-
resolverAddress: (await getResolver(publicClient, {
|
|
116
|
-
name: 'test123.eth',
|
|
117
|
-
}))!,
|
|
118
|
-
coins: [
|
|
119
|
-
{
|
|
120
|
-
coin: 'ETC_LEGACY',
|
|
121
|
-
value: '0x42D63ae25990889E35F215bC95884039Ba354115',
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
})
|
|
125
|
-
// 0x8b95dd71 is the function selector for setAddr(bytes32,uint256,bytes)
|
|
126
|
-
expect(encodedData.data.startsWith('0x8b95dd71')).toBe(true)
|
|
127
|
-
})
|
|
@@ -1,114 +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 setResolver from './setResolver.js'
|
|
10
|
-
|
|
11
|
-
let snapshot: Hex
|
|
12
|
-
let accounts: Address[]
|
|
13
|
-
|
|
14
|
-
beforeAll(async () => {
|
|
15
|
-
accounts = await walletClient.getAddresses()
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
beforeEach(async () => {
|
|
19
|
-
snapshot = await testClient.snapshot()
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
afterEach(async () => {
|
|
23
|
-
await testClient.revert({ id: snapshot })
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
it('should return a setResolver transaction to the registry and succeed', async () => {
|
|
27
|
-
const tx = await setResolver(walletClient, {
|
|
28
|
-
name: 'test123.eth',
|
|
29
|
-
contract: 'registry',
|
|
30
|
-
resolverAddress: '0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC',
|
|
31
|
-
account: accounts[1],
|
|
32
|
-
})
|
|
33
|
-
expect(tx).toBeTruthy()
|
|
34
|
-
const receipt = await waitForTransaction(tx)
|
|
35
|
-
expect(receipt.status).toBe('success')
|
|
36
|
-
|
|
37
|
-
const resolver = await getResolver(publicClient, {
|
|
38
|
-
name: 'test123.eth',
|
|
39
|
-
})
|
|
40
|
-
expect(resolver).toBe('0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC')
|
|
41
|
-
})
|
|
42
|
-
it('should return a setResolver transaction to the namewrapper and succeed', async () => {
|
|
43
|
-
const tx = await setResolver(walletClient, {
|
|
44
|
-
name: 'wrapped.eth',
|
|
45
|
-
contract: 'nameWrapper',
|
|
46
|
-
resolverAddress: '0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC',
|
|
47
|
-
account: accounts[1],
|
|
48
|
-
})
|
|
49
|
-
expect(tx).toBeTruthy()
|
|
50
|
-
const receipt = await waitForTransaction(tx)
|
|
51
|
-
expect(receipt.status).toBe('success')
|
|
52
|
-
|
|
53
|
-
const resolver = await getResolver(publicClient, {
|
|
54
|
-
name: 'wrapped.eth',
|
|
55
|
-
})
|
|
56
|
-
expect(resolver).toBe('0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC')
|
|
57
|
-
})
|
|
58
|
-
it('should error if unknown contract', async () => {
|
|
59
|
-
await expect(
|
|
60
|
-
setResolver(walletClient, {
|
|
61
|
-
name: 'test123.eth',
|
|
62
|
-
contract: 'random' as any,
|
|
63
|
-
resolverAddress: '0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC',
|
|
64
|
-
account: accounts[1],
|
|
65
|
-
}),
|
|
66
|
-
).rejects.toThrow('Unknown contract: random')
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
// it('should return a transaction for a name and set successfully', async () => {
|
|
70
|
-
// const tx = await setName(walletClient, {
|
|
71
|
-
// name: 'test123.eth',
|
|
72
|
-
// account: accounts[1],
|
|
73
|
-
// })
|
|
74
|
-
// expect(tx).toBeTruthy()
|
|
75
|
-
// const receipt = await publicClient.waitForTransactionReceipt({ hash: tx })
|
|
76
|
-
// expect(receipt.status).toBe('success')
|
|
77
|
-
|
|
78
|
-
// const resolvedName = await getName(publicClient, {
|
|
79
|
-
// address: accounts[1],
|
|
80
|
-
// })
|
|
81
|
-
// expect(resolvedName!.name).toBe('test123.eth')
|
|
82
|
-
// })
|
|
83
|
-
|
|
84
|
-
// it("should return a transaction for setting another address' name and succeed", async () => {
|
|
85
|
-
// const setApprovedForAllTx = await walletClient.writeContract({
|
|
86
|
-
// abi: setApprovalForAllSnippet,
|
|
87
|
-
// functionName: 'setApprovalForAll',
|
|
88
|
-
// address: getChainContractAddress({
|
|
89
|
-
// client: walletClient,
|
|
90
|
-
// contract: 'ensRegistry',
|
|
91
|
-
// }),
|
|
92
|
-
// args: [accounts[2], true],
|
|
93
|
-
// account: accounts[1],
|
|
94
|
-
// })
|
|
95
|
-
// expect(setApprovedForAllTx).toBeTruthy()
|
|
96
|
-
// const setApprovedForAllReceipt = await publicClient.waitForTransactionReceipt(
|
|
97
|
-
// { hash: setApprovedForAllTx },
|
|
98
|
-
// )
|
|
99
|
-
// expect(setApprovedForAllReceipt.status).toBe('success')
|
|
100
|
-
|
|
101
|
-
// const tx = await setName(walletClient, {
|
|
102
|
-
// name: 'test123.eth',
|
|
103
|
-
// address: accounts[1],
|
|
104
|
-
// account: accounts[2],
|
|
105
|
-
// })
|
|
106
|
-
// expect(tx).toBeTruthy()
|
|
107
|
-
// const receipt = await publicClient.waitForTransactionReceipt({ hash: tx })
|
|
108
|
-
// expect(receipt.status).toBe('success')
|
|
109
|
-
|
|
110
|
-
// const resolvedName = await getName(publicClient, {
|
|
111
|
-
// address: accounts[1],
|
|
112
|
-
// })
|
|
113
|
-
// expect(resolvedName!.name).toBe('test123.eth')
|
|
114
|
-
// })
|