@ensdomains/ensjs 3.0.0-alpha.4 → 3.0.0-alpha.41
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/LICENSE +1 -1
- package/README.md +13 -1
- package/dist/cjs/GqlManager.js +109 -36
- package/dist/cjs/contracts/baseRegistrar.js +24 -3
- package/dist/cjs/contracts/bulkRenewal.js +25 -0
- package/dist/cjs/contracts/dnsRegistrar.js +25 -0
- package/dist/cjs/contracts/ethRegistrarController.js +24 -3
- package/dist/cjs/contracts/factories.js +16 -0
- package/dist/cjs/contracts/getContractAddress.js +82 -43
- package/dist/cjs/contracts/index.js +56 -32
- package/dist/cjs/contracts/multicall.js +24 -21
- package/dist/cjs/contracts/nameWrapper.js +24 -3
- package/dist/cjs/contracts/publicResolver.js +24 -3
- package/dist/cjs/contracts/registry.js +24 -3
- package/dist/cjs/contracts/reverseRegistrar.js +24 -3
- package/dist/cjs/contracts/types.js +15 -1
- package/dist/cjs/contracts/universalResolver.js +24 -3
- package/dist/cjs/functions/batch.js +42 -15
- package/dist/cjs/functions/batchWrappers.js +130 -67
- package/dist/cjs/functions/burnFuses.js +28 -15
- package/dist/cjs/functions/commitName.js +49 -0
- package/dist/cjs/functions/createSubname.js +80 -38
- package/dist/cjs/functions/deleteSubname.js +59 -4
- package/dist/cjs/functions/getAvailable.js +55 -0
- package/dist/cjs/functions/getDNSOwner.js +78 -72
- package/dist/cjs/functions/getExpiry.js +110 -41
- package/dist/cjs/functions/getHistory.js +166 -195
- package/dist/cjs/functions/getName.js +51 -28
- package/dist/cjs/functions/getNames.js +211 -102
- package/dist/cjs/functions/getOwner.js +178 -123
- package/dist/cjs/functions/getPrice.js +119 -43
- package/dist/cjs/functions/getProfile.js +449 -253
- package/dist/cjs/functions/getRecords.js +29 -9
- package/dist/cjs/functions/getResolver.js +41 -19
- package/dist/cjs/functions/getSpecificRecord.js +270 -260
- package/dist/cjs/functions/getSubnames.js +75 -118
- package/dist/cjs/functions/getWrapperData.js +58 -0
- package/dist/cjs/functions/importDNSSECName.js +65 -0
- package/dist/cjs/functions/initialGetters.js +48 -37
- package/dist/cjs/functions/registerName.js +44 -0
- package/dist/cjs/functions/renewNames.js +62 -0
- package/dist/cjs/functions/setName.js +41 -15
- package/dist/cjs/functions/setRecord.js +56 -0
- package/dist/cjs/functions/setRecords.js +50 -20
- package/dist/cjs/functions/setResolver.js +43 -23
- package/dist/cjs/functions/supportsTLD.js +48 -0
- package/dist/cjs/functions/transferController.js +42 -0
- package/dist/cjs/functions/transferName.js +61 -30
- package/dist/cjs/functions/transferSubname.js +60 -24
- package/dist/cjs/functions/types.js +16 -0
- package/dist/cjs/functions/unwrapName.js +49 -25
- package/dist/cjs/functions/wrapName.js +123 -57
- package/dist/cjs/generated/BaseRegistrarImplementation.js +15 -1
- package/dist/cjs/generated/BulkRenewal.js +16 -0
- package/dist/cjs/generated/DNSRegistrar.js +15 -1
- package/dist/cjs/generated/DNSSECImpl.js +15 -1
- package/dist/cjs/generated/DefaultReverseResolver.js +15 -1
- package/dist/cjs/generated/ENSRegistry.js +15 -1
- package/dist/cjs/generated/ETHRegistrarController.js +15 -1
- package/dist/cjs/generated/Multicall.js +15 -1
- package/dist/cjs/generated/NameWrapper.js +15 -1
- package/dist/cjs/generated/P256SHA256Algorithm.js +15 -1
- package/dist/cjs/generated/PublicResolver.js +15 -1
- package/dist/cjs/generated/RSASHA1Algorithm.js +15 -1
- package/dist/cjs/generated/RSASHA256Algorithm.js +15 -1
- package/dist/cjs/generated/ReverseRegistrar.js +15 -1
- package/dist/cjs/generated/Root.js +15 -1
- package/dist/cjs/generated/SHA1Digest.js +15 -1
- package/dist/cjs/generated/SHA1NSEC3Digest.js +15 -1
- package/dist/cjs/generated/SHA256Digest.js +15 -1
- package/dist/cjs/generated/StaticMetadataService.js +15 -1
- package/dist/cjs/generated/TLDPublicSuffixList.js +15 -1
- package/dist/cjs/generated/UniversalResolver.js +15 -1
- package/dist/cjs/generated/common.js +15 -1
- package/dist/cjs/generated/factories/BaseRegistrarImplementation__factory.js +785 -764
- package/dist/cjs/generated/factories/BulkRenewal__factory.js +121 -0
- package/dist/cjs/generated/factories/DNSRegistrar__factory.js +282 -288
- package/dist/cjs/generated/factories/DNSSECImpl__factory.js +486 -492
- package/dist/cjs/generated/factories/DefaultReverseResolver__factory.js +103 -82
- package/dist/cjs/generated/factories/ENSRegistry__factory.js +448 -431
- package/dist/cjs/generated/factories/ETHRegistrarController__factory.js +672 -504
- package/dist/cjs/generated/factories/Multicall__factory.js +458 -441
- package/dist/cjs/generated/factories/NameWrapper__factory.js +1379 -1194
- package/dist/cjs/generated/factories/P256SHA256Algorithm__factory.js +61 -67
- package/dist/cjs/generated/factories/PublicResolver__factory.js +957 -885
- package/dist/cjs/generated/factories/RSASHA1Algorithm__factory.js +61 -67
- package/dist/cjs/generated/factories/RSASHA256Algorithm__factory.js +61 -67
- package/dist/cjs/generated/factories/ReverseRegistrar__factory.js +363 -333
- package/dist/cjs/generated/factories/Root__factory.js +254 -237
- package/dist/cjs/generated/factories/SHA1Digest__factory.js +56 -62
- package/dist/cjs/generated/factories/SHA1NSEC3Digest__factory.js +61 -67
- package/dist/cjs/generated/factories/SHA256Digest__factory.js +56 -62
- package/dist/cjs/generated/factories/StaticMetadataService__factory.js +65 -44
- package/dist/cjs/generated/factories/TLDPublicSuffixList__factory.js +51 -57
- package/dist/cjs/generated/factories/UniversalResolver__factory.js +493 -199
- package/dist/cjs/generated/factories/index.js +63 -17
- package/dist/cjs/generated/index.js +70 -37
- package/dist/cjs/index.js +317 -211
- package/dist/cjs/static.js +85 -0
- package/dist/cjs/utils/ccip.js +129 -0
- package/dist/cjs/utils/consts.js +24 -0
- package/dist/cjs/utils/contentHash.js +145 -142
- package/dist/cjs/utils/createReverseNode.js +23 -2
- package/dist/cjs/utils/format.js +27 -8
- package/dist/cjs/utils/fuses.js +123 -13
- package/dist/cjs/utils/generateFuseInput.js +37 -16
- package/dist/cjs/utils/hexEncodedName.js +29 -7
- package/dist/cjs/utils/labels.js +99 -83
- package/dist/cjs/utils/makeHashIndexes.js +27 -6
- package/dist/cjs/utils/normalise.js +51 -22
- package/dist/cjs/utils/recordHelpers.js +141 -37
- package/dist/cjs/utils/registerHelpers.js +118 -46
- package/dist/cjs/utils/singleCall.js +23 -6
- package/dist/cjs/utils/validation.js +76 -63
- package/dist/cjs/utils/wrapper.js +51 -0
- package/dist/cjs/utils/writeTx.js +25 -0
- package/dist/esm/GqlManager.mjs +88 -0
- package/dist/esm/contracts/baseRegistrar.mjs +6 -0
- package/dist/esm/contracts/bulkRenewal.mjs +6 -0
- package/dist/esm/contracts/dnsRegistrar.mjs +6 -0
- package/dist/esm/contracts/ethRegistrarController.mjs +6 -0
- package/dist/esm/contracts/factories.mjs +0 -0
- package/dist/esm/contracts/getContractAddress.mjs +66 -0
- package/dist/esm/contracts/index.mjs +44 -0
- package/dist/esm/contracts/multicall.mjs +6 -0
- package/dist/esm/contracts/nameWrapper.mjs +6 -0
- package/dist/esm/contracts/publicResolver.mjs +6 -0
- package/dist/esm/contracts/registry.mjs +6 -0
- package/dist/esm/contracts/reverseRegistrar.mjs +6 -0
- package/dist/esm/contracts/types.mjs +0 -0
- package/dist/esm/contracts/universalResolver.mjs +6 -0
- package/dist/esm/functions/batch.mjs +29 -0
- package/dist/esm/functions/batchWrappers.mjs +109 -0
- package/dist/esm/functions/burnFuses.mjs +12 -0
- package/dist/esm/functions/commitName.mjs +30 -0
- package/dist/esm/functions/createSubname.mjs +61 -0
- package/dist/esm/functions/deleteSubname.mjs +42 -0
- package/dist/esm/functions/getAvailable.mjs +36 -0
- package/dist/esm/functions/getDNSOwner.mjs +60 -0
- package/dist/esm/functions/getExpiry.mjs +95 -0
- package/dist/esm/functions/getHistory.mjs +231 -0
- package/dist/esm/functions/getName.mjs +38 -0
- package/dist/esm/functions/getNames.mjs +312 -0
- package/dist/esm/functions/getOwner.mjs +175 -0
- package/dist/esm/functions/getPrice.mjs +107 -0
- package/dist/esm/functions/getProfile.mjs +479 -0
- package/dist/esm/functions/getRecords.mjs +12 -0
- package/dist/esm/functions/getResolver.mjs +27 -0
- package/dist/esm/functions/getSpecificRecord.mjs +253 -0
- package/dist/esm/functions/getSubnames.mjs +92 -0
- package/dist/esm/functions/getWrapperData.mjs +39 -0
- package/dist/esm/functions/importDNSSECName.mjs +40 -0
- package/dist/esm/functions/initialGetters.mjs +25 -0
- package/dist/esm/functions/registerName.mjs +27 -0
- package/dist/esm/functions/renewNames.mjs +43 -0
- package/dist/esm/functions/setName.mjs +23 -0
- package/dist/esm/functions/setRecord.mjs +36 -0
- package/dist/esm/functions/setRecords.mjs +32 -0
- package/dist/esm/functions/setResolver.mjs +29 -0
- package/dist/esm/functions/supportsTLD.mjs +29 -0
- package/dist/esm/functions/transferController.mjs +23 -0
- package/dist/esm/functions/transferName.mjs +46 -0
- package/dist/esm/functions/transferSubname.mjs +45 -0
- package/dist/esm/functions/types.mjs +0 -0
- package/dist/esm/functions/unwrapName.mjs +33 -0
- package/dist/esm/functions/wrapName.mjs +105 -0
- package/dist/esm/generated/BaseRegistrarImplementation.mjs +0 -0
- package/dist/esm/generated/BulkRenewal.mjs +0 -0
- package/dist/esm/generated/DNSRegistrar.mjs +0 -0
- package/dist/esm/generated/DNSSECImpl.mjs +0 -0
- package/dist/esm/generated/DefaultReverseResolver.mjs +0 -0
- package/dist/esm/generated/ENSRegistry.mjs +0 -0
- package/dist/esm/generated/ETHRegistrarController.mjs +0 -0
- package/dist/esm/generated/Multicall.mjs +0 -0
- package/dist/esm/generated/NameWrapper.mjs +0 -0
- package/dist/esm/generated/P256SHA256Algorithm.mjs +0 -0
- package/dist/esm/generated/PublicResolver.mjs +0 -0
- package/dist/esm/generated/RSASHA1Algorithm.mjs +0 -0
- package/dist/esm/generated/RSASHA256Algorithm.mjs +0 -0
- package/dist/esm/generated/ReverseRegistrar.mjs +0 -0
- package/dist/esm/generated/Root.mjs +0 -0
- package/dist/esm/generated/SHA1Digest.mjs +0 -0
- package/dist/esm/generated/SHA1NSEC3Digest.mjs +0 -0
- package/dist/esm/generated/SHA256Digest.mjs +0 -0
- package/dist/esm/generated/StaticMetadataService.mjs +0 -0
- package/dist/esm/generated/TLDPublicSuffixList.mjs +0 -0
- package/dist/esm/generated/UniversalResolver.mjs +0 -0
- package/dist/esm/generated/common.mjs +0 -0
- package/dist/esm/generated/factories/BaseRegistrarImplementation__factory.mjs +779 -0
- package/dist/esm/generated/factories/BulkRenewal__factory.mjs +109 -0
- package/dist/esm/generated/factories/DNSRegistrar__factory.mjs +278 -0
- package/dist/esm/generated/factories/DNSSECImpl__factory.mjs +483 -0
- package/dist/esm/generated/factories/DefaultReverseResolver__factory.mjs +96 -0
- package/dist/esm/generated/factories/ENSRegistry__factory.mjs +444 -0
- package/dist/esm/generated/factories/ETHRegistrarController__factory.mjs +667 -0
- package/dist/esm/generated/factories/Multicall__factory.mjs +462 -0
- package/dist/esm/generated/factories/NameWrapper__factory.mjs +1373 -0
- package/dist/esm/generated/factories/P256SHA256Algorithm__factory.mjs +53 -0
- package/dist/esm/generated/factories/PublicResolver__factory.mjs +952 -0
- package/dist/esm/generated/factories/RSASHA1Algorithm__factory.mjs +53 -0
- package/dist/esm/generated/factories/RSASHA256Algorithm__factory.mjs +53 -0
- package/dist/esm/generated/factories/ReverseRegistrar__factory.mjs +358 -0
- package/dist/esm/generated/factories/Root__factory.mjs +248 -0
- package/dist/esm/generated/factories/SHA1Digest__factory.mjs +48 -0
- package/dist/esm/generated/factories/SHA1NSEC3Digest__factory.mjs +53 -0
- package/dist/esm/generated/factories/SHA256Digest__factory.mjs +48 -0
- package/dist/esm/generated/factories/StaticMetadataService__factory.mjs +58 -0
- package/dist/esm/generated/factories/TLDPublicSuffixList__factory.mjs +43 -0
- package/dist/esm/generated/factories/UniversalResolver__factory.mjs +486 -0
- package/dist/esm/generated/factories/index.mjs +45 -0
- package/dist/esm/generated/index.mjs +47 -0
- package/dist/esm/index.mjs +309 -0
- package/dist/esm/static.mjs +62 -0
- package/dist/esm/utils/ccip.mjs +114 -0
- package/dist/esm/utils/consts.mjs +5 -0
- package/dist/esm/utils/contentHash.mjs +142 -0
- package/dist/esm/utils/createReverseNode.mjs +5 -0
- package/dist/esm/utils/format.mjs +9 -0
- package/dist/esm/utils/fuses.mjs +115 -0
- package/dist/esm/utils/generateFuseInput.mjs +15 -0
- package/dist/esm/utils/hexEncodedName.mjs +6 -0
- package/dist/esm/utils/labels.mjs +109 -0
- package/dist/esm/utils/makeHashIndexes.mjs +10 -0
- package/dist/esm/utils/normalise.mjs +32 -0
- package/dist/esm/utils/recordHelpers.mjs +123 -0
- package/dist/esm/utils/registerHelpers.mjs +98 -0
- package/dist/esm/utils/singleCall.mjs +5 -0
- package/dist/esm/utils/validation.mjs +67 -0
- package/dist/esm/utils/wrapper.mjs +32 -0
- package/dist/esm/utils/writeTx.mjs +6 -0
- package/dist/types/GqlManager.d.ts +13 -0
- package/dist/types/contracts/baseRegistrar.d.ts +3 -0
- package/dist/types/contracts/bulkRenewal.d.ts +3 -0
- package/dist/types/contracts/dnsRegistrar.d.ts +3 -0
- package/dist/types/contracts/ethRegistrarController.d.ts +3 -0
- package/dist/types/contracts/factories.d.ts +45 -0
- package/dist/{cjs → types}/contracts/getContractAddress.d.ts +0 -0
- package/dist/types/contracts/index.d.ts +38 -0
- package/dist/types/contracts/multicall.d.ts +3 -0
- package/dist/types/contracts/nameWrapper.d.ts +3 -0
- package/dist/types/contracts/publicResolver.d.ts +3 -0
- package/dist/types/contracts/registry.d.ts +3 -0
- package/dist/types/contracts/reverseRegistrar.d.ts +3 -0
- package/dist/types/contracts/types.d.ts +2 -0
- package/dist/types/contracts/universalResolver.d.ts +3 -0
- package/dist/{cjs → types}/functions/batch.d.ts +0 -0
- package/dist/types/functions/batchWrappers.d.ts +86 -0
- package/dist/types/functions/burnFuses.d.ts +3 -0
- package/dist/types/functions/commitName.d.ts +26 -0
- package/dist/types/functions/createSubname.d.ts +16 -0
- package/dist/types/functions/deleteSubname.d.ts +6 -0
- package/dist/{esm/functions/getResolver.d.ts → types/functions/getAvailable.d.ts} +1 -1
- package/dist/{cjs → types}/functions/getDNSOwner.d.ts +0 -0
- package/dist/types/functions/getExpiry.d.ts +19 -0
- package/dist/types/functions/getHistory.d.ts +28 -0
- package/dist/{cjs → types}/functions/getName.d.ts +2 -2
- package/dist/{esm → types}/functions/getNames.d.ts +13 -3
- package/dist/{cjs → types}/functions/getOwner.d.ts +1 -1
- package/dist/{esm → types}/functions/getPrice.d.ts +3 -3
- package/dist/{esm → types}/functions/getProfile.d.ts +11 -1
- package/dist/{cjs → types}/functions/getRecords.d.ts +4 -2
- package/dist/{cjs → types}/functions/getResolver.d.ts +0 -0
- package/dist/{esm → types}/functions/getSpecificRecord.d.ts +28 -6
- package/dist/{esm → types}/functions/getSubnames.d.ts +2 -2
- package/dist/types/functions/getWrapperData.d.ts +15 -0
- package/dist/types/functions/importDNSSECName.d.ts +7 -0
- package/dist/{cjs → types}/functions/initialGetters.d.ts +1 -0
- package/dist/types/functions/registerName.d.ts +8 -0
- package/dist/types/functions/renewNames.d.ts +13 -0
- package/dist/types/functions/setName.d.ts +5 -0
- package/dist/types/functions/setRecord.d.ts +22 -0
- package/dist/types/functions/setRecords.d.ts +6 -0
- package/dist/types/functions/setResolver.d.ts +5 -0
- package/dist/types/functions/supportsTLD.d.ts +2 -0
- package/dist/types/functions/transferController.d.ts +5 -0
- package/dist/types/functions/transferName.d.ts +6 -0
- package/dist/types/functions/transferSubname.d.ts +14 -0
- package/dist/types/functions/types.d.ts +79 -0
- package/dist/types/functions/unwrapName.d.ts +5 -0
- package/dist/types/functions/wrapName.d.ts +9 -0
- package/dist/types/generated/BaseRegistrarImplementation.d.ts +512 -0
- package/dist/types/generated/BulkRenewal.d.ts +80 -0
- package/dist/types/generated/DNSRegistrar.d.ts +228 -0
- package/dist/types/generated/DNSSECImpl.d.ts +406 -0
- package/dist/types/generated/DefaultReverseResolver.d.ts +70 -0
- package/dist/types/generated/ENSRegistry.d.ts +278 -0
- package/dist/types/generated/ETHRegistrarController.d.ts +366 -0
- package/dist/{esm → types}/generated/Multicall.d.ts +113 -109
- package/dist/types/generated/NameWrapper.d.ts +814 -0
- package/dist/{esm → types}/generated/P256SHA256Algorithm.d.ts +22 -14
- package/dist/types/generated/PublicResolver.d.ts +598 -0
- package/dist/types/generated/RSASHA1Algorithm.d.ts +50 -0
- package/dist/types/generated/RSASHA256Algorithm.d.ts +50 -0
- package/dist/types/generated/ReverseRegistrar.d.ts +283 -0
- package/dist/types/generated/Root.d.ts +177 -0
- package/dist/{cjs → types}/generated/SHA1Digest.d.ts +18 -14
- package/dist/{esm → types}/generated/SHA1NSEC3Digest.d.ts +22 -14
- package/dist/{esm → types}/generated/SHA256Digest.d.ts +18 -14
- package/dist/types/generated/StaticMetadataService.d.ts +46 -0
- package/dist/types/generated/TLDPublicSuffixList.d.ts +46 -0
- package/dist/types/generated/UniversalResolver.d.ts +188 -0
- package/dist/{esm → types}/generated/common.d.ts +4 -3
- package/dist/{cjs → types}/generated/factories/BaseRegistrarImplementation__factory.d.ts +3 -3
- package/dist/{cjs/generated/factories/StaticMetadataService__factory.d.ts → types/generated/factories/BulkRenewal__factory.d.ts} +6 -6
- package/dist/{cjs/generated/factories/ETHRegistrarController__factory.d.ts → types/generated/factories/DNSRegistrar__factory.d.ts} +17 -16
- package/dist/{esm/generated/factories/DoNotCallOnChainUniversalResolverProxy__factory.d.ts → types/generated/factories/DNSSECImpl__factory.d.ts} +11 -11
- package/dist/{esm → types}/generated/factories/DefaultReverseResolver__factory.d.ts +3 -3
- package/dist/{esm → types}/generated/factories/ENSRegistry__factory.d.ts +3 -3
- package/dist/{esm → types}/generated/factories/ETHRegistrarController__factory.d.ts +15 -4
- package/dist/{esm → types}/generated/factories/Multicall__factory.d.ts +3 -3
- package/dist/{esm → types}/generated/factories/NameWrapper__factory.d.ts +3 -3
- package/dist/types/generated/factories/P256SHA256Algorithm__factory.d.ts +22 -0
- package/dist/{esm → types}/generated/factories/PublicResolver__factory.d.ts +3 -3
- package/dist/types/generated/factories/RSASHA1Algorithm__factory.d.ts +22 -0
- package/dist/types/generated/factories/RSASHA256Algorithm__factory.d.ts +22 -0
- package/dist/{esm → types}/generated/factories/ReverseRegistrar__factory.d.ts +3 -3
- package/dist/{cjs → types}/generated/factories/Root__factory.d.ts +3 -3
- package/dist/types/generated/factories/SHA1Digest__factory.d.ts +22 -0
- package/dist/types/generated/factories/SHA1NSEC3Digest__factory.d.ts +22 -0
- package/dist/types/generated/factories/SHA256Digest__factory.d.ts +22 -0
- package/dist/{esm → types}/generated/factories/StaticMetadataService__factory.d.ts +3 -3
- package/dist/types/generated/factories/TLDPublicSuffixList__factory.d.ts +22 -0
- package/dist/{cjs → types}/generated/factories/UniversalResolver__factory.d.ts +3 -3
- package/dist/types/generated/factories/index.d.ts +21 -0
- package/dist/types/generated/index.d.ts +43 -0
- package/dist/types/index.d.ts +553 -0
- package/dist/types/static.d.ts +26 -0
- package/dist/types/utils/ccip.d.ts +3 -0
- package/dist/types/utils/consts.d.ts +1 -0
- package/dist/{cjs → types}/utils/contentHash.d.ts +0 -0
- package/dist/{cjs → types}/utils/createReverseNode.d.ts +0 -0
- package/dist/{cjs → types}/utils/format.d.ts +0 -0
- package/dist/types/utils/fuses.d.ts +61 -0
- package/dist/{cjs → types}/utils/generateFuseInput.d.ts +1 -1
- package/dist/{cjs → types}/utils/hexEncodedName.d.ts +0 -0
- package/dist/{cjs → types}/utils/labels.d.ts +0 -0
- package/dist/{cjs → types}/utils/makeHashIndexes.d.ts +0 -0
- package/dist/types/utils/normalise.d.ts +2 -0
- package/dist/types/utils/recordHelpers.d.ts +29 -0
- package/dist/types/utils/registerHelpers.d.ts +59 -0
- package/dist/{esm → types}/utils/singleCall.d.ts +2 -2
- package/dist/{cjs → types}/utils/validation.d.ts +0 -0
- package/dist/types/utils/wrapper.d.ts +6 -0
- package/dist/types/utils/writeTx.d.ts +21 -0
- package/package.json +106 -39
- package/src/@types/@ensdomains/ens-contracts.d.ts +1 -1
- package/src/@types/dns-packet/index.d.ts +113 -113
- package/src/@types/pako.d.ts +188 -0
- package/src/ABIs/Multicall.json +452 -0
- package/src/GqlManager.test.ts +173 -0
- package/src/GqlManager.ts +105 -9
- package/src/contracts/baseRegistrar.ts +2 -2
- package/src/contracts/bulkRenewal.ts +6 -0
- package/src/contracts/dnsRegistrar.ts +5 -0
- package/src/contracts/ethRegistrarController.ts +2 -2
- package/src/contracts/factories.ts +48 -0
- package/src/contracts/getContractAddress.ts +28 -5
- package/src/contracts/index.ts +72 -48
- package/src/contracts/multicall.ts +2 -21
- package/src/contracts/nameWrapper.ts +2 -2
- package/src/contracts/publicResolver.ts +2 -2
- package/src/contracts/registry.ts +2 -2
- package/src/contracts/reverseRegistrar.ts +2 -2
- package/src/contracts/types.ts +3 -1
- package/src/contracts/universalResolver.ts +2 -2
- package/src/functions/batch.test.ts +10 -10
- package/src/functions/batch.ts +3 -3
- package/src/functions/batchWrappers.test.ts +13 -13
- package/src/functions/batchWrappers.ts +42 -11
- package/src/functions/burnFuses.test.ts +127 -23
- package/src/functions/burnFuses.ts +6 -13
- package/src/functions/commitName.test.ts +61 -0
- package/src/functions/commitName.ts +39 -0
- package/src/functions/createSubname.test.ts +11 -19
- package/src/functions/createSubname.ts +24 -17
- package/src/functions/deleteSubname.test.ts +36 -38
- package/src/functions/deleteSubname.ts +47 -13
- package/src/functions/getAvailable.test.ts +21 -0
- package/src/functions/getAvailable.ts +37 -0
- package/src/functions/getDNSOwner.test.ts +9 -19
- package/src/functions/getDNSOwner.ts +11 -9
- package/src/functions/getExpiry.test.ts +28 -10
- package/src/functions/getExpiry.ts +89 -11
- package/src/functions/getHistory.test.ts +17 -80
- package/src/functions/getHistory.ts +107 -176
- package/src/functions/getName.test.ts +10 -10
- package/src/functions/getName.ts +4 -4
- package/src/functions/getNames.test.ts +153 -89
- package/src/functions/getNames.ts +140 -36
- package/src/functions/getOwner.test.ts +3 -54
- package/src/functions/getOwner.ts +66 -29
- package/src/functions/getPrice.test.ts +55 -0
- package/src/functions/getPrice.ts +66 -13
- package/src/functions/getProfile-ccip.test.ts +29 -0
- package/src/functions/getProfile.test.ts +128 -29
- package/src/functions/getProfile.ts +296 -158
- package/src/functions/getRecords.ts +2 -1
- package/src/functions/getResolver.test.ts +5 -9
- package/src/functions/getResolver.ts +2 -6
- package/src/functions/getSpecificRecord.test.ts +185 -20
- package/src/functions/getSpecificRecord.ts +114 -149
- package/src/functions/getSubnames.test.ts +651 -7
- package/src/functions/getSubnames.ts +45 -103
- package/src/functions/getWrapperData.test.ts +98 -0
- package/src/functions/getWrapperData.ts +42 -0
- package/src/functions/importDNSSECName.ts +54 -0
- package/src/functions/initialGetters.ts +1 -0
- package/src/functions/makeCommitment.test.ts +6 -6
- package/src/functions/registerName.test.ts +59 -0
- package/src/functions/registerName.ts +38 -0
- package/src/functions/renewNames.test.ts +64 -0
- package/src/functions/renewNames.ts +60 -0
- package/src/functions/setName.test.ts +22 -18
- package/src/functions/setName.ts +15 -17
- package/src/functions/setRecord.test.ts +249 -0
- package/src/functions/setRecord.ts +64 -0
- package/src/functions/setRecords.test.ts +24 -18
- package/src/functions/setRecords.ts +19 -13
- package/src/functions/setResolver.test.ts +17 -25
- package/src/functions/setResolver.ts +15 -20
- package/src/functions/supportsTLD.test.ts +45 -0
- package/src/functions/supportsTLD.ts +38 -0
- package/src/functions/transferController.ts +29 -0
- package/src/functions/transferName.test.ts +24 -40
- package/src/functions/transferName.ts +27 -26
- package/src/functions/transferSubname.test.ts +19 -37
- package/src/functions/transferSubname.ts +41 -16
- package/src/functions/types.ts +98 -0
- package/src/functions/unwrapName.test.ts +19 -34
- package/src/functions/unwrapName.ts +26 -22
- package/src/functions/wrapName.test.ts +123 -37
- package/src/functions/wrapName.ts +80 -62
- package/src/generated/BaseRegistrarImplementation.ts +846 -773
- package/src/generated/BulkRenewal.ts +196 -0
- package/src/generated/DNSRegistrar.ts +276 -262
- package/src/generated/DNSSECImpl.ts +436 -412
- package/src/generated/DefaultReverseResolver.ts +95 -79
- package/src/generated/ENSRegistry.ts +491 -422
- package/src/generated/ETHRegistrarController.ts +649 -491
- package/src/generated/Multicall.ts +345 -336
- package/src/generated/NameWrapper.ts +1594 -1220
- package/src/generated/P256SHA256Algorithm.ts +70 -65
- package/src/generated/PublicResolver.ts +1105 -941
- package/src/generated/RSASHA1Algorithm.ts +70 -65
- package/src/generated/RSASHA256Algorithm.ts +70 -65
- package/src/generated/ReverseRegistrar.ts +428 -362
- package/src/generated/Root.ts +295 -241
- package/src/generated/SHA1Digest.ts +61 -60
- package/src/generated/SHA1NSEC3Digest.ts +70 -66
- package/src/generated/SHA256Digest.ts +61 -60
- package/src/generated/StaticMetadataService.ts +61 -46
- package/src/generated/TLDPublicSuffixList.ts +59 -55
- package/src/generated/UniversalResolver.ts +554 -188
- package/src/generated/common.ts +16 -14
- package/src/generated/factories/BaseRegistrarImplementation__factory.ts +340 -338
- package/src/generated/factories/BulkRenewal__factory.ts +110 -0
- package/src/generated/factories/DNSRegistrar__factory.ts +134 -184
- package/src/generated/factories/DNSSECImpl__factory.ts +233 -276
- package/src/generated/factories/DefaultReverseResolver__factory.ts +40 -38
- package/src/generated/factories/ENSRegistry__factory.ts +199 -197
- package/src/generated/factories/ETHRegistrarController__factory.ts +400 -251
- package/src/generated/factories/Multicall__factory.ts +226 -224
- package/src/generated/factories/NameWrapper__factory.ts +788 -618
- package/src/generated/factories/P256SHA256Algorithm__factory.ts +27 -61
- package/src/generated/factories/PublicResolver__factory.ts +490 -436
- package/src/generated/factories/RSASHA1Algorithm__factory.ts +27 -61
- package/src/generated/factories/RSASHA256Algorithm__factory.ts +27 -61
- package/src/generated/factories/ReverseRegistrar__factory.ts +175 -160
- package/src/generated/factories/Root__factory.ts +103 -101
- package/src/generated/factories/SHA1Digest__factory.ts +24 -58
- package/src/generated/factories/SHA1NSEC3Digest__factory.ts +27 -61
- package/src/generated/factories/SHA256Digest__factory.ts +24 -58
- package/src/generated/factories/StaticMetadataService__factory.ts +25 -23
- package/src/generated/factories/TLDPublicSuffixList__factory.ts +21 -55
- package/src/generated/factories/UniversalResolver__factory.ts +381 -102
- package/src/generated/factories/index.ts +15 -0
- package/src/generated/index.ts +31 -1
- package/src/index.ts +297 -164
- package/src/static.ts +94 -0
- package/src/utils/ccip.ts +149 -0
- package/src/utils/consts.ts +1 -0
- package/src/utils/contentHash.ts +29 -27
- package/src/utils/createReverseNode.ts +1 -1
- package/src/utils/fuses.ts +141 -4
- package/src/utils/generateFuseInput.ts +7 -12
- package/src/utils/labels.ts +7 -5
- package/src/utils/normalise.ts +14 -6
- package/src/utils/recordHelpers.ts +121 -20
- package/src/utils/registerHelpers.ts +125 -55
- package/src/utils/singleCall.ts +3 -3
- package/src/utils/validation.ts +9 -10
- package/src/utils/wrapper.ts +36 -0
- package/src/utils/writeTx.ts +16 -0
- package/dist/cjs/GqlManager.d.ts +0 -6
- package/dist/cjs/contracts/baseRegistrar.d.ts +0 -3
- package/dist/cjs/contracts/doNotCallOnChainUniversalResolverProxy.d.ts +0 -3
- package/dist/cjs/contracts/doNotCallOnChainUniversalResolverProxy.js +0 -4
- package/dist/cjs/contracts/ethRegistrarController.d.ts +0 -3
- package/dist/cjs/contracts/index.d.ts +0 -16
- package/dist/cjs/contracts/multicall.d.ts +0 -3
- package/dist/cjs/contracts/nameWrapper.d.ts +0 -3
- package/dist/cjs/contracts/publicResolver.d.ts +0 -3
- package/dist/cjs/contracts/registry.d.ts +0 -3
- package/dist/cjs/contracts/reverseRegistrar.d.ts +0 -3
- package/dist/cjs/contracts/types.d.ts +0 -2
- package/dist/cjs/contracts/universalResolver.d.ts +0 -3
- package/dist/cjs/functions/batchWrappers.d.ts +0 -29
- package/dist/cjs/functions/burnFuses.d.ts +0 -3
- package/dist/cjs/functions/createSubname.d.ts +0 -19
- package/dist/cjs/functions/deleteSubname.d.ts +0 -4
- package/dist/cjs/functions/getExpiry.d.ts +0 -12
- package/dist/cjs/functions/getFuses.d.ts +0 -17
- package/dist/cjs/functions/getFuses.js +0 -62
- package/dist/cjs/functions/getHistory.d.ts +0 -54
- package/dist/cjs/functions/getNames.d.ts +0 -40
- package/dist/cjs/functions/getPrice.d.ts +0 -13
- package/dist/cjs/functions/getProfile.d.ts +0 -30
- package/dist/cjs/functions/getSpecificRecord.d.ts +0 -73
- package/dist/cjs/functions/getSubnames.d.ts +0 -26
- package/dist/cjs/functions/setName.d.ts +0 -4
- package/dist/cjs/functions/setRecords.d.ts +0 -3
- package/dist/cjs/functions/setResolver.d.ts +0 -4
- package/dist/cjs/functions/transferName.d.ts +0 -5
- package/dist/cjs/functions/transferSubname.d.ts +0 -5
- package/dist/cjs/functions/unwrapName.d.ts +0 -4
- package/dist/cjs/functions/wrapName.d.ts +0 -6
- package/dist/cjs/generated/BaseRegistrarImplementation.d.ts +0 -487
- package/dist/cjs/generated/DNSRegistrar.d.ts +0 -220
- package/dist/cjs/generated/DNSSECImpl.d.ts +0 -402
- package/dist/cjs/generated/DefaultReverseResolver.d.ts +0 -66
- package/dist/cjs/generated/DoNotCallOnChainUniversalResolverProxy.d.ts +0 -144
- package/dist/cjs/generated/DoNotCallOnChainUniversalResolverProxy.js +0 -2
- package/dist/cjs/generated/ENSRegistry.d.ts +0 -259
- package/dist/cjs/generated/ETHRegistrarController.d.ts +0 -319
- package/dist/cjs/generated/Multicall.d.ts +0 -292
- package/dist/cjs/generated/NameWrapper.d.ts +0 -675
- package/dist/cjs/generated/P256SHA256Algorithm.d.ts +0 -72
- package/dist/cjs/generated/PublicResolver.d.ts +0 -542
- package/dist/cjs/generated/RSASHA1Algorithm.d.ts +0 -42
- package/dist/cjs/generated/RSASHA256Algorithm.d.ts +0 -42
- package/dist/cjs/generated/ReverseRegistrar.d.ts +0 -259
- package/dist/cjs/generated/Root.d.ts +0 -173
- package/dist/cjs/generated/SHA1NSEC3Digest.d.ts +0 -72
- package/dist/cjs/generated/SHA256Digest.d.ts +0 -67
- package/dist/cjs/generated/StaticMetadataService.d.ts +0 -42
- package/dist/cjs/generated/TLDPublicSuffixList.d.ts +0 -42
- package/dist/cjs/generated/UniversalResolver.d.ts +0 -82
- package/dist/cjs/generated/common.d.ts +0 -21
- package/dist/cjs/generated/factories/DNSRegistrar__factory.d.ts +0 -79
- package/dist/cjs/generated/factories/DNSSECImpl__factory.d.ts +0 -68
- package/dist/cjs/generated/factories/DefaultReverseResolver__factory.d.ts +0 -36
- package/dist/cjs/generated/factories/DoNotCallOnChainUniversalResolverProxy__factory.d.ts +0 -56
- package/dist/cjs/generated/factories/DoNotCallOnChainUniversalResolverProxy__factory.js +0 -171
- package/dist/cjs/generated/factories/ENSRegistry__factory.d.ts +0 -52
- package/dist/cjs/generated/factories/Multicall__factory.d.ts +0 -42
- package/dist/cjs/generated/factories/NameWrapper__factory.d.ts +0 -57
- package/dist/cjs/generated/factories/P256SHA256Algorithm__factory.d.ts +0 -34
- package/dist/cjs/generated/factories/PublicResolver__factory.d.ts +0 -46
- package/dist/cjs/generated/factories/RSASHA1Algorithm__factory.d.ts +0 -34
- package/dist/cjs/generated/factories/RSASHA256Algorithm__factory.d.ts +0 -34
- package/dist/cjs/generated/factories/ReverseRegistrar__factory.d.ts +0 -46
- package/dist/cjs/generated/factories/SHA1Digest__factory.d.ts +0 -34
- package/dist/cjs/generated/factories/SHA1NSEC3Digest__factory.d.ts +0 -34
- package/dist/cjs/generated/factories/SHA256Digest__factory.d.ts +0 -34
- package/dist/cjs/generated/factories/TLDPublicSuffixList__factory.d.ts +0 -34
- package/dist/cjs/generated/factories/index.d.ts +0 -6
- package/dist/cjs/generated/index.d.ts +0 -13
- package/dist/cjs/index.d.ts +0 -471
- package/dist/cjs/utils/fuses.d.ts +0 -20
- package/dist/cjs/utils/normalise.d.ts +0 -2
- package/dist/cjs/utils/recordHelpers.d.ts +0 -13
- package/dist/cjs/utils/registerHelpers.d.ts +0 -26
- package/dist/cjs/utils/singleCall.d.ts +0 -9
- package/dist/esm/GqlManager.d.ts +0 -6
- package/dist/esm/GqlManager.js +0 -18
- package/dist/esm/contracts/baseRegistrar.d.ts +0 -3
- package/dist/esm/contracts/baseRegistrar.js +0 -2
- package/dist/esm/contracts/doNotCallOnChainUniversalResolverProxy.d.ts +0 -3
- package/dist/esm/contracts/doNotCallOnChainUniversalResolverProxy.js +0 -2
- package/dist/esm/contracts/ethRegistrarController.d.ts +0 -3
- package/dist/esm/contracts/ethRegistrarController.js +0 -2
- package/dist/esm/contracts/getContractAddress.d.ts +0 -3
- package/dist/esm/contracts/getContractAddress.js +0 -42
- package/dist/esm/contracts/index.d.ts +0 -16
- package/dist/esm/contracts/index.js +0 -29
- package/dist/esm/contracts/multicall.d.ts +0 -3
- package/dist/esm/contracts/multicall.js +0 -20
- package/dist/esm/contracts/nameWrapper.d.ts +0 -3
- package/dist/esm/contracts/nameWrapper.js +0 -2
- package/dist/esm/contracts/publicResolver.d.ts +0 -3
- package/dist/esm/contracts/publicResolver.js +0 -2
- package/dist/esm/contracts/registry.d.ts +0 -3
- package/dist/esm/contracts/registry.js +0 -2
- package/dist/esm/contracts/reverseRegistrar.d.ts +0 -3
- package/dist/esm/contracts/reverseRegistrar.js +0 -2
- package/dist/esm/contracts/types.d.ts +0 -2
- package/dist/esm/contracts/types.js +0 -1
- package/dist/esm/contracts/universalResolver.d.ts +0 -3
- package/dist/esm/contracts/universalResolver.js +0 -2
- package/dist/esm/functions/batch.d.ts +0 -9
- package/dist/esm/functions/batch.js +0 -19
- package/dist/esm/functions/batchWrappers.d.ts +0 -29
- package/dist/esm/functions/batchWrappers.js +0 -68
- package/dist/esm/functions/burnFuses.d.ts +0 -3
- package/dist/esm/functions/burnFuses.js +0 -12
- package/dist/esm/functions/createSubname.d.ts +0 -19
- package/dist/esm/functions/createSubname.js +0 -38
- package/dist/esm/functions/deleteSubname.d.ts +0 -4
- package/dist/esm/functions/deleteSubname.js +0 -3
- package/dist/esm/functions/getDNSOwner.d.ts +0 -7
- package/dist/esm/functions/getDNSOwner.js +0 -51
- package/dist/esm/functions/getExpiry.d.ts +0 -12
- package/dist/esm/functions/getExpiry.js +0 -43
- package/dist/esm/functions/getFuses.d.ts +0 -17
- package/dist/esm/functions/getFuses.js +0 -60
- package/dist/esm/functions/getHistory.d.ts +0 -54
- package/dist/esm/functions/getHistory.js +0 -273
- package/dist/esm/functions/getName.d.ts +0 -19
- package/dist/esm/functions/getName.js +0 -32
- package/dist/esm/functions/getNames.js +0 -220
- package/dist/esm/functions/getOwner.d.ts +0 -14
- package/dist/esm/functions/getOwner.js +0 -138
- package/dist/esm/functions/getPrice.js +0 -48
- package/dist/esm/functions/getProfile.js +0 -299
- package/dist/esm/functions/getRecords.d.ts +0 -32
- package/dist/esm/functions/getRecords.js +0 -8
- package/dist/esm/functions/getResolver.js +0 -22
- package/dist/esm/functions/getSpecificRecord.js +0 -265
- package/dist/esm/functions/getSubnames.js +0 -152
- package/dist/esm/functions/initialGetters.d.ts +0 -11
- package/dist/esm/functions/initialGetters.js +0 -11
- package/dist/esm/functions/setName.d.ts +0 -4
- package/dist/esm/functions/setName.js +0 -14
- package/dist/esm/functions/setRecords.d.ts +0 -3
- package/dist/esm/functions/setRecords.js +0 -19
- package/dist/esm/functions/setResolver.d.ts +0 -4
- package/dist/esm/functions/setResolver.js +0 -25
- package/dist/esm/functions/transferName.d.ts +0 -5
- package/dist/esm/functions/transferName.js +0 -31
- package/dist/esm/functions/transferSubname.d.ts +0 -5
- package/dist/esm/functions/transferSubname.js +0 -25
- package/dist/esm/functions/unwrapName.d.ts +0 -4
- package/dist/esm/functions/unwrapName.js +0 -25
- package/dist/esm/functions/wrapName.d.ts +0 -6
- package/dist/esm/functions/wrapName.js +0 -58
- package/dist/esm/generated/BaseRegistrarImplementation.d.ts +0 -487
- package/dist/esm/generated/BaseRegistrarImplementation.js +0 -1
- package/dist/esm/generated/DNSRegistrar.d.ts +0 -220
- package/dist/esm/generated/DNSRegistrar.js +0 -1
- package/dist/esm/generated/DNSSECImpl.d.ts +0 -402
- package/dist/esm/generated/DNSSECImpl.js +0 -1
- package/dist/esm/generated/DefaultReverseResolver.d.ts +0 -66
- package/dist/esm/generated/DefaultReverseResolver.js +0 -1
- package/dist/esm/generated/DoNotCallOnChainUniversalResolverProxy.d.ts +0 -144
- package/dist/esm/generated/DoNotCallOnChainUniversalResolverProxy.js +0 -1
- package/dist/esm/generated/ENSRegistry.d.ts +0 -259
- package/dist/esm/generated/ENSRegistry.js +0 -1
- package/dist/esm/generated/ETHRegistrarController.d.ts +0 -319
- package/dist/esm/generated/ETHRegistrarController.js +0 -1
- package/dist/esm/generated/Multicall.js +0 -1
- package/dist/esm/generated/NameWrapper.d.ts +0 -675
- package/dist/esm/generated/NameWrapper.js +0 -1
- package/dist/esm/generated/P256SHA256Algorithm.js +0 -1
- package/dist/esm/generated/PublicResolver.d.ts +0 -542
- package/dist/esm/generated/PublicResolver.js +0 -1
- package/dist/esm/generated/RSASHA1Algorithm.d.ts +0 -42
- package/dist/esm/generated/RSASHA1Algorithm.js +0 -1
- package/dist/esm/generated/RSASHA256Algorithm.d.ts +0 -42
- package/dist/esm/generated/RSASHA256Algorithm.js +0 -1
- package/dist/esm/generated/ReverseRegistrar.d.ts +0 -259
- package/dist/esm/generated/ReverseRegistrar.js +0 -1
- package/dist/esm/generated/Root.d.ts +0 -173
- package/dist/esm/generated/Root.js +0 -1
- package/dist/esm/generated/SHA1Digest.d.ts +0 -67
- package/dist/esm/generated/SHA1Digest.js +0 -1
- package/dist/esm/generated/SHA1NSEC3Digest.js +0 -1
- package/dist/esm/generated/SHA256Digest.js +0 -1
- package/dist/esm/generated/StaticMetadataService.d.ts +0 -42
- package/dist/esm/generated/StaticMetadataService.js +0 -1
- package/dist/esm/generated/TLDPublicSuffixList.d.ts +0 -42
- package/dist/esm/generated/TLDPublicSuffixList.js +0 -1
- package/dist/esm/generated/UniversalResolver.d.ts +0 -82
- package/dist/esm/generated/UniversalResolver.js +0 -1
- package/dist/esm/generated/common.js +0 -1
- package/dist/esm/generated/factories/BaseRegistrarImplementation__factory.d.ts +0 -52
- package/dist/esm/generated/factories/BaseRegistrarImplementation__factory.js +0 -766
- package/dist/esm/generated/factories/DNSRegistrar__factory.d.ts +0 -79
- package/dist/esm/generated/factories/DNSRegistrar__factory.js +0 -292
- package/dist/esm/generated/factories/DNSSECImpl__factory.d.ts +0 -68
- package/dist/esm/generated/factories/DNSSECImpl__factory.js +0 -497
- package/dist/esm/generated/factories/DefaultReverseResolver__factory.js +0 -83
- package/dist/esm/generated/factories/DoNotCallOnChainUniversalResolverProxy__factory.js +0 -167
- package/dist/esm/generated/factories/ENSRegistry__factory.js +0 -435
- package/dist/esm/generated/factories/ETHRegistrarController__factory.js +0 -507
- package/dist/esm/generated/factories/Multicall__factory.js +0 -453
- package/dist/esm/generated/factories/NameWrapper__factory.js +0 -1196
- package/dist/esm/generated/factories/P256SHA256Algorithm__factory.d.ts +0 -34
- package/dist/esm/generated/factories/P256SHA256Algorithm__factory.js +0 -67
- package/dist/esm/generated/factories/PublicResolver__factory.js +0 -888
- package/dist/esm/generated/factories/RSASHA1Algorithm__factory.d.ts +0 -34
- package/dist/esm/generated/factories/RSASHA1Algorithm__factory.js +0 -67
- package/dist/esm/generated/factories/RSASHA256Algorithm__factory.d.ts +0 -34
- package/dist/esm/generated/factories/RSASHA256Algorithm__factory.js +0 -67
- package/dist/esm/generated/factories/ReverseRegistrar__factory.js +0 -336
- package/dist/esm/generated/factories/Root__factory.d.ts +0 -52
- package/dist/esm/generated/factories/Root__factory.js +0 -239
- package/dist/esm/generated/factories/SHA1Digest__factory.d.ts +0 -34
- package/dist/esm/generated/factories/SHA1Digest__factory.js +0 -62
- package/dist/esm/generated/factories/SHA1NSEC3Digest__factory.d.ts +0 -34
- package/dist/esm/generated/factories/SHA1NSEC3Digest__factory.js +0 -67
- package/dist/esm/generated/factories/SHA256Digest__factory.d.ts +0 -34
- package/dist/esm/generated/factories/SHA256Digest__factory.js +0 -62
- package/dist/esm/generated/factories/StaticMetadataService__factory.js +0 -45
- package/dist/esm/generated/factories/TLDPublicSuffixList__factory.d.ts +0 -34
- package/dist/esm/generated/factories/TLDPublicSuffixList__factory.js +0 -57
- package/dist/esm/generated/factories/UniversalResolver__factory.d.ts +0 -42
- package/dist/esm/generated/factories/UniversalResolver__factory.js +0 -200
- package/dist/esm/generated/factories/index.d.ts +0 -6
- package/dist/esm/generated/factories/index.js +0 -9
- package/dist/esm/generated/index.d.ts +0 -13
- package/dist/esm/generated/index.js +0 -7
- package/dist/esm/index.d.ts +0 -471
- package/dist/esm/index.js +0 -190
- package/dist/esm/utils/contentHash.d.ts +0 -28
- package/dist/esm/utils/contentHash.js +0 -153
- package/dist/esm/utils/createReverseNode.d.ts +0 -2
- package/dist/esm/utils/createReverseNode.js +0 -1
- package/dist/esm/utils/format.d.ts +0 -3
- package/dist/esm/utils/format.js +0 -3
- package/dist/esm/utils/fuses.d.ts +0 -20
- package/dist/esm/utils/fuses.js +0 -21
- package/dist/esm/utils/generateFuseInput.d.ts +0 -3
- package/dist/esm/utils/generateFuseInput.js +0 -14
- package/dist/esm/utils/hexEncodedName.d.ts +0 -1
- package/dist/esm/utils/hexEncodedName.js +0 -2
- package/dist/esm/utils/labels.d.ts +0 -14
- package/dist/esm/utils/labels.js +0 -95
- package/dist/esm/utils/makeHashIndexes.d.ts +0 -2
- package/dist/esm/utils/makeHashIndexes.js +0 -3
- package/dist/esm/utils/normalise.d.ts +0 -2
- package/dist/esm/utils/normalise.js +0 -20
- package/dist/esm/utils/recordHelpers.d.ts +0 -13
- package/dist/esm/utils/recordHelpers.js +0 -39
- package/dist/esm/utils/registerHelpers.d.ts +0 -26
- package/dist/esm/utils/registerHelpers.js +0 -43
- package/dist/esm/utils/singleCall.js +0 -5
- package/dist/esm/utils/validation.d.ts +0 -8
- package/dist/esm/utils/validation.js +0 -67
- package/src/@types/FuseOptions.d.ts +0 -9
- package/src/ABIs/ETHRegistrarController.json +0 -494
- package/src/ABIs/NameWrapper.json +0 -1183
- package/src/ABIs/PublicResolver.json +0 -875
- package/src/ABIs/ReverseRegistrar.json +0 -323
- package/src/ABIs/StaticMetadataService.json +0 -32
- package/src/ABIs/UniversalResolver.json +0 -187
- package/src/contracts/doNotCallOnChainUniversalResolverProxy.ts +0 -5
- package/src/functions/getFuses.test.ts +0 -103
- package/src/functions/getFuses.ts +0 -76
- package/src/generated/DoNotCallOnChainUniversalResolverProxy.ts +0 -285
- package/src/generated/factories/DoNotCallOnChainUniversalResolverProxy__factory.ts +0 -186
- package/src/tests/setup.ts +0 -53
- package/src/tests/withProvider.test.ts +0 -28
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare type DecodedContentHash = {
|
|
2
|
-
protocolType?: any;
|
|
3
|
-
decoded?: any;
|
|
4
|
-
error?: any;
|
|
5
|
-
};
|
|
6
|
-
export declare function decodeContenthash(encoded: any): {
|
|
7
|
-
protocolType?: undefined;
|
|
8
|
-
decoded?: undefined;
|
|
9
|
-
error?: undefined;
|
|
10
|
-
} | {
|
|
11
|
-
protocolType: null;
|
|
12
|
-
decoded: any;
|
|
13
|
-
error?: undefined;
|
|
14
|
-
} | {
|
|
15
|
-
protocolType: string | undefined;
|
|
16
|
-
decoded: any;
|
|
17
|
-
error: any;
|
|
18
|
-
};
|
|
19
|
-
export declare function validateContent(encoded: any): any;
|
|
20
|
-
export declare function isValidContenthash(encoded: any): boolean | undefined;
|
|
21
|
-
export declare function getProtocolType(encoded: any): {
|
|
22
|
-
protocolType: string | undefined;
|
|
23
|
-
decoded: string | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
export declare function encodeContenthash(text: string): {
|
|
26
|
-
encoded: string | boolean;
|
|
27
|
-
error: string | undefined;
|
|
28
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import contentHash from '@ensdomains/content-hash';
|
|
2
|
-
import { utils } from 'ethers';
|
|
3
|
-
const supportedCodecs = [
|
|
4
|
-
'ipns-ns',
|
|
5
|
-
'ipfs-ns',
|
|
6
|
-
'swarm-ns',
|
|
7
|
-
'onion',
|
|
8
|
-
'onion3',
|
|
9
|
-
'skynet-ns',
|
|
10
|
-
'arweave-ns',
|
|
11
|
-
];
|
|
12
|
-
function matchProtocol(text) {
|
|
13
|
-
return (text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave):\/\/(.*)/) ||
|
|
14
|
-
text.match(/\/(ipfs)\/(.*)/) ||
|
|
15
|
-
text.match(/\/(ipns)\/(.*)/));
|
|
16
|
-
}
|
|
17
|
-
export function decodeContenthash(encoded) {
|
|
18
|
-
let decoded, protocolType, error;
|
|
19
|
-
if (!encoded || encoded === '0x') {
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
22
|
-
if (encoded.error) {
|
|
23
|
-
return { protocolType: null, decoded: encoded.error };
|
|
24
|
-
}
|
|
25
|
-
else if (encoded === false) {
|
|
26
|
-
return { protocolType: null, decoded: 'invalid value' };
|
|
27
|
-
}
|
|
28
|
-
if (encoded) {
|
|
29
|
-
try {
|
|
30
|
-
decoded = contentHash.decode(encoded);
|
|
31
|
-
const codec = contentHash.getCodec(encoded);
|
|
32
|
-
if (codec === 'ipfs-ns') {
|
|
33
|
-
protocolType = 'ipfs';
|
|
34
|
-
}
|
|
35
|
-
else if (codec === 'ipns-ns') {
|
|
36
|
-
protocolType = 'ipns';
|
|
37
|
-
}
|
|
38
|
-
else if (codec === 'swarm-ns') {
|
|
39
|
-
protocolType = 'bzz';
|
|
40
|
-
}
|
|
41
|
-
else if (codec === 'onion') {
|
|
42
|
-
protocolType = 'onion';
|
|
43
|
-
}
|
|
44
|
-
else if (codec === 'onion3') {
|
|
45
|
-
protocolType = 'onion3';
|
|
46
|
-
}
|
|
47
|
-
else if (codec === 'skynet-ns') {
|
|
48
|
-
protocolType = 'sia';
|
|
49
|
-
}
|
|
50
|
-
else if (codec === 'arweave-ns') {
|
|
51
|
-
protocolType = 'arweave';
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
decoded = encoded;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
error = e.message;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return { protocolType, decoded, error };
|
|
62
|
-
}
|
|
63
|
-
export function validateContent(encoded) {
|
|
64
|
-
return (contentHash.isHashOfType(encoded, contentHash.Types.ipfs) ||
|
|
65
|
-
contentHash.isHashOfType(encoded, contentHash.Types.swarm));
|
|
66
|
-
}
|
|
67
|
-
export function isValidContenthash(encoded) {
|
|
68
|
-
try {
|
|
69
|
-
const codec = contentHash.getCodec(encoded);
|
|
70
|
-
return utils.isHexString(encoded) && supportedCodecs.includes(codec);
|
|
71
|
-
}
|
|
72
|
-
catch (e) {
|
|
73
|
-
console.log(e);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
export function getProtocolType(encoded) {
|
|
77
|
-
let protocolType, decoded;
|
|
78
|
-
try {
|
|
79
|
-
let matched = matchProtocol(encoded);
|
|
80
|
-
if (matched) {
|
|
81
|
-
protocolType = matched[1];
|
|
82
|
-
decoded = matched[2];
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
protocolType,
|
|
86
|
-
decoded,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
console.log(e);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
export function encodeContenthash(text) {
|
|
94
|
-
let content = text;
|
|
95
|
-
let contentType;
|
|
96
|
-
let encoded = false;
|
|
97
|
-
let error;
|
|
98
|
-
if (!!text) {
|
|
99
|
-
let matched = matchProtocol(text);
|
|
100
|
-
if (matched) {
|
|
101
|
-
contentType = matched[1];
|
|
102
|
-
content = matched[2];
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
if (contentType === 'ipfs') {
|
|
106
|
-
if (content.length >= 4) {
|
|
107
|
-
encoded = '0x' + contentHash.encode('ipfs-ns', content);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else if (contentType === 'ipns') {
|
|
111
|
-
encoded = '0x' + contentHash.encode('ipns-ns', content);
|
|
112
|
-
}
|
|
113
|
-
else if (contentType === 'bzz') {
|
|
114
|
-
if (content.length >= 4) {
|
|
115
|
-
encoded = '0x' + contentHash.fromSwarm(content);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else if (contentType === 'onion') {
|
|
119
|
-
if (content.length == 16) {
|
|
120
|
-
encoded = '0x' + contentHash.encode('onion', content);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
else if (contentType === 'onion3') {
|
|
124
|
-
if (content.length == 56) {
|
|
125
|
-
encoded = '0x' + contentHash.encode('onion3', content);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
else if (contentType === 'sia') {
|
|
129
|
-
if (content.length == 46) {
|
|
130
|
-
encoded = '0x' + contentHash.encode('skynet-ns', content);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
else if (contentType === 'arweave') {
|
|
134
|
-
if (content.length == 43) {
|
|
135
|
-
encoded = '0x' + contentHash.encode('arweave-ns', content);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
console.warn('Unsupported protocol or invalid value', {
|
|
140
|
-
contentType,
|
|
141
|
-
text,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
catch (err) {
|
|
146
|
-
const errorMessage = 'Error encoding content hash';
|
|
147
|
-
console.warn(errorMessage, { text, encoded });
|
|
148
|
-
error = errorMessage;
|
|
149
|
-
//throw 'Error encoding content hash'
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return { encoded, error };
|
|
153
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default (address) => address.toLowerCase().substring(2) + '.addr.reverse';
|
package/dist/esm/utils/format.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare const testable: {
|
|
2
|
-
CANNOT_UNWRAP: number;
|
|
3
|
-
CANNOT_BURN_FUSES: number;
|
|
4
|
-
CANNOT_TRANSFER: number;
|
|
5
|
-
CANNOT_SET_RESOLVER: number;
|
|
6
|
-
CANNOT_SET_TTL: number;
|
|
7
|
-
CANNOT_CREATE_SUBDOMAIN: number;
|
|
8
|
-
PARENT_CANNOT_CONTROL: number;
|
|
9
|
-
};
|
|
10
|
-
declare const _default: {
|
|
11
|
-
CAN_DO_EVERYTHING: number;
|
|
12
|
-
CANNOT_UNWRAP: number;
|
|
13
|
-
CANNOT_BURN_FUSES: number;
|
|
14
|
-
CANNOT_TRANSFER: number;
|
|
15
|
-
CANNOT_SET_RESOLVER: number;
|
|
16
|
-
CANNOT_SET_TTL: number;
|
|
17
|
-
CANNOT_CREATE_SUBDOMAIN: number;
|
|
18
|
-
PARENT_CANNOT_CONTROL: number;
|
|
19
|
-
};
|
|
20
|
-
export default _default;
|
package/dist/esm/utils/fuses.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const CANNOT_UNWRAP = 1;
|
|
2
|
-
const CANNOT_BURN_FUSES = 2;
|
|
3
|
-
const CANNOT_TRANSFER = 4;
|
|
4
|
-
const CANNOT_SET_RESOLVER = 8;
|
|
5
|
-
const CANNOT_SET_TTL = 16;
|
|
6
|
-
const CANNOT_CREATE_SUBDOMAIN = 32;
|
|
7
|
-
const PARENT_CANNOT_CONTROL = 64;
|
|
8
|
-
const CAN_DO_EVERYTHING = 0;
|
|
9
|
-
export const testable = {
|
|
10
|
-
CANNOT_UNWRAP,
|
|
11
|
-
CANNOT_BURN_FUSES,
|
|
12
|
-
CANNOT_TRANSFER,
|
|
13
|
-
CANNOT_SET_RESOLVER,
|
|
14
|
-
CANNOT_SET_TTL,
|
|
15
|
-
CANNOT_CREATE_SUBDOMAIN,
|
|
16
|
-
PARENT_CANNOT_CONTROL,
|
|
17
|
-
};
|
|
18
|
-
export default {
|
|
19
|
-
...testable,
|
|
20
|
-
CAN_DO_EVERYTHING,
|
|
21
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
import fuses from './fuses';
|
|
3
|
-
export default (fuseOptions) => {
|
|
4
|
-
const fuseKeys = Object.keys(fuseOptions)
|
|
5
|
-
.filter((opt) => fuseOptions[opt] === true)
|
|
6
|
-
.map((opt) => opt
|
|
7
|
-
.split(/(?=[A-Z])/)
|
|
8
|
-
.join('_')
|
|
9
|
-
.toUpperCase());
|
|
10
|
-
const bigNumberFuses = fuseKeys.reduce((prev, curr) => {
|
|
11
|
-
return prev.or(fuses[curr]);
|
|
12
|
-
}, ethers.BigNumber.from(0));
|
|
13
|
-
return bigNumberFuses.toHexString();
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const hexEncodeName: (name: string) => string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const labelhash: (input: string) => string;
|
|
2
|
-
export declare const keccakFromString: (input: string) => string;
|
|
3
|
-
export declare function decodeLabelhash(hash: string): string;
|
|
4
|
-
export declare function encodeLabelhash(hash: string): string;
|
|
5
|
-
export declare function isEncodedLabelhash(hash: string): boolean;
|
|
6
|
-
export declare function saveLabel(label: string): string;
|
|
7
|
-
export declare function saveName(name: string): void;
|
|
8
|
-
export declare function checkLabel(hash: string): string | undefined;
|
|
9
|
-
export declare function encodeLabel(label: any): any;
|
|
10
|
-
export declare function parseName(name: string): string;
|
|
11
|
-
export declare function checkIsDecrypted(string: string | string[]): boolean;
|
|
12
|
-
export declare function decryptName(name: string): string;
|
|
13
|
-
export declare const truncateUndecryptedName: (name: string) => string;
|
|
14
|
-
export declare function checkLocalStorageSize(): string;
|
package/dist/esm/utils/labels.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { solidityKeccak256 } from 'ethers/lib/utils';
|
|
2
|
-
import { truncateFormat } from './format';
|
|
3
|
-
export const labelhash = (input) => solidityKeccak256(['string'], [input]);
|
|
4
|
-
export const keccakFromString = (input) => labelhash(input);
|
|
5
|
-
export function decodeLabelhash(hash) {
|
|
6
|
-
if (!(hash.startsWith('[') && hash.endsWith(']'))) {
|
|
7
|
-
throw Error('Expected encoded labelhash to start and end with square brackets');
|
|
8
|
-
}
|
|
9
|
-
if (hash.length !== 66) {
|
|
10
|
-
throw Error('Expected encoded labelhash to have a length of 66');
|
|
11
|
-
}
|
|
12
|
-
return `${hash.slice(1, -1)}`;
|
|
13
|
-
}
|
|
14
|
-
export function encodeLabelhash(hash) {
|
|
15
|
-
if (!hash.startsWith('0x')) {
|
|
16
|
-
throw new Error('Expected label hash to start with 0x');
|
|
17
|
-
}
|
|
18
|
-
if (hash.length !== 66) {
|
|
19
|
-
throw new Error('Expected label hash to have a length of 66');
|
|
20
|
-
}
|
|
21
|
-
return `[${hash.slice(2)}]`;
|
|
22
|
-
}
|
|
23
|
-
export function isEncodedLabelhash(hash) {
|
|
24
|
-
return hash.startsWith('[') && hash.endsWith(']') && hash.length === 66;
|
|
25
|
-
}
|
|
26
|
-
function getLabels() {
|
|
27
|
-
return localStorage
|
|
28
|
-
? JSON.parse(localStorage.getItem('ensjs:labels')) || {}
|
|
29
|
-
: {};
|
|
30
|
-
}
|
|
31
|
-
function _saveLabel(hash, label) {
|
|
32
|
-
if (!localStorage)
|
|
33
|
-
return hash;
|
|
34
|
-
const labels = getLabels();
|
|
35
|
-
localStorage.setItem('ensjs:labels', JSON.stringify({
|
|
36
|
-
...labels,
|
|
37
|
-
[hash]: label,
|
|
38
|
-
}));
|
|
39
|
-
return hash;
|
|
40
|
-
}
|
|
41
|
-
export function saveLabel(label) {
|
|
42
|
-
const hash = `${labelhash(label.toLowerCase())}`;
|
|
43
|
-
return _saveLabel(hash, label);
|
|
44
|
-
}
|
|
45
|
-
export function saveName(name) {
|
|
46
|
-
const nameArray = name.split('.');
|
|
47
|
-
nameArray.forEach((label) => {
|
|
48
|
-
saveLabel(label);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
// eslint-disable-next-line consistent-return
|
|
52
|
-
export function checkLabel(hash) {
|
|
53
|
-
const labels = getLabels();
|
|
54
|
-
if (isEncodedLabelhash(hash)) {
|
|
55
|
-
return labels[decodeLabelhash(hash)];
|
|
56
|
-
}
|
|
57
|
-
if (hash.startsWith('0x')) {
|
|
58
|
-
return labels[`${hash.slice(2)}`];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export function encodeLabel(label) {
|
|
62
|
-
try {
|
|
63
|
-
return encodeLabelhash(label);
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
return label;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export function parseName(name) {
|
|
70
|
-
const nameArray = name.split('.');
|
|
71
|
-
return nameArray.map((label) => encodeLabel(label)).join('.');
|
|
72
|
-
}
|
|
73
|
-
export function checkIsDecrypted(string) {
|
|
74
|
-
return !string?.includes('[');
|
|
75
|
-
}
|
|
76
|
-
export function decryptName(name) {
|
|
77
|
-
return name
|
|
78
|
-
.split('.')
|
|
79
|
-
.map((label) => checkLabel(label) || label)
|
|
80
|
-
.join('.');
|
|
81
|
-
}
|
|
82
|
-
export const truncateUndecryptedName = (name) => truncateFormat(name);
|
|
83
|
-
export function checkLocalStorageSize() {
|
|
84
|
-
if (!localStorage)
|
|
85
|
-
return 'Empty (0 KB)';
|
|
86
|
-
let allStrings = '';
|
|
87
|
-
for (const key in window.localStorage) {
|
|
88
|
-
if (Object.prototype.hasOwnProperty.call(window.localStorage, key)) {
|
|
89
|
-
allStrings += window.localStorage[key];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return allStrings
|
|
93
|
-
? `${3 + (allStrings.length * 16) / (8 * 1024)} KB`
|
|
94
|
-
: 'Empty (0 KB)';
|
|
95
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { namehash } from './normalise';
|
|
2
|
-
export const makeOtherIndexes = (data, findStr) => Array.from(data.matchAll(findStr)).map((x) => x.index / 2 - 1);
|
|
3
|
-
export const makeNamehashIndexes = (data, name) => Array.from(data.matchAll(namehash(name).substring(2))).map((x) => x.index / 2 - 1);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { concat, hexlify, keccak256, toUtf8Bytes } from 'ethers/lib/utils';
|
|
2
|
-
import uts46 from 'idna-uts46-hx/uts46bundle.js';
|
|
3
|
-
const zeros = new Uint8Array(32);
|
|
4
|
-
zeros.fill(0);
|
|
5
|
-
export const normalise = (name) => name ? uts46.toUnicode(name, { useStd3ASCII: true }) : name;
|
|
6
|
-
export const namehash = (inputName) => {
|
|
7
|
-
let result = zeros;
|
|
8
|
-
const name = normalise(inputName);
|
|
9
|
-
if (name) {
|
|
10
|
-
const labels = name.split('.');
|
|
11
|
-
for (var i = labels.length - 1; i >= 0; i--) {
|
|
12
|
-
const labelSha = keccak256(toUtf8Bytes(labels[i]));
|
|
13
|
-
result = keccak256(concat([result, labelSha]));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
result = hexlify(zeros);
|
|
18
|
-
}
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { PublicResolver } from '../generated';
|
|
2
|
-
declare type RecordItem = {
|
|
3
|
-
key: string;
|
|
4
|
-
value: string;
|
|
5
|
-
};
|
|
6
|
-
export declare type RecordOptions = {
|
|
7
|
-
contentHash?: string;
|
|
8
|
-
texts?: RecordItem[];
|
|
9
|
-
coinTypes?: RecordItem[];
|
|
10
|
-
};
|
|
11
|
-
export declare const generateSetAddr: (namehash: string, coinType: string, address: string, resolver: PublicResolver) => string;
|
|
12
|
-
export declare const generateRecordCallArray: (namehash: string, records: RecordOptions, resolver: PublicResolver) => string[];
|
|
13
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { formatsByCoinType, formatsByName } from '@ensdomains/address-encoder';
|
|
2
|
-
import { encodeContenthash } from './contentHash';
|
|
3
|
-
export const generateSetAddr = (namehash, coinType, address, resolver) => {
|
|
4
|
-
let coinTypeInstance;
|
|
5
|
-
if (!isNaN(parseInt(coinType))) {
|
|
6
|
-
coinTypeInstance = formatsByCoinType[parseInt(coinType)];
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
coinTypeInstance = formatsByName[coinType.toUpperCase()];
|
|
10
|
-
}
|
|
11
|
-
const inputCoinType = coinTypeInstance.coinType;
|
|
12
|
-
const encodedAddress = coinTypeInstance.decoder(address);
|
|
13
|
-
return resolver?.interface.encodeFunctionData('setAddr(bytes32,uint256,bytes)', [namehash, inputCoinType, encodedAddress]);
|
|
14
|
-
};
|
|
15
|
-
export const generateRecordCallArray = (namehash, records, resolver) => {
|
|
16
|
-
const calls = [];
|
|
17
|
-
if (records.contentHash) {
|
|
18
|
-
const contentHash = records.contentHash === '' ? '' : encodeContenthash(records.contentHash);
|
|
19
|
-
const data = resolver?.interface.encodeFunctionData('setContenthash', [namehash, contentHash]);
|
|
20
|
-
data && calls.push(data);
|
|
21
|
-
}
|
|
22
|
-
if (records.texts && records.texts.length > 0) {
|
|
23
|
-
records.texts.forEach(({ key, value }) => {
|
|
24
|
-
const data = resolver?.interface.encodeFunctionData('setText', [
|
|
25
|
-
namehash,
|
|
26
|
-
key,
|
|
27
|
-
value,
|
|
28
|
-
]);
|
|
29
|
-
data && calls.push(data);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
if (records.coinTypes && records.coinTypes.length > 0) {
|
|
33
|
-
records.coinTypes.forEach(({ key, value }) => {
|
|
34
|
-
const data = generateSetAddr(namehash, key, value, resolver);
|
|
35
|
-
data && calls.push(data);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return calls;
|
|
39
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { FuseOptions } from '../@types/FuseOptions';
|
|
2
|
-
import type { PublicResolver } from '../generated';
|
|
3
|
-
import { RecordOptions } from './recordHelpers';
|
|
4
|
-
export declare const randomSecret: () => string;
|
|
5
|
-
export declare const makeCommitment: ({ name, owner, duration, resolver, records, reverseRecord, fuses, }: {
|
|
6
|
-
name: string;
|
|
7
|
-
owner: string;
|
|
8
|
-
duration: number;
|
|
9
|
-
resolver: PublicResolver;
|
|
10
|
-
records?: RecordOptions | undefined;
|
|
11
|
-
reverseRecord?: boolean | undefined;
|
|
12
|
-
fuses?: FuseOptions | undefined;
|
|
13
|
-
}) => {
|
|
14
|
-
secret: string;
|
|
15
|
-
commitment: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const _makeCommitment: ({ labelhash, owner, duration, secret, resolver, data, reverseRecord, fuses, }: {
|
|
18
|
-
labelhash: string;
|
|
19
|
-
owner: string;
|
|
20
|
-
duration: number;
|
|
21
|
-
secret: string;
|
|
22
|
-
resolver: string;
|
|
23
|
-
data: string[];
|
|
24
|
-
reverseRecord: boolean;
|
|
25
|
-
fuses: string;
|
|
26
|
-
}) => string;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { utils } from 'ethers';
|
|
2
|
-
import generateFuseInput from './generateFuseInput';
|
|
3
|
-
import { labelhash } from './labels';
|
|
4
|
-
import { namehash } from './normalise';
|
|
5
|
-
import { generateRecordCallArray } from './recordHelpers';
|
|
6
|
-
export const randomSecret = () => {
|
|
7
|
-
const bytes = Buffer.allocUnsafe(32);
|
|
8
|
-
return '0x' + crypto.getRandomValues(bytes).toString('hex');
|
|
9
|
-
};
|
|
10
|
-
export const makeCommitment = ({ name, owner, duration, resolver, records, reverseRecord, fuses, }) => {
|
|
11
|
-
const label = labelhash(name.split('.')[0]);
|
|
12
|
-
const hash = namehash(name);
|
|
13
|
-
const resolverAddress = resolver.address;
|
|
14
|
-
const data = records ? generateRecordCallArray(hash, records, resolver) : [];
|
|
15
|
-
const secret = randomSecret();
|
|
16
|
-
const fuseData = fuses ? generateFuseInput(fuses) : '0';
|
|
17
|
-
const commitment = _makeCommitment({
|
|
18
|
-
labelhash: label,
|
|
19
|
-
owner,
|
|
20
|
-
duration,
|
|
21
|
-
secret,
|
|
22
|
-
resolver: resolverAddress,
|
|
23
|
-
data,
|
|
24
|
-
reverseRecord: !!reverseRecord,
|
|
25
|
-
fuses: fuseData,
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
secret,
|
|
29
|
-
commitment,
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export const _makeCommitment = ({ labelhash, owner, duration, secret, resolver, data, reverseRecord, fuses, }) => {
|
|
33
|
-
return utils.solidityKeccak256([
|
|
34
|
-
'bytes32',
|
|
35
|
-
'address',
|
|
36
|
-
'uint256',
|
|
37
|
-
'bytes32',
|
|
38
|
-
'address',
|
|
39
|
-
'bytes[]',
|
|
40
|
-
'bool',
|
|
41
|
-
'uint96',
|
|
42
|
-
], [labelhash, owner, duration, secret, resolver, data, reverseRecord, fuses]);
|
|
43
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const validateName: (name: string) => string;
|
|
2
|
-
export declare const validateTLD: (name: string) => string;
|
|
3
|
-
declare type InputType = {
|
|
4
|
-
type: 'name' | 'label' | 'address' | 'unknown';
|
|
5
|
-
info?: 'short' | 'supported' | 'unsupported';
|
|
6
|
-
};
|
|
7
|
-
export declare const parseInputType: (input: string) => InputType;
|
|
8
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { isAddress } from 'ethers/lib/utils';
|
|
2
|
-
import { isEncodedLabelhash, saveName } from './labels';
|
|
3
|
-
import { normalise } from './normalise';
|
|
4
|
-
export const validateName = (name) => {
|
|
5
|
-
const nameArray = name.split('.');
|
|
6
|
-
const hasEmptyLabels = nameArray.some((label) => label.length == 0);
|
|
7
|
-
if (hasEmptyLabels)
|
|
8
|
-
throw new Error('Name cannot have empty labels');
|
|
9
|
-
const normalizedArray = nameArray.map((label) => {
|
|
10
|
-
if (label === '[root]') {
|
|
11
|
-
return label;
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return isEncodedLabelhash(label) ? label : normalise(label);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
const normalizedName = normalizedArray.join('.');
|
|
18
|
-
saveName(normalizedName);
|
|
19
|
-
return normalizedName;
|
|
20
|
-
};
|
|
21
|
-
export const validateTLD = (name) => {
|
|
22
|
-
const labels = name.split('.');
|
|
23
|
-
return validateName(labels[labels.length - 1]);
|
|
24
|
-
};
|
|
25
|
-
export const parseInputType = (input) => {
|
|
26
|
-
const validTLD = validateTLD(input);
|
|
27
|
-
let regex = /[^.]+$/;
|
|
28
|
-
try {
|
|
29
|
-
validateName(input);
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
return {
|
|
33
|
-
type: 'unknown',
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
if (input.indexOf('.') !== -1) {
|
|
37
|
-
const termArray = input.split('.');
|
|
38
|
-
const tld = input.match(regex) ? input.match(regex)[0] : '';
|
|
39
|
-
if (validTLD) {
|
|
40
|
-
if (tld === 'eth' && [...termArray[termArray.length - 2]].length < 3) {
|
|
41
|
-
// code-point length
|
|
42
|
-
return {
|
|
43
|
-
type: 'name',
|
|
44
|
-
info: 'short',
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
type: 'name',
|
|
49
|
-
info: 'supported',
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
type: 'name',
|
|
54
|
-
info: 'unsupported',
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
else if (isAddress(input)) {
|
|
58
|
-
return {
|
|
59
|
-
type: 'address',
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
return {
|
|
64
|
-
type: 'label',
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
};
|