@xyo-network/xl1-protocol 1.3.19 → 1.3.21

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 (158) hide show
  1. package/dist/neutral/index.mjs +29 -61
  2. package/dist/neutral/index.mjs.map +1 -1
  3. package/dist/node/index.mjs +29 -61
  4. package/dist/node/index.mjs.map +1 -1
  5. package/dist/types/BlockDuration.d.ts.map +1 -0
  6. package/dist/types/ChainIterator.d.ts +3 -3
  7. package/dist/types/ChainIterator.d.ts.map +1 -1
  8. package/dist/types/ChainIteratorEventData.d.ts +1 -1
  9. package/dist/types/ChainIteratorEventData.d.ts.map +1 -1
  10. package/dist/types/ChainReference.d.ts.map +1 -0
  11. package/dist/types/Initializable.d.ts.map +1 -0
  12. package/dist/types/Steps.d.ts.map +1 -0
  13. package/dist/types/{protocol → block}/AllowedBlockPayload.d.ts +2 -2
  14. package/dist/types/block/AllowedBlockPayload.d.ts.map +1 -0
  15. package/dist/types/block/BlockBoundWitness.d.ts.map +1 -0
  16. package/dist/types/block/HydratedBlock.d.ts.map +1 -0
  17. package/dist/types/block/index.d.ts +4 -0
  18. package/dist/types/block/index.d.ts.map +1 -0
  19. package/dist/types/{protocol → chain}/ChainAnalyzer.d.ts +1 -1
  20. package/dist/types/chain/ChainAnalyzer.d.ts.map +1 -0
  21. package/dist/types/chain/index.d.ts +1 -2
  22. package/dist/types/chain/index.d.ts.map +1 -1
  23. package/dist/types/index.d.ts +9 -7
  24. package/dist/types/index.d.ts.map +1 -1
  25. package/dist/types/payload/elevatable/ChainStakeIntent.d.ts +1 -1
  26. package/dist/types/payload/elevatable/ChainStakeIntent.d.ts.map +1 -1
  27. package/dist/types/provider/v1/XyoNetwork.d.ts +1 -1
  28. package/dist/types/provider/v1/XyoNetwork.d.ts.map +1 -1
  29. package/dist/types/provider/v1/XyoProvider.d.ts +2 -1
  30. package/dist/types/provider/v1/XyoProvider.d.ts.map +1 -1
  31. package/dist/types/provider/v1/XyoRunner.d.ts +1 -1
  32. package/dist/types/provider/v1/XyoRunner.d.ts.map +1 -1
  33. package/dist/types/provider/v1/XyoSigner.d.ts +2 -1
  34. package/dist/types/provider/v1/XyoSigner.d.ts.map +1 -1
  35. package/dist/types/provider/v1/XyoViewer.d.ts +4 -3
  36. package/dist/types/provider/v1/XyoViewer.d.ts.map +1 -1
  37. package/dist/types/provider/v2/viewer/Account.d.ts +1 -1
  38. package/dist/types/provider/v2/viewer/Account.d.ts.map +1 -1
  39. package/dist/types/provider/v2/viewer/Block.d.ts +1 -1
  40. package/dist/types/provider/v2/viewer/Block.d.ts.map +1 -1
  41. package/dist/types/provider/v2/viewer/Chain.d.ts +1 -1
  42. package/dist/types/provider/v2/viewer/Chain.d.ts.map +1 -1
  43. package/dist/types/provider/v2/viewer/Transaction.d.ts +1 -1
  44. package/dist/types/provider/v2/viewer/Transaction.d.ts.map +1 -1
  45. package/dist/types/provider/v2/viewer/Xyo.d.ts +1 -1
  46. package/dist/types/provider/v2/viewer/Xyo.d.ts.map +1 -1
  47. package/dist/types/repository/TransactionReadRepository.d.ts +1 -1
  48. package/dist/types/repository/TransactionReadRepository.d.ts.map +1 -1
  49. package/dist/types/repository/TransactionRepositoryIterator.d.ts +1 -1
  50. package/dist/types/repository/TransactionRepositoryIterator.d.ts.map +1 -1
  51. package/dist/types/repository/TransactionWriteRepository.d.ts +1 -1
  52. package/dist/types/repository/TransactionWriteRepository.d.ts.map +1 -1
  53. package/dist/types/services/BlockProducer.d.ts +2 -2
  54. package/dist/types/services/BlockProducer.d.ts.map +1 -1
  55. package/dist/types/{chain → services}/ChainServiceCollection.d.ts +6 -1
  56. package/dist/types/services/ChainServiceCollection.d.ts.map +1 -0
  57. package/dist/types/services/Election.d.ts +1 -1
  58. package/dist/types/services/Election.d.ts.map +1 -1
  59. package/dist/types/services/PendingTransactionsService.d.ts +1 -1
  60. package/dist/types/services/PendingTransactionsService.d.ts.map +1 -1
  61. package/dist/types/services/index.d.ts +1 -0
  62. package/dist/types/services/index.d.ts.map +1 -1
  63. package/dist/types/services/stakeIntent/StakeIntentService.d.ts +1 -1
  64. package/dist/types/services/stakeIntent/StakeIntentService.d.ts.map +1 -1
  65. package/dist/types/transaction/HydratedTransaction.d.ts.map +1 -0
  66. package/dist/types/{protocol → transaction}/TransactionBoundWitness.d.ts +2 -2
  67. package/dist/types/transaction/TransactionBoundWitness.d.ts.map +1 -0
  68. package/dist/types/transaction/TransactionFeesFields.d.ts.map +1 -0
  69. package/dist/types/transaction/index.d.ts +4 -0
  70. package/dist/types/transaction/index.d.ts.map +1 -0
  71. package/dist/types/validation/block/BlockValidationFunction.d.ts +1 -1
  72. package/dist/types/validation/block/BlockValidationFunction.d.ts.map +1 -1
  73. package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts +1 -1
  74. package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -1
  75. package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts +1 -1
  76. package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -1
  77. package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts +1 -1
  78. package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts.map +1 -1
  79. package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts +1 -1
  80. package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts.map +1 -1
  81. package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts +1 -2
  82. package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts.map +1 -1
  83. package/eslint.config.mjs +6 -2
  84. package/knip.config.ts +1 -1
  85. package/package.json +1 -4
  86. package/src/ChainIterator.ts +4 -3
  87. package/src/ChainIteratorEventData.ts +1 -1
  88. package/src/{protocol → block}/AllowedBlockPayload.ts +3 -3
  89. package/src/block/index.ts +3 -0
  90. package/src/{protocol → chain}/ChainAnalyzer.ts +1 -1
  91. package/src/chain/index.ts +1 -2
  92. package/src/index.ts +9 -7
  93. package/src/payload/elevatable/ChainStakeIntent.ts +1 -1
  94. package/src/provider/v1/XyoNetwork.ts +1 -1
  95. package/src/provider/v1/XyoProvider.ts +3 -3
  96. package/src/provider/v1/XyoRunner.ts +1 -1
  97. package/src/provider/v1/XyoSigner.ts +2 -3
  98. package/src/provider/v1/XyoViewer.ts +4 -3
  99. package/src/provider/v2/viewer/Account.ts +1 -1
  100. package/src/provider/v2/viewer/Block.ts +2 -1
  101. package/src/provider/v2/viewer/Chain.ts +2 -1
  102. package/src/provider/v2/viewer/Transaction.ts +2 -1
  103. package/src/provider/v2/viewer/Xyo.ts +1 -1
  104. package/src/repository/TransactionReadRepository.ts +2 -1
  105. package/src/repository/TransactionRepositoryIterator.ts +2 -1
  106. package/src/repository/TransactionWriteRepository.ts +2 -1
  107. package/src/services/BlockProducer.ts +3 -2
  108. package/src/{chain → services}/ChainServiceCollection.ts +7 -4
  109. package/src/services/Election.ts +2 -1
  110. package/src/services/PendingTransactionsService.ts +2 -1
  111. package/src/services/index.ts +1 -0
  112. package/src/services/stakeIntent/StakeIntentService.ts +1 -1
  113. package/src/{protocol → transaction}/TransactionBoundWitness.ts +3 -2
  114. package/src/transaction/index.ts +3 -0
  115. package/src/validation/block/BlockValidationFunction.ts +1 -1
  116. package/src/validation/block/HydratedBlockStateValidationFunction.ts +1 -1
  117. package/src/validation/block/HydratedBlockValidationFunction.ts +1 -1
  118. package/src/validation/payload/InBlockPayloadValidationFunction.ts +1 -1
  119. package/src/validation/transaction/HydratedTransactionStateValidationFunction.ts +1 -1
  120. package/src/validation/transaction/HydratedTransactionValidationFunction.ts +3 -2
  121. package/dist/types/chain/ChainServiceCollection.d.ts.map +0 -1
  122. package/dist/types/chain/Initializable.d.ts.map +0 -1
  123. package/dist/types/protocol/AllowedBlockPayload.d.ts.map +0 -1
  124. package/dist/types/protocol/BlockBoundWitness.d.ts.map +0 -1
  125. package/dist/types/protocol/BlockDuration.d.ts.map +0 -1
  126. package/dist/types/protocol/BlockNumber.d.ts +0 -37
  127. package/dist/types/protocol/BlockNumber.d.ts.map +0 -1
  128. package/dist/types/protocol/ChainAnalyzer.d.ts.map +0 -1
  129. package/dist/types/protocol/ChainReference.d.ts.map +0 -1
  130. package/dist/types/protocol/HydratedBlock.d.ts.map +0 -1
  131. package/dist/types/protocol/HydratedTransaction.d.ts.map +0 -1
  132. package/dist/types/protocol/Issuer.d.ts +0 -5
  133. package/dist/types/protocol/Issuer.d.ts.map +0 -1
  134. package/dist/types/protocol/Steps.d.ts.map +0 -1
  135. package/dist/types/protocol/TransactionBoundWitness.d.ts.map +0 -1
  136. package/dist/types/protocol/TransactionFeesFields.d.ts.map +0 -1
  137. package/dist/types/protocol/index.d.ts +0 -13
  138. package/dist/types/protocol/index.d.ts.map +0 -1
  139. package/knip.log +0 -491
  140. package/src/protocol/BlockNumber.ts +0 -39
  141. package/src/protocol/Issuer.ts +0 -5
  142. package/src/protocol/index.ts +0 -12
  143. /package/dist/types/{protocol/BlockDuration.d.ts → BlockDuration.d.ts} +0 -0
  144. /package/dist/types/{protocol/ChainReference.d.ts → ChainReference.d.ts} +0 -0
  145. /package/dist/types/{chain/Initializable.d.ts → Initializable.d.ts} +0 -0
  146. /package/dist/types/{protocol/Steps.d.ts → Steps.d.ts} +0 -0
  147. /package/dist/types/{protocol → block}/BlockBoundWitness.d.ts +0 -0
  148. /package/dist/types/{protocol → block}/HydratedBlock.d.ts +0 -0
  149. /package/dist/types/{protocol → transaction}/HydratedTransaction.d.ts +0 -0
  150. /package/dist/types/{protocol → transaction}/TransactionFeesFields.d.ts +0 -0
  151. /package/src/{protocol/BlockDuration.ts → BlockDuration.ts} +0 -0
  152. /package/src/{protocol/ChainReference.ts → ChainReference.ts} +0 -0
  153. /package/src/{chain/Initializable.ts → Initializable.ts} +0 -0
  154. /package/src/{protocol/Steps.ts → Steps.ts} +0 -0
  155. /package/src/{protocol → block}/BlockBoundWitness.ts +0 -0
  156. /package/src/{protocol → block}/HydratedBlock.ts +0 -0
  157. /package/src/{protocol → transaction}/HydratedTransaction.ts +0 -0
  158. /package/src/{protocol → transaction}/TransactionFeesFields.ts +0 -0
