@tradetrust-tt/dnsprove 2.12.2 → 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.
- package/dist/records/dnsTxt.js +3 -2
- package/dist/ts/records/dnsTxt.d.ts +5 -4
- package/package.json +1 -1
- package/src/index.test.ts +19 -12
- package/src/records/dnsTxt.ts +5 -3
package/dist/records/dnsTxt.js
CHANGED
|
@@ -23,13 +23,14 @@ let EthereumNetworks = exports.EthereumNetworks = void 0;
|
|
|
23
23
|
EthereumNetworks["goerli"] = "5";
|
|
24
24
|
EthereumNetworks["sepolia"] = "11155111";
|
|
25
25
|
EthereumNetworks["polygon"] = "137";
|
|
26
|
-
EthereumNetworks["polygonMumbai"] = "80001";
|
|
27
26
|
EthereumNetworks["polygonAmoy"] = "80002";
|
|
28
27
|
EthereumNetworks["local"] = "1337";
|
|
29
28
|
EthereumNetworks["xdc"] = "50";
|
|
30
29
|
EthereumNetworks["xdcapothem"] = "51";
|
|
31
30
|
EthereumNetworks["stabilityTestnet"] = "20180427";
|
|
32
31
|
EthereumNetworks["stability"] = "101010";
|
|
32
|
+
EthereumNetworks["hedera"] = "295";
|
|
33
|
+
EthereumNetworks["hederatestnet"] = "296";
|
|
33
34
|
})(EthereumNetworks || (exports.EthereumNetworks = EthereumNetworks = {}));
|
|
34
35
|
let HederaNetworks = exports.HederaNetworks = void 0;
|
|
35
36
|
(function (HederaNetworks) {
|
|
@@ -37,7 +38,7 @@ let HederaNetworks = exports.HederaNetworks = void 0;
|
|
|
37
38
|
HederaNetworks["testnet"] = "296";
|
|
38
39
|
})(HederaNetworks || (exports.HederaNetworks = HederaNetworks = {}));
|
|
39
40
|
const HederaNetworkIdT = exports.HederaNetworkIdT = (0, _runtypes.Union)((0, _runtypes.Literal)(HederaNetworks.mainnet), (0, _runtypes.Literal)(HederaNetworks.testnet));
|
|
40
|
-
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.
|
|
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));
|
|
41
42
|
const OpenAttestationDNSTextRecordT = exports.OpenAttestationDNSTextRecordT = (0, _runtypes.Union)((0, _runtypes.Record)({
|
|
42
43
|
type: RecordTypesT,
|
|
43
44
|
net: (0, _runtypes.Literal)("ethereum"),
|
|
@@ -10,24 +10,25 @@ export declare enum EthereumNetworks {
|
|
|
10
10
|
goerli = "5",
|
|
11
11
|
sepolia = "11155111",
|
|
12
12
|
polygon = "137",
|
|
13
|
-
polygonMumbai = "80001",
|
|
14
13
|
polygonAmoy = "80002",
|
|
15
14
|
local = "1337",
|
|
16
15
|
xdc = "50",
|
|
17
16
|
xdcapothem = "51",
|
|
18
17
|
stabilityTestnet = "20180427",
|
|
19
|
-
stability = "101010"
|
|
18
|
+
stability = "101010",
|
|
19
|
+
hedera = "295",
|
|
20
|
+
hederatestnet = "296"
|
|
20
21
|
}
|
|
21
22
|
export declare enum HederaNetworks {
|
|
22
23
|
mainnet = "295",
|
|
23
24
|
testnet = "296"
|
|
24
25
|
}
|
|
25
26
|
export declare const HederaNetworkIdT: Union<[Literal<HederaNetworks.mainnet>, Literal<HederaNetworks.testnet>]>;
|
|
26
|
-
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.
|
|
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>]>;
|
|
27
28
|
export declare const OpenAttestationDNSTextRecordT: Union<[import("runtypes").Intersect<[Record<{
|
|
28
29
|
type: Literal<"openatts">;
|
|
29
30
|
net: Literal<"ethereum">;
|
|
30
|
-
netId: Union<[Literal<EthereumNetworks.homestead>, Literal<EthereumNetworks.ropsten>, Literal<EthereumNetworks.rinkeby>, Literal<EthereumNetworks.goerli>, Literal<EthereumNetworks.sepolia>, Literal<EthereumNetworks.polygon>, Literal<EthereumNetworks.
|
|
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>]>;
|
|
31
32
|
addr: import("runtypes").Constraint<String, string, unknown>;
|
|
32
33
|
}, false>, Partial<{
|
|
33
34
|
dnssec: Boolean;
|
package/package.json
CHANGED
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: "
|
|
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
|
-
|
|
277
|
-
dnssec: false,
|
|
276
|
+
type: "openatts",
|
|
278
277
|
net: "hedera",
|
|
279
278
|
netId: "296",
|
|
280
|
-
|
|
279
|
+
addr: "0x3DE43bfd3D771931E46CbBd4EDE0D3d95C85f81A",
|
|
280
|
+
dnssec: false,
|
|
281
281
|
},
|
|
282
282
|
{
|
|
283
|
-
|
|
284
|
-
dnssec: false,
|
|
283
|
+
type: "openatts",
|
|
285
284
|
net: "hedera",
|
|
286
285
|
netId: "296",
|
|
287
|
-
|
|
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
|
});
|
package/src/records/dnsTxt.ts
CHANGED
|
@@ -20,13 +20,14 @@ export enum EthereumNetworks {
|
|
|
20
20
|
goerli = "5",
|
|
21
21
|
sepolia = "11155111",
|
|
22
22
|
polygon = "137",
|
|
23
|
-
polygonMumbai = "80001",
|
|
24
23
|
polygonAmoy = "80002",
|
|
25
24
|
local = "1337",
|
|
26
25
|
xdc = "50",
|
|
27
26
|
xdcapothem = "51",
|
|
28
27
|
stabilityTestnet = "20180427",
|
|
29
28
|
stability = "101010",
|
|
29
|
+
hedera = "295",
|
|
30
|
+
hederatestnet = "296",
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export enum HederaNetworks {
|
|
@@ -42,13 +43,14 @@ export const EthereumNetworkIdT = Union(
|
|
|
42
43
|
Literal(EthereumNetworks.goerli),
|
|
43
44
|
Literal(EthereumNetworks.sepolia),
|
|
44
45
|
Literal(EthereumNetworks.polygon),
|
|
45
|
-
Literal(EthereumNetworks.polygonMumbai),
|
|
46
46
|
Literal(EthereumNetworks.polygonAmoy),
|
|
47
47
|
Literal(EthereumNetworks.xdc),
|
|
48
48
|
Literal(EthereumNetworks.xdcapothem),
|
|
49
49
|
Literal(EthereumNetworks.stabilityTestnet),
|
|
50
50
|
Literal(EthereumNetworks.stability),
|
|
51
|
-
Literal(EthereumNetworks.local)
|
|
51
|
+
Literal(EthereumNetworks.local),
|
|
52
|
+
Literal(EthereumNetworks.hedera),
|
|
53
|
+
Literal(EthereumNetworks.hederatestnet)
|
|
52
54
|
);
|
|
53
55
|
|
|
54
56
|
export const OpenAttestationDNSTextRecordT = Union(
|