@ensdomains/ensjs 3.0.0-alpha.3 → 3.0.0-alpha.4

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.
@@ -4,4 +4,4 @@ export declare function encodeURLParams(p: {
4
4
  }): string;
5
5
  export declare const getDNS: (q: packet.Packet) => Promise<packet.Packet>;
6
6
  export declare const dnsQuery: (qtype: string, qname: string) => Promise<packet.Packet>;
7
- export default function (dnsName: string): Promise<any>;
7
+ export default function (_: any, dnsName: string): Promise<any>;
@@ -73,7 +73,7 @@ const dnsQuery = async (qtype, qname) => {
73
73
  return response;
74
74
  };
75
75
  exports.dnsQuery = dnsQuery;
76
- async function default_1(dnsName) {
76
+ async function default_1(_, dnsName) {
77
77
  const result = await (0, exports.dnsQuery)('TXT', `_ens.${dnsName}`);
78
78
  const address = result?.answers?.[0]?.data?.[0]?.toString()?.split('=')?.[1];
79
79
  return address;
@@ -466,6 +466,6 @@ export declare class ENS {
466
466
  transferSubname: (name: string, contract: "nameWrapper" | "registry", address: string, options?: {
467
467
  addressOrIndex?: string | number | undefined;
468
468
  } | undefined) => Promise<ethers.ContractTransaction>;
469
- getDNSOwner: () => Promise<any>;
469
+ getDNSOwner: (dnsName: string) => Promise<any>;
470
470
  }
471
471
  export {};
package/dist/cjs/index.js CHANGED
@@ -96,9 +96,6 @@ class ENS {
96
96
  if (subFunc !== 'combine') {
97
97
  // get the function to call
98
98
  const func = subFunc ? mod[exportName][subFunc] : mod[exportName];
99
- if (dependencies.length === 0) {
100
- return func(...args);
101
- }
102
99
  // get the dependencies to forward to the function as the first arg
103
100
  const dependenciesToForward = thisRef.forwardDependenciesFromArray(dependencies);
104
101
  // return the function with the dependencies forwarded
@@ -4,4 +4,4 @@ export declare function encodeURLParams(p: {
4
4
  }): string;
5
5
  export declare const getDNS: (q: packet.Packet) => Promise<packet.Packet>;
6
6
  export declare const dnsQuery: (qtype: string, qname: string) => Promise<packet.Packet>;
7
- export default function (dnsName: string): Promise<any>;
7
+ export default function (_: any, dnsName: string): Promise<any>;
@@ -44,7 +44,7 @@ export const dnsQuery = async (qtype, qname) => {
44
44
  }
45
45
  return response;
46
46
  };
47
- export default async function (dnsName) {
47
+ export default async function (_, dnsName) {
48
48
  const result = await dnsQuery('TXT', `_ens.${dnsName}`);
49
49
  const address = result?.answers?.[0]?.data?.[0]?.toString()?.split('=')?.[1];
50
50
  return address;
@@ -466,6 +466,6 @@ export declare class ENS {
466
466
  transferSubname: (name: string, contract: "nameWrapper" | "registry", address: string, options?: {
467
467
  addressOrIndex?: string | number | undefined;
468
468
  } | undefined) => Promise<ethers.ContractTransaction>;
469
- getDNSOwner: () => Promise<any>;
469
+ getDNSOwner: (dnsName: string) => Promise<any>;
470
470
  }
471
471
  export {};
package/dist/esm/index.js CHANGED
@@ -59,9 +59,6 @@ export class ENS {
59
59
  if (subFunc !== 'combine') {
60
60
  // get the function to call
61
61
  const func = subFunc ? mod[exportName][subFunc] : mod[exportName];
62
- if (dependencies.length === 0) {
63
- return func(...args);
64
- }
65
62
  // get the dependencies to forward to the function as the first arg
66
63
  const dependenciesToForward = thisRef.forwardDependenciesFromArray(dependencies);
67
64
  // return the function with the dependencies forwarded
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ensdomains/ensjs",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.4",
4
4
  "description": "ENS javascript library for contract interaction",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
@@ -81,5 +81,5 @@
81
81
  "peerDependencies": {
82
82
  "ethers": "*"
83
83
  },
84
- "stableVersion": "3.0.0-alpha.2"
84
+ "stableVersion": "3.0.0-alpha.3"
85
85
  }
@@ -70,7 +70,7 @@ describe('getDNSOwner', () => {
70
70
  '726c2b1d3bab6b74-TPE',
71
71
  ],
72
72
  )
73
- expect(await getDNSOwner(dnsName)).toEqual(
73
+ expect(await getDNSOwner({}, dnsName)).toEqual(
74
74
  '0x983110309620D911731Ac0932219af06091b6744',
75
75
  )
76
76
  })
@@ -114,7 +114,7 @@ describe('getDNSOwner', () => {
114
114
  ],
115
115
  )
116
116
  try {
117
- await getDNSOwner(dnsName)
117
+ await getDNSOwner({}, dnsName)
118
118
  } catch (error) {
119
119
  expect(error.message).toEqual('DNS query failed: NXDOMAIN')
120
120
  }
@@ -54,7 +54,7 @@ export const dnsQuery = async (
54
54
  return response
55
55
  }
56
56
 
57
- export default async function (dnsName: string) {
57
+ export default async function (_: any, dnsName: string) {
58
58
  const result = await dnsQuery('TXT', `_ens.${dnsName}`)
59
59
  const address = result?.answers?.[0]?.data?.[0]?.toString()?.split('=')?.[1]
60
60
  return address
package/src/index.ts CHANGED
@@ -195,9 +195,6 @@ export class ENS {
195
195
  if (subFunc !== 'combine') {
196
196
  // get the function to call
197
197
  const func = subFunc ? mod[exportName][subFunc] : mod[exportName]
198
- if(dependencies.length === 0) {
199
- return func(...args)
200
- }
201
198
  // get the dependencies to forward to the function as the first arg
202
199
  const dependenciesToForward =
203
200
  thisRef.forwardDependenciesFromArray<F>(dependencies)