@xyo-network/xl1-protocol 1.3.26 → 1.3.28

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 (89) hide show
  1. package/dist/neutral/index.mjs +33 -12
  2. package/dist/neutral/index.mjs.map +1 -1
  3. package/dist/node/index.mjs +33 -12
  4. package/dist/node/index.mjs.map +1 -1
  5. package/dist/types/BlockNumber.d.ts +37 -0
  6. package/dist/types/BlockNumber.d.ts.map +1 -0
  7. package/dist/types/ChainIterator.d.ts +3 -3
  8. package/dist/types/ChainIterator.d.ts.map +1 -1
  9. package/dist/types/ChainIteratorEventData.d.ts +1 -1
  10. package/dist/types/ChainIteratorEventData.d.ts.map +1 -1
  11. package/dist/types/block/AllowedBlockPayload.d.ts +2 -2
  12. package/dist/types/block/AllowedBlockPayload.d.ts.map +1 -1
  13. package/dist/types/chain/ChainAnalyzer.d.ts +1 -1
  14. package/dist/types/chain/ChainAnalyzer.d.ts.map +1 -1
  15. package/dist/types/index.d.ts +1 -0
  16. package/dist/types/index.d.ts.map +1 -1
  17. package/dist/types/provider/v1/XyoNetwork.d.ts +1 -1
  18. package/dist/types/provider/v1/XyoNetwork.d.ts.map +1 -1
  19. package/dist/types/provider/v1/XyoProvider.d.ts +2 -2
  20. package/dist/types/provider/v1/XyoProvider.d.ts.map +1 -1
  21. package/dist/types/provider/v1/XyoRunner.d.ts +1 -1
  22. package/dist/types/provider/v1/XyoRunner.d.ts.map +1 -1
  23. package/dist/types/provider/v1/XyoSigner.d.ts +2 -2
  24. package/dist/types/provider/v1/XyoSigner.d.ts.map +1 -1
  25. package/dist/types/provider/v1/XyoViewer.d.ts +3 -3
  26. package/dist/types/provider/v1/XyoViewer.d.ts.map +1 -1
  27. package/dist/types/provider/v2/viewer/Account.d.ts +1 -1
  28. package/dist/types/provider/v2/viewer/Account.d.ts.map +1 -1
  29. package/dist/types/provider/v2/viewer/Block.d.ts +1 -1
  30. package/dist/types/provider/v2/viewer/Block.d.ts.map +1 -1
  31. package/dist/types/provider/v2/viewer/Chain.d.ts +1 -1
  32. package/dist/types/provider/v2/viewer/Chain.d.ts.map +1 -1
  33. package/dist/types/provider/v2/viewer/Transaction.d.ts +1 -1
  34. package/dist/types/provider/v2/viewer/Transaction.d.ts.map +1 -1
  35. package/dist/types/repository/TransactionReadRepository.d.ts +1 -1
  36. package/dist/types/repository/TransactionReadRepository.d.ts.map +1 -1
  37. package/dist/types/repository/TransactionRepositoryIterator.d.ts +1 -1
  38. package/dist/types/repository/TransactionRepositoryIterator.d.ts.map +1 -1
  39. package/dist/types/repository/TransactionWriteRepository.d.ts +1 -1
  40. package/dist/types/repository/TransactionWriteRepository.d.ts.map +1 -1
  41. package/dist/types/services/BlockProducer.d.ts +2 -2
  42. package/dist/types/services/BlockProducer.d.ts.map +1 -1
  43. package/dist/types/services/Election.d.ts +1 -1
  44. package/dist/types/services/Election.d.ts.map +1 -1
  45. package/dist/types/services/PendingTransactionsService.d.ts +1 -1
  46. package/dist/types/services/PendingTransactionsService.d.ts.map +1 -1
  47. package/dist/types/services/stakeIntent/StakeIntentService.d.ts +1 -1
  48. package/dist/types/services/stakeIntent/StakeIntentService.d.ts.map +1 -1
  49. package/dist/types/validation/block/BlockValidationFunction.d.ts +1 -1
  50. package/dist/types/validation/block/BlockValidationFunction.d.ts.map +1 -1
  51. package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts +1 -1
  52. package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -1
  53. package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts +1 -1
  54. package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -1
  55. package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts +1 -1
  56. package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts.map +1 -1
  57. package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts +1 -1
  58. package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts.map +1 -1
  59. package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts +1 -1
  60. package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts.map +1 -1
  61. package/package.json +1 -1
  62. package/src/BlockNumber.ts +39 -0
  63. package/src/ChainIterator.ts +3 -4
  64. package/src/ChainIteratorEventData.ts +1 -1
  65. package/src/block/AllowedBlockPayload.ts +3 -3
  66. package/src/chain/ChainAnalyzer.ts +1 -1
  67. package/src/index.ts +1 -0
  68. package/src/provider/v1/XyoNetwork.ts +1 -1
  69. package/src/provider/v1/XyoProvider.ts +2 -3
  70. package/src/provider/v1/XyoRunner.ts +1 -1
  71. package/src/provider/v1/XyoSigner.ts +2 -2
  72. package/src/provider/v1/XyoViewer.ts +3 -3
  73. package/src/provider/v2/viewer/Account.ts +1 -1
  74. package/src/provider/v2/viewer/Block.ts +1 -2
  75. package/src/provider/v2/viewer/Chain.ts +1 -2
  76. package/src/provider/v2/viewer/Transaction.ts +1 -2
  77. package/src/repository/TransactionReadRepository.ts +1 -2
  78. package/src/repository/TransactionRepositoryIterator.ts +1 -2
  79. package/src/repository/TransactionWriteRepository.ts +1 -2
  80. package/src/services/BlockProducer.ts +2 -3
  81. package/src/services/Election.ts +1 -2
  82. package/src/services/PendingTransactionsService.ts +1 -2
  83. package/src/services/stakeIntent/StakeIntentService.ts +1 -1
  84. package/src/validation/block/BlockValidationFunction.ts +1 -1
  85. package/src/validation/block/HydratedBlockStateValidationFunction.ts +1 -1
  86. package/src/validation/block/HydratedBlockValidationFunction.ts +1 -1
  87. package/src/validation/payload/InBlockPayloadValidationFunction.ts +1 -1
  88. package/src/validation/transaction/HydratedTransactionStateValidationFunction.ts +1 -1
  89. package/src/validation/transaction/HydratedTransactionValidationFunction.ts +1 -1
