@xyo-network/xl1-protocol 1.12.101 → 1.12.103
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/neutral/block/AllowedBlockPayload.d.ts +1 -1
- package/dist/neutral/block/AllowedBlockPayload.d.ts.map +1 -1
- package/dist/neutral/block/BlockBoundWitness.d.ts +5 -5
- package/dist/neutral/block/BlockBoundWitness.d.ts.map +1 -1
- package/dist/neutral/index.mjs +30 -30
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/interfaces/viewers/AccountBalance.d.ts +1 -1
- package/dist/neutral/interfaces/viewers/AccountBalance.d.ts.map +1 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepViewer.d.ts +4 -2
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepViewer.d.ts.map +1 -1
- package/dist/neutral/model/StepIdentity.d.ts.map +1 -1
- package/dist/neutral/services/Election.d.ts +2 -2
- package/dist/neutral/services/Election.d.ts.map +1 -1
- package/dist/neutral/transaction/TransactionBoundWitnessDeprecated.d.ts +4 -4
- package/dist/neutral/transaction/TransactionBoundWitnessDeprecated.d.ts.map +1 -1
- package/dist/neutral/transaction/UnsignedHydratedTransactionWithHashMeta.d.ts +7 -0
- package/dist/neutral/transaction/UnsignedHydratedTransactionWithHashMeta.d.ts.map +1 -0
- package/dist/neutral/transaction/index.d.ts +1 -1
- package/dist/neutral/transaction/index.d.ts.map +1 -1
- package/dist/neutral/validation/boundwitness/HydratedBoundWitnessValidationFunction.d.ts +3 -3
- package/dist/neutral/validation/boundwitness/HydratedBoundWitnessValidationFunction.d.ts.map +1 -1
- package/dist/neutral/validation/payload/InBlockPayloadValidationFunction.d.ts +2 -2
- package/dist/neutral/validation/payload/InBlockPayloadValidationFunction.d.ts.map +1 -1
- package/package.json +24 -24
- package/src/block/AllowedBlockPayload.ts +3 -3
- package/src/block/BlockBoundWitness.ts +8 -8
- package/src/interfaces/viewers/AccountBalance.ts +1 -1
- package/src/interfaces/viewers/NetworkStakeViewer/StepViewer.ts +5 -2
- package/src/model/StepIdentity.ts +1 -0
- package/src/services/Election.ts +2 -2
- package/src/transaction/TransactionBoundWitnessDeprecated.ts +7 -7
- package/src/transaction/UnsignedHydratedTransactionWithHashMeta.ts +24 -0
- package/src/transaction/index.ts +1 -1
- package/src/validation/boundwitness/BoundWitnessValidationFunction.ts +1 -1
- package/src/validation/boundwitness/HydratedBoundWitnessValidationFunction.ts +4 -4
- package/src/validation/payload/InBlockPayloadValidationFunction.ts +2 -2
- package/src/validation/transaction/HydratedTransactionValidationFunction.ts +1 -1
- package/dist/neutral/transaction/UnsignedHydratedTransactionWithHashStorageMeta.d.ts +0 -7
- package/dist/neutral/transaction/UnsignedHydratedTransactionWithHashStorageMeta.d.ts.map +0 -1
- package/src/transaction/UnsignedHydratedTransactionWithHashStorageMeta.ts +0 -24
package/dist/neutral/validation/boundwitness/HydratedBoundWitnessValidationFunction.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HydratedBoundWitnessValidationFunction.d.ts","sourceRoot":"","sources":["../../../../src/validation/boundwitness/HydratedBoundWitnessValidationFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"HydratedBoundWitnessValidationFunction.d.ts","sourceRoot":"","sources":["../../../../src/validation/boundwitness/HydratedBoundWitnessValidationFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAA;AAErE,MAAM,MAAM,gCAAgC,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,CAAC,SAAS,OAAO,GAAG,OAAO,IAC3G,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,MAAM,sCAAsC,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,CAC1F,EAAE,EAAE,gCAAgC,CAAC,CAAC,CAAC,KACpC,UAAU,CAAC,mCAAmC,EAAE,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise';
|
|
2
|
-
import type { Payload,
|
|
2
|
+
import type { Payload, WithHashMeta } from '@xyo-network/payload-model';
|
|
3
3
|
import type { HydratedBlock } from '../../block/index.ts';
|
|
4
4
|
import type { InBlockPayloadValidationError } from './error.ts';
|
|
5
|
-
export type InBlockPayloadValidationFunction = (payload:
|
|
5
|
+
export type InBlockPayloadValidationFunction = (payload: WithHashMeta<Payload>, block: HydratedBlock) => Promisable<InBlockPayloadValidationError[]>;
|
|
6
6
|
//# sourceMappingURL=InBlockPayloadValidationFunction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InBlockPayloadValidationFunction.d.ts","sourceRoot":"","sources":["../../../../src/validation/payload/InBlockPayloadValidationFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InBlockPayloadValidationFunction.d.ts","sourceRoot":"","sources":["../../../../src/validation/payload/InBlockPayloadValidationFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAE/D,MAAM,MAAM,gCAAgC,GAAG,CAC7C,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,aAAa,KACjD,UAAU,CAAC,6BAA6B,EAAE,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-protocol",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.103",
|
|
5
5
|
"description": "XYO Layer One Protocol",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -37,37 +37,37 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@opentelemetry/api": "~1.9.0",
|
|
40
|
-
"@xylabs/assert": "~5.0.
|
|
41
|
-
"@xylabs/base": "~5.0.
|
|
42
|
-
"@xylabs/events": "~5.0.
|
|
43
|
-
"@xylabs/hex": "~5.0.
|
|
44
|
-
"@xylabs/logger": "~5.0.
|
|
45
|
-
"@xylabs/object": "~5.0.
|
|
46
|
-
"@xylabs/promise": "~5.0.
|
|
47
|
-
"@xylabs/typeof": "~5.0.
|
|
48
|
-
"@xyo-network/archivist-model": "~5.1.
|
|
49
|
-
"@xyo-network/boundwitness-model": "~5.1.
|
|
50
|
-
"@xyo-network/payload-model": "~5.1.
|
|
51
|
-
"@xyo-network/schema-payload-plugin": "~5.1.
|
|
40
|
+
"@xylabs/assert": "~5.0.18",
|
|
41
|
+
"@xylabs/base": "~5.0.18",
|
|
42
|
+
"@xylabs/events": "~5.0.18",
|
|
43
|
+
"@xylabs/hex": "~5.0.18",
|
|
44
|
+
"@xylabs/logger": "~5.0.18",
|
|
45
|
+
"@xylabs/object": "~5.0.18",
|
|
46
|
+
"@xylabs/promise": "~5.0.18",
|
|
47
|
+
"@xylabs/typeof": "~5.0.18",
|
|
48
|
+
"@xyo-network/archivist-model": "~5.1.17",
|
|
49
|
+
"@xyo-network/boundwitness-model": "~5.1.17",
|
|
50
|
+
"@xyo-network/payload-model": "~5.1.17",
|
|
51
|
+
"@xyo-network/schema-payload-plugin": "~5.1.17",
|
|
52
52
|
"zod": "~4.1.12"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "~24.
|
|
56
|
-
"@typescript-eslint/types": "~8.46.
|
|
57
|
-
"@xylabs/creatable": "~5.0.
|
|
58
|
-
"@xylabs/eslint-config-flat": "~7.
|
|
59
|
-
"@xylabs/ts-scripts-yarn3": "~7.
|
|
60
|
-
"@xylabs/tsconfig": "~7.
|
|
61
|
-
"@xyo-network/account-model": "~5.1.
|
|
55
|
+
"@types/node": "~24.10.0",
|
|
56
|
+
"@typescript-eslint/types": "~8.46.3",
|
|
57
|
+
"@xylabs/creatable": "~5.0.18",
|
|
58
|
+
"@xylabs/eslint-config-flat": "~7.2.4",
|
|
59
|
+
"@xylabs/ts-scripts-yarn3": "~7.2.4",
|
|
60
|
+
"@xylabs/tsconfig": "~7.2.4",
|
|
61
|
+
"@xyo-network/account-model": "~5.1.17",
|
|
62
62
|
"dependency-cruiser": "~17.2.0",
|
|
63
63
|
"dotenv": "~17.2.3",
|
|
64
|
-
"eslint": "~9.39.
|
|
64
|
+
"eslint": "~9.39.1",
|
|
65
65
|
"eslint-import-resolver-typescript": "~4.4.4",
|
|
66
|
-
"knip": "~5.
|
|
66
|
+
"knip": "~5.68.0",
|
|
67
67
|
"typescript": "~5.9.3",
|
|
68
|
-
"vite": "~7.1
|
|
68
|
+
"vite": "~7.2.1",
|
|
69
69
|
"vite-tsconfig-paths": "~5.1.4",
|
|
70
|
-
"vitest": "~
|
|
70
|
+
"vitest": "~4.0.7"
|
|
71
71
|
},
|
|
72
72
|
"packageManager": "yarn@4.10.3",
|
|
73
73
|
"engines": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
|
|
2
2
|
import type { Schema, WithStorageMeta } from '@xyo-network/payload-model'
|
|
3
|
-
import {
|
|
3
|
+
import { isHashMeta, isSchema } from '@xyo-network/payload-model'
|
|
4
4
|
import type { SchemaPayload } from '@xyo-network/schema-payload-plugin'
|
|
5
5
|
import { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'
|
|
6
6
|
import z from 'zod'
|
|
@@ -58,8 +58,8 @@ export const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayl
|
|
|
58
58
|
|| isTransactionBoundWitness(value)
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export const
|
|
62
|
-
return isAllowedBlockPayload(value) &&
|
|
61
|
+
export const isAllowedBlockPayloadWithHashMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {
|
|
62
|
+
return isAllowedBlockPayload(value) && isHashMeta(value)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export const AllowedBlockPayloadZod = z.object({ schema: z.enum(AllowedBlockPayloadSchemas) })
|
|
@@ -3,8 +3,8 @@ import { isHex } from '@xylabs/hex'
|
|
|
3
3
|
import { AsObjectFactory } from '@xylabs/object'
|
|
4
4
|
import type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'
|
|
5
5
|
import { isBoundWitness, isSigned } from '@xyo-network/boundwitness-model'
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
6
|
+
import type { WithHashMeta, WithStorageMeta } from '@xyo-network/payload-model'
|
|
7
|
+
import { isHashMeta, isStorageMeta } from '@xyo-network/payload-model'
|
|
8
8
|
|
|
9
9
|
import type { ChainId, XL1BlockNumber } from '../model/index.ts'
|
|
10
10
|
|
|
@@ -46,12 +46,12 @@ export const isSignedBlockBoundWitnessWithStorageMeta = (value: unknown): value
|
|
|
46
46
|
return isBlockBoundWitnessWithStorageMeta(value) && isSigned(value)
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export const
|
|
50
|
-
return isBlockBoundWitness(value) &&
|
|
49
|
+
export const isBlockBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<BlockBoundWitness> => {
|
|
50
|
+
return isBlockBoundWitness(value) && isHashMeta(value)
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
export const
|
|
54
|
-
return
|
|
53
|
+
export const isSignedBlockBoundWitnessWithHashMeta = (value: unknown): value is Signed<WithHashMeta<BlockBoundWitness>> => {
|
|
54
|
+
return isBlockBoundWitnessWithHashMeta(value) && isSigned(value)
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)
|
|
@@ -60,5 +60,5 @@ export const asSignedBlockBoundWitness = AsObjectFactory.create(isSignedBlockBou
|
|
|
60
60
|
export const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)
|
|
61
61
|
export const asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithStorageMeta)
|
|
62
62
|
|
|
63
|
-
export const
|
|
64
|
-
export const
|
|
63
|
+
export const asBlockBoundWitnessWithHashMeta = AsObjectFactory.create(isBlockBoundWitnessWithHashMeta)
|
|
64
|
+
export const asSignedBlockBoundWitnessWithHashMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithHashMeta)
|
|
@@ -4,7 +4,7 @@ import type { Promisable } from '@xylabs/promise'
|
|
|
4
4
|
import type { Transfer } from '../../payload/index.ts'
|
|
5
5
|
import type { AttoXL1 } from '../../xl1/index.ts'
|
|
6
6
|
|
|
7
|
-
export type AccountBalanceHistoryItem = [Hash /* block */,
|
|
7
|
+
export type AccountBalanceHistoryItem = [Hash /* block */, Transfer /* the actual transfer payload */]
|
|
8
8
|
|
|
9
9
|
export interface AccountBalancesViewInterface {
|
|
10
10
|
accountBalances(address: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>
|
|
@@ -14,6 +14,11 @@ export interface PagedStakersOptions {
|
|
|
14
14
|
limit?: number
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export interface StepStatistics {
|
|
18
|
+
endTime: number
|
|
19
|
+
startTime: number
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
export interface StepViewerMethods {
|
|
18
23
|
|
|
19
24
|
// the total number of positions for a given step
|
|
@@ -35,5 +40,3 @@ export interface StepViewerMethods {
|
|
|
35
40
|
// total weight of all stakers during a given step
|
|
36
41
|
weight(step: StepIdentity): Promisable<bigint>
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
export interface StepViewer extends StepViewerMethods {}
|
package/src/services/Election.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type {
|
|
2
|
+
import type { WithHashMeta } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
4
|
import type { BlockBoundWitness } from '../block/index.ts'
|
|
5
5
|
import type { ServiceInterface } from './Service.ts'
|
|
@@ -10,6 +10,6 @@ export interface ElectionService extends ServiceInterface {
|
|
|
10
10
|
* Given the current block, get the leader for the next block
|
|
11
11
|
* @param current The previous block
|
|
12
12
|
*/
|
|
13
|
-
getCreatorCommitteeForNextBlock(current:
|
|
13
|
+
getCreatorCommitteeForNextBlock(current: WithHashMeta<BlockBoundWitness>): Promise<Address[]>
|
|
14
14
|
|
|
15
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AsObjectFactory } from '@xylabs/object'
|
|
2
2
|
import type { Signed } from '@xyo-network/boundwitness-model'
|
|
3
3
|
import { isSigned } from '@xyo-network/boundwitness-model'
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
4
|
+
import type { WithHashMeta, WithStorageMeta } from '@xyo-network/payload-model'
|
|
5
|
+
import { isHashMeta, isStorageMeta } from '@xyo-network/payload-model'
|
|
6
6
|
|
|
7
7
|
import { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'
|
|
8
8
|
|
|
@@ -14,20 +14,20 @@ export const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value
|
|
|
14
14
|
isTransactionBoundWitness(value)
|
|
15
15
|
&& isStorageMeta(value)
|
|
16
16
|
|
|
17
|
-
export const
|
|
17
|
+
export const isTransactionBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<TransactionBoundWitness> =>
|
|
18
18
|
isTransactionBoundWitness(value)
|
|
19
|
-
&&
|
|
19
|
+
&& isHashMeta(value)
|
|
20
20
|
|
|
21
21
|
export const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>
|
|
22
22
|
|
|
23
23
|
isSignedTransactionBoundWitness(value)
|
|
24
24
|
&& isStorageMeta(value)
|
|
25
25
|
|
|
26
|
-
export const
|
|
26
|
+
export const isSignedTransactionBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<Signed<TransactionBoundWitness>> =>
|
|
27
27
|
|
|
28
28
|
isSignedTransactionBoundWitness(value)
|
|
29
|
-
&&
|
|
29
|
+
&& isHashMeta(value)
|
|
30
30
|
|
|
31
31
|
export const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)
|
|
32
32
|
|
|
33
|
-
export const
|
|
33
|
+
export const asTransactionBoundWitnessWithHashMeta = AsObjectFactory.create(isTransactionBoundWitnessWithHashMeta)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
+
import type { Unsigned } from '@xyo-network/boundwitness-model'
|
|
3
|
+
import {
|
|
4
|
+
isHashMeta,
|
|
5
|
+
type Payload, type WithHashMeta,
|
|
6
|
+
} from '@xyo-network/payload-model'
|
|
7
|
+
|
|
8
|
+
import { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'
|
|
9
|
+
import { type TransactionBoundWitness } from './TransactionBoundWitness.ts'
|
|
10
|
+
|
|
11
|
+
export type UnsignedHydratedTransactionWithHashMeta<T extends TransactionBoundWitness = TransactionBoundWitness,
|
|
12
|
+
P extends Payload = Payload> = [WithHashMeta<Unsigned<T>>, WithHashMeta<P>[]]
|
|
13
|
+
|
|
14
|
+
export const isUnsignedHydratedTransactionWithHashMeta = (
|
|
15
|
+
value: unknown,
|
|
16
|
+
): value is UnsignedHydratedTransactionWithHashMeta => {
|
|
17
|
+
return (
|
|
18
|
+
isSignedHydratedTransaction(value) && isHashMeta(value[0]) && !value[1].some(v => !isHashMeta(v))
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const asUnsignedHydratedTransactionWithHashMeta = AsObjectFactory.create<UnsignedHydratedTransactionWithHashMeta>(
|
|
23
|
+
isUnsignedHydratedTransactionWithHashMeta,
|
|
24
|
+
)
|
package/src/transaction/index.ts
CHANGED
|
@@ -7,4 +7,4 @@ export * from './TransactionBoundWitness.ts'
|
|
|
7
7
|
export * from './TransactionBoundWitnessDeprecated.ts'
|
|
8
8
|
export * from './TransactionFeesFields.ts'
|
|
9
9
|
export * from './UnsignedHydratedTransaction.ts'
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './UnsignedHydratedTransactionWithHashMeta.ts'
|
|
@@ -4,5 +4,5 @@ import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
|
4
4
|
import type { BoundWitnessValidationError } from './error.ts'
|
|
5
5
|
|
|
6
6
|
export type BoundWitnessValidationFunction<T extends BoundWitness = BoundWitness> = (
|
|
7
|
-
bw: T
|
|
7
|
+
bw: T,
|
|
8
8
|
) => Promisable<BoundWitnessValidationError[]>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
2
|
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
3
|
-
import type { Payload,
|
|
3
|
+
import type { Payload, WithHashMeta } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import type { HydratedBoundWitnessValidationError } from './error.ts'
|
|
6
6
|
|
|
7
|
-
export type
|
|
8
|
-
= [
|
|
7
|
+
export type HydratedBoundWitnessWithHashMeta<T extends BoundWitness = BoundWitness, P extends Payload = Payload>
|
|
8
|
+
= [WithHashMeta<T>, WithHashMeta<P>[]]
|
|
9
9
|
|
|
10
10
|
export type HydratedBoundWitnessValidationFunction<T extends BoundWitness = BoundWitness> = (
|
|
11
|
-
bw:
|
|
11
|
+
bw: HydratedBoundWitnessWithHashMeta<T>,
|
|
12
12
|
) => Promisable<HydratedBoundWitnessValidationError[]>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
import type { Payload,
|
|
2
|
+
import type { Payload, WithHashMeta } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
4
|
import type { HydratedBlock } from '../../block/index.ts'
|
|
5
5
|
import type { InBlockPayloadValidationError } from './error.ts'
|
|
6
6
|
|
|
7
7
|
export type InBlockPayloadValidationFunction = (
|
|
8
|
-
payload:
|
|
8
|
+
payload: WithHashMeta<Payload>, block: HydratedBlock,
|
|
9
9
|
) => Promisable<InBlockPayloadValidationError[]>
|
|
@@ -11,5 +11,5 @@ import type { HydratedTransactionValidationError } from './error.ts'
|
|
|
11
11
|
*/
|
|
12
12
|
export type HydratedTransactionValidationFunction<T extends TransactionBoundWitness = TransactionBoundWitness, TContext extends {} = {}> = (
|
|
13
13
|
hydratedTransaction: HydratedTransactionWithStorageMeta<T>,
|
|
14
|
-
context?: TContext
|
|
14
|
+
context?: TContext,
|
|
15
15
|
) => Promisable<HydratedTransactionValidationError[]>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Unsigned } from '@xyo-network/boundwitness-model';
|
|
2
|
-
import { type Payload, type WithHashStorageMeta } from '@xyo-network/payload-model';
|
|
3
|
-
import { type TransactionBoundWitness } from './TransactionBoundWitness.ts';
|
|
4
|
-
export type UnsignedHydratedTransactionWithHashStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness, P extends Payload = Payload> = [WithHashStorageMeta<Unsigned<T>>, WithHashStorageMeta<P>[]];
|
|
5
|
-
export declare const isUnsignedHydratedTransactionWithHashStorageMeta: (value: unknown) => value is UnsignedHydratedTransactionWithHashStorageMeta;
|
|
6
|
-
export declare const asUnsignedHydratedTransactionWithHashStorageMeta: import("@xylabs/object").AsTypeFunction<UnsignedHydratedTransactionWithHashStorageMeta<TransactionBoundWitness, Payload>>;
|
|
7
|
-
//# sourceMappingURL=UnsignedHydratedTransactionWithHashStorageMeta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnsignedHydratedTransactionWithHashStorageMeta.d.ts","sourceRoot":"","sources":["../../../src/transaction/UnsignedHydratedTransactionWithHashStorageMeta.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAEL,KAAK,OAAO,EAAE,KAAK,mBAAmB,EACvC,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAE3E,MAAM,MAAM,8CAA8C,CAAC,CAAC,SAAS,uBAAuB,GAAG,uBAAuB,EACpH,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAE7F,eAAO,MAAM,gDAAgD,GAC3D,OAAO,OAAO,KACb,KAAK,IAAI,8CAIX,CAAA;AAED,eAAO,MAAM,gDAAgD,2HAE5D,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
-
import type { Unsigned } from '@xyo-network/boundwitness-model'
|
|
3
|
-
import {
|
|
4
|
-
isHashStorageMeta,
|
|
5
|
-
type Payload, type WithHashStorageMeta,
|
|
6
|
-
} from '@xyo-network/payload-model'
|
|
7
|
-
|
|
8
|
-
import { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'
|
|
9
|
-
import { type TransactionBoundWitness } from './TransactionBoundWitness.ts'
|
|
10
|
-
|
|
11
|
-
export type UnsignedHydratedTransactionWithHashStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,
|
|
12
|
-
P extends Payload = Payload> = [WithHashStorageMeta<Unsigned<T>>, WithHashStorageMeta<P>[]]
|
|
13
|
-
|
|
14
|
-
export const isUnsignedHydratedTransactionWithHashStorageMeta = (
|
|
15
|
-
value: unknown,
|
|
16
|
-
): value is UnsignedHydratedTransactionWithHashStorageMeta => {
|
|
17
|
-
return (
|
|
18
|
-
isSignedHydratedTransaction(value) && isHashStorageMeta(value[0]) && !value[1].some(v => !isHashStorageMeta(v))
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const asUnsignedHydratedTransactionWithHashStorageMeta = AsObjectFactory.create<UnsignedHydratedTransactionWithHashStorageMeta>(
|
|
23
|
-
isUnsignedHydratedTransactionWithHashStorageMeta,
|
|
24
|
-
)
|