@@ -25,6 +25,22 @@ import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
25
25
  var NetworkStatusSchema = "network.xyo.chain.status";
26
26
  var isNetworkStatus = isPayloadOfSchemaType(NetworkStatusSchema);
27
27
 
28
+ // src/Steps.ts
29
+ var StepSizes = [
30
+ 10,
31
+ 105,
32
+ 1103,
33
+ 11576,
34
+ 121551,
35
+ 1276282,
36
+ 13400956
37
+ ];
38
+
39
+ // src/block/AllowedBlockPayload.ts
40
+ import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
41
+ import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
42
+ import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
43
+
28
44
  // src/payload/elevatable/ChainStakeIntent.ts
29
45
  import { AsObjectFactory } from "@xylabs/object";
30
46
  import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
@@ -67,12 +83,7 @@ var isTransfer = isPayloadOfSchemaType4(TransferSchema);
67
83
  var asTransfer = AsObjectFactory3.create(isTransfer);
68
84
  var asOptionalTransfer = AsObjectFactory3.createOptional(isTransfer);
69
85
 
70
- // src/protocol/AllowedBlockPayload.ts
71
- import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
72
- import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
73
- import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
74
-
75
- // src/protocol/TransactionBoundWitness.ts
86
+ // src/transaction/TransactionBoundWitness.ts
76
87
  import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
77
88
  import { isBoundWitness } from "@xyo-network/boundwitness-model";
78
89
  import { isStorageMeta } from "@xyo-network/payload-model";
@@ -80,18 +91,13 @@ var isTransactionBoundWitness = /* @__PURE__ */ __name((value) => {
80
91
  const typedObj = value;
81
92
  return isBoundWitness(value) && typedObj.chain !== void 0 && typedObj.fees !== void 0 && typedObj.exp !== void 0 && typedObj.nbf !== void 0;
82
93
  }, "isTransactionBoundWitness");