@@ -93,6 +93,20 @@ var asOptionalBlockBoundWitness = AsObjectFactory5.createOptional(isBlockBoundWi
93
93
  var asBlockBoundWitnessWithStorageMeta = AsObjectFactory5.create(isBlockBoundWitnessWithStorageMeta);
94
94
  var asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory5.createOptional(isBlockBoundWitnessWithStorageMeta);
95
95
 
96
+ // src/BlockNumber.ts
97
+ import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
98
+ import {
99
+ isPayloadOfSchemaType as isPayloadOfSchemaType4,
100
+ isPayloadOfSchemaTypeWithSources
101
+ } from "@xyo-network/payload-model";
102
+ var BlockNumberSchema = "network.xyo.chain.block.number";
103
+ var isBlockNumber = isPayloadOfSchemaType4(BlockNumberSchema);
104
+ var asBlockNumber = AsObjectFactory6.create(isBlockNumber);
105
+ var asOptionalBlockNumber = AsObjectFactory6.createOptional(isBlockNumber);
106
+ var isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources(BlockNumberSchema);
107
+ var asBlockNumberWithSources = AsObjectFactory6.create(isBlockNumberWithSources);
108
+ var asOptionalBlockNumberWithSources = AsObjectFactory6.createOptional(isBlockNumberWithSources);
109
+
96
110
  // src/ethereum.ts
97
111
  import { toHex } from "@xylabs/hex";
98
112
  import { getAddress } from "ethers";
@@ -111,36 +125,37 @@ var toEthAddress = (value) => {
111
125
  };
112
126
 
113
127
  // src/network/Status.ts
114
- import { isPayloadOfSchemaType as isPayloadOfSchemaType4 } from "@xyo-network/payload-model";
128
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
115
129
  var NetworkStatusSchema = "network.xyo.chain.status";
116
- var isNetworkStatus = isPayloadOfSchemaType4(NetworkStatusSchema);
130
+ var isNetworkStatus = isPayloadOfSchemaType5(NetworkStatusSchema);
117
131
 
118
132
  // src/services/Chain/ChainIdentification.ts
119
- import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
133
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
120
134
  var ChainIdentificationPayloadSchema = "network.xyo.chain.identification";
121
- var isChainIdentificationPayload = isPayloadOfSchemaType5(ChainIdentificationPayloadSchema);
135
+ var isChainIdentificationPayload = isPayloadOfSchemaType6(ChainIdentificationPayloadSchema);
122
136
 
123
137
  // src/services/Chain/ChainInformation.ts
124
- import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
138
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType7 } from "@xyo-network/payload-model";
125
139
  var ChainInformationPayloadSchema = "network.xyo.chain.information";
126
- var isChainInformationPayload = isPayloadOfSchemaType6(ChainInformationPayloadSchema);
140
+ var isChainInformationPayload = isPayloadOfSchemaType7(ChainInformationPayloadSchema);
127
141
 
128
142
  // src/services/stakeIntent/ChainIndexingServiceStateSchema.ts
