@xyo-network/xns-record-payload-plugins 6.0.0 → 6.0.2

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.
Files changed (109) hide show
  1. package/dist/browser/Address/Payload.d.ts +2 -2
  2. package/dist/browser/Address/Payload.d.ts.map +1 -1
  3. package/dist/browser/DNS/Witness/Config.d.ts +1 -2
  4. package/dist/browser/DNS/Witness/Config.d.ts.map +1 -1
  5. package/dist/browser/DNS/Witness/Params.d.ts +1 -2
  6. package/dist/browser/DNS/Witness/Params.d.ts.map +1 -1
  7. package/dist/browser/DNS/Witness/Payload/Request.d.ts +3 -3
  8. package/dist/browser/DNS/Witness/Payload/Request.d.ts.map +1 -1
  9. package/dist/browser/DNS/Witness/Payload/Response.d.ts +3 -3
  10. package/dist/browser/DNS/Witness/Payload/Response.d.ts.map +1 -1
  11. package/dist/browser/Domain/Domain.d.ts +3 -3
  12. package/dist/browser/Domain/Domain.d.ts.map +1 -1
  13. package/dist/browser/Domain/DomainLease.d.ts +3 -3
  14. package/dist/browser/Domain/DomainLease.d.ts.map +1 -1
  15. package/dist/browser/DomainEstimate/DomainEstimate.d.ts +1 -2
  16. package/dist/browser/DomainEstimate/DomainEstimate.d.ts.map +1 -1
  17. package/dist/browser/DomainRegistration/DomainRegistration.d.ts +3 -3
  18. package/dist/browser/DomainRegistration/DomainRegistration.d.ts.map +1 -1
  19. package/dist/browser/DomainRegistration/DomainRegistrationLease.d.ts +4 -4
  20. package/dist/browser/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
  21. package/dist/browser/Duration/validation/validateBoundWitness.d.ts +1 -2
  22. package/dist/browser/Duration/validation/validateBoundWitness.d.ts.map +1 -1
  23. package/dist/browser/Duration/validation/validateBoundWitnessAndDuration.d.ts +1 -2
  24. package/dist/browser/Duration/validation/validateBoundWitnessAndDuration.d.ts.map +1 -1
  25. package/dist/browser/Duration/validation/validateBoundWitnessWithDuration.d.ts +1 -2
  26. package/dist/browser/Duration/validation/validateBoundWitnessWithDuration.d.ts.map +1 -1
  27. package/dist/browser/Duration/validation/validateDuration.d.ts +1 -1
  28. package/dist/browser/Duration/validation/validateDuration.d.ts.map +1 -1
  29. package/dist/browser/Hash/Payload.d.ts +2 -2
  30. package/dist/browser/Hash/Payload.d.ts.map +1 -1
  31. package/dist/browser/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +3 -3
  32. package/dist/browser/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
  33. package/dist/browser/diviner/lib/parseEstimatesFromArray.d.ts +1 -2
  34. package/dist/browser/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
  35. package/dist/browser/index.mjs +14 -15
  36. package/dist/browser/index.mjs.map +2 -2
  37. package/dist/neutral/Address/Payload.d.ts +2 -2
  38. package/dist/neutral/Address/Payload.d.ts.map +1 -1
  39. package/dist/neutral/DNS/Witness/Config.d.ts +1 -2
  40. package/dist/neutral/DNS/Witness/Config.d.ts.map +1 -1
  41. package/dist/neutral/DNS/Witness/Params.d.ts +1 -2
  42. package/dist/neutral/DNS/Witness/Params.d.ts.map +1 -1
  43. package/dist/neutral/DNS/Witness/Payload/Request.d.ts +3 -3
  44. package/dist/neutral/DNS/Witness/Payload/Request.d.ts.map +1 -1
  45. package/dist/neutral/DNS/Witness/Payload/Response.d.ts +3 -3
  46. package/dist/neutral/DNS/Witness/Payload/Response.d.ts.map +1 -1
  47. package/dist/neutral/Domain/Domain.d.ts +3 -3
  48. package/dist/neutral/Domain/Domain.d.ts.map +1 -1
  49. package/dist/neutral/Domain/DomainLease.d.ts +3 -3
  50. package/dist/neutral/Domain/DomainLease.d.ts.map +1 -1
  51. package/dist/neutral/DomainEstimate/DomainEstimate.d.ts +1 -2
  52. package/dist/neutral/DomainEstimate/DomainEstimate.d.ts.map +1 -1
  53. package/dist/neutral/DomainRegistration/DomainRegistration.d.ts +3 -3
  54. package/dist/neutral/DomainRegistration/DomainRegistration.d.ts.map +1 -1
  55. package/dist/neutral/DomainRegistration/DomainRegistrationLease.d.ts +4 -4
  56. package/dist/neutral/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
  57. package/dist/neutral/Duration/validation/validateBoundWitness.d.ts +1 -2
  58. package/dist/neutral/Duration/validation/validateBoundWitness.d.ts.map +1 -1
  59. package/dist/neutral/Duration/validation/validateBoundWitnessAndDuration.d.ts +1 -2
  60. package/dist/neutral/Duration/validation/validateBoundWitnessAndDuration.d.ts.map +1 -1
  61. package/dist/neutral/Duration/validation/validateBoundWitnessWithDuration.d.ts +1 -2
  62. package/dist/neutral/Duration/validation/validateBoundWitnessWithDuration.d.ts.map +1 -1
  63. package/dist/neutral/Duration/validation/validateDuration.d.ts +1 -1
  64. package/dist/neutral/Duration/validation/validateDuration.d.ts.map +1 -1
  65. package/dist/neutral/Hash/Payload.d.ts +2 -2
  66. package/dist/neutral/Hash/Payload.d.ts.map +1 -1
  67. package/dist/neutral/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +3 -3
  68. package/dist/neutral/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
  69. package/dist/neutral/diviner/lib/parseEstimatesFromArray.d.ts +1 -2
  70. package/dist/neutral/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
  71. package/dist/neutral/index.mjs +14 -15
  72. package/dist/neutral/index.mjs.map +2 -2
  73. package/dist/node/Address/Payload.d.ts +2 -2
  74. package/dist/node/Address/Payload.d.ts.map +1 -1
  75. package/dist/node/DNS/Witness/Config.d.ts +1 -2
  76. package/dist/node/DNS/Witness/Config.d.ts.map +1 -1
  77. package/dist/node/DNS/Witness/Params.d.ts +1 -2
  78. package/dist/node/DNS/Witness/Params.d.ts.map +1 -1
  79. package/dist/node/DNS/Witness/Payload/Request.d.ts +3 -3
  80. package/dist/node/DNS/Witness/Payload/Request.d.ts.map +1 -1
  81. package/dist/node/DNS/Witness/Payload/Response.d.ts +3 -3
  82. package/dist/node/DNS/Witness/Payload/Response.d.ts.map +1 -1
  83. package/dist/node/Domain/Domain.d.ts +3 -3
  84. package/dist/node/Domain/Domain.d.ts.map +1 -1
  85. package/dist/node/Domain/DomainLease.d.ts +3 -3
  86. package/dist/node/Domain/DomainLease.d.ts.map +1 -1
  87. package/dist/node/DomainEstimate/DomainEstimate.d.ts +1 -2
  88. package/dist/node/DomainEstimate/DomainEstimate.d.ts.map +1 -1
  89. package/dist/node/DomainRegistration/DomainRegistration.d.ts +3 -3
  90. package/dist/node/DomainRegistration/DomainRegistration.d.ts.map +1 -1
  91. package/dist/node/DomainRegistration/DomainRegistrationLease.d.ts +4 -4
  92. package/dist/node/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
  93. package/dist/node/Duration/validation/validateBoundWitness.d.ts +1 -2
  94. package/dist/node/Duration/validation/validateBoundWitness.d.ts.map +1 -1
  95. package/dist/node/Duration/validation/validateBoundWitnessAndDuration.d.ts +1 -2
  96. package/dist/node/Duration/validation/validateBoundWitnessAndDuration.d.ts.map +1 -1
  97. package/dist/node/Duration/validation/validateBoundWitnessWithDuration.d.ts +1 -2
  98. package/dist/node/Duration/validation/validateBoundWitnessWithDuration.d.ts.map +1 -1
  99. package/dist/node/Duration/validation/validateDuration.d.ts +1 -1
  100. package/dist/node/Duration/validation/validateDuration.d.ts.map +1 -1
  101. package/dist/node/Hash/Payload.d.ts +2 -2
  102. package/dist/node/Hash/Payload.d.ts.map +1 -1
  103. package/dist/node/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +3 -3
  104. package/dist/node/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
  105. package/dist/node/diviner/lib/parseEstimatesFromArray.d.ts +1 -2
  106. package/dist/node/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
  107. package/dist/node/index.mjs +14 -15
  108. package/dist/node/index.mjs.map +2 -2
  109. package/package.json +17 -63