83
- var isSignedTransactionBoundWitness = /* @__PURE__ */ __name((value) => {
84
- return isTransactionBoundWitness(value) && isSigned(value);
85
- }, "isSignedTransactionBoundWitness");
86
- var isSigned = /* @__PURE__ */ __name((value) => isBoundWitness(value) && value.$signatures.length === value.addresses.length && value.addresses.length > 0, "isSigned");
87
94
  var isTransactionBoundWitnessWithStorageMeta = /* @__PURE__ */ __name((value) => isTransactionBoundWitness(value) && isStorageMeta(value), "isTransactionBoundWitnessWithStorageMeta");
88
- var isSignedTransactionBoundWitnessWithStorageMeta = /* @__PURE__ */ __name((value) => isSignedTransactionBoundWitness(value) && isStorageMeta(value), "isSignedTransactionBoundWitnessWithStorageMeta");
89
95
  var asTransactionBoundWitness = AsObjectFactory4.create(isTransactionBoundWitness);
90
96
  var asOptionalTransactionBoundWitness = AsObjectFactory4.createOptional(isTransactionBoundWitness);
91
97
  var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.create(isTransactionBoundWitnessWithStorageMeta);
92
98
  var asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.createOptional(isTransactionBoundWitnessWithStorageMeta);
93
99
 
94
- // src/protocol/AllowedBlockPayload.ts
100
+ // src/block/AllowedBlockPayload.ts
95
101
  var AllowedBlockPayloadSchemas = [
96
102
  TransferSchema,
97
103
  ChainStakeIntentSchema,
@@ -109,7 +115,7 @@ var isAllowedBlockPayloadWithHashStorageMeta = /* @__PURE__ */ __name((value) =>
109
115
  return isAllowedBlockPayload(value) && isHashStorageMeta(value);
110
116
  }, "isAllowedBlockPayloadWithHashStorageMeta");
111
117
 
112
- // src/protocol/BlockBoundWitness.ts
118
+ // src/block/BlockBoundWitness.ts
113
119
  import { isHex } from "@xylabs/hex";
114
120
  import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
115
121
  import { isBoundWitness as isBoundWitness2 } from "@xyo-network/boundwitness-model";