129
- import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
130
- import { isPayloadOfSchemaType as isPayloadOfSchemaType7, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
143
+ import { AsObjectFactory as AsObjectFactory7 } from "@xylabs/object";
144
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType8, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
131
145
  var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
132
146
  var isChainIndexingServiceState = (payload) => {
133
- return isPayloadOfSchemaType7(ChainIndexingServiceStateSchema)(payload);
147
+ return isPayloadOfSchemaType8(ChainIndexingServiceStateSchema)(payload);
134
148
  };
135
- var asChainIndexingServiceState = AsObjectFactory6.create(isChainIndexingServiceState);
149
+ var asChainIndexingServiceState = AsObjectFactory7.create(isChainIndexingServiceState);
136
150
  var isChainIndexingServiceStateWithStorageMeta = (value) => isChainIndexingServiceState(value) && isStorageMeta3(value);
137
- var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.create(isChainIndexingServiceStateWithStorageMeta);
138
- var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.createOptional(isChainIndexingServiceStateWithStorageMeta);
151
+ var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.create(isChainIndexingServiceStateWithStorageMeta);
152
+ var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.createOptional(isChainIndexingServiceStateWithStorageMeta);
139
153
 
140
154
  // src/Steps.ts
141
155
  var StepSizes = [10, 105, 1103, 11576, 121551, 1276282, 13400956];
142
156
  export {
143
157
  AllowedBlockPayloadSchemas,
158
+ BlockNumberSchema,
144
159
  ChainIdentificationPayloadSchema,
145
160
  ChainIndexingServiceStateSchema,
146
161
  ChainInformationPayloadSchema,
@@ -152,6 +167,8 @@ export {
152
167
  TransferSchema,
153
168
  asBlockBoundWitness,
154
169
  asBlockBoundWitnessWithStorageMeta,
170
+ asBlockNumber,
171
+ asBlockNumberWithSources,
155
172
  asChainIndexingServiceState,
156
173
  asChainIndexingServiceStateWithStorageMeta,
157
174
  asChainStakeIntent,
@@ -160,6 +177,8 @@ export {
160
177
  asHashPayloadWithStorageMeta,
161
178
  asOptionalBlockBoundWitness,
162
179
  asOptionalBlockBoundWitnessWithStorageMeta,
180
+ asOptionalBlockNumber,
181
+ asOptionalBlockNumberWithSources,
163
182
  asOptionalChainIndexingServiceStateWithStorageMeta,
164
183
  asOptionalChainStakeIntent,
165
184
  asOptionalHashPayload,
@@ -176,6 +195,8 @@ export {
176
195
  isAllowedBlockPayloadWithHashStorageMeta,
177
196
  isBlockBoundWitness,
178
197
  isBlockBoundWitnessWithStorageMeta,
198
+ isBlockNumber,
199
+ isBlockNumberWithSources,
179
200
  isChainIdentificationPayload,
180
201
  isChainIndexingServiceState,
181
202
  isChainIndexingServiceStateWithStorageMeta,
@@ -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/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/ethereum.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts","../../src/Steps.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'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '#payload'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '#transaction'\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 '../../BlockDuration.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)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(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)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(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: 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)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\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 { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../BlockDuration.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 isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { 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 isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","import type { Hex } from '@xylabs/hex'\nimport { toHex } from '@xylabs/hex'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { getAddress } from 'ethers'\nimport { parseUnits } from 'ethers/utils'\n\nexport interface GasConfig {\n gasLimit?: number\n gasPrice?: bigint\n}\n\nexport const getDefaultGasConfig = (): GasConfig => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport type EthAddress = Hex\n\nexport const ETH_ZERO_ADDRESS: EthAddress = '0x0000000000000000000000000000000000000000' as const\n\nexport const toEthAddress = (value: bigint | string | AccountInstance): EthAddress => {\n const address = (typeof value === 'object') ? value.address : value\n return getAddress(toHex(address, { prefix: true, bitLength: 160 })) as EthAddress\n}\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 { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\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\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,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,MA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ObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","isPayloadOfSchemaType","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/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/BlockNumber.ts","../../src/ethereum.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts","../../src/Steps.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 '../../BlockDuration.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)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(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)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(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: 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)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\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 { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../BlockDuration.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 isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { 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 isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\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 * The chain id\n */\n chain?: 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)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<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)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Hex } from '@xylabs/hex'\nimport { toHex } from '@xylabs/hex'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { getAddress } from 'ethers'\nimport { parseUnits } from 'ethers/utils'\n\nexport interface GasConfig {\n gasLimit?: number\n gasPrice?: bigint\n}\n\nexport const getDefaultGasConfig = (): GasConfig => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport type EthAddress = Hex\n\nexport const ETH_ZERO_ADDRESS: EthAddress = '0x0000000000000000000000000000000000000000' as const\n\nexport const toEthAddress = (value: bigint | string | AccountInstance): EthAddress => {\n const address = (typeof value === 'object') ? value.address : value\n return getAddress(toHex(address, { prefix: true, bitLength: 160 })) as EthAddress\n}\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 { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\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\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;;;ACJ9C,SAAS,uBAAuB;AAEhC,SAAS,6BAA6B;AAK/B,IAAM,yBAAyB;AAc/B,IAAM,qBAAqB,CAAC,MAA8C;AAC/E,SAA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S,yBAAAC,wBAAuB,iBAAAC,sBAAqB;AAiB9C,IAAM,kCAAkC;AAWxC,IAAM,8BAA8B,CAAkC,YAA+D;AAC1I,SAAOD,uBAAoD,+BAA+B,EAAE,OAAO;AACrG;AACO,IAAM,8BAA8BD,iBAAgB,OAA6C,2BAA2B;AAE5H,IAAM,6CACX,CAAkC,UAClC,4BAA+B,KAAK,KAAKE,eAAc,KAAK;AAEvD,IAAM,6CACXF,iBAAgB,OAAmD,0CAA0C;AAExG,IAAM,qDACXA,iBAAgB,eAA2D,0CAA0C;;;AC7ChH,IAAM,YAAY,CAAC,IAAI,KAAK,MAAM,OAAQ,QAAS,SAAW,QAAU;","names":["AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
@@ -93,6 +93,20 @@ var asOptionalBlockBoundWitness = AsObjectFactory5.createOptional(isBlockBoundWi
93
93
  var asBlockBoundWitnessWithStorageMeta = AsObjectFactory5.create(isBlockBoundWitnessWithStorageMeta);
94
94
  var asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory5.createOptional(isBlockBoundWitnessWithStorageMeta);
95
95
 
96
+ // src/BlockNumber.ts
97
+ import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
98
+ import {
99
+ isPayloadOfSchemaType as isPayloadOfSchemaType4,
100
+ isPayloadOfSchemaTypeWithSources
101
+ } from "@xyo-network/payload-model";
102
+ var BlockNumberSchema = "network.xyo.chain.block.number";
103
+ var isBlockNumber = isPayloadOfSchemaType4(BlockNumberSchema);
104
+ var asBlockNumber = AsObjectFactory6.create(isBlockNumber);
105
+ var asOptionalBlockNumber = AsObjectFactory6.createOptional(isBlockNumber);
106
+ var isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources(BlockNumberSchema);
107
+ var asBlockNumberWithSources = AsObjectFactory6.create(isBlockNumberWithSources);
108
+ var asOptionalBlockNumberWithSources = AsObjectFactory6.createOptional(isBlockNumberWithSources);
109
+
96
110
  // src/ethereum.ts
97
111
  import { toHex } from "@xylabs/hex";
98
112
  import { getAddress } from "ethers";
@@ -111,36 +125,37 @@ var toEthAddress = (value) => {
111
125
  };
112
126
 
113
127
  // src/network/Status.ts
114
- import { isPayloadOfSchemaType as isPayloadOfSchemaType4 } from "@xyo-network/payload-model";
128
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
115
129
  var NetworkStatusSchema = "network.xyo.chain.status";
116
- var isNetworkStatus = isPayloadOfSchemaType4(NetworkStatusSchema);
130
+ var isNetworkStatus = isPayloadOfSchemaType5(NetworkStatusSchema);
117
131
 
118
132
  // src/services/Chain/ChainIdentification.ts
119
- import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
133
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
120
134
  var ChainIdentificationPayloadSchema = "network.xyo.chain.identification";
121
- var isChainIdentificationPayload = isPayloadOfSchemaType5(ChainIdentificationPayloadSchema);
135
+ var isChainIdentificationPayload = isPayloadOfSchemaType6(ChainIdentificationPayloadSchema);
122
136
 
123
137
  // src/services/Chain/ChainInformation.ts
124
- import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
138
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType7 } from "@xyo-network/payload-model";
125
139
  var ChainInformationPayloadSchema = "network.xyo.chain.information";
126
- var isChainInformationPayload = isPayloadOfSchemaType6(ChainInformationPayloadSchema);
140
+ var isChainInformationPayload = isPayloadOfSchemaType7(ChainInformationPayloadSchema);
127
141
 
128
142
  // src/services/stakeIntent/ChainIndexingServiceStateSchema.ts
129
- import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
130
- import { isPayloadOfSchemaType as isPayloadOfSchemaType7, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
143
+ import { AsObjectFactory as AsObjectFactory7 } from "@xylabs/object";
144
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType8, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
131
145
  var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
132
146
  var isChainIndexingServiceState = (payload) => {
133
- return isPayloadOfSchemaType7(ChainIndexingServiceStateSchema)(payload);
147
+ return isPayloadOfSchemaType8(ChainIndexingServiceStateSchema)(payload);
134
148
  };
135
- var asChainIndexingServiceState = AsObjectFactory6.create(isChainIndexingServiceState);
149
+ var asChainIndexingServiceState = AsObjectFactory7.create(isChainIndexingServiceState);
136
150
  var isChainIndexingServiceStateWithStorageMeta = (value) => isChainIndexingServiceState(value) && isStorageMeta3(value);
137
- var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.create(isChainIndexingServiceStateWithStorageMeta);
138
- var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.createOptional(isChainIndexingServiceStateWithStorageMeta);
151
+ var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.create(isChainIndexingServiceStateWithStorageMeta);
152
+ var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.createOptional(isChainIndexingServiceStateWithStorageMeta);
139
153
 
140
154
  // src/Steps.ts
141
155
  var StepSizes = [10, 105, 1103, 11576, 121551, 1276282, 13400956];
142
156
  export {
143
157
  AllowedBlockPayloadSchemas,
158
+ BlockNumberSchema,
144
159
  ChainIdentificationPayloadSchema,
145
160
  ChainIndexingServiceStateSchema,
146
161
  ChainInformationPayloadSchema,
@@ -152,6 +167,8 @@ export {
152
167
  TransferSchema,
153
168
  asBlockBoundWitness,
154
169
  asBlockBoundWitnessWithStorageMeta,
170
+ asBlockNumber,
171
+ asBlockNumberWithSources,
155
172
  asChainIndexingServiceState,
156
173
  asChainIndexingServiceStateWithStorageMeta,
157
174
  asChainStakeIntent,
@@ -160,6 +177,8 @@ export {
160
177
  asHashPayloadWithStorageMeta,
161
178
  asOptionalBlockBoundWitness,
162
179
  asOptionalBlockBoundWitnessWithStorageMeta,
180
+ asOptionalBlockNumber,
181
+ asOptionalBlockNumberWithSources,
163
182
  asOptionalChainIndexingServiceStateWithStorageMeta,
164
183
  asOptionalChainStakeIntent,
165
184
  asOptionalHashPayload,
@@ -176,6 +195,8 @@ export {
176
195
  isAllowedBlockPayloadWithHashStorageMeta,
177
196
  isBlockBoundWitness,
178
197
  isBlockBoundWitnessWithStorageMeta,
198
+ isBlockNumber,
199
+ isBlockNumberWithSources,
179
200
  isChainIdentificationPayload,
180
201
  isChainIndexingServiceState,
181
202
  isChainIndexingServiceStateWithStorageMeta,
@@ -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/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/ethereum.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts","../../src/Steps.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'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '#payload'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '#transaction'\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 '../../BlockDuration.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)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(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)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(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: 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)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\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 { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../BlockDuration.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 isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { 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 isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","import type { Hex } from '@xylabs/hex'\nimport { toHex } from '@xylabs/hex'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { getAddress } from 'ethers'\nimport { parseUnits } from 'ethers/utils'\n\nexport interface GasConfig {\n gasLimit?: number\n gasPrice?: bigint\n}\n\nexport const getDefaultGasConfig = (): GasConfig => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport type EthAddress = Hex\n\nexport const ETH_ZERO_ADDRESS: EthAddress = '0x0000000000000000000000000000000000000000' as const\n\nexport const toEthAddress = (value: bigint | string | AccountInstance): EthAddress => {\n const address = (typeof value === 'object') ? value.address : value\n return getAddress(toHex(address, { prefix: true, bitLength: 160 })) as EthAddress\n}\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 { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\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\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,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;AACpE,IAAM,6BAA6B,gBAAgB,eAAe,kBAAkB;AAE3F,IAAM,uBAAuB,CAAC,QAAgB;AAC5C,SAAQ,OAAO,UAAU,GAAG,KAAK,OAAO,IAAK,MAAM;AACrD;;;AC7BA,SAAS,oBAAoB;AAOtB,IAAM,UAAU,CAAC,UAAwC;AAC9D,SAAQ,MAAqB,SAAS;AACxC;AASO,IAAM,eAAe,CAAwB,UAAiD;AACnG,SAAO,aAAa,KAAK,KAAK,MAAM,QAAS,MAAsC,MAAM;AAC3F;AAEO,IAAM,eAAe,CAAwB,UAAoD;AACtG,SAAO,aAAa,KAAK,I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,CAAC;AACpE;;;ACxBA,SAAS,yBAAAG,8BAA6B;AAE/B,IAAM,sBAAsB;AAmB5B,IAAM,kBAAkBA,uBAAqC,mBAAmB;;;ACpBvF,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,mCAAmC;AAYzC,IAAM,+BAA+BA,uBAAkD,gCAAgC;;;ACf9H,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,gCAAgC;AAgBtC,IAAM,4BAA4BA,uBAA+C,6BAA6B;;;ACjBrH,SAAS,mBAAAC,wBAAuB;AAEhC,SAAS,yBAAAC,wBAAuB,iBAAAC,sBAAqB;AAiB9C,IAAM,kCAAkC;AAWxC,IAAM,8BAA8B,CAAkC,YAA+D;AAC1I,SAAOD,uBAAoD,+BAA+B,EAAE,OAAO;AACrG;AACO,IAAM,8BAA8BD,iBAAgB,OAA6C,2BAA2B;AAE5H,IAAM,6CACX,CAAkC,UAClC,4BAA+B,KAAK,KAAKE,eAAc,KAAK;AAEvD,IAAM,6CACXF,iBAAgB,OAAmD,0CAA0C;AAExG,IAAM,qDACXA,iBAAgB,eAA2D,0CAA0C;;;AC7ChH,IAAM,YAAY,CAAC,IAAI,KAAK,MAAM,OAAQ,QAAS,SAAW,QAAU;","names":["AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","isPayloadOfSchemaType","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/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/BlockNumber.ts","../../src/ethereum.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts","../../src/Steps.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 '../../BlockDuration.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)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(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)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(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: 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)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\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 { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../BlockDuration.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 isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { 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 isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\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 * The chain id\n */\n chain?: 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)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<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)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Hex } from '@xylabs/hex'\nimport { toHex } from '@xylabs/hex'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { getAddress } from 'ethers'\nimport { parseUnits } from 'ethers/utils'\n\nexport interface GasConfig {\n gasLimit?: number\n gasPrice?: bigint\n}\n\nexport const getDefaultGasConfig = (): GasConfig => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport type EthAddress = Hex\n\nexport const ETH_ZERO_ADDRESS: EthAddress = '0x0000000000000000000000000000000000000000' as const\n\nexport const toEthAddress = (value: bigint | string | AccountInstance): EthAddress => {\n const address = (typeof value === 'object') ? value.address : value\n return getAddress(toHex(address, { prefix: true, bitLength: 160 })) as EthAddress\n}\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 { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\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\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,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;AACpE,IAAM,6BAA6B,gBAAgB,eAAe,kBAAkB;AAE3F,IAAM,uBAAuB,CAAC,QAAgB;AAC5C,SAAQ,OAAO,UAAU,GAAG,KAAK,OAAO,IAAK,MAAM;AACrD;;;AC7BA,SAAS,oBAAoB;AAOtB,IAAM,UAAU,CAAC,UAAwC;AAC9D,SAAQ,MAAqB,SAAS;AACxC;AASO,IAAM,eAAe,CAAwB,UAAiD;AACnG,SAAO,aAAa,KAAK,KAAK,MAAM,QAAS,MAAsC,MAAM;AAC3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chemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
@@ -0,0 +1,37 @@
1
+ import type { Hex } from '@xylabs/hex';
2
+ import type { Payload, WithSources } from '@xyo-network/payload-model';
3
+ export declare const BlockNumberSchema: "network.xyo.chain.block.number";
4
+ export type BlockNumberSchema = typeof BlockNumberSchema;
5
+ export interface BlockNumberFields {
6
+ /**
7
+ * The block number
8
+ */
9
+ block: Hex;
10
+ /**
11
+ * The chain id
12
+ */
13
+ chain?: Hex;
14
+ }
15
+ /**
16
+ * The number of a block
17
+ */
18
+ export type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>;
19
+ /**
20
+ * Identity function for determining if an object is a BlockNumber
21
+ */
22
+ export declare const isBlockNumber: (x?: unknown | null) => x is BlockNumber;
23
+ export declare const asBlockNumber: {
24
+ <TType extends BlockNumber>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
25
+ <TType extends BlockNumber>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<BlockNumber>, config?: import("@xylabs/object").TypeCheckConfig): TType;
26
+ };
27
+ export declare const asOptionalBlockNumber: <TType extends BlockNumber>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
28
+ /**
29
+ * Identity function for determining if an object is a BlockNumber with sources
30
+ */
31
+ export declare const isBlockNumberWithSources: (x?: unknown | null) => x is WithSources<BlockNumber>;
32
+ export declare const asBlockNumberWithSources: {
33
+ <TType extends WithSources<BlockNumber>>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
34
+ <TType extends WithSources<BlockNumber>>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<BlockNumber>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
35
+ };
36
+ export declare const asOptionalBlockNumberWithSources: <TType extends WithSources<BlockNumber>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
37
+ //# sourceMappingURL=BlockNumber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockNumber.d.ts","sourceRoot":"","sources":["../../src/BlockNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAMtE,eAAO,MAAM,iBAAiB,EAAG,gCAAyC,CAAA;AAC1E,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAExD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,EAAE,GAAG,CAAA;IACV;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAA;CACZ;AACD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,aAAa,0CAAwD,CAAA;AAClF,eAAO,MAAM,aAAa;;;CAAqD,CAAA;AAC/E,eAAO,MAAM,qBAAqB,kGAA6D,CAAA;AAE/F;;GAEG;AACH,eAAO,MAAM,wBAAwB,uDAAmE,CAAA;AACxG,eAAO,MAAM,wBAAwB;;;CAA6E,CAAA;AAClH,eAAO,MAAM,gCAAgC,+GAAqF,CAAA"}
@@ -2,10 +2,10 @@ import type { BaseParams } from '@xylabs/base';
2
2
  import type { BaseEmitter } from '@xylabs/events';
3
3
  import type { Hash } from '@xylabs/hex';
4
4
  import type { ArchivistInstance } from '@xyo-network/archivist-model';
5
- import type { BlockBoundWitness } from '#block';
6
- import type { IterableRepository, ReadRepository } from '#repository';
7
- import type { BaseServiceParams, ChainIdentification } from '#services';
5
+ import type { BlockBoundWitness } from './block/index.ts';
8
6
  import type { ChainIteratorEventData } from './ChainIteratorEventData.ts';
7
+ import type { IterableRepository, ReadRepository } from './repository/index.ts';
8
+ import type { BaseServiceParams, ChainIdentification } from './services/index.ts';
9
9
  export interface ChainIterator<TKey, THead> extends ReadRepository<TKey, BlockBoundWitness>, IterableRepository<TKey, BlockBoundWitness> {
10
10
  chainIdentification: ChainIdentification;
11
11
  head(): Promise<THead>;
@@ -1 +1 @@
1
- {"version":3,"file":"ChainIterator.d.ts","sourceRoot":"","sources":["../../src/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,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAEvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEzE,MAAM,WAAW,aAAa,CAAC,IAAI,EAAE,KAAK,CAAE,SAAQ,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACtI,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,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,OAA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AAE,SAAQ,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACtI,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,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;AAExF,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,cAAc,EAAE,iBAAiB,CAAA;IACjC,IAAI,EAAE,iBAAiB,CAAA;CACxB"}
@@ -1,5 +1,5 @@
1
1
  import type { EventData } from '@xylabs/events';
2
- import type { BlockBoundWitness } from '#block';
2
+ import type { BlockBoundWitness } from './block/index.ts';
3
3
  export type HeadEventArgs = {
4
4
  blocks: [BlockBoundWitness];
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ChainIteratorEventData.d.ts","sourceRoot":"","sources":["../../src/ChainIteratorEventData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAE/C,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
+ {"version":3,"file":"ChainIteratorEventData.d.ts","sourceRoot":"","sources":["../../src/ChainIteratorEventData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,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,7 +1,7 @@
1
1
  import type { Schema, WithStorageMeta } from '@xyo-network/payload-model';
2
2
  import type { SchemaPayload } from '@xyo-network/schema-payload-plugin';
3
- import type { ChainStakeIntent, HashPayload, Transfer } from '#payload';
4
- import { type TransactionBoundWitness } from '#transaction';
3
+ import type { ChainStakeIntent, HashPayload, Transfer } from '../payload/index.ts';
4
+ import { type TransactionBoundWitness } from '../transaction/index.ts';
5
5
  export type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload;
6
6
  export declare const AllowedBlockPayloadSchemas: Schema[];
7
7
  export type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number];
@@ -1 +1 @@
1
- {"version":3,"file":"AllowedBlockPayload.d.ts","sourceRoot":"","sources":["../../../src/block/AllowedBlockPayload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAGvE,OAAO,KAAK,EACV,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EACxC,MAAM,UAAU,CAAA;AAIjB,OAAO,EAA6B,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,gBAAgB,GAAG,aAAa,GAAG,uBAAuB,GAAG,WAAW,CAAA;AACrH,eAAO,MAAM,0BAA0B,EAAE,MAAM,EAA2F,CAAA;AAC1I,MAAM,MAAM,yBAAyB,GAAG,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAA;AAEjF,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,yBAErE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,mBAE/D,CAAA;AAED,eAAO,MAAM,wCAAwC,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,eAAe,CAAC,mBAAmB,CAErH,CAAA"}
1
+ {"version":3,"file":"AllowedBlockPayload.d.ts","sourceRoot":"","sources":["../../../src/block/AllowedBlockPayload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAGvE,OAAO,KAAK,EACV,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EACxC,MAAM,qBAAqB,CAAA;AAI5B,OAAO,EAA6B,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEjG,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,gBAAgB,GAAG,aAAa,GAAG,uBAAuB,GAAG,WAAW,CAAA;AACrH,eAAO,MAAM,0BAA0B,EAAE,MAAM,EAA2F,CAAA;AAC1I,MAAM,MAAM,yBAAyB,GAAG,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAA;AAEjF,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,yBAErE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,mBAE/D,CAAA;AAED,eAAO,MAAM,wCAAwC,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,eAAe,CAAC,mBAAmB,CAErH,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { Promisable } from '@xylabs/promise';
2
2
  import type { Payload } from '@xyo-network/payload-model';
3
- import type { HydratedBlock } from '#block';
3
+ import type { HydratedBlock } from '../block/index.ts';
4
4
  export interface ChainAnalyzer<T extends Payload = Payload> {
5
5
  onBlock(block: HydratedBlock): Promisable<boolean>;
6
6
  result(): T;
@@ -1 +1 @@
1
- {"version":3,"file":"ChainAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/chain/ChainAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAE3C,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IACxD,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAClD,MAAM,IAAI,CAAC,CAAA;IACX,cAAc,IAAI,OAAO,CAAA;CAC1B"}
1
+ {"version":3,"file":"ChainAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/chain/ChainAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IACxD,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAClD,MAAM,IAAI,CAAC,CAAA;IACX,cAAc,IAAI,OAAO,CAAA;CAC1B"}
@@ -1,6 +1,7 @@
1
1
  export * from './Addressable.ts';
2
2
  export * from './block/index.ts';
3
3
  export * from './BlockDuration.ts';
4
+ export * from './BlockNumber.ts';
4
5
  export * from './chain/index.ts';
5
6
  export * from './ChainIterator.ts';
6
7
  export * from './ChainIteratorEventData.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,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,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,YAAY,CAAA;AAC1B,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,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,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,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,YAAY,CAAA;AAC1B,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { Promisable } from '@xylabs/promise';
2
- import type { NetworkStatus } from '#network';
2
+ import type { NetworkStatus } from '../../network/index.ts';
3
3
  export interface XyoNetwork {
4
4
  status(): Promisable<NetworkStatus>;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"XyoNetwork.d.ts","sourceRoot":"","sources":["../../../../src/provider/v1/XyoNetwork.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,MAAM,WAAW,UAAU;IACzB,MAAM,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;CACpC"}
1
+ {"version":3,"file":"XyoNetwork.d.ts","sourceRoot":"","sources":["../../../../src/provider/v1/XyoNetwork.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,MAAM,WAAW,UAAU;IACzB,MAAM,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;CACpC"}
@@ -1,8 +1,8 @@
1
1
  import type { Address } from '@xylabs/hex';
2
2
  import type { Signed } from '@xyo-network/boundwitness-model';
3
3
  import type { Payload } from '@xyo-network/payload-model';
4
- import type { AllowedBlockPayload } from '#block';
5
- import type { TransactionBoundWitness, TransactionFeesBigInt } from '#transaction';
4
+ import type { AllowedBlockPayload } from '../../block/index.ts';
5
+ import type { TransactionBoundWitness, TransactionFeesBigInt } from '../../transaction/index.ts';
6
6
  import type { XyoDataLakeProvider } from './XyoDataLake.ts';
7
7
  import type { XyoNetwork } from './XyoNetwork.ts';
8
8
  import type { XyoRunner } from './XyoRunner.ts';
@@ -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,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,IAAI,CAAC,EAAE,CACL,gBAAgB,EAAE,mBAAmB,EAAE,EACvC,kBAAkB,EAAE,OAAO,EAAE,EAC7B,KAAK,CAAC,EAAE,OAAO,EACf,GAAG,CAAC,EAAE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O,EAAE,EAC7B,KAAK,CAAC,EAAE,OAAO,EACf,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,qBAAqB,KACzB,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAA;IAC7C,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB"}
@@ -1,6 +1,6 @@
1
1
  import type { Hash } from '@xylabs/hex';
2
2
  import type { Promisable } from '@xylabs/promise';
3
- import type { SignedHydratedTransaction } from '#transaction';
3
+ import type { SignedHydratedTransaction } from '../../transaction/index.ts';
4
4
  export interface XyoRunner {
5
5
  broadcastTransaction(transaction: SignedHydratedTransaction): Promisable<Hash>;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"XyoRunner.d.ts","sourceRoot":"","sources":["../../../../src/provider/v1/XyoRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAE7D,MAAM,WAAW,SAAS;IACxB,oBAAoB,CAAC,WAAW,EAAE,yBAAyB,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;CAC/E"}
1
+ {"version":3,"file":"XyoRunner.d.ts","sourceRoot":"","sources":["../../../../src/provider/v1/XyoRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,WAAW,SAAS;IACxB,oBAAoB,CAAC,WAAW,EAAE,yBAAyB,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;CAC/E"}