@xyo-network/xl1-protocol 1.6.0 → 1.6.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 (42) hide show
  1. package/dist/neutral/index.mjs +14 -10
  2. package/dist/neutral/index.mjs.map +1 -1
  3. package/dist/types/index.d.ts +0 -1
  4. package/dist/types/index.d.ts.map +1 -1
  5. package/dist/types/payload/elevatable/ChainStakeIntent.d.ts +2 -1
  6. package/dist/types/payload/elevatable/ChainStakeIntent.d.ts.map +1 -1
  7. package/dist/types/provider/v1/XyoProvider.d.ts +1 -1
  8. package/dist/types/provider/v1/XyoProvider.d.ts.map +1 -1
  9. package/dist/types/services/ChainIterator/ChainIteratorService.d.ts +41 -0
  10. package/dist/types/services/ChainIterator/ChainIteratorService.d.ts.map +1 -0
  11. package/dist/types/services/ChainIterator/ChainIteratorServiceEventData.d.ts +14 -0
  12. package/dist/types/services/ChainIterator/ChainIteratorServiceEventData.d.ts.map +1 -0
  13. package/dist/types/services/ChainIterator/index.d.ts +3 -0
  14. package/dist/types/services/ChainIterator/index.d.ts.map +1 -0
  15. package/dist/types/services/ChainServiceCollection.d.ts +2 -2
  16. package/dist/types/services/ChainServiceCollection.d.ts.map +1 -1
  17. package/dist/types/services/ChainServiceCollectionV2.d.ts +2 -2
  18. package/dist/types/services/ChainServiceCollectionV2.d.ts.map +1 -1
  19. package/dist/types/services/Service.d.ts +2 -1
  20. package/dist/types/services/Service.d.ts.map +1 -1
  21. package/dist/types/services/index.d.ts +1 -0
  22. package/dist/types/services/index.d.ts.map +1 -1
  23. package/package.json +21 -20
  24. package/src/index.ts +0 -1
  25. package/src/payload/elevatable/ChainStakeIntent.ts +6 -2
  26. package/src/provider/v1/XyoProvider.ts +3 -1
  27. package/src/services/ChainIterator/ChainIteratorService.ts +43 -0
  28. package/src/services/ChainIterator/ChainIteratorServiceEventData.ts +14 -0
  29. package/src/services/ChainIterator/index.ts +2 -0
  30. package/src/services/ChainServiceCollection.ts +2 -2
  31. package/src/services/ChainServiceCollectionV2.ts +2 -2
  32. package/src/services/Service.ts +1 -3
  33. package/src/services/index.ts +1 -0
  34. package/dist/types/iterator/ChainIterator.d.ts +0 -23
  35. package/dist/types/iterator/ChainIterator.d.ts.map +0 -1
  36. package/dist/types/iterator/ChainIteratorEventData.d.ts +0 -11
  37. package/dist/types/iterator/ChainIteratorEventData.d.ts.map +0 -1
  38. package/dist/types/iterator/index.d.ts +0 -3
  39. package/dist/types/iterator/index.d.ts.map +0 -1
  40. package/src/iterator/ChainIterator.ts +0 -23
  41. package/src/iterator/ChainIteratorEventData.ts +0 -11
  42. package/src/iterator/index.ts +0 -2
@@ -5,12 +5,15 @@ import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugi
5
5
 
6
6
  // src/payload/elevatable/ChainStakeIntent.ts
7
7
  import { AsObjectFactory } from "@xylabs/object";
8
- import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
8
+ import { isPayloadOfSchemaType, isStorageMeta } from "@xyo-network/payload-model";
9
9
  var ChainStakeIntentSchema = "network.xyo.chain.stake.intent";
10
10
  var isChainStakeIntent = (x) => {
11
11
  return isPayloadOfSchemaType(ChainStakeIntentSchema)(x) && asNonNegativeInteger(x.nbf) !== void 0 && asNonNegativeInteger(x.exp) !== void 0;
12
12
  };
13
13
  var asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent);
14
+ var isChainStakeIntentWithStorageMeta = (x) => {
15
+ return isChainStakeIntent(x) && isStorageMeta(x);
16
+ };
14
17
  var asNonNegativeInteger = (num) => {
15
18
  return Number.isInteger(num) && num >= 0 ? num : void 0;
16
19
  };
@@ -47,15 +50,15 @@ import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
47
50
 
48
51
  // src/isHydratedBoundWitness.ts
49
52
  import { isBoundWitnessWithStorageMeta } from "@xyo-network/boundwitness-model";
50
- import { isAnyPayload as isAnyPayload2, isStorageMeta } from "@xyo-network/payload-model";
53
+ import { isAnyPayload as isAnyPayload2, isStorageMeta as isStorageMeta2 } from "@xyo-network/payload-model";
51
54
  var isHydratedBoundWitness = (value) => {
52
- return Array.isArray(value) && value.length === 2 && isBoundWitnessWithStorageMeta(value[0]) && Array.isArray(value[1]) && !value[1].some((item) => !isAnyPayload2(item) || !isStorageMeta(item));
55
+ return Array.isArray(value) && value.length === 2 && isBoundWitnessWithStorageMeta(value[0]) && Array.isArray(value[1]) && !value[1].some((item) => !isAnyPayload2(item) || !isStorageMeta2(item));
53
56
  };
54
57
 
55
58
  // src/transaction/TransactionBoundWitness.ts
56
59
  import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
57
60
  import { isBoundWitness } from "@xyo-network/boundwitness-model";
