@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.
- package/dist/records/dnsTxt.js +2 -1
- package/dist/ts/records/dnsTxt.d.ts +3 -2
- package/package.json +1 -1
- package/src/index.test.ts +33 -2
- package/src/records/dnsTxt.ts +2 -0
package/dist/records/dnsTxt.js
CHANGED
|
@@ -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
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: "
|
|
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: "
|
|
328
|
+
addr: "0xc98d993271a997384889dd39c14cec0c1e0206c2",
|
|
298
329
|
dnssec: false,
|
|
299
330
|
},
|
|
300
331
|
];
|
package/src/records/dnsTxt.ts
CHANGED
|
@@ -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
|
|