@xyo-network/xns-record-payload-plugins 3.1.2 → 3.2.0-rc.1
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/browser/Address/Payload.d.ts +1 -4
- package/dist/browser/Address/Payload.d.ts.map +1 -1
- package/dist/browser/DNS/Witness/Payload/Request.d.ts +0 -4
- package/dist/browser/DNS/Witness/Payload/Request.d.ts.map +1 -1
- package/dist/browser/DNS/Witness/Payload/Response.d.ts +0 -4
- package/dist/browser/DNS/Witness/Payload/Response.d.ts.map +1 -1
- package/dist/browser/Domain/Domain.d.ts +0 -6
- package/dist/browser/Domain/Domain.d.ts.map +1 -1
- package/dist/browser/Domain/DomainLease.d.ts +0 -6
- package/dist/browser/Domain/DomainLease.d.ts.map +1 -1
- package/dist/browser/DomainEstimate/DomainEstimate.d.ts +4 -4
- package/dist/browser/DomainEstimate/DomainEstimate.d.ts.map +1 -1
- package/dist/browser/DomainRegistration/DomainRegistration.d.ts +0 -6
- package/dist/browser/DomainRegistration/DomainRegistration.d.ts.map +1 -1
- package/dist/browser/DomainRegistration/DomainRegistrationLease.d.ts +0 -12
- package/dist/browser/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
- package/dist/browser/Hash/Payload.d.ts +1 -4
- package/dist/browser/Hash/Payload.d.ts.map +1 -1
- package/dist/browser/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +0 -6
- package/dist/browser/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
- package/dist/browser/diviner/lib/parseEstimatesFromArray.d.ts +4 -4
- package/dist/browser/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
- package/dist/browser/index.mjs +8 -50
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/Address/Payload.d.ts +1 -4
- package/dist/neutral/Address/Payload.d.ts.map +1 -1
- package/dist/neutral/DNS/Witness/Payload/Request.d.ts +0 -4
- package/dist/neutral/DNS/Witness/Payload/Request.d.ts.map +1 -1
- package/dist/neutral/DNS/Witness/Payload/Response.d.ts +0 -4
- package/dist/neutral/DNS/Witness/Payload/Response.d.ts.map +1 -1
- package/dist/neutral/Domain/Domain.d.ts +0 -6
- package/dist/neutral/Domain/Domain.d.ts.map +1 -1
- package/dist/neutral/Domain/DomainLease.d.ts +0 -6
- package/dist/neutral/Domain/DomainLease.d.ts.map +1 -1
- package/dist/neutral/DomainEstimate/DomainEstimate.d.ts +4 -4
- package/dist/neutral/DomainEstimate/DomainEstimate.d.ts.map +1 -1
- package/dist/neutral/DomainRegistration/DomainRegistration.d.ts +0 -6
- package/dist/neutral/DomainRegistration/DomainRegistration.d.ts.map +1 -1
- package/dist/neutral/DomainRegistration/DomainRegistrationLease.d.ts +0 -12
- package/dist/neutral/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
- package/dist/neutral/Hash/Payload.d.ts +1 -4
- package/dist/neutral/Hash/Payload.d.ts.map +1 -1
- package/dist/neutral/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +0 -6
- package/dist/neutral/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
- package/dist/neutral/diviner/lib/parseEstimatesFromArray.d.ts +4 -4
- package/dist/neutral/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
- package/dist/neutral/index.mjs +8 -50
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/Address/Payload.d.ts +1 -4
- package/dist/node/Address/Payload.d.ts.map +1 -1
- package/dist/node/DNS/Witness/Payload/Request.d.ts +0 -4
- package/dist/node/DNS/Witness/Payload/Request.d.ts.map +1 -1
- package/dist/node/DNS/Witness/Payload/Response.d.ts +0 -4
- package/dist/node/DNS/Witness/Payload/Response.d.ts.map +1 -1
- package/dist/node/Domain/Domain.d.ts +0 -6
- package/dist/node/Domain/Domain.d.ts.map +1 -1
- package/dist/node/Domain/DomainLease.d.ts +0 -6
- package/dist/node/Domain/DomainLease.d.ts.map +1 -1
- package/dist/node/DomainEstimate/DomainEstimate.d.ts +4 -4
- package/dist/node/DomainEstimate/DomainEstimate.d.ts.map +1 -1
- package/dist/node/DomainRegistration/DomainRegistration.d.ts +0 -6
- package/dist/node/DomainRegistration/DomainRegistration.d.ts.map +1 -1
- package/dist/node/DomainRegistration/DomainRegistrationLease.d.ts +0 -12
- package/dist/node/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
- package/dist/node/Hash/Payload.d.ts +1 -4
- package/dist/node/Hash/Payload.d.ts.map +1 -1
- package/dist/node/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +0 -6
- package/dist/node/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
- package/dist/node/diviner/lib/parseEstimatesFromArray.d.ts +4 -4
- package/dist/node/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
- package/dist/node/index.mjs +8 -50
- package/dist/node/index.mjs.map +1 -1
- package/package.json +16 -15
- package/src/Address/Payload.ts +1 -2
- package/src/DNS/Witness/Payload/Request.ts +0 -6
- package/src/DNS/Witness/Payload/Response.ts +0 -6
- package/src/Domain/Domain.ts +1 -8
- package/src/Domain/DomainLease.ts +1 -8
- package/src/DomainEstimate/DomainEstimate.ts +4 -4
- package/src/DomainRegistration/DomainRegistration.ts +1 -8
- package/src/DomainRegistration/DomainRegistrationLease.ts +1 -12
- package/src/Hash/Payload.ts +1 -2
- package/src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts +1 -9
- package/src/diviner/lib/parseEstimatesFromArray.ts +10 -13
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type BoundWitness } from '@xyo-network/boundwitness-model';
|
|
2
2
|
import { type HashLeaseEstimate } from '@xyo-network/diviner-hash-lease';
|
|
3
|
-
import type { Payload,
|
|
3
|
+
import type { Payload, WithSources } from '@xyo-network/payload-model';
|
|
4
4
|
import { type DomainRegistrationLease } from '../../DomainRegistration/index.ts';
|
|
5
5
|
export type Estimate = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
BoundWitness,
|
|
7
|
+
WithSources<HashLeaseEstimate>,
|
|
8
|
+
WithSources<DomainRegistrationLease>
|
|
9
9
|
];
|
|
10
10
|
/**
|
|
11
11
|
* Parses a generic array of payloads into estimates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseEstimatesFromArray.d.ts","sourceRoot":"","sources":["../../../../src/diviner/lib/parseEstimatesFromArray.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AACnF,OAAO,EACL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"parseEstimatesFromArray.d.ts","sourceRoot":"","sources":["../../../../src/diviner/lib/parseEstimatesFromArray.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AACnF,OAAO,EACL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAEtE,OAAO,EACL,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAA;AAE1C,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,WAAW,CAAC,iBAAiB,CAAC;IAC9B,WAAW,CAAC,uBAAuB,CAAC;CACrC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,cAAqB,OAAO,EAAE,KAAG,OAAO,CAAC,QAAQ,EAAE,CA0BtF,CAAA"}
|
package/dist/node/index.mjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
3
3
|
var AddressRecordSchema = "network.xyo.ns.record.address";
|
|
4
4
|
var isAddressRecord = isPayloadOfSchemaType(AddressRecordSchema);
|
|
5
|
-
var isAddressRecordWithMeta = isPayloadOfSchemaType(AddressRecordSchema);
|
|
6
5
|
|
|
7
6
|
// src/diviner/DomainLeaseEstimateDiviner/Schema.ts
|
|
8
7
|
var DomainLeaseEstimateDivinerValidationErrorDetailsSchema = "network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details";
|
|
@@ -57,73 +56,47 @@ var DomainLeaseEstimateDivinerErrorDetailsDictionary = {
|
|
|
57
56
|
};
|
|
58
57
|
|
|
59
58
|
// src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts
|
|
60
|
-
import {
|
|
61
|
-
isPayloadOfSchemaType as isPayloadOfSchemaType2,
|
|
62
|
-
isPayloadOfSchemaTypeWithMeta,
|
|
63
|
-
isPayloadOfSchemaTypeWithSources
|
|
64
|
-
} from "@xyo-network/payload-model";
|
|
59
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType2, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
|
|
65
60
|
var isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSchemaType2(
|
|
66
61
|
DomainLeaseEstimateDivinerValidationErrorDetailsSchema
|
|
67
62
|
);
|
|
68
63
|
var isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources = isPayloadOfSchemaTypeWithSources(DomainLeaseEstimateDivinerValidationErrorDetailsSchema);
|
|
69
|
-
var isDomainLeaseEstimateDivinerValidationErrorDetailsWithMeta = isPayloadOfSchemaTypeWithMeta(DomainLeaseEstimateDivinerValidationErrorDetailsSchema);
|
|
70
64
|
|
|
71
65
|
// src/diviner/lib/parseEstimatesFromArray.ts
|
|
72
66
|
import { exists } from "@xylabs/exists";
|
|
73
67
|
import { isBoundWitness } from "@xyo-network/boundwitness-model";
|
|
74
68
|
import {
|
|
75
69
|
HashLeaseEstimateSchema,
|
|
76
|
-
|
|
70
|
+
isHashLeaseEstimate
|
|
77
71
|
} from "@xyo-network/diviner-hash-lease";
|
|
78
72
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
79
73
|
|
|
80
74
|
// src/DomainRegistration/DomainRegistration.ts
|
|
81
|
-
import {
|
|
82
|
-
isPayloadOfSchemaType as isPayloadOfSchemaType5,
|
|
83
|
-
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta4,
|
|
84
|
-
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources4
|
|
85
|
-
} from "@xyo-network/payload-model";
|
|
75
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType5, isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources4 } from "@xyo-network/payload-model";
|
|
86
76
|
|
|
87
77
|
// src/Domain/Domain.ts
|
|
88
|
-
import {
|
|
89
|
-
isPayloadOfSchemaType as isPayloadOfSchemaType3,
|
|
90
|
-
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta2,
|
|
91
|
-
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources2
|
|
92
|
-
} from "@xyo-network/payload-model";
|
|
78
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType3, isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources2 } from "@xyo-network/payload-model";
|
|
93
79
|
var DomainSchema = "network.xyo.ns.domain";
|
|
94
80
|
var isDomain = isPayloadOfSchemaType3(DomainSchema);
|
|
95
81
|
var isDomainWithSources = isPayloadOfSchemaTypeWithSources2(DomainSchema);
|
|
96
|
-
var isDomainWithMeta = isPayloadOfSchemaTypeWithMeta2(DomainSchema);
|
|
97
82
|
|
|
98
83
|
// src/Domain/DomainLease.ts
|
|
99
|
-
import {
|
|
100
|
-
isPayloadOfSchemaType as isPayloadOfSchemaType4,
|
|
101
|
-
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta3,
|
|
102
|
-
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources3
|
|
103
|
-
} from "@xyo-network/payload-model";
|
|
84
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType4, isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources3 } from "@xyo-network/payload-model";
|
|
104
85
|
var DomainLeaseSchema = "network.xyo.ns.domain.lease";
|
|
105
86
|
var isDomainLease = isPayloadOfSchemaType4(DomainLeaseSchema);
|
|
106
87
|
var isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources3(DomainLeaseSchema);
|
|
107
|
-
var isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta3(DomainLeaseSchema);
|
|
108
88
|
|
|
109
89
|
// src/DomainRegistration/DomainRegistration.ts
|
|
110
90
|
var DomainRegistrationSchema = `${DomainSchema}.registration`;
|
|
111
91
|
var isDomainRegistration = isPayloadOfSchemaType5(DomainRegistrationSchema);
|
|
112
92
|
var isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources4(DomainRegistrationSchema);
|
|
113
|
-
var isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta4(DomainRegistrationSchema);
|
|
114
93
|
|
|
115
94
|
// src/DomainRegistration/DomainRegistrationLease.ts
|
|
116
|
-
import {
|
|
117
|
-
isPayloadOfSchemaType as isPayloadOfSchemaType6,
|
|
118
|
-
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta5,
|
|
119
|
-
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources5
|
|
120
|
-
} from "@xyo-network/payload-model";
|
|
95
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType6, isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources5 } from "@xyo-network/payload-model";
|
|
121
96
|
var DomainRegistrationLeaseSchema = `${DomainRegistrationSchema}.lease`;
|
|
122
97
|
var isDomainRegistrationLease = isPayloadOfSchemaType6(DomainRegistrationLeaseSchema);
|
|
123
98
|
var isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources5(DomainRegistrationLeaseSchema);
|
|
124
99
|
var isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources;
|
|
125
|
-
var isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta5(DomainRegistrationLeaseSchema);
|
|
126
|
-
var isDomainRegistrationLeaseMeta = isDomainRegistrationLeaseWithMeta;
|
|
127
100
|
|
|
128
101
|
// src/diviner/lib/parseEstimatesFromArray.ts
|
|
129
102
|
var parseEstimatesFromArray = async (payloads) => {
|
|
@@ -136,14 +109,14 @@ var parseEstimatesFromArray = async (payloads) => {
|
|
|
136
109
|
bw,
|
|
137
110
|
HashLeaseEstimateSchema,
|
|
138
111
|
hashMap,
|
|
139
|
-
|
|
112
|
+
isHashLeaseEstimate
|
|
140
113
|
);
|
|
141
114
|
if (!hashLeaseEstimate) return;
|
|
142
115
|
const domainLease = getPayloadBySchemaFromBoundWitness(
|
|
143
116
|
bw,
|
|
144
117
|
DomainRegistrationLeaseSchema,
|
|
145
118
|
hashMap,
|
|
146
|
-
|
|
119
|
+
isDomainRegistrationLease
|
|
147
120
|
);
|
|
148
121
|
if (!domainLease) return;
|
|
149
122
|
return [bw, hashLeaseEstimate, domainLease];
|
|
@@ -445,12 +418,10 @@ var DNSWitnessConfigSchema = `${DNSSchema}.witness.config`;
|
|
|
445
418
|
// src/DNS/Witness/Payload/Request.ts
|
|
446
419
|
import {
|
|
447
420
|
isPayloadOfSchemaType as isPayloadOfSchemaType7,
|
|
448
|
-
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta6,
|
|
449
421
|
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources6
|
|
450
422
|
} from "@xyo-network/payload-model";
|
|
451
423
|
var isDNSRequest = isPayloadOfSchemaType7(DNSSchema);
|
|
452
424
|
var isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources6(DNSSchema);
|
|
453
|
-
var isDNSRequestWithMeta = isPayloadOfSchemaTypeWithMeta6(DNSSchema);
|
|
454
425
|
var getDnsRequestFor = (domain, type = DNSResourceRecordTypes.A) => {
|
|
455
426
|
return { ...getRequestFor(domain, type), schema: DNSSchema };
|
|
456
427
|
};
|
|
@@ -458,12 +429,10 @@ var getDnsRequestFor = (domain, type = DNSResourceRecordTypes.A) => {
|
|
|
458
429
|
// src/DNS/Witness/Payload/Response.ts
|
|
459
430
|
import {
|
|
460
431
|
isPayloadOfSchemaType as isPayloadOfSchemaType8,
|
|
461
|
-
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta7,
|
|
462
432
|
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources7
|
|
463
433
|
} from "@xyo-network/payload-model";
|
|
464
434
|
var isDNSResponse = isPayloadOfSchemaType8(DNSSchema);
|
|
465
435
|
var isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources7(DNSSchema);
|
|
466
|
-
var isDNSResponseWithMeta = isPayloadOfSchemaTypeWithMeta7(DNSSchema);
|
|
467
436
|
|
|
468
437
|
// src/Duration/validation/validateBoundWitness.ts
|
|
469
438
|
import { BoundWitnessValidator } from "@xyo-network/boundwitness-validator";
|
|
@@ -512,7 +481,6 @@ var validateBoundWitnessWithDuration = async (recordBw, recordPayload) => {
|
|
|
512
481
|
import { isPayloadOfSchemaType as isPayloadOfSchemaType9 } from "@xyo-network/payload-model";
|
|
513
482
|
var HashRecordSchema = "network.xyo.ns.record.hash";
|
|
514
483
|
var isHashRecord = isPayloadOfSchemaType9(HashRecordSchema);
|
|
515
|
-
var isHashRecordWithMeta = isPayloadOfSchemaType9(HashRecordSchema);
|
|
516
484
|
export {
|
|
517
485
|
AddressRecordSchema,
|
|
518
486
|
DNSQueryOpcodes,
|
|
@@ -533,32 +501,22 @@ export {
|
|
|
533
501
|
getRandomId,
|
|
534
502
|
getRequestFor,
|
|
535
503
|
isAddressRecord,
|
|
536
|
-
isAddressRecordWithMeta,
|
|
537
504
|
isDNSRequest,
|
|
538
|
-
isDNSRequestWithMeta,
|
|
539
505
|
isDNSRequestWithSources,
|
|
540
506
|
isDNSResponse,
|
|
541
|
-
isDNSResponseWithMeta,
|
|
542
507
|
isDNSResponseWithSources,
|
|
543
508
|
isDomain,
|
|
544
509
|
isDomainLease,
|
|
545
510
|
isDomainLeaseEstimateDivinerValidationErrorDetails,
|
|
546
|
-
isDomainLeaseEstimateDivinerValidationErrorDetailsWithMeta,
|
|
547
511
|
isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources,
|
|
548
|
-
isDomainLeaseWithMeta,
|
|
549
512
|
isDomainLeaseWithSources,
|
|
550
513
|
isDomainRegistration,
|
|
551
514
|
isDomainRegistrationLease,
|
|
552
|
-
isDomainRegistrationLeaseMeta,
|
|
553
515
|
isDomainRegistrationLeaseSources,
|
|
554
|
-
isDomainRegistrationLeaseWithMeta,
|
|
555
516
|
isDomainRegistrationLeaseWithSources,
|
|
556
|
-
isDomainRegistrationWithMeta,
|
|
557
517
|
isDomainRegistrationWithSources,
|
|
558
|
-
isDomainWithMeta,
|
|
559
518
|
isDomainWithSources,
|
|
560
519
|
isHashRecord,
|
|
561
|
-
isHashRecordWithMeta,
|
|
562
520
|
isWithinDelegatedTimeframe,
|
|
563
521
|
parseEstimatesFromArray,
|
|
564
522
|
validateBoundWitnessWithDuration,
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Address/Payload.ts","../../src/diviner/DomainLeaseEstimateDiviner/Schema.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts","../../src/diviner/lib/parseEstimatesFromArray.ts","../../src/DomainRegistration/DomainRegistration.ts","../../src/Domain/Domain.ts","../../src/Domain/DomainLease.ts","../../src/DomainRegistration/DomainRegistrationLease.ts","../../src/DNS/types/OperationCodes.ts","../../src/DNS/types/ResponseCodes.ts","../../src/DNS/types/Header.ts","../../src/DNS/types/ResourceRecord.ts","../../src/DNS/types/Request.ts","../../src/DNS/Witness/Schema.ts","../../src/DNS/Witness/Config.ts","../../src/DNS/Witness/Payload/Request.ts","../../src/DNS/Witness/Payload/Response.ts","../../src/Duration/validation/validateBoundWitness.ts","../../src/Duration/validation/validateBoundWitnessAndDuration.ts","../../src/Duration/validation/validateDuration.ts","../../src/Duration/validation/validateBoundWitnessWithDuration.ts","../../src/Hash/Payload.ts"],"sourcesContent":["import type { Address } from '@xylabs/hex'\nimport type { Payload, WithMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type AddressRecordSchema = 'network.xyo.ns.record.address'\nexport const AddressRecordSchema: AddressRecordSchema = 'network.xyo.ns.record.address'\n\nexport interface AddressRecordFields extends DomainFields {\n /**\n * The address the record points to\n */\n address: Address[]\n}\n\n/**\n * An address record points a domain to an address\n */\nexport type AddressRecord = Payload<AddressRecordFields, AddressRecordSchema>\n\nexport const isAddressRecord = isPayloadOfSchemaType<AddressRecord>(AddressRecordSchema)\nexport const isAddressRecordWithMeta = isPayloadOfSchemaType<WithMeta<AddressRecord>>(AddressRecordSchema)\n","export const DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n = 'network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details' as const\n\nexport type DomainLeaseEstimateDivinerValidationErrorDetailsSchema = typeof DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n","import { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\nimport type { DomainLeaseEstimateDivinerValidationErrorDetails, ErrorDetailsDictionary } from './Payload.ts'\n\n// export type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = keyof typeof DomainLeaseEstimateDivinerErrorDetailsDictionary\nexport type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8\n\nexport const DomainLeaseEstimateDivinerErrorDetailsDictionary: Readonly<\n Readonly<Record<DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode, DomainLeaseEstimateDivinerValidationErrorDetails>> &\n ErrorDetailsDictionary\n> = {\n 0: {\n code: '0', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Success',\n },\n 1: {\n code: '1', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid casing',\n },\n 2: {\n code: '2', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid coin signature',\n },\n 3: {\n code: '3', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid length',\n },\n 4: {\n code: '4', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid name',\n },\n 5: {\n code: '5', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved fragment',\n },\n 6: {\n code: '6', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved name',\n },\n 7: {\n code: '7', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved string',\n },\n 8: {\n code: '8', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid TLD',\n },\n} as const\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\n\nexport interface ErrorDetails<TErrorCode extends string | undefined = string | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any // Index signature for any other additional properties\n /**\n * A string code indicating the error type.\n */\n code: TErrorCode\n /**\n * A human-readable explanation specific to this occurrence of the problem\n */\n detail?: string\n /**\n * A short, human-readable summary of the problem type.\n */\n title?: string\n}\n\nexport type ErrorDetailsDictionary<T extends number = number> = {\n readonly [K in T]: ErrorDetails<`${K}`>\n}\n\n/**\n * A payment authorization token payload\n */\nexport type DomainLeaseEstimateDivinerValidationErrorDetails<TErrorCode extends string | undefined = string> = Payload<\n ErrorDetails<TErrorCode>,\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n>\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSchemaType<DomainLeaseEstimateDivinerValidationErrorDetails>(\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema,\n)\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with sources\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources\n = isPayloadOfSchemaTypeWithSources<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with meta\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetailsWithMeta\n = isPayloadOfSchemaTypeWithMeta<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)\n","import { exists } from '@xylabs/exists'\nimport { type BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport {\n type HashLeaseEstimate, HashLeaseEstimateSchema,\n isHashLeaseEstimateWithMeta,\n} from '@xyo-network/diviner-hash-lease'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type {\n Payload, WithMeta, WithOptionalMeta, WithSources,\n} from '@xyo-network/payload-model'\n\nimport {\n type DomainRegistrationLease, DomainRegistrationLeaseSchema, isDomainRegistrationLeaseWithMeta,\n} from '../../DomainRegistration/index.ts'\n\nexport type Estimate = [\n WithOptionalMeta<BoundWitness>,\n WithOptionalMeta<WithSources<HashLeaseEstimate>>,\n WithOptionalMeta<WithSources<DomainRegistrationLease>>,\n]\n\n/**\n * Parses a generic array of payloads into estimates\n * @param payloads An array of payloads\n * @returns Parsed estimates\n */\nexport const parseEstimatesFromArray = async (payloads?: Payload[]): Promise<Estimate[]> => {\n if (!payloads) return []\n const bws = payloads\n // Find all bound witnesses\n .filter(isBoundWitness)\n // that have the required estimate payloads\n .filter(hasEstimatePayloads) ?? []\n if (bws.length === 0) return []\n const hashMap = await PayloadBuilder.toAllHashMap(payloads)\n return bws.map<Estimate | undefined>((bw) => {\n const hashLeaseEstimate = getPayloadBySchemaFromBoundWitness<WithSources<HashLeaseEstimate>>(\n bw,\n HashLeaseEstimateSchema,\n hashMap,\n isHashLeaseEstimateWithMeta,\n )\n if (!hashLeaseEstimate) return\n const domainLease = getPayloadBySchemaFromBoundWitness<DomainRegistrationLease>(\n bw,\n DomainRegistrationLeaseSchema,\n hashMap,\n isDomainRegistrationLeaseWithMeta,\n )\n if (!domainLease) return\n return [bw, hashLeaseEstimate, domainLease]\n }).filter(exists)\n}\n\n/**\n * Tests if a BoundWitness has the required estimate payloads\n * @param bw The BoundWitness to check for estimate payloads\n * @returns True if the BoundWitness has the required estimate payloads, false otherwise\n */\nconst hasEstimatePayloads = (bw: BoundWitness): boolean => {\n return bw.payload_schemas.includes(DomainRegistrationLeaseSchema)\n && bw.payload_schemas.includes(HashLeaseEstimateSchema)\n}\n\n/**\n * Finds the first instance of a payload in a BoundWitness by schema\n * @param bw The BoundWitness to extract the payload from\n * @param schema The schema of the payload to extract\n * @param hashMap The hashmap of the payloads\n * @param identity An identity function to check if the payload is of the correct type\n * @returns The payload if it exists or undefined\n */\nconst getPayloadBySchemaFromBoundWitness = <T extends Payload = Payload>(\n bw: BoundWitness,\n schema: string,\n hashMap: Awaited<ReturnType<typeof PayloadBuilder.toHashMap>>,\n identity: (payload: Payload) => payload is WithMeta<T>,\n): WithMeta<T> | undefined => {\n const schemaIndex = bw.payload_schemas.indexOf(schema)\n if (schemaIndex === -1) return\n const hash = bw.payload_hashes[schemaIndex]\n return [hashMap[hash]].filter(exists).find(identity)\n}\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\nimport { DomainSchema } from '../Domain/index.ts'\n\nexport const DomainRegistrationSchema = `${DomainSchema}.registration` as const\nexport type DomainRegistrationSchema = typeof DomainRegistrationSchema\n\nexport interface DomainRegistrationFields extends DomainFields {\n /**\n * The registrant of the domain\n */\n registrant: Address[]\n /**\n * The registrar of the domain\n */\n registrar: Address[]\n}\n\n/**\n * Delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistration = Payload<DomainRegistrationFields, DomainRegistrationSchema>\n\n/**\n * Identity function for DomainRegistration payload\n */\nexport const isDomainRegistration = isPayloadOfSchemaType<DomainRegistration>(DomainRegistrationSchema)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistration>(DomainRegistrationSchema)\n\n/**\n * Identity function for DomainRegistration payload with meta\n */\nexport const isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistration>(DomainRegistrationSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport type DomainSchema = 'network.xyo.ns.domain'\nexport const DomainSchema: DomainSchema = 'network.xyo.ns.domain'\n\n/**\n * The supported TLDs for XNS\n */\nexport type TopLevelDomain = 'xyo'\n\n/**\n * The fields for a domain record\n */\nexport interface DomainFields {\n /**\n * The XNS domain of the record\n */\n domain: string\n\n /**\n * The Top-Level Domain of the domain\n */\n tld: TopLevelDomain\n}\n\n/**\n * A domain record is a record of a domain\n */\nexport type Domain = Payload<DomainFields, DomainSchema>\n\n/**\n * Identity function for Domain payload\n */\nexport const isDomain = isPayloadOfSchemaType<Domain>(DomainSchema)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<Domain>(DomainSchema)\n\n/**\n * Identity function for Domain payload with meta\n */\nexport const isDomainWithMeta = isPayloadOfSchemaTypeWithMeta<Domain>(DomainSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainFields } from './Domain.ts'\n\nexport type DomainLeaseSchema = 'network.xyo.ns.domain.lease'\nexport const DomainLeaseSchema: DomainLeaseSchema = 'network.xyo.ns.domain.lease'\n\n/**\n * A domain is leased for a duration\n */\nexport interface DomainLeaseFields extends DomainFields, DurationFields {}\n\n/**\n * A domain lease is a record of a domain and the duration it is leased for\n */\nexport type DomainLease = Payload<DomainLeaseFields, DomainLeaseSchema>\n\n/**\n * Identity function for DomainLease payload\n */\nexport const isDomainLease = isPayloadOfSchemaType<DomainLease>(DomainLeaseSchema)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainLease>(DomainLeaseSchema)\n\n/**\n * Identity function for DomainLease payload with meta\n */\nexport const isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainLease>(DomainLeaseSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainRegistrationFields } from './DomainRegistration.ts'\nimport { DomainRegistrationSchema } from './DomainRegistration.ts'\n\nexport const DomainRegistrationLeaseSchema = `${DomainRegistrationSchema}.lease` as const\nexport type DomainRegistrationLeaseSchema = typeof DomainRegistrationLeaseSchema\n\nexport interface DomainRegistrationLeaseFields extends DomainRegistrationFields, DurationFields {}\n\n/**\n * Temporal delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistrationLease = Payload<DomainRegistrationLeaseFields, DomainRegistrationLeaseSchema>\n\n/**\n * Identity function for DomainRegistrationLease payload\n */\nexport const isDomainRegistrationLease = isPayloadOfSchemaType<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n/**\n * @deprecated Use isDomainRegistrationLeaseWithSources instead\n */\nexport const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources\n\n/**\n * Identity function for DomainRegistrationLease payload with meta\n */\nexport const isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n/**\n * @deprecated Use isDomainRegistrationLeaseWithMeta instead\n */\nexport const isDomainRegistrationLeaseMeta = isDomainRegistrationLeaseWithMeta\n","export type DNSQueryOpcode = 0 | 1 | 2 | 4 | 5 | 6 // Supported opcodes as numeric values\n\n// Optional: Add a more descriptive union type for the opcodes.\nexport type DNSQueryOpcodeName = 'QUERY' | 'IQUERY' | 'STATUS' | 'NOTIFY' | 'UPDATE' | 'DSO'\n\nexport const DNSQueryOpcodes: Record<DNSQueryOpcodeName, DNSQueryOpcode> = {\n QUERY: 0,\n IQUERY: 1,\n STATUS: 2,\n NOTIFY: 4,\n UPDATE: 5,\n DSO: 6,\n}\n","export type DNSRcode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18\n\nexport type DNSRcodeName =\n | 'NOERROR'\n | 'FORMERR'\n | 'SERVFAIL'\n | 'NXDOMAIN'\n | 'NOTIMP'\n | 'REFUSED'\n | 'YXDOMAIN'\n | 'YXRRSET'\n | 'NXRRSET'\n | 'NOTAUTH'\n | 'NOTZONE'\n | 'BADSIG'\n | 'BADKEY'\n | 'BADTIME'\n\nexport const DNSRcodes: Readonly<Record<DNSRcodeName, DNSRcode>> = {\n NOERROR: 0,\n FORMERR: 1,\n SERVFAIL: 2,\n NXDOMAIN: 3,\n NOTIMP: 4,\n REFUSED: 5,\n YXDOMAIN: 6,\n YXRRSET: 7,\n NXRRSET: 8,\n NOTAUTH: 9,\n NOTZONE: 10,\n BADSIG: 16,\n BADKEY: 17,\n BADTIME: 18,\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\n\n// An attempt to match compatibility with the RFC 8427 (Representing DNS Messages in JSON)\n// https://www.rfc-editor.org/rfc/rfc8427\n// and Google/CloudFlare's DNS over HTTPS (DoH) standard\n// https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/\n\nimport { type DNSQueryOpcode, DNSQueryOpcodes } from './OperationCodes.ts'\nimport type { DNSRcode } from './ResponseCodes.ts'\nimport { DNSRcodes } from './ResponseCodes.ts'\n\n// NOTE: The RFC says `Boolean` but uses 0/1 for the values. DNS over HTTPS (DoH) uses `true`/`false`.\nexport type NumericBoolean = 0 | 1 | true | false\nexport type NumericBooleanFalsy = 0 | false\nexport type NumericBooleanTruthy = 1 | true\n\nexport interface DNSHeader {\n /**\n * Transaction ID, typically a random number. Integer whose value is 0 to 65535\n */\n ID?: number\n /**\n * Query/Response Flag (0 = Query, 1 = Response)\n */\n QR?: NumericBoolean\n /**\n * Operation Code (0 for standard query)\n */\n Opcode?: DNSQueryOpcode\n /**\n * Authoritative Answer (set in response)\n */\n AA?: NumericBoolean\n /**\n * Truncated Flag\n */\n TC?: NumericBoolean // Truncation\n /**\n * Recursion Desired\n */\n RD?: NumericBoolean // Recursion Desired (set in query)\n /**\n * Response Code (0 for no error, non-0 for errors)\n */\n RCODE?: DNSRcode\n /**\n * Number of questions in the query (usually 1)\n */\n QDCOUNT?: number\n /**\n * Number of answer records in the response\n */\n ANCOUNT?: number\n /**\n * Number of authority records in the response\n */\n NSCOUNT?: number\n /**\n * Number of additional records in the response\n */\n ARCOUNT?: number\n}\n\nexport interface DNSRequestHeader extends DNSHeader {\n QR: NumericBooleanFalsy // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBooleanFalsy // Authoritative Answer (0 in query)\n TC: NumericBooleanFalsy // Truncation (0 for non-truncated)\n RCODE: typeof DNSRcodes.NOERROR // Response Code (always 0 in query)\n ANCOUNT: 0 // Number of answer records (always 0 in query)\n NSCOUNT: 0 // Number of authority records (always 0 in query)\n ARCOUNT: 0 // Number of additional records (always 0 in query)\n}\n\nexport const StandardRequestHeader: Readonly<DNSRequestHeader> = {\n ID: 0,\n QR: 0, // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcodes.QUERY, // Operation Code (0 for standard query)\n AA: 0, // Authoritative Answer (0 in query)\n TC: 0, // Truncation (0 for non-truncated)\n RD: 1, // Recursion Desired (1 if recursion is requested)\n RCODE: DNSRcodes.NOERROR, // Response Code (always 0 in query)\n QDCOUNT: 1,\n ANCOUNT: 0,\n NSCOUNT: 0,\n ARCOUNT: 0,\n}\n\nexport interface DNSResponseHeader extends DNSHeader {\n QR: NumericBooleanTruthy // Query/Response Flag (1 = Response)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBoolean // Authoritative Answer (1 if the response is authoritative)\n TC: NumericBoolean // Truncation (1 if the message is truncated)\n RA: NumericBoolean // Recursion Available (1 if the server supports recursion)\n}\n","// https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n\nexport type DNSResourceRecordType =\n | 'A'\n | 'NS'\n | 'MD'\n | 'MF'\n | 'CNAME'\n | 'SOA'\n | 'MB'\n | 'MG'\n | 'MR'\n | 'NULL'\n | 'WKS'\n | 'PTR'\n | 'HINFO'\n | 'MINFO'\n | 'MX'\n | 'TXT'\n | 'RP'\n | 'AFSDB'\n | 'X25'\n | 'ISDN'\n | 'RT'\n | 'NSAP'\n | 'NSAP-PTR'\n | 'SIG'\n | 'KEY'\n | 'PX'\n | 'GPOS'\n | 'AAAA'\n | 'LOC'\n | 'NXT'\n | 'EID'\n | 'NIMLOC'\n | 'SRV'\n | 'ATMA'\n | 'NAPTR'\n | 'KX'\n | 'CERT'\n | 'A6'\n | 'DNAME'\n | 'SINK'\n | 'OPT'\n | 'APL'\n | 'DS'\n | 'SSHFP'\n | 'IPSECKEY'\n | 'RRSIG'\n | 'NSEC'\n | 'DNSKEY'\n | 'DHCID'\n | 'NSEC3'\n | 'NSEC3PARAM'\n | 'TLSA'\n | 'SMIMEA'\n | 'HIP'\n | 'NINFO'\n | 'RKEY'\n | 'TALINK'\n | 'CDS'\n | 'CDNSKEY'\n | 'OPENPGPKEY'\n | 'CSYNC'\n | 'ZONEMD'\n | 'SVCB'\n | 'HTTPS'\n | 'SPF'\n | 'UINFO'\n | 'UID'\n | 'GID'\n | 'UNSPEC'\n | 'NID'\n | 'L32'\n | 'L64'\n | 'LP'\n | 'EUI48'\n | 'EUI64'\n | 'NXNAME'\n | 'TKEY'\n | 'TSIG'\n | 'IXFR'\n | 'AXFR'\n | 'MAILB'\n | 'MAILA'\n | '*'\n | 'URI'\n | 'CAA'\n | 'AVC'\n | 'DOA'\n | 'AMTRELAY'\n | 'RESINFO'\n | 'WALLET'\n | 'CLA'\n | 'IPN'\n | 'TA'\n | 'DLV'\n // NOTE: Custom types here\n | 'XYOA'\n | 'XYOH'\n\nexport const DNSResourceRecordTypes: Readonly<Record<DNSResourceRecordType, number>> = {\n 'A': 1, // a host address\n 'NS': 2, // an authoritative name server\n 'MD': 3, // a mail destination (OBSOLETE - use MX)\n 'MF': 4, // a mail forwarder (OBSOLETE - use MX)\n 'CNAME': 5, // the canonical name for an alias\n 'SOA': 6, // marks the start of a zone of authority\n 'MB': 7, // a mailbox domain name (EXPERIMENTAL)\n 'MG': 8, // a mail group member (EXPERIMENTAL)\n 'MR': 9, // a mail rename domain name (EXPERIMENTAL)\n 'NULL': 10, // a null RR (EXPERIMENTAL)\n 'WKS': 11, // a well known service description\n 'PTR': 12, // a domain name pointer\n 'HINFO': 13, // host information\n 'MINFO': 14, // mailbox or mail list information\n 'MX': 15, // mail exchange\n 'TXT': 16, // text strings\n 'RP': 17, // for Responsible Person\n 'AFSDB': 18, // for AFS Data Base location\n 'X25': 19, // for X.25 PSDN address\n 'ISDN': 20, // for ISDN address\n 'RT': 21, // for Route Through\n 'NSAP': 22, // for NSAP address, NSAP style A record (DEPRECATED)\n 'NSAP-PTR': 23, // for domain name pointer, NSAP style (DEPRECATED)\n 'SIG': 24, // for security signature\n 'KEY': 25, // for security key\n 'PX': 26, // X.400 mail mapping information\n 'GPOS': 27, // Geographical Position\n 'AAAA': 28, // IP6 Address\n 'LOC': 29, // Location Information\n 'NXT': 30, // Next Domain (OBSOLETE)\n 'EID': 31, // Endpoint Identifier\n 'NIMLOC': 32, // Nimrod Locator\n 'SRV': 33, // Server Selection\n 'ATMA': 34, // ATM Address\n 'NAPTR': 35, // Naming Authority Pointer\n 'KX': 36, // Key Exchanger\n 'CERT': 37, // CERT\n 'A6': 38, // A6 (OBSOLETE - use AAAA)\n 'DNAME': 39, // DNAME\n 'SINK': 40, // SINK\n 'OPT': 41, // OPT\n 'APL': 42, // APL\n 'DS': 43, // Delegation Signer\n 'SSHFP': 44, // SSH Key Fingerprint\n 'IPSECKEY': 45, // IPSECKEY\n 'RRSIG': 46, // RRSIG\n 'NSEC': 47, // NSEC\n 'DNSKEY': 48, // DNSKEY\n 'DHCID': 49, // DHCID\n 'NSEC3': 50, // NSEC3\n 'NSEC3PARAM': 51, // NSEC3PARAM\n 'TLSA': 52, // TLSA\n 'SMIMEA': 53, // S/MIME cert association\n 'HIP': 55, // Host Identity Protocol\n 'NINFO': 56, // NINFO\n 'RKEY': 57, // RKEY\n 'TALINK': 58, // Trust Anchor LINK\n 'CDS': 59, // Child DS\n 'CDNSKEY': 60, // DNSKEY(s) the Child wants reflected in DS\n 'OPENPGPKEY': 61, // OpenPGP Key\n 'CSYNC': 62, // Child-To-Parent Synchronization\n 'ZONEMD': 63, // Message Digest Over Zone Data\n 'SVCB': 64, // General-purpose service binding\n 'HTTPS': 65, // SVCB-compatible type for use with HTTP\n 'SPF': 99,\n 'UINFO': 100,\n 'UID': 101,\n 'GID': 102,\n 'UNSPEC': 103,\n 'NID': 104,\n 'L32': 105,\n 'L64': 106,\n 'LP': 107,\n 'EUI48': 108, // an EUI-48 address\n 'EUI64': 109, // an EUI-64 address\n 'NXNAME': 128, // NXDOMAIN indicator for Compact Denial of Existence\n 'TKEY': 249, // Transaction Key\n 'TSIG': 250, // Transaction Signature\n 'IXFR': 251, // incremental transfer\n 'AXFR': 252, // transfer of an entire zone\n 'MAILB': 253, // mailbox-related RRs (MB, MG or MR)\n 'MAILA': 254, // mail agent RRs (OBSOLETE - see MX)\n '*': 255, // A request for some or all records the server has available\n 'URI': 256, // URI\n 'CAA': 257, // Certification Authority Restriction\n 'AVC': 258, // Application Visibility and Control\n 'DOA': 259, // Digital Object Architecture\n 'AMTRELAY': 260, // Automatic Multicast Tunneling Relay\n 'RESINFO': 261, // Resolver Information as Key/Value Pairs\n 'WALLET': 262, // Public wallet address\n 'CLA': 263, // BP Convergence Layer Adapter\n 'IPN': 264, // BP Node Number\n 'TA': 32_768, // DNSSEC Trust Authorities\n 'DLV': 32_769, // DNSSEC Lookaside Validation (OBSOLETE)\n\n // NOTE: Custom types here chosen within the Private Use Range\n // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n // https://www.rfc-editor.org/rfc/rfc5226\n // as, per the RFC, the Private Use Range is reserved\n // \"For private or local use only, with the type and\n // purpose defined by the local site. No attempt is made to\n // prevent multiple sites from using the same value in\n // different (and incompatible) ways. There is no need for\n // IANA to review such assignments (since IANA does not record\n // them) and assignments are not generally useful for broad\n // interoperability. It is the responsibility of the sites\n // making use of the Private Use range to ensure that no\n // conflicts occur (within the intended scope of use).\"\n // If we want to apply for a custom reserved code later\n // on, once the usage is proven enough we can absolutely\n // do that.\n 'XYOA': 65_432, // XYO Address\n 'XYOH': 65_433, // XYO Hash\n}\n\nexport type DNSResourceRecordTypeValue = (typeof DNSResourceRecordTypes)[keyof typeof DNSResourceRecordTypes]\n\nexport const findDNSResourceRecordTypesByValue = (value: DNSResourceRecordTypeValue): DNSResourceRecordType | undefined => {\n // Iterate through the keys of the record\n for (const key in DNSResourceRecordTypes) {\n const resourceRecordType = key as DNSResourceRecordType\n if (DNSResourceRecordTypes[resourceRecordType] === value) {\n return resourceRecordType // Return the key if the value matches\n }\n }\n return undefined // Return undefined if no matching value is found\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport { type DNSRequestHeader, StandardRequestHeader } from './Header.ts'\nimport type { DNSResourceRecordTypeValue } from './ResourceRecord.ts'\nimport { DNSResourceRecordTypes } from './ResourceRecord.ts'\n\nexport interface DNSQuestion {\n name: string // The domain name that was queried\n type: DNSResourceRecordTypeValue // The record type (e.g., 1 for A record)\n class?: number // Query Class (typically 1 for IN - Internet)\n}\n\nexport interface DNSRequestFields extends DNSRequestHeader {\n Question: DNSQuestion[]\n}\n\n/**\n * Helper for generating a DNS request for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNS request\n */\nexport const getRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequestFields => {\n return {\n ...StandardRequestHeader,\n ID: getRandomId(),\n Question: [{\n name: domain, type, class: 1,\n }],\n }\n}\n\n/**\n * Used to generate a random ID for a DNS request\n * @returns A random number between 0 and 65,535\n */\nexport const getRandomId = (): number => {\n return Math.floor(Math.random() * 65_536) // Math.random() generates a number between 0 and 1, multiply by 65536 to get the range 0-65535\n}\n","export type DNSSchema = 'network.xyo.dns'\nexport const DNSSchema: DNSSchema = 'network.xyo.dns'\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nimport type { DNSResourceRecordType } from '../types/index.ts'\nimport { DNSSchema } from './Schema.ts'\n\nexport type DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\nexport const DNSWitnessConfigSchema: DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\n\nexport type DNSWitnessConfig = WitnessConfig<{\n /**\n * The address record index diviner to be used to determine the address record index\n */\n addressRecordIndexDiviner?: ModuleIdentifier\n /**\n * The hash record index diviner to be used to determine the hash record index\n */\n hashRecordIndexDiviner?: ModuleIdentifier\n /**\n * The config schema for the DNS witness\n */\n schema: DNSWitnessConfigSchema\n /**\n * If supplied, the DNS witness will only support the specified resource record types\n */\n supportedResources?: DNSResourceRecordType[]\n}>\n","import type { PayloadWithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithMeta,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSRequestFields, DNSResourceRecordTypeValue } from '../../types/index.ts'\nimport { DNSResourceRecordTypes, getRequestFor } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSRequest payload\n */\nexport type DNSRequest = PayloadWithSources<DNSRequestFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSRequest payload\n */\nexport const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with sources\n */\nexport const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<DNSRequest>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with meta\n */\nexport const isDNSRequestWithMeta = isPayloadOfSchemaTypeWithMeta<DNSRequest>(DNSSchema)\n\n/**\n * Helper for generating a DNSRequest payload for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNSRequest payload\n */\nexport const getDnsRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequest => {\n return { ...getRequestFor(domain, type), schema: DNSSchema }\n}\n","import type { PayloadWithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithMeta,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSResponseFields } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSResponse payload\n */\nexport type DNSResponse = PayloadWithSources<DNSResponseFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSResponse payload\n */\nexport const isDNSResponse = isPayloadOfSchemaType<DNSResponse>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with sources\n */\nexport const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with meta\n */\nexport const isDNSResponseWithMeta = isPayloadOfSchemaTypeWithMeta<DNSResponse>(DNSSchema)\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\n\n// BW Validations\nexport const validateBoundWitness = async (recordBw: BoundWitness, requiredSchemas: string[] = []): Promise<boolean> => {\n // If the BW does not include all of the required schemas\n if (!requiredSchemas.every(requiredSchema => recordBw.payload_schemas.includes(requiredSchema))) return false\n // If the BW is valid (does not include any errors)\n const validator = new BoundWitnessValidator(recordBw)\n const errors = await validator.validate()\n return errors.length === 0\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// BW & Record Validations\nexport const validateBoundWitnessAndDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n if (!(await recordIsInBoundWitness(recordBw, recordPayload))) return false\n if (!recordIsTemporallyValidToBoundWitness(recordBw, recordPayload)) return false\n return true\n}\n\nconst recordIsInBoundWitness = async (recordBw: BoundWitness, recordPayload: Payload): Promise<boolean> => {\n const hash = await PayloadBuilder.dataHash(recordPayload)\n return recordBw.payload_hashes.includes(hash)\n}\n\nconst recordIsTemporallyValidToBoundWitness = (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): boolean => {\n const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// Record Validations\nexport const validateDuration = (recordPayload: Payload<DurationFields>): boolean => {\n // if (!isValidAddress(recordPayload)) return false\n if (!isWithinDelegatedTimeframe(recordPayload)) return false\n return true\n}\n\nexport const isWithinDelegatedTimeframe = (recordPayload: Payload<DurationFields>, now = Date.now()): boolean => {\n // nbf < now < exp\n return recordPayload.nbf < now && now < recordPayload.exp\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\nimport { validateBoundWitness } from './validateBoundWitness.ts'\nimport { validateBoundWitnessAndDuration } from './validateBoundWitnessAndDuration.ts'\nimport { validateDuration } from './validateDuration.ts'\n\nexport const validateBoundWitnessWithDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n // Validate the BW\n if (!(await validateBoundWitness(recordBw, [recordPayload.schema]))) return false\n // Validate the record\n if (!validateDuration(recordPayload)) return false\n // Validate the record relative to the BW\n if (!(await validateBoundWitnessAndDuration(recordBw, recordPayload))) return false\n return true\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload, WithMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type HashRecordSchema = 'network.xyo.ns.record.hash'\nexport const HashRecordSchema: HashRecordSchema = 'network.xyo.ns.record.hash'\n\nexport interface HashRecordFields extends DomainFields {\n /**\n * The hash the record points to\n */\n hash: Hash[]\n}\n\n/**\n * An hash record points a domain to an hash\n */\nexport type HashRecord = Payload<HashRecordFields, HashRecordSchema>\n\nexport const isHashRecord = isPayloadOfSchemaType<HashRecord>(HashRecordSchema)\nexport const isHashRecordWithMeta = isP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O,OAAO,WAAW;AAC3B;;;ACVA,SAAS,kBAAAC,uBAAsB;AAMxB,IAAM,kCAAkC,OAAO,UAAwB,kBAA6D;AACzI,MAAI,CAAE,MAAM,uBAAuB,UAAU,aAAa,EAAI,QAAO;AACrE,MAAI,CAAC,sCAAsC,UAAU,aAAa,EAAG,QAAO;AAC5E,SAAO;AACT;AAEA,IAAM,yBAAyB,OAAO,UAAwB,kBAA6C;AACzG,QAAM,OAAO,MAAMA,gBAAe,SAAS,aAAa;AACxD,SAAO,SAAS,eAAe,SAAS,IAAI;AAC9C;AAEA,IAAM,wCAAwC,CAAC,UAAwB,kBAAoD;AACzH,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,EAAE,IAAI,IAAI;AAChB,SAAO,MAAM;AACf;;;ACjBO,IAAM,mBAAmB,CAAC,kBAAoD;AAEnF,MAAI,CAAC,2BAA2B,aAAa,EAAG,QAAO;AACvD,SAAO;AACT;AAEO,IAAM,6BAA6B,CAAC,eAAwC,MAAM,KAAK,IAAI,MAAe;AAE/G,SAAO,cAAc,MAAM,OAAO,MAAM,cAAc;AACxD;;;ACNO,IAAM,mCAAmC,OAAO,UAAwB,kBAA6D;AAE1I,MAAI,CAAE,MAAM,qBAAqB,UAAU,CAAC,cAAc,MAAM,CAAC,EAAI,QAAO;AAE5E,MAAI,CAAC,iBAAiB,aAAa,EAAG,QAAO;AAE7C,MAAI,CAAE,MAAM,gCAAgC,UAAU,aAAa,EAAI,QAAO;AAC9E,SAAO;AACT;;;ACdA,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,mBAAqC;AAc3C,IAAM,eAAeA,uBAAkC,gBAAgB;AACvE,IAAM,uBAAuBA,uBAA4C,gBAAgB;","names":["isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","PayloadBuilder","isPayloadOfSchemaType"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Address/Payload.ts","../../src/diviner/DomainLeaseEstimateDiviner/Schema.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts","../../src/diviner/lib/parseEstimatesFromArray.ts","../../src/DomainRegistration/DomainRegistration.ts","../../src/Domain/Domain.ts","../../src/Domain/DomainLease.ts","../../src/DomainRegistration/DomainRegistrationLease.ts","../../src/DNS/types/OperationCodes.ts","../../src/DNS/types/ResponseCodes.ts","../../src/DNS/types/Header.ts","../../src/DNS/types/ResourceRecord.ts","../../src/DNS/types/Request.ts","../../src/DNS/Witness/Schema.ts","../../src/DNS/Witness/Config.ts","../../src/DNS/Witness/Payload/Request.ts","../../src/DNS/Witness/Payload/Response.ts","../../src/Duration/validation/validateBoundWitness.ts","../../src/Duration/validation/validateBoundWitnessAndDuration.ts","../../src/Duration/validation/validateDuration.ts","../../src/Duration/validation/validateBoundWitnessWithDuration.ts","../../src/Hash/Payload.ts"],"sourcesContent":["import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type AddressRecordSchema = 'network.xyo.ns.record.address'\nexport const AddressRecordSchema: AddressRecordSchema = 'network.xyo.ns.record.address'\n\nexport interface AddressRecordFields extends DomainFields {\n /**\n * The address the record points to\n */\n address: Address[]\n}\n\n/**\n * An address record points a domain to an address\n */\nexport type AddressRecord = Payload<AddressRecordFields, AddressRecordSchema>\n\nexport const isAddressRecord = isPayloadOfSchemaType<AddressRecord>(AddressRecordSchema)\n","export const DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n = 'network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details' as const\n\nexport type DomainLeaseEstimateDivinerValidationErrorDetailsSchema = typeof DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n","import { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\nimport type { DomainLeaseEstimateDivinerValidationErrorDetails, ErrorDetailsDictionary } from './Payload.ts'\n\n// export type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = keyof typeof DomainLeaseEstimateDivinerErrorDetailsDictionary\nexport type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8\n\nexport const DomainLeaseEstimateDivinerErrorDetailsDictionary: Readonly<\n Readonly<Record<DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode, DomainLeaseEstimateDivinerValidationErrorDetails>> &\n ErrorDetailsDictionary\n> = {\n 0: {\n code: '0', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Success',\n },\n 1: {\n code: '1', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid casing',\n },\n 2: {\n code: '2', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid coin signature',\n },\n 3: {\n code: '3', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid length',\n },\n 4: {\n code: '4', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid name',\n },\n 5: {\n code: '5', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved fragment',\n },\n 6: {\n code: '6', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved name',\n },\n 7: {\n code: '7', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved string',\n },\n 8: {\n code: '8', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid TLD',\n },\n} as const\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\n\nexport interface ErrorDetails<TErrorCode extends string | undefined = string | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any // Index signature for any other additional properties\n /**\n * A string code indicating the error type.\n */\n code: TErrorCode\n /**\n * A human-readable explanation specific to this occurrence of the problem\n */\n detail?: string\n /**\n * A short, human-readable summary of the problem type.\n */\n title?: string\n}\n\nexport type ErrorDetailsDictionary<T extends number = number> = {\n readonly [K in T]: ErrorDetails<`${K}`>\n}\n\n/**\n * A payment authorization token payload\n */\nexport type DomainLeaseEstimateDivinerValidationErrorDetails<TErrorCode extends string | undefined = string> = Payload<\n ErrorDetails<TErrorCode>,\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n>\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSchemaType<DomainLeaseEstimateDivinerValidationErrorDetails>(\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema,\n)\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with sources\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources\n = isPayloadOfSchemaTypeWithSources<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)\n","import { exists } from '@xylabs/exists'\nimport { type BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport {\n type HashLeaseEstimate, HashLeaseEstimateSchema, isHashLeaseEstimate,\n} from '@xyo-network/diviner-hash-lease'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\n\nimport {\n type DomainRegistrationLease, DomainRegistrationLeaseSchema, isDomainRegistrationLease,\n} from '../../DomainRegistration/index.ts'\n\nexport type Estimate = [\n BoundWitness,\n WithSources<HashLeaseEstimate>,\n WithSources<DomainRegistrationLease>,\n]\n\n/**\n * Parses a generic array of payloads into estimates\n * @param payloads An array of payloads\n * @returns Parsed estimates\n */\nexport const parseEstimatesFromArray = async (payloads?: Payload[]): Promise<Estimate[]> => {\n if (!payloads) return []\n const bws = payloads\n // Find all bound witnesses\n .filter(isBoundWitness)\n // that have the required estimate payloads\n .filter(hasEstimatePayloads) ?? []\n if (bws.length === 0) return []\n const hashMap = await PayloadBuilder.toAllHashMap(payloads)\n return bws.map<Estimate | undefined>((bw) => {\n const hashLeaseEstimate = getPayloadBySchemaFromBoundWitness<WithSources<HashLeaseEstimate>>(\n bw,\n HashLeaseEstimateSchema,\n hashMap,\n isHashLeaseEstimate,\n )\n if (!hashLeaseEstimate) return\n const domainLease = getPayloadBySchemaFromBoundWitness<DomainRegistrationLease>(\n bw,\n DomainRegistrationLeaseSchema,\n hashMap,\n isDomainRegistrationLease,\n )\n if (!domainLease) return\n return [bw, hashLeaseEstimate, domainLease]\n }).filter(exists)\n}\n\n/**\n * Tests if a BoundWitness has the required estimate payloads\n * @param bw The BoundWitness to check for estimate payloads\n * @returns True if the BoundWitness has the required estimate payloads, false otherwise\n */\nconst hasEstimatePayloads = (bw: BoundWitness): boolean => {\n return bw.payload_schemas.includes(DomainRegistrationLeaseSchema)\n && bw.payload_schemas.includes(HashLeaseEstimateSchema)\n}\n\n/**\n * Finds the first instance of a payload in a BoundWitness by schema\n * @param bw The BoundWitness to extract the payload from\n * @param schema The schema of the payload to extract\n * @param hashMap The hashmap of the payloads\n * @param identity An identity function to check if the payload is of the correct type\n * @returns The payload if it exists or undefined\n */\nconst getPayloadBySchemaFromBoundWitness = <T extends Payload = Payload>(\n bw: BoundWitness,\n schema: string,\n hashMap: Awaited<ReturnType<typeof PayloadBuilder.toHashMap>>,\n identity: (payload: Payload) => payload is T,\n): T | undefined => {\n const schemaIndex = bw.payload_schemas.indexOf(schema)\n if (schemaIndex === -1) return\n const hash = bw.payload_hashes[schemaIndex]\n return [hashMap[hash]].filter(exists).find(identity)\n}\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\nimport { DomainSchema } from '../Domain/index.ts'\n\nexport const DomainRegistrationSchema = `${DomainSchema}.registration` as const\nexport type DomainRegistrationSchema = typeof DomainRegistrationSchema\n\nexport interface DomainRegistrationFields extends DomainFields {\n /**\n * The registrant of the domain\n */\n registrant: Address[]\n /**\n * The registrar of the domain\n */\n registrar: Address[]\n}\n\n/**\n * Delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistration = Payload<DomainRegistrationFields, DomainRegistrationSchema>\n\n/**\n * Identity function for DomainRegistration payload\n */\nexport const isDomainRegistration = isPayloadOfSchemaType<DomainRegistration>(DomainRegistrationSchema)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistration>(DomainRegistrationSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nexport type DomainSchema = 'network.xyo.ns.domain'\nexport const DomainSchema: DomainSchema = 'network.xyo.ns.domain'\n\n/**\n * The supported TLDs for XNS\n */\nexport type TopLevelDomain = 'xyo'\n\n/**\n * The fields for a domain record\n */\nexport interface DomainFields {\n /**\n * The XNS domain of the record\n */\n domain: string\n\n /**\n * The Top-Level Domain of the domain\n */\n tld: TopLevelDomain\n}\n\n/**\n * A domain record is a record of a domain\n */\nexport type Domain = Payload<DomainFields, DomainSchema>\n\n/**\n * Identity function for Domain payload\n */\nexport const isDomain = isPayloadOfSchemaType<Domain>(DomainSchema)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<Domain>(DomainSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainFields } from './Domain.ts'\n\nexport type DomainLeaseSchema = 'network.xyo.ns.domain.lease'\nexport const DomainLeaseSchema: DomainLeaseSchema = 'network.xyo.ns.domain.lease'\n\n/**\n * A domain is leased for a duration\n */\nexport interface DomainLeaseFields extends DomainFields, DurationFields {}\n\n/**\n * A domain lease is a record of a domain and the duration it is leased for\n */\nexport type DomainLease = Payload<DomainLeaseFields, DomainLeaseSchema>\n\n/**\n * Identity function for DomainLease payload\n */\nexport const isDomainLease = isPayloadOfSchemaType<DomainLease>(DomainLeaseSchema)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainLease>(DomainLeaseSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainRegistrationFields } from './DomainRegistration.ts'\nimport { DomainRegistrationSchema } from './DomainRegistration.ts'\n\nexport const DomainRegistrationLeaseSchema = `${DomainRegistrationSchema}.lease` as const\nexport type DomainRegistrationLeaseSchema = typeof DomainRegistrationLeaseSchema\n\nexport interface DomainRegistrationLeaseFields extends DomainRegistrationFields, DurationFields {}\n\n/**\n * Temporal delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistrationLease = Payload<DomainRegistrationLeaseFields, DomainRegistrationLeaseSchema>\n\n/**\n * Identity function for DomainRegistrationLease payload\n */\nexport const isDomainRegistrationLease = isPayloadOfSchemaType<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n/**\n * @deprecated Use isDomainRegistrationLeaseWithSources instead\n */\nexport const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources\n","export type DNSQueryOpcode = 0 | 1 | 2 | 4 | 5 | 6 // Supported opcodes as numeric values\n\n// Optional: Add a more descriptive union type for the opcodes.\nexport type DNSQueryOpcodeName = 'QUERY' | 'IQUERY' | 'STATUS' | 'NOTIFY' | 'UPDATE' | 'DSO'\n\nexport const DNSQueryOpcodes: Record<DNSQueryOpcodeName, DNSQueryOpcode> = {\n QUERY: 0,\n IQUERY: 1,\n STATUS: 2,\n NOTIFY: 4,\n UPDATE: 5,\n DSO: 6,\n}\n","export type DNSRcode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18\n\nexport type DNSRcodeName =\n | 'NOERROR'\n | 'FORMERR'\n | 'SERVFAIL'\n | 'NXDOMAIN'\n | 'NOTIMP'\n | 'REFUSED'\n | 'YXDOMAIN'\n | 'YXRRSET'\n | 'NXRRSET'\n | 'NOTAUTH'\n | 'NOTZONE'\n | 'BADSIG'\n | 'BADKEY'\n | 'BADTIME'\n\nexport const DNSRcodes: Readonly<Record<DNSRcodeName, DNSRcode>> = {\n NOERROR: 0,\n FORMERR: 1,\n SERVFAIL: 2,\n NXDOMAIN: 3,\n NOTIMP: 4,\n REFUSED: 5,\n YXDOMAIN: 6,\n YXRRSET: 7,\n NXRRSET: 8,\n NOTAUTH: 9,\n NOTZONE: 10,\n BADSIG: 16,\n BADKEY: 17,\n BADTIME: 18,\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\n\n// An attempt to match compatibility with the RFC 8427 (Representing DNS Messages in JSON)\n// https://www.rfc-editor.org/rfc/rfc8427\n// and Google/CloudFlare's DNS over HTTPS (DoH) standard\n// https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/\n\nimport { type DNSQueryOpcode, DNSQueryOpcodes } from './OperationCodes.ts'\nimport type { DNSRcode } from './ResponseCodes.ts'\nimport { DNSRcodes } from './ResponseCodes.ts'\n\n// NOTE: The RFC says `Boolean` but uses 0/1 for the values. DNS over HTTPS (DoH) uses `true`/`false`.\nexport type NumericBoolean = 0 | 1 | true | false\nexport type NumericBooleanFalsy = 0 | false\nexport type NumericBooleanTruthy = 1 | true\n\nexport interface DNSHeader {\n /**\n * Transaction ID, typically a random number. Integer whose value is 0 to 65535\n */\n ID?: number\n /**\n * Query/Response Flag (0 = Query, 1 = Response)\n */\n QR?: NumericBoolean\n /**\n * Operation Code (0 for standard query)\n */\n Opcode?: DNSQueryOpcode\n /**\n * Authoritative Answer (set in response)\n */\n AA?: NumericBoolean\n /**\n * Truncated Flag\n */\n TC?: NumericBoolean // Truncation\n /**\n * Recursion Desired\n */\n RD?: NumericBoolean // Recursion Desired (set in query)\n /**\n * Response Code (0 for no error, non-0 for errors)\n */\n RCODE?: DNSRcode\n /**\n * Number of questions in the query (usually 1)\n */\n QDCOUNT?: number\n /**\n * Number of answer records in the response\n */\n ANCOUNT?: number\n /**\n * Number of authority records in the response\n */\n NSCOUNT?: number\n /**\n * Number of additional records in the response\n */\n ARCOUNT?: number\n}\n\nexport interface DNSRequestHeader extends DNSHeader {\n QR: NumericBooleanFalsy // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBooleanFalsy // Authoritative Answer (0 in query)\n TC: NumericBooleanFalsy // Truncation (0 for non-truncated)\n RCODE: typeof DNSRcodes.NOERROR // Response Code (always 0 in query)\n ANCOUNT: 0 // Number of answer records (always 0 in query)\n NSCOUNT: 0 // Number of authority records (always 0 in query)\n ARCOUNT: 0 // Number of additional records (always 0 in query)\n}\n\nexport const StandardRequestHeader: Readonly<DNSRequestHeader> = {\n ID: 0,\n QR: 0, // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcodes.QUERY, // Operation Code (0 for standard query)\n AA: 0, // Authoritative Answer (0 in query)\n TC: 0, // Truncation (0 for non-truncated)\n RD: 1, // Recursion Desired (1 if recursion is requested)\n RCODE: DNSRcodes.NOERROR, // Response Code (always 0 in query)\n QDCOUNT: 1,\n ANCOUNT: 0,\n NSCOUNT: 0,\n ARCOUNT: 0,\n}\n\nexport interface DNSResponseHeader extends DNSHeader {\n QR: NumericBooleanTruthy // Query/Response Flag (1 = Response)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBoolean // Authoritative Answer (1 if the response is authoritative)\n TC: NumericBoolean // Truncation (1 if the message is truncated)\n RA: NumericBoolean // Recursion Available (1 if the server supports recursion)\n}\n","// https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n\nexport type DNSResourceRecordType =\n | 'A'\n | 'NS'\n | 'MD'\n | 'MF'\n | 'CNAME'\n | 'SOA'\n | 'MB'\n | 'MG'\n | 'MR'\n | 'NULL'\n | 'WKS'\n | 'PTR'\n | 'HINFO'\n | 'MINFO'\n | 'MX'\n | 'TXT'\n | 'RP'\n | 'AFSDB'\n | 'X25'\n | 'ISDN'\n | 'RT'\n | 'NSAP'\n | 'NSAP-PTR'\n | 'SIG'\n | 'KEY'\n | 'PX'\n | 'GPOS'\n | 'AAAA'\n | 'LOC'\n | 'NXT'\n | 'EID'\n | 'NIMLOC'\n | 'SRV'\n | 'ATMA'\n | 'NAPTR'\n | 'KX'\n | 'CERT'\n | 'A6'\n | 'DNAME'\n | 'SINK'\n | 'OPT'\n | 'APL'\n | 'DS'\n | 'SSHFP'\n | 'IPSECKEY'\n | 'RRSIG'\n | 'NSEC'\n | 'DNSKEY'\n | 'DHCID'\n | 'NSEC3'\n | 'NSEC3PARAM'\n | 'TLSA'\n | 'SMIMEA'\n | 'HIP'\n | 'NINFO'\n | 'RKEY'\n | 'TALINK'\n | 'CDS'\n | 'CDNSKEY'\n | 'OPENPGPKEY'\n | 'CSYNC'\n | 'ZONEMD'\n | 'SVCB'\n | 'HTTPS'\n | 'SPF'\n | 'UINFO'\n | 'UID'\n | 'GID'\n | 'UNSPEC'\n | 'NID'\n | 'L32'\n | 'L64'\n | 'LP'\n | 'EUI48'\n | 'EUI64'\n | 'NXNAME'\n | 'TKEY'\n | 'TSIG'\n | 'IXFR'\n | 'AXFR'\n | 'MAILB'\n | 'MAILA'\n | '*'\n | 'URI'\n | 'CAA'\n | 'AVC'\n | 'DOA'\n | 'AMTRELAY'\n | 'RESINFO'\n | 'WALLET'\n | 'CLA'\n | 'IPN'\n | 'TA'\n | 'DLV'\n // NOTE: Custom types here\n | 'XYOA'\n | 'XYOH'\n\nexport const DNSResourceRecordTypes: Readonly<Record<DNSResourceRecordType, number>> = {\n 'A': 1, // a host address\n 'NS': 2, // an authoritative name server\n 'MD': 3, // a mail destination (OBSOLETE - use MX)\n 'MF': 4, // a mail forwarder (OBSOLETE - use MX)\n 'CNAME': 5, // the canonical name for an alias\n 'SOA': 6, // marks the start of a zone of authority\n 'MB': 7, // a mailbox domain name (EXPERIMENTAL)\n 'MG': 8, // a mail group member (EXPERIMENTAL)\n 'MR': 9, // a mail rename domain name (EXPERIMENTAL)\n 'NULL': 10, // a null RR (EXPERIMENTAL)\n 'WKS': 11, // a well known service description\n 'PTR': 12, // a domain name pointer\n 'HINFO': 13, // host information\n 'MINFO': 14, // mailbox or mail list information\n 'MX': 15, // mail exchange\n 'TXT': 16, // text strings\n 'RP': 17, // for Responsible Person\n 'AFSDB': 18, // for AFS Data Base location\n 'X25': 19, // for X.25 PSDN address\n 'ISDN': 20, // for ISDN address\n 'RT': 21, // for Route Through\n 'NSAP': 22, // for NSAP address, NSAP style A record (DEPRECATED)\n 'NSAP-PTR': 23, // for domain name pointer, NSAP style (DEPRECATED)\n 'SIG': 24, // for security signature\n 'KEY': 25, // for security key\n 'PX': 26, // X.400 mail mapping information\n 'GPOS': 27, // Geographical Position\n 'AAAA': 28, // IP6 Address\n 'LOC': 29, // Location Information\n 'NXT': 30, // Next Domain (OBSOLETE)\n 'EID': 31, // Endpoint Identifier\n 'NIMLOC': 32, // Nimrod Locator\n 'SRV': 33, // Server Selection\n 'ATMA': 34, // ATM Address\n 'NAPTR': 35, // Naming Authority Pointer\n 'KX': 36, // Key Exchanger\n 'CERT': 37, // CERT\n 'A6': 38, // A6 (OBSOLETE - use AAAA)\n 'DNAME': 39, // DNAME\n 'SINK': 40, // SINK\n 'OPT': 41, // OPT\n 'APL': 42, // APL\n 'DS': 43, // Delegation Signer\n 'SSHFP': 44, // SSH Key Fingerprint\n 'IPSECKEY': 45, // IPSECKEY\n 'RRSIG': 46, // RRSIG\n 'NSEC': 47, // NSEC\n 'DNSKEY': 48, // DNSKEY\n 'DHCID': 49, // DHCID\n 'NSEC3': 50, // NSEC3\n 'NSEC3PARAM': 51, // NSEC3PARAM\n 'TLSA': 52, // TLSA\n 'SMIMEA': 53, // S/MIME cert association\n 'HIP': 55, // Host Identity Protocol\n 'NINFO': 56, // NINFO\n 'RKEY': 57, // RKEY\n 'TALINK': 58, // Trust Anchor LINK\n 'CDS': 59, // Child DS\n 'CDNSKEY': 60, // DNSKEY(s) the Child wants reflected in DS\n 'OPENPGPKEY': 61, // OpenPGP Key\n 'CSYNC': 62, // Child-To-Parent Synchronization\n 'ZONEMD': 63, // Message Digest Over Zone Data\n 'SVCB': 64, // General-purpose service binding\n 'HTTPS': 65, // SVCB-compatible type for use with HTTP\n 'SPF': 99,\n 'UINFO': 100,\n 'UID': 101,\n 'GID': 102,\n 'UNSPEC': 103,\n 'NID': 104,\n 'L32': 105,\n 'L64': 106,\n 'LP': 107,\n 'EUI48': 108, // an EUI-48 address\n 'EUI64': 109, // an EUI-64 address\n 'NXNAME': 128, // NXDOMAIN indicator for Compact Denial of Existence\n 'TKEY': 249, // Transaction Key\n 'TSIG': 250, // Transaction Signature\n 'IXFR': 251, // incremental transfer\n 'AXFR': 252, // transfer of an entire zone\n 'MAILB': 253, // mailbox-related RRs (MB, MG or MR)\n 'MAILA': 254, // mail agent RRs (OBSOLETE - see MX)\n '*': 255, // A request for some or all records the server has available\n 'URI': 256, // URI\n 'CAA': 257, // Certification Authority Restriction\n 'AVC': 258, // Application Visibility and Control\n 'DOA': 259, // Digital Object Architecture\n 'AMTRELAY': 260, // Automatic Multicast Tunneling Relay\n 'RESINFO': 261, // Resolver Information as Key/Value Pairs\n 'WALLET': 262, // Public wallet address\n 'CLA': 263, // BP Convergence Layer Adapter\n 'IPN': 264, // BP Node Number\n 'TA': 32_768, // DNSSEC Trust Authorities\n 'DLV': 32_769, // DNSSEC Lookaside Validation (OBSOLETE)\n\n // NOTE: Custom types here chosen within the Private Use Range\n // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n // https://www.rfc-editor.org/rfc/rfc5226\n // as, per the RFC, the Private Use Range is reserved\n // \"For private or local use only, with the type and\n // purpose defined by the local site. No attempt is made to\n // prevent multiple sites from using the same value in\n // different (and incompatible) ways. There is no need for\n // IANA to review such assignments (since IANA does not record\n // them) and assignments are not generally useful for broad\n // interoperability. It is the responsibility of the sites\n // making use of the Private Use range to ensure that no\n // conflicts occur (within the intended scope of use).\"\n // If we want to apply for a custom reserved code later\n // on, once the usage is proven enough we can absolutely\n // do that.\n 'XYOA': 65_432, // XYO Address\n 'XYOH': 65_433, // XYO Hash\n}\n\nexport type DNSResourceRecordTypeValue = (typeof DNSResourceRecordTypes)[keyof typeof DNSResourceRecordTypes]\n\nexport const findDNSResourceRecordTypesByValue = (value: DNSResourceRecordTypeValue): DNSResourceRecordType | undefined => {\n // Iterate through the keys of the record\n for (const key in DNSResourceRecordTypes) {\n const resourceRecordType = key as DNSResourceRecordType\n if (DNSResourceRecordTypes[resourceRecordType] === value) {\n return resourceRecordType // Return the key if the value matches\n }\n }\n return undefined // Return undefined if no matching value is found\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport { type DNSRequestHeader, StandardRequestHeader } from './Header.ts'\nimport type { DNSResourceRecordTypeValue } from './ResourceRecord.ts'\nimport { DNSResourceRecordTypes } from './ResourceRecord.ts'\n\nexport interface DNSQuestion {\n name: string // The domain name that was queried\n type: DNSResourceRecordTypeValue // The record type (e.g., 1 for A record)\n class?: number // Query Class (typically 1 for IN - Internet)\n}\n\nexport interface DNSRequestFields extends DNSRequestHeader {\n Question: DNSQuestion[]\n}\n\n/**\n * Helper for generating a DNS request for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNS request\n */\nexport const getRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequestFields => {\n return {\n ...StandardRequestHeader,\n ID: getRandomId(),\n Question: [{\n name: domain, type, class: 1,\n }],\n }\n}\n\n/**\n * Used to generate a random ID for a DNS request\n * @returns A random number between 0 and 65,535\n */\nexport const getRandomId = (): number => {\n return Math.floor(Math.random() * 65_536) // Math.random() generates a number between 0 and 1, multiply by 65536 to get the range 0-65535\n}\n","export type DNSSchema = 'network.xyo.dns'\nexport const DNSSchema: DNSSchema = 'network.xyo.dns'\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nimport type { DNSResourceRecordType } from '../types/index.ts'\nimport { DNSSchema } from './Schema.ts'\n\nexport type DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\nexport const DNSWitnessConfigSchema: DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\n\nexport type DNSWitnessConfig = WitnessConfig<{\n /**\n * The address record index diviner to be used to determine the address record index\n */\n addressRecordIndexDiviner?: ModuleIdentifier\n /**\n * The hash record index diviner to be used to determine the hash record index\n */\n hashRecordIndexDiviner?: ModuleIdentifier\n /**\n * The config schema for the DNS witness\n */\n schema: DNSWitnessConfigSchema\n /**\n * If supplied, the DNS witness will only support the specified resource record types\n */\n supportedResources?: DNSResourceRecordType[]\n}>\n","import type { PayloadWithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSRequestFields, DNSResourceRecordTypeValue } from '../../types/index.ts'\nimport { DNSResourceRecordTypes, getRequestFor } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSRequest payload\n */\nexport type DNSRequest = PayloadWithSources<DNSRequestFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSRequest payload\n */\nexport const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with sources\n */\nexport const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<DNSRequest>(DNSSchema)\n\n/**\n * Helper for generating a DNSRequest payload for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNSRequest payload\n */\nexport const getDnsRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequest => {\n return { ...getRequestFor(domain, type), schema: DNSSchema }\n}\n","import type { PayloadWithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSResponseFields } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSResponse payload\n */\nexport type DNSResponse = PayloadWithSources<DNSResponseFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSResponse payload\n */\nexport const isDNSResponse = isPayloadOfSchemaType<DNSResponse>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with sources\n */\nexport const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\n\n// BW Validations\nexport const validateBoundWitness = async (recordBw: BoundWitness, requiredSchemas: string[] = []): Promise<boolean> => {\n // If the BW does not include all of the required schemas\n if (!requiredSchemas.every(requiredSchema => recordBw.payload_schemas.includes(requiredSchema))) return false\n // If the BW is valid (does not include any errors)\n const validator = new BoundWitnessValidator(recordBw)\n const errors = await validator.validate()\n return errors.length === 0\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// BW & Record Validations\nexport const validateBoundWitnessAndDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n if (!(await recordIsInBoundWitness(recordBw, recordPayload))) return false\n if (!recordIsTemporallyValidToBoundWitness(recordBw, recordPayload)) return false\n return true\n}\n\nconst recordIsInBoundWitness = async (recordBw: BoundWitness, recordPayload: Payload): Promise<boolean> => {\n const hash = await PayloadBuilder.dataHash(recordPayload)\n return recordBw.payload_hashes.includes(hash)\n}\n\nconst recordIsTemporallyValidToBoundWitness = (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): boolean => {\n const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// Record Validations\nexport const validateDuration = (recordPayload: Payload<DurationFields>): boolean => {\n // if (!isValidAddress(recordPayload)) return false\n if (!isWithinDelegatedTimeframe(recordPayload)) return false\n return true\n}\n\nexport const isWithinDelegatedTimeframe = (recordPayload: Payload<DurationFields>, now = Date.now()): boolean => {\n // nbf < now < exp\n return recordPayload.nbf < now && now < recordPayload.exp\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\nimport { validateBoundWitness } from './validateBoundWitness.ts'\nimport { validateBoundWitnessAndDuration } from './validateBoundWitnessAndDuration.ts'\nimport { validateDuration } from './validateDuration.ts'\n\nexport const validateBoundWitnessWithDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n // Validate the BW\n if (!(await validateBoundWitness(recordBw, [recordPayload.schema]))) return false\n // Validate the record\n if (!validateDuration(recordPayload)) return false\n // Validate the record relative to the BW\n if (!(await validateBoundWitnessAndDuration(recordBw, recordPayload))) return false\n return true\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type HashRecordSchema = 'network.xyo.ns.record.hash'\nexport const HashRecordSchema: HashRecordSchema = 'network.xyo.ns.record.hash'\n\nexport interface HashRecordFields extends DomainFields {\n /**\n * The hash the record points to\n */\n hash: Hash[]\n}\n\n/**\n * An hash record points a domain to an hash\n */\nexport type HashRecord = Payload<HashRecordFields, HashRecordSchema>\n\nexport const isHashRecord = isPayloadOfSchemaType<HashRecord>(HashRecordSchema)\n"],"mappings":";AAEA,SAAS,6BAA6B;AAK/B,IAAM,sBAA2C;AAcjD,IAAM,kBAAkB,sBAAqC,mBAAmB;;;ACrBhF,IAAM,yDACT;;;ACKG,IAAM,mDAGT;AAAA,EACF,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;A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;;ACdA,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,mBAAqC;AAc3C,IAAM,eAAeA,uBAAkC,gBAAgB;","names":["isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","PayloadBuilder","isPayloadOfSchemaType"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xns-record-payload-plugins",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.0-rc.1",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -29,26 +29,27 @@
|
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/exists": "^4.4.
|
|
33
|
-
"@xylabs/hex": "^4.4.
|
|
34
|
-
"@xyo-network/boundwitness-model": "^3.
|
|
35
|
-
"@xyo-network/boundwitness-validator": "^3.
|
|
36
|
-
"@xyo-network/diviner-hash-lease": "^3.
|
|
37
|
-
"@xyo-network/module-model": "^3.
|
|
38
|
-
"@xyo-network/payload-builder": "^3.
|
|
39
|
-
"@xyo-network/payload-model": "^3.
|
|
40
|
-
"@xyo-network/witness-model": "^3.
|
|
32
|
+
"@xylabs/exists": "^4.4.12",
|
|
33
|
+
"@xylabs/hex": "^4.4.12",
|
|
34
|
+
"@xyo-network/boundwitness-model": "^3.6.0-rc.1",
|
|
35
|
+
"@xyo-network/boundwitness-validator": "^3.6.0-rc.1",
|
|
36
|
+
"@xyo-network/diviner-hash-lease": "^3.6.0-rc.1",
|
|
37
|
+
"@xyo-network/module-model": "^3.6.0-rc.1",
|
|
38
|
+
"@xyo-network/payload-builder": "^3.6.0-rc.1",
|
|
39
|
+
"@xyo-network/payload-model": "^3.6.0-rc.1",
|
|
40
|
+
"@xyo-network/witness-model": "^3.6.0-rc.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@xylabs/ts-scripts-yarn3": "^4.2.4",
|
|
44
44
|
"@xylabs/tsconfig": "^4.2.4",
|
|
45
|
-
"@xylabs/vitest-matchers": "^4.4.
|
|
46
|
-
"@xyo-network/account": "^3.
|
|
47
|
-
"@xyo-network/boundwitness-builder": "^3.
|
|
45
|
+
"@xylabs/vitest-matchers": "^4.4.12",
|
|
46
|
+
"@xyo-network/account": "^3.6.0-rc.1",
|
|
47
|
+
"@xyo-network/boundwitness-builder": "^3.6.0-rc.1",
|
|
48
48
|
"typescript": "^5.7.2",
|
|
49
|
-
"vitest": "^2.1.
|
|
49
|
+
"vitest": "^2.1.8"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
|
+
"stableVersion": "3.1.2"
|
|
54
55
|
}
|
package/src/Address/Payload.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Payload
|
|
2
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import type { DomainFields } from '../Domain/index.ts'
|
|
@@ -20,4 +20,3 @@ export interface AddressRecordFields extends DomainFields {
|
|
|
20
20
|
export type AddressRecord = Payload<AddressRecordFields, AddressRecordSchema>
|
|
21
21
|
|
|
22
22
|
export const isAddressRecord = isPayloadOfSchemaType<AddressRecord>(AddressRecordSchema)
|
|
23
|
-
export const isAddressRecordWithMeta = isPayloadOfSchemaType<WithMeta<AddressRecord>>(AddressRecordSchema)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PayloadWithSources } from '@xyo-network/payload-model'
|
|
2
2
|
import {
|
|
3
3
|
isPayloadOfSchemaType,
|
|
4
|
-
isPayloadOfSchemaTypeWithMeta,
|
|
5
4
|
isPayloadOfSchemaTypeWithSources,
|
|
6
5
|
} from '@xyo-network/payload-model'
|
|
7
6
|
|
|
@@ -24,11 +23,6 @@ export const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)
|
|
|
24
23
|
*/
|
|
25
24
|
export const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<DNSRequest>(DNSSchema)
|
|
26
25
|
|
|
27
|
-
/**
|
|
28
|
-
* Identity function for determining if an object is a DNSRequest payload with meta
|
|
29
|
-
*/
|
|
30
|
-
export const isDNSRequestWithMeta = isPayloadOfSchemaTypeWithMeta<DNSRequest>(DNSSchema)
|
|
31
|
-
|
|
32
26
|
/**
|
|
33
27
|
* Helper for generating a DNSRequest payload for a given domain and record type
|
|
34
28
|
* @param domain The domain to query
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PayloadWithSources } from '@xyo-network/payload-model'
|
|
2
2
|
import {
|
|
3
3
|
isPayloadOfSchemaType,
|
|
4
|
-
isPayloadOfSchemaTypeWithMeta,
|
|
5
4
|
isPayloadOfSchemaTypeWithSources,
|
|
6
5
|
} from '@xyo-network/payload-model'
|
|
7
6
|
|
|
@@ -22,8 +21,3 @@ export const isDNSResponse = isPayloadOfSchemaType<DNSResponse>(DNSSchema)
|
|
|
22
21
|
* Identity function for determining if an object is a DNSResponse payload with sources
|
|
23
22
|
*/
|
|
24
23
|
export const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Identity function for determining if an object is a DNSResponse payload with meta
|
|
28
|
-
*/
|
|
29
|
-
export const isDNSResponseWithMeta = isPayloadOfSchemaTypeWithMeta<DNSResponse>(DNSSchema)
|
package/src/Domain/Domain.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import {
|
|
3
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
4
|
-
} from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
export type DomainSchema = 'network.xyo.ns.domain'
|
|
7
5
|
export const DomainSchema: DomainSchema = 'network.xyo.ns.domain'
|
|
@@ -40,8 +38,3 @@ export const isDomain = isPayloadOfSchemaType<Domain>(DomainSchema)
|
|
|
40
38
|
* Identity function for Domain payload with sources
|
|
41
39
|
*/
|
|
42
40
|
export const isDomainWithSources = isPayloadOfSchemaTypeWithSources<Domain>(DomainSchema)
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Identity function for Domain payload with meta
|
|
46
|
-
*/
|
|
47
|
-
export const isDomainWithMeta = isPayloadOfSchemaTypeWithMeta<Domain>(DomainSchema)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import {
|
|
3
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
4
|
-
} from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
import type { DurationFields } from '../Duration/index.ts'
|
|
7
5
|
import type { DomainFields } from './Domain.ts'
|
|
@@ -28,8 +26,3 @@ export const isDomainLease = isPayloadOfSchemaType<DomainLease>(DomainLeaseSchem
|
|
|
28
26
|
* Identity function for DomainLease payload with sources
|
|
29
27
|
*/
|
|
30
28
|
export const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainLease>(DomainLeaseSchema)
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Identity function for DomainLease payload with meta
|
|
34
|
-
*/
|
|
35
|
-
export const isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainLease>(DomainLeaseSchema)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
2
2
|
import type { HashLeaseEstimate } from '@xyo-network/diviner-hash-lease'
|
|
3
|
-
import type {
|
|
3
|
+
import type { WithSources } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import type { DomainRegistrationLease } from '../DomainRegistration/index.ts'
|
|
6
6
|
|
|
7
7
|
export type DomainEstimate = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
BoundWitness,
|
|
9
|
+
WithSources<HashLeaseEstimate>,
|
|
10
|
+
WithSources<DomainRegistrationLease>,
|
|
11
11
|
]
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex'
|
|
2
2
|
import type { Payload } from '@xyo-network/payload-model'
|
|
3
|
-
import {
|
|
4
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
5
|
-
} from '@xyo-network/payload-model'
|
|
3
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
6
4
|
|
|
7
5
|
import type { DomainFields } from '../Domain/index.ts'
|
|
8
6
|
import { DomainSchema } from '../Domain/index.ts'
|
|
@@ -35,8 +33,3 @@ export const isDomainRegistration = isPayloadOfSchemaType<DomainRegistration>(Do
|
|
|
35
33
|
* Identity function for DomainRegistration payload with sources
|
|
36
34
|
*/
|
|
37
35
|
export const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistration>(DomainRegistrationSchema)
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Identity function for DomainRegistration payload with meta
|
|
41
|
-
*/
|
|
42
|
-
export const isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistration>(DomainRegistrationSchema)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import {
|
|
3
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
4
|
-
} from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
import type { DurationFields } from '../Duration/index.ts'
|
|
7
5
|
import type { DomainRegistrationFields } from './DomainRegistration.ts'
|
|
@@ -30,12 +28,3 @@ export const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSou
|
|
|
30
28
|
* @deprecated Use isDomainRegistrationLeaseWithSources instead
|
|
31
29
|
*/
|
|
32
30
|
export const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Identity function for DomainRegistrationLease payload with meta
|
|
36
|
-
*/
|
|
37
|
-
export const isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistrationLease>(DomainRegistrationLeaseSchema)
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Use isDomainRegistrationLeaseWithMeta instead
|
|
40
|
-
*/
|
|
41
|
-
export const isDomainRegistrationLeaseMeta = isDomainRegistrationLeaseWithMeta
|