@xyo-network/xns-record-payload-plugins 3.1.1 → 3.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/Address/Payload.d.ts +7 -4
- package/dist/browser/Address/Payload.d.ts.map +1 -1
- package/dist/browser/DNS/Witness/Config.d.ts +12 -0
- package/dist/browser/DNS/Witness/Config.d.ts.map +1 -1
- package/dist/browser/DNS/Witness/Payload/Request.d.ts +15 -1
- package/dist/browser/DNS/Witness/Payload/Request.d.ts.map +1 -1
- package/dist/browser/DNS/Witness/Payload/Response.d.ts +9 -1
- package/dist/browser/DNS/Witness/Payload/Response.d.ts.map +1 -1
- package/dist/browser/DNS/types/Header.d.ts +33 -0
- package/dist/browser/DNS/types/Header.d.ts.map +1 -1
- package/dist/browser/DNS/types/Request.d.ts +10 -0
- package/dist/browser/DNS/types/Request.d.ts.map +1 -1
- package/dist/browser/Domain/Domain.d.ts +21 -3
- package/dist/browser/Domain/Domain.d.ts.map +1 -1
- package/dist/browser/Domain/DomainLease.d.ts +12 -3
- package/dist/browser/Domain/DomainLease.d.ts.map +1 -1
- package/dist/browser/DomainEstimate/DomainEstimate.d.ts +4 -4
- package/dist/browser/DomainEstimate/DomainEstimate.d.ts.map +1 -1
- package/dist/browser/DomainRegistration/DomainRegistration.d.ts +15 -3
- package/dist/browser/DomainRegistration/DomainRegistration.d.ts.map +1 -1
- package/dist/browser/DomainRegistration/DomainRegistrationLease.d.ts +12 -6
- package/dist/browser/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
- package/dist/browser/Duration/Duration.d.ts +6 -0
- package/dist/browser/Duration/Duration.d.ts.map +1 -1
- package/dist/browser/Hash/Payload.d.ts +7 -4
- package/dist/browser/Hash/Payload.d.ts.map +1 -1
- package/dist/browser/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +18 -3
- package/dist/browser/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
- package/dist/browser/diviner/DomainLeaseEstimateDiviner/Schema.d.ts.map +1 -1
- package/dist/browser/diviner/lib/parseEstimatesFromArray.d.ts +9 -4
- package/dist/browser/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
- package/dist/browser/index.mjs +8 -50
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/Address/Payload.d.ts +7 -4
- package/dist/neutral/Address/Payload.d.ts.map +1 -1
- package/dist/neutral/DNS/Witness/Config.d.ts +12 -0
- package/dist/neutral/DNS/Witness/Config.d.ts.map +1 -1
- package/dist/neutral/DNS/Witness/Payload/Request.d.ts +15 -1
- package/dist/neutral/DNS/Witness/Payload/Request.d.ts.map +1 -1
- package/dist/neutral/DNS/Witness/Payload/Response.d.ts +9 -1
- package/dist/neutral/DNS/Witness/Payload/Response.d.ts.map +1 -1
- package/dist/neutral/DNS/types/Header.d.ts +33 -0
- package/dist/neutral/DNS/types/Header.d.ts.map +1 -1
- package/dist/neutral/DNS/types/Request.d.ts +10 -0
- package/dist/neutral/DNS/types/Request.d.ts.map +1 -1
- package/dist/neutral/Domain/Domain.d.ts +21 -3
- package/dist/neutral/Domain/Domain.d.ts.map +1 -1
- package/dist/neutral/Domain/DomainLease.d.ts +12 -3
- package/dist/neutral/Domain/DomainLease.d.ts.map +1 -1
- package/dist/neutral/DomainEstimate/DomainEstimate.d.ts +4 -4
- package/dist/neutral/DomainEstimate/DomainEstimate.d.ts.map +1 -1
- package/dist/neutral/DomainRegistration/DomainRegistration.d.ts +15 -3
- package/dist/neutral/DomainRegistration/DomainRegistration.d.ts.map +1 -1
- package/dist/neutral/DomainRegistration/DomainRegistrationLease.d.ts +12 -6
- package/dist/neutral/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
- package/dist/neutral/Duration/Duration.d.ts +6 -0
- package/dist/neutral/Duration/Duration.d.ts.map +1 -1
- package/dist/neutral/Hash/Payload.d.ts +7 -4
- package/dist/neutral/Hash/Payload.d.ts.map +1 -1
- package/dist/neutral/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +18 -3
- package/dist/neutral/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
- package/dist/neutral/diviner/DomainLeaseEstimateDiviner/Schema.d.ts.map +1 -1
- package/dist/neutral/diviner/lib/parseEstimatesFromArray.d.ts +9 -4
- package/dist/neutral/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
- package/dist/neutral/index.mjs +8 -50
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/Address/Payload.d.ts +7 -4
- package/dist/node/Address/Payload.d.ts.map +1 -1
- package/dist/node/DNS/Witness/Config.d.ts +12 -0
- package/dist/node/DNS/Witness/Config.d.ts.map +1 -1
- package/dist/node/DNS/Witness/Payload/Request.d.ts +15 -1
- package/dist/node/DNS/Witness/Payload/Request.d.ts.map +1 -1
- package/dist/node/DNS/Witness/Payload/Response.d.ts +9 -1
- package/dist/node/DNS/Witness/Payload/Response.d.ts.map +1 -1
- package/dist/node/DNS/types/Header.d.ts +33 -0
- package/dist/node/DNS/types/Header.d.ts.map +1 -1
- package/dist/node/DNS/types/Request.d.ts +10 -0
- package/dist/node/DNS/types/Request.d.ts.map +1 -1
- package/dist/node/Domain/Domain.d.ts +21 -3
- package/dist/node/Domain/Domain.d.ts.map +1 -1
- package/dist/node/Domain/DomainLease.d.ts +12 -3
- package/dist/node/Domain/DomainLease.d.ts.map +1 -1
- package/dist/node/DomainEstimate/DomainEstimate.d.ts +4 -4
- package/dist/node/DomainEstimate/DomainEstimate.d.ts.map +1 -1
- package/dist/node/DomainRegistration/DomainRegistration.d.ts +15 -3
- package/dist/node/DomainRegistration/DomainRegistration.d.ts.map +1 -1
- package/dist/node/DomainRegistration/DomainRegistrationLease.d.ts +12 -6
- package/dist/node/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
- package/dist/node/Duration/Duration.d.ts +6 -0
- package/dist/node/Duration/Duration.d.ts.map +1 -1
- package/dist/node/Hash/Payload.d.ts +7 -4
- package/dist/node/Hash/Payload.d.ts.map +1 -1
- package/dist/node/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts +18 -3
- package/dist/node/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.d.ts.map +1 -1
- package/dist/node/diviner/DomainLeaseEstimateDiviner/Schema.d.ts.map +1 -1
- package/dist/node/diviner/lib/parseEstimatesFromArray.d.ts +9 -4
- package/dist/node/diviner/lib/parseEstimatesFromArray.d.ts.map +1 -1
- package/dist/node/index.mjs +8 -50
- package/dist/node/index.mjs.map +1 -1
- package/package.json +19 -16
- package/src/Address/Payload.ts +1 -2
- package/src/DNS/Witness/Payload/Request.ts +0 -6
- package/src/DNS/Witness/Payload/Response.ts +0 -6
- package/src/Domain/Domain.ts +1 -8
- package/src/Domain/DomainLease.ts +1 -8
- package/src/DomainEstimate/DomainEstimate.ts +4 -4
- package/src/DomainRegistration/DomainRegistration.ts +1 -8
- package/src/DomainRegistration/DomainRegistrationLease.ts +1 -12
- package/src/Hash/Payload.ts +1 -2
- package/src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts +1 -9
- package/src/diviner/lib/parseEstimatesFromArray.ts +10 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xns-record-payload-plugins",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-rc.1",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -29,24 +29,27 @@
|
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/exists": "^4.
|
|
33
|
-
"@xylabs/hex": "^4.
|
|
34
|
-
"@xyo-network/boundwitness-model": "^3.
|
|
35
|
-
"@xyo-network/boundwitness-validator": "^3.
|
|
36
|
-
"@xyo-network/diviner-hash-lease": "^3.
|
|
37
|
-
"@xyo-network/module-model": "^3.
|
|
38
|
-
"@xyo-network/payload-builder": "^3.
|
|
39
|
-
"@xyo-network/payload-model": "^3.
|
|
40
|
-
"@xyo-network/witness-model": "^3.
|
|
32
|
+
"@xylabs/exists": "^4.4.12",
|
|
33
|
+
"@xylabs/hex": "^4.4.12",
|
|
34
|
+
"@xyo-network/boundwitness-model": "^3.6.0-rc.1",
|
|
35
|
+
"@xyo-network/boundwitness-validator": "^3.6.0-rc.1",
|
|
36
|
+
"@xyo-network/diviner-hash-lease": "^3.6.0-rc.1",
|
|
37
|
+
"@xyo-network/module-model": "^3.6.0-rc.1",
|
|
38
|
+
"@xyo-network/payload-builder": "^3.6.0-rc.1",
|
|
39
|
+
"@xyo-network/payload-model": "^3.6.0-rc.1",
|
|
40
|
+
"@xyo-network/witness-model": "^3.6.0-rc.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@xylabs/ts-scripts-yarn3": "^4.
|
|
44
|
-
"@xylabs/tsconfig": "^4.
|
|
45
|
-
"@
|
|
46
|
-
"@xyo-network/
|
|
47
|
-
"
|
|
43
|
+
"@xylabs/ts-scripts-yarn3": "^4.2.4",
|
|
44
|
+
"@xylabs/tsconfig": "^4.2.4",
|
|
45
|
+
"@xylabs/vitest-matchers": "^4.4.12",
|
|
46
|
+
"@xyo-network/account": "^3.6.0-rc.1",
|
|
47
|
+
"@xyo-network/boundwitness-builder": "^3.6.0-rc.1",
|
|
48
|
+
"typescript": "^5.7.2",
|
|
49
|
+
"vitest": "^2.1.8"
|
|
48
50
|
},
|
|
49
51
|
"publishConfig": {
|
|
50
52
|
"access": "public"
|
|
51
|
-
}
|
|
53
|
+
},
|
|
54
|
+
"stableVersion": "3.1.2"
|
|
52
55
|
}
|
package/src/Address/Payload.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Payload
|
|
2
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import type { DomainFields } from '../Domain/index.ts'
|
|
@@ -20,4 +20,3 @@ export interface AddressRecordFields extends DomainFields {
|
|
|
20
20
|
export type AddressRecord = Payload<AddressRecordFields, AddressRecordSchema>
|
|
21
21
|
|
|
22
22
|
export const isAddressRecord = isPayloadOfSchemaType<AddressRecord>(AddressRecordSchema)
|
|
23
|
-
export const isAddressRecordWithMeta = isPayloadOfSchemaType<WithMeta<AddressRecord>>(AddressRecordSchema)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PayloadWithSources } from '@xyo-network/payload-model'
|
|
2
2
|
import {
|
|
3
3
|
isPayloadOfSchemaType,
|
|
4
|
-
isPayloadOfSchemaTypeWithMeta,
|
|
5
4
|
isPayloadOfSchemaTypeWithSources,
|
|
6
5
|
} from '@xyo-network/payload-model'
|
|
7
6
|
|
|
@@ -24,11 +23,6 @@ export const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)
|
|
|
24
23
|
*/
|
|
25
24
|
export const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<DNSRequest>(DNSSchema)
|
|
26
25
|
|
|
27
|
-
/**
|
|
28
|
-
* Identity function for determining if an object is a DNSRequest payload with meta
|
|
29
|
-
*/
|
|
30
|
-
export const isDNSRequestWithMeta = isPayloadOfSchemaTypeWithMeta<DNSRequest>(DNSSchema)
|
|
31
|
-
|
|
32
26
|
/**
|
|
33
27
|
* Helper for generating a DNSRequest payload for a given domain and record type
|
|
34
28
|
* @param domain The domain to query
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PayloadWithSources } from '@xyo-network/payload-model'
|
|
2
2
|
import {
|
|
3
3
|
isPayloadOfSchemaType,
|
|
4
|
-
isPayloadOfSchemaTypeWithMeta,
|
|
5
4
|
isPayloadOfSchemaTypeWithSources,
|
|
6
5
|
} from '@xyo-network/payload-model'
|
|
7
6
|
|
|
@@ -22,8 +21,3 @@ export const isDNSResponse = isPayloadOfSchemaType<DNSResponse>(DNSSchema)
|
|
|
22
21
|
* Identity function for determining if an object is a DNSResponse payload with sources
|
|
23
22
|
*/
|
|
24
23
|
export const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Identity function for determining if an object is a DNSResponse payload with meta
|
|
28
|
-
*/
|
|
29
|
-
export const isDNSResponseWithMeta = isPayloadOfSchemaTypeWithMeta<DNSResponse>(DNSSchema)
|
package/src/Domain/Domain.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import {
|
|
3
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
4
|
-
} from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
export type DomainSchema = 'network.xyo.ns.domain'
|
|
7
5
|
export const DomainSchema: DomainSchema = 'network.xyo.ns.domain'
|
|
@@ -40,8 +38,3 @@ export const isDomain = isPayloadOfSchemaType<Domain>(DomainSchema)
|
|
|
40
38
|
* Identity function for Domain payload with sources
|
|
41
39
|
*/
|
|
42
40
|
export const isDomainWithSources = isPayloadOfSchemaTypeWithSources<Domain>(DomainSchema)
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Identity function for Domain payload with meta
|
|
46
|
-
*/
|
|
47
|
-
export const isDomainWithMeta = isPayloadOfSchemaTypeWithMeta<Domain>(DomainSchema)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import {
|
|
3
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
4
|
-
} from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
import type { DurationFields } from '../Duration/index.ts'
|
|
7
5
|
import type { DomainFields } from './Domain.ts'
|
|
@@ -28,8 +26,3 @@ export const isDomainLease = isPayloadOfSchemaType<DomainLease>(DomainLeaseSchem
|
|
|
28
26
|
* Identity function for DomainLease payload with sources
|
|
29
27
|
*/
|
|
30
28
|
export const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainLease>(DomainLeaseSchema)
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Identity function for DomainLease payload with meta
|
|
34
|
-
*/
|
|
35
|
-
export const isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainLease>(DomainLeaseSchema)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
2
2
|
import type { HashLeaseEstimate } from '@xyo-network/diviner-hash-lease'
|
|
3
|
-
import type {
|
|
3
|
+
import type { WithSources } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import type { DomainRegistrationLease } from '../DomainRegistration/index.ts'
|
|
6
6
|
|
|
7
7
|
export type DomainEstimate = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
BoundWitness,
|
|
9
|
+
WithSources<HashLeaseEstimate>,
|
|
10
|
+
WithSources<DomainRegistrationLease>,
|
|
11
11
|
]
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex'
|
|
2
2
|
import type { Payload } from '@xyo-network/payload-model'
|
|
3
|
-
import {
|
|
4
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
5
|
-
} from '@xyo-network/payload-model'
|
|
3
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
6
4
|
|
|
7
5
|
import type { DomainFields } from '../Domain/index.ts'
|
|
8
6
|
import { DomainSchema } from '../Domain/index.ts'
|
|
@@ -35,8 +33,3 @@ export const isDomainRegistration = isPayloadOfSchemaType<DomainRegistration>(Do
|
|
|
35
33
|
* Identity function for DomainRegistration payload with sources
|
|
36
34
|
*/
|
|
37
35
|
export const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistration>(DomainRegistrationSchema)
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Identity function for DomainRegistration payload with meta
|
|
41
|
-
*/
|
|
42
|
-
export const isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistration>(DomainRegistrationSchema)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import {
|
|
3
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
4
|
-
} from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
import type { DurationFields } from '../Duration/index.ts'
|
|
7
5
|
import type { DomainRegistrationFields } from './DomainRegistration.ts'
|
|
@@ -30,12 +28,3 @@ export const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSou
|
|
|
30
28
|
* @deprecated Use isDomainRegistrationLeaseWithSources instead
|
|
31
29
|
*/
|
|
32
30
|
export const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Identity function for DomainRegistrationLease payload with meta
|
|
36
|
-
*/
|
|
37
|
-
export const isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistrationLease>(DomainRegistrationLeaseSchema)
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Use isDomainRegistrationLeaseWithMeta instead
|
|
40
|
-
*/
|
|
41
|
-
export const isDomainRegistrationLeaseMeta = isDomainRegistrationLeaseWithMeta
|
package/src/Hash/Payload.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import type { Payload
|
|
2
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import type { DomainFields } from '../Domain/index.ts'
|
|
@@ -20,4 +20,3 @@ export interface HashRecordFields extends DomainFields {
|
|
|
20
20
|
export type HashRecord = Payload<HashRecordFields, HashRecordSchema>
|
|
21
21
|
|
|
22
22
|
export const isHashRecord = isPayloadOfSchemaType<HashRecord>(HashRecordSchema)
|
|
23
|
-
export const isHashRecordWithMeta = isPayloadOfSchemaType<WithMeta<HashRecord>>(HashRecordSchema)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import {
|
|
3
|
-
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,
|
|
4
|
-
} from '@xyo-network/payload-model'
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
import { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'
|
|
7
5
|
|
|
@@ -46,9 +44,3 @@ export const isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSch
|
|
|
46
44
|
*/
|
|
47
45
|
export const isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources
|
|
48
46
|
= isPayloadOfSchemaTypeWithSources<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with meta
|
|
52
|
-
*/
|
|
53
|
-
export const isDomainLeaseEstimateDivinerValidationErrorDetailsWithMeta
|
|
54
|
-
= isPayloadOfSchemaTypeWithMeta<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { exists } from '@xylabs/exists'
|
|
2
2
|
import { type BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'
|
|
3
3
|
import {
|
|
4
|
-
type HashLeaseEstimate, HashLeaseEstimateSchema,
|
|
5
|
-
isHashLeaseEstimateWithMeta,
|
|
4
|
+
type HashLeaseEstimate, HashLeaseEstimateSchema, isHashLeaseEstimate,
|
|
6
5
|
} from '@xyo-network/diviner-hash-lease'
|
|
7
6
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
8
|
-
import type {
|
|
9
|
-
Payload, WithMeta, WithOptionalMeta, WithSources,
|
|
10
|
-
} from '@xyo-network/payload-model'
|
|
7
|
+
import type { Payload, WithSources } from '@xyo-network/payload-model'
|
|
11
8
|
|
|
12
9
|
import {
|
|
13
|
-
type DomainRegistrationLease, DomainRegistrationLeaseSchema,
|
|
10
|
+
type DomainRegistrationLease, DomainRegistrationLeaseSchema, isDomainRegistrationLease,
|
|
14
11
|
} from '../../DomainRegistration/index.ts'
|
|
15
12
|
|
|
16
13
|
export type Estimate = [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
BoundWitness,
|
|
15
|
+
WithSources<HashLeaseEstimate>,
|
|
16
|
+
WithSources<DomainRegistrationLease>,
|
|
20
17
|
]
|
|
21
18
|
|
|
22
19
|
/**
|
|
@@ -38,14 +35,14 @@ export const parseEstimatesFromArray = async (payloads?: Payload[]): Promise<Est
|
|
|
38
35
|
bw,
|
|
39
36
|
HashLeaseEstimateSchema,
|
|
40
37
|
hashMap,
|
|
41
|
-
|
|
38
|
+
isHashLeaseEstimate,
|
|
42
39
|
)
|
|
43
40
|
if (!hashLeaseEstimate) return
|
|
44
41
|
const domainLease = getPayloadBySchemaFromBoundWitness<DomainRegistrationLease>(
|
|
45
42
|
bw,
|
|
46
43
|
DomainRegistrationLeaseSchema,
|
|
47
44
|
hashMap,
|
|
48
|
-
|
|
45
|
+
isDomainRegistrationLease,
|
|
49
46
|
)
|
|
50
47
|
if (!domainLease) return
|
|
51
48
|
return [bw, hashLeaseEstimate, domainLease]
|
|
@@ -74,8 +71,8 @@ const getPayloadBySchemaFromBoundWitness = <T extends Payload = Payload>(
|
|
|
74
71
|
bw: BoundWitness,
|
|
75
72
|
schema: string,
|
|
76
73
|
hashMap: Awaited<ReturnType<typeof PayloadBuilder.toHashMap>>,
|
|
77
|
-
identity: (payload: Payload) => payload is
|
|
78
|
-
):
|
|
74
|
+
identity: (payload: Payload) => payload is T,
|
|
75
|
+
): T | undefined => {
|
|
79
76
|
const schemaIndex = bw.payload_schemas.indexOf(schema)
|
|
80
77
|
if (schemaIndex === -1) return
|
|
81
78
|
const hash = bw.payload_hashes[schemaIndex]
|