@@ -126,52 +132,29 @@ var asOptionalBlockBoundWitness = AsObjectFactory5.createOptional(isBlockBoundWi
126
132
  var asBlockBoundWitnessWithStorageMeta = AsObjectFactory5.create(isBlockBoundWitnessWithStorageMeta);
127
133
  var asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory5.createOptional(isBlockBoundWitnessWithStorageMeta);
128
134
 
129
- // src/protocol/BlockNumber.ts
130
- import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
131
- import { isPayloadOfSchemaType as isPayloadOfSchemaType5, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
132
- var BlockNumberSchema = "network.xyo.chain.block.number";
133
- var isBlockNumber = isPayloadOfSchemaType5(BlockNumberSchema);
134
- var asBlockNumber = AsObjectFactory6.create(isBlockNumber);
135
- var asOptionalBlockNumber = AsObjectFactory6.createOptional(isBlockNumber);
136
- var isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources(BlockNumberSchema);
137
- var asBlockNumberWithSources = AsObjectFactory6.create(isBlockNumberWithSources);
138
- var asOptionalBlockNumberWithSources = AsObjectFactory6.createOptional(isBlockNumberWithSources);
139
-
140
- // src/protocol/Steps.ts
141
- var StepSizes = [
142
- 10,
143
- 105,
144
- 1103,
145
- 11576,
146
- 121551,
147
- 1276282,
148
- 13400956
149
- ];
150
-
151
135
  // src/services/Chain/ChainIdentification.ts
152
- import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
136
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
153
137
  var ChainIdentificationPayloadSchema = "network.xyo.chain.identification";
154
- var isChainIdentificationPayload = isPayloadOfSchemaType6(ChainIdentificationPayloadSchema);
138
+ var isChainIdentificationPayload = isPayloadOfSchemaType5(ChainIdentificationPayloadSchema);
155
139
 
156
140
  // src/services/Chain/ChainInformation.ts
157
- import { isPayloadOfSchemaType as isPayloadOfSchemaType7 } from "@xyo-network/payload-model";
141
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
158
142
  var ChainInformationPayloadSchema = "network.xyo.chain.information";
159
- var isChainInformationPayload = isPayloadOfSchemaType7(ChainInformationPayloadSchema);
143
+ var isChainInformationPayload = isPayloadOfSchemaType6(ChainInformationPayloadSchema);
160
144
 
161
145
  // src/services/stakeIntent/ChainIndexingServiceStateSchema.ts
162
- import { AsObjectFactory as AsObjectFactory7 } from "@xylabs/object";
163
- import { isPayloadOfSchemaType as isPayloadOfSchemaType8, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
146
+ import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
147
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType7, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
164
148
  var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
165
149
  var isChainIndexingServiceState = /* @__PURE__ */ __name((payload) => {
166
- return isPayloadOfSchemaType8(ChainIndexingServiceStateSchema)(payload);
150
+ return isPayloadOfSchemaType7(ChainIndexingServiceStateSchema)(payload);
167
151
  }, "isChainIndexingServiceState");
168
- var asChainIndexingServiceState = AsObjectFactory7.create(isChainIndexingServiceState);
152
+ var asChainIndexingServiceState = AsObjectFactory6.create(isChainIndexingServiceState);
169
153
  var isChainIndexingServiceStateWithStorageMeta = /* @__PURE__ */ __name((value) => isChainIndexingServiceState(value) && isStorageMeta3(value), "isChainIndexingServiceStateWithStorageMeta");
170
- var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.create(isChainIndexingServiceStateWithStorageMeta);
171
- var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.createOptional(isChainIndexingServiceStateWithStorageMeta);
154
+ var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.create(isChainIndexingServiceStateWithStorageMeta);
155
+ var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.createOptional(isChainIndexingServiceStateWithStorageMeta);
172
156
  export {
173
157
  AllowedBlockPayloadSchemas,
174
- BlockNumberSchema,
175
158
  ChainIdentificationPayloadSchema,
176
159
  ChainIndexingServiceStateSchema,
177
160
  ChainInformationPayloadSchema,
@@ -183,8 +166,6 @@ export {
183
166
  TransferSchema,
184
167
  asBlockBoundWitness,
185
168
  asBlockBoundWitnessWithStorageMeta,
186
- asBlockNumber,
187
- asBlockNumberWithSources,
188
169
  asChainIndexingServiceState,
189
170
  asChainIndexingServiceStateWithStorageMeta,
190
171
  asChainStakeIntent,
@@ -193,16 +174,10 @@ export {
193
174
  asHashPayloadWithStorageMeta,
194
175
  asOptionalBlockBoundWitness,
195
176
  asOptionalBlockBoundWitnessWithStorageMeta,
196
- asOptionalBlockNumber,
197
- asOptionalBlockNumberWithSources,
198
177
  asOptionalChainIndexingServiceStateWithStorageMeta,
199
178
  asOptionalChainStakeIntent,
200
179
  asOptionalHashPayload,
201
- asOptionalTransactionBoundWitness,
202
- asOptionalTransactionBoundWitnessWithStorageMeta,
203
180
  asOptionalTransfer,
204
- asTransactionBoundWitness,
205
- asTransactionBoundWitnessWithStorageMeta,
206
181
  asTransfer,
207
182
  getDefaultGasConfig,
208
183
  hasFrom,
@@ -211,8 +186,6 @@ export {
211
186
  isAllowedBlockPayloadWithHashStorageMeta,
212
187
  isBlockBoundWitness,
213
188
  isBlockBoundWitnessWithStorageMeta,
214
- isBlockNumber,
215
- isBlockNumberWithSources,
216
189
  isChainIdentificationPayload,
217
190
  isChainIndexingServiceState,
218
191
  isChainIndexingServiceStateWithStorageMeta,
@@ -221,11 +194,6 @@ export {
221
194
  isExecutable,
222
195
  isHashPayload,
223
196
  isNetworkStatus,
224
- isSigned,
225
- isSignedTransactionBoundWitness,
226
- isSignedTransactionBoundWitnessWithStorageMeta,
227
- isTransactionBoundWitness,
228
- isTransactionBoundWitnessWithStorageMeta,
229
197
  isTransfer,
230
198
  toEthAddress
231
199
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ethereum.ts","../../src/network/Status.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/protocol/AllowedBlockPayload.ts","../../src/protocol/TransactionBoundWitness.ts","../../src/protocol/BlockBoundWitness.ts","../../src/protocol/BlockNumber.ts","../../src/protocol/Steps.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["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 { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../protocol/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 { 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 './TransactionBoundWitness.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 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 {\n FromFields,\n OptionalExecutable,\n} from '../payload/index.ts'\nimport type { BlockDuration } from './BlockDuration.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","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\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"],"mappings":";;;;AACA,SAASA,aAAa;AAEtB,SAASC,kBAAkB;AAC3B,SAASC,kBAAkB;AAOpB,IAAMC,sBAAsB,6BAAA;AACjC,SAAO;IACLC,UAAU;IACVC,UAAUC,WAAW,OAAO,MAAA;EAC9B;AACF,GALmC;AAS5B,IAAMC,mBAA+B;AAErC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,QAAMC,UAAW,OAAOD,UAAU,WAAYA,MAAMC,UAAUD;AAC9D,SAAOE,WAAWC,MAAMF,SAAS;IAAEG,QAAQ;IAAMC,WAAW;EAAI,CAAA,CAAA;AAClE,GAH4B;;;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ACtClG,IAAMG,YAAY;EAAC;EAAI;EAAK;EAAM;EAAQ;EAAS;EAAW;;;;ACErE,SAASC,yBAAAA,8BAA6B;AAE/B,IAAMC,mCAAmC;AAYzC,IAAMC,+BAA+BF,uBAAkDC,gCAAAA;;;ACf9F,SAASE,yBAAAA,8BAA6B;AAE/B,IAAMC,gCAAgC;AAgBtC,IAAMC,4BAA4BF,uBAA+CC,6BAAAA;;;ACjBxF,SAASE,mBAAAA,wBAAuB;AAEhC,SAASC,yBAAAA,wBAAuBC,iBAAAA,sBAAqB;AAiB9C,IAAMC,kCAAkC;AAWxC,IAAMC,8BAA8B,wBAAkCC,YAAAA;AAC3E,SAAOC,uBAAoDH,+BAAAA,EAAiCE,OAAAA;AAC9F,GAF2C;AAGpC,IAAME,8BAA8BC,iBAAgBC,OAA6CL,2BAAAA;AAEjG,IAAMM,6CACX,wBAAkCC,UAClCP,4BAA+BO,KAAAA,KAAUC,eAAcD,KAAAA,GADvD;AAGK,IAAME,6CACXL,iBAAgBC,OAAmDC,0CAAAA;AAE9D,IAAMI,qDACXN,iBAAgBO,eAA2DL,0CAAAA;","names":["toHex","getAddress","parseUnits","getDefaultGasConfig","gasLimit","gasPrice","parseUnits","ETH_ZERO_ADDRESS","toEthAddress","value","address","getAddress","toHex","prefix","bitLength","isPayloadOfSchemaType","NetworkStatusSchema","isNetworkStatus","AsObjectFactory","isPayloadOfSchemaType","ChainStakeIntentSchema","isChainStakeIntent","x","isPayloadOfSchemaType","asNonNegativeInteger","nbf","undefined","exp","asChainStakeIntent","AsObjectFactory","create","asOptionalChainStakeIntent","createOptional","num","Number","isInteger","isAnyPayload","hasFrom","value","from","undefined","isExecutable","isAnyPayload","Array","isArray","script","asExecutable","AsObjectFactory","isPayloadOfSchemaType","HashSchema","isHashPayload","asHashPayload","create","asHashPayloadWithStorageMeta","asOptionalHashPayload","createOptional","AsObjectFactory","isPayloadOfSchemaType","TransferSchema","isTransfer","asTransfer","create","asOptionalTransfer","createOptional","BoundWitnessSchema","isHashStorageMeta","isSchema","isSchemaPayload","SchemaSchema","AsObjectFactory","isBoundWitness","isStorageMeta","isTransactionBoundWitness","value","typedObj","isBoundWitness","chain","undefined","fees","exp","nbf","isSignedTransactionBoundWitness","isSigned","$signatures","length","addresses","isTransactionBoundWitnessWithStorageMeta","isStorageMeta","isSignedTransactionBoundWitnessWithStorageMeta","asTransactionBoundWitness","AsObjectFactory","create","asOptionalTransactionBoundWitness","createOptional","asTransactionBoundWitnessWithStorageMeta","asOptionalTransactionBoundWitnessWithStorageMeta","AllowedBlockPayloadSchemas","TransferSchema","ChainStakeIntentSchema","SchemaSchema","BoundWitnessSchema","HashSchema","isAllowedBlockPayloadSchema","value","isSchema","includes","isAllowedBlockPayload","isTransfer","isChainStakeIntent","isSchemaPayload","isTransactionBoundWitness","isHashPayload","isAllowedBlockPayloadWithHashStorageMeta","isHashStorageMeta","isHex","AsObjectFactory","isBoundWitness","isStorageMeta","isBlockBoundWitness","value","typedObj","isBoundWitness","Number","isInteger","block","isHex","chain","isBlockBoundWitnessWithStorageMeta","isStorageMeta","asBlockBoundWitness","AsObjectFactory","create","asOptionalBlockBoundWitness","createOptional","asBlockBoundWitnessWithStorageMeta","asOptionalBlockBoundWitnessWithStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","BlockNumberSchema","isBlockNumber","asBlockNumber","create","asOptionalBlockNumber","createOptional","isBlockNumberWithSources","asBlockNumberWithSources","asOptionalBlockNumberWithSources","StepSizes","isPayloadOfSchemaType","ChainIdentificationPayloadSchema","isChainIdentificationPayload","isPayloadOfSchemaType","ChainInformationPayloadSchema","isChainInformationPayload","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta","ChainIndexingServiceStateSchema","isChainIndexingServiceState","payload","isPayloadOfSchemaType","asChainIndexingServiceState","AsObjectFactory","create","isChainIndexingServiceStateWithStorageMeta","value","isStorageMeta","asChainIndexingServiceStateWithStorageMeta","asOptionalChainIndexingServiceStateWithStorageMeta","createOptional"]}
1
+ {"version":3,"sources":["../../src/ethereum.ts","../../src/network/Status.ts","../../src/Steps.ts","../../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/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["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","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n","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 {\n FromFields,\n OptionalExecutable,\n} from '#payload'\n\nimport type { BlockDuration } from '../BlockDuration.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 { 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>>(is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,wBAAuB;AAEhC,SAASC,yBAAAA,wBAAuBC,iBAAAA,sBAAqB;AAiB9C,IAAMC,kCAAkC;AAWxC,IAAMC,8BAA8B,wBAAkCC,YAAAA;AAC3E,SAAOC,uBAAoDH,+BAAAA,EAAiCE,OAAAA;AAC9F,GAF2C;AAGpC,IAAME,8BAA8BC,iBAAgBC,OAA6CL,2BAAAA;AAEjG,IAAMM,6CACX,wBAAkCC,UAClCP,4BAA+BO,KAAAA,KAAUC,eAAcD,KAAAA,GADvD;AAGK,IAAME,6CACXL,iBAAgBC,OAAmDC,0CAAAA;AAE9D,IAAMI,qDACXN,iBAAgBO,eAA2DL,0CAAAA;","names":["toHex","getAddress","parseUnits","getDefaultGasConfig","gasLimit","gasPrice","parseUnits","ETH_ZERO_ADDRESS","toEthAddress","value","address","getAddress","toHex","prefix","bitLength","isPayloadOfSchemaType","NetworkStatusSchema","isNetworkStatus","StepSizes","BoundWitnessSchema","isHashStorageMeta","isSchema","isSchemaPayload","SchemaSchema","AsObjectFactory","isPayloadOfSchemaType","ChainStakeIntentSchema","isChainStakeIntent","x","isPayloadOfSchemaType","asNonNegativeInteger","nbf","undefined","exp","asChainStakeIntent","AsObjectFactory","create","asOptionalChainStakeIntent","createOptional","num","Number","isInteger","isAnyPayload","hasFrom","value","from","undefined","isExecutable","isAnyPayload","Array","isArray","script","asExecutable","AsObjectFactory","isPayloadOfSchemaType","HashSchema","isHashPayload","asHashPayload","create","asHashPayloadWithStorageMeta","asOptionalHashPayload","createOptional","AsObjectFactory","isPayloadOfSchemaType","TransferSchema","isTransfer","asTransfer","create","asOptionalTransfer","createOptional","AsObjectFactory","isBoundWitness","isStorageMeta","isTransactionBoundWitness","value","typedObj","isBoundWitness","chain","undefined","fees","exp","nbf","isTransactionBoundWitnessWithStorageMeta","value","isTransactionBoundWitness","isStorageMeta","asTransactionBoundWitness","AsObjectFactory","create","isTransactionBoundWitness","asOptionalTransactionBoundWitness","createOptional","asTransactionBoundWitnessWithStorageMeta","isTransactionBoundWitnessWithStorageMeta","asOptionalTransactionBoundWitnessWithStorageMeta","AllowedBlockPayloadSchemas","TransferSchema","ChainStakeIntentSchema","SchemaSchema","BoundWitnessSchema","HashSchema","isAllowedBlockPayloadSchema","value","isSchema","includes","isAllowedBlockPayload","isTransfer","isChainStakeIntent","isSchemaPayload","isTransactionBoundWitness","isHashPayload","isAllowedBlockPayloadWithHashStorageMeta","isHashStorageMeta","isHex","AsObjectFactory","isBoundWitness","isStorageMeta","isBlockBoundWitness","value","typedObj","isBoundWitness","Number","isInteger","block","isHex","chain","isBlockBoundWitnessWithStorageMeta","isStorageMeta","asBlockBoundWitness","AsObjectFactory","create","asOptionalBlockBoundWitness","createOptional","asBlockBoundWitnessWithStorageMeta","asOptionalBlockBoundWitnessWithStorageMeta","isPayloadOfSchemaType","ChainIdentificationPayloadSchema","isChainIdentificationPayload","isPayloadOfSchemaType","ChainInformationPayloadSchema","isChainInformationPayload","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta","ChainIndexingServiceStateSchema","isChainIndexingServiceState","payload","isPayloadOfSchemaType","asChainIndexingServiceState","AsObjectFactory","create","isChainIndexingServiceStateWithStorageMeta","value","isStorageMeta","asChainIndexingServiceStateWithStorageMeta","asOptionalChainIndexingServiceStateWithStorageMeta","createOptional"]}
@@ -25,6 +25,22 @@ import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
25
25
  var NetworkStatusSchema = "network.xyo.chain.status";
26
26
  var isNetworkStatus = isPayloadOfSchemaType(NetworkStatusSchema);
27
27
 
28
+ // src/Steps.ts
29
+ var StepSizes = [
30
+ 10,
31
+ 105,
32
+ 1103,
33
+ 11576,
34
+ 121551,
35
+ 1276282,
36
+ 13400956
37
+ ];
38
+
39
+ // src/block/AllowedBlockPayload.ts
40
+ import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
41
+ import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
42
+ import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
43
+
28
44
  // src/payload/elevatable/ChainStakeIntent.ts
29
45
  import { AsObjectFactory } from "@xylabs/object";
30
46
  import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
@@ -67,12 +83,7 @@ var isTransfer = isPayloadOfSchemaType4(TransferSchema);
67
83
  var asTransfer = AsObjectFactory3.create(isTransfer);
68
84
  var asOptionalTransfer = AsObjectFactory3.createOptional(isTransfer);
69
85
 
70
- // src/protocol/AllowedBlockPayload.ts
71
- import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
72
- import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
73
- import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
74
-
75
- // src/protocol/TransactionBoundWitness.ts
86
+ // src/transaction/TransactionBoundWitness.ts
76
87
  import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
77
88
  import { isBoundWitness } from "@xyo-network/boundwitness-model";
78
89
  import { isStorageMeta } from "@xyo-network/payload-model";
@@ -80,18 +91,13 @@ var isTransactionBoundWitness = /* @__PURE__ */ __name((value) => {
80
91
  const typedObj = value;
81
92
  return isBoundWitness(value) && typedObj.chain !== void 0 && typedObj.fees !== void 0 && typedObj.exp !== void 0 && typedObj.nbf !== void 0;
82
93
  }, "isTransactionBoundWitness");
83
- var isSignedTransactionBoundWitness = /* @__PURE__ */ __name((value) => {
84
- return isTransactionBoundWitness(value) && isSigned(value);
85
- }, "isSignedTransactionBoundWitness");
86
- var isSigned = /* @__PURE__ */ __name((value) => isBoundWitness(value) && value.$signatures.length === value.addresses.length && value.addresses.length > 0, "isSigned");
87
94
  var isTransactionBoundWitnessWithStorageMeta = /* @__PURE__ */ __name((value) => isTransactionBoundWitness(value) && isStorageMeta(value), "isTransactionBoundWitnessWithStorageMeta");
88
- var isSignedTransactionBoundWitnessWithStorageMeta = /* @__PURE__ */ __name((value) => isSignedTransactionBoundWitness(value) && isStorageMeta(value), "isSignedTransactionBoundWitnessWithStorageMeta");
89
95
  var asTransactionBoundWitness = AsObjectFactory4.create(isTransactionBoundWitness);
90
96
  var asOptionalTransactionBoundWitness = AsObjectFactory4.createOptional(isTransactionBoundWitness);
91
97
  var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.create(isTransactionBoundWitnessWithStorageMeta);
92
98
  var asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.createOptional(isTransactionBoundWitnessWithStorageMeta);
93
99
 
94
- // src/protocol/AllowedBlockPayload.ts
100
+ // src/block/AllowedBlockPayload.ts
95
101
  var AllowedBlockPayloadSchemas = [
96
102
  TransferSchema,
97
103
  ChainStakeIntentSchema,
@@ -109,7 +115,7 @@ var isAllowedBlockPayloadWithHashStorageMeta = /* @__PURE__ */ __name((value) =>
109
115
  return isAllowedBlockPayload(value) && isHashStorageMeta(value);
110
116
  }, "isAllowedBlockPayloadWithHashStorageMeta");
111
117
 
112
- // src/protocol/BlockBoundWitness.ts
118
+ // src/block/BlockBoundWitness.ts
113
119
  import { isHex } from "@xylabs/hex";
114
120
  import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
115
121
  import { isBoundWitness as isBoundWitness2 } from "@xyo-network/boundwitness-model";
@@ -126,52 +132,29 @@ var asOptionalBlockBoundWitness = AsObjectFactory5.createOptional(isBlockBoundWi
126
132
  var asBlockBoundWitnessWithStorageMeta = AsObjectFactory5.create(isBlockBoundWitnessWithStorageMeta);
127
133
  var asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory5.createOptional(isBlockBoundWitnessWithStorageMeta);
128
134
 
129
- // src/protocol/BlockNumber.ts
130
- import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
131
- import { isPayloadOfSchemaType as isPayloadOfSchemaType5, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
132
- var BlockNumberSchema = "network.xyo.chain.block.number";
133
- var isBlockNumber = isPayloadOfSchemaType5(BlockNumberSchema);
134
- var asBlockNumber = AsObjectFactory6.create(isBlockNumber);
135
- var asOptionalBlockNumber = AsObjectFactory6.createOptional(isBlockNumber);
136
- var isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources(BlockNumberSchema);
137
- var asBlockNumberWithSources = AsObjectFactory6.create(isBlockNumberWithSources);
138
- var asOptionalBlockNumberWithSources = AsObjectFactory6.createOptional(isBlockNumberWithSources);
139
-
140
- // src/protocol/Steps.ts
141
- var StepSizes = [
142
- 10,
143
- 105,
144
- 1103,
145
- 11576,
146
- 121551,
147
- 1276282,
148
- 13400956
149
- ];
150
-
151
135
  // src/services/Chain/ChainIdentification.ts
152
- import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
136
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
153
137
  var ChainIdentificationPayloadSchema = "network.xyo.chain.identification";
154
- var isChainIdentificationPayload = isPayloadOfSchemaType6(ChainIdentificationPayloadSchema);
138
+ var isChainIdentificationPayload = isPayloadOfSchemaType5(ChainIdentificationPayloadSchema);
155
139
 
156
140
  // src/services/Chain/ChainInformation.ts
157
- import { isPayloadOfSchemaType as isPayloadOfSchemaType7 } from "@xyo-network/payload-model";
141
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
158
142
  var ChainInformationPayloadSchema = "network.xyo.chain.information";
159
- var isChainInformationPayload = isPayloadOfSchemaType7(ChainInformationPayloadSchema);
143
+ var isChainInformationPayload = isPayloadOfSchemaType6(ChainInformationPayloadSchema);
160
144
 
161
145
  // src/services/stakeIntent/ChainIndexingServiceStateSchema.ts
162
- import { AsObjectFactory as AsObjectFactory7 } from "@xylabs/object";
163
- import { isPayloadOfSchemaType as isPayloadOfSchemaType8, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
146
+ import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
147
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType7, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
164
148
  var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
165
149
  var isChainIndexingServiceState = /* @__PURE__ */ __name((payload) => {
166
- return isPayloadOfSchemaType8(ChainIndexingServiceStateSchema)(payload);
150
+ return isPayloadOfSchemaType7(ChainIndexingServiceStateSchema)(payload);
167
151
  }, "isChainIndexingServiceState");
168
- var asChainIndexingServiceState = AsObjectFactory7.create(isChainIndexingServiceState);
152
+ var asChainIndexingServiceState = AsObjectFactory6.create(isChainIndexingServiceState);
169
153
  var isChainIndexingServiceStateWithStorageMeta = /* @__PURE__ */ __name((value) => isChainIndexingServiceState(value) && isStorageMeta3(value), "isChainIndexingServiceStateWithStorageMeta");
170
- var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.create(isChainIndexingServiceStateWithStorageMeta);
171
- var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory7.createOptional(isChainIndexingServiceStateWithStorageMeta);
154
+ var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.create(isChainIndexingServiceStateWithStorageMeta);
155
+ var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.createOptional(isChainIndexingServiceStateWithStorageMeta);
172
156
  export {
173
157
  AllowedBlockPayloadSchemas,
174
- BlockNumberSchema,
175
158
  ChainIdentificationPayloadSchema,
176
159
  ChainIndexingServiceStateSchema,
177
160
  ChainInformationPayloadSchema,
@@ -183,8 +166,6 @@ export {
183
166
  TransferSchema,
184
167
  asBlockBoundWitness,
185
168
  asBlockBoundWitnessWithStorageMeta,
186
- asBlockNumber,
187
- asBlockNumberWithSources,
188
169
  asChainIndexingServiceState,
189
170
  asChainIndexingServiceStateWithStorageMeta,
190
171
  asChainStakeIntent,
@@ -193,16 +174,10 @@ export {
193
174
  asHashPayloadWithStorageMeta,
194
175
  asOptionalBlockBoundWitness,
195
176
  asOptionalBlockBoundWitnessWithStorageMeta,
196
- asOptionalBlockNumber,
197
- asOptionalBlockNumberWithSources,
198
177
  asOptionalChainIndexingServiceStateWithStorageMeta,
199
178
  asOptionalChainStakeIntent,
200
179
  asOptionalHashPayload,
201
- asOptionalTransactionBoundWitness,
202
- asOptionalTransactionBoundWitnessWithStorageMeta,
203
180
  asOptionalTransfer,
204
- asTransactionBoundWitness,
205
- asTransactionBoundWitnessWithStorageMeta,
206
181
  asTransfer,
207
182
  getDefaultGasConfig,
208
183
  hasFrom,
@@ -211,8 +186,6 @@ export {
211
186
  isAllowedBlockPayloadWithHashStorageMeta,
212
187
  isBlockBoundWitness,
213
188
  isBlockBoundWitnessWithStorageMeta,
214
- isBlockNumber,
215
- isBlockNumberWithSources,
216
189
  isChainIdentificationPayload,
217
190
  isChainIndexingServiceState,
218
191
  isChainIndexingServiceStateWithStorageMeta,
@@ -221,11 +194,6 @@ export {
221
194
  isExecutable,
222
195
  isHashPayload,
223
196
  isNetworkStatus,
224
- isSigned,
225
- isSignedTransactionBoundWitness,
226
- isSignedTransactionBoundWitnessWithStorageMeta,
227
- isTransactionBoundWitness,
228
- isTransactionBoundWitnessWithStorageMeta,
229
197
  isTransfer,
230
198
  toEthAddress
231
199
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ethereum.ts","../../src/network/Status.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/protocol/AllowedBlockPayload.ts","../../src/protocol/TransactionBoundWitness.ts","../../src/protocol/BlockBoundWitness.ts","../../src/protocol/BlockNumber.ts","../../src/protocol/Steps.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["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 { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../protocol/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 { 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 './TransactionBoundWitness.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 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 {\n FromFields,\n OptionalExecutable,\n} from '../payload/index.ts'\nimport type { BlockDuration } from './BlockDuration.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","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\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"],"mappings":";;;;AACA,SAASA,aAAa;AAEtB,SAASC,kBAAkB;AAC3B,SAASC,kBAAkB;AAOpB,IAAMC,sBAAsB,6BAAA;AACjC,SAAO;IACLC,UAAU;IACVC,UAAUC,WAAW,OAAO,MAAA;EAC9B;AACF,GALmC;AAS5B,IAAMC,mBAA+B;AAErC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,QAAMC,UAAW,OAAOD,UAAU,WAAYA,MAAMC,UAAUD;AAC9D,SAAOE,WAAWC,MAAMF,SAAS;IAAEG,QAAQ;IAAMC,WAAW;EAAI,CAAA,CAAA;AAClE,GAH4B;;;ACrB5B,SAASC,6BAA6B;AAE/B,IAAMC,sBAAsB;AAmB5B,IAAMC,kBAAkBF,sBAAqCC,mBAAAA;;;ACtBpE,SAASE,uBAAuB;AAEhC,SAASC,yBAAAA,8BAA6B;AAK/B,IAAMC,yBAAyB;AAc/B,IAAMC,qBAAqB,wBAACC,MAAAA;AACjC,SAAOC,uBAAwCH,sBAAAA,EAAwBE,CAAAA,KAClEE,qBAAqBF,EAAEG,GAAG,MAAMC,UAChCF,qBAAqBF,EAAEK,GAAG,MAAMD;AACvC,GAJkC;AAK3B,IAAME,qBAAqBC,gBAAgBC,OAAOT,kBAAAA;AAClD,IAAMU,6BAA6BF,gBAAgBG,eAAeX,kBAAAA;AAEzE,IAAMG,uBAAuB,wBAACS,QAAAA;AAC5B,SAAQC,OAAOC,UAAUF,GAAAA,KA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AAA;AAEjG,IAAMM,6CACX,wBAAkCC,UAClCP,4BAA+BO,KAAAA,KAAUC,eAAcD,KAAAA,GADvD;AAGK,IAAME,6CACXL,iBAAgBC,OAAmDC,0CAAAA;AAE9D,IAAMI,qDACXN,iBAAgBO,eAA2DL,0CAAAA;","names":["toHex","getAddress","parseUnits","getDefaultGasConfig","gasLimit","gasPrice","parseUnits","ETH_ZERO_ADDRESS","toEthAddress","value","address","getAddress","toHex","prefix","bitLength","isPayloadOfSchemaType","NetworkStatusSchema","isNetworkStatus","AsObjectFactory","isPayloadOfSchemaType","ChainStakeIntentSchema","isChainStakeIntent","x","isPayloadOfSchemaType","asNonNegativeInteger","nbf","undefined","exp","asChainStakeIntent","AsObjectFactory","create","asOptionalChainStakeIntent","createOptional","num","Number","isInteger","isAnyPayload","hasFrom","value","from","undefined","isExecutable","isAnyPayload","Array","isArray","script","asExecutable","AsObjectFactory","isPayloadOfSchemaType","HashSchema","isHashPayload","asHashPayload","create","asHashPayloadWithStorageMeta","asOptionalHashPayload","createOptional","AsObjectFactory","isPayloadOfSchemaType","TransferSchema","isTransfer","asTransfer","create","asOptionalTransfer","createOptional","BoundWitnessSchema","isHashStorageMeta","isSchema","isSchemaPayload","SchemaSchema","AsObjectFactory","isBoundWitness","isStorageMeta","isTransactionBoundWitness","value","typedObj","isBoundWitness","chain","undefined","fees","exp","nbf","isSignedTransactionBoundWitness","isSigned","$signatures","length","addresses","isTransactionBoundWitnessWithStorageMeta","isStorageMeta","isSignedTransactionBoundWitnessWithStorageMeta","asTransactionBoundWitness","AsObjectFactory","create","asOptionalTransactionBoundWitness","createOptional","asTransactionBoundWitnessWithStorageMeta","asOptionalTransactionBoundWitnessWithStorageMeta","AllowedBlockPayloadSchemas","TransferSchema","ChainStakeIntentSchema","SchemaSchema","BoundWitnessSchema","HashSchema","isAllowedBlockPayloadSchema","value","isSchema","includes","isAllowedBlockPayload","isTransfer","isChainStakeIntent","isSchemaPayload","isTransactionBoundWitness","isHashPayload","isAllowedBlockPayloadWithHashStorageMeta","isHashStorageMeta","isHex","AsObjectFactory","isBoundWitness","isStorageMeta","isBlockBoundWitness","value","typedObj","isBoundWitness","Number","isInteger","block","isHex","chain","isBlockBoundWitnessWithStorageMeta","isStorageMeta","asBlockBoundWitness","AsObjectFactory","create","asOptionalBlockBoundWitness","createOptional","asBlockBoundWitnessWithStorageMeta","asOptionalBlockBoundWitnessWithStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","BlockNumberSchema","isBlockNumber","asBlockNumber","create","asOptionalBlockNumber","createOptional","isBlockNumberWithSources","asBlockNumberWithSources","asOptionalBlockNumberWithSources","StepSizes","isPayloadOfSchemaType","ChainIdentificationPayloadSchema","isChainIdentificationPayload","isPayloadOfSchemaType","ChainInformationPayloadSchema","isChainInformationPayload","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta","ChainIndexingServiceStateSchema","isChainIndexingServiceState","payload","isPayloadOfSchemaType","asChainIndexingServiceState","AsObjectFactory","create","isChainIndexingServiceStateWithStorageMeta","value","isStorageMeta","asChainIndexingServiceStateWithStorageMeta","asOptionalChainIndexingServiceStateWithStorageMeta","createOptional"]}
1
+ {"version":3,"sources":["../../src/ethereum.ts","../../src/network/Status.ts","../../src/Steps.ts","../../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/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["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","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n","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 {\n FromFields,\n OptionalExecutable,\n} from '#payload'\n\nimport type { BlockDuration } from '../BlockDuration.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 { 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"],"mappings":";;;;AACA,SAASA,aAAa;AAEtB,SAASC,kBAAkB;AAC3B,SAASC,kBAAkB;AAOpB,IAAMC,sBAAsB,6BAAA;AACjC,SAAO;IACLC,UAAU;IACVC,UAAUC,WAAW,OAAO,MAAA;EAC9B;AACF,GALmC;AAS5B,IAAMC,mBAA+B;AAErC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,QAAMC,UAAW,OAAOD,UAAU,WAAYA,MAAMC,UAAUD;AAC9D,SAAOE,WAAWC,MAAMF,SAAS;IAAEG,QAAQ;IAAMC,WAAW;EAAI,CAAA,CAAA;AAClE,GAH4B;;;ACrB5B,SAASC,6BAA6B;AAE/B,IAAMC,sBAAsB;AAmB5B,IAAMC,kBAAkBF,sBAAqCC,mBAAAA;;;ACtB7D,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BAAsB;AAE/B,SAASC,iBAAAA,sBAAqB;AAqBvB,IAAMC,sBAAsB,wBAACC,UAAAA;AAClC,QAAMC,WAAWD;AACjB,SAAOE,gBAAeF,KAAAA,KACjBG,OAAOC,UAAUH,SAASI,KAAK,KAC/BC,MAAML,SAASM,KAAK;AAC3B,GALmC;AAO5B,IAAMC,qCAAqC,wBAACR,UAAAA;AACjD,SAAOD,oBAAoBC,KAAAA,KAAUS,eAAcT,KAAAA;AACrD,GAFkD;AAI3C,IAAMU,sBAAsBC,iBAAgBC,OAAOb,mBAAAA;AACnD,IAAMc,8BAA8BF,iBAAgBG,eAAef,mBAAAA;AAEnE,IAAMgB,qCAAqCJ,iBAAgBC,OAAOJ,kCAAAA;AAClE,IAAMQ,6CAA6CL,iBAAgBG,eAAeN,kCAAAA;;;ACxCzF,SAASS,yBAAAA,8BAA6B;AAE/B,IAAMC,mCAAmC;AAYzC,IAAMC,+BAA+BF,uBAAkDC,gCAAAA;;;ACf9F,SAASE,yBAAAA,8BAA6B;AAE/B,IAAMC,gCAAgC;AAgBtC,IAAMC,4BAA4BF,uBAA+CC,6BAAAA;;;ACjBxF,SAASE,mBAAAA,wBAAuB;AAEhC,SAASC,yBAAAA,wBAAuBC,iBAAAA,sBAAqB;AAiB9C,IAAMC,kCAAkC;AAWxC,IAAMC,8BAA8B,wBAAkCC,YAAAA;AAC3E,SAAOC,uBAAoDH,+BAAAA,EAAiCE,OAAAA;AAC9F,GAF2C;AAGpC,IAAME,8BAA8BC,iBAAgBC,OAA6CL,2BAAAA;AAEjG,IAAMM,6CACX,wBAAkCC,UAClCP,4BAA+BO,KAAAA,KAAUC,eAAcD,KAAAA,GADvD;AAGK,IAAME,6CACXL,iBAAgBC,OAAmDC,0CAAAA;AAE9D,IAAMI,qDACXN,iBAAgBO,eAA2DL,0CAAAA;","names":["toHex","getAddress","parseUnits","getDefaultGasConfig","gasLimit","gasPrice","parseUnits","ETH_ZERO_ADDRESS","toEthAddress","value","address","getAddress","toHex","prefix","bitLength","isPayloadOfSchemaType","NetworkStatusSchema","isNetworkStatus","StepSizes","BoundWitnessSchema","isHashStorageMeta","isSchema","isSchemaPayload","SchemaSchema","AsObjectFactory","isPayloadOfSchemaType","ChainStakeIntentSchema","isChainStakeIntent","x","isPayloadOfSchemaType","asNonNegativeInteger","nbf","undefined","exp","asChainStakeIntent","AsObjectFactory","create","asOptionalChainStakeIntent","createOptional","num","Number","isInteger","isAnyPayload","hasFrom","value","from","undefined","isExecutable","isAnyPayload","Array","isArray","script","asExecutable","AsObjectFactory","isPayloadOfSchemaType","HashSchema","isHashPayload","asHashPayload","create","asHashPayloadWithStorageMeta","asOptionalHashPayload","createOptional","AsObjectFactory","isPayloadOfSchemaType","TransferSchema","isTransfer","asTransfer","create","asOptionalTransfer","createOptional","AsObjectFactory","isBoundWitness","isStorageMeta","isTransactionBoundWitness","value","typedObj","isBoundWitness","chain","undefined","fees","exp","nbf","isTransactionBoundWitnessWithStorageMeta","value","isTransactionBoundWitness","isStorageMeta","asTransactionBoundWitness","AsObjectFactory","create","isTransactionBoundWitness","asOptionalTransactionBoundWitness","createOptional","asTransactionBoundWitnessWithStorageMeta","isTransactionBoundWitnessWithStorageMeta","asOptionalTransactionBoundWitnessWithStorageMeta","AllowedBlockPayloadSchemas","TransferSchema","ChainStakeIntentSchema","SchemaSchema","BoundWitnessSchema","HashSchema","isAllowedBlockPayloadSchema","value","isSchema","includes","isAllowedBlockPayload","isTransfer","isChainStakeIntent","isSchemaPayload","isTransactionBoundWitness","isHashPayload","isAllowedBlockPayloadWithHashStorageMeta","isHashStorageMeta","isHex","AsObjectFactory","isBoundWitness","isStorageMeta","isBlockBoundWitness","value","typedObj","isBoundWitness","Number","isInteger","block","isHex","chain","isBlockBoundWitnessWithStorageMeta","isStorageMeta","asBlockBoundWitness","AsObjectFactory","create","asOptionalBlockBoundWitness","createOptional","asBlockBoundWitnessWithStorageMeta","asOptionalBlockBoundWitnessWithStorageMeta","isPayloadOfSchemaType","ChainIdentificationPayloadSchema","isChainIdentificationPayload","isPayloadOfSchemaType","ChainInformationPayloadSchema","isChainInformationPayload","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta","ChainIndexingServiceStateSchema","isChainIndexingServiceState","payload","isPayloadOfSchemaType","asChainIndexingServiceState","AsObjectFactory","create","isChainIndexingServiceStateWithStorageMeta","value","isStorageMeta","asChainIndexingServiceStateWithStorageMeta","asOptionalChainIndexingServiceStateWithStorageMeta","createOptional"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockDuration.d.ts","sourceRoot":"","sources":["../../src/BlockDuration.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;CAAG;AAExF;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU,EAAE,QAAQ;CAAG"}
@@ -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
8
  import type { ChainIteratorEventData } from './ChainIteratorEventData.ts';
6
- import type { BlockBoundWitness } from './protocol/index.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>;