@ensdomains/ensjs 3.0.0-alpha.37 → 3.0.0-alpha.38

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.
Files changed (59) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -0
  3. package/dist/cjs/GqlManager.js +22 -20
  4. package/dist/cjs/contracts/getContractAddress.js +1 -1
  5. package/dist/cjs/contracts/index.js +44 -46
  6. package/dist/cjs/functions/batchWrappers.js +6 -6
  7. package/dist/cjs/functions/createSubname.js +1 -1
  8. package/dist/cjs/functions/getAvailable.js +2 -2
  9. package/dist/cjs/functions/getDNSOwner.js +4 -2
  10. package/dist/cjs/functions/getExpiry.js +4 -4
  11. package/dist/cjs/functions/getName.js +2 -2
  12. package/dist/cjs/functions/getNames.js +6 -6
  13. package/dist/cjs/functions/getOwner.js +10 -9
  14. package/dist/cjs/functions/getPrice.js +4 -4
  15. package/dist/cjs/functions/getProfile.js +10 -10
  16. package/dist/cjs/functions/getResolver.js +2 -2
  17. package/dist/cjs/functions/getSpecificRecord.js +6 -6
  18. package/dist/cjs/functions/getSubnames.js +4 -4
  19. package/dist/cjs/functions/getWrapperData.js +2 -2
  20. package/dist/cjs/functions/importDNSSECName.js +5 -5
  21. package/dist/cjs/functions/setName.js +3 -2
  22. package/dist/cjs/functions/setRecord.js +2 -1
  23. package/dist/cjs/functions/setRecords.js +2 -1
  24. package/dist/cjs/functions/setResolver.js +2 -2
  25. package/dist/cjs/functions/supportsTLD.js +1 -1
  26. package/dist/cjs/functions/transferController.js +2 -2
  27. package/dist/cjs/functions/transferName.js +3 -3
  28. package/dist/cjs/functions/wrapName.js +3 -3
  29. package/dist/cjs/generated/factories/BaseRegistrarImplementation__factory.js +1 -1
  30. package/dist/cjs/generated/factories/BulkRenewal__factory.js +1 -1
  31. package/dist/cjs/generated/factories/DNSRegistrar__factory.js +1 -1
  32. package/dist/cjs/generated/factories/DNSSECImpl__factory.js +1 -1
  33. package/dist/cjs/generated/factories/DefaultReverseResolver__factory.js +1 -1
  34. package/dist/cjs/generated/factories/ENSRegistry__factory.js +1 -1
  35. package/dist/cjs/generated/factories/ETHRegistrarController__factory.js +1 -1
  36. package/dist/cjs/generated/factories/Multicall__factory.js +1 -1
  37. package/dist/cjs/generated/factories/NameWrapper__factory.js +1 -1
  38. package/dist/cjs/generated/factories/P256SHA256Algorithm__factory.js +1 -1
  39. package/dist/cjs/generated/factories/PublicResolver__factory.js +1 -1
  40. package/dist/cjs/generated/factories/RSASHA1Algorithm__factory.js +1 -1
  41. package/dist/cjs/generated/factories/RSASHA256Algorithm__factory.js +1 -1
  42. package/dist/cjs/generated/factories/ReverseRegistrar__factory.js +1 -1
  43. package/dist/cjs/generated/factories/Root__factory.js +1 -1
  44. package/dist/cjs/generated/factories/SHA1Digest__factory.js +1 -1
  45. package/dist/cjs/generated/factories/SHA1NSEC3Digest__factory.js +1 -1
  46. package/dist/cjs/generated/factories/SHA256Digest__factory.js +1 -1
  47. package/dist/cjs/generated/factories/StaticMetadataService__factory.js +1 -1
  48. package/dist/cjs/generated/factories/TLDPublicSuffixList__factory.js +1 -1
  49. package/dist/cjs/generated/factories/UniversalResolver__factory.js +1 -1
  50. package/dist/cjs/index.js +295 -296
  51. package/dist/cjs/utils/labels.js +1 -1
  52. package/dist/cjs/utils/recordHelpers.js +1 -1
  53. package/dist/cjs/utils/registerHelpers.js +2 -1
  54. package/dist/cjs/utils/wrapper.js +1 -1
  55. package/dist/esm/contracts/getContractAddress.mjs +1 -1
  56. package/dist/esm/index.mjs +4 -1
  57. package/package.json +1 -1
  58. package/src/contracts/getContractAddress.ts +1 -1
  59. package/src/index.ts +6 -2
@@ -38,10 +38,13 @@ var ENS = class {
38
38
  const thisRef = this;
39
39
  const mainFunc = async function(...args) {
40
40
  await thisRef.checkInitialProvider();
41
- const mod = await import(
41
+ let mod = await import(
42
42
  /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */
43
43
  `./functions/${path}`
44
44
  );
45
+ if (mod.default?.[exportName]) {
46
+ mod = mod.default;
47
+ }
45
48
  if (subFunc !== "combine") {
46
49
  const writeable = subFunc === "write" || subFunc === "populateTransaction";
47
50
  const func = subFunc && !writeable ? mod[exportName][subFunc] : mod[exportName];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ensdomains/ensjs",
3
- "version": "3.0.0-alpha.37",
3
+ "version": "3.0.0-alpha.38",
4
4
  "description": "ENS javascript library for contract interaction",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -46,7 +46,7 @@ const addresses: Record<
46
46
  '5': '0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48',
47
47
  },
48
48
  UniversalResolver: {
49
- '1': '0x580AF46E06DaaD47eb5940526FD64d95b815Cb70',
49
+ '1': '0x74E20Bd2A1fE0cdbe45b9A1d89cb7e0a45b36376',
50
50
  '3': '0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376',
51
51
  '4': '0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376',
52
52
  '5': '0x687c30Cc44bFA39A1449e86E172BF002E7b3f0b0',
package/src/index.ts CHANGED
@@ -15,7 +15,6 @@ import type createSubname from './functions/createSubname'
15
15
  import type deleteSubname from './functions/deleteSubname'
16
16
  import type getAvailable from './functions/getAvailable'
17
17
  import type getDNSOwner from './functions/getDNSOwner'
18
- import type supportsTLD from './functions/supportsTLD'
19
18
  import type getExpiry from './functions/getExpiry'
20
19
  import type { getHistory } from './functions/getHistory'
21
20
  import type getName from './functions/getName'
@@ -46,6 +45,7 @@ import type setName from './functions/setName'
46
45
  import type setRecord from './functions/setRecord'
47
46
  import type setRecords from './functions/setRecords'
48
47
  import type setResolver from './functions/setResolver'
48
+ import type supportsTLD from './functions/supportsTLD'
49
49
  import type transferController from './functions/transferController'
50
50
  import type transferName from './functions/transferName'
51
51
  import type transferSubname from './functions/transferSubname'
@@ -259,10 +259,14 @@ export class ENS {
259
259
  // check the initial provider and set if it exists
260
260
  await thisRef.checkInitialProvider()
261
261
  // import the module dynamically
262
- const mod = await import(
262
+ let mod = await import(
263
263
  /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */
264
264
  `./functions/${path}`
265
265
  )
266
+ // if export is nested in default, use default
267
+ if (mod.default?.[exportName]) {
268
+ mod = mod.default
269
+ }
266
270
 
267
271
  // if combine isn't specified, run normally
268
272
  // otherwise, create a function from the raw and decode functions