@tradetrust-tt/dnsprove 2.12.3 → 2.12.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.
@@ -29,6 +29,8 @@ let EthereumNetworks = exports.EthereumNetworks = void 0;
29
29
  EthereumNetworks["xdcapothem"] = "51";
30
30
  EthereumNetworks["stabilityTestnet"] = "20180427";
31
31
  EthereumNetworks["stability"] = "101010";
32
+ EthereumNetworks["hedera"] = "295";
33
+ EthereumNetworks["hederatestnet"] = "296";
32
34
  })(EthereumNetworks || (exports.EthereumNetworks = EthereumNetworks = {}));
33
35
  let HederaNetworks = exports.HederaNetworks = void 0;
34
36
  (function (HederaNetworks) {
@@ -36,7 +38,7 @@ let HederaNetworks = exports.HederaNetworks = void 0;
36
38
  HederaNetworks["testnet"] = "296";
37
39
  })(HederaNetworks || (exports.HederaNetworks = HederaNetworks = {}));
38
40
  const HederaNetworkIdT = exports.HederaNetworkIdT = (0, _runtypes.Union)((0, _runtypes.Literal)(HederaNetworks.mainnet), (0, _runtypes.Literal)(HederaNetworks.testnet));
39
- const EthereumNetworkIdT = exports.EthereumNetworkIdT = (0, _runtypes.Union)((0, _runtypes.Literal)(EthereumNetworks.homestead), (0, _runtypes.Literal)(EthereumNetworks.ropsten), (0, _runtypes.Literal)(EthereumNetworks.rinkeby), (0, _runtypes.Literal)(EthereumNetworks.goerli), (0, _runtypes.Literal)(EthereumNetworks.sepolia), (0, _runtypes.Literal)(EthereumNetworks.polygon), (0, _runtypes.Literal)(EthereumNetworks.polygonAmoy), (0, _runtypes.Literal)(EthereumNetworks.xdc), (0, _runtypes.Literal)(EthereumNetworks.xdcapothem), (0, _runtypes.Literal)(EthereumNetworks.stabilityTestnet), (0, _runtypes.Literal)(EthereumNetworks.stability), (0, _runtypes.Literal)(EthereumNetworks.local));
41
+ const EthereumNetworkIdT = exports.EthereumNetworkIdT = (0, _runtypes.Union)((0, _runtypes.Literal)(EthereumNetworks.homestead), (0, _runtypes.Literal)(EthereumNetworks.ropsten), (0, _runtypes.Literal)(EthereumNetworks.rinkeby), (0, _runtypes.Literal)(EthereumNetworks.goerli), (0, _runtypes.Literal)(EthereumNetworks.sepolia), (0, _runtypes.Literal)(EthereumNetworks.polygon), (0, _runtypes.Literal)(EthereumNetworks.polygonAmoy), (0, _runtypes.Literal)(EthereumNetworks.xdc), (0, _runtypes.Literal)(EthereumNetworks.xdcapothem), (0, _runtypes.Literal)(EthereumNetworks.stabilityTestnet), (0, _runtypes.Literal)(EthereumNetworks.stability), (0, _runtypes.Literal)(EthereumNetworks.local), (0, _runtypes.Literal)(EthereumNetworks.hedera), (0, _runtypes.Literal)(EthereumNetworks.hederatestnet));
40
42
  const OpenAttestationDNSTextRecordT = exports.OpenAttestationDNSTextRecordT = (0, _runtypes.Union)((0, _runtypes.Record)({
41
43
  type: RecordTypesT,
42
44
  net: (0, _runtypes.Literal)("ethereum"),
@@ -15,18 +15,20 @@ export declare enum EthereumNetworks {
15
15
  xdc = "50",
16
16
  xdcapothem = "51",
17
17
  stabilityTestnet = "20180427",
18
- stability = "101010"
18
+ stability = "101010",
19
+ hedera = "295",
20
+ hederatestnet = "296"
19
21
  }
20
22
  export declare enum HederaNetworks {
21
23
  mainnet = "295",
22
24
  testnet = "296"
23
25
  }
24
26
  export declare const HederaNetworkIdT: Union<[Literal<HederaNetworks.mainnet>, Literal<HederaNetworks.testnet>]>;
25
- export declare const EthereumNetworkIdT: Union<[Literal<EthereumNetworks.homestead>, Literal<EthereumNetworks.ropsten>, Literal<EthereumNetworks.rinkeby>, Literal<EthereumNetworks.goerli>, Literal<EthereumNetworks.sepolia>, Literal<EthereumNetworks.polygon>, Literal<EthereumNetworks.polygonAmoy>, Literal<EthereumNetworks.xdc>, Literal<EthereumNetworks.xdcapothem>, Literal<EthereumNetworks.stabilityTestnet>, Literal<EthereumNetworks.stability>, Literal<EthereumNetworks.local>]>;
27
+ export declare const EthereumNetworkIdT: Union<[Literal<EthereumNetworks.homestead>, Literal<EthereumNetworks.ropsten>, Literal<EthereumNetworks.rinkeby>, Literal<EthereumNetworks.goerli>, Literal<EthereumNetworks.sepolia>, Literal<EthereumNetworks.polygon>, Literal<EthereumNetworks.polygonAmoy>, Literal<EthereumNetworks.xdc>, Literal<EthereumNetworks.xdcapothem>, Literal<EthereumNetworks.stabilityTestnet>, Literal<EthereumNetworks.stability>, Literal<EthereumNetworks.local>, Literal<EthereumNetworks.hedera>, Literal<EthereumNetworks.hederatestnet>]>;
26
28
  export declare const OpenAttestationDNSTextRecordT: Union<[import("runtypes").Intersect<[Record<{
27
29
  type: Literal<"openatts">;
28
30
  net: Literal<"ethereum">;
29
- netId: Union<[Literal<EthereumNetworks.homestead>, Literal<EthereumNetworks.ropsten>, Literal<EthereumNetworks.rinkeby>, Literal<EthereumNetworks.goerli>, Literal<EthereumNetworks.sepolia>, Literal<EthereumNetworks.polygon>, Literal<EthereumNetworks.polygonAmoy>, Literal<EthereumNetworks.xdc>, Literal<EthereumNetworks.xdcapothem>, Literal<EthereumNetworks.stabilityTestnet>, Literal<EthereumNetworks.stability>, Literal<EthereumNetworks.local>]>;
31
+ netId: Union<[Literal<EthereumNetworks.homestead>, Literal<EthereumNetworks.ropsten>, Literal<EthereumNetworks.rinkeby>, Literal<EthereumNetworks.goerli>, Literal<EthereumNetworks.sepolia>, Literal<EthereumNetworks.polygon>, Literal<EthereumNetworks.polygonAmoy>, Literal<EthereumNetworks.xdc>, Literal<EthereumNetworks.xdcapothem>, Literal<EthereumNetworks.stabilityTestnet>, Literal<EthereumNetworks.stability>, Literal<EthereumNetworks.local>, Literal<EthereumNetworks.hedera>, Literal<EthereumNetworks.hederatestnet>]>;
30
32
  addr: import("runtypes").Constraint<String, string, unknown>;
31
33
  }, false>, Partial<{
32
34
  dnssec: Boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradetrust-tt/dnsprove",
3
- "version": "2.12.3",
3
+ "version": "2.12.4",
4
4
  "description": "Helper utility for retrieving OpenAttestations document store address records from DNS",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/index.test.ts CHANGED
@@ -261,35 +261,42 @@ describe("getDocumentStoreRecords for Hedera", () => {
261
261
  {
262
262
  type: "openatts",
263
263
  net: "hedera",
264
- netId: "296",
264
+ netId: "295",
265
+ addr: "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21",
265
266
  dnssec: false,
266
- addr: "0x3DE43bfd3D771931E46CbBd4EDE0D3d95C85f81A",
267
267
  },
268
268
  {
269
+ type: "openatts",
270
+ net: "hedera",
271
+ netId: "296",
269
272
  addr: "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21",
270
273
  dnssec: false,
271
- net: "hedera",
272
- netId: "295",
273
- type: "openatts",
274
274
  },
275
275
  {
276
- addr: "0xB9cf2eFcBeCdF96E6A7E46AECd79A784B41Bcf6B",
277
- dnssec: false,
276
+ type: "openatts",
278
277
  net: "hedera",
279
278
  netId: "296",
280
- type: "openatts",
279
+ addr: "0x3DE43bfd3D771931E46CbBd4EDE0D3d95C85f81A",
280
+ dnssec: false,
281
281
  },
282
282
  {
283
- addr: "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21",
284
- dnssec: false,
283
+ type: "openatts",
285
284
  net: "hedera",
286
285
  netId: "296",
287
- type: "openatts",
286
+ addr: "0xB9cf2eFcBeCdF96E6A7E46AECd79A784B41Bcf6B",
287
+ dnssec: false,
288
288
  },
289
289
  ];
290
290
 
291
291
  test("it should work with trustlv.org", async () => {
292
- const records = await getDocumentStoreRecords("trustlv.org");
292
+ const records = (await getDocumentStoreRecords("trustlv.org")).sort((a, b) => {
293
+ if (a.netId < b.netId) return -1;
294
+ if (a.netId > b.netId) return 1;
295
+ if (a.addr < b.addr) return -1;
296
+ if (a.addr > b.addr) return 1;
297
+ return 0;
298
+ });
299
+
293
300
  expect(records).toStrictEqual(sampleDnsTextRecord);
294
301
  });
295
302
  });
@@ -26,6 +26,8 @@ export enum EthereumNetworks {
26
26
  xdcapothem = "51",
27
27
  stabilityTestnet = "20180427",
28
28
  stability = "101010",
29
+ hedera = "295",
30
+ hederatestnet = "296",
29
31
  }
30
32
 
31
33
  export enum HederaNetworks {
@@ -46,7 +48,9 @@ export const EthereumNetworkIdT = Union(
46
48
  Literal(EthereumNetworks.xdcapothem),
47
49
  Literal(EthereumNetworks.stabilityTestnet),
48
50
  Literal(EthereumNetworks.stability),
49
- Literal(EthereumNetworks.local)
51
+ Literal(EthereumNetworks.local),
52
+ Literal(EthereumNetworks.hedera),
53
+ Literal(EthereumNetworks.hederatestnet)
50
54
  );
51
55
 
52
56
  export const OpenAttestationDNSTextRecordT = Union(