@tradetrust-tt/dnsprove 2.16.0 → 2.18.0

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.
@@ -24,9 +24,10 @@ let EthereumNetworks = exports.EthereumNetworks = void 0;
24
24
  EthereumNetworks["xdcapothem"] = "51";
25
25
  EthereumNetworks["stabilityTestnet"] = "20180427";
26
26
  EthereumNetworks["stability"] = "101010";
27
+ EthereumNetworks["astronTestnet"] = "21002";
27
28
  EthereumNetworks["astron"] = "1338";
28
29
  })(EthereumNetworks || (exports.EthereumNetworks = EthereumNetworks = {}));
29
- 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.astron));
30
+ 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.astronTestnet), (0, _runtypes.Literal)(EthereumNetworks.astron));
30
31
  const OpenAttestationDNSTextRecordT = exports.OpenAttestationDNSTextRecordT = (0, _runtypes.Record)({
31
32
  type: RecordTypesT,
32
33
  net: BlockchainNetworkT,
@@ -15,13 +15,14 @@ export declare enum EthereumNetworks {
15
15
  xdcapothem = "51",
16
16
  stabilityTestnet = "20180427",
17
17
  stability = "101010",
18
+ astronTestnet = "21002",
18
19
  astron = "1338"
19
20
  }
20
- 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.astron>]>;
21
+ 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.astronTestnet>, Literal<EthereumNetworks.astron>]>;
21
22
  export declare const OpenAttestationDNSTextRecordT: import("runtypes").Intersect<[Record<{
22
23
  type: Literal<"openatts">;
23
24
  net: Literal<"ethereum">;
24
- 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.astron>]>;
25
+ 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.astronTestnet>, Literal<EthereumNetworks.astron>]>;
25
26
  addr: import("runtypes").Constraint<String, string, unknown>;
26
27
  }, false>, Partial<{
27
28
  dnssec: Boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradetrust-tt/dnsprove",
3
- "version": "2.16.0",
3
+ "version": "2.18.0",
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
@@ -281,20 +281,51 @@ describe("queryDns", () => {
281
281
  });
282
282
  });
283
283
 
284
+ describe("getDocumentStoreRecords for AstronTestnet", () => {
285
+ const sampleDnsTextRecord = [
286
+ {
287
+ type: "openatts",
288
+ net: "ethereum",
289
+ netId: "21002",
290
+ addr: "0xb1Bf514b3893357813F366282E887eE221D5C2dA",
291
+ dnssec: false,
292
+ },
293
+ {
294
+ type: "openatts",
295
+ net: "ethereum",
296
+ netId: "21002",
297
+ addr: "0xdAEe89A37fEEBCBFAc94aBA63Fb163808dAc38Fb",
298
+ dnssec: false,
299
+ },
300
+ ];
301
+
302
+ test("it should work with dev-astronlayer2.bitfactory.cn", async () => {
303
+ const records = (await getDocumentStoreRecords("dev-astronlayer2.bitfactory.cn")).sort((a, b) => {
304
+ if (a.netId < b.netId) return -1;
305
+ if (a.netId > b.netId) return 1;
306
+ if (a.addr < b.addr) return -1;
307
+ if (a.addr > b.addr) return 1;
308
+ return 0;
309
+ });
310
+
311
+ expect(records).toStrictEqual(sampleDnsTextRecord);
312
+ });
313
+ });
314
+
284
315
  describe("getDocumentStoreRecords for Astron", () => {
285
316
  const sampleDnsTextRecord = [
286
317
  {
287
318
  type: "openatts",
288
319
  net: "ethereum",
289
320
  netId: "1338",
290
- addr: "0x0D5da59B93e8AC9b1781CE5694fbcE626586F4c9",
321
+ addr: "0x18bc0127Ae33389cD96593a1a612774fD14c0737",
291
322
  dnssec: false,
292
323
  },
293
324
  {
294
325
  type: "openatts",
295
326
  net: "ethereum",
296
327
  netId: "1338",
297
- addr: "0x94FD21A026E29E0686583b8be71Cb28a8ca1A8d4",
328
+ addr: "0xc98d993271a997384889dd39c14cec0c1e0206c2",
298
329
  dnssec: false,
299
330
  },
300
331
  ];
@@ -21,6 +21,7 @@ export enum EthereumNetworks {
21
21
  xdcapothem = "51",
22
22
  stabilityTestnet = "20180427",
23
23
  stability = "101010",
24
+ astronTestnet = "21002",
24
25
  astron = "1338",
25
26
  }
26
27
 
@@ -37,6 +38,7 @@ export const EthereumNetworkIdT = Union(
37
38
  Literal(EthereumNetworks.stabilityTestnet),
38
39
  Literal(EthereumNetworks.stability),
39
40
  Literal(EthereumNetworks.local),
41
+ Literal(EthereumNetworks.astronTestnet),
40
42
  Literal(EthereumNetworks.astron)
41
43
  );
42
44