@@ -1,5 +1,5 @@
1
1
  import type { Address } from '@xylabs/sdk-js';
2
- import type { Payload, WithSources } from '@xyo-network/payload-model';
2
+ import type { Payload, WithSources } from '@xyo-network/sdk-js';
3
3
  import type { DomainFields } from '../Domain/index.ts';
4
4
  export declare const DomainRegistrationSchema: string & {
5
5
  readonly __schema: true;
@@ -22,13 +22,13 @@ export type DomainRegistration = Payload<DomainRegistrationFields, DomainRegistr
22
22
  /**
23
23
  * Identity function for DomainRegistration payload
24
24
  */
25
- export declare const isDomainRegistration: (x?: unknown | null) => x is DomainRegistration;
25
+ export declare const isDomainRegistration: (x?: unknown) => x is DomainRegistration;
26
26
  export declare const asDomainRegistration: import("@xylabs/sdk-js").AsTypeFunction<DomainRegistration>;
27
27
  export declare const asOptionalDomainRegistration: (value: import("@xylabs/sdk-js").AnyNonPromise) => DomainRegistration | undefined;
28
28
  /**
29
29
  * Identity function for DomainRegistration payload with sources
30
30
  */
31
- export declare const isDomainRegistrationWithSources: (x?: unknown | null) => x is WithSources<WithSources<DomainRegistration>>;
31
+ export declare const isDomainRegistrationWithSources: (x?: unknown) => x is WithSources<WithSources<DomainRegistration>>;
32
32
  export declare const asDomainRegistrationWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<DomainRegistration>>;
33
33
  export declare const asOptionalDomainRegistrationWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<DomainRegistration> | undefined;
34
34
  //# sourceMappingURL=DomainRegistration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DomainRegistration.d.ts","sourceRoot":"","sources":["../../../src/DomainRegistration/DomainRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAKtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,eAAO,MAAM,wBAAwB;;CAAiD,CAAA;AACtF,MAAM,MAAM,wBA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mE,CAAA;AACpG,eAAO,MAAM,4BAA4B,mFAA2E,CAAA;AAEpH;;GAEG;AACH,eAAO,MAAM,+BAA+B,oEAA8F,CAAA;AAC1I,eAAO,MAAM,+BAA+B,0EAA2F,CAAA;AACvI,eAAO,MAAM,uCAAuC,gGAAmG,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Payload, WithSources } from '@xyo-network/payload-model';
1
+ import type { Payload, WithSources } from '@xyo-network/sdk-js';
2
2
  import type { DurationFields } from '../Duration/index.ts';
3
3
  import type { DomainRegistrationFields } from './DomainRegistration.ts';
4
4
  export declare const DomainRegistrationLeaseSchema: string & {
@@ -14,17 +14,17 @@ export type DomainRegistrationLease = Payload<DomainRegistrationLeaseFields, Dom
14
14
  /**
15
15
  * Identity function for DomainRegistrationLease payload
16
16
  */
17
- export declare const isDomainRegistrationLease: (x?: unknown | null) => x is DomainRegistrationLease;
17
+ export declare const isDomainRegistrationLease: (x?: unknown) => x is DomainRegistrationLease;
18
18
  export declare const asDomainRegistrationLease: import("@xylabs/sdk-js").AsTypeFunction<DomainRegistrationLease>;
19
19
  export declare const asOptionalDomainRegistrationLease: (value: import("@xylabs/sdk-js").AnyNonPromise) => DomainRegistrationLease | undefined;
20
20
  /**
21
21
  * Identity function for DomainRegistrationLease payload with sources
22
22
  */
23
- export declare const isDomainRegistrationLeaseWithSources: (x?: unknown | null) => x is WithSources<WithSources<DomainRegistrationLease>>;
23
+ export declare const isDomainRegistrationLeaseWithSources: (x?: unknown) => x is WithSources<WithSources<DomainRegistrationLease>>;
24
24
  export declare const asDomainRegistrationLeaseWithSources: import("@xylabs/sdk-js").AsTypeFunction<WithSources<DomainRegistrationLease>>;
25
25
  export declare const asOptionalDomainRegistrationLeaseWithSources: (value: import("@xylabs/sdk-js").AnyNonPromise) => WithSources<DomainRegistrationLease> | undefined;
26
26
  /**
27
27
  * @deprecated Use isDomainRegistrationLeaseWithSources instead
28
28
  */
29
- export declare const isDomainRegistrationLeaseSources: (x?: unknown | null) => x is WithSources<WithSources<DomainRegistrationLease>>;
29
+ export declare const isDomainRegistrationLeaseSources: (x?: unknown) => x is WithSources<WithSources<DomainRegistrationLease>>;
30
30
  //# sourceMappingURL=DomainRegistrationLease.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DomainRegistrationLease.d.ts","sourceRoot":"","sources":["../../../src/DomainRegistration/DomainRegistrationLease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAKtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAGvE,eAAO,MAAM,6BAA6B;;CAAsD,CAAA;AAChG,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,cAAc;CAAG;AAElG;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AAE3G;;GAEG;AACH,eAAO,MAAM,yBAAyB,sDAAgF,CAAA;AACtH,eAAO,MAAM,yBAAyB,kEAA6E,CAAA;AACnH,eAAO,MAAM,iCAAiC,wFAAqF,CAAA;AAEnI;;GAEG;AACH,eAAO,MAAM,oCAAoC,gFAAwG,CAAA;AACzJ,eAAO,MAAM,oCAAoC,+EAAqG,CAAA;AACtJ,eAAO,MAAM,4CAA4C,qGACoC,CAAA;AAE7F;;GAEG;AACH,eAAO,MAAM,gCAAgC,gFAAuC,CAAA"}
1
+ {"version":3,"file":"DomainRegistrationLease.d.ts","sourceRoot":"","sources":["../../../src/DomainRegistration/DomainRegistrationLease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAGvE,eAAO,MAAM,6BAA6B;;CAAsD,CAAA;AAChG,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,cAAc;CAAG;AAElG;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AAE3G;;GAEG;AACH,eAAO,MAAM,yBAAyB,+CAAgF,CAAA;AACtH,eAAO,MAAM,yBAAyB,kEAA6E,CAAA;AACnH,eAAO,MAAM,iCAAiC,wFAAqF,CAAA;AAEnI;;GAEG;AACH,eAAO,MAAM,oCAAoC,yEAAwG,CAAA;AACzJ,eAAO,MAAM,oCAAoC,+EAAqG,CAAA;AACtJ,eAAO,MAAM,4CAA4C,qGACoC,CAAA;AAE7F;;GAEG;AACH,eAAO,MAAM,gCAAgC,yEAAuC,CAAA"}
@@ -1,4 +1,3 @@
1
- import type { BoundWitness } from '@xyo-network/boundwitness-model';
2
- import type { Schema } from '@xyo-network/payload-model';
1
+ import type { BoundWitness, Schema } from '@xyo-network/sdk-js';
3
2
  export declare const validateBoundWitness: (recordBw: BoundWitness, requiredSchemas?: Schema[]) => Promise<boolean>;
4
3
  //# sourceMappingURL=validateBoundWitness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validateBoundWitness.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAGxD,eAAO,MAAM,oBAAoB,GAAU,UAAU,YAAY,EAAE,kBAAiB,MAAM,EAAO,KAAG,OAAO,CAAC,OAAO,CAOlH,CAAA"}
1
+ {"version":3,"file":"validateBoundWitness.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAI/D,eAAO,MAAM,oBAAoB,GAAU,UAAU,YAAY,EAAE,kBAAiB,MAAM,EAAO,KAAG,OAAO,CAAC,OAAO,CAOlH,CAAA"}
@@ -1,5 +1,4 @@
1
- import type { BoundWitness } from '@xyo-network/boundwitness-model';
2
- import type { Payload } from '@xyo-network/payload-model';
1
+ import type { BoundWitness, Payload } from '@xyo-network/sdk-js';
3
2
  import type { DurationFields } from '../Duration.ts';
4
3
  export declare const validateBoundWitnessAndDuration: (recordBw: BoundWitness, recordPayload: Payload<DurationFields>) => Promise<boolean>;
5
4
  //# sourceMappingURL=validateBoundWitnessAndDuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validateBoundWitnessAndDuration.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateBoundWitnessAndDuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,eAAO,MAAM,+BAA+B,GAAU,UAAU,YAAY,EAAE,eAAe,OAAO,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,OAAO,CAGrI,CAAA"}
1
+ {"version":3,"file":"validateBoundWitnessAndDuration.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateBoundWitnessAndDuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,eAAO,MAAM,+BAA+B,GAAU,UAAU,YAAY,EAAE,eAAe,OAAO,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,OAAO,CAGrI,CAAA"}
@@ -1,5 +1,4 @@
1
- import type { BoundWitness } from '@xyo-network/boundwitness-model';
2
- import type { Payload } from '@xyo-network/payload-model';
1
+ import type { BoundWitness, Payload } from '@xyo-network/sdk-js';
3
2
  import type { DurationFields } from '../Duration.ts';
4
3
  export declare const validateBoundWitnessWithDuration: (recordBw: BoundWitness, recordPayload: Payload<DurationFields>) => Promise<boolean>;
5
4
  //# sourceMappingURL=validateBoundWitnessWithDuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validateBoundWitnessWithDuration.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateBoundWitnessWithDuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAKpD,eAAO,MAAM,gCAAgC,GAAU,UAAU,YAAY,EAAE,eAAe,OAAO,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,OAAO,CAOtI,CAAA"}
1
+ {"version":3,"file":"validateBoundWitnessWithDuration.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateBoundWitnessWithDuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAKpD,eAAO,MAAM,gCAAgC,GAAU,UAAU,YAAY,EAAE,eAAe,OAAO,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,OAAO,CAOtI,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Payload } from '@xyo-network/payload-model';
1
+ import type { Payload } from '@xyo-network/sdk-js';
2
2
  import type { DurationFields } from '../Duration.ts';
3
3
  export declare const validateDuration: (recordPayload: Payload<DurationFields>) => boolean;
4
4
  export declare const isWithinDelegatedTimeframe: (recordPayload: Payload<DurationFields>, now?: number) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"validateDuration.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateDuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,eAAO,MAAM,gBAAgB,GAAI,eAAe,OAAO,CAAC,cAAc,CAAC,KAAG,OAGzE,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,eAAe,OAAO,CAAC,cAAc,CAAC,EAAE,YAAgB,KAAG,OAGrG,CAAA"}
1
+ {"version":3,"file":"validateDuration.d.ts","sourceRoot":"","sources":["../../../../src/Duration/validation/validateDuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,eAAO,MAAM,gBAAgB,GAAI,eAAe,OAAO,CAAC,cAAc,CAAC,KAAG,OAGzE,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,eAAe,OAAO,CAAC,cAAc,CAAC,EAAE,YAAgB,KAAG,OAGrG,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { Hash } from '@xylabs/sdk-js';
2
- import type { Payload } from '@xyo-network/payload-model';
2
+ import type { Payload } from '@xyo-network/sdk-js';
3
3
  import type { DomainFields } from '../Domain/index.ts';
4
4
  export type HashRecordSchema = typeof HashRecordSchema;
5
5
  export declare const HashRecordSchema: "network.xyo.ns.record.hash" & {
@@ -15,5 +15,5 @@ export interface HashRecordFields extends DomainFields {
15
15
  * An hash record points a domain to an hash
16
16
  */
17
17
  export type HashRecord = Payload<HashRecordFields, HashRecordSchema>;
18
- export declare const isHashRecord: (x?: unknown | null) => x is HashRecord;
18
+ export declare const isHashRecord: (x?: unknown) => x is HashRecord;
19
19
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Hash/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAA;AACtD,eAAO,MAAM,gBAAgB;;CAA+C,CAAA;AAE5E,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD;;OAEG;IACH,IAAI,EAAE,IAAI,EAAE,CAAA;CACb;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;AAEpE,eAAO,MAAM,YAAY,yCAAsD,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Hash/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAA;AACtD,eAAO,MAAM,gBAAgB;;CAA+C,CAAA;AAE5E,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD;;OAEG;IACH,IAAI,EAAE,IAAI,EAAE,CAAA;CACb;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;AAEpE,eAAO,MAAM,YAAY,kCAAsD,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Payload } from '@xyo-network/payload-model';
1
+ import type { Payload } from '@xyo-network/sdk-js';
2
2
  import { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts';
3
3
  export interface ErrorDetails<TErrorCode extends string | undefined = string | undefined> {
4
4
  [key: string]: any;
@@ -25,9 +25,9 @@ export type DomainLeaseEstimateDivinerValidationErrorDetails<TErrorCode extends
25
25
  /**
26
26
  * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload
27
27
  */
28
- export declare const isDomainLeaseEstimateDivinerValidationErrorDetails: (x?: unknown | null) => x is DomainLeaseEstimateDivinerValidationErrorDetails<string>;
28
+ export declare const isDomainLeaseEstimateDivinerValidationErrorDetails: (x?: unknown) => x is DomainLeaseEstimateDivinerValidationErrorDetails<string>;
29
29
  /**
30
30
  * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with sources
31
31
  */
32
- export declare const isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources: (x?: unknown | null) => x is import("@xyo-network/payload-model").WithSources<DomainLeaseEstimateDivinerValidationErrorDetails<string>>;
32
+ export declare const isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources: (x?: unknown) => x is import("@xyo-network/sdk-js").WithSources<DomainLeaseEstimateDivinerValidationErrorDetails<string>>;
33
33
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,EAAE,sDAAsD,EAAE,MAAM,cAAc,CAAA;AAErF,MAAM,WAAW,YAAY,CAAC,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS;IAEtF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB;;OAEG;IACH,IAAI,EAAE,UAAU,CAAA;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAC9D,QAAQ,EAAE,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;CACxC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gDAAgD,CAAC,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,IAAI,OAAO,CACpH,YAAY,CAAC,UAAU,CAAC,EACxB,sDAAsD,CACvD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kDAAkD,uFAE9D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,6DAA6D,yIACoE,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,sDAAsD,EAAE,MAAM,cAAc,CAAA;AAErF,MAAM,WAAW,YAAY,CAAC,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS;IAEtF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB;;OAEG;IACH,IAAI,EAAE,UAAU,CAAA;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAC9D,QAAQ,EAAE,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;CACxC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gDAAgD,CAAC,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,IAAI,OAAO,CACpH,YAAY,CAAC,UAAU,CAAC,EACxB,sDAAsD,CACvD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kDAAkD,gFAE9D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,6DAA6D,2HACoE,CAAA"}
@@ -1,6 +1,5 @@
1
- import type { BoundWitness } from '@xyo-network/boundwitness-model';
2
1
  import type { HashLeaseEstimate } from '@xyo-network/diviner-hash-lease';
3
- import type { Payload, WithSources } from '@xyo-network/payload-model';
2
+ import type { BoundWitness, Payload, WithSources } from '@xyo-network/sdk-js';
4
3
  import type { DomainRegistrationLease } from '../../DomainRegistration/index.ts';
5
4
  export type Estimate = [
6
5
  BoundWitness,
@@ -1 +1 @@
1
- {"version":3,"file":"parseEstimatesFromArray.d.ts","sourceRoot":"","sources":["../../../../src/diviner/lib/parseEstimatesFromArray.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,KAAK,EACV,OAAO,EAAU,WAAW,EAC7B,MAAM,4BAA4B,CAAA;AAGnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAGhF,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,WAAW,CAAC,iBAAiB,CAAC;IAC9B,WAAW,CAAC,uBAAuB,CAAC;CACrC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAU,WAAW,OAAO,EAAE,KAAG,OAAO,CAAC,QAAQ,EAAE,CA0BtF,CAAA"}
1
+ {"version":3,"file":"parseEstimatesFromArray.d.ts","sourceRoot":"","sources":["../../../../src/diviner/lib/parseEstimatesFromArray.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EAAU,WAAW,EAC7B,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAGhF,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,WAAW,CAAC,iBAAiB,CAAC;IAC9B,WAAW,CAAC,uBAAuB,CAAC;CACrC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAU,WAAW,OAAO,EAAE,KAAG,OAAO,CAAC,QAAQ,EAAE,CA0BtF,CAAA"}
@@ -1,10 +1,10 @@
1
1
  // src/Address/Payload.ts
2
- import { asSchema, isPayloadOfSchemaType } from "@xyo-network/payload-model";
2
+ import { asSchema, isPayloadOfSchemaType } from "@xyo-network/sdk-js";
3
3
  var AddressRecordSchema = asSchema("network.xyo.ns.record.address", true);
4
4
  var isAddressRecord = isPayloadOfSchemaType(AddressRecordSchema);
5
5
 
6
6
  // src/diviner/DomainLeaseEstimateDiviner/Schema.ts
7
- import { asSchema as asSchema2 } from "@xyo-network/payload-model";
7
+ import { asSchema as asSchema2 } from "@xyo-network/sdk-js";
8
8
  var DomainLeaseEstimateDivinerValidationErrorDetailsSchema = asSchema2("network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details", true);
9
9
 
10
10
  // src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts
@@ -57,7 +57,7 @@ var DomainLeaseEstimateDivinerErrorDetailsDictionary = {
57
57
  };
58
58
 
59
59
  // src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts
60
- import { isPayloadOfSchemaType as isPayloadOfSchemaType2, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
60
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType2, isPayloadOfSchemaTypeWithSources } from "@xyo-network/sdk-js";
61
61
  var isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSchemaType2(
62
62
  DomainLeaseEstimateDivinerValidationErrorDetailsSchema
63
63
  );
@@ -65,9 +65,8 @@ var isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources = isPayloadOfS
65
65
 
66
66
  // src/diviner/lib/parseEstimatesFromArray.ts
67
67
  import { exists, findAs } from "@xylabs/sdk-js";
68
- import { isBoundWitness } from "@xyo-network/boundwitness-model";
69
68
  import { asHashLeaseEstimate, HashLeaseEstimateSchema } from "@xyo-network/diviner-hash-lease";
70
- import { PayloadBuilder } from "@xyo-network/sdk-js";
69
+ import { isBoundWitness, PayloadBuilder } from "@xyo-network/sdk-js";
71
70
 
72
71
  // src/DomainRegistration/DomainRegistration.ts
73
72
  import { AsObjectFactory as AsObjectFactory3 } from "@xylabs/sdk-js";
@@ -75,7 +74,7 @@ import {
75
74
  asSchema as asSchema5,
76
75
  isPayloadOfSchemaType as isPayloadOfSchemaType5,
77
76
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources4
78
- } from "@xyo-network/payload-model";
77
+ } from "@xyo-network/sdk-js";
79
78
 
80
79
  // src/Domain/Domain.ts
81
80
  import { AsObjectFactory } from "@xylabs/sdk-js";
@@ -83,7 +82,7 @@ import {
83
82
  asSchema as asSchema3,
84
83
  isPayloadOfSchemaType as isPayloadOfSchemaType3,
85
84
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources2
86
- } from "@xyo-network/payload-model";
85
+ } from "@xyo-network/sdk-js";
87
86
  var DomainSchema = asSchema3("network.xyo.ns.domain", true);
88
87
  var isDomain = isPayloadOfSchemaType3(DomainSchema);
89
88
  var asDomain = AsObjectFactory.create(isDomain);
@@ -98,7 +97,7 @@ import {
98
97
  asSchema as asSchema4,
99
98
  isPayloadOfSchemaType as isPayloadOfSchemaType4,
100
99
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources3
101
- } from "@xyo-network/payload-model";
100
+ } from "@xyo-network/sdk-js";
102
101
  var DomainLeaseSchema = asSchema4("network.xyo.ns.domain.lease", true);
103
102
  var isDomainLease = isPayloadOfSchemaType4(DomainLeaseSchema);
104
103
  var asDomainLease = AsObjectFactory2.create(isDomainLease);
@@ -122,7 +121,7 @@ import {
122
121
  asSchema as asSchema6,
123
122
  isPayloadOfSchemaType as isPayloadOfSchemaType6,
124
123
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources5
125
- } from "@xyo-network/payload-model";
124
+ } from "@xyo-network/sdk-js";
126
125
  var DomainRegistrationLeaseSchema = asSchema6(`${DomainRegistrationSchema}.lease`, true);
127
126
  var isDomainRegistrationLease = isPayloadOfSchemaType6(DomainRegistrationLeaseSchema);
128
127
  var asDomainRegistrationLease = AsObjectFactory4.create(isDomainRegistrationLease);
@@ -444,10 +443,10 @@ var getRandomId = () => {
444
443
  };
445
444
 
446
445
  // src/DNS/Witness/Config.ts
447
- import { asSchema as asSchema8 } from "@xyo-network/payload-model";
446
+ import { asSchema as asSchema8 } from "@xyo-network/sdk-js";
448
447
 
449
448
  // src/DNS/Witness/Schema.ts
450
- import { asSchema as asSchema7 } from "@xyo-network/payload-model";
449
+ import { asSchema as asSchema7 } from "@xyo-network/sdk-js";
451
450
  var DNSSchema = asSchema7("network.xyo.dns", true);
452
451
 
453
452
  // src/DNS/Witness/Config.ts
@@ -458,7 +457,7 @@ import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/sdk-js";
458
457
  import {
459
458
  isPayloadOfSchemaType as isPayloadOfSchemaType7,
460
459
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources6
461
- } from "@xyo-network/payload-model";
460
+ } from "@xyo-network/sdk-js";
462
461
  var isDNSRequest = isPayloadOfSchemaType7(DNSSchema);
463
462
  var asDNSRequest = AsObjectFactory5.create(isDNSRequest);
464
463
  var asOptionalDNSRequest = AsObjectFactory5.createOptional(isDNSRequest);
@@ -474,7 +473,7 @@ import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/sdk-js";
474
473
  import {
475
474
  isPayloadOfSchemaType as isPayloadOfSchemaType8,
476
475
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources7
477
- } from "@xyo-network/payload-model";
476
+ } from "@xyo-network/sdk-js";
478
477
  var isDNSResponse = isPayloadOfSchemaType8(DNSSchema);
479
478
  var asDNSResponse = AsObjectFactory6.create(isDNSResponse);
480
479
  var asOptionalDNSResponse = AsObjectFactory6.createOptional(isDNSResponse);
@@ -483,7 +482,7 @@ var asDNSResponseWithSources = AsObjectFactory6.create(isDNSResponseWithSources)
483
482
  var asOptionalDNSResponseWithSources = AsObjectFactory6.createOptional(isDNSResponseWithSources);
484
483
 
485
484
  // src/Duration/validation/validateBoundWitness.ts
486
- import { BoundWitnessValidator } from "@xyo-network/boundwitness-validator";
485
+ import { BoundWitnessValidator } from "@xyo-network/sdk-js";
487
486
  var validateBoundWitness = async (recordBw, requiredSchemas = []) => {
488
487
  if (!requiredSchemas.every((requiredSchema) => recordBw.payload_schemas.includes(requiredSchema))) return false;
489
488
  const validator = new BoundWitnessValidator(recordBw);
@@ -521,7 +520,7 @@ var validateBoundWitnessWithDuration = async (recordBw, recordPayload) => {
521
520
  };
522
521
 
523
522
  // src/Hash/Payload.ts
524
- import { asSchema as asSchema9, isPayloadOfSchemaType as isPayloadOfSchemaType9 } from "@xyo-network/payload-model";
523
+ import { asSchema as asSchema9, isPayloadOfSchemaType as isPayloadOfSchemaType9 } from "@xyo-network/sdk-js";
525
524
  var HashRecordSchema = asSchema9("network.xyo.ns.record.hash", true);
526
525
  var isHashRecord = isPayloadOfSchemaType9(HashRecordSchema);
527
526
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
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/Config.ts", "../../src/DNS/Witness/Schema.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"],
4
- "sourcesContent": ["import type { Address } from '@xylabs/sdk-js'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type AddressRecordSchema = typeof AddressRecordSchema\nexport const AddressRecordSchema = asSchema('network.xyo.ns.record.address', true)\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", "import { asSchema } from '@xyo-network/payload-model'\n\nexport const DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n = asSchema('network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details', true)\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, findAs } from '@xylabs/sdk-js'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { HashLeaseEstimate } from '@xyo-network/diviner-hash-lease'\nimport { asHashLeaseEstimate, HashLeaseEstimateSchema } from '@xyo-network/diviner-hash-lease'\nimport type {\n Payload, Schema, WithSources,\n} from '@xyo-network/payload-model'\nimport { PayloadBuilder } from '@xyo-network/sdk-js'\n\nimport type { DomainRegistrationLease } from '../../DomainRegistration/index.ts'\nimport { asDomainRegistrationLeaseWithSources, DomainRegistrationLeaseSchema } 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 asHashLeaseEstimate,\n )\n if (!hashLeaseEstimate) return\n const domainLease = getPayloadBySchemaFromBoundWitness<WithSources<DomainRegistrationLease>>(\n bw,\n DomainRegistrationLeaseSchema,\n hashMap,\n asDomainRegistrationLeaseWithSources,\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: Schema,\n hashMap: Awaited<ReturnType<typeof PayloadBuilder.toHashMap>>,\n identity: (payload: Payload) => 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 findAs([hashMap[hash]], identity)\n}\n", "import type { Address } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n asSchema, isPayloadOfSchemaType, 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 = asSchema(`${DomainSchema}.registration`, true)\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)\nexport const asDomainRegistration = AsObjectFactory.create<DomainRegistration>(isDomainRegistration)\nexport const asOptionalDomainRegistration = AsObjectFactory.createOptional<DomainRegistration>(isDomainRegistration)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistration>>(DomainRegistrationSchema)\nexport const asDomainRegistrationWithSources = AsObjectFactory.create<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\nexport const asOptionalDomainRegistrationWithSources = AsObjectFactory.createOptional<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n asSchema, isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport type DomainSchema = typeof DomainSchema\nexport const DomainSchema = asSchema('network.xyo.ns.domain', true)\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)\nexport const asDomain = AsObjectFactory.create<Domain>(isDomain)\nexport const asOptionalDomain = AsObjectFactory.createOptional<Domain>(isDomain)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<WithSources<Domain>>(DomainSchema)\nexport const asDomainWithSources = AsObjectFactory.create<WithSources<Domain>>(isDomainWithSources)\nexport const asOptionalDomainWithSources = AsObjectFactory.createOptional<WithSources<Domain>>(isDomainWithSources)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n asSchema, isPayloadOfSchemaType, 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 = typeof DomainLeaseSchema\nexport const DomainLeaseSchema = asSchema('network.xyo.ns.domain.lease', true)\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)\nexport const asDomainLease = AsObjectFactory.create<DomainLease>(isDomainLease)\nexport const asOptionalDomainLease = AsObjectFactory.createOptional<DomainLease>(isDomainLease)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainLease>>(DomainLeaseSchema)\nexport const asDomainLeaseWithSources = AsObjectFactory.create<WithSources<DomainLease>>(isDomainLeaseWithSources)\nexport const asOptionalDomainLeaseWithSources = AsObjectFactory.createOptional<WithSources<DomainLease>>(isDomainLeaseWithSources)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n asSchema, isPayloadOfSchemaType, 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 = asSchema(`${DomainRegistrationSchema}.lease`, true)\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)\nexport const asDomainRegistrationLease = AsObjectFactory.create<DomainRegistrationLease>(isDomainRegistrationLease)\nexport const asOptionalDomainRegistrationLease = AsObjectFactory.createOptional<DomainRegistrationLease>(isDomainRegistrationLease)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistrationLease>>(DomainRegistrationLeaseSchema)\nexport const asDomainRegistrationLeaseWithSources = AsObjectFactory.create<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\nexport const asOptionalDomainRegistrationLeaseWithSources = AsObjectFactory\n .createOptional<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\n\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 } from './OperationCodes.ts'\nimport { DNSQueryOpcodes } from './OperationCodes.ts'\nimport type { DNSRcode } from './ResponseCodes.ts'\nimport { DNSRcodes } from './ResponseCodes.ts'\n\n// 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 // 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 // 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 } from './Header.ts'\nimport { 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", "import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport { asSchema } from '@xyo-network/payload-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 = typeof DNSWitnessConfigSchema\nexport const DNSWitnessConfigSchema = asSchema(`${DNSSchema}.witness.config`, true)\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 { asSchema } from '@xyo-network/payload-model'\n\nexport type DNSSchema = typeof DNSSchema\nexport const DNSSchema = asSchema('network.xyo.dns', true)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } 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 = Payload<DNSRequestFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSRequest payload\n */\nexport const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)\nexport const asDNSRequest = AsObjectFactory.create<DNSRequest>(isDNSRequest)\nexport const asOptionalDNSRequest = AsObjectFactory.createOptional<DNSRequest>(isDNSRequest)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with sources\n */\nexport const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DNSRequest>>(DNSSchema)\nexport const asDNSRequestWithSources = AsObjectFactory.create<WithSources<DNSRequest>>(isDNSRequestWithSources)\nexport const asOptionalDNSRequestWithSources = AsObjectFactory.createOptional<WithSources<DNSRequest>>(isDNSRequestWithSources)\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 { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { PayloadWithSources, WithSources } 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)\nexport const asDNSResponse = AsObjectFactory.create<DNSResponse>(isDNSResponse)\nexport const asOptionalDNSResponse = AsObjectFactory.createOptional<DNSResponse>(isDNSResponse)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with sources\n */\nexport const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)\nexport const asDNSResponseWithSources = AsObjectFactory.create<WithSources<DNSResponse>>(isDNSResponseWithSources)\nexport const asOptionalDNSResponseWithSources = AsObjectFactory.createOptional<WithSources<DNSResponse>>(isDNSResponseWithSources)\n", "import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\nimport type { Schema } from '@xyo-network/payload-model'\n\n// BW Validations\nexport const validateBoundWitness = async (recordBw: BoundWitness, requiredSchemas: Schema[] = []): 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 type { Payload } from '@xyo-network/payload-model'\nimport { PayloadBuilder } from '@xyo-network/sdk-js'\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 return (recordIsTemporallyValidToBoundWitness(recordBw, recordPayload))\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\n// TODO: Use sequence for this?\nconst recordIsTemporallyValidToBoundWitness = (_recordBw: BoundWitness, _recordPayload: Payload<DurationFields>): boolean => {\n /* const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp */\n return true\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 return isWithinDelegatedTimeframe(recordPayload)\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 return (await validateBoundWitnessAndDuration(recordBw, recordPayload))\n}\n", "import type { Hash } from '@xylabs/sdk-js'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type HashRecordSchema = typeof HashRecordSchema\nexport const HashRecordSchema = asSchema('network.xyo.ns.record.hash', true)\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"],
5
- "mappings": ";AAEA,SAAS,UAAU,6BAA6B;AAKzC,IAAM,sBAAsB,SAAS,iCAAiC,IAAI;AAc1E,IAAM,kBAAkB,sBAAqC,mBAAmB;;;ACrBvF,SAAS,YAAAA,iBAAgB;AAElB,IAAM,yDACTA,UAAS,s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AAyB,mBAAqD;AAI3H,SAAO;AACT;;;AClBO,IAAM,mBAAmB,CAAC,kBAAoD;AAEnF,SAAO,2BAA2B,aAAa;AACjD;AAEO,IAAM,6BAA6B,CAAC,eAAwC,MAAM,KAAK,IAAI,MAAe;AAE/G,SAAO,cAAc,MAAM,OAAO,MAAM,cAAc;AACxD;;;ACLO,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,SAAQ,MAAM,gCAAgC,UAAU,aAAa;AACvE;;;ACbA,SAAS,YAAAC,WAAU,yBAAAC,8BAA6B;AAKzC,IAAM,mBAAmBD,UAAS,8BAA8B,IAAI;AAcpE,IAAM,eAAeC,uBAAkC,gBAAgB;",
4
+ "sourcesContent": ["import type { Address } from '@xylabs/sdk-js'\nimport type { Payload } from '@xyo-network/sdk-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type AddressRecordSchema = typeof AddressRecordSchema\nexport const AddressRecordSchema = asSchema('network.xyo.ns.record.address', true)\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", "import { asSchema } from '@xyo-network/sdk-js'\n\nexport const DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n = asSchema('network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details', true)\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/sdk-js'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/sdk-js'\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, findAs } from '@xylabs/sdk-js'\nimport type { HashLeaseEstimate } from '@xyo-network/diviner-hash-lease'\nimport { asHashLeaseEstimate, HashLeaseEstimateSchema } from '@xyo-network/diviner-hash-lease'\nimport type {\n BoundWitness,\n Payload, Schema, WithSources,\n} from '@xyo-network/sdk-js'\nimport { isBoundWitness, PayloadBuilder } from '@xyo-network/sdk-js'\n\nimport type { DomainRegistrationLease } from '../../DomainRegistration/index.ts'\nimport { asDomainRegistrationLeaseWithSources, DomainRegistrationLeaseSchema } 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 asHashLeaseEstimate,\n )\n if (!hashLeaseEstimate) return\n const domainLease = getPayloadBySchemaFromBoundWitness<WithSources<DomainRegistrationLease>>(\n bw,\n DomainRegistrationLeaseSchema,\n hashMap,\n asDomainRegistrationLeaseWithSources,\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: Schema,\n hashMap: Awaited<ReturnType<typeof PayloadBuilder.toHashMap>>,\n identity: (payload: Payload) => 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 findAs([hashMap[hash]], identity)\n}\n", "import type { Address } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/sdk-js'\nimport {\n asSchema, isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/sdk-js'\n\nimport type { DomainFields } from '../Domain/index.ts'\nimport { DomainSchema } from '../Domain/index.ts'\n\nexport const DomainRegistrationSchema = asSchema(`${DomainSchema}.registration`, true)\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)\nexport const asDomainRegistration = AsObjectFactory.create<DomainRegistration>(isDomainRegistration)\nexport const asOptionalDomainRegistration = AsObjectFactory.createOptional<DomainRegistration>(isDomainRegistration)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistration>>(DomainRegistrationSchema)\nexport const asDomainRegistrationWithSources = AsObjectFactory.create<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\nexport const asOptionalDomainRegistrationWithSources = AsObjectFactory.createOptional<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/sdk-js'\nimport {\n asSchema, isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/sdk-js'\n\nexport type DomainSchema = typeof DomainSchema\nexport const DomainSchema = asSchema('network.xyo.ns.domain', true)\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)\nexport const asDomain = AsObjectFactory.create<Domain>(isDomain)\nexport const asOptionalDomain = AsObjectFactory.createOptional<Domain>(isDomain)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<WithSources<Domain>>(DomainSchema)\nexport const asDomainWithSources = AsObjectFactory.create<WithSources<Domain>>(isDomainWithSources)\nexport const asOptionalDomainWithSources = AsObjectFactory.createOptional<WithSources<Domain>>(isDomainWithSources)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/sdk-js'\nimport {\n asSchema, isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/sdk-js'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainFields } from './Domain.ts'\n\nexport type DomainLeaseSchema = typeof DomainLeaseSchema\nexport const DomainLeaseSchema = asSchema('network.xyo.ns.domain.lease', true)\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)\nexport const asDomainLease = AsObjectFactory.create<DomainLease>(isDomainLease)\nexport const asOptionalDomainLease = AsObjectFactory.createOptional<DomainLease>(isDomainLease)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainLease>>(DomainLeaseSchema)\nexport const asDomainLeaseWithSources = AsObjectFactory.create<WithSources<DomainLease>>(isDomainLeaseWithSources)\nexport const asOptionalDomainLeaseWithSources = AsObjectFactory.createOptional<WithSources<DomainLease>>(isDomainLeaseWithSources)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/sdk-js'\nimport {\n asSchema, isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/sdk-js'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainRegistrationFields } from './DomainRegistration.ts'\nimport { DomainRegistrationSchema } from './DomainRegistration.ts'\n\nexport const DomainRegistrationLeaseSchema = asSchema(`${DomainRegistrationSchema}.lease`, true)\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)\nexport const asDomainRegistrationLease = AsObjectFactory.create<DomainRegistrationLease>(isDomainRegistrationLease)\nexport const asOptionalDomainRegistrationLease = AsObjectFactory.createOptional<DomainRegistrationLease>(isDomainRegistrationLease)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistrationLease>>(DomainRegistrationLeaseSchema)\nexport const asDomainRegistrationLeaseWithSources = AsObjectFactory.create<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\nexport const asOptionalDomainRegistrationLeaseWithSources = AsObjectFactory\n .createOptional<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\n\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 } from './OperationCodes.ts'\nimport { DNSQueryOpcodes } from './OperationCodes.ts'\nimport type { DNSRcode } from './ResponseCodes.ts'\nimport { DNSRcodes } from './ResponseCodes.ts'\n\n// 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 // 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 // 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 } from './Header.ts'\nimport { 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", "import type { ModuleIdentifier, WitnessConfig } from '@xyo-network/sdk-js'\nimport { asSchema } from '@xyo-network/sdk-js'\n\nimport type { DNSResourceRecordType } from '../types/index.ts'\nimport { DNSSchema } from './Schema.ts'\n\nexport type DNSWitnessConfigSchema = typeof DNSWitnessConfigSchema\nexport const DNSWitnessConfigSchema = asSchema(`${DNSSchema}.witness.config`, true)\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 { asSchema } from '@xyo-network/sdk-js'\n\nexport type DNSSchema = typeof DNSSchema\nexport const DNSSchema = asSchema('network.xyo.dns', true)\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload, WithSources } from '@xyo-network/sdk-js'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/sdk-js'\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 = Payload<DNSRequestFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSRequest payload\n */\nexport const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)\nexport const asDNSRequest = AsObjectFactory.create<DNSRequest>(isDNSRequest)\nexport const asOptionalDNSRequest = AsObjectFactory.createOptional<DNSRequest>(isDNSRequest)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with sources\n */\nexport const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DNSRequest>>(DNSSchema)\nexport const asDNSRequestWithSources = AsObjectFactory.create<WithSources<DNSRequest>>(isDNSRequestWithSources)\nexport const asOptionalDNSRequestWithSources = AsObjectFactory.createOptional<WithSources<DNSRequest>>(isDNSRequestWithSources)\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 { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { PayloadWithSources, WithSources } from '@xyo-network/sdk-js'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/sdk-js'\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)\nexport const asDNSResponse = AsObjectFactory.create<DNSResponse>(isDNSResponse)\nexport const asOptionalDNSResponse = AsObjectFactory.createOptional<DNSResponse>(isDNSResponse)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with sources\n */\nexport const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)\nexport const asDNSResponseWithSources = AsObjectFactory.create<WithSources<DNSResponse>>(isDNSResponseWithSources)\nexport const asOptionalDNSResponseWithSources = AsObjectFactory.createOptional<WithSources<DNSResponse>>(isDNSResponseWithSources)\n", "import type { BoundWitness, Schema } from '@xyo-network/sdk-js'\nimport { BoundWitnessValidator } from '@xyo-network/sdk-js'\n\n// BW Validations\nexport const validateBoundWitness = async (recordBw: BoundWitness, requiredSchemas: Schema[] = []): 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, Payload } from '@xyo-network/sdk-js'\nimport { PayloadBuilder } from '@xyo-network/sdk-js'\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 return (recordIsTemporallyValidToBoundWitness(recordBw, recordPayload))\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\n// TODO: Use sequence for this?\nconst recordIsTemporallyValidToBoundWitness = (_recordBw: BoundWitness, _recordPayload: Payload<DurationFields>): boolean => {\n /* const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp */\n return true\n}\n", "import type { Payload } from '@xyo-network/sdk-js'\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 return isWithinDelegatedTimeframe(recordPayload)\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, Payload } from '@xyo-network/sdk-js'\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 return (await validateBoundWitnessAndDuration(recordBw, recordPayload))\n}\n", "import type { Hash } from '@xylabs/sdk-js'\nimport type { Payload } from '@xyo-network/sdk-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type HashRecordSchema = typeof HashRecordSchema\nexport const HashRecordSchema = asSchema('network.xyo.ns.record.hash', true)\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"],
5
+ "mappings": ";AAEA,SAAS,UAAU,6BAA6B;AAKzC,IAAM,sBAAsB,SAAS,iCAAiC,IAAI;AAc1E,IAAM,kBAAkB,sBAAqC,mBAAmB;;;ACrBvF,SAAS,YAAAA,iBAAgB;AAElB,IAAM,yDACTA,UAAS,sFAAsF,IAAI;;;ACGhG,IAAM,mDAGT;AAAA,EACF,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,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AAa;AACjD;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,SAAQ,MAAM,gCAAgC,UAAU,aAAa;AACvE;;;ACZA,SAAS,YAAAC,WAAU,yBAAAC,8BAA6B;AAKzC,IAAM,mBAAmBD,UAAS,8BAA8B,IAAI;AAcpE,IAAM,eAAeC,uBAAkC,gBAAgB;",
6
6
  "names": ["asSchema", "isPayloadOfSchemaType", "isPayloadOfSchemaType", "AsObjectFactory", "asSchema", "isPayloadOfSchemaType", "isPayloadOfSchemaTypeWithSources", "asSchema", "isPayloadOfSchemaType", "isPayloadOfSchemaTypeWithSources", "AsObjectFactory", "asSchema", "isPayloadOfSchemaType", "isPayloadOfSchemaTypeWithSources", "asSchema", "isPayloadOfSchemaType", "AsObjectFactory", "isPayloadOfSchemaTypeWithSources", "AsObjectFactory", "asSchema", "isPayloadOfSchemaType", "isPayloadOfSchemaTypeWithSources", "asSchema", "isPayloadOfSchemaType", "AsObjectFactory", "isPayloadOfSchemaTypeWithSources", "asSchema", "asSchema", "asSchema", "AsObjectFactory", "isPayloadOfSchemaType", "isPayloadOfSchemaTypeWithSources", "isPayloadOfSchemaType", "AsObjectFactory", "isPayloadOfSchemaTypeWithSources", "AsObjectFactory", "isPayloadOfSchemaType", "isPayloadOfSchemaTypeWithSources", "isPayloadOfSchemaType", "AsObjectFactory", "isPayloadOfSchemaTypeWithSources", "PayloadBuilder", "asSchema", "isPayloadOfSchemaType"]
7
7
  }