58
- import { isHashStorageMeta, isStorageMeta as isStorageMeta2 } from "@xyo-network/payload-model";
61
+ import { isHashStorageMeta, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
59
62
  var isTransactionBoundWitness = (value) => {
60
63
  const typedObj = value;
61
64
  return isBoundWitness(value) && typedObj.chain !== void 0 && typedObj.fees !== void 0 && typedObj.exp !== void 0 && typedObj.nbf !== void 0;
@@ -64,9 +67,9 @@ var isSignedTransactionBoundWitness = (value) => {
64
67
  return isTransactionBoundWitness(value) && isSigned(value);
65
68
  };
66
69
  var isSigned = (value) => isBoundWitness(value) && value.$signatures.length === value.addresses.length && value.addresses.length > 0;
67
- var isTransactionBoundWitnessWithStorageMeta = (value) => isTransactionBoundWitness(value) && isStorageMeta2(value);
70
+ var isTransactionBoundWitnessWithStorageMeta = (value) => isTransactionBoundWitness(value) && isStorageMeta3(value);
68
71
  var isTransactionBoundWitnessWithHashStorageMeta = (value) => isTransactionBoundWitness(value) && isHashStorageMeta(value);
69
- var isSignedTransactionBoundWitnessWithStorageMeta = (value) => isSignedTransactionBoundWitness(value) && isStorageMeta2(value);
72
+ var isSignedTransactionBoundWitnessWithStorageMeta = (value) => isSignedTransactionBoundWitness(value) && isStorageMeta3(value);
70
73
  var isSignedTransactionBoundWitnessWithHashStorageMeta = (value) => isSignedTransactionBoundWitness(value) && isHashStorageMeta(value);
71
74
  var asTransactionBoundWitness = AsObjectFactory4.create(isTransactionBoundWitness);
72
75
  var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.create(isTransactionBoundWitnessWithStorageMeta);
@@ -96,7 +99,7 @@ var isAllowedBlockPayloadWithHashStorageMeta = (value) => {
96
99
  import { isHex } from "@xylabs/hex";
97
100
  import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
98
101
  import { isBoundWitness as isBoundWitness2, isSigned as isSigned2 } from "@xyo-network/boundwitness-model";
99
- import { isHashStorageMeta as isHashStorageMeta3, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
102
+ import { isHashStorageMeta as isHashStorageMeta3, isStorageMeta as isStorageMeta4 } from "@xyo-network/payload-model";
100
103
  var isBlockBoundWitness = (value) => {
101
104
  const typedObj = value;
102
105
  return isBoundWitness2(value) && Number.isInteger(typedObj.block) && isHex(typedObj.chain);
@@ -105,7 +108,7 @@ var isSignedBlockBoundWitness = (value) => {
105
108
  return isBlockBoundWitness(value) && isSigned2(value);
106
109
  };
107
110
  var isBlockBoundWitnessWithStorageMeta = (value) => {
108
- return isBlockBoundWitness(value) && isStorageMeta3(value);
111
+ return isBlockBoundWitness(value) && isStorageMeta4(value);
109
112
  };
110
113
  var isSignedBlockBoundWitnessWithStorageMeta = (value) => {
111
114
  return isBlockBoundWitnessWithStorageMeta(value) && isSigned2(value);
@@ -245,13 +248,13 @@ var isNetworkStatus = isPayloadOfSchemaType5(NetworkStatusSchema);
245
248
 
246
249
  // src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts
247
250
  import { AsObjectFactory as AsObjectFactory9 } from "@xylabs/object";
248
- import { isPayloadOfSchemaType as isPayloadOfSchemaType6, isStorageMeta as isStorageMeta4 } from "@xyo-network/payload-model";
251
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType6, isStorageMeta as isStorageMeta5 } from "@xyo-network/payload-model";
249
252
  var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
250
253
  var isChainIndexingServiceState = (payload) => {
251
254
  return isPayloadOfSchemaType6(ChainIndexingServiceStateSchema)(payload);
252
255
  };
253
256
  var asChainIndexingServiceState = AsObjectFactory9.create(isChainIndexingServiceState);
254
- var isChainIndexingServiceStateWithStorageMeta = (value) => isChainIndexingServiceState(value) && isStorageMeta4(value);
257
+ var isChainIndexingServiceStateWithStorageMeta = (value) => isChainIndexingServiceState(value) && isStorageMeta5(value);
255
258
  var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory9.create(isChainIndexingServiceStateWithStorageMeta);
256
259
 
257
260
  // src/validation/error.ts
@@ -400,6 +403,7 @@ export {
400
403
  isChainIndexingServiceState,
401
404
  isChainIndexingServiceStateWithStorageMeta,
402
405
  isChainStakeIntent,
406
+ isChainStakeIntentWithStorageMeta,
403
407
  isExecutable,
404
408
  isHashPayload,
405
409
  isHydratedBlock,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/HydratedTransaction.ts","../../src/isHydratedBoundWitness.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/block/HydratedBlock.ts","../../src/xl1/XL1.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/constants/version.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts","../../src/validation/error.ts","../../src/validation/block/error.ts","../../src/validation/boundwitness/error.ts","../../src/validation/payload/error.ts","../../src/validation/transaction/error.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '../payload/index.ts'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Partial<Record<Address, Hex>>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isSignedTransactionBoundWitnessWithStorageMeta, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedTransaction = (\n value: unknown,\n): value is HydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isSignedTransactionBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedTransaction = AsObjectFactory.create<HydratedTransaction>(\n isHydratedTransaction,\n)\n","import type { HydratedBoundWitnessWithStorageMeta } from '@xyo-network/archivist-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport { isAnyPayload, isStorageMeta } from '@xyo-network/payload-model'\n\nexport const isHydratedBoundWitness = (\n value: unknown,\n): value is HydratedBoundWitnessWithStorageMeta => {\n return (\n Array.isArray(value)\n && value.length === 2\n && isBoundWitnessWithStorageMeta(value[0])\n && Array.isArray(value[1])\n && !value[1].some(item => (!isAnyPayload(item) || !isStorageMeta(item)))\n )\n}\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\n\nexport const asTransactionBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithHashStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness, isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isSignedBlockBoundWitness = (value: unknown): value is Signed<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithStorageMeta = (value: unknown): value is Signed<WithStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithStorageMeta(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isHashStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is Signed<WithHashStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithHashStorageMeta(value) && isSigned(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asSignedBlockBoundWitness = AsObjectFactory.create(isSignedBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithStorageMeta)\n\nexport const asBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithHashStorageMeta)\nexport const asSignedBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithHashStorageMeta)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { type Payload, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport {\n type BlockBoundWitness,\n isBlockBoundWitnessWithStorageMeta,\n} from './BlockBoundWitness.ts'\n\nexport type HydratedBlock<T extends BlockBoundWitness = BlockBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedBlock = (\n value: unknown,\n): value is HydratedBlock => {\n return (\n isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedBlock = AsObjectFactory.create<HydratedBlock>(\n isHydratedBlock,\n)\n","export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\nexport type TypingFunc<T extends bigint> = (value: bigint) => T\n\nexport const XL1: TypingFunc<XL1> = (value: bigint): XL1 => value as XL1\nexport const MilliXL1: TypingFunc<MilliXL1> = (value: bigint): MilliXL1 => value as MilliXL1\nexport const MicroXL1: TypingFunc<MicroXL1> = (value: bigint): MicroXL1 => value as MicroXL1\nexport const NanoXL1: TypingFunc<NanoXL1> = (value: bigint): NanoXL1 => value as NanoXL1\nexport const PicoXL1: TypingFunc<PicoXL1> = (value: bigint): PicoXL1 => value as PicoXL1\nexport const FemtoXL1: TypingFunc<FemtoXL1> = (value: bigint): FemtoXL1 => value as FemtoXL1\nexport const AttoXL1: TypingFunc<AttoXL1> = (value: bigint): AttoXL1 => value as AttoXL1\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.nano),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.nano),\n} as const\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\nimport { minTransactionFees } from './minTransactionFees.ts'\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: minTransactionFees.priority,\n} as const\n","import { AsTypeFactory } from '@xylabs/object'\n\n// StepsV2 are primorial(n+2) + 1, where n is the index of the step size\n// primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310\n\nexport const StepSizes = [7, 31, 211, 2311, 30_031, 510_511, 9_699_691, 223_092_871, 6_469_693_231] as const\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`, { required: true })\n return StepSizes[validatedStep]\n}\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","export const XL1_PROTOCOL_VERSION_MAJOR = 1 as const\nexport const XL1_PROTOCOL_VERSION_MINOR = 2 as const\nexport const XL1_PROTOCOL_VERSION_PATCH = 0 as const\nexport const XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_VERSION_MINOR}.${XL1_PROTOCOL_VERSION_PATCH}` as const\nexport const XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1_000_000 + XL1_PROTOCOL_VERSION_MINOR * 1000 + XL1_PROTOCOL_VERSION_PATCH\n","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n","import { type Hash, isHash } from '@xylabs/hex'\nimport { isError } from '@xylabs/typeof'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport class ValidationError<TValue = Payload> extends Error {\n hash: Hash\n value: TValue\n constructor(hash: Hash, value: TValue, message?: string, cause?: unknown) {\n super(message)\n this.hash = hash\n this.name = this.constructor.name\n this.value = value\n this.cause = cause\n }\n}\n\nexport const isValidationError = <TValue = Payload>(\n error: unknown,\n): error is ValidationError<TValue> => {\n return (\n isError(error) && isHash((error as ValidationError<TValue>)?.hash) && (error as ValidationError<TValue>)?.value !== undefined\n )\n}\n","import type { Address, Hash } from '@xylabs/hex'\n\nimport { type BlockBoundWitness, type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BlockValidationError extends ValidationError<BlockBoundWitness> {}\n\nexport const isBlockValidationError = (\n error: unknown,\n): error is BlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockValidationError extends ValidationError<HydratedBlock> {}\n\nexport const isHydratedBlockValidationError = (\n error: unknown,\n): error is HydratedBlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockStateValidationError extends ValidationError<HydratedBlock> {\n chainId: Address\n constructor(hash: Hash, chainId: Address, value: HydratedBlock, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.chainId = chainId\n }\n}\n\nexport const isHydratedBlockStateValidationError = (\n error: unknown,\n): error is HydratedBlockStateValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockStateValidationError.constructor.name\n )\n}\n","import type { HydratedBoundWitness } from '@xyo-network/archivist-model'\nimport { type BoundWitness } from '@xyo-network/boundwitness-model'\n\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BoundWitnessValidationError extends ValidationError<BoundWitness> {}\n\nexport const isBoundWitnessValidationError = (\n error: unknown,\n): error is BoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BoundWitnessValidationError.constructor.name\n )\n}\n\nexport class HydratedBoundWitnessValidationError extends ValidationError<HydratedBoundWitness> {}\n\nexport const isHydratedBoundWitnessValidationError = (\n error: unknown,\n): error is HydratedBoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBoundWitnessValidationError.constructor.name\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class InBlockPayloadValidationError extends ValidationError<Payload> {\n block: HydratedBlock\n constructor(hash: Hash, block: HydratedBlock, value: Payload, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.block = block\n }\n}\n\nexport const isInBlockPayloadValidationError = (\n error: unknown,\n): error is InBlockPayloadValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === InBlockPayloadValidationError.constructor.name\n )\n}\n","import { type HydratedTransaction } from '../../transaction/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class HydratedTransactionValidationError extends ValidationError<HydratedTransaction> {}\n\nexport const isHydratedTransactionValidationError = (\n error: unknown,\n): error is HydratedTransactionValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedTransactionValidationError.constructor.name\n )\n}\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,qBAAAA,oBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;;;ACJ9C,SAAS,uBAAuB;AAEhC,SAAS,6BAA6B;AAK/B,IAAM,yBAAyB;AAc/B,IAAM,qBAAqB,CAAC,MAA8C;AAC/E,SAAO,sBAAwC,sBAAsB,EAAE,CAAC,KACnE,qBAAqB,EAAE,GAAG,MAAM,UAChC,qBAAqB,EAAE,GAAG,MAAM;AACvC;AACO,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AAE3E,IAAM,uBAAuB,CAAC,QAAgB;AAC5C,SAAQ,OAAO,UAAU,GAAG,KAAK,OAAO,IAAK,MAAM;AACrD;;;AC5BA,SAAS,oBAAoB;AAOtB,IAAM,UAAU,CAAC,UAAwC;AAC9D,SAAQ,MAAqB,SAAS;AACxC;AASO,IAAM,eAAe,CAAwB,UAAiD;AACnG,SAAO,aAAa,KAAK,KAAK,MAAM,QAAS,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AO;AACtC,SACE,MAAM,SAAS,oCAAoC,YAAY;AAEnE;;;ACnBO,IAAM,gCAAN,cAA4C,gBAAyB;AAAA,EAC1E;AAAA,EACA,YAAY,MAAY,OAAsB,OAAgB,SAAkB,OAAiB;AAC/F,UAAM,MAAM,OAAO,SAAS,KAAK;AACjC,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,IAAM,kCAAkC,CAC7C,UAC2C;AAC3C,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,8BAA8B,YAAY;AAE7D;;;AClBO,IAAM,qCAAN,cAAiD,gBAAqC;AAAC;AAEvF,IAAM,uCAAuC,CAClD,UACgD;AAChD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,mCAAmC,YAAY;AAElE;","names":["isHashStorageMeta","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isAnyPayload","AsObjectFactory","isStorageMeta","AsObjectFactory","isHashStorageMeta","AsObjectFactory","isBoundWitness","isSigned","isHashStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
1
+ {"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/HydratedTransaction.ts","../../src/isHydratedBoundWitness.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/block/HydratedBlock.ts","../../src/xl1/XL1.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/constants/version.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts","../../src/validation/error.ts","../../src/validation/block/error.ts","../../src/validation/boundwitness/error.ts","../../src/validation/payload/error.ts","../../src/validation/transaction/error.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '../payload/index.ts'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\n\nexport const isChainStakeIntentWithStorageMeta = (x?: unknown | null): x is WithStorageMeta<ChainStakeIntent> => {\n return isChainStakeIntent(x) && isStorageMeta(x)\n}\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Partial<Record<Address, Hex>>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isSignedTransactionBoundWitnessWithStorageMeta, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedTransaction = (\n value: unknown,\n): value is HydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isSignedTransactionBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedTransaction = AsObjectFactory.create<HydratedTransaction>(\n isHydratedTransaction,\n)\n","import type { HydratedBoundWitnessWithStorageMeta } from '@xyo-network/archivist-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport { isAnyPayload, isStorageMeta } from '@xyo-network/payload-model'\n\nexport const isHydratedBoundWitness = (\n value: unknown,\n): value is HydratedBoundWitnessWithStorageMeta => {\n return (\n Array.isArray(value)\n && value.length === 2\n && isBoundWitnessWithStorageMeta(value[0])\n && Array.isArray(value[1])\n && !value[1].some(item => (!isAnyPayload(item) || !isStorageMeta(item)))\n )\n}\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\n\nexport const asTransactionBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithHashStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness, isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isSignedBlockBoundWitness = (value: unknown): value is Signed<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithStorageMeta = (value: unknown): value is Signed<WithStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithStorageMeta(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isHashStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is Signed<WithHashStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithHashStorageMeta(value) && isSigned(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asSignedBlockBoundWitness = AsObjectFactory.create(isSignedBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithStorageMeta)\n\nexport const asBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithHashStorageMeta)\nexport const asSignedBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithHashStorageMeta)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { type Payload, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport {\n type BlockBoundWitness,\n isBlockBoundWitnessWithStorageMeta,\n} from './BlockBoundWitness.ts'\n\nexport type HydratedBlock<T extends BlockBoundWitness = BlockBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedBlock = (\n value: unknown,\n): value is HydratedBlock => {\n return (\n isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedBlock = AsObjectFactory.create<HydratedBlock>(\n isHydratedBlock,\n)\n","export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\nexport type TypingFunc<T extends bigint> = (value: bigint) => T\n\nexport const XL1: TypingFunc<XL1> = (value: bigint): XL1 => value as XL1\nexport const MilliXL1: TypingFunc<MilliXL1> = (value: bigint): MilliXL1 => value as MilliXL1\nexport const MicroXL1: TypingFunc<MicroXL1> = (value: bigint): MicroXL1 => value as MicroXL1\nexport const NanoXL1: TypingFunc<NanoXL1> = (value: bigint): NanoXL1 => value as NanoXL1\nexport const PicoXL1: TypingFunc<PicoXL1> = (value: bigint): PicoXL1 => value as PicoXL1\nexport const FemtoXL1: TypingFunc<FemtoXL1> = (value: bigint): FemtoXL1 => value as FemtoXL1\nexport const AttoXL1: TypingFunc<AttoXL1> = (value: bigint): AttoXL1 => value as AttoXL1\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.nano),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.nano),\n} as const\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\nimport { minTransactionFees } from './minTransactionFees.ts'\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: minTransactionFees.priority,\n} as const\n","import { AsTypeFactory } from '@xylabs/object'\n\n// StepsV2 are primorial(n+2) + 1, where n is the index of the step size\n// primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310\n\nexport const StepSizes = [7, 31, 211, 2311, 30_031, 510_511, 9_699_691, 223_092_871, 6_469_693_231] as const\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`, { required: true })\n return StepSizes[validatedStep]\n}\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","export const XL1_PROTOCOL_VERSION_MAJOR = 1 as const\nexport const XL1_PROTOCOL_VERSION_MINOR = 2 as const\nexport const XL1_PROTOCOL_VERSION_PATCH = 0 as const\nexport const XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_VERSION_MINOR}.${XL1_PROTOCOL_VERSION_PATCH}` as const\nexport const XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1_000_000 + XL1_PROTOCOL_VERSION_MINOR * 1000 + XL1_PROTOCOL_VERSION_PATCH\n","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n","import { type Hash, isHash } from '@xylabs/hex'\nimport { isError } from '@xylabs/typeof'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport class ValidationError<TValue = Payload> extends Error {\n hash: Hash\n value: TValue\n constructor(hash: Hash, value: TValue, message?: string, cause?: unknown) {\n super(message)\n this.hash = hash\n this.name = this.constructor.name\n this.value = value\n this.cause = cause\n }\n}\n\nexport const isValidationError = <TValue = Payload>(\n error: unknown,\n): error is ValidationError<TValue> => {\n return (\n isError(error) && isHash((error as ValidationError<TValue>)?.hash) && (error as ValidationError<TValue>)?.value !== undefined\n )\n}\n","import type { Address, Hash } from '@xylabs/hex'\n\nimport { type BlockBoundWitness, type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BlockValidationError extends ValidationError<BlockBoundWitness> {}\n\nexport const isBlockValidationError = (\n error: unknown,\n): error is BlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockValidationError extends ValidationError<HydratedBlock> {}\n\nexport const isHydratedBlockValidationError = (\n error: unknown,\n): error is HydratedBlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockStateValidationError extends ValidationError<HydratedBlock> {\n chainId: Address\n constructor(hash: Hash, chainId: Address, value: HydratedBlock, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.chainId = chainId\n }\n}\n\nexport const isHydratedBlockStateValidationError = (\n error: unknown,\n): error is HydratedBlockStateValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockStateValidationError.constructor.name\n )\n}\n","import type { HydratedBoundWitness } from '@xyo-network/archivist-model'\nimport { type BoundWitness } from '@xyo-network/boundwitness-model'\n\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BoundWitnessValidationError extends ValidationError<BoundWitness> {}\n\nexport const isBoundWitnessValidationError = (\n error: unknown,\n): error is BoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BoundWitnessValidationError.constructor.name\n )\n}\n\nexport class HydratedBoundWitnessValidationError extends ValidationError<HydratedBoundWitness> {}\n\nexport const isHydratedBoundWitnessValidationError = (\n error: unknown,\n): error is HydratedBoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBoundWitnessValidationError.constructor.name\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class InBlockPayloadValidationError extends ValidationError<Payload> {\n block: HydratedBlock\n constructor(hash: Hash, block: HydratedBlock, value: Payload, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.block = block\n }\n}\n\nexport const isInBlockPayloadValidationError = (\n error: unknown,\n): error is InBlockPayloadValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === InBlockPayloadValidationError.constructor.name\n )\n}\n","import { type HydratedTransaction } from '../../transaction/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class HydratedTransactionValidationError extends ValidationError<HydratedTransaction> {}\n\nexport const isHydratedTransactionValidationError = (\n error: unknown,\n): error is HydratedTransactionValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedTransactionValidationError.constructor.name\n )\n}\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,qBAAAA,oBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;;;ACJ9C,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB,qBAAqB;AAK9C,IAAM,yBAAyB;AAc/B,IAAM,qBAAqB,CAAC,MAA8C;AAC/E,SAAO,sBAAwC,sBAAsB,EAAE,CAAC,KACnE,qBAAqB,EAAE,GAAG,MAAM,UAChC,qBAAqB,EAAE,GA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ACF;AAEO,IAAM,sCAAsC,CACjD,UAC+C;AAC/C,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,kCAAkC,YAAY;AAEjE;;;ACrCO,IAAM,8BAAN,cAA0C,gBAA8B;AAAC;AAEzE,IAAM,gCAAgC,CAC3C,UACyC;AACzC,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,4BAA4B,YAAY;AAE3D;AAEO,IAAM,sCAAN,cAAkD,gBAAsC;AAAC;AAEzF,IAAM,wCAAwC,CACnD,UACiD;AACjD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,oCAAoC,YAAY;AAEnE;;;ACnBO,IAAM,gCAAN,cAA4C,gBAAyB;AAAA,EAC1E;AAAA,EACA,YAAY,MAAY,OAAsB,OAAgB,SAAkB,OAAiB;AAC/F,UAAM,MAAM,OAAO,SAAS,KAAK;AACjC,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,IAAM,kCAAkC,CAC7C,UAC2C;AAC3C,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,8BAA8B,YAAY;AAE7D;;;AClBO,IAAM,qCAAN,cAAiD,gBAAqC;AAAC;AAEvF,IAAM,uCAAuC,CAClD,UACgD;AAChD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,mCAAmC,YAAY;AAElE;","names":["isHashStorageMeta","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isAnyPayload","isStorageMeta","AsObjectFactory","isStorageMeta","AsObjectFactory","isHashStorageMeta","AsObjectFactory","isBoundWitness","isSigned","isHashStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
@@ -3,7 +3,6 @@ export * from './chain/index.ts';
3
3
  export * from './constants/index.ts';
4
4
  export * from './fields/index.ts';
5
5
  export * from './Initializable.ts';
6
- export * from './iterator/index.ts';
7
6
  export * from './network/index.ts';
8
7
  export * from './OpenTelemetryProviders.ts';
9
8
  export * from './payload/index.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Payload } from '@xyo-network/payload-model';
1
+ import type { Payload, WithStorageMeta } from '@xyo-network/payload-model';
2
2
  import type { BlockDuration } from '../../fields/index.ts';
3
3
  import type { FromFields } from './Executable.ts';
4
4
  export declare const ChainStakeIntentSchema: "network.xyo.chain.stake.intent";
@@ -10,4 +10,5 @@ export interface ChainStakeIntentFields extends BlockDuration, FromFields {
10
10
  export type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>;
11
11
  export declare const isChainStakeIntent: (x?: unknown | null) => x is ChainStakeIntent;
12
12
  export declare const asChainStakeIntent: import("@xylabs/object").AsTypeFunction<ChainStakeIntent>;
13
+ export declare const isChainStakeIntentWithStorageMeta: (x?: unknown | null) => x is WithStorageMeta<ChainStakeIntent>;
13
14
  //# sourceMappingURL=ChainStakeIntent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChainStakeIntent.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/ChainStakeIntent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,eAAO,MAAM,sBAAsB,EAAG,gCAAyC,CAAA;AAC/E,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAA;AAElE,MAAM,MAAM,MAAM,GAAG,UAAU,CAAA;AAE/B,MAAM,WAAW,sBAAuB,SAAQ,aAAa,EAAE,UAAU;IAIvE,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAA;AAEtF,eAAO,MAAM,kBAAkB,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,gBAI5D,CAAA;AACD,eAAO,MAAM,kBAAkB,2DAA6C,CAAA"}
1
+ {"version":3,"file":"ChainStakeIntent.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/ChainStakeIntent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,eAAO,MAAM,sBAAsB,EAAG,gCAAyC,CAAA;AAC/E,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAA;AAElE,MAAM,MAAM,MAAM,GAAG,UAAU,CAAA;AAE/B,MAAM,WAAW,sBAAuB,SAAQ,aAAa,EAAE,UAAU;IAIvE,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAA;AAEtF,eAAO,MAAM,kBAAkB,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,gBAI5D,CAAA;AACD,eAAO,MAAM,kBAAkB,2DAA6C,CAAA;AAE5E,eAAO,MAAM,iCAAiC,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,eAAe,CAAC,gBAAgB,CAE3G,CAAA"}
@@ -18,7 +18,7 @@ export interface XyoProvider {
18
18
  signer?: XyoSigner;
19
19
  storage?: XyoDataLakeProvider;
20
20
  viewer?: XyoViewer;
21
- /** @deprecated - use XyoHost instead */
21
+ /** @deprecated - use host instead */
22
22
  wallet?: XyoWallet;
23
23
  }
24
24
  //# sourceMappingURL=XyoProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XyoProvider.d.ts","sourceRoot":"","sources":["../../../../src/provider/v1/XyoProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KA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IAClB,sCAAsC;IAEtC,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB"}
@@ -0,0 +1,41 @@
1
+ import type { BaseParams } from '@xylabs/base';
2
+ import type { BaseEmitter } from '@xylabs/events';
3
+ import type { Address, Hash } from '@xylabs/hex';
4
+ import type { BlockBoundWitness } from '../../block/index.ts';
5
+ import type { IterableRepository, ReadRepository } from '../../repository/index.ts';
6
+ import type { ChainIteratorServiceEventData } from './ChainIteratorServiceEventData.ts';
7
+ export interface ChainIteratorService<TKey, THead> extends ReadRepository<TKey, BlockBoundWitness | undefined>, IterableRepository<TKey, BlockBoundWitness | undefined> {
8
+ chainId: Address;
9
+ head(): Promise<THead>;
10
+ previous(cursor?: TKey | undefined, limit?: number): Promise<BlockBoundWitness[]>;
11
+ updateHead(head: THead): Promise<void>;
12
+ }
13
+ /** @deprecated use ChainIteratorService instead */
14
+ export interface ChainIterator<TKey, THead> extends ChainIteratorService<TKey, THead> {
15
+ }
16
+ export interface EventingChainIteratorService<TKey, THead> extends ChainIteratorService<TKey, THead>, BaseEmitter<BaseParams, ChainIteratorServiceEventData> {
17
+ }
18
+ /** @deprecated use EventingChainIteratorService instead */
19
+ export interface EventingChainIterator<TKey, THead> extends EventingChainIteratorService<TKey, THead> {
20
+ }
21
+ export interface ChainBlockNumberIteratorService extends ChainIteratorService<number, BlockBoundWitness> {
22
+ }
23
+ /** @deprecated use ChainBlockNumberIteratorService instead */
24
+ export interface ChainBlockNumberIterator extends ChainBlockNumberIteratorService {
25
+ }
26
+ export interface EventingChainBlockNumberIteratorService extends EventingChainIteratorService<number, BlockBoundWitness> {
27
+ }
28
+ /** @deprecated use EventingChainBlockNumberIteratorService instead */
29
+ export interface EventingChainBlockNumberIterator extends EventingChainBlockNumberIteratorService {
30
+ }
31
+ export interface ChainHashIteratorService extends ChainIteratorService<Hash, Hash> {
32
+ }
33
+ /** @deprecated use ChainHashIteratorService instead */
34
+ export interface ChainHashIterator extends ChainHashIteratorService {
35
+ }
36
+ export interface EventingChainHashIteratorService extends EventingChainIteratorService<Hash, Hash> {
37
+ }
38
+ /** @deprecated use EventingChainHashIteratorService instead */
39
+ export interface EventingChainHashIterator extends EventingChainHashIteratorService {
40
+ }
41
+ //# sourceMappingURL=ChainIteratorService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChainIteratorService.d.ts","sourceRoot":"","sources":["../../../../src/services/ChainIterator/ChainIteratorService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAEvF,MAAM,WAAW,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAC/C,SAAQ,cAAc,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAAC,EAAE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACpH,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;IACjF,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvC;AAED,mDAAmD;AACnD,MAAM,WAAW,aAAa,CAAC,IAAI,EAAE,KAAK,CAAE,SAAQ,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC;CAAG;AAExF,MAAM,WAAW,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAE,SAAQ,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,EAAE,6BAA6B,CAAC;CAAG;AAE/J,2DAA2D;AAC3D,MAAM,WAAW,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAE,SAAQ,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC;CAAG;AAExG,MAAM,WAAW,+BAAgC,SAAQ,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,CAAC;CAAG;AAE3G,8DAA8D;AAC9D,MAAM,WAAW,wBAAyB,SAAQ,+BAA+B;CAAG;AAEpF,MAAM,WAAW,uCAAwC,SAAQ,4BAA4B,CAAC,MAAM,EAAE,iBAAiB,CAAC;CAAG;AAE3H,sEAAsE;AACtE,MAAM,WAAW,gCAAiC,SAAQ,uCAAuC;CAAG;AAEpG,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC;CAAG;AAErF,uDAAuD;AACvD,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;CAAG;AAEtE,MAAM,WAAW,gCAAiC,SAAQ,4BAA4B,CAAC,IAAI,EAAE,IAAI,CAAC;CAAG;AAErG,+DAA+D;AAC/D,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;CAAG"}
@@ -0,0 +1,14 @@
1
+ import type { EventData } from '@xylabs/events';
2
+ import type { BlockBoundWitness } from '../../block/index.ts';
3
+ export type HeadEventArgs = {
4
+ blocks: [BlockBoundWitness];
5
+ };
6
+ export interface HeadEventData extends EventData {
7
+ headUpdated: HeadEventArgs;
8
+ }
9
+ export interface ChainIteratorServiceEventData extends HeadEventData {
10
+ }
11
+ /** @deprecated use ChainIteratorServiceEventData instead */
12
+ export interface ChainIteratorEventData extends ChainIteratorServiceEventData {
13
+ }
14
+ //# sourceMappingURL=ChainIteratorServiceEventData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChainIteratorServiceEventData.d.ts","sourceRoot":"","sources":["../../../../src/services/ChainIterator/ChainIteratorServiceEventData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,MAAM,aAAa,GAAG;IAAE,MAAM,EAAE,CAAC,iBAAiB,CAAC,CAAA;CAAE,CAAA;AAE3D,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,WAAW,EAAE,aAAa,CAAA;CAC3B;AAED,MAAM,WAAW,6BAA8B,SAAQ,aAAa;CAAI;AAExE,4DAA4D;AAC5D,MAAM,WAAW,sBAAuB,SAAQ,6BAA6B;CAAI"}
@@ -0,0 +1,3 @@
1
+ export * from './ChainIteratorService.ts';
2
+ export * from './ChainIteratorServiceEventData.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/ChainIterator/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,oCAAoC,CAAA"}
@@ -1,10 +1,10 @@
1
1
  import type { ArchivistInstance, WriteArchivist } from '@xyo-network/archivist-model';
2
2
  import type { WalletInstance } from '@xyo-network/wallet-model';
3
- import type { EventingChainBlockNumberIterator } from '../iterator/index.ts';
4
3
  import type { AccountBalanceService } from './AccountBalanceService.ts';
5
4
  import type { BlockProducerService } from './BlockProducerService.ts';
6
5
  import type { BlockRewardService } from './BlockRewardService.ts';
7
6
  import type { ChainContractViewer, ChainStaker, ChainStakeViewer } from './Chain/index.ts';
7
+ import type { EventingChainBlockNumberIteratorService } from './ChainIterator/index.ts';
8
8
  import type { ElectionService } from './Election.ts';
9
9
  import type { StakeIntentService } from './StakeIntentService/index.ts';
10
10
  /** @deprecated use from @xyo-network/xl1-protocol-sdk instead */
@@ -29,7 +29,7 @@ export interface ChainServiceCollection {
29
29
  /**
30
30
  * The chain iterator
31
31
  */
32
- chainIterator?: EventingChainBlockNumberIterator;
32
+ chainIterator?: EventingChainBlockNumberIteratorService;
33
33
  /**
34
34
  * Service for viewing stake information
35
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ChainServiceCollection.d.ts","sourceRoot":"","sources":["../../../src/services/ChainServiceCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EACV,mBAAmB,EAAE,WAAW,EAAE,gBAAgB,EACnD,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAEvE,iEAAiE;AACjE,MAAM,WAAW,sBAAsB;IAErC;;OAEG;IACH,OAAO,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,cAAc,EAAE,qBAAqB,CAAA;IACrC;;OAEG;IACH,cAAc,EAAE,iBAAiB,CAAA;IACjC;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAA;IACxC;;OAEG;IACH,aAAa,CAAC,EAAE,gCAAgC,CAAA;IAChD;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;IAClC;;OAEG;IACH,WAAW,EAAE,WAAW,CAAA;IACxB;;OAEG;IACH,8BAA8B,EAAE,cAAc,CAAA;IAC9C;;OAEG;IACH,eAAe,EAAE,eAAe,CAAA;IAChC;;;OAGG;IACH,wCAAwC,EAAE,iBAAiB,CAAA;IAC3D;;OAEG;IACH,QAAQ,EAAE,oBAAoB,CAAA;IAC9B;;OAEG;IACH,aAAa,EAAE,kBAAkB,CAAA;IACjC;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAA;CACvC"}
1
+ {"version":3,"file":"ChainServiceCollection.d.ts","sourceRoot":"","sources":["../../../src/services/ChainServiceCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EACV,mBAAmB,EAAE,WAAW,EAAE,gBAAgB,EACnD,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,0BAA0B,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAEvE,iEAAiE;AACjE,MAAM,WAAW,sBAAsB;IAErC;;OAEG;IACH,OAAO,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,cAAc,EAAE,qBAAqB,CAAA;IACrC;;OAEG;IACH,cAAc,EAAE,iBAAiB,CAAA;IACjC;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAA;IACxC;;OAEG;IACH,aAAa,CAAC,EAAE,uCAAuC,CAAA;IACvD;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;IAClC;;OAEG;IACH,WAAW,EAAE,WAAW,CAAA;IACxB;;OAEG;IACH,8BAA8B,EAAE,cAAc,CAAA;IAC9C;;OAEG;IACH,eAAe,EAAE,eAAe,CAAA;IAChC;;;OAGG;IACH,wCAAwC,EAAE,iBAAiB,CAAA;IAC3D;;OAEG;IACH,QAAQ,EAAE,oBAAoB,CAAA;IAC9B;;OAEG;IACH,aAAa,EAAE,kBAAkB,CAAA;IACjC;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAA;CACvC"}
@@ -1,10 +1,10 @@
1
1
  import type { ArchivistInstance, WriteArchivist } from '@xyo-network/archivist-model';
2
2
  import type { WalletInstance } from '@xyo-network/wallet-model';
3
- import type { EventingChainBlockNumberIterator } from '../iterator/index.ts';
4
3
  import type { AccountBalanceServiceV2 } from './AccountBalanceService.ts';
5
4
  import type { BlockProducerService } from './BlockProducerService.ts';
6
5
  import type { BlockRewardService } from './BlockRewardService.ts';
7
6
  import type { ChainContractViewer, ChainStaker, ChainStakeViewer } from './Chain/index.ts';
7
+ import type { EventingChainBlockNumberIteratorService } from './ChainIterator/index.ts';
8
8
  import type { ElectionService } from './Election.ts';
9
9
  import type { StakeIntentService } from './StakeIntentService/index.ts';
10
10
  /** @deprecated use from @xyo-network/xl1-protocol-sdk instead */
@@ -29,7 +29,7 @@ export interface ChainServiceCollectionV2 {
29
29
  /**
30
30
  * The chain iterator
31
31
  */
32
- chainIterator?: EventingChainBlockNumberIterator;
32
+ chainIterator?: EventingChainBlockNumberIteratorService;
33
33
  /**
34
34
  * Service for viewing stake information
35
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ChainServiceCollectionV2.d.ts","sourceRoot":"","sources":["../../../src/services/ChainServiceCollectionV2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EACV,mBAAmB,EAAE,WAAW,EAAE,gBAAgB,EACnD,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAEvE,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IAEvC;;OAEG;IACH,OAAO,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,cAAc,EAAE,uBAAuB,CAAA;IACvC;;OAEG;IACH,cAAc,EAAE,iBAAiB,CAAA;IACjC;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAA;IACxC;;OAEG;IACH,aAAa,CAAC,EAAE,gCAAgC,CAAA;IAChD;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;IAClC;;OAEG;IACH,WAAW,EAAE,WAAW,CAAA;IACxB;;OAEG;IACH,8BAA8B,EAAE,cAAc,CAAA;IAC9C;;OAEG;IACH,eAAe,EAAE,eAAe,CAAA;IAChC;;;OAGG;IACH,wCAAwC,EAAE,iBAAiB,CAAA;IAC3D;;OAEG;IACH,QAAQ,EAAE,oBAAoB,CAAA;IAC9B;;OAEG;IACH,aAAa,EAAE,kBAAkB,CAAA;IACjC;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAA;CACvC"}
1
+ {"version":3,"file":"ChainServiceCollectionV2.d.ts","sourceRoot":"","sources":["../../../src/services/ChainServiceCollectionV2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,KAAK,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"Service.d.ts","sourceRoot":"","sources":["../../../src/services/Service.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,EAErB,CAAA"}
1
+ {"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/services/Service.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;CAAG"}
@@ -2,6 +2,7 @@ export * from './AccountBalanceService.ts';
2
2
  export * from './BlockProducerService.ts';
3
3
  export * from './BlockRewardService.ts';
4
4
  export * from './Chain/index.ts';
5
+ export * from './ChainIterator/index.ts';
5
6
  export * from './ChainServiceCollection.ts';
6
7
  export * from './ChainServiceCollectionV2.ts';
7
8
  export * from './Election.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,eAAe,CAAA;AAC7B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,cAAc,CAAA;AAC5B,cAAc,+BAA+B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,eAAe,CAAA;AAC7B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,cAAc,CAAA;AAC5B,cAAc,+BAA+B,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.6.0",
4
+ "version": "1.6.2",
5
5
  "description": "XYO Layer One Protocol",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -38,32 +38,33 @@
38
38
  "types": "./dist/types/index.d.ts",
39
39
  "dependencies": {
40
40
  "@opentelemetry/api": "^1.9.0",
41
- "@xylabs/base": "^4.12.31",
42
- "@xylabs/creatable": "^4.12.31",
43
- "@xylabs/events": "^4.12.31",
44
- "@xylabs/hex": "^4.12.31",
45
- "@xylabs/object": "^4.12.31",
46
- "@xylabs/promise": "^4.12.31",
47
- "@xylabs/typeof": "^4.12.31",
48
- "@xyo-network/account-model": "^4.0.1",
49
- "@xyo-network/archivist-model": "^4.0.1",
50
- "@xyo-network/boundwitness-model": "^4.0.1",
51
- "@xyo-network/payload-model": "^4.0.1",
52
- "@xyo-network/schema-payload-plugin": "^4.0.1",
53
- "@xyo-network/wallet-model": "^4.0.1"
41
+ "@xylabs/base": "^4.12.44",
42
+ "@xylabs/creatable": "^4.12.44",
43
+ "@xylabs/events": "^4.12.44",
44
+ "@xylabs/hex": "^4.12.44",
45
+ "@xylabs/object": "^4.12.44",
46
+ "@xylabs/promise": "^4.12.44",
47
+ "@xylabs/typeof": "^4.12.44",
48
+ "@xyo-network/account-model": "^4.0.2",
49
+ "@xyo-network/archivist-model": "^4.0.2",
50
+ "@xyo-network/boundwitness-model": "^4.0.2",
51
+ "@xyo-network/payload-model": "^4.0.2",
52
+ "@xyo-network/schema-payload-plugin": "^4.0.2",
53
+ "@xyo-network/wallet-model": "^4.0.2"
54
54
  },
55
55
  "devDependencies": {
56
- "@types/node": "^24.0.10",
57
- "@xylabs/eslint-config-flat": "^6.5.12",
58
- "@xylabs/ts-scripts-yarn3": "^6.5.12",
59
- "@xylabs/tsconfig": "^6.5.12",
56
+ "@types/node": "^24.0.11",
57
+ "@typescript-eslint/types": "^8.36.0",
58
+ "@xylabs/eslint-config-flat": "^6.5.13",
59
+ "@xylabs/ts-scripts-yarn3": "^6.5.13",
60
+ "@xylabs/tsconfig": "^6.5.13",
60
61
  "dependency-cruiser": "^16.10.4",
61
- "dotenv": "^17.0.1",
62
+ "dotenv": "^17.1.0",
62
63
  "eslint": "^9.30.1",
63
64
  "eslint-import-resolver-typescript": "^4.4.4",
64
65
  "knip": "^5.61.3",
65
66
  "typescript": "^5.8.3",
66
- "vite": "^7.0.0",
67
+ "vite": "^7.0.3",
67
68
  "vite-tsconfig-paths": "^5.1.4",
68
69
  "vitest": "^3.2.4"
69
70
  },
package/src/index.ts CHANGED
@@ -3,7 +3,6 @@ export * from './chain/index.ts'
3
3
  export * from './constants/index.ts'
4
4
  export * from './fields/index.ts'
5
5
  export * from './Initializable.ts'
6
- export * from './iterator/index.ts'
7
6
  export * from './network/index.ts'
8
7
  export * from './OpenTelemetryProviders.ts'
9
8
  export * from './payload/index.ts'
@@ -1,6 +1,6 @@
1
1
  import { AsObjectFactory } from '@xylabs/object'
2
- import type { Payload } from '@xyo-network/payload-model'
3
- import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
2
+ import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
3
+ import { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'
4
4
 
5
5
  import type { BlockDuration } from '../../fields/index.ts'
6
6
  import type { FromFields } from './Executable.ts'
@@ -26,6 +26,10 @@ export const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent =>
26
26
  }
27
27
  export const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)
28
28
 
29
+ export const isChainStakeIntentWithStorageMeta = (x?: unknown | null): x is WithStorageMeta<ChainStakeIntent> => {
30
+ return isChainStakeIntent(x) && isStorageMeta(x)
31
+ }
32
+
29
33
  const asNonNegativeInteger = (num: number) => {
30
34
  return (Number.isInteger(num) && num >= 0) ? num : undefined
31
35
  }
@@ -10,6 +10,7 @@ import type { XyoNetwork } from './XyoNetwork.ts'
10
10
  import type { XyoRunner } from './XyoRunner.ts'
11
11
  import type { XyoSigner } from './XyoSigner.ts'
12
12
  import type { XyoViewer } from './XyoViewer.ts'
13
+ // eslint-disable-next-line sonarjs/deprecation
13
14
  import type { XyoWallet } from './XyoWallet.ts'
14
15
 
15
16
  export interface XyoProvider {
@@ -28,6 +29,7 @@ export interface XyoProvider {
28
29
  signer?: XyoSigner
29
30
  storage?: XyoDataLakeProvider
30
31
  viewer?: XyoViewer
31
- /** @deprecated - use XyoHost instead */
32
+ /** @deprecated - use host instead */
33
+ // eslint-disable-next-line sonarjs/deprecation
32
34
  wallet?: XyoWallet
33
35
  }
@@ -0,0 +1,43 @@
1
+ import type { BaseParams } from '@xylabs/base'
2
+ import type { BaseEmitter } from '@xylabs/events'
3
+ import type { Address, Hash } from '@xylabs/hex'
4
+
5
+ import type { BlockBoundWitness } from '../../block/index.ts'
6
+ import type { IterableRepository, ReadRepository } from '../../repository/index.ts'
7
+ import type { ChainIteratorServiceEventData } from './ChainIteratorServiceEventData.ts'
8
+
9
+ export interface ChainIteratorService<TKey, THead>
10
+ extends ReadRepository<TKey, BlockBoundWitness | undefined>, IterableRepository<TKey, BlockBoundWitness | undefined> {
11
+ chainId: Address
12
+ head(): Promise<THead>
13
+ previous(cursor?: TKey | undefined, limit?: number): Promise<BlockBoundWitness[]>
14
+ updateHead(head: THead): Promise<void>
15
+ }
16
+
17
+ /** @deprecated use ChainIteratorService instead */
18
+ export interface ChainIterator<TKey, THead> extends ChainIteratorService<TKey, THead> {}
19
+
20
+ export interface EventingChainIteratorService<TKey, THead> extends ChainIteratorService<TKey, THead>, BaseEmitter<BaseParams, ChainIteratorServiceEventData> {}
21
+
22
+ /** @deprecated use EventingChainIteratorService instead */
23
+ export interface EventingChainIterator<TKey, THead> extends EventingChainIteratorService<TKey, THead> {}
24
+
25
+ export interface ChainBlockNumberIteratorService extends ChainIteratorService<number, BlockBoundWitness> {}
26
+
27
+ /** @deprecated use ChainBlockNumberIteratorService instead */
28
+ export interface ChainBlockNumberIterator extends ChainBlockNumberIteratorService {}
29
+
30
+ export interface EventingChainBlockNumberIteratorService extends EventingChainIteratorService<number, BlockBoundWitness> {}
31
+
32
+ /** @deprecated use EventingChainBlockNumberIteratorService instead */
33
+ export interface EventingChainBlockNumberIterator extends EventingChainBlockNumberIteratorService {}
34
+
35
+ export interface ChainHashIteratorService extends ChainIteratorService<Hash, Hash> {}
36
+
37
+ /** @deprecated use ChainHashIteratorService instead */
38
+ export interface ChainHashIterator extends ChainHashIteratorService {}
39
+
40
+ export interface EventingChainHashIteratorService extends EventingChainIteratorService<Hash, Hash> {}
41
+
42
+ /** @deprecated use EventingChainHashIteratorService instead */
43
+ export interface EventingChainHashIterator extends EventingChainHashIteratorService {}
@@ -0,0 +1,14 @@
1
+ import type { EventData } from '@xylabs/events'
2
+
3
+ import type { BlockBoundWitness } from '../../block/index.ts'
4
+
5
+ export type HeadEventArgs = { blocks: [BlockBoundWitness] }
6
+
7
+ export interface HeadEventData extends EventData {
8
+ headUpdated: HeadEventArgs
9
+ }
10
+
11
+ export interface ChainIteratorServiceEventData extends HeadEventData { }
12
+
13
+ /** @deprecated use ChainIteratorServiceEventData instead */
14
+ export interface ChainIteratorEventData extends ChainIteratorServiceEventData { }
@@ -0,0 +1,2 @@
1
+ export * from './ChainIteratorService.ts'
2
+ export * from './ChainIteratorServiceEventData.ts'
@@ -1,13 +1,13 @@
1
1
  import type { ArchivistInstance, WriteArchivist } from '@xyo-network/archivist-model'
2
2
  import type { WalletInstance } from '@xyo-network/wallet-model'
3
3
 
4
- import type { EventingChainBlockNumberIterator } from '../iterator/index.ts'
5
4
  import type { AccountBalanceService } from './AccountBalanceService.ts'
6
5
  import type { BlockProducerService } from './BlockProducerService.ts'
7
6
  import type { BlockRewardService } from './BlockRewardService.ts'
8
7
  import type {
9
8
  ChainContractViewer, ChainStaker, ChainStakeViewer,
10
9
  } from './Chain/index.ts'
10
+ import type { EventingChainBlockNumberIteratorService } from './ChainIterator/index.ts'
11
11
  import type { ElectionService } from './Election.ts'
12
12
  import type { StakeIntentService } from './StakeIntentService/index.ts'
13
13
 
@@ -34,7 +34,7 @@ export interface ChainServiceCollection {
34
34
  /**
35
35
  * The chain iterator
36
36
  */
37
- chainIterator?: EventingChainBlockNumberIterator
37
+ chainIterator?: EventingChainBlockNumberIteratorService
38
38
  /**
39
39
  * Service for viewing stake information
40
40
  */
@@ -1,13 +1,13 @@
1
1
  import type { ArchivistInstance, WriteArchivist } from '@xyo-network/archivist-model'
2
2
  import type { WalletInstance } from '@xyo-network/wallet-model'
3
3
 
4
- import type { EventingChainBlockNumberIterator } from '../iterator/index.ts'
5
4
  import type { AccountBalanceServiceV2 } from './AccountBalanceService.ts'
6
5
  import type { BlockProducerService } from './BlockProducerService.ts'
7
6
  import type { BlockRewardService } from './BlockRewardService.ts'
8
7
  import type {
9
8
  ChainContractViewer, ChainStaker, ChainStakeViewer,
10
9
  } from './Chain/index.ts'
10
+ import type { EventingChainBlockNumberIteratorService } from './ChainIterator/index.ts'
11
11
  import type { ElectionService } from './Election.ts'
12
12
  import type { StakeIntentService } from './StakeIntentService/index.ts'
13
13
 
@@ -34,7 +34,7 @@ export interface ChainServiceCollectionV2 {
34
34
  /**
35
35
  * The chain iterator
36
36
  */
37
- chainIterator?: EventingChainBlockNumberIterator
37
+ chainIterator?: EventingChainBlockNumberIteratorService
38
38
  /**
39
39
  * Service for viewing stake information
40
40
  */
@@ -1,3 +1 @@
1
- export type Service = {
2
-
3
- }
1
+ export interface Service {}
@@ -2,6 +2,7 @@ export * from './AccountBalanceService.ts'
2
2
  export * from './BlockProducerService.ts'
3
3
  export * from './BlockRewardService.ts'
4
4
  export * from './Chain/index.ts'
5
+ export * from './ChainIterator/index.ts'
5
6
  export * from './ChainServiceCollection.ts'
6
7
  export * from './ChainServiceCollectionV2.ts'
7
8
  export * from './Election.ts'
@@ -1,23 +0,0 @@
1
- import type { BaseParams } from '@xylabs/base';
2
- import type { BaseEmitter } from '@xylabs/events';
3
- import type { Address, Hash } from '@xylabs/hex';
4
- import type { BlockBoundWitness } from '../block/index.ts';
5
- import type { IterableRepository, ReadRepository } from '../repository/index.ts';
6
- import type { ChainIteratorEventData } from './ChainIteratorEventData.ts';
7
- export interface ChainIterator<TKey, THead> extends ReadRepository<TKey, BlockBoundWitness | undefined>, IterableRepository<TKey, BlockBoundWitness | undefined> {
8
- chainId: Address;
9
- head(): Promise<THead>;
10
- previous(cursor?: TKey | undefined, limit?: number): Promise<BlockBoundWitness[]>;
11
- updateHead(head: THead): Promise<void>;
12
- }
13
- export interface EventingChainIterator<TKey, THead> extends ChainIterator<TKey, THead>, BaseEmitter<BaseParams, ChainIteratorEventData> {
14
- }
15
- export interface ChainBlockNumberIterator extends ChainIterator<number, BlockBoundWitness> {
16
- }
17
- export interface EventingChainBlockNumberIterator extends EventingChainIterator<number, BlockBoundWitness> {
18
- }
19
- export interface ChainHashIterator extends ChainIterator<Hash, Hash> {
20
- }
21
- export interface EventingChainHashIterator extends EventingChainIterator<Hash, Hash> {
22
- }
23
- //# sourceMappingURL=ChainIterator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChainIterator.d.ts","sourceRoot":"","sources":["../../../src/iterator/ChainIterator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEzE,MAAM,WAAW,aAAa,CAAC,IAAI,EAAE,KAAK,CACxC,SAAQ,cAAc,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAAC,EAAE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACpH,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;IACjF,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvC;AAED,MAAM,WAAW,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAE,SAAQ,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,EAAE,sBAAsB,CAAC;CAAI;AAE3I,MAAM,WAAW,wBAAyB,SAAQ,aAAa,CAAC,MAAM,EAAE,iBAAiB,CAAC;CAAI;AAC9F,MAAM,WAAW,gCAAiC,SAAQ,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,CAAC;CAAI;AAE9G,MAAM,WAAW,iBAAkB,SAAQ,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC;CAAI;AACxE,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC;CAAI"}
@@ -1,11 +0,0 @@
1
- import type { EventData } from '@xylabs/events';
2
- import type { BlockBoundWitness } from '../block/index.ts';
3
- export type HeadEventArgs = {
4
- blocks: [BlockBoundWitness];
5
- };
6
- export interface HeadEventData extends EventData {
7
- headUpdated: HeadEventArgs;
8
- }
9
- export interface ChainIteratorEventData extends HeadEventData {
10
- }
11
- //# sourceMappingURL=ChainIteratorEventData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChainIteratorEventData.d.ts","sourceRoot":"","sources":["../../../src/iterator/ChainIteratorEventData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,MAAM,MAAM,aAAa,GAAG;IAAE,MAAM,EAAE,CAAC,iBAAiB,CAAC,CAAA;CAAE,CAAA;AAE3D,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,WAAW,EAAE,aAAa,CAAA;CAC3B;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;CAAI"}
@@ -1,3 +0,0 @@
1
- export * from './ChainIterator.ts';
2
- export * from './ChainIteratorEventData.ts';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/iterator/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA"}
@@ -1,23 +0,0 @@
1
- import type { BaseParams } from '@xylabs/base'
2
- import type { BaseEmitter } from '@xylabs/events'
3
- import type { Address, Hash } from '@xylabs/hex'
4
-
5
- import type { BlockBoundWitness } from '../block/index.ts'
6
- import type { IterableRepository, ReadRepository } from '../repository/index.ts'
7
- import type { ChainIteratorEventData } from './ChainIteratorEventData.ts'
8
-
9
- export interface ChainIterator<TKey, THead>
10
- extends ReadRepository<TKey, BlockBoundWitness | undefined>, IterableRepository<TKey, BlockBoundWitness | undefined> {
11
- chainId: Address
12
- head(): Promise<THead>
13
- previous(cursor?: TKey | undefined, limit?: number): Promise<BlockBoundWitness[]>
14
- updateHead(head: THead): Promise<void>
15
- }
16
-
17
- export interface EventingChainIterator<TKey, THead> extends ChainIterator<TKey, THead>, BaseEmitter<BaseParams, ChainIteratorEventData> { }
18
-
19
- export interface ChainBlockNumberIterator extends ChainIterator<number, BlockBoundWitness> { }
20
- export interface EventingChainBlockNumberIterator extends EventingChainIterator<number, BlockBoundWitness> { }
21
-
22
- export interface ChainHashIterator extends ChainIterator<Hash, Hash> { }
23
- export interface EventingChainHashIterator extends EventingChainIterator<Hash, Hash> { }
@@ -1,11 +0,0 @@
1
- import type { EventData } from '@xylabs/events'
2
-
3
- import type { BlockBoundWitness } from '../block/index.ts'
4
-
5
- export type HeadEventArgs = { blocks: [BlockBoundWitness] }
6
-
7
- export interface HeadEventData extends EventData {
8
- headUpdated: HeadEventArgs
9
- }
10
-
11
- export interface ChainIteratorEventData extends HeadEventData { }
@@ -1,2 +0,0 @@
1
- export * from './ChainIterator.ts'
2
- export * from './ChainIteratorEventData.ts'